mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:27:35 +00:00
Shell: Implement the return
POSIX builtin
This is also available in the regular shell mode, as it's a generally useful builtin to have.
This commit is contained in:
parent
2d1c5dbfcb
commit
a8c7448ccb
4 changed files with 25 additions and 1 deletions
|
@ -1230,7 +1230,7 @@ ErrorOr<RefPtr<Value>> ForLoop::run(RefPtr<Shell> shell)
|
|||
|
||||
size_t consecutive_interruptions = 0;
|
||||
auto run = [&](auto& block_value) {
|
||||
if (shell->has_error(Shell::ShellError::InternalControlFlowBreak)) {
|
||||
if (shell->has_error(Shell::ShellError::InternalControlFlowBreak) || shell->has_error(Shell::ShellError::InternalControlFlowReturn)) {
|
||||
shell->take_error();
|
||||
return IterationDecision::Break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue