fix: gin_helper::MicrotasksScope instantiation (#43185)

This commit is contained in:
Charles Kerr 2024-08-05 08:24:27 -05:00 committed by GitHub
parent e64302cc91
commit 6877671390
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 55 additions and 44 deletions

View file

@ -50,8 +50,9 @@ struct V8FunctionInvoker<v8::Local<v8::Value>(ArgTypes...)> {
return v8::Null(isolate);
v8::Local<v8::Function> holder = function.NewHandle(isolate);
v8::Local<v8::Context> context = holder->GetCreationContextChecked();
gin_helper::MicrotasksScope microtasks_scope(
isolate, context->GetMicrotaskQueue(), true);
gin_helper::MicrotasksScope microtasks_scope{
isolate, context->GetMicrotaskQueue(), true,
v8::MicrotasksScope::kRunMicrotasks};
v8::Context::Scope context_scope(context);
std::vector<v8::Local<v8::Value>> args{
gin::ConvertToV8(isolate, std::forward<ArgTypes>(raw))...};
@ -75,8 +76,9 @@ struct V8FunctionInvoker<void(ArgTypes...)> {
return;
v8::Local<v8::Function> holder = function.NewHandle(isolate);
v8::Local<v8::Context> context = holder->GetCreationContextChecked();
gin_helper::MicrotasksScope microtasks_scope(
isolate, context->GetMicrotaskQueue(), true);
gin_helper::MicrotasksScope microtasks_scope{
isolate, context->GetMicrotaskQueue(), true,
v8::MicrotasksScope::kRunMicrotasks};
v8::Context::Scope context_scope(context);
std::vector<v8::Local<v8::Value>> args{
gin::ConvertToV8(isolate, std::forward<ArgTypes>(raw))...};
@ -99,8 +101,9 @@ struct V8FunctionInvoker<ReturnType(ArgTypes...)> {
return ret;
v8::Local<v8::Function> holder = function.NewHandle(isolate);
v8::Local<v8::Context> context = holder->GetCreationContextChecked();
gin_helper::MicrotasksScope microtasks_scope(
isolate, context->GetMicrotaskQueue(), true);
gin_helper::MicrotasksScope microtasks_scope{
isolate, context->GetMicrotaskQueue(), true,
v8::MicrotasksScope::kRunMicrotasks};
v8::Context::Scope context_scope(context);
std::vector<v8::Local<v8::Value>> args{
gin::ConvertToV8(isolate, std::forward<ArgTypes>(raw))...};