-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Editorial: Re-factor ExportSpecifier (#637)
In prior editions, the ExportSpecifier production was defined using only IdentifierName. However, when the ExportSpecifier is part of an "local" ExportDeclaration, the IdentifierName was interpreted as an IdentifierReference through an Early Error rule. The rule was undesirable for a number of reasons: - it duplicated the definition of IdentifierReference - it relied on an abstract operation, ReferencedBindings, which was otherwise unused - it was not technically necessary (a separate Early Error rule for ModuleBody requires that all ExportedBindings are declared within the module itself, and it is not possible to create a such a binding) These details made interpreting ExportSpecifier difficult and tended to obscure the motivation for the use of IdentifierName. Re-factor ExportSpecifier with a production parameter describing whether it belongs to a "local" or "indirect" ExportDeclaration. This allows for the definition of dedicated grammar productions, obviating the need for an explicit early error, and removing branching logic from the static semantics rule ExportEntriesForModule. It also more clearly communicates the intent behind related definitions of the production.
- Loading branch information
1 parent
88a48ec
commit 5d5fdab
Showing
1 changed file
with
45 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters