Index: src/parsing/preparser.cc |
diff --git a/src/parsing/preparser.cc b/src/parsing/preparser.cc |
index 9161a1a49a26fd87d4a362611d22fd8a7e42dea8..9dffa836e90edd906151368c43ea2447aa4b9bea 100644 |
--- a/src/parsing/preparser.cc |
+++ b/src/parsing/preparser.cc |
@@ -298,72 +298,6 @@ PreParser::Statement PreParser::ParseForStatement( |
} |
-PreParser::Statement PreParser::ParseTryStatement(bool* ok) { |
- // TryStatement :: |
- // 'try' Block Catch |
- // 'try' Block Finally |
- // 'try' Block Catch Finally |
- // |
- // Catch :: |
- // 'catch' '(' Identifier ')' Block |
- // |
- // Finally :: |
- // 'finally' Block |
- |
- Expect(Token::TRY, CHECK_OK); |
- |
- { |
- ReturnExprScope no_tail_calls(function_state_, |
- ReturnExprContext::kInsideTryBlock); |
- ParseBlock(nullptr, CHECK_OK); |
- } |
- |
- Token::Value tok = peek(); |
- if (tok != Token::CATCH && tok != Token::FINALLY) { |
- ReportMessageAt(scanner()->location(), MessageTemplate::kNoCatchOrFinally); |
- *ok = false; |
- return Statement::Default(); |
- } |
- TailCallExpressionList tail_call_expressions_in_catch_block(zone()); |
- bool catch_block_exists = false; |
- if (tok == Token::CATCH) { |
- Consume(Token::CATCH); |
- Expect(Token::LPAREN, CHECK_OK); |
- Scope* catch_scope = NewScope(CATCH_SCOPE); |
- ExpressionClassifier pattern_classifier(this); |
- ParsePrimaryExpression(CHECK_OK); |
- ValidateBindingPattern(CHECK_OK); |
- Expect(Token::RPAREN, CHECK_OK); |
- { |
- CollectExpressionsInTailPositionToListScope |
- collect_tail_call_expressions_scope( |
- function_state_, &tail_call_expressions_in_catch_block); |
- BlockState block_state(&scope_state_, catch_scope); |
- { |
- BlockState block_state(&scope_state_); |
- ParseBlock(nullptr, CHECK_OK); |
- } |
- } |
- catch_block_exists = true; |
- tok = peek(); |
- } |
- if (tok == Token::FINALLY) { |
- Consume(Token::FINALLY); |
- ParseBlock(nullptr, CHECK_OK); |
- if (FLAG_harmony_explicit_tailcalls && catch_block_exists && |
- tail_call_expressions_in_catch_block.has_explicit_tail_calls()) { |
- // TODO(ishell): update chapter number. |
- // ES8 XX.YY.ZZ |
- ReportMessageAt(tail_call_expressions_in_catch_block.location(), |
- MessageTemplate::kUnexpectedTailCallInCatchBlock); |
- *ok = false; |
- return Statement::Default(); |
- } |
- } |
- return Statement::Default(); |
-} |
- |
- |
// Redefinition of CHECK_OK for parsing expressions. |
#undef CHECK_OK |
#define CHECK_OK CHECK_OK_VALUE(Expression::Default()) |