diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc index da762131c5..0f57e5f7a0 100644 --- a/src/bootstrapper.cc +++ b/src/bootstrapper.cc @@ -1733,6 +1733,10 @@ void Genesis::InitializeGlobal(Handle global_object, native_context()->set_array_for_each_iterator(*for_each_fun); SimpleInstallFunction(isolate_, proto, "filter", Builtins::kArrayFilter, 1, false); + SimpleInstallFunction(isolate_, proto, "flat", + Builtins::kArrayPrototypeFlat, 0, false); + SimpleInstallFunction(isolate_, proto, "flatMap", + Builtins::kArrayPrototypeFlatMap, 1, false); SimpleInstallFunction(isolate_, proto, "map", Builtins::kArrayMap, 1, false); SimpleInstallFunction(isolate_, proto, "every", Builtins::kArrayEvery, 1, @@ -4214,18 +4218,6 @@ void Genesis::InitializeGlobal_harmony_sharedarraybuffer() { InstallToStringTag(isolate_, isolate()->atomics_object(), "Atomics"); } -void Genesis::InitializeGlobal_harmony_array_flat() { - if (!FLAG_harmony_array_flat) return; - Handle array_constructor(native_context()->array_function(), - isolate()); - Handle array_prototype( - JSObject::cast(array_constructor->instance_prototype()), isolate()); - SimpleInstallFunction(isolate(), array_prototype, "flat", - Builtins::kArrayPrototypeFlat, 0, false); - SimpleInstallFunction(isolate(), array_prototype, "flatMap", - Builtins::kArrayPrototypeFlatMap, 1, false); -} - void Genesis::InitializeGlobal_harmony_symbol_description() { if (!FLAG_harmony_symbol_description) return; diff --git a/src/flag-definitions.h b/src/flag-definitions.h index 4bdf41e9ce..3658aa9f0f 100644 --- a/src/flag-definitions.h +++ b/src/flag-definitions.h @@ -234,7 +234,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_flat, "harmony Array.prototype.{flat,flatMap}") \ V(harmony_symbol_description, "harmony Symbol.prototype.description") \ V(harmony_global, "harmony global") \ V(harmony_json_stringify, "well-formed JSON.stringify") \ diff --git a/test/mjsunit/harmony/array-flat-species.js b/test/mjsunit/harmony/array-flat-species.js index d04f8a0875..7181c10bea 100644 --- a/test/mjsunit/harmony/array-flat-species.js +++ b/test/mjsunit/harmony/array-flat-species.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --harmony-array-flat - { class MyArray extends Array { static get [Symbol.species]() { diff --git a/test/mjsunit/harmony/array-flat.js b/test/mjsunit/harmony/array-flat.js index 86571e8dce..9a291dc3b0 100644 --- a/test/mjsunit/harmony/array-flat.js +++ b/test/mjsunit/harmony/array-flat.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --harmony-array-flat - assertEquals(Array.prototype.flat.length, 0); assertEquals(Array.prototype.flat.name, 'flat'); diff --git a/test/mjsunit/harmony/array-flatMap-species.js b/test/mjsunit/harmony/array-flatMap-species.js index d4159b4801..48f9bea2d0 100644 --- a/test/mjsunit/harmony/array-flatMap-species.js +++ b/test/mjsunit/harmony/array-flatMap-species.js @@ -2,8 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --harmony-array-flat - { class MyArray extends Array { static get [Symbol.species]() { diff --git a/test/mjsunit/harmony/array-flatMap.js b/test/mjsunit/harmony/array-flatMap.js index 9f0426fe7f..65a4025603 100644 --- a/test/mjsunit/harmony/array-flatMap.js +++ b/test/mjsunit/harmony/array-flatMap.js @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -// Flags: --harmony-array-flat --allow-natives-syntax +// Flags: --allow-natives-syntax assertEquals(Array.prototype.flatMap.length, 1); assertEquals(Array.prototype.flatMap.name, 'flatMap'); diff --git a/test/test262/testcfg.py b/test/test262/testcfg.py index fe130665f6..8bec9965e2 100644 --- a/test/test262/testcfg.py +++ b/test/test262/testcfg.py @@ -46,8 +46,6 @@ FEATURE_FLAGS = { 'class-static-fields-public': '--harmony-class-fields', 'class-fields-private': '--harmony-private-fields', 'class-static-fields-private': '--harmony-private-fields', - 'Array.prototype.flat': '--harmony-array-flat', - 'Array.prototype.flatMap': '--harmony-array-flat', 'String.prototype.matchAll': '--harmony-string-matchall', 'Symbol.matchAll': '--harmony-string-matchall', 'numeric-separator-literal': '--harmony-numeric-separator',