mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibJS: Deduplicate scoped continue & break bytecode generation
The only two differences between these two functions are the name of the block that is created and the specific jump/break handling per boundary.
This commit is contained in:
parent
c4bad2186f
commit
663e4507ea
2 changed files with 26 additions and 36 deletions
|
@ -212,6 +212,12 @@ public:
|
|||
[[nodiscard]] size_t next_global_variable_cache() { return m_next_global_variable_cache++; }
|
||||
|
||||
private:
|
||||
enum class JumpType {
|
||||
Continue,
|
||||
Break,
|
||||
};
|
||||
void generate_scoped_jump(JumpType);
|
||||
|
||||
Generator();
|
||||
~Generator() = default;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue