Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(739)

Unified Diff: src/parser.cc

Issue 7314002: Group property assignments in top-level blocks. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698