Unverified Commit 8f39881b authored by Anna Henningsen's avatar Anna Henningsen
Browse files

async_hooks: use resource objects for Promises

Use `PromiseWrap` resource objects whose lifetimes are tied to
the `Promise` instances themselves to track promises, and have
a `.promise` getter that points to the `Promise` and a `.parent`
property that points to the parent Promise’s resource object,
if there is any.

The properties are implemented as getters for internal fields
rather than normal properties in the hope that it helps keep
performance for the common case that async_hooks users will
often not inspect them.

PR-URL: https://github.com/nodejs/node/pull/13452


Reviewed-By: default avatarAndreas Madsen <amwebdk@gmail.com>
Reviewed-By: default avatarTrevor Norris <trev.norris@gmail.com>
parent 02aea069
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment