From 1797f65353f679354e17ef2e3a5c469299ef1c8f Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Thu, 12 Apr 2018 16:43:15 +0530 Subject: [PATCH] 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 --- src/async_wrap-inl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/async_wrap-inl.h b/src/async_wrap-inl.h index c9f12333243092..f9c709aa21e987 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()); }