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

Unified Diff: src/ast/scopeinfo.cc

Issue 2353403003: [modules] Support exporting a local variable under multiple export names. (Closed)
Patch Set: 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.cc » ('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 63bc6cca68b4a3d30f03820136e681b627e6060d..c2ed3aeb539be34452e09c64f3d0a44a04a2113d 100644
--- a/src/ast/scopeinfo.cc
+++ b/src/ast/scopeinfo.cc
@@ -272,7 +272,7 @@ Handle<ScopeInfo> ScopeInfo::Create(Isolate* isolate, Zone* zone, Scope* scope,
// Module-specific information (only for module scopes).
if (scope->is_module_scope()) {
Handle<ModuleInfo> module_info =
- ModuleInfo::New(isolate, scope->AsModuleScope()->module());
+ ModuleInfo::New(isolate, zone, scope->AsModuleScope()->module());
DCHECK_EQ(index, scope_info->ModuleInfoIndex());
scope_info->set(index++, *module_info);
DCHECK_EQ(index, scope_info->ModuleVariableCountIndex());
@@ -852,7 +852,8 @@ Handle<ModuleInfoEntry> ModuleInfoEntry::New(Isolate* isolate,
return result;
}
-Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, ModuleDescriptor* descr) {
+Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, Zone* zone,
+ ModuleDescriptor* descr) {
// Serialize module requests.
Handle<FixedArray> module_requests = isolate->factory()->NewFixedArray(
static_cast<int>(descr->module_requests().size()));
@@ -881,14 +882,8 @@ Handle<ModuleInfo> ModuleInfo::New(Isolate* isolate, ModuleDescriptor* descr) {
}
// Serialize regular exports.
- Handle<FixedArray> regular_exports = isolate->factory()->NewFixedArray(
- static_cast<int>(descr->regular_exports().size()));
- {
- int i = 0;
- for (const auto& elem : descr->regular_exports()) {
- regular_exports->set(i++, *elem.second->Serialize(isolate));
- }
- }
+ Handle<FixedArray> regular_exports =
+ descr->SerializeRegularExports(isolate, zone);
// Serialize regular imports.
Handle<FixedArray> regular_imports = isolate->factory()->NewFixedArray(
« no previous file with comments | « src/ast/modules.cc ('k') | src/ast/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698