mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibJS: Propagate finalizers into nested try-catch blocks without them
This commit is contained in:
committed by
Andreas Kling
parent
865e651a7d
commit
301a1fc763
@@ -2510,8 +2510,13 @@ Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> TryStatement::gener
|
||||
if (m_finalizer)
|
||||
generator.end_boundary(Bytecode::Generator::BlockBoundaryType::ReturnToFinally);
|
||||
if (m_handler) {
|
||||
if (!m_finalizer)
|
||||
unwind_context.emplace(generator, OptionalNone());
|
||||
if (!m_finalizer) {
|
||||
auto const* parent_unwind_context = generator.current_unwind_context();
|
||||
if (parent_unwind_context)
|
||||
unwind_context.emplace(generator, parent_unwind_context->finalizer());
|
||||
else
|
||||
unwind_context.emplace(generator, OptionalNone());
|
||||
}
|
||||
unwind_context->set_handler(handler_target.value());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user