mirror of
https://github.com/nodejs/node-v0.x-archive.git
synced 2026-04-28 03:01:10 -04:00
Clean up little errors in events.js
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user