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:
authorShelley Vohr <shelley.vohr@gmail.com>2019-09-04 08:44:10 +0300
committerRich Trott <rtrott@gmail.com>2019-09-06 09:16:50 +0300
commit63b056d8d4f0696254cd5fc40a69aee0157fc410 (patch)
tree43bb37e0cb8408f499ae3666c09eba73815eacc3 /src/node_task_queue.cc
parent72650bcf7283c7b9eb9df9154f981eabdf8c523a (diff)
src: check microtasks before running them
PR-URL: https://github.com/nodejs/node/pull/29434 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Minwoo Jung <minwoo@nodesource.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 e6b4d0b8e21..4ff51bc3b80 100644
--- a/src/node_task_queue.cc
+++ b/src/node_task_queue.cc
@@ -21,6 +21,7 @@ using v8::kPromiseRejectWithNoHandler;
using v8::kPromiseResolveAfterResolved;
using v8::Local;
using v8::Message;
+using v8::MicrotasksScope;
using v8::Number;
using v8::Object;
using v8::Promise;
@@ -43,7 +44,7 @@ static void EnqueueMicrotask(const FunctionCallbackInfo<Value>& args) {
bool RunNextTicksNative(Environment* env) {
TickInfo* tick_info = env->tick_info();
if (!tick_info->has_tick_scheduled() && !tick_info->has_rejection_to_warn())
- env->isolate()->RunMicrotasks();
+ MicrotasksScope::PerformCheckpoint(env->isolate());
if (!tick_info->has_tick_scheduled() && !tick_info->has_rejection_to_warn())
return true;