summaryrefslogtreecommitdiff
path: root/src/node_task_queue.cc
diff options
context:
space:
mode:
authorAnna Henningsen <anna@addaleax.net>2020-12-08 22:48:02 +0100
committerAnna Henningsen <anna@addaleax.net>2020-12-13 22:03:45 +0100
commitc6c83374028c44d280dd7eaa767348eaee3b9502 (patch)
tree5d6183c447ac9e48a9a3c6bebc5f4a837eb0c920 /src/node_task_queue.cc
parenta91a95f8203c6683ad497c0cbd4cb5f48030bd23 (diff)
downloadnode-new-c6c83374028c44d280dd7eaa767348eaee3b9502.tar.gz
src: use correct outer Context’s microtask queue
Fall back to using the outer context’s microtask queue, rather than the Isolate’s default one. This would otherwise result in surprising behavior if an embedder specified a custom microtask queue for the main Node.js context. PR-URL: https://github.com/nodejs/node/pull/36482 Refs: https://github.com/v8/v8/commit/4bf051d536a172e7932845d82f918ad7280c7873 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'src/node_task_queue.cc')
-rw-r--r--src/node_task_queue.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/node_task_queue.cc b/src/node_task_queue.cc
index 926b27fcf2..dff59d8dc7 100644
--- a/src/node_task_queue.cc
+++ b/src/node_task_queue.cc
@@ -96,7 +96,8 @@ static void EnqueueMicrotask(const FunctionCallbackInfo<Value>& args) {
CHECK(args[0]->IsFunction());
- isolate->EnqueueMicrotask(args[0].As<Function>());
+ isolate->GetCurrentContext()->GetMicrotaskQueue()
+ ->EnqueueMicrotask(isolate, args[0].As<Function>());
}
static void RunMicrotasks(const FunctionCallbackInfo<Value>& args) {