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

oj requires more semicolons than pure JS #67

Open
iccir opened this issue Nov 7, 2015 · 0 comments
Open

oj requires more semicolons than pure JS #67

iccir opened this issue Nov 7, 2015 · 0 comments

Comments

@iccir
Copy link
Member

iccir commented Nov 7, 2015

I don't have a good fix for this, but I wanted to document the behavior.

JavaScript performs automatic semicolon insertion (ASI), which allows semicolons to be omitted in specific situations:

foo()
foo()

However, this doesn't work in oj:

foo()
[instance foo] // Parse error

In this specific case, the parser thinks that we are in a computed member expression:

foo()
[5]           // "Call foo and then access the 5th member"

parseLeftHandSideExpressionAllowCall(), parseLeftHandSideExpression(), and parseComputedMember() in Esprima would need to be modified to make this possible.

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

1 participant