Bug 235925

Summary: [Modules] ES module link errors should be reported unmuted from script elements
Product: WebKit Reporter: Asumu Takikawa <asumu>
Component: WebCore JavaScriptAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Asumu Takikawa 2022-01-31 16:08:54 PST
Currently some WPT tests related to ES module link errors are failing (https://github.com/WebKit/WebKit/blob/4b4206d9a657984bcd1c01379a62de494afcaa69/LayoutTests/imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/instantiation-error-1-expected.txt) because the linking errors are muted (i.e., the error message is just "Script error.") and don't include the full error message/error value in the ErrorEvent. Since module scripts shouldn't have muted errors, these messages should get reported in full.
Comment 1 Asumu Takikawa 2022-01-31 18:05:08 PST
Created attachment 450488 [details]
Patch
Comment 2 Yusuke Suzuki 2022-02-01 23:58:24 PST
Comment on attachment 450488 [details]
Patch

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

r=me

> Source/WebCore/bindings/js/ScriptController.cpp:215
> +        reportException(&lexicalGlobalObject, evaluationException, nullptr, /* fromModule */ true);

I recommend using a boolean variable here to name it.

constexpr bool fromModule = true;
reportException(&lexicalGlobalObject, evaluationException, nullptr, fromModule);
Comment 3 Asumu Takikawa 2022-02-02 09:00:04 PST
Created attachment 450653 [details]
Patch
Comment 4 EWS 2022-02-02 12:53:04 PST
Committed r288989 (246708@main): <https://commits.webkit.org/246708@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 450653 [details].
Comment 5 Radar WebKit Bug Importer 2022-02-02 12:54:17 PST
<rdar://problem/88396643>