1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 08:35:09 +00:00

LibJS: Don't allow TryStatement without catch clause

This commit is contained in:
Linus Groh 2020-10-22 21:58:01 +01:00 committed by Andreas Kling
parent 82ac936a9d
commit 80bb22788f

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)) {