Return the EventEmitter from addListener for chaining.

http://groups.google.com/group/nodejs/browse_thread/thread/13708eacedb40b36
pull/5370/head
Ryan 2009-08-19 13:29:22 +02:00
parent 53b3d6be35
commit b590a45849
1 changed files with 1 additions and 0 deletions

View File

@ -8,6 +8,7 @@ node.EventEmitter.prototype.addListener = function (type, listener) {
if (!this._events.hasOwnProperty(type)) this._events[type] = []; if (!this._events.hasOwnProperty(type)) this._events[type] = [];
this._events[type].push(listener); this._events[type].push(listener);
} }
return this;
}; };
node.EventEmitter.prototype.listeners = function (type) { node.EventEmitter.prototype.listeners = function (type) {