diff --git a/src/extensions/gc-extension.cc b/src/extensions/gc-extension.cc index 98cfe7f14f..16fdeb457b 100644 --- a/src/extensions/gc-extension.cc +++ b/src/extensions/gc-extension.cc @@ -5,6 +5,7 @@ #include "src/extensions/gc-extension.h" #include "include/v8-isolate.h" +#include "include/v8-microtask-queue.h" #include "include/v8-object.h" #include "include/v8-persistent-handle.h" #include "include/v8-primitive.h" @@ -121,6 +122,8 @@ class AsyncGC final : public CancelableTask { InvokeGC(isolate_, ExecutionType::kAsync, type_); auto resolver = v8::Local::New(isolate_, resolver_); auto ctx = Local::New(isolate_, ctx_); + v8::MicrotasksScope microtasks_scope( + ctx, v8::MicrotasksScope::kDoNotRunMicrotasks); resolver->Resolve(ctx, v8::Undefined(isolate_)).ToChecked(); }