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
path: root/doc
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2021-12-27 17:14:35 +0300
committerGitHub <noreply@github.com>2021-12-27 17:14:35 +0300
commit9a85efaa7f5f22c6905bf47d672dd73738787437 (patch)
tree1cdd74985a47bd43b35452970890f75d180f092f /doc
parent59db1728278f8111be277f069236cff7ae895e05 (diff)
events: graduate capturerejections to supported
These have been around long enough to warrant graduation. Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/41267 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/events.md24
1 files changed, 14 insertions, 10 deletions
diff --git a/doc/api/events.md b/doc/api/events.md
index 71846ea4527..817099643e2 100644
--- a/doc/api/events.md
+++ b/doc/api/events.md
@@ -173,8 +173,6 @@ myEmitter.emit('error', new Error('whoops!'));
## Capture rejections of promises
-> Stability: 1 - captureRejections is experimental.
-
Using `async` functions with event handlers is problematic, because it
can lead to an unhandled rejection in case of a thrown exception:
@@ -741,10 +739,12 @@ emitter.emit('log');
added:
- v13.4.0
- v12.16.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/41267
+ description: No longer experimental.
-->
-> Stability: 1 - captureRejections is experimental.
-
* `err` Error
* `eventName` {string|symbol}
* `...args` {any}
@@ -1028,10 +1028,12 @@ foo().then(() => console.log('done'));
added:
- v13.4.0
- v12.16.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/41267
+ description: No longer experimental.
-->
-> Stability: 1 - captureRejections is experimental.
-
Value: {boolean}
Change the default `captureRejections` option on all new `EventEmitter` objects.
@@ -1040,12 +1042,14 @@ Change the default `captureRejections` option on all new `EventEmitter` objects.
<!-- YAML
added:
- - v13.4.0
- - v12.16.0
+ - v13.4.0
+ - v12.16.0
+changes:
+ - version: REPLACEME
+ pr-url: https://github.com/nodejs/node/pull/41267
+ description: No longer experimental.
-->
-> Stability: 1 - captureRejections is experimental.
-
Value: `Symbol.for('nodejs.rejection')`
See how to write a custom [rejection handler][rejection].