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

Unified Diff: src/ast/scopes.cc

Issue 2273013002: [modules] Split exports into regular and special, store regular ones in a multimap. (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
Index: src/ast/scopes.cc
diff --git a/src/ast/scopes.cc b/src/ast/scopes.cc
index 2a41c7d47a2c1a458422e4f1225b24bd080b8567..6efeeb5f51522675073cb4da27d726ebc5eb9e6e 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1599,17 +1599,15 @@ void DeclarationScope::AllocateLocals() {
}
void ModuleScope::AllocateModuleVariables() {
- for (auto it = module()->regular_imports().begin();
- it != module()->regular_imports().end(); ++it) {
- Variable* var = LookupLocal(it->second->local_name);
+ for (const auto& it : module()->regular_imports()) {
+ Variable* var = LookupLocal(it.first);
// 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);
- var->AllocateTo(VariableLocation::MODULE, 42);
+ for (const auto& it : module()->regular_exports()) {
+ Variable* var = LookupLocal(it.first);
+ var->AllocateTo(VariableLocation::MODULE, 0);
}
}

Powered by Google App Engine
This is Rietveld 408576698