Skip to content

Commit

Permalink
Core: Warn against jQuery.isArray in jQuery >=3.2, not 3.3
Browse files Browse the repository at this point in the history
The API was deprecated in jQuery 3.2 so when jQuery 3.2
is used the deprecation message should be printed.

Fixes jquerygh-370
Closes jquerygh-375
  • Loading branch information
ildar-aim authored Aug 31, 2020
1 parent e9a11f7 commit 668042f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/jquery/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ if ( jQueryVersionSince( "3.2.0" ) ) {
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
},
"jQuery.nodeName is deprecated" );

migrateWarnFunc( jQuery, "isArray", Array.isArray,
"jQuery.isArray is deprecated; use Array.isArray"
);
}

if ( jQueryVersionSince( "3.3.0" ) ) {
Expand Down Expand Up @@ -157,8 +161,4 @@ if ( jQueryVersionSince( "3.3.0" ) ) {
},
"jQuery.isWindow() is deprecated"
);

migrateWarnFunc( jQuery, "isArray", Array.isArray,
"jQuery.isArray is deprecated; use Array.isArray"
);
}
2 changes: 1 addition & 1 deletion test/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ QUnit[ jQueryVersionSince( "3.3.0" ) ? "test" : "skip" ]( "jQuery.type (warn)",

} );

QUnit[ jQueryVersionSince( "3.3.0" ) ? "test" : "skip" ]( "jQuery.isArray", function( assert ) {
QUnit[ jQueryVersionSince( "3.2.0" ) ? "test" : "skip" ]( "jQuery.isArray", function( assert ) {
assert.expect( 4 );

expectWarning( assert, "isArray", 3, function() {
Expand Down

0 comments on commit 668042f

Please sign in to comment.