aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiza Ramo <liza.h.ramo@gmail.com>2015-10-17 16:48:57 -0400
committerRichard Gibson <richard.gibson@gmail.com>2015-10-25 14:12:53 -0400
commitd846c25dca4adeb4262f98957f1b887fe6b29912 (patch)
tree7ae5fde71f50e402d5b9fb73d356c27a0a7ee35b /src
parent20cd34384d6908e0280cea9b69e09f065c4e4003 (diff)
downloadjquery-d846c25dca4adeb4262f98957f1b887fe6b29912.tar.gz
jquery-d846c25dca4adeb4262f98957f1b887fe6b29912.zip
Core: make isNumeric test work on Symbol
Ref #2645 Closes #2657 (cherry picked from commit 0703fd52ef88a2cdac93502070c51c93ffa1dfdd)
Diffstat (limited to 'src')
-rw-r--r--src/core.js3
1 files changed, 2 insertions, 1 deletions
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 ) {