nushell/crates/nu-cmd-lang/src/core_commands
Wind e8764de3c6
don't allow break/continue in each and items command (#13398)
# Description
Fixes: #11451

# User-Facing Changes
### Before
```nushell
❯ [1 2 3] | each {|e| break; print $e }
╭────────────╮
│ empty list │
╰────────────╯
```

### After
```
❯ [1 2 3] | each {|e| break; print $e }
Error: nu:🐚:eval_block_with_input

  × Eval block failed with pipeline input
   ╭─[entry #9:1:2]
 1 │ [1 2 3] | each {|e| break; print $e }
   ·  ┬
   ·  ╰── source value
   ╰────

Error:   × Break used outside of loop
   ╭─[entry #9:1:21]
 1 │ [1 2 3] | each {|e| break; print $e }
   ·                     ──┬──
   ·                       ╰── used outside of loop
   ╰────
```

# Tests + Formatting
Removes some tests.
2024-07-19 00:21:02 -07:00
..
overlay Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
scope Define keywords (#13213) 2024-06-25 18:32:54 -07:00
alias.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
break_.rs don't allow break/continue in each and items command (#13398) 2024-07-19 00:21:02 -07:00
collect.rs Use pipeline data for http post|put|patch|delete commands. (#13254) 2024-07-01 12:34:19 -07:00
const_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
continue_.rs don't allow break/continue in each and items command (#13398) 2024-07-19 00:21:02 -07:00
def.rs Fix multiple issues with def --wrapped help example (#13123) 2024-06-10 19:12:54 -05:00
describe.rs Add string/binary type color to ByteStream (#12897) 2024-05-20 00:35:32 +00:00
do_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
echo.rs Mention print in the echo help text (#12436) 2024-04-06 20:24:00 -05:00
error_make.rs don't show result in error make examples (#13296) 2024-07-05 07:17:07 -05:00
export_alias.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
export_const.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
export_def.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
export_extern.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
export_module.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
export_use.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
export.rs Make get_full_help take &dyn Command (#12903) 2024-05-19 19:56:33 +02:00
extern_.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
for_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
hide_env.rs nu-cmd-lang cleanup (#12609) 2024-04-25 14:16:12 +00:00
hide.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
if_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
ignore.rs Rename IoStream to OutDest (#12433) 2024-04-09 16:48:32 +00:00
let_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
loop_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
match_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
mod.rs Remove lazy records (#12682) 2024-05-03 08:36:10 +08:00
module.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
mut_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
return_.rs Use CommandType in more places (#12832) 2024-05-18 23:37:31 +00:00
try_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
use_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00
version.rs Allow plugins to report their own version and store it in the registry (#12883) 2024-06-21 06:27:09 -05:00
while_.rs Internal representation (IR) compiler and evaluator (#13330) 2024-07-10 17:33:59 -07:00