FIX: EventEmitter#removeAllListeners signature
This function should return this is all cases.
This commit is contained in:
parent
fea6f829bf
commit
53a9869ff7
@ -99,8 +99,8 @@ process.EventEmitter.prototype.removeListener = function (type, listener) {
|
|||||||
|
|
||||||
process.EventEmitter.prototype.removeAllListeners = function (type) {
|
process.EventEmitter.prototype.removeAllListeners = function (type) {
|
||||||
// does not use listeners(), so no side effect of creating _events[type]
|
// does not use listeners(), so no side effect of creating _events[type]
|
||||||
if (!type || !this._events || !this._events[type]) return this;
|
if (type && this._events && this._events[type]) this._events[type] = null;
|
||||||
this._events[type] = null;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
process.EventEmitter.prototype.listeners = function (type) {
|
process.EventEmitter.prototype.listeners = function (type) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user