diff options
author | Rich Trott <rtrott@gmail.com> | 2020-09-05 16:41:16 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-09-07 18:20:27 +0300 |
commit | e56da0625a82880f6329df4d5ef8849ff018956a (patch) | |
tree | 56a719117864d576af3dc9740ee205b11a317e52 /doc/api/events.md | |
parent | c4b3b2341383369ccbd0fa68e51266f580e9a5fd (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.md | 2 |
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 |