Skip to content

Commit

Permalink
fix: forStatement requires LHS
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Nov 7, 2020
1 parent f4faefc commit 76b8566
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/babel-parser/src/parser/statement.js
Expand Up @@ -528,7 +528,7 @@ export default class StatementParser extends ExpressionParser {
const refExpressionErrors = new ExpressionErrors();
const init = this.parseExpression(true, refExpressionErrors);
if (this.match(tt._in) || this.isContextual("of")) {
this.toAssignable(init);
this.toAssignable(init, /* isLHS */ true);
const description = this.isContextual("of")
? "for-of statement"
: "for-in statement";
Expand Down

0 comments on commit 76b8566

Please sign in to comment.