From 06e987db041395761ca5830a704f9fd96bf1ceef Mon Sep 17 00:00:00 2001 From: Alex Hultman Date: Fri, 1 Mar 2019 19:04:13 +0100 Subject: [PATCH] Run microtasks after calling JS --- src/addon.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/addon.cpp b/src/addon.cpp index 64c5895..499e68c 100644 --- a/src/addon.cpp +++ b/src/addon.cpp @@ -85,6 +85,9 @@ void Main(Local exports) { /* I guess we store this statically */ isolate = exports->GetIsolate(); + /* We want this */ + isolate->SetMicrotasksPolicy(MicrotasksPolicy::kAuto); + /* Register our own nextTick handlers */ uWS::Loop::defaultLoop()->setPostHandler([](uWS::Loop *) { processNextTickQueueImpl(isolate);