| Index: src/inspector/v8-runtime-agent-impl.cc
|
| diff --git a/src/inspector/v8-runtime-agent-impl.cc b/src/inspector/v8-runtime-agent-impl.cc
|
| index 7d8c246e7f50be06bd34ec1e6ee9c90bfacf33b9..9b4944aa575ceacb14f4b0367540662b4c127d75 100644
|
| --- a/src/inspector/v8-runtime-agent-impl.cc
|
| +++ b/src/inspector/v8-runtime-agent-impl.cc
|
| @@ -297,7 +297,9 @@ void V8RuntimeAgentImpl::evaluate(
|
| v8::Local<v8::Script> script;
|
| if (m_inspector->compileScript(scope.context(), expression, String16())
|
| .ToLocal(&script)) {
|
| - maybeResultValue = m_inspector->runCompiledScript(scope.context(), script);
|
| + v8::MicrotasksScope microtasksScope(m_inspector->isolate(),
|
| + v8::MicrotasksScope::kRunMicrotasks);
|
| + maybeResultValue = script->Run(scope.context());
|
| }
|
|
|
| if (evalIsDisabled) scope.context()->AllowCodeGenerationFromStrings(false);
|
| @@ -385,8 +387,9 @@ void V8RuntimeAgentImpl::callFunctionOn(
|
| if (m_inspector
|
| ->compileScript(scope.context(), "(" + expression + ")", String16())
|
| .ToLocal(&functionScript)) {
|
| - maybeFunctionValue =
|
| - m_inspector->runCompiledScript(scope.context(), functionScript);
|
| + v8::MicrotasksScope microtasksScope(m_inspector->isolate(),
|
| + v8::MicrotasksScope::kRunMicrotasks);
|
| + maybeFunctionValue = functionScript->Run(scope.context());
|
| }
|
| // Re-initialize after running client's code, as it could have destroyed
|
| // context or session.
|
| @@ -411,9 +414,13 @@ void V8RuntimeAgentImpl::callFunctionOn(
|
| return;
|
| }
|
|
|
| - v8::MaybeLocal<v8::Value> maybeResultValue = m_inspector->callFunction(
|
| - functionValue.As<v8::Function>(), scope.context(), scope.object(), argc,
|
| - argv.get());
|
| + v8::MaybeLocal<v8::Value> maybeResultValue;
|
| + {
|
| + v8::MicrotasksScope microtasksScope(m_inspector->isolate(),
|
| + v8::MicrotasksScope::kRunMicrotasks);
|
| + maybeResultValue = functionValue.As<v8::Function>()->Call(
|
| + scope.context(), scope.object(), argc, argv.get());
|
| + }
|
| // Re-initialize after running client's code, as it could have destroyed
|
| // context or session.
|
| response = scope.initialize();
|
| @@ -620,8 +627,12 @@ void V8RuntimeAgentImpl::runScript(
|
|
|
| if (includeCommandLineAPI.fromMaybe(false)) scope.installCommandLineAPI();
|
|
|
| - v8::MaybeLocal<v8::Value> maybeResultValue =
|
| - m_inspector->runCompiledScript(scope.context(), script);
|
| + v8::MaybeLocal<v8::Value> maybeResultValue;
|
| + {
|
| + v8::MicrotasksScope microtasksScope(m_inspector->isolate(),
|
| + v8::MicrotasksScope::kRunMicrotasks);
|
| + maybeResultValue = script->Run(scope.context());
|
| + }
|
|
|
| // Re-initialize after running client's code, as it could have destroyed
|
| // context or session.
|
|
|