Title: [289479] trunk
Revision
289479
Author
cdu...@apple.com
Date
2022-02-09 10:05:48 -0800 (Wed, 09 Feb 2022)

Log Message

Exceptions are not properly reported when initializing a worker as a module
https://bugs.webkit.org/show_bug.cgi?id=236334

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT tests that are now passing.

* web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror-expected.txt:
* web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/message-module-DOMException-expected.txt:

Source/WebCore:

No new tests, rebaselined existing tests.

* workers/WorkerOrWorkletScriptController.cpp:
(WebCore::WorkerOrWorkletScriptController::linkAndEvaluateModule):
linkAndEvaluateModule() was failing to report the exception, unlike
evaluate() (which is used for classic workers).

Modified Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (289478 => 289479)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-09 18:05:48 UTC (rev 289479)
@@ -1,5 +1,17 @@
 2022-02-09  Chris Dumez  <cdu...@apple.com>
 
+        Exceptions are not properly reported when initializing a worker as a module
+        https://bugs.webkit.org/show_bug.cgi?id=236334
+
+        Reviewed by Geoffrey Garen.
+
+        Rebaseline WPT tests that are now passing.
+
+        * web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror-expected.txt:
+        * web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/message-module-DOMException-expected.txt:
+
+2022-02-09  Chris Dumez  <cdu...@apple.com>
+
         Stop obfuscating exceptions thrown by scripts in data URLs
         https://bugs.webkit.org/show_bug.cgi?id=236329
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/microtasks/checkpoint-after-workerglobalscope-onerror-module-expected.txt (289478 => 289479)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/microtasks/checkpoint-after-workerglobalscope-onerror-module-expected.txt	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/microtasks/checkpoint-after-workerglobalscope-onerror-module-expected.txt	2022-02-09 18:05:48 UTC (rev 289479)
@@ -1,4 +1,4 @@
 
-FAIL Promise resolved during #report-the-error assert_array_equals: lengths differ, expected array ["handler 1", "handler 2", "handler 1 promise", "handler 2 promise"] length 4, got [] length 0
+FAIL Promise resolved during #report-the-error assert_array_equals: expected property 1 to be "handler 2" but got "handler 1 promise" (expected array ["handler 1", "handler 2", "handler 1 promise", "handler 2 promise"] got ["handler 1", "handler 1 promise", "handler 2", "handler 2 promise"])
 PASS Promise resolved during event handlers other than error
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-sharedworker-expected.txt (289478 => 289479)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-sharedworker-expected.txt	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-sharedworker-expected.txt	2022-02-09 18:05:48 UTC (rev 289479)
@@ -1,3 +1,3 @@
 
-FAIL Test evaluation order of modules assert_array_equals: lengths differ, expected array ["step-1-1", "step-1-2", "microtask", "global-error", "error"] length 5, got ["step-1-1", "step-1-2", "microtask"] length 3
+PASS Test evaluation order of modules
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-worker-expected.txt (289478 => 289479)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-worker-expected.txt	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-1-worker-expected.txt	2022-02-09 18:05:48 UTC (rev 289479)
@@ -1,3 +1,3 @@
 
-FAIL Test evaluation order of modules assert_array_equals: lengths differ, expected array ["step-1-1", "step-1-2", "microtask", "global-error", "error"] length 5, got ["step-1-1", "step-1-2", "microtask"] length 3
+PASS Test evaluation order of modules
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-2-import-sharedworker-expected.txt (289478 => 289479)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-2-import-sharedworker-expected.txt	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-2-import-sharedworker-expected.txt	2022-02-09 18:05:48 UTC (rev 289479)
@@ -1,3 +1,3 @@
 
-FAIL Test evaluation order of modules assert_array_equals: lengths differ, expected array ["step-2.2-1", "step-2.2-2", "microtask-2.2", "global-error", "error"] length 5, got ["step-2.2-1", "step-2.2-2", "microtask-2.2"] length 3
+PASS Test evaluation order of modules
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-2-import-worker-expected.txt (289478 => 289479)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-2-import-worker-expected.txt	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/evaluation-order-2-import-worker-expected.txt	2022-02-09 18:05:48 UTC (rev 289479)
@@ -1,3 +1,3 @@
 
-FAIL Test evaluation order of modules assert_array_equals: lengths differ, expected array ["step-2.2-1", "step-2.2-2", "microtask-2.2", "global-error", "error"] length 5, got ["step-2.2-1", "step-2.2-2", "microtask-2.2"] length 3
+PASS Test evaluation order of modules
 

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror-expected.txt (289478 => 289479)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror-expected.txt	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/exception-in-onerror-expected.txt	2022-02-09 18:05:48 UTC (rev 289479)
@@ -7,8 +7,8 @@
 PASS Throw in setTimeout(string): classic: handler
 PASS Throw in message handler: classic: listener
 PASS Throw in message handler: classic: handler
-FAIL Throw in worker initialization: module: listener assert_unreached: Worker.onerror not fired for: Throw in toplevel Throw in error handler Reached unreachable code
-FAIL Throw in worker initialization: module: handler assert_unreached: Worker.onerror not fired for: Throw in toplevel Throw in error handler Reached unreachable code
+PASS Throw in worker initialization: module: listener
+PASS Throw in worker initialization: module: handler
 PASS Throw in setTimeout(function): module: listener
 PASS Throw in setTimeout(function): module: handler
 PASS Throw in setTimeout(string): module: listener

Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/message-module-DOMException-expected.txt (289478 => 289479)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/message-module-DOMException-expected.txt	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/workers/interfaces/WorkerGlobalScope/onerror/message-module-DOMException-expected.txt	2022-02-09 18:05:48 UTC (rev 289479)
@@ -1,8 +1,6 @@
 
-Harness Error (TIMEOUT), message = null
-
-TIMEOUT Throw DOMException-TypeError in toplevel: module: listener Test timed out
-TIMEOUT Throw DOMException-TypeError in toplevel: module: handler Test timed out
+PASS Throw DOMException-TypeError in toplevel: module: listener
+PASS Throw DOMException-TypeError in toplevel: module: handler
 PASS Throw DOMException-TypeError in setTimeout-function: module: listener
 PASS Throw DOMException-TypeError in setTimeout-function: module: handler
 PASS Throw DOMException-TypeError in setTimeout-string: module: listener

Modified: trunk/Source/WebCore/ChangeLog (289478 => 289479)


--- trunk/Source/WebCore/ChangeLog	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/Source/WebCore/ChangeLog	2022-02-09 18:05:48 UTC (rev 289479)
@@ -1,5 +1,19 @@
 2022-02-09  Chris Dumez  <cdu...@apple.com>
 
+        Exceptions are not properly reported when initializing a worker as a module
+        https://bugs.webkit.org/show_bug.cgi?id=236334
+
+        Reviewed by Geoffrey Garen.
+
+        No new tests, rebaselined existing tests.
+
+        * workers/WorkerOrWorkletScriptController.cpp:
+        (WebCore::WorkerOrWorkletScriptController::linkAndEvaluateModule):
+        linkAndEvaluateModule() was failing to report the exception, unlike
+        evaluate() (which is used for classic workers).
+
+2022-02-09  Chris Dumez  <cdu...@apple.com>
+
         Stop obfuscating exceptions thrown by scripts in data URLs
         https://bugs.webkit.org/show_bug.cgi?id=236329
 

Modified: trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp (289478 => 289479)


--- trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp	2022-02-09 17:43:54 UTC (rev 289478)
+++ trunk/Source/WebCore/workers/WorkerOrWorkletScriptController.cpp	2022-02-09 18:05:48 UTC (rev 289479)
@@ -403,6 +403,9 @@
             if (returnedExceptionMessage)
                 *returnedExceptionMessage = genericErrorMessage;
         }
+
+        JSLockHolder lock(vm);
+        reportException(m_globalScopeWrapper.get(), returnedException);
     }
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to