File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -216,7 +216,7 @@ jQuery.extend({
216216 // parseFloat NaNs numeric-cast false positives (null|true|false|"")
217217 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
218218 // subtraction forces infinities to NaN
219- return obj - parseFloat ( obj ) >= 0 ;
219+ return ! jQuery . isArray ( obj ) && obj - parseFloat ( obj ) >= 0 ;
220220 } ,
221221
222222 isPlainObject : function ( obj ) {
Original file line number Diff line number Diff line change @@ -457,7 +457,7 @@ test("isFunction", function() {
457457} ) ;
458458
459459test ( "isNumeric" , function ( ) {
460- expect ( 36 ) ;
460+ expect ( 38 ) ;
461461
462462 var t = jQuery . isNumeric ,
463463 Traditionalists = /** @constructor */ function ( n ) {
@@ -505,6 +505,8 @@ test( "isNumeric", function() {
505505 equal ( t ( Number . NEGATIVE_INFINITY ) , false , "Negative Infinity" ) ;
506506 equal ( t ( rong ) , false , "Custom .toString returning non-number" ) ;
507507 equal ( t ( { } ) , false , "Empty object" ) ;
508+ equal ( t ( [ ] ) , false , "Empty array" ) ;
509+ equal ( t ( [ 42 ] ) , false , "Array with one number" ) ;
508510 equal ( t ( function ( ) { } ) , false , "Instance of a function" ) ;
509511 equal ( t ( new Date ( ) ) , false , "Instance of a Date" ) ;
510512 equal ( t ( function ( ) { } ) , false , "Instance of a function" ) ;
You can’t perform that action at this time.
0 commit comments