Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Supports interoperable removal of hyphenated/camelCase properties. Fi…
…xes #9413
- Loading branch information
Showing
1 changed file
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -135,7 +135,12 @@ jQuery.extend({ | ||
return; | ||
} | ||
|
||
var internalKey = jQuery.expando, isNode = elem.nodeType, | ||
var thisCache, | ||
|
||
// Reference to internal data cache key | ||
internalKey = jQuery.expando, | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
rwaldron
Author
Member
|
||
|
||
isNode = elem.nodeType, | ||
|
||
// See jQuery.data for more information | ||
cache = isNode ? jQuery.cache : elem, | ||
@@ -150,9 +155,16 @@ jQuery.extend({ | ||
} | ||
|
||
if ( name ) { | ||
var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; | ||
|
||
thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; | ||
|
||
if ( thisCache ) { | ||
|
||
// Support interoperable removal of hyphenated or camelcased keys | ||
if ( !thisCache[ name ] ) { | ||
name = jQuery.camelCase( name ); | ||
} | ||
|
||
delete thisCache[ name ]; | ||
|
||
// If there is no data left in the cache, we want to continue | ||
I didn't know where to point that out, so I notice you: in the current version of this file, the
internalKey
is not used anymore, but thejQuery.expando
property is accessed multiple times. Could/should we remove thatinternalKey
var or those multiple calls ?