Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index 319d468e4d61db43f529e8424139842d7bede8ba..8dafdc9cc8cb26ca5d18aa3d8fd01455ad6d454d 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -3594,7 +3594,8 @@ Statement* Parser::ParseForStatement(ZoneList<const AstRawString*>* labels, |
return nullptr; |
} |
if (parsing_result.first_initializer_loc.IsValid() && |
- (is_strict(language_mode()) || mode == ForEachStatement::ITERATE)) { |
+ (is_strict(language_mode()) || mode == ForEachStatement::ITERATE || |
+ IsLexicalVariableMode(parsing_result.descriptor.mode))) { |
if (mode == ForEachStatement::ITERATE) { |
ReportMessageAt(parsing_result.first_initializer_loc, |
MessageTemplate::kForOfLoopInitializer); |