| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
… match
class D extends A { constructor(y) { super(y); } } where A is an ES5-style
function-based pseudo-class (not an ES6 class) caused resolveCallTargets
(call-resolver.ts, mirrored by resolve_call_targets_core in build_edges.rs)
to fabricate a calls edge from D.constructor to any unrelated same-named
constructor reachable via the bare same-file lookup or the project-wide
"exact global match" fallback tier -- because A has no qualified
A.constructor node for resolveThisDispatch's CHA ancestor walk to find, and
neither engine's super resolution excluded coincidental same-name matches
the way this/self dispatch legitimately can.
Excludes super from those non-CHA-aware fallback tiers, but only when the
caller is inside a real class (RECEIVER_KINDS-kind declaration), where
super is syntactically guaranteed to have a real extends target CHA can
verify. An object-literal method using dynamic prototype linkage
(Object.setPrototypeOf, obj.__proto__ = ...) has no static extends clause
for CHA to check at all, so the bare/global fallback still applies there --
confirmed by the jelly-micro super/super3 fixtures' own recall floors,
which caught an initial overly-broad version of this fix.
Closes #2244
Impact: 3 functions changed, 0 affected
Greptile SummaryThe PR prevents real-class super calls from resolving to unrelated same-named symbols while preserving heuristic fallback resolution for object-literal methods using dynamic prototype linkage.
Confidence Score: 5/5The PR appears safe to merge, with no actionable correctness, security, or parity issue identified. The TypeScript and Rust resolvers apply equivalent gating, current caller naming distinguishes real classes from object-literal methods, and valid real-class dispatch remains handled by the existing CHA post-passes. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
Call["super / super.method call"] --> Detect{"Caller belongs to a real class?"}
Detect -->|Yes| CHA["Resolve through CHA ancestor walk"]
Detect -->|No| Fallback["Retain bare/global heuristic fallback"]
CHA --> Valid["Persist only ancestor-related call edges"]
Fallback --> Dynamic["Preserve dynamic-prototype resolution"]
Reviews (1): Last reviewed commit: "fix(cha): super() must never fall back t..." | Re-trigger Greptile |
Sorry, something went wrong.
Codegraph Impact Analysis3 functions changed → 17 callers affected across 3 files
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Test plan
Closes #2244