Remove for-in/of loop parsing code that redundantly marks the loop

target as assigned -- Parser::forHeadStart already does this.
This commit is contained in:
wolfbeast 2019-04-06 10:44:48 +02:00 committed by Roy Tam
commit d215447209

View file

@ -5715,12 +5715,6 @@ Parser<ParseHandler>::forStatement(YieldHandling yieldHandling)
stmt.refineForKind(StatementKind::ForOfLoop);
}
if (!handler.isDeclarationList(target)) {
MOZ_ASSERT(!forLoopLexicalScope);
if (!checkAndMarkAsAssignmentLhs(target, PlainAssignment))
return null();
}
// Parser::declaration consumed everything up to the closing ')'. That
// token follows an {Assignment,}Expression, so the next token must be
// consumed as if an operator continued the expression, i.e. as None.