WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
246207
Modules with invalid "type" assertion should throw
https://bugs.webkit.org/show_bug.cgi?id=246207
Summary
Modules with invalid "type" assertion should throw
Nicolò Ribaudo
Reported
2022-10-07 03:14:47 PDT
Consider these two files: // main.js await import("./dep.js", { assert: { type: "<invalid>" } }); // dep.js console.log("Hi from dep!"); Step 6 of
https://html.spec.whatwg.org/#fetch-an-import()-module-script-graph
stops the import process if "type" is not a supported type assertion, so dep.js shouldn't be fetched and executed. However, WebKit ignores the "type" assertions and loads dep.js as JavaScript. Tested in Epiphani TP 43.0-12. I believe that this bug comes from the .value_or call at
https://github.com/WebKit/WebKit/blob/5d0f369579801f91293bcae0845cca26c816ea44/Source/WebCore/bindings/js/ScriptModuleLoader.cpp#L318
.
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2022-10-14 03:15:18 PDT
<
rdar://problem/101166148
>
Yusuke Suzuki
Comment 2
2022-10-14 15:35:44 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/5399
EWS
Comment 3
2022-10-15 01:26:00 PDT
Committed
255574@main
(902de48a7da9): <
https://commits.webkit.org/255574@main
> Reviewed commits have been landed. Closing PR #5399 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug