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

Unified Diff: src/bootstrapper.cc

Issue 2599903003: Implement "global" property of global object
Patch Set: implement behind a harmony flag Created 4 years 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/flag-definitions.h » ('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 fe4721617cd8a2ffa3be6f6448fdd28f5d876907..7d31467101a3986e63843611aabdb33ca22d7061 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3467,6 +3467,18 @@ void Genesis::InitializeGlobal_harmony_array_prototype_values() {
NONE);
}
+void Genesis::InitializeGlobal_harmony_global() {
+ if (!FLAG_harmony_global) return;
+ Handle<JSGlobalObject> global_object(
+ JSGlobalObject::cast(native_context()->global_object()));
+ Handle<JSGlobalProxy> global_proxy(
+ JSGlobalProxy::cast(native_context()->global_proxy()));
+ Isolate* isolate = global_object->GetIsolate();
+ Factory* factory = isolate->factory();
+ Handle<String> global_name = factory->global_string();
+ JSObject::AddProperty(global_object, global_name, global_proxy, DONT_ENUM);
+}
+
Handle<JSFunction> Genesis::InstallArrayBuffer(Handle<JSObject> target,
const char* name,
Builtins::Name call,
@@ -3932,6 +3944,7 @@ bool Genesis::InstallExperimentalNatives() {
static const char* harmony_restrictive_generators_natives[] = {nullptr};
static const char* harmony_trailing_commas_natives[] = {nullptr};
static const char* harmony_class_fields_natives[] = {nullptr};
+ static const char* harmony_global_natives[] = {nullptr};
for (int i = ExperimentalNatives::GetDebuggerCount();
i < ExperimentalNatives::GetBuiltinsCount(); i++) {
« no previous file with comments | « no previous file | src/flag-definitions.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698