Brute force property removal when removeData([a,b,c]). Fixes #12786

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
Rick Waldron
2012-10-24 14:12:28 -04:00
parent 2eff7fe72d
commit 812c6087ad
2 changed files with 78 additions and 0 deletions

View File

@@ -136,6 +136,14 @@ function internalRemoveData( elem, name, pvt /* For internal use only */ ){
name = name.split(" ");
}
}
} else {
// If "name" is an array of keys...
// When data is initially created, via ("key", "val") signature,
// keys will be converted to camelCase.
// Since there is no way to tell _how_ a key was added, remove
// both plain key and camelCase key. #12786
// This will only penalize the array argument path.
name = name.concat( jQuery.map( name, jQuery.camelCase ) );
}
for ( i = 0, l = name.length; i < l; i++ ) {