Skip to content

fix: wasm pts resolution misses cross-file bind/apply spread bindings (fun.js, classes2.js) #1511

@carlos-alm

Description

@carlos-alm

Summary

In the jelly-micro parity fixture, native/hybrid emits cross-file dynamic edges that WASM misses:

  • fun/fun.js:foo → spread/spread.js:b (conf=0.5 dyn=1)
  • fun/fun.js:bar → spread/spread.js:c (conf=0.5 dyn=1)
  • classes2/classes2.js:G.constructor → prototypes3/prototypes3.js:a (conf=0.5 dyn=1)
  • classes2/classes2.js:G.constructor → spread/spread.js:a (conf=0.5 dyn=1)
  • fun/fun.js:foo → super5/super5.js:b (conf=0.5 dyn=1)
  • fun/fun.js:bar → prototypes3/prototypes3.js:c (conf=0.5 dyn=1)

These are pts/spread resolution edges for foo.call(fn, ...) and bar.apply(fn, args) patterns where the bound receiver function is defined in a different file. Native's pts solver correctly tracks the apply/call target across file boundaries; WASM's pts map doesn't capture these cross-file bindings.

Fix direction

Extend WASM's buildPointsToMapForFile / thisCallBindings logic to handle cross-file pts resolution for .apply()/.call() with function references from imported files. Requires seeding importedNames into the pts resolution chain.

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