summaryrefslogtreecommitdiff
path: root/lib/events.js
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2013-03-02 11:58:21 -0800
committerisaacs <i@izs.me>2013-03-02 15:01:20 -0800
commitd345c1173ac9c7ba861039707a142e187651f71d (patch)
tree31319ac92417b7d05f8db59dae08618640c369f9 /lib/events.js
parent2d51036fb9655d5b775e7f9e5ab362cd91460ca3 (diff)
downloadnode-d345c1173ac9c7ba861039707a142e187651f71d.tar.gz
events: Handle emit before constructor call
Diffstat (limited to 'lib/events.js')
-rw-r--r--lib/events.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/events.js b/lib/events.js
index 4cfa74076..dd4fdf64e 100644
--- a/lib/events.js
+++ b/lib/events.js
@@ -73,6 +73,9 @@ EventEmitter.prototype.emit = function(type) {
}
}
+ if (!this._events)
+ this._events = {};
+
handler = this._events[type];
if (typeof handler === 'undefined')