Skip to content

Commit 5796c3a

Browse files
benjamingrbengl
authored andcommitted
process: deprecate multipleResolves
Deprecate the process multipleResolves event to detect when a promise is resolved more than once because it never really worked. Fixes: #41554 PR-URL: #41872 Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Juan José Arboleda <[email protected]> Reviewed-By: Mestery <[email protected]>
1 parent 0fff4d2 commit 5796c3a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

doc/api/deprecations.md

+14
Original file line numberDiff line numberDiff line change
@@ -3061,6 +3061,20 @@ This method was deprecated because it is not compatible with
30613061

30623062
Use [`buffer.subarray`][] which does the same thing instead.
30633063

3064+
### DEPXXXX: `process.on('multipleResolves', handler)`
3065+
3066+
<!-- YAML
3067+
changes:
3068+
- version: REPLACEME
3069+
pr-url: https://github.com/nodejs/node/pull/41872
3070+
description: Documentation-only deprecation.
3071+
-->
3072+
3073+
Type: Documentation-only
3074+
3075+
This event was deprecated because it did not work with V8 promise combinators
3076+
which diminished its usefulness.
3077+
30643078
[Legacy URL API]: url.md#legacy-url-api
30653079
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
30663080
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3

doc/api/process.md

+6
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,11 @@ See [Advanced serialization for `child_process`][] for more details.
181181

182182
<!-- YAML
183183
added: v10.12.0
184+
deprecated: REPLACEME
184185
-->
185186

187+
> Stability: 0 - Deprecated
188+
186189
* `type` {string} The resolution type. One of `'resolve'` or `'reject'`.
187190
* `promise` {Promise} The promise that resolved or rejected more than once.
188191
* `value` {any} The value with which the promise was either resolved or
@@ -200,6 +203,9 @@ This is useful for tracking potential errors in an application while using the
200203
the occurrence of this event does not necessarily indicate an error. For
201204
example, [`Promise.race()`][] can trigger a `'multipleResolves'` event.
202205

206+
Because of the unreliability of the event in cases like the
207+
[`Promise.race()`][] example above it has been deprecated.
208+
203209
```mjs
204210
import process from 'process';
205211

0 commit comments

Comments
 (0)