fix: removing nonexistent events is ok
This commit is contained in:
parent
2fc0b35eee
commit
e97aef03d1
|
@ -77,12 +77,10 @@ export function EventEmitterMixin(Superclass) {
|
|||
return;
|
||||
}
|
||||
// Function.
|
||||
const lists = [];
|
||||
if ((type in this.$$events)) {
|
||||
lists.push(this.$$events);
|
||||
if (!(type in this.$$events)) {
|
||||
return;
|
||||
}
|
||||
const listeners = this.$$events;
|
||||
listeners[type] = listeners[type].filter((listener) => {
|
||||
this.$$events[type] = this.$$events[type].filter((listener) => {
|
||||
return listener.fn !== fn;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user