Skip to content

test(vscode): cover object-literal captures in the guard - #1

Merged
ikwach merged 1 commit into
mainfrom
guard/object-literal-captures
Sep 2, 2026
Merged

test(vscode): cover object-literal captures in the guard#1
ikwach merged 1 commit into
mainfrom
guard/object-literal-captures

Conversation

@ikwach

@ikwach ikwach commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Closes the last capture shape noted in the B1 review: a module-scope object literal holding fs/child_process function references. Same descendant selector as the array-literal case, keyed on the watched namespaces. Self-test table grows to 24 banned / 9 allowed; the innocent object literal and a default parameter (evaluated per call) are shown to pass.

This is also the first pull request in this repository, so it doubles as the check that the root workflow fires on the pull_request path and runs the vscode job with its self-tests from the new layout.

`const ops = { exists: fs.existsSync }` captures a function reference at
module load the same way the array-literal form does, and is the more natural
thing to write. Same descendant selector shape, keyed on the watched
namespaces; two banned fixtures (plain and exported-with-optional-chain) and
two innocent ones, including a default parameter, which is evaluated per call
and must stay legal.
@ikwach
ikwach merged commit d2b11fd into main Sep 2, 2026
5 checks passed
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