Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5f69c9c98e098d5178fad176045eec16c393f10f
      
https://github.com/WebKit/WebKit/commit/5f69c9c98e098d5178fad176045eec16c393f10f
  Author: Anne van Kesteren <[email protected]>
  Date:   2026-05-06 (Wed, 06 May 2026)

  Changed paths:
    M LayoutTests/imported/w3c/web-platform-tests/workers/abrupt-completion.html
    M 
LayoutTests/imported/w3c/web-platform-tests/workers/constructors/Worker/constructor-utf16-bom-expected.txt
    M 
LayoutTests/imported/w3c/web-platform-tests/workers/dedicated-worker-parse-error-failure-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/workers/dedicated-worker-runtime-error-is-not-parse-error-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/workers/dedicated-worker-runtime-error-is-not-parse-error.html
    M 
LayoutTests/imported/w3c/web-platform-tests/workers/shared-worker-parse-error-failure-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/workers/shared-worker-runtime-error-is-not-parse-error-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/workers/shared-worker-runtime-error-is-not-parse-error.html
    A 
LayoutTests/imported/w3c/web-platform-tests/workers/support/eval-syntax-error.js
    A 
LayoutTests/imported/w3c/web-platform-tests/workers/support/json-parse-error.js
    A 
LayoutTests/imported/w3c/web-platform-tests/workers/support/shared-worker-eval-syntax-error.js
    A 
LayoutTests/imported/w3c/web-platform-tests/workers/support/shared-worker-json-parse-error.js
    M Source/JavaScriptCore/parser/ParserError.h
    M Source/JavaScriptCore/runtime/ErrorInstance.cpp
    M Source/JavaScriptCore/runtime/ErrorInstance.h
    M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
    M Source/WebCore/workers/WorkerOrWorkletScriptController.cpp
    M Source/WebCore/workers/WorkerOrWorkletScriptController.h
    M Source/WebCore/workers/WorkerThread.cpp
    M Source/WebCore/workers/shared/context/SharedWorkerThreadProxy.cpp

  Log Message:
  -----------
  Parse errors in workers should be reported to the parent
https://bugs.webkit.org/show_bug.cgi?id=312709

Reviewed by Chris Dumez and Keith Miller.

Per the specification we should report script parse errors to the
Worker or SharedWorker object:
https://html.spec.whatwg.org/multipage/workers.html#run-a-worker has a
step that deals with "error to rethrow" which is initialized in
https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-classic-script
with the result of ECMAScript's ParseScript.

Runtime errors however should only go to
the Worker object as detailed here:
https://html.spec.whatwg.org/multipage/webappapis.html#report-an-exception

This mostly matches Gecko. Although the risk should be minimal, we
preference-gate it behind WorkerParseErrorReportingEnabled just in
case.

Tests: 
imported/w3c/web-platform-tests/workers/dedicated-worker-runtime-error-is-not-parse-error.html
       
imported/w3c/web-platform-tests/workers/shared-worker-runtime-error-is-not-parse-error.html

Upstream: https://github.com/web-platform-tests/wpt/pull/59652
Canonical link: https://commits.webkit.org/312701@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to