mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Make "break" actually work inside "switch"
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 07:55:24 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e3b92caa6d9
@@ -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