[PR #4675] feat(js): resolve class instance method calls in semantic graphs #6358

Open
opened 2026-10-31 01:13:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/4675
Author: @SachinD6
Created: 10/17/2026
Status: 🔄 Open

Base: main ← Head: feat/js-class-method-calls-4437


📝 Commits (6)

  • 277b348 feat(js): resolve this and const-new class method calls
  • a572ede feat(js): resolve this-field class method calls
  • 26aaae4 feat(js): resolve getter-hop, super and inherited method calls
  • dd0c181 test(js): cover class method call resolution for 4437
  • d380ac2 fix(js): keep class method edges fail-closed
  • a206014 fix(js): refuse exact edges when receiver proof is incomplete

📊 Changes

3 files changed (+2073 additions, -0 deletions)

View changed files

➕ src/domain/javascript/javascriptSemanticAnalysis.class_method_calls.test.ts (+704 -0)
📝 src/domain/javascript/javascriptSemanticCallResolution.ts (+104 -0)
➕ src/domain/javascript/javascriptSemanticClassReceivers.ts (+1265 -0)

📄 Description

Why

Callers traces miss class method callers. Every member call was a dynamic-call unknown. The first patch resolved the simple cases, then review found exact edges for methods that do not run.

What changed

  • Resolve this, const-new, field, and getter receivers when the class is proven.
  • Keep candidate edges for overrides and reassignment.
  • Refuse exact edges when a field, constructor return, decorator, static block, or incomplete new can change the target.

Scope

  • Covers static JavaScript analysis only. No execution.
  • Leaves external receivers, decorators beyond "not exact", and Object.defineProperty unknown.
  • Does not model the sink zero-unknowns quirk from the issue.

Tradeoffs

  • Chose fail-closed over guessing a hidden or replaced method. A missing edge is safer than an exact edge to a method that never runs.

Blast Radius

  • Touches JavaScript semantic resolution only. Existing candidate flow is unchanged. The JavaScript semantic suite passes.

Verification

  • Class-method tests cover the review cases and the original repro lines.
  • npx vitest run src/domain/javascript passed 80 files and 1972 tests.
  • Pre-push typecheck and lint passed.

Fixes #4437.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/4675 **Author:** [@SachinD6](https://github.com/SachinD6) **Created:** 10/17/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `feat/js-class-method-calls-4437` --- ### 📝 Commits (6) - [`277b348`](https://github.com/morluto/rea/commit/277b348c1e23e900f0d7f1d82dd97e34cdda0d0a) feat(js): resolve this and const-new class method calls - [`a572ede`](https://github.com/morluto/rea/commit/a572ede94932508994e3c58f9d0f6135be085108) feat(js): resolve this-field class method calls - [`26aaae4`](https://github.com/morluto/rea/commit/26aaae4ef675ee652cc363561313514ad169e00d) feat(js): resolve getter-hop, super and inherited method calls - [`dd0c181`](https://github.com/morluto/rea/commit/dd0c1819b0d19ebf7f06fb396c6701c768ecf97d) test(js): cover class method call resolution for 4437 - [`d380ac2`](https://github.com/morluto/rea/commit/d380ac20327ab49745425bbb83f6202360edf91e) fix(js): keep class method edges fail-closed - [`a206014`](https://github.com/morluto/rea/commit/a2060140a9f64d825efaa7e00b5e6d708ecc3418) fix(js): refuse exact edges when receiver proof is incomplete ### 📊 Changes **3 files changed** (+2073 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/domain/javascript/javascriptSemanticAnalysis.class_method_calls.test.ts` (+704 -0) 📝 `src/domain/javascript/javascriptSemanticCallResolution.ts` (+104 -0) ➕ `src/domain/javascript/javascriptSemanticClassReceivers.ts` (+1265 -0) </details> ### 📄 Description ## Why Callers traces miss class method callers. Every member call was a dynamic-call unknown. The first patch resolved the simple cases, then review found exact edges for methods that do not run. ## What changed - Resolve `this`, const-new, field, and getter receivers when the class is proven. - Keep candidate edges for overrides and reassignment. - Refuse exact edges when a field, constructor return, decorator, static block, or incomplete `new` can change the target. ## Scope - Covers static JavaScript analysis only. No execution. - Leaves external receivers, decorators beyond "not exact", and `Object.defineProperty` unknown. - Does not model the sink zero-unknowns quirk from the issue. ## Tradeoffs - Chose fail-closed over guessing a hidden or replaced method. A missing edge is safer than an exact edge to a method that never runs. ## Blast Radius - Touches JavaScript semantic resolution only. Existing candidate flow is unchanged. The JavaScript semantic suite passes. ## Verification - Class-method tests cover the review cases and the original repro lines. - `npx vitest run src/domain/javascript` passed 80 files and 1972 tests. - Pre-push `typecheck` and `lint` passed. Fixes #4437. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6358
No description provided.