[webkit-changes] [WebKit/WebKit] a94e85: [WebIDL] JSErrorHandler should restore window.even...

EWS noreply at github.com
Tue Nov 29 16:19:51 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: a94e852bfc69edb31f494b31f0e3c9627e8b7386
      https://github.com/WebKit/WebKit/commit/a94e852bfc69edb31f494b31f0e3c9627e8b7386
  Author: Alexey Shvayka <ashvayka at apple.com>
  Date:   2022-11-29 (Tue, 29 Nov 2022)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/dom/events/event-global-is-still-set-when-reporting-exception-onerror-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/dom/events/event-global-is-still-set-when-reporting-exception-onerror.html
    M Source/WebCore/bindings/js/JSErrorHandler.cpp

  Log Message:
  -----------
  [WebIDL] JSErrorHandler should restore window.event after it reports an exception
https://bugs.webkit.org/show_bug.cgi?id=248452

Reviewed by Darin Adler.

The remark in r286873 that "JSErrorHandler is correct regarding window.error" was only valid
because reportException() was called on the wrong global object, which was fixed in r257086.

This change aligns WebKit with Blink by restoring window.error after exception is reported [1],
making JSErrorHandler consistent with JSEventListener.

[1] https://dom.spec.whatwg.org/#concept-event-listener-inner-invoke (steps 10.2 - 12)

* LayoutTests/imported/w3c/web-platform-tests/dom/events/event-global-is-still-set-when-reporting-exception-onerror-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/dom/events/event-global-is-still-set-when-reporting-exception-onerror.html: Added.
* Source/WebCore/bindings/js/JSErrorHandler.cpp:
(WebCore::JSErrorHandler::handleEvent):

Canonical link: https://commits.webkit.org/257149@main




More information about the webkit-changes mailing list