From 6f65f5faf2b5831414d4c93d271a59265b41a75b Mon Sep 17 00:00:00 2001 From: Mike Sidorov Date: Mon, 15 Dec 2014 13:06:09 +0500 Subject: [PATCH] Data: shave off a couple of bytes Closes gh-1931 --- src/data.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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" ) { -- 2.39.5