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

no semicolon after var/let/const does not allow expression on next line #751

Closed
danez opened this issue Nov 4, 2018 · 2 comments
Closed

Comments

@danez
Copy link
Contributor

danez commented Nov 4, 2018

function a() {
  let x
  /asd/g
}

or with jsx

function a() {
  let x
  <asd />
}

both should work as ASI is supposed to add a semicolon after the variable declaration.

Chrome parses the first one correctly.

Tried with acorn 6.0.2

@marijnh
Copy link
Member

marijnh commented Nov 5, 2018

Related to #589 (again). This one actually seems really hard to address with the current stand-alone-tokenizer approach

@marijnh
Copy link
Member

marijnh commented Nov 5, 2018

Attached patch should address this for regular expressions (and probably all further issues in this class). Could you open a separate issue on acorn-jsx? This approach won't help there—the tokenizer doesn't know an expression is coming up in this situation, so that plugin will need a similar kludge.

@marijnh marijnh closed this as completed Nov 5, 2018
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

2 participants