Explicit void

This commit is contained in:
Tim Schaub
2018-07-26 10:46:39 -06:00
parent 8346bb7454
commit 6cfa2b22a7
21 changed files with 54 additions and 53 deletions
+3 -3
View File
@@ -3,7 +3,7 @@
*/
import Disposable from '../Disposable.js';
import {unlistenAll} from '../events.js';
import {UNDEFINED} from '../functions.js';
import {VOID} from '../functions.js';
import Event from '../events/Event.js';
@@ -102,7 +102,7 @@ class Target extends Disposable {
let pendingRemovals = this.pendingRemovals_[type];
delete this.pendingRemovals_[type];
while (pendingRemovals--) {
this.removeEventListener(type, UNDEFINED);
this.removeEventListener(type, VOID);
}
delete this.dispatching_[type];
}
@@ -149,7 +149,7 @@ class Target extends Disposable {
const index = listeners.indexOf(listener);
if (type in this.pendingRemovals_) {
// make listener a no-op, and remove later in #dispatchEvent()
listeners[index] = UNDEFINED;
listeners[index] = VOID;
++this.pendingRemovals_[type];
} else {
listeners.splice(index, 1);