Skip to content


setMaxListeners fails unless events have already been added #682

jdub opened this Issue · 1 comment

2 participants


So you can't create an emitter and immediately setMaxListeners on it, which I imagine would be a common use case. :-)

From events.js:

var defaultMaxListeners = 10;
EventEmitter.prototype.setMaxListeners = function(n) {
  this._events.maxListeners = n;

... and further down...

EventEmitter.prototype.addListener = function(type, listener) {
  if (!this._events) this._events = {};
ry commented

fixed in 81d3de7

@ry ry closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.