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:
parent
41184c960d
commit
ba9c4959d6
3 changed files with 44 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue