Skip to content

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

3 participants