1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-23 18:55:08 +00:00

LibJS: Leave the unwind context on break/continue/return in bytecode

Otherwise we'd keep the old unwind context, and end up never invoking
the other handlers up the stack.
This commit is contained in:
Ali Mohammad Pur 2022-03-13 11:51:02 +03:30 committed by Andreas Kling
parent 41184c960d
commit ba9c4959d6
3 changed files with 44 additions and 2 deletions

View file

@ -79,11 +79,13 @@ Label Generator::nearest_continuable_scope() const
void Generator::begin_continuable_scope(Label continue_target)
{
m_continuable_scopes.append(continue_target);
start_boundary(BlockBoundaryType::Continue);
}
void Generator::end_continuable_scope()
{
m_continuable_scopes.take_last();
end_boundary(BlockBoundaryType::Continue);
}
Label Generator::nearest_breakable_scope() const
{
@ -92,11 +94,13 @@ Label Generator::nearest_breakable_scope() const
void Generator::begin_breakable_scope(Label breakable_target)
{
m_breakable_scopes.append(breakable_target);
start_boundary(BlockBoundaryType::Break);
}
void Generator::end_breakable_scope()
{
m_breakable_scopes.take_last();
end_boundary(BlockBoundaryType::Break);
}
CodeGenerationErrorOr<void> Generator::emit_load_from_reference(JS::ASTNode const& node)