Applied the RegExp issues reported by Jeff Robinson here: http://jmrware.com/articles...
[jquery.git] / src / data.js
index 3bd4b97..562834a 100644 (file)
@@ -1,7 +1,8 @@
 (function( jQuery ) {
 
 var windowData = {},
-       rbrace = /^(?:\{.*\}|\[.*\])$/;
+       rbrace = /^(?:\{.*\}|\[.*\])$/,
+       rdigit = /\d/;
 
 jQuery.extend({
        cache: {},
@@ -157,7 +158,7 @@ jQuery.fn.extend({
                                                        data = data === "true" ? true :
                                                                data === "false" ? false :
                                                                data === "null" ? null :
-                                                               /\d/.test( data ) && !isNaN( data ) ? parseFloat( data ) :
+                                                               rdigit.test( data ) && !isNaN( data ) ? parseFloat( data ) :
                                                                rbrace.test( data ) ? jQuery.parseJSON( data ) :
                                                                data;
                                                } catch( e ) {}