Skip to content

fix: align receiver-callee-mixup attribution between wasm and native #1510

@carlos-alm

Description

@carlos-alm

Summary

In the jelly-micro parity fixture, receiver-callee-mixup/receiver-callee-mixup.js shows:

  • WASM: f(method) → g(method) (4 edges) — attributes calls to the bare f(method) node
  • Native: o1.f(function) → g(method) and o2.f(function) → g(method) (2 edges each) — attributes to the qualified name

Both engines extract two nodes for each object literal method: f(method) at line 2 and o1.f(function) at line 2. When findCaller has a span tie, the insertion order determines the winner. Native inserts o1.f(function) first; WASM inserts f(method) first.

The correct caller for this.g() inside o1.f() is the qualified name o1.f(function), not the bare f(method).

Fix direction

In findCaller (call-resolver.ts), when two definitions at the same line and span are tied, prefer the more-qualified name (one containing a dot). This needs careful scoping to avoid regressions in other callers like static blocks (B.<static:36:2>).

Stacking

Found in #1472. Defer to a follow-up PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions