mirror of https://github.com/nodejs/node.git
events: define properties on prototype
Speeds up EventEmitter object construction by about 15-20%.pull/37258/head
parent
6af8788f3e
commit
7ce5a31061
|
@ -37,6 +37,9 @@ function 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
|
||||
// added to it. This is a useful default which helps finding memory leaks.
|
||||
|
|
Loading…
Reference in New Issue