summaryrefslogtreecommitdiff
path: root/src/async_wrap-inl.h
diff options
context:
space:
mode:
authorUjjwal Sharma <usharma1998@gmail.com>2018-04-12 16:43:15 +0530
committerJames M Snell <jasnell@gmail.com>2018-04-14 12:10:32 -0700
commit6eaeabcbecd31a96205802e395166671f4c70406 (patch)
treeaa2c0c1905e3502ccd11152ea2e2a617406f25f9 /src/async_wrap-inl.h
parent594e59d18df303477e7887c9c8b29de981c7476f (diff)
downloadnode-new-6eaeabcbecd31a96205802e395166671f4c70406.tar.gz
src: add HandleScope to fix error
Add `HandleError`s to the AsyncScope constructor and destructor in async_wrap-inl.h to fix "FATAL ERROR" incurring observed while running test-http2-respond-with-file using the --trace-events-enabled flag. Fixes: https://github.com/nodejs/node/issues/19921 PR-URL: https://github.com/nodejs/node/pull/19972 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/async_wrap-inl.h')
-rw-r--r--src/async_wrap-inl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/async_wrap-inl.h b/src/async_wrap-inl.h
index c9f1233324..f9c709aa21 100644
--- a/src/async_wrap-inl.h
+++ b/src/async_wrap-inl.h
@@ -50,6 +50,7 @@ inline AsyncWrap::AsyncScope::AsyncScope(AsyncWrap* wrap)
Environment* env = wrap->env();
if (env->async_hooks()->fields()[Environment::AsyncHooks::kBefore] == 0)
return;
+ v8::HandleScope handle_scope(env->isolate());
EmitBefore(env, wrap->get_async_id());
}
@@ -57,6 +58,7 @@ inline AsyncWrap::AsyncScope::~AsyncScope() {
Environment* env = wrap_->env();
if (env->async_hooks()->fields()[Environment::AsyncHooks::kAfter] == 0)
return;
+ v8::HandleScope handle_scope(env->isolate());
EmitAfter(env, wrap_->get_async_id());
}