Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-12-06 18:35:06 +0300
committerRich Trott <rtrott@gmail.com>2020-12-08 17:56:21 +0300
commite31a99f01b8a92615ce79b845441949424cd1dda (patch)
tree600c64f35bd80bca16f976a26298d2d2e6d848b1 /src/env.cc
parent7a39d892d6a257a9443c8e9bedad6d412359864b (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.cc2
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_));