diff --git a/src/EventEmitter.js b/src/EventEmitter.js index 3ce46fefe..e3133d03d 100644 --- a/src/EventEmitter.js +++ b/src/EventEmitter.js @@ -142,8 +142,8 @@ EventEmitter.prototype = { * @param {Array} args */ emit: function(event, sender, data) { - var listeners, length, - idx=0; + var listeners, length, + emitter = this; if (!this.checkEvent(event)) { return; @@ -156,23 +156,22 @@ EventEmitter.prototype = { var e = new JsSIP.Event(event, sender, data); - if (e) { - for (idx; idx