Core: make isNumeric test work on Symbol

Ref #2645
Closes #2657
This commit is contained in:
Liza Ramo
2015-10-17 16:48:57 -04:00
committed by Oleg Gaidarenko
parent 44f8239d3f
commit 0703fd52ef
2 changed files with 9 additions and 1 deletions

View File

@@ -214,7 +214,8 @@ jQuery.extend( {
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
// subtraction forces infinities to NaN
// adding 1 corrects loss of precision from parseFloat (#15100)
return !jQuery.isArray( obj ) && ( obj - parseFloat( obj ) + 1 ) >= 0;
var realStringObj = obj && obj.toString();
return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
},
isPlainObject: function( obj ) {