LibJS: Implement bytecode generation for BreakStatement

This commit is contained in:
xyanrch
2021-06-10 20:28:43 +08:00
committed by Ali Mohammad Pur
parent 73cf16f643
commit a0412e0d5e
4 changed files with 31 additions and 3 deletions

View File

@@ -62,5 +62,17 @@ void Generator::end_continuable_scope()
{
m_continuable_scopes.take_last();
}
Label Generator::nearest_breakable_scope() const
{
return m_breakable_scopes.last();
}
void Generator::begin_breakable_scope(Label breakable_target)
{
m_breakable_scopes.append(breakable_target);
}
void Generator::end_breakable_scope()
{
m_breakable_scopes.take_last();
}
}