Chromium Code Reviews| Index: src/parser.cc |
| diff --git a/src/parser.cc b/src/parser.cc |
| index 184f0a2a27efd2c7104c67dcfa63469b1f71ed84..20873f7b5f8c40f6cd8a88c2dd9f00225e255e8a 100644 |
| --- a/src/parser.cc |
| +++ b/src/parser.cc |
| @@ -1478,9 +1478,15 @@ Block* Parser::ParseBlock(ZoneStringList* labels, bool* ok) { |
| Block* result = new(zone()) Block(labels, 16, false); |
| Target target(&this->target_stack_, result); |
| Expect(Token::LBRACE, CHECK_OK); |
| + InitializationBlockFinder block_finder; |
| while (peek() != Token::RBRACE) { |
| Statement* stat = ParseStatement(NULL, CHECK_OK); |
| - if (stat && !stat->IsEmpty()) result->AddStatement(stat); |
| + if (stat && !stat->IsEmpty()) { |
| + result->AddStatement(stat); |
| + if (top_scope_->is_global_scope()) { |
|
Vyacheslav Egorov (Chromium)
2011/07/06 13:07:51
I think this if needs the same kind of comment it
Kevin Millikin (Chromium)
2011/07/06 13:15:03
I think it needs to be top_scope_->DeclarationScop
|
| + block_finder.Update(stat); |
| + } |
| + } |
| } |
| Expect(Token::RBRACE, CHECK_OK); |
| return result; |