mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 15:16:14 +00:00
LibJS: Make "break" actually work inside "switch"
This commit is contained in:
@@ -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 {};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user