Skip to content

Commit 24b40b3

Browse files
jasnelldanielleadams
authored andcommitted
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: #41267 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent bb997ff commit 24b40b3

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

doc/api/events.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@ myEmitter.emit('error', new Error('whoops!'));
173173

174174
## Capture rejections of promises
175175

176-
> Stability: 1 - captureRejections is experimental.
177-
178176
Using `async` functions with event handlers is problematic, because it
179177
can lead to an unhandled rejection in case of a thrown exception:
180178

@@ -741,10 +739,12 @@ emitter.emit('log');
741739
added:
742740
- v13.4.0
743741
- v12.16.0
742+
changes:
743+
- version: REPLACEME
744+
pr-url: https://github.com/nodejs/node/pull/41267
745+
description: No longer experimental.
744746
-->
745747

746-
> Stability: 1 - captureRejections is experimental.
747-
748748
* `err` Error
749749
* `eventName` {string|symbol}
750750
* `...args` {any}
@@ -1027,10 +1027,12 @@ foo().then(() => console.log('done'));
10271027
added:
10281028
- v13.4.0
10291029
- v12.16.0
1030+
changes:
1031+
- version: REPLACEME
1032+
pr-url: https://github.com/nodejs/node/pull/41267
1033+
description: No longer experimental.
10301034
-->
10311035

1032-
> Stability: 1 - captureRejections is experimental.
1033-
10341036
Value: {boolean}
10351037

10361038
Change the default `captureRejections` option on all new `EventEmitter` objects.
@@ -1039,12 +1041,14 @@ Change the default `captureRejections` option on all new `EventEmitter` objects.
10391041

10401042
<!-- YAML
10411043
added:
1042-
- v13.4.0
1043-
- v12.16.0
1044+
- v13.4.0
1045+
- v12.16.0
1046+
changes:
1047+
- version: REPLACEME
1048+
pr-url: https://github.com/nodejs/node/pull/41267
1049+
description: No longer experimental.
10441050
-->
10451051

1046-
> Stability: 1 - captureRejections is experimental.
1047-
10481052
Value: `Symbol.for('nodejs.rejection')`
10491053

10501054
See how to write a custom [rejection handler][rejection].

0 commit comments

Comments
 (0)