add flatten/flatMap to features.txt and mark appropriate tests

This commit is contained in:
Michael Ficarra 2018-01-05 11:55:19 -08:00 committed by Rick Waldron
parent d8233624aa
commit 041da54c02
23 changed files with 28 additions and 0 deletions

View File

@ -55,6 +55,11 @@ regexp-unicode-property-escapes
Atomics
SharedArrayBuffer
# Array.prototype.flatten and Array.prototype.flatMap
# https://github.com/tc39/proposal-flatMap
Array.prototype.flatten
Array.prototype.flatMap
# Standard language features
#
# Language features that have been included in a published version of the

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatMap
description: >
array-like objects can be flattened
includes: [compareArray.js]
features: [Array.prototype.flatMap]
---*/
function getArgumentsObject() {

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatMap
description: >
Behavior when given a bound function
includes: [compareArray.js]
features: [Array.prototype.flatMap]
---*/
var a = [0, 0];

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatMap
description: >
Behavior when array is depth more than 1
includes: [compareArray.js]
features: [Array.prototype.flatMap]
---*/
assert.compareArray([1, 2].flatMap(function(e) {

View File

@ -6,6 +6,7 @@ description: Array.prototype.flatMap.length value and descriptor.
info: >
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
features: [Array.prototype.flatMap]
---*/
assert.sameValue(

View File

@ -6,6 +6,7 @@ description: Array.prototype.flatmap name value and descriptor.
info: >
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
features: [Array.prototype.flatMap]
---*/
assert.sameValue(

View File

@ -4,6 +4,7 @@
esid: sec-array.prototype.flatMap
description: >
non callable argument should throw TypeError Exception
features: [Array.prototype.flatMap]
---*/
assert.throws(TypeError, function () {

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatMap
description: >
Behavior when `constructor` property is neither an Object nor undefined
- if IsConstructor(C) is false, throw a TypeError exception.
features: [Array.prototype.flatMap]
---*/
var a = [];

View File

@ -4,6 +4,7 @@
esid: sec-array.prototype.flatMap
description: >
null or undefined should throw TypeError Exception
features: [Array.prototype.flatMap]
---*/
assert.throws(TypeError, function() {

View File

@ -7,6 +7,7 @@ description: >
Array.prototype.flatMap ( mapperFunction [ , thisArg ] )
includes: [compareArray.js]
flags: [onlyStrict]
features: [Array.prototype.flatMap]
---*/
var a = {};

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
description: >
array-like objects can be flattened
includes: [compareArray.js]
features: [Array.prototype.flatten]
---*/
function getArgumentsObject() {

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
description: >
using bound functions
includes: [compareArray.js]
features: [Array.prototype.flatten]
---*/
var a = [[0],[1]];

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
description: >
arrays with empty arrays elements
includes: [compareArray.js]
features: [Array.prototype.flatten]
---*/
var a = {};

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
description: >
arrays with empty object elements
includes: [compareArray.js]
features: [Array.prototype.flatten]
---*/
var a = {}, b = {};

View File

@ -6,6 +6,7 @@ description: Array.prototype.flatten.length value and descriptor.
info: >
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
features: [Array.prototype.flatten]
---*/
assert.sameValue(

View File

@ -7,6 +7,7 @@ description: >
info: >
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
features: [Array.prototype.flatten]
---*/
assert.sameValue(

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
description: >
if the argument is a string or object, the depthNum is 0
includes: [compareArray.js]
features: [Array.prototype.flatten]
---*/
var a = [1, [2]];

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
description: >
Behavior when `constructor` property is neither an Object nor undefined
- if IsConstructor(C) is false, throw a TypeError exception.
features: [Array.prototype.flatten]
---*/
var a = [];

View File

@ -5,7 +5,9 @@ esid: sec-array.prototype.flatten
description: >
arrays with null, and undefined
includes: [compareArray.js]
features: [Array.prototype.flatten]
---*/
var a = [void 0];
assert(compareArray([1, null, void 0].flatten(), [1, null, undefined]));

View File

@ -4,6 +4,7 @@
esid: sec-array.prototype.flatten
description: >
null or undefined should throw TypeError Exception
features: [Array.prototype.flatten]
---*/
assert.throws(TypeError, function() {

View File

@ -5,6 +5,7 @@ esid: sec-array.prototype.flatten
description: >
if the argument is a positive infinity, the depthNum is max depth of the array
includes: [compareArray.js]
features: [Array.prototype.flatten]
---*/
var a = [1, [2, [3, [4]]]]

View File

@ -7,6 +7,7 @@ description: Property type and descriptor.
info: >
17 ECMAScript Standard Built-in Objects
includes: [propertyHelper.js]
features: [Array.prototype.flatten]
---*/
assert.sameValue(

View File

@ -4,6 +4,7 @@
esid: sec-array.prototype.flatten
description: >
if the argument is a Symbol or Object null, it throws exception
features: [Array.prototype.flatten]
---*/
assert.throws(TypeError, function() {