events: define properties on prototype
Speeds up EventEmitter object construction by about 15-20%.
This commit is contained in:
parent
6af8788f3e
commit
7ce5a31061
@ -37,6 +37,9 @@ function EventEmitter() {
|
|||||||
}
|
}
|
||||||
exports.EventEmitter = EventEmitter;
|
exports.EventEmitter = EventEmitter;
|
||||||
|
|
||||||
|
EventEmitter.prototype.domain = undefined;
|
||||||
|
EventEmitter.prototype._events = undefined;
|
||||||
|
EventEmitter.prototype._maxListeners = undefined;
|
||||||
|
|
||||||
// By default EventEmitters will print a warning if more than 10 listeners are
|
// By default EventEmitters will print a warning if more than 10 listeners are
|
||||||
// added to it. This is a useful default which helps finding memory leaks.
|
// added to it. This is a useful default which helps finding memory leaks.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user