Skip to content

worker_threads: honor --no-addons in execArgv after value-taking flags - #32362

Open
robobun wants to merge 9 commits into
mainfrom
farm/e1cad303/worker-execargv-no-addons
Open

worker_threads: honor --no-addons in execArgv after value-taking flags#32362
robobun wants to merge 9 commits into
mainfrom
farm/e1cad303/worker-execargv-no-addons

worker_threads: honor --no-addons in execArgv after value-taking flags

9ae7e91
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jun 15, 2026 in 15m 37s

Code review found 2 potential issues

Found 5 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 2
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/runtime/jsc_hooks.rs:1479-1491 flag_consumes_next_token misses chained shorts ending in a value-taking flag
🟡 Nit src/runtime/jsc_hooks.rs:1502-1509 prev_wants_value not consumed when value token starts with '-'

Annotations

Check warning on line 1491 in src/runtime/jsc_hooks.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

flag_consumes_next_token misses chained shorts ending in a value-taking flag

`flag_consumes_next_token` only matches the exact 2-byte form `-s`, so a chained-short cluster whose *last* character is a value-taking short — e.g. `-br` — returns `false` and the next token is treated as a positional. `StreamingClap::chainging` *does* call `iter.next()` in that case (the `arg.len() <= next_index` branch at `src/clap/streaming.rs:254`), so for `['-br', './preload.js', '--no-addons']` the reference parser consumes `./preload.js` as `-r`'s value and sees `--no-addons`, while this

Check warning on line 1509 in src/runtime/jsc_hooks.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

prev_wants_value not consumed when value token starts with '-'

The `prev_wants_value` consume-and-continue is nested inside `if bytes.first() != Some(&b'-')`, so a value token that itself starts with `-` is never consumed as the previous flag's value — `StreamingClap` pulls the next token via raw `iter.next()` regardless of content. For `['-r', '--', '--no-addons']` this scanner hits the `b"--"` → `break` instead of consuming `'--'` as `-r`'s value, leaving addons enabled (the same false-negative class this PR fixes); hoist the `core::mem::take(&mut prev_wa