From ea008411e4c88824fd8a0775c7639036d0d2eab0 Mon Sep 17 00:00:00 2001 From: Daniel Imms Date: Sun, 21 May 2017 11:25:18 -0700 Subject: [PATCH] Add missing EventEmitter.emit args/types --- src/EventEmitter.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/EventEmitter.ts b/src/EventEmitter.ts index 1db86763..a4fd4542 100644 --- a/src/EventEmitter.ts +++ b/src/EventEmitter.ts @@ -53,14 +53,11 @@ export class EventEmitter { return this.on(type, on); } - public emit(type): void { + public emit(type: string, ...args: any[]): void { if (!this._events[type]) { return; } - - let args = Array.prototype.slice.call(arguments, 1); let obj = this._events[type]; - for (let i = 0; i < obj.length; i++) { obj[i].apply(this, args); }