Wrap funcToString call in _.isNative in a try-catch.

This commit is contained in:
John-David Dalton
2016-03-31 09:46:39 -07:00
parent 45953b2ac1
commit ec92292c38

View File

@@ -10838,7 +10838,9 @@
return false; return false;
} }
if (isFunction(value)) { if (isFunction(value)) {
return reIsNative.test(funcToString.call(value)); try {
return reIsNative.test(funcToString.call(value));
} catch (e) {}
} }
return isObjectLike(value) && return isObjectLike(value) &&
(isHostObject(value) ? reIsNative : reIsHostCtor).test(value); (isHostObject(value) ? reIsNative : reIsHostCtor).test(value);