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

Unified Diff: src/ast/scopeinfo.cc

Issue 2353633002: [modules] Explicitly keep track of module requests. (Closed)
Patch Set: Address comments. Created 4 years, 3 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/ast/scopes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ast/scopeinfo.cc
diff --git a/src/ast/scopeinfo.cc b/src/ast/scopeinfo.cc
index d3014274d40bf1abdf2cb708fdcde9f0be9bb273..9e2f7c16171fb2f819b7e7a42b2293a1c11feb81 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -853,6 +853,13 @@ Handle<ModuleInfoEntry> ModuleInfoEntry::New(Isolate* isolate,
}
Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, ModuleDescriptor* descr) {
+ // Serialize module requests.
+ Handle<FixedArray> module_requests = isolate->factory()->NewFixedArray(
+ static_cast<int>(descr->module_requests().size()));
+ for (const auto& elem : descr->module_requests()) {
+ module_requests->set(elem.second, *elem.first->string());
+ }
+
// Serialize special exports.
Handle<FixedArray> special_exports =
isolate->factory()->NewFixedArray(descr->special_exports().length());
@@ -868,12 +875,13 @@ Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, ModuleDescriptor* descr) {
static_cast<int>(descr->regular_exports().size()));
{
int i = 0;
- for (const auto& it : descr->regular_exports()) {
- regular_exports->set(i++, *it.second->Serialize(isolate));
+ for (const auto& elem : descr->regular_exports()) {
+ regular_exports->set(i++, *elem.second->Serialize(isolate));
}
}
Handle<ModuleInfo> result = isolate->factory()->NewModuleInfo();
+ result->set(kModuleRequestsIndex, *module_requests);
result->set(kSpecialExportsIndex, *special_exports);
result->set(kRegularExportsIndex, *regular_exports);
return result;
« no previous file with comments | « src/ast/modules.cc ('k') | src/ast/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698