test(vscode): cover object-literal captures in the guard - #1
Merged
Conversation
`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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.