-
Notifications
You must be signed in to change notification settings - Fork 16
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
document automatic semicolon insertion (ASI) hazard? #49
Comments
Given the stated rules -- never start a line with |
To answer your question, "What exactly is the hazard/risk?", it is that the programmer thought they wrote a program whose parse would give it one meaning but the machine runs it as a program with a different meaning based on a different parse. Without his restrictions and IDE support there are plenty of examples caused by ASI. Given his restrictions and IDE support, I don't know if there are any examples where ASI causes such ambiguity. Here's a tricky non-ASI example. What does the following code do as a script? As a CJS module? As an EcmaScript module? As an EcmaScript module packaged up by your favorite packer, say rollup? let x = 8;
let y = 9;
let z = y <!--x;
console.log(z); |
OK. Thanks. I recall that it simplifies writing a Jessie parser, which is probably enough motivation for this scope. |
What exactly is the hazard / risk?
I filed tgrospic/rnode-client-js#16 asking @tgrospic to avoid it, but when I did so, I struggled to come up with any argument other than authority; i.e. Agoric says so (and Crockford used to say so). @tgrospic is (quite reasonably, as far as I can tell) pushing back.
The text was updated successfully, but these errors were encountered: