Skip to content

Commit

Permalink
async_hooks: switch between native and context hooks correctly
Browse files Browse the repository at this point in the history
🤦 Might help if I remember to disable the _other_ promise
hook implementation when switching between them...

Fixes #38814
Fixes #38815
  • Loading branch information
Qard committed Jun 3, 2021
1 parent 21f5a56 commit 2a20c6b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/internal/async_hooks.js
Expand Up @@ -357,7 +357,9 @@ function updatePromiseHookMode() {
wantPromiseHook = true;
if (destroyHooksExist()) {
enablePromiseHook();
setPromiseHooks(undefined, undefined, undefined, undefined);
} else {
disablePromiseHook();
setPromiseHooks(
initHooksExist() ? promiseInitHook : undefined,
promiseBeforeHook,
Expand Down

0 comments on commit 2a20c6b

Please sign in to comment.