Tweak exit early in _.isFunction.

This commit is contained in:
John-David Dalton
2016-10-10 10:30:01 -07:00
parent 0a0fa58e2d
commit 8f06ea259a

View File

@@ -11638,9 +11638,12 @@
* // => false
*/
function isFunction(value) {
if (!isObject(value)) {
return false;
}
// The use of `Object#toString` avoids issues with the `typeof` operator
// in Safari 9 which returns 'object' for typed array and other constructors.
var tag = isObject(value) ? baseGetTag(value) : '';
// in Safari 9 which returns 'object' for typed arrays and other constructors.
var tag = baseGetTag(value);
return tag == funcTag || tag == genTag || tag == proxyTag;
}