nushell/crates/nu-cmd-lang/src
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
..
core_commands don't allow break/continue in each and items command (#13398) 2024-07-19 00:21:02 -07:00
default_context.rs Remove lazy records (#12682) 2024-05-03 08:36:10 +08:00
example_support.rs Overhaul $in expressions (#13357) 2024-07-17 16:02:42 -05:00
example_test.rs remove def-env and export def-env (#10999) 2023-11-19 23:25:09 +08:00
lib.rs Add top-level crate documentation/READMEs (#12907) 2024-07-14 10:10:41 +02:00