You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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: