mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-28 02:27:19 +02: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:
committed by
Andreas Kling
parent
c4bad2186f
commit
663e4507ea
Notes:
sideshowbarker
2024-07-16 22:51:10 +09:00
Author: https://github.com/shannonbooth Commit: https://github.com/SerenityOS/serenity/commit/663e4507ea Pull-request: https://github.com/SerenityOS/serenity/pull/20095
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user