Skip to content

SyntheticModuleRecord: support a live exports source for namespace reads - #380

Open
robobun wants to merge 5 commits into
mainfrom
farm/24ce6e23/synthetic-module-live-exports
Open

SyntheticModuleRecord: support a live exports source for namespace reads#380
robobun wants to merge 5 commits into
mainfrom
farm/24ce6e23/synthetic-module-live-exports

overrideExportValue: write through to the live-exports source

1ee717b
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Aug 1, 2026 in 21m 44s

Code review found 2 important issues

Found 5 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 2
🟡 Nit 0
🟣 Pre-existing 0
Severity File:Line Issue
🔴 Important Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp:481-486 overrideExportValue live-source write-through: wrong key and wrong primitive

Annotations

Check failure on line 486 in Source/JavaScriptCore/runtime/JSModuleNamespaceObject.cpp

See this annotation in the file changed.

@claude claude / Claude Code Review

overrideExportValue live-source write-through: wrong key and wrong primitive

The write-through uses `name` (the export name on *this* namespace) instead of `resolution.localName` (the binding name in the target synthetic module — the same key the env-slot write on line 470 already uses). With `export { foo as bar } from './mocked'`, an override on B's namespace with `name='bar'` writes a stray `source.bar` while `source.foo` stays stale, so once the read side is fixed to use `localName` the override is silently lost for namespace reads. Separately, `putDirect` is a fragi