Parse right-hand-side of for/of as an assignment expression (#9767)

This commit is contained in:
Daniel Tschinder
2019-03-25 18:14:56 -07:00
committed by GitHub
parent 2867bbf195
commit 7f4427432c
4 changed files with 9 additions and 8 deletions

View File

@@ -951,7 +951,10 @@ export default class StatementParser extends ExpressionParser {
node.await = awaitAt > -1;
}
node.left = init;
node.right = this.parseExpression();
node.right =
type === "ForInStatement"
? this.parseExpression()
: this.parseMaybeAssign();
this.expect(tt.parenR);
node.body =