Skip to content

Conversation

@nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Oct 28, 2025

This is a test for the difference described in tc39/ecma262#3710.

TL;DR

  • export { foo } from "mod" and import { foo } from "mod"; export { foo } are equivalent: they both propagate the binding, so when both re-exported with export * from they do not cause ambiguity.
  • export * as foo from "mod" and import * as foo from "mod"; export { foo } are not equivalent: the second one introduces a new binding, causing ambiguity. It would be unambiguous if both were doing export * as foo from "mod". It's still be ambiguous (two bindings) if both were doing import * as foo from "mod"; export { foo }

The first commit just moves the tests related to binding ambiguity to a single folder, so that it's easier to tell what is already tested.

@nicolo-ribaudo nicolo-ribaudo force-pushed the ambiguous-binding branch 4 times, most recently from 3374720 to 74e1d86 Compare October 28, 2025 10:32
@nicolo-ribaudo nicolo-ribaudo force-pushed the ambiguous-binding branch 2 times, most recently from 9769291 to 0ae13c9 Compare October 28, 2025 10:37
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review October 28, 2025 10:41
@nicolo-ribaudo nicolo-ribaudo requested a review from a team as a code owner October 28, 2025 10:41
@nicolo-ribaudo
Copy link
Member Author

SM/JSC pass all the tests, while V8/engine262/XS fail test/language/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-start-as-from.js

@nicolo-ribaudo
Copy link
Member Author

Marking as draft because I plan to present something related to this in plenary.

@nicolo-ribaudo nicolo-ribaudo marked this pull request as draft October 28, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant