mirror of https://github.com/tc39/test262.git
add flatten/flatMap to features.txt and mark appropriate tests
This commit is contained in:
parent
d8233624aa
commit
041da54c02
|
@ -55,6 +55,11 @@ regexp-unicode-property-escapes
|
||||||
Atomics
|
Atomics
|
||||||
SharedArrayBuffer
|
SharedArrayBuffer
|
||||||
|
|
||||||
|
# Array.prototype.flatten and Array.prototype.flatMap
|
||||||
|
# https://github.com/tc39/proposal-flatMap
|
||||||
|
Array.prototype.flatten
|
||||||
|
Array.prototype.flatMap
|
||||||
|
|
||||||
# Standard language features
|
# Standard language features
|
||||||
#
|
#
|
||||||
# Language features that have been included in a published version of the
|
# Language features that have been included in a published version of the
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatMap
|
||||||
description: >
|
description: >
|
||||||
array-like objects can be flattened
|
array-like objects can be flattened
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function getArgumentsObject() {
|
function getArgumentsObject() {
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatMap
|
||||||
description: >
|
description: >
|
||||||
Behavior when given a bound function
|
Behavior when given a bound function
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = [0, 0];
|
var a = [0, 0];
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatMap
|
||||||
description: >
|
description: >
|
||||||
Behavior when array is depth more than 1
|
Behavior when array is depth more than 1
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.compareArray([1, 2].flatMap(function(e) {
|
assert.compareArray([1, 2].flatMap(function(e) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ description: Array.prototype.flatMap.length value and descriptor.
|
||||||
info: >
|
info: >
|
||||||
17 ECMAScript Standard Built-in Objects
|
17 ECMAScript Standard Built-in Objects
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
|
|
|
@ -6,6 +6,7 @@ description: Array.prototype.flatmap name value and descriptor.
|
||||||
info: >
|
info: >
|
||||||
17 ECMAScript Standard Built-in Objects
|
17 ECMAScript Standard Built-in Objects
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
esid: sec-array.prototype.flatMap
|
esid: sec-array.prototype.flatMap
|
||||||
description: >
|
description: >
|
||||||
non callable argument should throw TypeError Exception
|
non callable argument should throw TypeError Exception
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.throws(TypeError, function () {
|
assert.throws(TypeError, function () {
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatMap
|
||||||
description: >
|
description: >
|
||||||
Behavior when `constructor` property is neither an Object nor undefined
|
Behavior when `constructor` property is neither an Object nor undefined
|
||||||
- if IsConstructor(C) is false, throw a TypeError exception.
|
- if IsConstructor(C) is false, throw a TypeError exception.
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = [];
|
var a = [];
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
esid: sec-array.prototype.flatMap
|
esid: sec-array.prototype.flatMap
|
||||||
description: >
|
description: >
|
||||||
null or undefined should throw TypeError Exception
|
null or undefined should throw TypeError Exception
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
||||||
Array.prototype.flatMap ( mapperFunction [ , thisArg ] )
|
Array.prototype.flatMap ( mapperFunction [ , thisArg ] )
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
|
features: [Array.prototype.flatMap]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = {};
|
var a = {};
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
array-like objects can be flattened
|
array-like objects can be flattened
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
function getArgumentsObject() {
|
function getArgumentsObject() {
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
using bound functions
|
using bound functions
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = [[0],[1]];
|
var a = [[0],[1]];
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
arrays with empty arrays elements
|
arrays with empty arrays elements
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = {};
|
var a = {};
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
arrays with empty object elements
|
arrays with empty object elements
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = {}, b = {};
|
var a = {}, b = {};
|
||||||
|
|
|
@ -6,6 +6,7 @@ description: Array.prototype.flatten.length value and descriptor.
|
||||||
info: >
|
info: >
|
||||||
17 ECMAScript Standard Built-in Objects
|
17 ECMAScript Standard Built-in Objects
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
|
|
|
@ -7,6 +7,7 @@ description: >
|
||||||
info: >
|
info: >
|
||||||
17 ECMAScript Standard Built-in Objects
|
17 ECMAScript Standard Built-in Objects
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
if the argument is a string or object, the depthNum is 0
|
if the argument is a string or object, the depthNum is 0
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = [1, [2]];
|
var a = [1, [2]];
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
Behavior when `constructor` property is neither an Object nor undefined
|
Behavior when `constructor` property is neither an Object nor undefined
|
||||||
- if IsConstructor(C) is false, throw a TypeError exception.
|
- if IsConstructor(C) is false, throw a TypeError exception.
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = [];
|
var a = [];
|
||||||
|
|
|
@ -5,7 +5,9 @@ esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
arrays with null, and undefined
|
arrays with null, and undefined
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = [void 0];
|
var a = [void 0];
|
||||||
|
|
||||||
assert(compareArray([1, null, void 0].flatten(), [1, null, undefined]));
|
assert(compareArray([1, null, void 0].flatten(), [1, null, undefined]));
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
esid: sec-array.prototype.flatten
|
esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
null or undefined should throw TypeError Exception
|
null or undefined should throw TypeError Exception
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
|
|
|
@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
if the argument is a positive infinity, the depthNum is max depth of the array
|
if the argument is a positive infinity, the depthNum is max depth of the array
|
||||||
includes: [compareArray.js]
|
includes: [compareArray.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var a = [1, [2, [3, [4]]]]
|
var a = [1, [2, [3, [4]]]]
|
||||||
|
|
|
@ -7,6 +7,7 @@ description: Property type and descriptor.
|
||||||
info: >
|
info: >
|
||||||
17 ECMAScript Standard Built-in Objects
|
17 ECMAScript Standard Built-in Objects
|
||||||
includes: [propertyHelper.js]
|
includes: [propertyHelper.js]
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue(
|
assert.sameValue(
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
esid: sec-array.prototype.flatten
|
esid: sec-array.prototype.flatten
|
||||||
description: >
|
description: >
|
||||||
if the argument is a Symbol or Object null, it throws exception
|
if the argument is a Symbol or Object null, it throws exception
|
||||||
|
features: [Array.prototype.flatten]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.throws(TypeError, function() {
|
assert.throws(TypeError, function() {
|
||||||
|
|
Loading…
Reference in New Issue