-
Notifications
You must be signed in to change notification settings - Fork 20
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
Should named JSON module import be a parsing stage error? #27
Comments
It’s a host-dependent behavior, and the assertion is not supposed to be required outside a browser. It definitely should error, but probably not at the parsing stage. |
Given this proposal is stage 4, these are the remaining test262 case we are unable to flag as syntax errors:
Should
|
Currently Babel parser throws syntax error for the following cases:
which conforms to this test262 test.
But the spec only states that JSON module should provide only a single default export, so a SyntaxError should be thrown no later than the module resolution stage. However unlike random modules, a parser can recognize JSON module imports thanks to the import assertion syntax. So should a JavaScript parser throw such errors?
Either way an end user will not observe any differences, but it helps us define the scope.
Context: babel/babel#14816
The text was updated successfully, but these errors were encountered: