Commit 6776944f authored by Adam Klein's avatar Adam Klein Committed by Commit Bot

Remove always-true --harmony-array-prototype-values flag

It's been enabled for several releases now.

R=gsathya@chromium.org

Change-Id: Ib1806a1373821ee542dae2fd80f639b56bd99ed9
Reviewed-on: https://chromium-review.googlesource.com/c/1384796Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Adam Klein <adamk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58381}
parent e5e05015
......@@ -1727,9 +1727,12 @@ void Genesis::InitializeGlobal(Handle<JSGlobalObject> global_object,
InstallFunctionWithBuiltinId(isolate_, proto, "entries",
Builtins::kArrayPrototypeEntries, 0, true,
BuiltinFunctionId::kArrayEntries);
InstallFunctionAtSymbol(isolate_, proto, factory->iterator_symbol(),
"values", Builtins::kArrayPrototypeValues, 0, true,
DONT_ENUM, BuiltinFunctionId::kArrayValues);
Handle<JSFunction> values_iterator = InstallFunctionWithBuiltinId(
isolate_, proto, "values", Builtins::kArrayPrototypeValues, 0, true,
BuiltinFunctionId::kArrayValues);
JSObject::AddProperty(isolate_, proto, factory->iterator_symbol(),
values_iterator, DONT_ENUM);
SimpleInstallFunction(isolate_, proto, "forEach", Builtins::kArrayForEach,
1, false);
SimpleInstallFunction(isolate_, proto, "filter", Builtins::kArrayFilter, 1,
......@@ -4400,30 +4403,6 @@ void Genesis::InitializeGlobal_harmony_sharedarraybuffer() {
}
}
void Genesis::InitializeGlobal_harmony_array_prototype_values() {
if (!FLAG_harmony_array_prototype_values) return;
Handle<JSFunction> array_constructor(native_context()->array_function(),
isolate());
Handle<JSObject> array_prototype(
JSObject::cast(array_constructor->instance_prototype()), isolate());
Handle<Object> values_iterator =
JSObject::GetProperty(isolate(), array_prototype,
factory()->iterator_symbol())
.ToHandleChecked();
DCHECK(values_iterator->IsJSFunction());
JSObject::AddProperty(isolate(), array_prototype, factory()->values_string(),
values_iterator, DONT_ENUM);
Handle<Object> unscopables =
JSObject::GetProperty(isolate(), array_prototype,
factory()->unscopables_symbol())
.ToHandleChecked();
DCHECK(unscopables->IsJSObject());
JSObject::AddProperty(isolate(), Handle<JSObject>::cast(unscopables),
factory()->values_string(), factory()->true_value(),
NONE);
}
void Genesis::InitializeGlobal_harmony_array_flat() {
if (!FLAG_harmony_array_flat) return;
Handle<JSFunction> array_constructor(native_context()->array_function(),
......
......@@ -236,7 +236,6 @@ DEFINE_IMPLICATION(harmony_private_methods, harmony_private_fields)
V(harmony_sharedarraybuffer, "harmony sharedarraybuffer") \
V(harmony_import_meta, "harmony import.meta property") \
V(harmony_dynamic_import, "harmony dynamic import") \
V(harmony_array_prototype_values, "harmony Array.prototype.values") \
V(harmony_array_flat, "harmony Array.prototype.{flat,flatMap}") \
V(harmony_symbol_description, "harmony Symbol.prototype.description") \
V(harmony_global, "harmony global") \
......
......@@ -62,6 +62,7 @@ function PostNatives(utils) {
findIndex: true,
includes: true,
keys: true,
values: true,
};
%ToFastProperties(unscopables);
......
// Copyright 2016 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// Flags: --harmony-array-prototype-values
// Functionality of the values iterator is tested elsewhere; this test
// merely verifies that the 'values' property is set up correctly.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment