1
Fork 0
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:
Shannon Booth 2023-07-19 19:44:10 +12:00 committed by Andreas Kling
parent c4bad2186f
commit 663e4507ea
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;