Skip to content

Commit 71b90fa

Browse files
authored
doc: deprecate calling promisify on a function that returns a promise
PR-URL: #49647 Reviewed-By: Benjamin Gruenbaum <[email protected]> Reviewed-By: LiviaMedeiros <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]>
1 parent ae73d48 commit 71b90fa

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

doc/api/deprecations.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3383,6 +3383,20 @@ In a future version of Node.js, [`assert.CallTracker`][],
33833383
will be removed.
33843384
Consider using alternatives such as the [`mock`][] helper function.
33853385

3386+
### DEP0174: calling `promisify` on a function that returns a `Promise`
3387+
3388+
<!-- YAML
3389+
changes:
3390+
- version: REPLACEME
3391+
pr-url: https://github.com/nodejs/node/pull/49647
3392+
description: Documentation-only deprecation.
3393+
-->
3394+
3395+
Type: Documentation-only
3396+
3397+
Calling [`util.promisify`][] on a function that returns a <Promise> will ignore
3398+
the result of said promise, which can lead to unhandled promise rejections.
3399+
33863400
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
33873401
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
33883402
[RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4
@@ -3523,6 +3537,7 @@ Consider using alternatives such as the [`mock`][] helper function.
35233537
[`util.isSymbol()`]: util.md#utilissymbolobject
35243538
[`util.isUndefined()`]: util.md#utilisundefinedobject
35253539
[`util.log()`]: util.md#utillogstring
3540+
[`util.promisify`]: util.md#utilpromisifyoriginal
35263541
[`util.types`]: util.md#utiltypes
35273542
[`util`]: util.md
35283543
[`worker.exitedAfterDisconnect`]: cluster.md#workerexitedafterdisconnect

doc/api/util.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,6 +1591,11 @@ $ node negate.js --no-logfile --logfile=test.log --color --no-color
15911591
15921592
<!-- YAML
15931593
added: v8.0.0
1594+
changes:
1595+
- version: REPLACEME
1596+
pr-url: https://github.com/nodejs/node/pull/49647
1597+
description: Calling `promisify` on a function that returns a `Promise` is
1598+
deprecated.
15941599
-->
15951600
15961601
* `original` {Function}

0 commit comments

Comments
 (0)