Chromium Code Reviews| Index: src/parser.cc |
| diff --git a/src/parser.cc b/src/parser.cc |
| index a626d99fa0a078cbaffb97deb3fb448e4d6c8dd2..061abb2b634f360423199c0aa634423cec463115 100644 |
| --- a/src/parser.cc |
| +++ b/src/parser.cc |
| @@ -2839,17 +2839,20 @@ Statement* Parser::ParseForStatement(ZoneStringList* labels, bool* ok) { |
| Variable* temp = top_scope_->DeclarationScope()->NewTemporary(name); |
| VariableProxy* temp_proxy = factory()->NewVariableProxy(temp); |
| Interface* interface = Interface::NewValue(); |
|
Michael Starzinger
2012/10/05 08:42:36
Can we also move the interface down right before t
rossberg
2012/10/05 09:15:02
Inlined instead.
|
| - VariableProxy* each = |
| - top_scope_->NewUnresolved(factory(), name, interface); |
| ForInStatement* loop = factory()->NewForInStatement(labels); |
| Target target(&this->target_stack_, loop); |
| + // The expression does not see the loop variable. |
| Expect(Token::IN, CHECK_OK); |
| + top_scope_ = saved_scope; |
| Expression* enumerable = ParseExpression(true, CHECK_OK); |
| + top_scope_ = for_scope; |
| Expect(Token::RPAREN, CHECK_OK); |
| Statement* body = ParseStatement(NULL, CHECK_OK); |
| Block* body_block = factory()->NewBlock(NULL, 3, false); |
| + VariableProxy* each = |
| + top_scope_->NewUnresolved(factory(), name, interface); |
| Assignment* assignment = factory()->NewAssignment( |
| Token::ASSIGN, each, temp_proxy, RelocInfo::kNoPosition); |
| Statement* assignment_statement = |