]> source.dussan.org Git - jquery.git/commitdiff
Revert "Data: camelCasing should not ignore case"
authorOleg Gaidarenko <markelog@gmail.com>
Fri, 13 Nov 2015 12:00:47 +0000 (15:00 +0300)
committerOleg Gaidarenko <markelog@gmail.com>
Fri, 13 Nov 2015 12:00:47 +0000 (15:00 +0300)
This reverts commit 172cad80ac635d8900aa6a3504c89f38b320488e.

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

index 9095213eb3b7b08722df28ef4f5da5feba74dabf..0adb67063a69905030bc108e2e8ef294fb187a02 100644 (file)
@@ -28,7 +28,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 31c6a6174d4e0cdf018d66d297300b2cb3e6dbbc..abd01e92e112643a304f913dfa5d23e91095577b 100644 (file)
@@ -629,18 +629,7 @@ 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", function( assert ) {
-
+QUnit.test(".data supports interoperable hyphenated/camelCase get/set of properties with arbitrary non-null|NaN|undefined values", function( assert ) {
        var div = jQuery( "<div/>", { id: "hyphened" } ).appendTo( "#qunit-fixture" ),
                datas = {
                        "non-empty": "a string",