Index: src/ast/modules.cc |
diff --git a/src/ast/modules.cc b/src/ast/modules.cc |
index 3a1f2e4b7b57a3c7a4d3055ee7d7e9ff2777a90e..67f371faa7e0aaf30cc1ed7acf7f38249a75dbd9 100644 |
--- a/src/ast/modules.cc |
+++ b/src/ast/modules.cc |
@@ -80,6 +80,23 @@ void ModuleDescriptor::AddStarExport( |
exports_.Add(entry, zone); |
} |
+void ModuleDescriptor::MakeIndirectExportsExplicit() { |
+ for (auto entry : exports_) { |
+ if (entry->export_name == nullptr) continue; |
+ if (entry->import_name != nullptr) continue; |
+ DCHECK_NOT_NULL(entry->local_name); |
+ auto it = regular_imports_.find(entry->local_name); |
+ if (it != regular_imports_.end()) { |
+ // Found an indirect export. |
+ DCHECK_NOT_NULL(it->second->module_request); |
+ DCHECK_NOT_NULL(it->second->import_name); |
+ entry->import_name = it->second->import_name; |
+ entry->module_request = it->second->module_request; |
+ entry->local_name = nullptr; |
+ } |
+ } |
+} |
+ |
bool ModuleDescriptor::Validate(DeclarationScope* module_scope, |
PendingCompilationErrorHandler* error_handler, |
Zone* zone) const { |