diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2013-05-02 16:35:22 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2013-05-02 16:35:22 -0400 |
commit | 2406b5e290c1364c0a58832e0bbf4bcf82abfe10 (patch) | |
tree | a1da1c4026fd3318a7ff0cefbbfa152bdd328a0c /src | |
parent | e8b110c646754ffd6f5ee418d7c2ddf4190f9704 (diff) | |
download | jquery-2406b5e290c1364c0a58832e0bbf4bcf82abfe10.tar.gz jquery-2406b5e290c1364c0a58832e0bbf4bcf82abfe10.zip |
Fixes #13850. Better removal of hyphenated data property names.
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/data.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/data.js b/src/data.js index 344dae25f..a9b451788 100644 --- a/src/data.js +++ b/src/data.js @@ -142,7 +142,7 @@ Data.prototype = { return value !== undefined ? value : key; }, remove: function( owner, key ) { - var i, name, + var i, name, camel, unlock = this.key( owner ), cache = this.cache[ unlock ]; @@ -160,13 +160,14 @@ Data.prototype = { // This will only penalize the array argument path. name = key.concat( key.map( jQuery.camelCase ) ); } else { + camel = jQuery.camelCase( key ); // Try the string as a key before any manipulation if ( key in cache ) { - name = [ key ]; + name = [ key, camel ]; } else { // If a key with the spaces exists, use it. // Otherwise, create an array by matching non-whitespace - name = jQuery.camelCase( key ); + name = camel; name = name in cache ? [ name ] : ( name.match( core_rnotwhite ) || [] ); } |