fix the wrong variable name 'event' in Emitter.ts

This commit is contained in:
Vibert Thio 2021-01-20 18:41:55 -05:00
parent ac856bc82b
commit 46bd7176f6

View file

@ -69,11 +69,11 @@ export class Emitter<EventType extends string = string> extends Tone {
if (isUndef(this._events)) { if (isUndef(this._events)) {
this._events = {}; this._events = {};
} }
if (this._events.hasOwnProperty(event)) { if (this._events.hasOwnProperty(eventName)) {
if (isUndef(callback)) { if (isUndef(callback)) {
this._events[event] = []; this._events[eventName] = [];
} else { } else {
const eventList = this._events[event]; const eventList = this._events[eventName];
for (let i = eventList.length - 1; i >= 0; i--) { for (let i = eventList.length - 1; i >= 0; i--) {
if (eventList[i] === callback) { if (eventList[i] === callback) {
eventList.splice(i, 1); eventList.splice(i, 1);