Preserve captured relative externals outside dynamic import
Why
Restoring the primitive to normal local references re-read properties and changed the receiver of tagged template calls. Keep the binding a value and recover primitive metadata only when lowering dynamic import.
modifiedJS ordinary read of a relative external
js
Before
After
let value = Fixture.counter.value;let value = Fixture.counter.value;return [Fixture.counter.value, Fixture.counter.value];return [value, value];
Review
- Does the fix keep FFI adaptation for dynamic imports? Yes, both native import paths still see the original primitive metadata. The nullable relative import fixture exercises the adapted path.