[webkit-reviews] review granted: [Bug 209240] [Web Animations] Mark promises as handled when rejected : [Attachment 393958] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 19 07:35:10 PDT 2020


youenn fablet <youennf at gmail.com> has granted Antoine Quint
<graouts at apple.com>'s request for review:
Bug 209240: [Web Animations] Mark promises as handled when rejected
https://bugs.webkit.org/show_bug.cgi?id=209240

Attachment 393958: Patch

https://bugs.webkit.org/attachment.cgi?id=393958&action=review




--- Comment #3 from youenn fablet <youennf at gmail.com> ---
Comment on attachment 393958
  --> https://bugs.webkit.org/attachment.cgi?id=393958
Patch

Looks ok to me.

I still think we should not be passing a Handled value to reject() in this case
though.
This promise is an attribute or state promise, reject should always be using
Handled.
Instead of leaving the choice here, I would hardcode RejectAsHandled::Yes in
DOMPromiseProxyWithResolveCallback<IDLType>::reject, something like:
inline void DOMPromiseProxyWithResolveCallback<IDLType>::reject(Exception
exception)
{
    ASSERT(!m_valueOrException);

    m_valueOrException = ExceptionOr<void> { WTFMove(exception) };
    for (auto& deferredPromise : m_deferredPromises)
	deferredPromise->reject(m_valueOrException->exception(),
RejectAsHandled::Yes);
}


More information about the webkit-reviews mailing list