File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -214,7 +214,8 @@ jQuery.extend( {
214214 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
215215 // subtraction forces infinities to NaN
216216 // 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 ;
218219 } ,
219220
220221 isPlainObject : function ( obj ) {
Original file line number Diff line number Diff line change @@ -490,6 +490,13 @@ QUnit.test( "isNumeric", function( assert ) {
490490 assert . equal ( t ( new Date ( ) ) , false , "Instance of a Date" ) ;
491491} ) ;
492492
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+
493500QUnit . test ( "isXMLDoc - HTML" , function ( assert ) {
494501 assert . expect ( 4 ) ;
495502
You can’t perform that action at this time.
0 commit comments