Skip to content

Commit 6eaeabc

Browse files
ryzokukenjasnell
authored andcommitted
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: nodejs#19921 PR-URL: nodejs#19972 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 594e59d commit 6eaeabc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/async_wrap-inl.h

+2
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ inline AsyncWrap::AsyncScope::AsyncScope(AsyncWrap* wrap)
5050
Environment* env = wrap->env();
5151
if (env->async_hooks()->fields()[Environment::AsyncHooks::kBefore] == 0)
5252
return;
53+
v8::HandleScope handle_scope(env->isolate());
5354
EmitBefore(env, wrap->get_async_id());
5455
}
5556

5657
inline AsyncWrap::AsyncScope::~AsyncScope() {
5758
Environment* env = wrap_->env();
5859
if (env->async_hooks()->fields()[Environment::AsyncHooks::kAfter] == 0)
5960
return;
61+
v8::HandleScope handle_scope(env->isolate());
6062
EmitAfter(env, wrap_->get_async_id());
6163
}
6264

0 commit comments

Comments
 (0)