Index: src/modules.cc |
diff --git a/src/modules.cc b/src/modules.cc |
index 863443e627fbb670694d3a3c67415ad4a1ac8393..3d6aa2c789693419d937d19c97239f7953ca35c7 100644 |
--- a/src/modules.cc |
+++ b/src/modules.cc |
@@ -35,6 +35,15 @@ void ModuleDescriptor::AddLocalExport(const AstRawString* export_name, |
} |
+void ModuleDescriptor::AddModuleRequest(const AstRawString* module_specifier, |
+ Zone* zone) { |
+ // TODO(adamk): Avoid this O(N) operation on each insert by storing |
+ // a HashMap, or by de-duping after parsing. |
+ if (requested_modules_.Contains(module_specifier)) return; |
+ requested_modules_.Add(module_specifier, zone); |
+} |
+ |
+ |
const AstRawString* ModuleDescriptor::LookupLocalExport( |
const AstRawString* export_name, Zone* zone) { |
if (exports_ == nullptr) return nullptr; |