]> source.dussan.org Git - jquery.git/commitdiff
Revert "Data: camelCasing should not ignore case"
authorOleg Gaidarenko <markelog@gmail.com>
Tue, 22 Dec 2015 13:24:23 +0000 (16:24 +0300)
committerOleg Gaidarenko <markelog@gmail.com>
Tue, 22 Dec 2015 13:24:23 +0000 (16:24 +0300)
This reverts commit cf16f860b05b7bffeb2382a0a55bb85c69b2abb5.

src/core.js
test/unit/data.js

index 4a1820b3d38b1deaa23bcfb932f7fe7f430fe330..6ba437662b4c7e8f498e28ed20985b8638d04766 100644 (file)
@@ -29,7 +29,7 @@ var
 
        // Matches dashed string for camelizing
        rmsPrefix = /^-ms-/,
-       rdashAlpha = /-([a-z])/g,
+       rdashAlpha = /-([a-z])/gi,
 
        // Used by jQuery.camelCase as callback to replace()
        fcamelCase = function( all, letter ) {
index 0ccd8c96c1eeaa369754a93ef7bd6e64e6358532..b78b4309023efba1a4d947e0ce3d3b49195ce5c2 100644 (file)
@@ -882,25 +882,6 @@ QUnit.test( ".data always sets data with the camelCased key (gh-2257)", function
        } );
 } );
 
-QUnit.test(
-       ".data should not strip more than one hyphen when camelCasing (gh-2070)",
-       function( assert ) {
-               assert.expect( 3 );
-               var div = jQuery( "<div data-nested-single='single' data-nested--double='double' data-nested---triple='triple'></div>" ).appendTo( "#qunit-fixture" ),
-                       allData = div.data();
-
-               assert.equal(
-                       allData.nestedSingle, "single", "Key is correctly camelCased"
-               );
-               assert.equal(
-                       allData[ "nested-Double" ], "double", "Key with double hyphens is correctly camelCased"
-               );
-               assert.equal(
-                       allData[ "nested--Triple" ], "triple", "Key with triple hyphens is correctly camelCased"
-               );
-       }
-);
-
 QUnit.test(
        ".data supports interoperable hyphenated/camelCase get/set of" +
        " properties with arbitrary non-null|NaN|undefined values",