Index: src/parsing/parser.cc |
diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc |
index 01614c4af818884b1c5dbaa673b12e29a471c3ff..691c394ea9426e7a84bcb26c1ad157da45873b28 100644 |
--- a/src/parsing/parser.cc |
+++ b/src/parsing/parser.cc |
@@ -2993,18 +2993,18 @@ TryStatement* Parser::ParseTryStatement(bool* ok) { |
} |
Token::Value tok = peek(); |
+ |
bool catch_for_promise_reject = false; |
+ if (allow_natives() && tok == Token::MOD) { |
+ Consume(Token::MOD); |
+ catch_for_promise_reject = true; |
+ tok = peek(); |
+ } |
+ |
if (tok != Token::CATCH && tok != Token::FINALLY) { |
- if (allow_natives() && tok == Token::MOD) { |
- Consume(Token::MOD); |
- catch_for_promise_reject = true; |
- tok = peek(); |
- DCHECK_EQ(Token::CATCH, tok); |
- } else { |
- ReportMessage(MessageTemplate::kNoCatchOrFinally); |
- *ok = false; |
- return NULL; |
- } |
+ ReportMessage(MessageTemplate::kNoCatchOrFinally); |
+ *ok = false; |
+ return NULL; |
} |
Scope* catch_scope = NULL; |