[webkit-reviews] review granted: [Bug 204151] Automation: evaluateJavaScriptFunction should use Promises : [Attachment 387089] Rebased patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Jan 9 12:05:52 PST 2020
Brian Burg <bburg at apple.com> has granted Carlos Garcia Campos
<cgarcia at igalia.com>'s request for review:
Bug 204151: Automation: evaluateJavaScriptFunction should use Promises
https://bugs.webkit.org/show_bug.cgi?id=204151
Attachment 387089: Rebased patch
https://bugs.webkit.org/attachment.cgi?id=387089&action=review
--- Comment #6 from Brian Burg <bburg at apple.com> ---
Comment on attachment 387089
--> https://bugs.webkit.org/attachment.cgi?id=387089
Rebased patch
View in context: https://bugs.webkit.org/attachment.cgi?id=387089&action=review
r=me, nice work!
> Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.cpp:198
> + } else if (JSValueIsObject(context, arguments[2])) {
I like this change.
> Source/WebKit/WebProcess/Automation/WebAutomationSessionProxy.js:102
> + // finishes resolved, so we need to start a new one here to wait for
the second promise to be reolved or the timeout.
Nit: resolved
So in other words, `resultPromise` could resolve to a Promise that is not
settled (because we passed the `resolve` for the inner racing promise), so it
has to be waited. It's a little tragic to have to do this, but I guess I can't
think of an alternative if we can't assume anything about the callback's
argument type.
More information about the webkit-reviews
mailing list