mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 17:15:44 +00:00
LibJS: Restore scheduled jumps in catch blocks without finalizers
This commit is contained in:
committed by
Andreas Kling
parent
301a1fc763
commit
b4b9c4b383
@@ -2461,8 +2461,10 @@ Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> TryStatement::gener
|
||||
auto caught_value = Bytecode::Operand { generator.allocate_register() };
|
||||
generator.emit<Bytecode::Op::Catch>(caught_value);
|
||||
|
||||
if (!m_finalizer)
|
||||
if (!m_finalizer) {
|
||||
generator.emit<Bytecode::Op::LeaveUnwindContext>();
|
||||
generator.emit<Bytecode::Op::RestoreScheduledJump>();
|
||||
}
|
||||
|
||||
// OPTIMIZATION: We avoid creating a lexical environment if the catch clause has no parameter.
|
||||
bool did_create_variable_scope_for_catch_clause = false;
|
||||
|
||||
Reference in New Issue
Block a user