Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Unified Diff: src/ast/scopes.cc

Issue 2224333002: [modules] Split imports into regular and special, store regular ones in a map. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ast/modules.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 6839ce84c0f4e36f7674f537bd05f96cad03099e..b69fc3bdb3915060aba5e7261f5adc40f5a6ef69 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1703,13 +1703,13 @@ void DeclarationScope::AllocateLocals(AstValueFactory* ast_value_factory) {
}
void DeclarationScope::AllocateModuleVariables() {
- for (auto entry : module()->imports()) {
- if (entry->local_name == nullptr) continue;
- if (entry->import_name == nullptr) continue; // Namespace import.
- Variable* var = LookupLocal(entry->local_name);
+ for (auto it = module()->regular_imports().begin();
+ it != module()->regular_imports().end(); ++it) {
+ Variable* var = LookupLocal(it->second->local_name);
// TODO(neis): Use a meaningful index.
var->AllocateTo(VariableLocation::MODULE, 42);
}
+
for (auto entry : module()->exports()) {
if (entry->local_name == nullptr) continue;
Variable* var = LookupLocal(entry->local_name);
« no previous file with comments | « src/ast/modules.cc ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698