Unverified Commit a2fdb766 authored by Trevor Norris's avatar Trevor Norris Committed by Anna Henningsen
Browse files

async_wrap: use kTotals to enable PromiseHook

Keep a total of enabled hook callbacks in kTotals. This value is used to
track whether node::PromiseHook (src/async-wrap.cc) should be enabled or
disabled.

Don't enable node::PromiseHook, using enablePromiseHook(), until a hook
has been added. Then, using disablePromiseHook(), disable
node::PromiseHook when all hooks have been disabled.

Need to use a native test in order to check the internal field of the
Promise and check for a PromiseWrap.

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


Reviewed-By: default avatarAndreas Madsen <amwebdk@gmail.com>
Reviewed-By: default avatarAnna Henningsen <anna@addaleax.net>
parent cc2dd93e
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