From e56da0625a82880f6329df4d5ef8849ff018956a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 5 Sep 2020 06:41:16 -0700 Subject: [PATCH] doc: use correct Error type for EventEmitter.defaultMaxListener MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-By: Michaƫl Zasso Reviewed-By: Anna Henningsen Reviewed-By: Luigi Pinca --- doc/api/events.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/events.md b/doc/api/events.md index daa887a0c09585..6bb7c1ed2cf11a 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