Skip to content

process/worker: env descriptor validation, worker execArgv policy table with per-worker --expose-gc (+3 tests, worker 74%→76%) - #34654

Open
cirospaciari wants to merge 74 commits into
ciro/worker-threads-node-testsfrom
claude/process-env-descriptor-validation
Open

process/worker: env descriptor validation, worker execArgv policy table with per-worker --expose-gc (+3 tests, worker 74%→76%)#34654
cirospaciari wants to merge 74 commits into
ciro/worker-threads-node-testsfrom
claude/process-env-descriptor-validation

Merge branch 'ciro/worker-threads-node-tests' into claude/process-env…

18dfe4a
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 8, 2026 in 35m 12s

Code review found 3 potential issues

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

Details

Severity Count
🔴 Important 0
🟡 Nit 3
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/jsc/bindings/JSEnvironmentVariableMap.cpp:735-738 JSEnvironmentVariableMap::put's symbol-key TypeError message diverges from the four siblings 945f6c3 just aligned
🟡 Nit src/jsc/web_worker.rs:587-607 Inheriting workers do not re-run process --require preloads; explicit-execArgv workers do

Annotations

Check warning on line 738 in src/jsc/bindings/JSEnvironmentVariableMap.cpp

See this annotation in the file changed.

@claude claude / Claude Code Review

JSEnvironmentVariableMap::put's symbol-key TypeError message diverges from the four siblings 945f6c38 just aligned

Commit 945f6c38 aligned the symbol-key TypeError message to node/V8's exact "Cannot convert a Symbol value to a string" in `JSSharedEnvMap::put` (here), `JSSharedEnvMap::defineOwnProperty`, and both Windows Proxy traps — but the fifth sibling, `JSEnvironmentVariableMap::put` (~line 130, POSIX main-thread `process.env[Symbol()] = ...`), still reads "Cannot convert a symbol to a string" (lowercase 's', missing 'value'). Since `JSEnvironmentVariableMap::defineOwnProperty` tail-calls `put()`, a vali

Check warning on line 607 in src/jsc/web_worker.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

Inheriting workers do not re-run process --require preloads; explicit-execArgv workers do

The explicit-`execArgv` branch (line 603) appends `parsed.preloads` to the worker, but the `inherit_exec_argv` branch (587-593) only reads `.expose_gc` — so `bun -r ./setup.js app.js` → `new Worker(url)` does NOT re-run `./setup.js` in the worker, while `new Worker(url, {execArgv: process.execArgv})` does; node re-runs it in both. This makes the PR description's *"`new Worker(url, {execArgv: process.execArgv})` and `new Worker(url)` round-trip"* claim false for `-r`/`--require`/`--import`, and t