mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-08 05:27:14 +09:00
LibJS: Don't allow TryStatement without catch clause
This commit is contained in:
parent
82ac936a9d
commit
80bb22788f
Notes:
sideshowbarker
2024-07-19 01:47:12 +09:00
Author: https://github.com/linusg
Commit: 80bb22788f
Pull-request: https://github.com/SerenityOS/serenity/pull/3821
Reviewed-by: https://github.com/emanuele6
1 changed files with 1 additions and 4 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue