Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 30b048996869293c2250afdbfe9121813011512e..efb76fd5d8ac0eccf8b14e223ab4e3b0bae84ae1 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -1967,14 +1967,13 @@ void Parser::DesugarBindingInForEachStatement(ForInfo* for_info, |
bool is_for_var_of = |
for_info->mode == ForEachStatement::ITERATE && |
for_info->parsing_result.descriptor.mode == VariableMode::VAR; |
+ bool collect_names = |
+ IsLexicalVariableMode(for_info->parsing_result.descriptor.mode) || |
+ is_for_var_of; |
PatternRewriter::DeclareAndInitializeVariables( |
this, each_initialization_block, &descriptor, &decl, |
- (IsLexicalVariableMode(for_info->parsing_result.descriptor.mode) || |
- is_for_var_of) |
- ? &for_info->bound_names |
- : nullptr, |
- CHECK_OK_VOID); |
+ collect_names ? &for_info->bound_names : nullptr, CHECK_OK_VOID); |
// Annex B.3.5 prohibits the form |
// `try {} catch(e) { for (var e of {}); }` |