mirror of
https://github.com/jquery/jquery.git
synced 2024-11-23 02:54:22 +00:00
Only splice from internal arrays when item actually exists.
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
This commit is contained in:
parent
b9cdc4136b
commit
f717226b3a
@ -122,8 +122,11 @@ Data.prototype = {
|
||||
},
|
||||
discard: function( owner ) {
|
||||
var index = this.owners.indexOf( owner );
|
||||
|
||||
if ( index >= 0 ) {
|
||||
this.owners.splice( index, 1 );
|
||||
this.cache.splice( index, 1 );
|
||||
}
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user