Index: src/parser.cc |
diff --git a/src/parser.cc b/src/parser.cc |
index f122d9aa5e4b57ff1459cfa48e060c666bd407ff..c241375535bf1a9f40e79433fa477feefbf21272 100644 |
--- a/src/parser.cc |
+++ b/src/parser.cc |
@@ -2593,7 +2593,9 @@ void Parser::ParseVariableDeclarations(VariableDeclarationContext var_context, |
} |
// Make sure that 'const x' and 'let x' initialize 'x' to undefined. |
- if (value == NULL && parsing_result->descriptor.needs_init) { |
+ // If in a for-of/in loop, no need to initialize here. |
+ if (value == NULL && parsing_result->descriptor.needs_init && |
+ !is_for_iteration_variable) { |
value = GetLiteralUndefined(position()); |
} |