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

Editorial: Correct ExportEntry.[[LocalName]] description #3126

Merged
merged 1 commit into from Jul 19, 2023
Merged

Editorial: Correct ExportEntry.[[LocalName]] description #3126

merged 1 commit into from Jul 19, 2023

Conversation

ghost
Copy link

@ghost ghost commented Jul 18, 2023

ExportEntry.[[LocalName]] calls itself the name used in the importing module. I think this is meant to say exporting.

https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#table-exportentry-records

The name that is used to locally access the exported value from within the importing module. null if the exported value is not locally accessible from within the module.

Some export declarations relay imports (which would make this the importing module), but not all. It's always the exporting module for every export.

I think this probably snuck in by analogy with the ImportEntry.[[LocalName]] description.

https://tc39.es/ecma262/multipage/ecmascript-language-scripts-and-modules.html#table-importentry-record-fields

The name that is used to locally access the imported value from within the importing module.

This patch changes "importing" to "exporting" in ExportEntry.[[LocalName]].

Copy link
Member

@michaelficarra michaelficarra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine. It would be nice to also explain "*default*" here. Even nicer to replace it with a spec enum.

@bakkot
Copy link
Contributor

bakkot commented Jul 19, 2023

"*default*" cannot be changed to a spec enum; see discussion in #2566.

It already has a detailed explanation here.

@michaelficarra
Copy link
Member

@bakkot I think in this position, it can be replaced, but it wouldn't totally eliminate the use of "*default*".

Copy link
Contributor

@bakkot bakkot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks. I'm betting this is a copy-paste error from the ImportEntry Record table.

@bakkot
Copy link
Contributor

bakkot commented Jul 19, 2023

@michaelficarra This is the only position which uses *default*. It can't be eliminated without either adding a special case throughout the linkage machinery or making scopes support non-string binding names, neither of which seems like a good idea. The description in #2566 is pretty thorough about this.

@bakkot bakkot added the ready to merge Editors believe this PR needs no further reviews, and is ready to land. label Jul 19, 2023
@ljharb ljharb merged commit 6e2f689 into tc39:main Jul 19, 2023
ljharb added a commit to ljharb/ecma262 that referenced this pull request Jul 24, 2023
ljharb added a commit to ljharb/ecma262 that referenced this pull request Jul 24, 2023
zhangenming pushed a commit to zhangenming/ecma262 that referenced this pull request Dec 22, 2023
zhangenming pushed a commit to zhangenming/ecma262 that referenced this pull request Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants