Commit a8dc2c47 authored by adamk's avatar adamk Committed by Commit bot

Remove duplicated ForOfStatement init code code from RewriteSpreads

Simply call InitializeForOfStatement (split out from InitializeForEachStatement)
instead, which already has all the necessary logic.

As part of this, trade one bool arg (is_destructuring) for an int
(iterable_pos).

Review URL: https://codereview.chromium.org/1740293002

Cr-Commit-Position: refs/heads/master@{#34561}
parent d117207a
This diff is collapsed.
......@@ -938,8 +938,10 @@ class Parser : public ParserBase<ParserTraits> {
// Initialize the components of a for-in / for-of statement.
void InitializeForEachStatement(ForEachStatement* stmt, Expression* each,
Expression* subject, Statement* body,
bool is_destructuring);
Expression* subject, Statement* body);
void InitializeForOfStatement(ForOfStatement* stmt, Expression* each,
Expression* iterable, Statement* body,
int iterable_pos);
Statement* DesugarLexicalBindingsInForStatement(
Scope* inner_scope, VariableMode mode,
ZoneList<const AstRawString*>* names, ForStatement* loop, Statement* init,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment