diff options
author | jeresig <jeresig@gmail.com> | 2010-09-21 08:31:55 -0400 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-09-21 08:31:55 -0400 |
commit | 8ebb9b22df32fe5739a48087b6e33abb9f5cda49 (patch) | |
tree | 13cb6063cc70b64cb84d58b085404d910a3a7749 /src/data.js | |
parent | e0b24306a86629f02576017f25d295fbe07f21a5 (diff) | |
download | jquery-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.js | 3 |
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 ) {} |