From 78c83b805fa684ba484f753717e73703f33e04fe Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 21 Dec 2021 11:11:55 -0800 Subject: [PATCH 1/2] events: graduate capturerejections to supported These have been around long enough to warrant graduation. Signed-off-by: James M Snell --- doc/api/events.md | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/api/events.md b/doc/api/events.md index f3ef831a4843d0..e8620d87c988a8 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/00000 + 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/00000 + 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. -> Stability: 1 - captureRejections is experimental. - Value: `Symbol.for('nodejs.rejection')` See how to write a custom [rejection handler][rejection]. From 678bbc7e9105cb10a0aaa3fb3e53a0ff00c214f9 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Tue, 21 Dec 2021 12:04:31 -0800 Subject: [PATCH 2/2] [Squash] nits --- doc/api/events.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/api/events.md b/doc/api/events.md index e8620d87c988a8..03346442e066eb 100644 --- a/doc/api/events.md +++ b/doc/api/events.md @@ -741,7 +741,7 @@ added: - v12.16.0 changes: - version: REPLACEME - pr-url: https://github.com/nodejs/node/pull/00000 + pr-url: https://github.com/nodejs/node/pull/41267 description: No longer experimental. --> @@ -1030,7 +1030,7 @@ added: - v12.16.0 changes: - version: REPLACEME - pr-url: https://github.com/nodejs/node/pull/00000 + pr-url: https://github.com/nodejs/node/pull/41267 description: No longer experimental. --> @@ -1046,7 +1046,7 @@ added: - v12.16.0 changes: - version: REPLACEME - pr-url: https://github.com/nodejs/node/pull/00000 + pr-url: https://github.com/nodejs/node/pull/41267 description: No longer experimental. -->