mirror of
https://github.com/esiur/esiur-js.git
synced 2026-04-04 05:58:22 +00:00
1.8.2
This commit is contained in:
@@ -39,7 +39,7 @@ export default class AutoMap extends IEventHandler
|
||||
add(key, value)
|
||||
{
|
||||
if (value instanceof IDestructible)
|
||||
value.on("destroy", this._item_destroyed);
|
||||
value.on("destroy", this.#_item_destroyed);
|
||||
|
||||
this.dic[key] = value;
|
||||
|
||||
@@ -58,13 +58,13 @@ export default class AutoMap extends IEventHandler
|
||||
{
|
||||
if (this.dic[key] !== undefined) {
|
||||
if (this.dic[key] instanceof IDestructible)
|
||||
this.dic[key].off("destroy", this._item_destroyed);
|
||||
this.dic[key].off("destroy", this.#_item_destroyed);
|
||||
|
||||
delete this.dic[key];
|
||||
}
|
||||
}
|
||||
|
||||
_item_destroyed(sender)
|
||||
#_item_destroyed = function(sender)
|
||||
{
|
||||
this.remove(sender);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user