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

Unified Diff: src/api.cc

Issue 2362153003: [modules] Support star exports. (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 | « no previous file | src/messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/api.cc
diff --git a/src/api.cc b/src/api.cc
index e1a6dcd9cef807d90494550de89b3ddd33ca165e..7fec7da4474a68d28c22c31ce91e63464151ca8b 100644
--- a/src/api.cc
+++ b/src/api.cc
@@ -1989,7 +1989,8 @@ static bool InstantiateModule(Local<Module> v8_module,
i::ModuleInfoEntry::cast(regular_imports->get(i)), isolate);
i::Handle<i::String> name(i::String::cast(entry->import_name()), isolate);
int module_request = i::Smi::cast(entry->module_request())->value();
- if (i::Module::ResolveImport(module, name, module_request).is_null()) {
+ if (i::Module::ResolveImport(module, name, module_request, true)
+ .is_null()) {
return false;
}
}
@@ -1998,8 +1999,10 @@ static bool InstantiateModule(Local<Module> v8_module,
for (int i = 0, n = special_exports->length(); i < n; ++i) {
i::Handle<i::ModuleInfoEntry> entry(
i::ModuleInfoEntry::cast(special_exports->get(i)), isolate);
- i::Handle<i::String> name(i::String::cast(entry->export_name()), isolate);
- if (i::Module::ResolveExport(module, name).is_null()) {
+ i::Handle<i::Object> name(entry->export_name(), isolate);
+ if (name->IsUndefined(isolate)) continue; // Star export.
+ if (i::Module::ResolveExport(module, i::Handle<i::String>::cast(name), true)
+ .is_null()) {
return false;
}
}
« no previous file with comments | « no previous file | src/messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698