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:
Shannon Booth
2023-07-19 19:44:10 +12:00
committed by Andreas Kling
parent c4bad2186f
commit 663e4507ea
Notes: sideshowbarker 2024-07-16 22:51:10 +09:00
2 changed files with 26 additions and 36 deletions

View File

@@ -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;