Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4079fc4

Browse filesBrowse files
jasnelltargos
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 e339220 commit 4079fc4
Copy full SHA for 4079fc4

File tree

Expand file treeCollapse file tree

1 file changed

+14
-10
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+14
-10
lines changed
Open diff view settings
Collapse file

‎doc/api/events.md‎

Copy file name to clipboardExpand all lines: doc/api/events.md
+14-10Lines changed: 14 additions & 10 deletions
  • Display the source diff
  • Display the rich diff
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.