LibJS: Don't allow TryStatement without catch clause

This commit is contained in:
Linus Groh
2020-10-22 21:58:01 +01:00
parent a316ca0e0d
commit 9ffe45bc76

View File

@@ -1421,10 +1421,7 @@ NonnullRefPtr<TryStatement> Parser::parse_try_statement()
consume(TokenType::Try);
auto block = parse_block_statement();
RefPtr<CatchClause> handler;
if (match(TokenType::Catch))
handler = parse_catch_clause();
auto handler = parse_catch_clause();
RefPtr<BlockStatement> finalizer;
if (match(TokenType::Finally)) {