Skip to content

fix: receiver edge for prototypes.js targets wrong C class (cross-file instead of same-file) #1513

@carlos-alm

Description

@carlos-alm

Summary

In jelly-micro/prototypes/prototypes.js, new C() creates a local C. The receiver edge from prototypes/prototypes.js(file) → C(class) should point to the LOCAL C defined in prototypes.js, but instead points to classes/classes.js:C (WASM) or private/private.js:C (native).

This is a receiver resolution non-determinism when multiple files define a same-named class. The same-file candidate should always win.

Fix direction

In resolveReceiverEdge (call-resolver.ts), when computing same-file candidates vs global candidates, the same-file C in prototypes.js should be found and used. Likely an extraction gap — the local C function constructor may not be extracted with kind='class' in one of the engines.

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