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.
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:
However, this doesn't work in oj:
In this specific case, the parser thinks that we are in a computed member expression:
parseLeftHandSideExpressionAllowCall()
,parseLeftHandSideExpression()
, andparseComputedMember()
in Esprima would need to be modified to make this possible.