mirror of https://github.com/nodejs/node.git
Clean up little errors in events.js
parent
0462b5d1ec
commit
dd1750f573
|
@ -11,7 +11,7 @@ emitter.addListener = function (type, listener) {
|
|||
}
|
||||
};
|
||||
|
||||
emitter.listeners = function (type, listener) {
|
||||
emitter.listeners = function (type) {
|
||||
if (!this._events) this._events = {};
|
||||
if (!this._events.hasOwnProperty(type)) this._events[type] = [];
|
||||
return this._events[type];
|
||||
|
@ -26,7 +26,7 @@ emitter.emit = function (type, args) {
|
|||
var listeners = this._events[type];
|
||||
var length = listeners.length;
|
||||
|
||||
for (var i = 0; i < length; i++) {
|
||||
for (var i = 0; i < listeners.length; i++) {
|
||||
listeners[i].apply(this, args);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue