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

Unified Diff: src/preparser.h

Issue 4639005: Preparsing now considers catch-blocks as inside a with. (Closed)
Patch Set: Upped version number of preparse data. Created 10 years, 1 month 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 | « src/parser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index 952f25bc60d6d850fa9f4128477804f87cb3ef97..5565154cf99235977c2c0ff356af55b4ec740b44 100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -750,15 +750,18 @@ Statement PreParser<Scanner, Log>::ParseTryStatement(bool* ok) {
bool catch_or_finally_seen = false;
if (peek() == i::Token::CATCH) {
- Expect(i::Token::CATCH, CHECK_OK);
+ Consume(i::Token::CATCH);
Expect(i::Token::LPAREN, CHECK_OK);
ParseIdentifier(CHECK_OK);
Expect(i::Token::RPAREN, CHECK_OK);
- ParseBlock(CHECK_OK);
+ scope_->EnterWith();
+ ParseBlock(ok);
+ scope_->LeaveWith();
+ if (!*ok) return kUnknownStatement;
catch_or_finally_seen = true;
}
if (peek() == i::Token::FINALLY) {
- Expect(i::Token::FINALLY, CHECK_OK);
+ Consume(i::Token::FINALLY);
ParseBlock(CHECK_OK);
catch_or_finally_seen = true;
}
« no previous file with comments | « src/parser.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698