diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2011-11-04 16:57:02 -0400 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-11-06 16:05:45 -0500 |
commit | e086c22826e681bb8afcff93c16c8ad41389a096 (patch) | |
tree | ff4a8b14d3c56f301ef83b8efcef0b230ed03c45 | |
parent | 262c32a70e1f14e5addd263af2f868525aab03c8 (diff) | |
download | jquery-e086c22826e681bb8afcff93c16c8ad41389a096.tar.gz jquery-e086c22826e681bb8afcff93c16c8ad41389a096.zip |
User internalKey instead of jQuery.expando. Fixes #10675
-rw-r--r-- | src/data.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/data.js b/src/data.js index 15faa6fdc..b4c53250c 100644 --- a/src/data.js +++ b/src/data.js @@ -46,7 +46,7 @@ jQuery.extend({ // Only defining an ID for JS objects if its cache already exists allows // the code to shortcut on the same path as a DOM node with no cache - id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando, + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey, isEvents = name === "events"; // Avoid doing any more work than we need to when trying to get data on an @@ -59,9 +59,9 @@ jQuery.extend({ // Only DOM nodes need a new unique ID for each element since their data // ends up in the global cache if ( isNode ) { - elem[ jQuery.expando ] = id = ++jQuery.uuid; + elem[ internalKey ] = id = ++jQuery.uuid; } else { - id = jQuery.expando; + id = internalKey; } } @@ -144,7 +144,7 @@ jQuery.extend({ cache = isNode ? jQuery.cache : elem, // See jQuery.data for more information - id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + id = isNode ? elem[ internalKey ] : internalKey; // If there is already no cache entry for this object, there is no // purpose in continuing @@ -214,11 +214,11 @@ jQuery.extend({ // nor does it have a removeAttribute function on Document nodes; // we must handle all of these cases if ( jQuery.support.deleteExpando ) { - delete elem[ jQuery.expando ]; + delete elem[ internalKey ]; } else if ( elem.removeAttribute ) { - elem.removeAttribute( jQuery.expando ); + elem.removeAttribute( internalKey ); } else { - elem[ jQuery.expando ] = null; + elem[ internalKey ] = null; } } }, |