Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Pfenniger <jonas@pfenniger.name>2010-05-14 15:12:41 +0400
committerRyan Dahl <ry@tinyclouds.org>2010-05-15 06:13:50 +0400
commitfea6f829bf6cc0d2f3f698a786832797d5ddae8e (patch)
tree3fb5439b845fc7a5d30b077dc8e36ba935f9ef9e /lib/events.js
parent4274e6b7d0f5eb3559dd8f91941ce47d9a68e370 (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.js2
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;
}