-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: Handle non-direct binding cases in ResolveExports #3488
base: main
Are you sure you want to change the base?
Conversation
ALL-BUT-DEFAULT is only used for It might be helpful to look at Table 58: the only cases that can happen in this code path are those where the first two columns are not null. |
Thank you for clarifying! I replaced it with an assertion instead. |
cb7b5c1
to
54d19ac
Compare
@@ -28211,6 +28211,7 @@ <h1> | |||
1. For each ExportEntry Record _e_ of _module_.[[IndirectExportEntries]], do | |||
1. If _e_.[[ExportName]] is _exportName_, then | |||
1. Assert: _e_.[[ModuleRequest]] is not *null*. | |||
1. Assert: _e_.[[ImportName]] is neither ~all-but-default~ nor *null*. |
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.
Instead of ruling out two of the four possible states here, and then switching between the remaining two later, I would add another assert in the "else" case below (after the existing "imports a specific binding" assert):
1. Assert: _e_.[[ImportName]] is a String.
That seems clearer.
In step 6.a.iv.3 of ResolveExport, the case where
e.[[ImportName]]
isALL
, indicating that the module does not provide a direct binding, is addressed. I’m uncertain but curious whether we should also handle other cases such as ALL-BUT-DEFAULT and null in this context.c.f. This is problematic because the recursive call in step 6.a.iv.4 requires exportName to be a string. Therefore, the remaining cases should be explicitly handled in some way.