FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

feat: use a global symbol for `util.promisify.custom` by ExE-Boss · Pull Request #44 · browserify/node-util · GitHub

feat: use a global symbol for util.promisify.custom - #44

Open
ExE-Boss wants to merge 1 commit into
browserify:masterfrom
EB-Forks:feat/use-global-util-promisify-custom-symbol
Open

feat: use a global symbol for util.promisify.custom#44
ExE-Boss wants to merge 1 commit into
browserify:masterfrom
EB-Forks:feat/use-global-util-promisify-custom-symbol

Conversation

ExE-Boss commented Feb 8, 2020
edited
Loading

Copy link
Copy Markdown

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.

See also:

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.

Refs: nodejs/node#31647
Refs: nodejs/node#31672
ExE-Boss force-pushed the feat/use-global-util-promisify-custom-symbol branch from ec9c70f to f89af7d Compare February 8, 2020 14:10

ljharb commented Feb 8, 2020

Copy link
Copy Markdown
Member

This shouldn’t land until the node one has landed.

goto-bus-stop left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes, we'll want to wait until a Node.js version with this symbol has been released. Thanks for the PR!

Copy link
Copy Markdown
Author

@goto-bus-stop
This is now shipping in Node since v12.16.2/v13.12.0.

Refs: https://nodejs.org/api/util.html#util_util_promisify_custom

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL