Run microtasks after calling JS

This commit is contained in:
Alex Hultman 2019-03-01 19:04:13 +01:00
parent 42c66b2f00
commit 06e987db04
1 changed files with 3 additions and 0 deletions

View File

@ -85,6 +85,9 @@ void Main(Local<Object> exports) {
/* I guess we store this statically */ /* I guess we store this statically */
isolate = exports->GetIsolate(); isolate = exports->GetIsolate();
/* We want this */
isolate->SetMicrotasksPolicy(MicrotasksPolicy::kAuto);
/* Register our own nextTick handlers */ /* Register our own nextTick handlers */
uWS::Loop::defaultLoop()->setPostHandler([](uWS::Loop *) { uWS::Loop::defaultLoop()->setPostHandler([](uWS::Loop *) {
processNextTickQueueImpl(isolate); processNextTickQueueImpl(isolate);