[webkit-reviews] review granted: [Bug 218363] Promises returned by our DOM API have the caller's global instead of the callee's : [Attachment 412792] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Oct 30 16:06:13 PDT 2020


Darin Adler <darin at apple.com> has granted Chris Dumez <cdumez at apple.com>'s
request for review:
Bug 218363: Promises returned by our DOM API have the caller's global instead
of the callee's
https://bugs.webkit.org/show_bug.cgi?id=218363

Attachment 412792: Patch

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




--- Comment #11 from Darin Adler <darin at apple.com> ---
Comment on attachment 412792
  --> https://bugs.webkit.org/attachment.cgi?id=412792
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=412792&action=review

> Source/WebCore/bindings/js/JSDOMPromiseDeferred.h:317
> +    auto& globalObject =
*JSC::jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject);

What guarantees this? I guess maybe it’s obvious, but I wasn’t sure.

> Source/WebCore/bindings/js/JSDOMPromiseDeferred.h:336
> +    auto& globalObject =
*JSC::jsCast<JSDOMGlobalObject*>(&lexicalGlobalObject);

Ditto.

> Source/WebCore/dom/EventLoop.cpp:82
> +    auto associatedGroup = std::exchange(m_associatedGroups, { });

Should be plural, associatedGroups.

> Source/WebCore/dom/EventLoop.h:140
> +	   m_isReadyToStop = true;
> +	   if (m_eventLoop)
> +	       m_eventLoop->stopAssociatedGroupsIfNecessary();

Is it correct to call stopAssociatedGroupsIfNecessary even if m_isReadyToStop
was already true?


More information about the webkit-reviews mailing list