Skip to content

fix(js/ts): separate static and instance override dispatch - #2775

Open
yang0228 wants to merge 1 commit into
colbymchenry:mainfrom
yang0228:codex/fix-static-override-dispatch-2761
Open

yang0228 wants to merge 1 commit into
colbymchenry:mainfrom
yang0228:codex/fix-static-override-dispatch-2761

Conversation

@yang0228

Copy link
Copy Markdown

An instance method in a JS/TS base class could appear to call a subclass's static method with the same name, or the reverse, because override dispatch matched names without checking the static flag. JavaScript extraction also omitted that flag, so filtering the synthesized edges alone would leave JS incorrect.

Reuse TypeScript's static-modifier hook for JavaScript, make the native JS/JSX walker emit the same flag, and skip JS/TS override-dispatch pairs whose static flags differ. Missing flags retain their existing instance-method meaning, and same-kind matches remain intact. Other languages retain their existing matching; a Java annotation control protects a real override whose existing static metadata is misleading.

Fixes #2761.

Validation:

  • Added 15 regression/control cases; 11 failed against the original implementation on 0de94978 before the fix.
  • WASM extraction and dispatch controls: 17 tests passed.
  • Rebuilt the actual native kernel, then ran the dispatch, TS/JS parity and inheritance control suites: 122 tests passed, including all 105 TS/JS parity cases.
  • All 15 new regression/control cases also passed on Node 22.23.2.
  • Full suite with the native kernel required: 8,447 passed, 27 platform/conditional skips across 704 test files.
  • npm run build and git diff --check passed.

Existing JavaScript and TypeScript projects should be re-indexed after upgrading, as noted in the changelog. Validation was performed on macOS with Node 22.23.2 and standalone Node 24.19.0.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS/TS: override-dispatch edges link a static method to an instance method of the same name

1 participant