1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:07:34 +00:00

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

@ -57,8 +57,11 @@ public:
void begin_continuable_scope(Label continue_target);
void end_continuable_scope();
void begin_breakable_scope(Label breakable_target);
void end_breakable_scope();
[[nodiscard]] Label nearest_continuable_scope() const;
[[nodiscard]] Label nearest_breakable_scope() const;
void switch_to_basic_block(BasicBlock& block)
{
@ -97,6 +100,7 @@ private:
u32 m_next_register { 1 };
u32 m_next_block { 1 };
Vector<Label> m_continuable_scopes;
Vector<Label> m_breakable_scopes;
};
}