| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…pressions In handle_call_expr, when the callee is `this` or `super` used as a function (e.g. `this(b)` or `super(a)`), extract_callback_reference_calls was being invoked and emitting identifier arguments as spurious dynamic calls. The pts resolver then resolved those names globally, producing false cross-file call edges (e.g. fun/fun.js:foo → spread/spread.js:b). Add an early return for fn_node.kind() == "this" || "super", mirroring the JS extractor's guard (javascript.ts:1135). Add regression tests for both this(b) and super(a) argument non-emission. Closes #1511
Greptile SummaryAdds a two-line early-return guard in handle_call_expr (Rust JS extractor) for callee nodes of kind "this" or "super", mirroring a pre-existing guard in the TypeScript extractor. Without this guard, extract_callback_reference_calls iterated the argument list of this(b) / super(a) and emitted each identifier argument as a dynamic call; the PTS resolver then matched those names globally, generating false cross-file edges.
Confidence Score: 5/5Safe to merge — the change is a narrow, well-scoped guard that removes false-positive call edges without affecting any legitimate call recording. The three functions skipped by the early return are all no-ops or harmful for this/super callees: extract_call_info returns None for non-identifier/member-expression nodes, extract_callback_definition requires a member_expression callee to proceed, and extract_callback_reference_calls was the root cause of the false edges. The this call record continues to be emitted through the separate collect_this_call_and_bindings path, confirmed by the new test. Two focused regression tests cover both cases and the guard cleanly mirrors the existing TypeScript extractor behavior. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[handle_call_expr called] --> B{callee is import?}
B -- Yes --> C[handle_dynamic_import and return]
B -- No --> D{callee is this or super?}
D -- Yes - NEW GUARD --> E[return early - no spurious dynamic calls emitted]
D -- No --> F[extract_call_info - push call record]
F --> G[extract_callback_definition - push anon callback def]
G --> H[extract_callback_reference_calls - push identifier args as dynamic calls]
Reviews (1): Last reviewed commit: "fix(native): skip callback-reference cal..." | Re-trigger Greptile |
Sorry, something went wrong.
Codegraph Impact Analysis3 functions changed → 1 callers affected across 1 files
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Summary
Root cause
The JS extractor (javascript.ts) has an early return at line 1135 when the function node type is this:
The Rust extractor (javascript.rs) did not have this guard, so extract_callback_reference_calls ran on this(b) / super(a) and emitted b and a as dynamic calls. The pts resolver then resolved those names globally, finding same-named functions in sibling fixture files.
Impact
Eliminates 11 false-positive native call edges in the jelly-micro parity fixture:
Test plan
Closes #1511