Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ExE-Boss
Copy link

@ExE-Boss ExE-Boss commented Feb 8, 2020

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 ExE-Boss force-pushed the feat/use-global-util-promisify-custom-symbol branch from ec9c70f to f89af7d Compare February 8, 2020 14:10
@ljharb
Copy link
Member

ljharb commented Feb 8, 2020

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

Copy link
Member

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

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

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

@ExE-Boss
Copy link
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

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