Skip to content

fix(parity): jelly-micro bind.js: WASM emits dyn=1 for f.call/bind aliases, native emits dyn=0 #1687

@carlos-alm

Description

@carlos-alm

Summary

When running node scripts/parity-compare.mjs --langs jelly-micro with grammars properly available, the WASM engine produces dyn=1 edges for f.call/f.bind patterns in tests/benchmarks/resolution/fixtures/jelly-micro/bind/bind.js, while the native engine produces dyn=0.

Divergence

[edge] [calls] bind/bind.js:bind/bind.js(file) -> arguments/arguments.js:f(function) conf=0.5 dyn=0  wasm=0 native=1
[edge] [calls] bind/bind.js:bind/bind.js(file) -> arguments/arguments.js:f(function) conf=0.5 dyn=1  wasm=1 native=0

22 similar edge diffs across different target files.

Root cause

The bind/bind.js fixture content:

const f = function () {}.bind({});
f();
f.call({});

extractCallbackReferenceCalls on f.call({}) emits { name: 'f', dynamic: true } (no dynamicKind). This results in a pts-resolved edge with dyn=1 being emitted before the direct f() call (which should produce dyn=0) can suppress it.

Note

This divergence was previously masked because bind.js failed to parse in test environments where the JavaScript grammar file was not properly available. The issue surfaced when running parity compare with grammars properly available.

Impact

Parity gate fails for jelly-micro. All other 41 fixtures pass.

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