From: Mike Sidorov Date: Mon, 15 Dec 2014 08:06:09 +0000 (+0500) Subject: Data: shave off a couple of bytes X-Git-Tag: 3.0.0-alpha1~164 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6f65f5faf2b5831414d4c93d271a59265b41a75b;p=jquery.git Data: shave off a couple of bytes Closes gh-1931 --- diff --git a/src/data.js b/src/data.js index 21329defa..be80a1e38 100644 --- a/src/data.js +++ b/src/data.js @@ -1,10 +1,9 @@ define([ "./core", - "./var/rnotwhite", "./core/access", "./data/var/dataPriv", "./data/var/dataUser" -], function( jQuery, rnotwhite, access, dataPriv, dataUser ) { +], function( jQuery, access, dataPriv, dataUser ) { // Implementation Summary // @@ -17,7 +16,7 @@ define([ // 6. Provide a clear path for implementation upgrade to WeakMap in 2014 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, - rmultiDash = /([A-Z])/g; + rmultiDash = /[A-Z]/g; function dataAttr( elem, key, data ) { var name; @@ -25,7 +24,7 @@ function dataAttr( elem, key, data ) { // If nothing was found internally, try to fetch any // data from the HTML5 data-* attribute if ( data === undefined && elem.nodeType === 1 ) { - name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); data = elem.getAttribute( name ); if ( typeof data === "string" ) {