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 @@ -221,7 +221,8 @@ jQuery.extend( {
221221 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
222222 // subtraction forces infinities to NaN
223223 // adding 1 corrects loss of precision from parseFloat (#15100)
224- return ! jQuery . isArray ( obj ) && ( obj - parseFloat ( obj ) + 1 ) >= 0 ;
224+ var realStringObj = obj && obj . toString ( ) ;
225+ return ! jQuery . isArray ( obj ) && ( realStringObj - parseFloat ( realStringObj ) + 1 ) >= 0 ;
225226 } ,
226227
227228 isEmptyObject : function ( obj ) {
Original file line number Diff line number Diff line change @@ -504,6 +504,13 @@ QUnit.test( "isNumeric", function( assert ) {
504504 assert . equal ( t ( new Date ( ) ) , false , "Instance of a Date" ) ;
505505} ) ;
506506
507+ QUnit [ typeof Symbol === "function" ? "test" : "skip" ] ( "isNumeric(Symbol)" , function ( assert ) {
508+ assert . expect ( 2 ) ;
509+
510+ assert . equal ( jQuery . isNumeric ( Symbol ( ) ) , false , "Symbol" ) ;
511+ assert . equal ( jQuery . isNumeric ( Object ( Symbol ( ) ) ) , false , "Symbol inside an object" ) ;
512+ } ) ;
513+
507514QUnit . test ( "isXMLDoc - HTML" , function ( assert ) {
508515 assert . expect ( 4 ) ;
509516
You can’t perform that action at this time.
0 commit comments