Summary
The WASM/JS engine gains rest-parameter resolution in PR #1337 (issue #1336): when function f3({ a, ...rest }) is called as f3(obj), the JS build-edges path seeds typeMap[rest] = { type: 'obj' } so rest.method() calls resolve via the seeded object's composite typeMap keys.
The native Rust engine does not yet perform this seeding. The buildParamFlowPtsPostPass native post-pass only handles pts parameter-flow (paramBindings), not objectRestParamBindings.
Expected behaviour
Both engines should produce f3 → e4 for:
function e4() {}
var obj = { e4 };
function f3({ e1: eee1, ...eerest }) {
eerest.e4(); // should resolve to e4
}
f3(obj);
What needs to change
In the native Rust post-pass (buildParamFlowPtsPostPass in build-edges.ts or equivalent Rust logic):
- Extract
objectRestParamBindings from the JS/WASM extractor output
- Cross-reference with
paramBindings to seed typeMap[restName] = { type: argName }
- The composite key
argName.method is already seeded by the JS extractor's object-literal property seeding (Phase 8.3f)
Related
Summary
The WASM/JS engine gains rest-parameter resolution in PR #1337 (issue #1336): when
function f3({ a, ...rest })is called asf3(obj), the JS build-edges path seedstypeMap[rest] = { type: 'obj' }sorest.method()calls resolve via the seeded object's composite typeMap keys.The native Rust engine does not yet perform this seeding. The
buildParamFlowPtsPostPassnative post-pass only handles pts parameter-flow (paramBindings), notobjectRestParamBindings.Expected behaviour
Both engines should produce
f3 → e4for:What needs to change
In the native Rust post-pass (
buildParamFlowPtsPostPassinbuild-edges.tsor equivalent Rust logic):objectRestParamBindingsfrom the JS/WASM extractor outputparamBindingsto seedtypeMap[restName] = { type: argName }argName.methodis already seeded by the JS extractor's object-literal property seeding (Phase 8.3f)Related