Skip to content

Commit

Permalink
Don't expose jQuery.deletedIds. Close jquerygh-889.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwaldron authored and dmethvin committed Oct 21, 2012
1 parent 2b0e720 commit 8076a33
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ var
// Used for detecting and trimming whitespace
core_rnotwhite = /\S/,
core_rspace = /\s+/,

// List of deleted data cache ids, so we can reuse them
core_deletedIds = [],

// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
Expand Down
2 changes: 1 addition & 1 deletion src/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function internalData( elem, name, data, pvt /* Internal Use Only */ ){
// Only DOM nodes need a new unique ID for each element since their data
// ends up in the global cache
if ( isNode ) {
elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
} else {
id = internalKey;
}
Expand Down
2 changes: 1 addition & 1 deletion src/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ jQuery.extend({
elem[ internalKey ] = null;
}

jQuery.deletedIds.push( id );
core_deletedIds.push( id );
}
}
}
Expand Down

0 comments on commit 8076a33

Please sign in to comment.