fix(resolution): a receiver-less JS/TS call never binds to a method - #1759
Merged
Merged
Conversation
`serialize(this.raw)` inside `Record.serialize`, with a module-scope `function serialize` in the same file, resolved onto the method itself: both were exact-name candidates, both same-file, and findBestMatch's line-proximity term always prefers the enclosing method (#1714). In JS/TS a call written without a receiver cannot reach a method at all — methods need `this.`, an object, or a bound reference. The extractor emits `this.m()` and `super.m()` under the bare method name, so the receiver is read back from the call site's own line: when the text there begins with the name itself and nothing but whitespace, an operator or an opener precedes it, the call is bare, and `method` nodes leave the candidate set before ranking. matchFuzzy declines a lone `method` survivor for the same ref. A name the file binds itself also has no cross-file candidate for a bare call. `this.serialize()` and `other.serialize()` are unchanged. Rebased #1735 onto current main (resolved conflicts with sealed-module / cross-file visibility guards from #1719/#1730/#1731). Fixes #1714 Co-authored-by: danusha2345 <ewidusoc498@gmail.com>
This was referenced Sep 8, 2026
Contributor
|
Thanks for landing it — but the head you rebased ( |
bompus
added a commit
to bompus/codegraph
that referenced
this pull request
Sep 8, 2026
Replaces the fork-local carve-out with the version in upstream PR colbymchenry#1760, which fixes the same colbymchenry#1759 regression. Adopting it now means the merge is clean when colbymchenry#1760 lands instead of conflicting in name-matcher.ts. The two differ in approach. The carve-out kept destructuring in declRe and excluded `.getState()` / `get()` initialisers by name; colbymchenry#1760 drops the destructuring alternation from declRe entirely, so a destructured binding is never a candidate, and matches a selector by backreference — the arrow's body must read the member off its OWN parameter. That also reclassifies `const now = opts.now || (() => Date.now())`, which the carve-out kept shadowing. bare-call-no-method, object-literal-methods and ui-steps-api: 25 passed, including colbymchenry#1760's new store-selector test, carried over with it.
This was referenced Sep 14, 2026
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.
Fixes #1714.
Lands/rebases #1735 onto current main (was CONFLICTING).
Receiver-less JS/TS calls never bind to methods; local bindings shadow cross-file names. Keeps main visibility guards.
Verified fail->pass on Linux; bare-call-no-method 5/5; resolution 198/198; tsc clean.
Credit: @danusha2345 (#1735).