Skip to content

Keep JavaScript definition names distinct in modules and effects - #1760

Merged
Lorenzobattistela merged 6 commits into
bendlang:mainfrom
oxura:fix/mjs-canonical-exports-20261019d
Oct 20, 2026
Merged

Lorenzobattistela merged 6 commits into
bendlang:mainfrom
oxura:fix/mjs-canonical-exports-20261019d

Conversation

@oxura

@oxura oxura commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Imported lib:value and root lib.value are different checked definitions. JS currently collapses them in two places: pure module exports overwrite each other, and foreign IO handlers fail with “two effects register lib.value”. Keep canonical names in both paths, and escape generated property keys so quotes/backslashes cannot break a module.

Root names and constructor tags stay unchanged. Imported export keys and foreign JS definition IDs now keep :; this is a breaking change for hosts that called an imported def by its dotted key. No compatibility aliases.

Real consumers fail before the fixes and pass after: both pure functions remain callable, and the two IO handlers print 1 then 2 under both Bun and Node. Interpreter IO and the existing prototype-key, constructor interop, Nat/F32 export and host-closure consumers pass too. Local repo/cap gate: 54/54. Remote mini-cluster gates were not run.

Closes #1758
Closes #1759
Closes #1766

@oxura oxura changed the title Keep JavaScript module export names distinct and escaped Keep JavaScript definition names distinct in modules and effects Oct 19, 2026
@Lorenzobattistela Lorenzobattistela self-assigned this Oct 20, 2026
Lorenzobattistela and others added 4 commits October 20, 2026 06:30
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Lorenzobattistela
Lorenzobattistela merged commit d169272 into bendlang:main Oct 20, 2026
1 check passed
@Lorenzobattistela Lorenzobattistela mentioned this pull request Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants