Index: src/parsing/preparser.cc |
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc |
index b04fa792249f81e279f70c039335e26e2187d003..6eb220921c3a7165c74d6d83ed15f38d499105fb 100644 |
--- a/src/parsing/preparser.cc |
+++ b/src/parsing/preparser.cc |
@@ -591,12 +591,7 @@ PreParser::Statement PreParser::ParseVariableDeclarations( |
} |
} |
- is_pattern = (pattern.IsObjectLiteral() || pattern.IsArrayLiteral()) && |
- !pattern.is_parenthesized(); |
- |
- bool is_for_iteration_variable = |
- var_context == kForStatement && |
- (peek() == Token::IN || PeekContextualKeyword(CStrVector("of"))); |
+ is_pattern = pattern.IsObjectLiteral() || pattern.IsArrayLiteral(); |
Scanner::Location variable_loc = scanner()->location(); |
nvars++; |
@@ -611,7 +606,7 @@ PreParser::Statement PreParser::ParseVariableDeclarations( |
*first_initializer_loc = variable_loc; |
} |
} else if ((require_initializer || is_pattern) && |
- !is_for_iteration_variable) { |
+ (var_context != kForStatement || !PeekInOrOf())) { |
PreParserTraits::ReportMessageAt( |
Scanner::Location(decl_pos, scanner()->location().end_pos), |
MessageTemplate::kDeclarationMissingInitializer, |