Add getValue helper.

This commit is contained in:
John-David Dalton
2016-05-15 20:57:10 -07:00
parent 346579ac7a
commit 464885a539

View File

@@ -1006,6 +1006,18 @@
return '\\' + stringEscapes[chr];
}
/**
* Gets the value at `key` of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {string} key The key of the property to get.
* @returns {*} Returns the property value.
*/
function getValue(object, key) {
return object[key];
}
/**
* Gets the index at which the first occurrence of `NaN` is found in `array`.
*
@@ -5393,7 +5405,7 @@
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object[key];
var value = getValue(object, key);
return (isMaskable(value) ? baseIsNative : isNative)(value) ? value : undefined;
}