mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 20:15:00 +00:00
LibJS: Don't use null DFS for break/continue statements without a label
This commit is contained in:
parent
761d16141d
commit
78491204d9
3 changed files with 17 additions and 17 deletions
|
@ -2199,12 +2199,12 @@ Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> ContinueStatement::
|
|||
// FIXME: Handle finally blocks in a graceful manner
|
||||
// We need to execute the finally block, but tell it to resume
|
||||
// execution at the designated block
|
||||
if (m_target_label.is_null()) {
|
||||
if (!m_target_label.has_value()) {
|
||||
generator.generate_continue();
|
||||
return Optional<Bytecode::Operand> {};
|
||||
}
|
||||
|
||||
generator.generate_continue(m_target_label);
|
||||
generator.generate_continue(m_target_label.value());
|
||||
return Optional<Bytecode::Operand> {};
|
||||
}
|
||||
|
||||
|
@ -2415,12 +2415,12 @@ Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> BreakStatement::gen
|
|||
// FIXME: Handle finally blocks in a graceful manner
|
||||
// We need to execute the finally block, but tell it to resume
|
||||
// execution at the designated block
|
||||
if (m_target_label.is_null()) {
|
||||
if (!m_target_label.has_value()) {
|
||||
generator.generate_break();
|
||||
return Optional<Bytecode::Operand> {};
|
||||
}
|
||||
|
||||
generator.generate_break(m_target_label);
|
||||
generator.generate_break(m_target_label.value());
|
||||
return Optional<Bytecode::Operand> {};
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue