fix: avoid template local clash for primitive completions - #2411
Open
Tanvir Alam (tanvir-ux) wants to merge 1 commit into
Open
fix: avoid template local clash for primitive completions#2411Tanvir Alam (tanvir-ux) wants to merge 1 commit into
Tanvir Alam (tanvir-ux) wants to merge 1 commit into
Conversation
When completing properties on a paused primitive whose name matches a local in enumeratePropertiesTemplate (e.g. minified `n`, or `target`), re-evaluating the expression on the call frame binds the template local instead of the user value and completions come back empty. Interpolate the already-evaluated primitive into the template and run it with Runtime.evaluate in the execution context (no call frame). Fixes microsoft#2399
Author
|
@microsoft-github-policy-service agree |
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.
Summary
When completing properties on a paused primitive whose name matches a local in
enumeratePropertiesTemplate(for example minifiedn, ortarget), the helper was re-evaluated on the call frame aslet n = (n)/let target = (target). That binds the template local instead of the user value, so evaluation throws and completions are empty.This change interpolates the already-evaluated primitive into the template and runs it with
Runtime.evaluatein the execution context (no call frame), matching the approach discussed in #2399.Test plan
completes primitive when name clashes with template locals (#2399)integration coverage forn.andtarget.while pausedFixes #2399