diff options
author | Oleg Gaidarenko <markelog@gmail.com> | 2013-04-08 15:35:16 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2013-04-08 15:35:16 -0400 |
commit | e8731410a4714a3383dfc5342f835e0177b58ff7 (patch) | |
tree | 311279ca18c848dffaa72953a3864eb29fef288a /src/manipulation.js | |
parent | 1a3939659b2c2506fb50ca3ee21e84c642cb5f64 (diff) | |
download | jquery-e8731410a4714a3383dfc5342f835e0177b58ff7.tar.gz jquery-e8731410a4714a3383dfc5342f835e0177b58ff7.zip |
No ticket. Use data_priv methods instead of jQuery._removeData and jQuery._data; Remove needless, internal second argument of jQuery.cleanData. Closes gh-1234
Diffstat (limited to 'src/manipulation.js')
-rw-r--r-- | src/manipulation.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/manipulation.js b/src/manipulation.js index 8f0422694..c794470dc 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -442,7 +442,7 @@ jQuery.extend({ return fragment; }, - cleanData: function( elems, /* internal */ acceptData ) { + cleanData: function( elems ) { var data, elem, type, l = elems.length, i = 0, @@ -451,7 +451,7 @@ jQuery.extend({ for ( ; i < l; i++ ) { elem = elems[ i ]; - if ( acceptData || jQuery.acceptData( elem ) ) { + if ( jQuery.acceptData( elem ) ) { data = data_priv.access( elem ); @@ -468,7 +468,10 @@ jQuery.extend({ } } // Discard any remaining `private` and `user` data - data_discard( elem ); + // One day we'll replace the dual arrays with a WeakMap and this won't be an issue. + // (Splices the data objects out of the internal cache arrays) + data_user.discard( elem ); + data_priv.discard( elem ); } } }); |