From d846c25dca4adeb4262f98957f1b887fe6b29912 Mon Sep 17 00:00:00 2001 From: Liza Ramo Date: Sat, 17 Oct 2015 16:48:57 -0400 Subject: Core: make isNumeric test work on Symbol Ref #2645 Closes #2657 (cherry picked from commit 0703fd52ef88a2cdac93502070c51c93ffa1dfdd) --- src/core.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/core.js b/src/core.js index 5e0037f19..4a1820b3d 100644 --- a/src/core.js +++ b/src/core.js @@ -221,7 +221,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; }, isEmptyObject: function( obj ) { -- cgit v1.2.3