-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent modules from being imported with a type: 'javascript' assertion #7350
Prevent modules from being imported with a type: 'javascript' assertion #7350
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, very nice. Will give people some time over the weekend to double-check.
I think the spec should include some examples and expected outcomes. It’s not clear to me what the spec intends to happen for each of the following: const url = 'data:text/javascript,export default "hello"';
import(url);
import(url, { assert: { type: 'javascript' } });
import(url, { assert: { type: '' } });
import(url, { assert: { type: null } });
import(url, { assert: { type: undefined } }); And if |
Prevent modules from being loaded with a
type: 'javascript'
assertion. This was the original intent of the import assertions integration, buttype: 'javascript'
was unintentionally allowed to work due to a bug involving the spec's internal use of the "javascript" module type for JavaScript module scripts.Chromium already implements the behavior in this PR, i.e. Chromium passes https://github.com/web-platform-tests/wpt/blob/master/html/semantics/scripting-1/the-script-element/import-assertions/invalid-type-assertion-error.html.
Resolves #7342.
/webappapis.html ( diff )