Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStephen Belanger <stephen.belanger@datadoghq.com>2021-06-03 08:22:15 +0300
committerGerhard Stoebich <18708370+Flarna@users.noreply.github.com>2021-06-05 22:21:03 +0300
commit1c36eefcdbdbd823f37d7006846490da67210f5a (patch)
tree024d4dfda4747d8c77581e4df2faa1d9cb0e8d3f /lib
parent78af363aa7b8817a575faf1c3de58e47d64a1f8b (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.js2
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,