diff --git a/src/node.cc b/src/node.cc index 9f6c8084cfd3c9..33bf5199d63b01 100644 --- a/src/node.cc +++ b/src/node.cc @@ -1373,6 +1373,12 @@ CallbackScope::~CallbackScope() { delete private_; } +InternalCallbackScope::InternalCallbackScope(AsyncWrap* async_wrap) + : InternalCallbackScope(async_wrap->env(), + async_wrap->object(), + { async_wrap->get_async_id(), + async_wrap->get_trigger_async_id() }) {} + InternalCallbackScope::InternalCallbackScope(Environment* env, Local object, const async_context& asyncContext, diff --git a/src/node_internals.h b/src/node_internals.h index 610347364d5eab..5d2f996cc8c1c5 100644 --- a/src/node_internals.h +++ b/src/node_internals.h @@ -303,6 +303,8 @@ class InternalCallbackScope { v8::Local object, const async_context& asyncContext, ResourceExpectation expect = kRequireResource); + // Utility that can be used by AsyncWrap classes. + explicit InternalCallbackScope(AsyncWrap* async_wrap); ~InternalCallbackScope(); void Close();