-
Notifications
You must be signed in to change notification settings - Fork 514
Test export * as x from and import * as x; export { x } binding equivalence
#4606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
0ae13c9 to
ae7fc83
Compare
|
SM/JSC pass all the tests, while V8/engine262/XS fail |
|
Marking as draft because I plan to present something related to this in plenary. |
|
Hmm, what is the value in allowing |
...nguage/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js
Show resolved
Hide resolved
|
I believe the behavior here has consensus (looks like it's asserting the post-tc39/ecma262#3715 behavior). @nicolo-ribaudo did you want to do any further updates or is this ready to review? |
|
The PR is testing the old behavior |
ae7fc83 to
a419ce7
Compare
|
Updated ✔️ |
a419ce7 to
a2ade85
Compare
export * as x from and import * as x; export { x }export * as x from and import * as x; export { x } binding equivalence
| export * from "./namespace-export-star-as-from-1_FIXTURE.js"; | ||
| export * from "./namespace-import-star-as-and-export-1_FIXTURE.js"; | ||
|
|
||
| import { foo } from './namespace-ambiguous-if-import-star-as-and-export.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the spec change, this would be an error.
| export * from "./namespace-import-star-as-and-export-1_FIXTURE.js"; | ||
| export * from "./namespace-import-star-as-and-export-2_FIXTURE.js"; | ||
|
|
||
| import { foo } from './namespace-ambiguous-if-import-star-as-and-export.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the spec change, this would be an error.
6cdfc0e to
b47cae6
Compare
bakkot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I overlooked the negative bits earlier, oops.
Anyway, this looks good to me other than the descriptions I commented on. Specifically, it is testing
- that
import { foo } from 'bar'; export { foo }does not conflict withexport { foo } from 'bar'(inimport-and-export-propagates-binding.js) - not technically part of the changes in the PR, but good to test - that two
import * as foo from 'bar'; export { foo }do not conflict with each other (innamespace-unambiguous-if-import-star-as-and-export.js) - that two
export * as foo from 'bar'do not conflict with each other (in thenamespace-unambiguous-if-export-star-as-from.jstest) - that
export * as foo from 'bar'does not conflict withimport * as foo from 'bar'; export { foo }(innamespace-unambiguous-if-export-star-as-from-and-import-star-as-and-export.js)
...xport-bindings/namespace-unambiguous-if-export-star-as-from-and-import-star-as-and-export.js
Outdated
Show resolved
Hide resolved
.../module-code/ambiguous-export-bindings/namespace-unambiguous-if-import-star-as-and-export.js
Outdated
Show resolved
Hide resolved
...nguage/module-code/ambiguous-export-bindings/namespace-unambiguous-if-export-star-as-from.js
Outdated
Show resolved
Hide resolved
640055a to
a3d252b
Compare
Ms2ger
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
a3d252b to
a92f684
Compare
…=jonco This patch implements tc39/ecma262#3715, to make import * as ns from "mod"; export { ns }; behave the same as export * as ns from "mod"; Tested by tc39/test262#4606 Differential Revision: https://phabricator.services.mozilla.com/D274013
https://bugs.webkit.org/show_bug.cgi?id=303141 Reviewed by NOBODY (OOPS!). This patch changes JSC's handling of `import * as ns; export { ns }` to align with tc39/ecma262#3715, which reached consensus in the Nov 2025 TC39 meeting. This will be tested by tc39/test262#4606, for now I manually verified that the relevant tests in that PR are failing before this patch and passing after it. * Source/JavaScriptCore/parser/ModuleAnalyzer.cpp: (JSC::ModuleAnalyzer::exportVariable):
…=jonco This patch implements tc39/ecma262#3715, to make import * as ns from "mod"; export { ns }; behave the same as export * as ns from "mod"; Tested by tc39/test262#4606 Differential Revision: https://phabricator.services.mozilla.com/D274013 UltraBlame original commit: d14a908552e6d040c7538351430b3152a4a36887
…=jonco This patch implements tc39/ecma262#3715, to make import * as ns from "mod"; export { ns }; behave the same as export * as ns from "mod"; Tested by tc39/test262#4606 Differential Revision: https://phabricator.services.mozilla.com/D274013 UltraBlame original commit: d14a908552e6d040c7538351430b3152a4a36887
…=jonco This patch implements tc39/ecma262#3715, to make import * as ns from "mod"; export { ns }; behave the same as export * as ns from "mod"; Tested by tc39/test262#4606 Differential Revision: https://phabricator.services.mozilla.com/D274013 UltraBlame original commit: d14a908552e6d040c7538351430b3152a4a36887
https://bugs.webkit.org/show_bug.cgi?id=303141 Reviewed by NOBODY (OOPS!). This patch changes JSC's handling of `import * as ns; export { ns }` to align with tc39/ecma262#3715, which reached consensus in the Nov 2025 TC39 meeting. This will be tested by tc39/test262#4606, for now I manually verified that the relevant tests in that PR are failing before this patch and passing after it. * Source/JavaScriptCore/parser/ModuleAnalyzer.cpp: (JSC::ModuleAnalyzer::exportVariable):
This PR adds tests for tc39/ecma262#3715.
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.