From 6eaeabcbecd31a96205802e395166671f4c70406 Mon Sep 17 00:00:00 2001 From: Ujjwal Sharma Date: Thu, 12 Apr 2018 16:43:15 +0530 Subject: 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 Reviewed-By: James M Snell --- src/async_wrap-inl.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/async_wrap-inl.h') 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()); } -- cgit v1.2.1