Commit 53fd0d8
util: use a global symbol for
Define `util.promisify.custom`
as `Symbol.for("nodejs.util.inspect.custom")`, rather than
as `Symbol("util.inspect.custom")`.
This allows custom `promisify` wrappers to easily/safely be defined
in non‑Node.js environments.
Fixes: #31647
PR-URL: #31672
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>util.promisify.custom
1 parent 2069c4e commit 53fd0d8Copy full SHA for 53fd0d8
File tree
Expand file treeCollapse file tree
3 files changed
+37
-1
lines changedOpen diff view settings
Filter options
- doc/api
- lib/internal
- test/parallel
Expand file treeCollapse file tree
3 files changed
+37
-1
lines changedOpen diff view settings
Collapse file
+21Lines changed: 21 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
995 | 995 | |
996 | 996 | |
997 | 997 | |
| 998 | + |
| 999 | + |
| 1000 | + |
| 1001 | + |
998 | 1002 | |
999 | 1003 | |
1000 | 1004 | |
1001 | 1005 | |
1002 | 1006 | |
| 1007 | + |
| 1008 | + |
| 1009 | + |
| 1010 | + |
| 1011 | + |
| 1012 | + |
| 1013 | + |
| 1014 | + |
| 1015 | + |
| 1016 | + |
| 1017 | + |
| 1018 | + |
| 1019 | + |
| 1020 | + |
| 1021 | + |
| 1022 | + |
| 1023 | + |
1003 | 1024 | |
1004 | 1025 | |
1005 | 1026 | |
|
Collapse file
+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
271 | 271 | |
272 | 272 | |
273 | 273 | |
274 | | - |
| 274 | + |
275 | 275 | |
276 | 276 | |
277 | 277 | |
|
Collapse file
test/parallel/test-util-promisify.js
Copy file name to clipboardExpand all lines: test/parallel/test-util-promisify.js+15Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
33 | 33 | |
34 | 34 | |
35 | 35 | |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
36 | 51 | |
37 | 52 | |
38 | 53 | |
|
0 commit comments