diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core.js b/src/core.js index 54b44b1ea..83d427c78 100644 --- a/src/core.js +++ b/src/core.js @@ -212,7 +212,12 @@ jQuery.extend( { noop: function() {}, isFunction: function( obj ) { - return jQuery.type( obj ) === "function"; + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML <object> elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; }, isWindow: function( obj ) { @@ -464,7 +469,7 @@ function isArrayLike( obj ) { var length = !!obj && "length" in obj && obj.length, type = jQuery.type( obj ); - if ( type === "function" || jQuery.isWindow( obj ) ) { + if ( jQuery.isFunction( obj ) || jQuery.isWindow( obj ) ) { return false; } |