diff options
author | John Resig <jeresig@gmail.com> | 2011-05-10 11:56:42 -0400 |
---|---|---|
committer | John Resig <jeresig@gmail.com> | 2011-05-10 11:56:42 -0400 |
commit | a5e407cafb9d398b5bf2f209ad0e8a42691bf391 (patch) | |
tree | 84ae0db76ba289044c0e103d23edc75f511bb3e3 /src/data.js | |
parent | 419b5e5e2a0d376e71c3f37bf9a3d96f3b4a67f2 (diff) | |
download | jquery-a5e407cafb9d398b5bf2f209ad0e8a42691bf391.tar.gz jquery-a5e407cafb9d398b5bf2f209ad0e8a42691bf391.zip |
Make sure that data properties with hyphens are always accessed/set using camelCase. Fixes #9124.
Diffstat (limited to 'src/data.js')
-rw-r--r-- | src/data.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/data.js b/src/data.js index 9e5d1ab0b..c019a64e2 100644 --- a/src/data.js +++ b/src/data.js @@ -98,7 +98,7 @@ jQuery.extend({ } if ( data !== undefined ) { - thisCache[ name ] = data; + thisCache[ jQuery.camelCase( name ) ] = data; } // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should @@ -108,7 +108,7 @@ jQuery.extend({ return thisCache[ internalKey ] && thisCache[ internalKey ].events; } - return getByName ? thisCache[ name ] : thisCache; + return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache; }, removeData: function( elem, name, pvt /* Internal Use Only */ ) { |