Chromium Code Reviews| Index: src/parsing/parser-base.h | 
| diff --git a/src/parsing/parser-base.h b/src/parsing/parser-base.h | 
| index a85d4f2e6a12622c0b6f05fe792242f33d0c975c..3e160948e852460d642c8f8ab784b6a2accca13d 100644 | 
| --- a/src/parsing/parser-base.h | 
| +++ b/src/parsing/parser-base.h | 
| @@ -5635,8 +5635,6 @@ ParserBase<Impl>::ParseForEachStatementWithDeclarations( | 
| auto loop = factory()->NewForEachStatement(for_info->mode, labels, stmt_pos); | 
| typename Types::Target target(this, loop); | 
| - int each_keyword_pos = scanner()->location().beg_pos; | 
| - | 
| ExpressionT enumerable = impl()->EmptyExpression(); | 
| if (for_info->mode == ForEachStatement::ITERATE) { | 
| ExpressionClassifier classifier(this); | 
| @@ -5662,8 +5660,8 @@ ParserBase<Impl>::ParseForEachStatementWithDeclarations( | 
| impl()->DesugarBindingInForEachStatement(for_info, &body_block, | 
| &each_variable, CHECK_OK); | 
| body_block->statements()->Add(body, zone()); | 
| - final_loop = impl()->InitializeForEachStatement( | 
| - loop, each_variable, enumerable, body_block, each_keyword_pos); | 
| + final_loop = impl()->InitializeForEachStatement(loop, each_variable, | 
| 
 
jgruber
2017/05/23 12:33:57
I'm trying to understand the logic change this CL
 
 | 
| + enumerable, body_block); | 
| scope()->set_end_position(scanner()->location().end_pos); | 
| body_block->set_scope(scope()->FinalizeBlockScope()); | 
| @@ -5700,8 +5698,6 @@ ParserBase<Impl>::ParseForEachStatementWithoutDeclarations( | 
| auto loop = factory()->NewForEachStatement(for_info->mode, labels, stmt_pos); | 
| typename Types::Target target(this, loop); | 
| - int each_keyword_pos = scanner()->location().beg_pos; | 
| - | 
| ExpressionT enumerable = impl()->EmptyExpression(); | 
| if (for_info->mode == ForEachStatement::ITERATE) { | 
| ExpressionClassifier classifier(this); | 
| @@ -5722,8 +5718,8 @@ ParserBase<Impl>::ParseForEachStatementWithoutDeclarations( | 
| StatementT body = ParseStatement(nullptr, CHECK_OK); | 
| scope()->set_end_position(scanner()->location().end_pos); | 
| - StatementT final_loop = impl()->InitializeForEachStatement( | 
| - loop, expression, enumerable, body, each_keyword_pos); | 
| + StatementT final_loop = | 
| + impl()->InitializeForEachStatement(loop, expression, enumerable, body); | 
| 
 
jgruber
2017/05/23 12:33:57
While here it all depends on whether expression's
 
kozy
2017/05/23 12:56:28
It's not just refactoring, location for for..of lo
 
 | 
| for_scope = for_scope->FinalizeBlockScope(); | 
| USE(for_scope); |