Skip to content

Commit 4079fc4

Browse files
jasnelltargos
authored andcommitted
events: graduate capturerejections to supported
These have been around long enough to warrant graduation. Signed-off-by: James M Snell <[email protected]> PR-URL: #41267 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Antoine du Hamel <[email protected]>
1 parent e339220 commit 4079fc4

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

doc/api/events.md

+14-10
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}
@@ -1028,10 +1028,12 @@ foo().then(() => console.log('done'));
10281028
added:
10291029
- v13.4.0
10301030
- v12.16.0
1031+
changes:
1032+
- version: REPLACEME
1033+
pr-url: https://github.com/nodejs/node/pull/41267
1034+
description: No longer experimental.
10311035
-->
10321036

1033-
> Stability: 1 - captureRejections is experimental.
1034-
10351037
Value: {boolean}
10361038

10371039
Change the default `captureRejections` option on all new `EventEmitter` objects.
@@ -1040,12 +1042,14 @@ Change the default `captureRejections` option on all new `EventEmitter` objects.
10401042

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

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

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

0 commit comments

Comments
 (0)