aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.js
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-09-21 08:31:55 -0400
committerjeresig <jeresig@gmail.com>2010-09-21 08:31:55 -0400
commit8ebb9b22df32fe5739a48087b6e33abb9f5cda49 (patch)
tree13cb6063cc70b64cb84d58b085404d910a3a7749 /src/data.js
parente0b24306a86629f02576017f25d295fbe07f21a5 (diff)
downloadjquery-8ebb9b22df32fe5739a48087b6e33abb9f5cda49.tar.gz
jquery-8ebb9b22df32fe5739a48087b6e33abb9f5cda49.zip
Switch to using isNaN instead of RegExp for data-.
Diffstat (limited to 'src/data.js')
-rw-r--r--src/data.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/data.js b/src/data.js
index dc08a563a..295ea794a 100644
--- a/src/data.js
+++ b/src/data.js
@@ -1,7 +1,6 @@
(function( jQuery ) {
var windowData = {},
- rnum = /^-?\d+(?:\.\d+)?(?:E\d+)?$/,
rbrace = /^(?:{.*}|\[.*\])$/;
jQuery.extend({
@@ -158,7 +157,7 @@ jQuery.fn.extend({
data = data === "true" ? true :
data === "false" ? false :
data === "null" ? null :
- rnum.test( data ) ? parseFloat( data ) :
+ !isNaN( data ) ? parseFloat( data ) :
rbrace.test( data ) ? jQuery.parseJSON( data ) :
data;
} catch( e ) {}