]> source.dussan.org Git - jquery.git/commitdiff
Switch to using isNaN instead of RegExp for data-.
authorjeresig <jeresig@gmail.com>
Tue, 21 Sep 2010 12:31:55 +0000 (08:31 -0400)
committerjeresig <jeresig@gmail.com>
Tue, 21 Sep 2010 12:31:55 +0000 (08:31 -0400)
src/data.js

index dc08a563a95adae9dc0bd99a14b94dd02279aafc..295ea794a51d18807e86a4f862e72f16f8bae57e 100644 (file)
@@ -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 ) {}