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

Unified Diff: src/factory.cc

Issue 2388153003: [modules] Implement namespace imports. (Closed)
Patch Set: Add comment on VisitModuleNamespaceImports. Created 4 years, 2 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/factory.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 163e86484dfb7f4d9f1ebd9c9ea02a8bf0ad51c2..f299249c0c19ac466c28ffa7b132b06753bdb07a 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1735,6 +1735,10 @@ void Factory::NewJSArrayStorage(Handle<JSArray> array,
array->set_length(Smi::FromInt(length));
}
+Handle<JSModuleNamespace> Factory::NewJSModuleNamespace() {
+ Handle<Map> map = isolate()->js_module_namespace_map();
+ return Handle<JSModuleNamespace>::cast(NewJSObjectFromMap(map));
+}
Handle<JSGeneratorObject> Factory::NewJSGeneratorObject(
Handle<JSFunction> function) {
@@ -1765,10 +1769,11 @@ Handle<Module> Factory::NewModule(Handle<SharedFunctionInfo> code) {
Handle<Module> module = Handle<Module>::cast(NewStruct(MODULE_TYPE));
module->set_code(*code);
+ module->set_embedder_data(isolate()->heap()->undefined_value());
module->set_exports(*exports);
- module->set_requested_modules(*requested_modules);
module->set_flags(0);
- module->set_embedder_data(isolate()->heap()->undefined_value());
+ module->set_module_namespace(isolate()->heap()->undefined_value());
+ module->set_requested_modules(*requested_modules);
return module;
}
« no previous file with comments | « src/factory.h ('k') | src/heap/objects-visiting.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698