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; |
} |