Add comments to _.isFunction. [ci skip]

This commit is contained in:
John-David Dalton
2014-11-09 00:02:00 -08:00
parent 1b842f86ca
commit 4d69a0ce29

View File

@@ -7377,9 +7377,13 @@
// https://github.com/jashkenas/underscore/issues/1621
return typeof value == 'function' || false;
}
// fallback for older versions of Chrome and Safari
// fallback for environments that return incorrect `typeof` operator results
if (isFunction(/x/) || !Uint8Array || !isFunction(Uint8Array)) {
isFunction = function(value) {
// the use of `Object#toString` avoids issues with the `typeof` operator
// in older versions of Chrome and Safari which return 'function' for
// regexes and modern Safari which returns 'object' for typed array
// constructors
return toString.call(value) == funcClass;
};
}