From: Oleg Gaidarenko Date: Tue, 22 Dec 2015 13:24:23 +0000 (+0300) Subject: Revert "Data: camelCasing should not ignore case" X-Git-Tag: 1.12.0~55 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4e0c67d6df9b5b909a3973633dfb725b3ba165cc;p=jquery.git Revert "Data: camelCasing should not ignore case" This reverts commit cf16f860b05b7bffeb2382a0a55bb85c69b2abb5. --- diff --git a/src/core.js b/src/core.js index 4a1820b3d..6ba437662 100644 --- a/src/core.js +++ b/src/core.js @@ -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 ) { diff --git a/test/unit/data.js b/test/unit/data.js index 0ccd8c96c..b78b43090 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -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( "
" ).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",