Skip to content

Commit

Permalink
doc: use correect Error type for EventEmitter.defaultMaxListener
Browse files Browse the repository at this point in the history
If a bad value is assigned to EventEmitter.defaultMaxListener, a
RangeError is thrown and not a TypeError. Update documentation to
reflect this.

PR-URL: nodejs#35069
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Trott committed Sep 7, 2020
1 parent c4b3b23 commit 0019836
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/events.md
Expand Up @@ -333,7 +333,7 @@ By default, a maximum of `10` listeners can be registered for any single
event. This limit can be changed for individual `EventEmitter` instances
using the [`emitter.setMaxListeners(n)`][] method. To change the default
for *all* `EventEmitter` instances, the `EventEmitter.defaultMaxListeners`
property can be used. If this value is not a positive number, a `TypeError`
property can be used. If this value is not a positive number, a `RangeError`
is thrown.

Take caution when setting the `EventEmitter.defaultMaxListeners` because the
Expand Down

0 comments on commit 0019836

Please sign in to comment.