src: perform check before running in runMicrotasks()

This is a continuation of https://github.com/nodejs/node/pull/29434,
rewriting the last remaining call to RunMicrotasks.

PR-URL: https://github.com/nodejs/node/pull/29581
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Minwoo Jung <minwoo@nodesource.com>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
Jeremy Apthorp 2019-09-16 13:27:39 -04:00 committed by Rich Trott
parent d398b8f02b
commit 4ef3ccbbe0

View File

@ -56,7 +56,7 @@ bool RunNextTicksNative(Environment* env) {
} }
static void RunMicrotasks(const FunctionCallbackInfo<Value>& args) { static void RunMicrotasks(const FunctionCallbackInfo<Value>& args) {
args.GetIsolate()->RunMicrotasks(); MicrotasksScope::PerformCheckpoint(args.GetIsolate());
} }
static void SetTickCallback(const FunctionCallbackInfo<Value>& args) { static void SetTickCallback(const FunctionCallbackInfo<Value>& args) {