diff --git a/doc/api/events.markdown b/doc/api/events.markdown index 7e72dcb012..736f79b494 100644 --- a/doc/api/events.markdown +++ b/doc/api/events.markdown @@ -80,6 +80,7 @@ added for a particular event. This is a useful default which helps finding memory leaks. Obviously not all Emitters should be limited to 10. This function allows that to be increased. Set to zero for unlimited. +Returns emitter, so calls can be chained. ### EventEmitter.defaultMaxListeners diff --git a/lib/events.js b/lib/events.js index ef9ff7426c..a5cf6d4880 100644 --- a/lib/events.js +++ b/lib/events.js @@ -49,6 +49,7 @@ EventEmitter.prototype.setMaxListeners = function(n) { if (typeof n !== 'number' || n < 0) throw TypeError('n must be a positive number'); this._maxListeners = n; + return this; }; EventEmitter.prototype.emit = function(type) {