Bug 235925 - [Modules] ES module link errors should be reported unmuted from script elements
Summary: [Modules] ES module link errors should be reported unmuted from script elements
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-31 16:08 PST by Asumu Takikawa
Modified: 2022-02-02 12:54 PST (History)
2 users (show)

See Also:


Attachments
Patch (13.62 KB, patch)
2022-01-31 18:05 PST, Asumu Takikawa
no flags Details | Formatted Diff | Diff
Patch (13.65 KB, patch)
2022-02-02 09:00 PST, Asumu Takikawa
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>