diff options
author | Jonas Pfenniger <jonas@pfenniger.name> | 2010-05-14 15:12:41 +0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2010-05-15 06:13:50 +0400 |
commit | fea6f829bf6cc0d2f3f698a786832797d5ddae8e (patch) | |
tree | 3fb5439b845fc7a5d30b077dc8e36ba935f9ef9e /lib/events.js | |
parent | 4274e6b7d0f5eb3559dd8f91941ce47d9a68e370 (diff) |
FIX: EventEmitter#removeListener logic
In the case of one defined listener, the function should only remove it
if it is the same as the passed listener.
Diffstat (limited to 'lib/events.js')
-rw-r--r-- | lib/events.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/events.js b/lib/events.js index c77032fe43b..682a9280b13 100644 --- a/lib/events.js +++ b/lib/events.js @@ -90,7 +90,7 @@ process.EventEmitter.prototype.removeListener = function (type, listener) { var i = list.indexOf(listener); if (i < 0) return this; list.splice(i, 1); - } else { + } else if (this._events[type] === listener) { this._events[type] = null; } |