File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -539,6 +539,8 @@ void Environment::InitializeLibuv() {
539539 [](uv_async_t * async) {
540540 Environment* env = ContainerOf (
541541 &Environment::task_queues_async_, async);
542+ HandleScope handle_scope (env->isolate ());
543+ Context::Scope context_scope (env->context ());
542544 env->RunAndClearNativeImmediates ();
543545 });
544546 uv_unref (reinterpret_cast <uv_handle_t *>(&task_queues_async_));
Original file line number Diff line number Diff line change @@ -288,6 +288,7 @@ inline void FileHandle::Close() {
288288void FileHandle::CloseReq::Resolve () {
289289 Isolate* isolate = env ()->isolate ();
290290 HandleScope scope (isolate);
291+ Context::Scope context_scope (env ()->context ());
291292 InternalCallbackScope callback_scope (this );
292293 Local<Promise> promise = promise_.Get (isolate);
293294 Local<Promise::Resolver> resolver = promise.As <Promise::Resolver>();
@@ -297,6 +298,7 @@ void FileHandle::CloseReq::Resolve() {
297298void FileHandle::CloseReq::Reject (Local<Value> reason) {
298299 Isolate* isolate = env ()->isolate ();
299300 HandleScope scope (isolate);
301+ Context::Scope context_scope (env ()->context ());
300302 InternalCallbackScope callback_scope (this );
301303 Local<Promise> promise = promise_.Get (isolate);
302304 Local<Promise::Resolver> resolver = promise.As <Promise::Resolver>();
You can’t perform that action at this time.
0 commit comments