Add isObject check to getNative.

This commit is contained in:
jdalton
2015-05-15 01:29:17 -07:00
parent de4f5eb2ca
commit b25cd39953

View File

@@ -4105,7 +4105,10 @@
* @returns {*} Returns the function if it's native, else `undefined`.
*/
function getNative(object, key) {
var value = object == null ? undefined : object[key];
if (!isObject(object)) {
return;
}
var value = object[key];
if (isNative(value)) {
return value;
}