-
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
Proposal: Nested import declarations #646
Commits on Jul 24, 2016
-
Support CreateImportBinding for all declarative Environment Records.
Previously, CreateImportBinding was only supported for module Environment Records. Supporting the CreateImportBinding method for declarative Environment Records will be important for nested |ImportDeclaration|s, since the declarative Environment Record for the nested block containing the |ImportDeclaration| will need to allow indirect bindings, too. Because declarative Environment Records may now have indirect bindings, the GetBindingValue method of declarative Environment Records now fully incorporates the logic of the GetBindingValue method of module Environment Records, and so the module-specific method has been removed.
Configuration menu - View commit details
-
Copy full SHA for 2ac6e23 - Browse repository at this point
Copy the full SHA 2ac6e23View commit details
Commits on Jul 25, 2016
-
Make StatementListItem (instead of ModuleItem) produce ImportDeclarat…
…ion. This change means |ImportDeclaration|s are no longer grammatically restricted to the top level of a module. It also means |ImportDeclaration|s are no longer grammatically restricted to |Module|s, and could potentially appear in |Script|s, which is a problem to be addressed in a follow-up commit.
Configuration menu - View commit details
-
Copy full SHA for e5f7acf - Browse repository at this point
Copy the full SHA e5f7acfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3a4faa7 - Browse repository at this point
Copy the full SHA 3a4faa7View commit details -
Use CreateLexicalBindings for modules, functions, and blocks.
Note that this change allows functions and blocks to define bindings for |ImportDeclaration|s, which was not previously possible. After this change, the [[ImportEntries]] field of Module Record is no longer used anywhere in this specification.
Configuration menu - View commit details
-
Copy full SHA for c4da2ad - Browse repository at this point
Copy the full SHA c4da2adView commit details -
Remove unused [[ImportEntries]] field of Source Text Module Record.
The top-level ImportEntries of a module are now extracted as part of the CreateLexicalBindings operation, based on the top-level LexicallyScopedDeclarations of the module, which now include |ImportDeclaration| productions in addition to other lexically scoped declarations like function/generator declarations and let/const variable declarations. Though it is possible that another specification might depend on this field, the only relevant specification that I'm aware of is the WHATWG Loader spec (https://whatwg.github.io/loader), and while it refers to the Source Text Module Record in many places, it never makes use of the [[ImportEntries]] field. Moreover, I think we should remove this field now rather than allowing it to persist, because any hypothetical auxiliary specification that relies on [[ImportEntries]] is likely to be treating top-level import declarations differently from nested import declarations, and thus runs the risk of mishandling nested import declarations.
Configuration menu - View commit details
-
Copy full SHA for 25cd2a8 - Browse repository at this point
Copy the full SHA 25cd2a8View commit details -
Note why EvalDeclarationInstantiation does not call CreateLexicalBind…
…ings. Unless this note is wrong, we do not have to worry about import declarations in eval strings, which is good news because it would be impossible to determine statically what module identifiers are requested by a dynamic string of code.
Configuration menu - View commit details
-
Copy full SHA for f468a4f - Browse repository at this point
Copy the full SHA f468a4fView commit details -
Define and use an abstract operation called EvaluateRequestedModules.
This change means nested modules will be evaluated at the beginning of their enclosing blocks, if they have not already been evaluated.
Configuration menu - View commit details
-
Copy full SHA for ca0949b - Browse repository at this point
Copy the full SHA ca0949bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 0d578e5 - Browse repository at this point
Copy the full SHA 0d578e5View commit details