Skip to content

Commit

Permalink
doc: use correct 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: #35069
Reviewed-By: Daijiro Wachi <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and ruyadorno committed Sep 17, 2020
1 parent 8bbf92a commit fb89be6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion doc/api/events.md
Original file line number Diff line number Diff line change
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 fb89be6

Please sign in to comment.