From: jeresig Date: Tue, 21 Sep 2010 12:31:55 +0000 (-0400) Subject: Switch to using isNaN instead of RegExp for data-. X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=8ebb9b22df32fe5739a48087b6e33abb9f5cda49 Switch to using isNaN instead of RegExp for data-. --- diff --git a/src/data.js b/src/data.js index dc08a56..295ea79 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 ) {}