Commit ff135975 authored by kozyatinskiy's avatar kozyatinskiy Committed by Commit bot

[inspector] run microtasks after async Runtime.evaluate

If promise was resolved before adding handler in Runtime.evaluate method then this callback won't be called. We need to run microtasks after adding handlers.

R=dgozman@chromium.org,alph@chromium.org

Review-Url: https://codereview.chromium.org/2371773004
Cr-Commit-Position: refs/heads/master@{#39793}
parent 34922e8d
...@@ -78,6 +78,8 @@ class ProtocolPromiseHandler { ...@@ -78,6 +78,8 @@ class ProtocolPromiseHandler {
callback->sendFailure(notPromiseError); callback->sendFailure(notPromiseError);
return; return;
} }
v8::MicrotasksScope microtasks_scope(inspector->isolate(),
v8::MicrotasksScope::kRunMicrotasks);
v8::Local<v8::Promise> promise = v8::Local<v8::Promise> promise =
v8::Local<v8::Promise>::Cast(value.ToLocalChecked()); v8::Local<v8::Promise>::Cast(value.ToLocalChecked());
Callback* rawCallback = callback.get(); Callback* rawCallback = callback.get();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment