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

BoundNames of default exports #603

Open
GeorgNeis opened this Issue Jun 7, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@GeorgNeis
Contributor

GeorgNeis commented Jun 7, 2016

15.2.3.2 Static Semantics: BoundNames always includes "default" for a default export, even if there already is a local name for it. For instance:

BoundNames(export default function foo() {}) = {"foo", "default"}

I couldn't find a justification for that, am I missing something?

@allenwb

This comment has been minimized.

Show comment
Hide comment
@allenwb

allenwb Jun 7, 2016

Member

It's there so that the early error checks in 15.2.1.1 that use LexicallyDeclaredNames work across all export default declarations.

However, it appears that the first two rules (when applied to export default declarations) may be redundant with rule 3 (see the note that follow the rules). If that is the case that it may be valid to eliminate the unconditional inclusion of "default" as a BoundName.

This probably needs a more careful analysis.

Member

allenwb commented Jun 7, 2016

It's there so that the early error checks in 15.2.1.1 that use LexicallyDeclaredNames work across all export default declarations.

However, it appears that the first two rules (when applied to export default declarations) may be redundant with rule 3 (see the note that follow the rules). If that is the case that it may be valid to eliminate the unconditional inclusion of "default" as a BoundName.

This probably needs a more careful analysis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment