1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:48:12 +00:00

LibJS: Simplify Generator::perform_needed_unwinds

This does not need to cater to the needs of `break` and `continue
anymore, which allows us to simplify it a bit.
This commit is contained in:
Hendiadyoin1 2022-11-25 16:42:29 +01:00 committed by Linus Groh
parent d65488b80c
commit 088dc1b24b
2 changed files with 5 additions and 18 deletions

View file

@ -2474,8 +2474,7 @@ static Bytecode::CodeGenerationErrorOr<ForInOfHeadEvaluationResult> for_in_of_he
// i. Return Completion Record { [[Type]]: break, [[Value]]: empty, [[Target]]: empty }.
generator.switch_to_basic_block(nullish_block);
generator.perform_needed_unwinds<Bytecode::Op::Jump>(true);
generator.emit<Bytecode::Op::Jump>().set_targets(generator.nearest_breakable_scope(), {});
generator.generate_break();
generator.switch_to_basic_block(continuation_block);
// b. Let obj be ! ToObject(exprValue).