Skip to content
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

for (;;) marked 'fail', should be 'pass' #18

Closed
jmdyck opened this issue Jun 25, 2018 · 4 comments
Closed

for (;;) marked 'fail', should be 'pass' #18

jmdyck opened this issue Jun 25, 2018 · 4 comments

Comments

@jmdyck
Copy link
Contributor

jmdyck commented Jun 25, 2018

The content of fail/3e6146fd7daff493.js is: for(;;)
I believe ASI rule 2 makes this a valid script, so it should be in pass.

@bmeck
Copy link
Member

bmeck commented Jun 25, 2018

agreed, ASI should convert it to ~ for(;;); which is valid, per reason above

quick ref link: https://tc39.github.io/ecma262/#sec-rules-of-automatic-semicolon-insertion

@michaelficarra
Copy link
Member

No, I think it's right. ASI can't insert empty statements.

However, there is an additional overriding condition on the preceding rules: a semicolon is never inserted automatically if the semicolon would then be parsed as an empty statement or if that semicolon would become one of the two semicolons in the header of a for statement (see 13.7.4).

@jmdyck
Copy link
Contributor Author

jmdyck commented Jun 25, 2018

Ah! Thanks.
(It's unfortunate there aren't explanations to accompany at least some tests.)

@jmdyck jmdyck closed this as completed Jun 25, 2018
@michaelficarra
Copy link
Member

An explanation for a non-program doesn't really make sense to me. I guess we could describe the production that is being parsed when the parse fails? But that doesn't seem too useful.

Explanations for programs already exist in the "explicit" examples.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants