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

Unified Diff: src/objects.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/objects.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 59ce01243c9c5d8db2d5fbe2c9f03dc92029e606..9e633721fdeade0852f815df56fc9f7a11c35769 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -19580,13 +19580,17 @@ bool JSReceiver::HasProxyInPrototype(Isolate* isolate) {
return false;
}
-void Module::CreateExport(Handle<Module> module, Handle<String> name) {
+void Module::CreateExport(Handle<Module> module, Handle<FixedArray> names) {
+ DCHECK_LT(0, names->length());
Isolate* isolate = module->GetIsolate();
Handle<Cell> cell =
isolate->factory()->NewCell(isolate->factory()->undefined_value());
Handle<ObjectHashTable> exports(module->exports(), isolate);
- DCHECK(exports->Lookup(name)->IsTheHole(isolate));
- exports = ObjectHashTable::Put(exports, name, cell);
+ for (int i = 0, n = names->length(); i < n; ++i) {
+ Handle<String> name(String::cast(names->get(i)), isolate);
+ DCHECK(exports->Lookup(name)->IsTheHole(isolate));
+ exports = ObjectHashTable::Put(exports, name, cell);
+ }
module->set_exports(*exports);
}
« no previous file with comments | « src/objects.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698