Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2020-09-05 16:41:16 +0300
committerRich Trott <rtrott@gmail.com>2020-09-07 18:20:27 +0300
commite56da0625a82880f6329df4d5ef8849ff018956a (patch)
tree56a719117864d576af3dc9740ee205b11a317e52 /doc/api/events.md
parentc4b3b2341383369ccbd0fa68e51266f580e9a5fd (diff)
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: https://github.com/nodejs/node/pull/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>
Diffstat (limited to 'doc/api/events.md')
-rw-r--r--doc/api/events.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/api/events.md b/doc/api/events.md
index daa887a0c09..6bb7c1ed2cf 100644
--- a/doc/api/events.md
+++ b/doc/api/events.md
@@ -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