mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Core: Update isFunction to handle unusual-@@toStringTag input
Ref gh-3597 Fixes gh-3600 Fixes gh-3596 Closes gh-3617
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user