Skip to content

Commit 7b6a731

Browse files
aduh95ruyadorno
authored andcommitted
doc: deprecate calling promisify on a function that returns a promise
PR-URL: #49647 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent d316b32 commit 7b6a731

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
@@ -3378,6 +3378,20 @@ In a future version of Node.js, [`assert.CallTracker`][],
33783378
will be removed.
33793379
Consider using alternatives such as the [`mock`][] helper function.
33803380

3381+
### DEP0174: calling `promisify` on a function that returns a `Promise`
3382+
3383+
<!-- YAML
3384+
changes:
3385+
- version: REPLACEME
3386+
pr-url: https://github.com/nodejs/node/pull/49647
3387+
description: Documentation-only deprecation.
3388+
-->
3389+
3390+
Type: Documentation-only
3391+
3392+
Calling [`util.promisify`][] on a function that returns a <Promise> will ignore
3393+
the result of said promise, which can lead to unhandled promise rejections.
3394+
33813395
[NIST SP 800-38D]: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38d.pdf
33823396
[RFC 6066]: https://tools.ietf.org/html/rfc6066#section-3
33833397
[RFC 8247 Section 2.4]: https://www.rfc-editor.org/rfc/rfc8247#section-2.4
@@ -3518,6 +3532,7 @@ Consider using alternatives such as the [`mock`][] helper function.
35183532
[`util.isSymbol()`]: util.md#utilissymbolobject
35193533
[`util.isUndefined()`]: util.md#utilisundefinedobject
35203534
[`util.log()`]: util.md#utillogstring
3535+
[`util.promisify`]: util.md#utilpromisifyoriginal
35213536
[`util.types`]: util.md#utiltypes
35223537
[`util`]: util.md
35233538
[`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)