Skip to content
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

Skip "default" export from export * from "mod" #184

Closed
jdalton opened this issue Jul 10, 2017 · 4 comments
Closed

Skip "default" export from export * from "mod" #184

jdalton opened this issue Jul 10, 2017 · 4 comments
Assignees

Comments

@jdalton
Copy link
Contributor

jdalton commented Jul 10, 2017

I noticed while reviewing our export extension proposals that by spec we should not export "default" for export * from "mod".

See https://tc39.github.io/ecma262/#sec-getexportednames.
Also mentioned in step 6 of https://tc39.github.io/ecma262/#sec-resolveexport.

This effects runtime.makeNsSetter.

@benjamn benjamn self-assigned this Jul 10, 2017
@benjamn
Copy link
Owner

benjamn commented Jul 11, 2017

I agree this is what the spec says, but I'm having trouble understanding why this is desirable behavior, because this breaks the ES equivalent of module.exports = require("./other-module") (the CommonJS "bridge" idiom). I think this is something we need to bring up at TC39.

@benjamn
Copy link
Owner

benjamn commented Jul 11, 2017

Yeah, this seems inconsistent with the creation of module namespace objects, which uses GetExportedNames: https://tc39.github.io/ecma262/#sec-getmodulenamespace

Imagine if a dynamic import(...) couldn't access the default property of the imported module!

@benjamn
Copy link
Owner

benjamn commented Jul 11, 2017

Okay, I've opened an issue on the tc39/ecma262 repository. Looking forward to understanding this policy better, or getting it retracted!

@jdalton
Copy link
Contributor Author

jdalton commented Jul 11, 2017

Thanks for raising this with the TC39.

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

No branches or pull requests

2 participants