File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,8 @@ jQuery.extend( {
214
214
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
215
215
// subtraction forces infinities to NaN
216
216
// adding 1 corrects loss of precision from parseFloat (#15100)
217
- return ! jQuery . isArray ( obj ) && ( obj - parseFloat ( obj ) + 1 ) >= 0 ;
217
+ var realStringObj = obj && obj . toString ( ) ;
218
+ return ! jQuery . isArray ( obj ) && ( realStringObj - parseFloat ( realStringObj ) + 1 ) >= 0 ;
218
219
} ,
219
220
220
221
isPlainObject : function ( obj ) {
Original file line number Diff line number Diff line change @@ -490,6 +490,13 @@ QUnit.test( "isNumeric", function( assert ) {
490
490
assert . equal ( t ( new Date ( ) ) , false , "Instance of a Date" ) ;
491
491
} ) ;
492
492
493
+ QUnit [ typeof Symbol === "function" ? "test" : "skip" ] ( "isNumeric(Symbol)" , function ( assert ) {
494
+ assert . expect ( 2 ) ;
495
+
496
+ assert . equal ( jQuery . isNumeric ( Symbol ( ) ) , false , "Symbol" ) ;
497
+ assert . equal ( jQuery . isNumeric ( Object ( Symbol ( ) ) ) , false , "Symbol inside an object" ) ;
498
+ } ) ;
499
+
493
500
QUnit . test ( "isXMLDoc - HTML" , function ( assert ) {
494
501
assert . expect ( 4 ) ;
495
502
You can’t perform that action at this time.
0 commit comments