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

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: git cl format 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') | src/zone-containers.h » ('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 ce65627d7d2edb4f723fd3cb1b696680224cbd6e..eb92cefb98f055f12081c00611624944e361c26a 100644
--- a/src/ast/scopes.cc
+++ b/src/ast/scopes.cc
@@ -1594,17 +1594,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);
}
}
« no previous file with comments | « src/ast/modules.cc ('k') | src/zone-containers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698