use emitter.setMaxListeners().

This commit is contained in:
Christopher Jeffrey 2015-01-31 12:32:33 -08:00
parent 1795cd93d6
commit 610e00ee21
2 changed files with 6 additions and 1 deletions

View File

@ -14,6 +14,10 @@ function EventEmitter() {
if (!this._events) this._events = {};
}
EventEmitter.prototype.setMaxListeners = function(n) {
this._maxListeners = n;
};
EventEmitter.prototype.addListener = function(type, listener) {
if (!this._events[type]) {
this._events[type] = listener;

View File

@ -354,7 +354,8 @@ function Screen(options) {
this.enter();
this._maxListeners = Infinity;
// XXX Not used right now since we're using our own EventEmitter:
this.setMaxListeners(Infinity);
Screen.total++;