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

Unified Diff: src/bootstrapper.cc

Issue 1781573003: Expose Array.prototype.values behind a flag and stage it (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 9 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/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 796fb08c594034d57c1cd54aa6ef1c3873f07af8..8fd97b2c7e18f9473168d9c258f6dde9e68445a4 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -2527,6 +2527,26 @@ void Genesis::InitializeGlobal_harmony_proxies() {
InstallFunction(global, name, proxy_function, factory->Object_string());
}
+void Genesis::InitializeGlobal_harmony_array_prototype_values() {
+ if (!FLAG_harmony_array_prototype_values) return;
+ Handle<JSFunction> array_constructor(native_context()->array_function());
+ Handle<JSObject> array_prototype(
+ JSObject::cast(array_constructor->instance_prototype()));
+ Handle<Object> values_iterator =
+ JSObject::GetProperty(array_prototype, factory()->iterator_symbol())
+ .ToHandleChecked();
+ DCHECK(values_iterator->IsJSFunction());
+ JSObject::AddProperty(array_prototype, factory()->values_string(),
+ values_iterator, DONT_ENUM);
+
+ Handle<Object> unscopables =
+ JSObject::GetProperty(array_prototype, factory()->unscopables_symbol())
+ .ToHandleChecked();
+ DCHECK(unscopables->IsJSObject());
+ JSObject::AddProperty(Handle<JSObject>::cast(unscopables),
+ factory()->values_string(), factory()->true_value(),
+ NONE);
+}
Handle<JSFunction> Genesis::InstallArrayBuffer(Handle<JSObject> target,
const char* name) {
@@ -2967,6 +2987,7 @@ bool Genesis::InstallExperimentalNatives() {
static const char* harmony_object_values_entries_natives[] = {nullptr};
static const char* harmony_object_own_property_descriptors_natives[] = {
nullptr};
+ static const char* harmony_array_prototype_values_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