Skip to content

Commit fb89be6

Browse files
Trottruyadorno
authored andcommitted
doc: use correct Error type for EventEmitter.defaultMaxListener
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 <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>
1 parent 8bbf92a commit fb89be6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/api/events.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ By default, a maximum of `10` listeners can be registered for any single
333333
event. This limit can be changed for individual `EventEmitter` instances
334334
using the [`emitter.setMaxListeners(n)`][] method. To change the default
335335
for *all* `EventEmitter` instances, the `EventEmitter.defaultMaxListeners`
336-
property can be used. If this value is not a positive number, a `TypeError`
336+
property can be used. If this value is not a positive number, a `RangeError`
337337
is thrown.
338338

339339
Take caution when setting the `EventEmitter.defaultMaxListeners` because the

0 commit comments

Comments
 (0)