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

Unified Diff: src/bootstrapper.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/ast/ast-types.cc ('k') | src/compiler/types.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 6c8c4054b94c99cad7444b9a2c49bacea38d7ae9..a5513d8ee4e60b77ccff4894b87f97e9d67ce931 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -1969,6 +1969,25 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
Context::JS_SET_FUN_INDEX);
}
+ { // -- J S M o d u l e N a m e s p a c e
+ Handle<Map> map =
+ factory->NewMap(JS_MODULE_NAMESPACE_TYPE, JSModuleNamespace::kSize);
+ Map::SetPrototype(map, isolate->factory()->null_value());
+ native_context()->set_js_module_namespace_map(*map);
+
+ // Install @@toStringTag.
+ PropertyAttributes attribs =
+ static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY);
+ Handle<AccessorInfo> toStringTag =
+ Accessors::ModuleNamespaceToStringTagInfo(isolate, attribs);
+ AccessorConstantDescriptor d(factory->to_string_tag_symbol(), toStringTag,
+ attribs);
+ Map::EnsureDescriptorSlack(map, 1);
+ map->AppendDescriptor(&d);
+
+ // TODO(neis): Implement and install @@iterator.
+ }
+
{ // -- I t e r a t o r R e s u l t
Handle<Map> map =
factory->NewMap(JS_OBJECT_TYPE, JSIteratorResult::kSize);
« no previous file with comments | « src/ast/ast-types.cc ('k') | src/compiler/types.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698