mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:48:11 +00:00
LibJS: Make "break" actually work inside "switch"
This commit is contained in:
parent
9d099835f9
commit
e3b92caa6d
3 changed files with 33 additions and 1 deletions
|
@ -980,8 +980,13 @@ Value SwitchStatement::execute(Interpreter& interpreter) const
|
|||
statement.execute(interpreter);
|
||||
if (interpreter.exception())
|
||||
return {};
|
||||
if (interpreter.should_unwind())
|
||||
if (interpreter.should_unwind()) {
|
||||
if (interpreter.should_unwind_until(ScopeType::Breakable)) {
|
||||
interpreter.stop_unwind();
|
||||
return {};
|
||||
}
|
||||
return {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue