|
|
@ -115,8 +115,14 @@ EventEmitter.prototype.addListener = function(type, listener) { |
|
|
|
// If we've already got an array, just append.
|
|
|
|
this._events[type].push(listener); |
|
|
|
|
|
|
|
} else { |
|
|
|
// Adding the second element, need to change to array.
|
|
|
|
this._events[type] = [this._events[type], listener]; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Check for listener leak
|
|
|
|
if (!this._events[type].warned) { |
|
|
|
if (isArray(this._events[type]) && !this._events[type].warned) { |
|
|
|
var m; |
|
|
|
if (this._maxListeners !== undefined) { |
|
|
|
m = this._maxListeners; |
|
|
@ -133,10 +139,6 @@ EventEmitter.prototype.addListener = function(type, listener) { |
|
|
|
console.trace(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
// Adding the second element, need to change to array.
|
|
|
|
this._events[type] = [this._events[type], listener]; |
|
|
|
} |
|
|
|
|
|
|
|
return this; |
|
|
|
}; |
|
|
|