Skip to content

test(windows): read windowsHide the way an object literal evaluates - #360

Merged
bompus merged 1 commit into
fork/consolidatedfrom
fix/windowshide-guard-spread
Oct 2, 2026
Merged

bompus merged 1 commit into
fork/consolidatedfrom
fix/windowshide-guard-spread

Conversation

@bompus

@bompus bompus commented Oct 2, 2026

Copy link
Copy Markdown
Owner

child-process-windows-hide.test.ts checks that every child_process spawn under src/ sets windowsHide: true. Its object-literal reader only let a spread turn the option on, so { windowsHide: true, ...{ windowsHide: false } } passed although the child would open a console window. This came up in review of #359.

The reader now applies members in source order, the way the literal evaluates:

  • A spread clears an earlier true unless it provably has no windowsHide key.
  • A computed key, shorthand, accessor or method that may set windowsHide clears it too. Quoted keys count.
  • Cycle detection follows the bindings being expanded, so spreading one value twice is no longer taken for a cycle.
  • A parameter is checked against every call. An omitted argument takes the parameter's default, and a spread argument that may supply it makes the parameter unprovable.
  • A loop variable no longer borrows an outer binding's proof.

Variables are still read from their initializers, so a later mutation or a getter's side effect goes unseen. The doc comment says so: the guard catches a forgotten option, not code written to evade it.

Test-only change: no CHANGELOG entry. README rows checked: none describe this guard.

Checks

  • The guard test passes, 3 tests. All current src/ spawn sites pass (36 proven, 2 allowlisted).
  • The new cases fail against the previous reader, and the default, spread-argument and loop cases each fail with their fix removed.
  • Astra xhigh review: PASS in round 4. Rounds 1–3 found the computed-key, shared-reference, default-argument, loop-shadowing and spread-argument cases fixed here. Round 2 also found two limits that are accepted and documented.

The guard only let a spread turn windowsHide on, so
`{ windowsHide: true, ...{ windowsHide: false } }` passed although the
child would get a console. Members now apply in order: a spread clears an
earlier `true` unless it provably has no windowsHide key, and a computed
key, shorthand, accessor or method that may set windowsHide clears it too.
Quoted keys count. Cycle detection follows the bindings being expanded, so
a value spread twice is no longer mistaken for a cycle.

A parameter is now checked against every call. An omitted argument takes
the parameter's default, and a spread argument that may supply it makes
it unprovable. A loop variable no longer borrows an outer binding's proof.
Variables are still read from their initializers; the doc comment says so.
@bompus
bompus merged commit c69f25a into fork/consolidated Oct 2, 2026
@bompus
bompus deleted the fix/windowshide-guard-spread branch October 2, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant