mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibJS: Generate unwind chains for continue in Bytecode
This works similar to `break` The `try-finally-continue` still do not pass with this, likely because of binding issues.
This commit is contained in:
parent
f5376cb282
commit
d65488b80c
Notes:
sideshowbarker
2024-07-16 23:52:22 +09:00
Author: https://github.com/Hendiadyoin1
Commit: d65488b80c
Pull-request: https://github.com/SerenityOS/serenity/pull/16184
Issue: https://github.com/SerenityOS/serenity/issues/16393
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/kleinesfilmroellchen
4 changed files with 55 additions and 19 deletions
|
@ -1972,17 +1972,11 @@ Bytecode::CodeGenerationErrorOr<void> ContinueStatement::generate_bytecode(Bytec
|
|||
// We need to execute the finally block, but tell it to resume
|
||||
// execution at the designated block
|
||||
if (m_target_label.is_null()) {
|
||||
generator.perform_needed_unwinds<Bytecode::Op::Jump>();
|
||||
generator.emit<Bytecode::Op::Jump>().set_targets(
|
||||
generator.nearest_continuable_scope(),
|
||||
{});
|
||||
generator.generate_continue();
|
||||
return {};
|
||||
}
|
||||
|
||||
auto target_to_jump_to = generator.perform_needed_unwinds_for_labelled_continue_and_return_target_block(m_target_label);
|
||||
generator.emit<Bytecode::Op::Jump>().set_targets(
|
||||
target_to_jump_to,
|
||||
{});
|
||||
generator.generate_continue(m_target_label);
|
||||
return {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue