diff options
author | Anna Henningsen <anna@addaleax.net> | 2020-12-06 18:35:06 +0300 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2020-12-08 17:56:21 +0300 |
commit | e31a99f01b8a92615ce79b845441949424cd1dda (patch) | |
tree | 600c64f35bd80bca16f976a26298d2d2e6d848b1 /src/env.cc | |
parent | 7a39d892d6a257a9443c8e9bedad6d412359864b (diff) |
src: add missing context scopes
Add scopes that ensure that the context associated with the
current Environment is always entered when working with it.
PR-URL: https://github.com/nodejs/node/pull/36413
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/env.cc')
-rw-r--r-- | src/env.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/env.cc b/src/env.cc index 3e03ba9121f..341f62e1790 100644 --- a/src/env.cc +++ b/src/env.cc @@ -539,6 +539,8 @@ void Environment::InitializeLibuv() { [](uv_async_t* async) { Environment* env = ContainerOf( &Environment::task_queues_async_, async); + HandleScope handle_scope(env->isolate()); + Context::Scope context_scope(env->context()); env->RunAndClearNativeImmediates(); }); uv_unref(reinterpret_cast<uv_handle_t*>(&task_queues_async_)); |