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

Unified Diff: src/factory.cc

Issue 2625093005: [modules] Define @@toStringTag on namespace object as a field. (Closed)
Patch Set: Created 3 years, 11 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/bootstrapper.cc ('k') | src/objects.h » ('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 07dc8b5d09d18c097aaf38d4479f684296d178d1..12aa1528e2d061dfa12b0a7c9bac99728aad90f9 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1884,7 +1884,13 @@ void Factory::NewJSArrayStorage(Handle<JSArray> array,
Handle<JSModuleNamespace> Factory::NewJSModuleNamespace() {
Handle<Map> map = isolate()->js_module_namespace_map();
- return Handle<JSModuleNamespace>::cast(NewJSObjectFromMap(map));
+ Handle<JSModuleNamespace> module_namespace(
+ Handle<JSModuleNamespace>::cast(NewJSObjectFromMap(map)));
+ FieldIndex index = FieldIndex::ForDescriptor(
+ *map, JSModuleNamespace::kToStringTagFieldIndex);
+ Handle<String> to_string_value = NewStringFromAsciiChecked("Module");
+ module_namespace->FastPropertyAtPut(index, *to_string_value);
+ return module_namespace;
}
Handle<JSGeneratorObject> Factory::NewJSGeneratorObject(
« no previous file with comments | « src/bootstrapper.cc ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698