Add _.isFunction test for NodeList instances.

This commit is contained in:
Graeme Yeates
2015-07-12 19:12:13 -04:00
committed by John-David Dalton
parent 211a6cc4f1
commit ffd3e17364
2 changed files with 10 additions and 3 deletions

View File

@@ -8187,8 +8187,9 @@
*/
function isFunction(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 Safari 8 which returns 'object' for typed array constructors.
// in older versions of Chrome and Safari which return 'function' for regexes,
// Safari 8 which returns 'object' for typed array constructors, and PhantomJS 1.9
// which returns 'function' for `NodeList` instances.
return isObject(value) && objToString.call(value) == funcTag;
}