From: Oleg Gaidarenko Date: Fri, 13 Nov 2015 12:00:47 +0000 (+0300) Subject: Revert "Data: camelCasing should not ignore case" X-Git-Tag: 2.2.0~49 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=41ebc4096dbc92b93875deb8b10f03e08379a0cd;p=jquery.git Revert "Data: camelCasing should not ignore case" This reverts commit 172cad80ac635d8900aa6a3504c89f38b320488e. --- diff --git a/src/core.js b/src/core.js index 9095213eb..0adb67063 100644 --- a/src/core.js +++ b/src/core.js @@ -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 ) { diff --git a/test/unit/data.js b/test/unit/data.js index 31c6a6174..abd01e92e 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -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( "
" ).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( "
", { id: "hyphened" } ).appendTo( "#qunit-fixture" ), datas = { "non-empty": "a string",