diff options
author | Stephen Belanger <stephen.belanger@datadoghq.com> | 2021-06-03 08:22:15 +0300 |
---|---|---|
committer | Gerhard Stoebich <18708370+Flarna@users.noreply.github.com> | 2021-06-05 22:21:03 +0300 |
commit | 1c36eefcdbdbd823f37d7006846490da67210f5a (patch) | |
tree | 024d4dfda4747d8c77581e4df2faa1d9cb0e8d3f /lib | |
parent | 78af363aa7b8817a575faf1c3de58e47d64a1f8b (diff) |
async_hooks: switch between native and context hooks correctly
:facepalm: Might help if I remember to disable the _other_ promise
hook implementation when switching between them...
Fixes #38814
Fixes #38815
Refs #36394
PR-URL: https://github.com/nodejs/node/pull/38912
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Bryan English <bryan@bryanenglish.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/async_hooks.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/internal/async_hooks.js b/lib/internal/async_hooks.js index eac2471ff79..a6d258cf257 100644 --- a/lib/internal/async_hooks.js +++ b/lib/internal/async_hooks.js @@ -357,7 +357,9 @@ function updatePromiseHookMode() { wantPromiseHook = true; if (destroyHooksExist()) { enablePromiseHook(); + setPromiseHooks(undefined, undefined, undefined, undefined); } else { + disablePromiseHook(); setPromiseHooks( initHooksExist() ? promiseInitHook : undefined, promiseBeforeHook, |