-
Notifications
You must be signed in to change notification settings - Fork 12
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
[Q] Breaking change? #2
Comments
With |
I think the decision to forbid The only argument I can imagine for disallowing this production, despite the breaking change that it represents, is that the following syntaxes still work: export { from as default }
export default (0, from) Of course, that still leaves the objection that Disambiguating Do newlines create a problem? export default from
"just a string literal expression statement?" This ambiguity is not fatal; we just need to decide what it means. My preference would be to avoid making newlines meaningful, so the above code would be a single |
No, you can't do that because it will change the semantic of current valid code, aka. breaking change. The only option is keep treating it as export default from // <-- ASI
"just a string literal expression statement?" |
I wish JavaScript required semicolons, as that would’ve made many things unambiguous. |
export default from
"string literal" exist in the world...but who knows?
return
{a: 1};
var exp;
do exp; // do expression proposal?
while (0) console.log('ok'); // ASI without line break!!
|
This proposal disallows
export default from;
(which is valid ES2017 code). Is it intentional?Ref: babel/babel#7309
The text was updated successfully, but these errors were encountered: