aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.js
diff options
context:
space:
mode:
authorMike Sidorov <mikes.ekb@gmail.com>2014-12-15 13:06:09 +0500
committerOleg Gaidarenko <markelog@gmail.com>2014-12-24 01:44:38 +0300
commit6f65f5faf2b5831414d4c93d271a59265b41a75b (patch)
treeab89b8029072f21083a6e74e618b500bb98b34c8 /src/data.js
parent72c4a067a9def9720a997f23615690970894dc9c (diff)
downloadjquery-6f65f5faf2b5831414d4c93d271a59265b41a75b.tar.gz
jquery-6f65f5faf2b5831414d4c93d271a59265b41a75b.zip
Data: shave off a couple of bytes
Closes gh-1931
Diffstat (limited to 'src/data.js')
-rw-r--r--src/data.js7
1 files 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" ) {