Closed gabejohnson closed 7 years ago
I'd like to add a test for this.
@disnet I just noticed that the test262
tests don't check to see that the parse was correct. Just that it returned a result. How would you suggest I test this? We got rid of all of the parser tests when you added the test262
stuff.
This is not the answer as this:
{
foo = new bar()['a']
baz = foo
}
results in:
{
foo = baz = foo
}
The problem appears to be what's happening when you encounter an identifier in the loop. I think breaking if this.term != null
is the way to go.
Nice job tracking this down!
For tests I think what you should do is assert that the AST for the code with a semicolon is the same as the AST without the semicolon.
both result in:
This is because after enforestation of either a
CallExpression
or aNewExpression
the while loop inenforestLeftHandSideExpression
was either entered (in the case ofNewExpression
) or continued (in the case ofCallExpression
).This PR fixes that by breaking or returning respectively.
Fixes #600 and fixes #591