diff --git a/test/built-ins/TypedArray/prototype/fill/coerced-indexes.js b/test/built-ins/TypedArray/prototype/fill/coerced-indexes.js index 0f0dab7d833d8bbdb6a8be013ab8a6bfe3237c91..2d512bae5c0fa15c22d9be064e2892a5d5d115c6 100644 --- a/test/built-ins/TypedArray/prototype/fill/coerced-indexes.js +++ b/test/built-ins/TypedArray/prototype/fill/coerced-indexes.js @@ -33,72 +33,72 @@ features: [TypedArray] testWithTypedArrayConstructors(function(TA) { assert( - compareArray(new TA([0, 0])).fill(1, undefined), [1, 1], + compareArray(new TA([0, 0]).fill(1, undefined), [1, 1]), '`undefined` start coerced to 0' ); assert( - compareArray(new TA([0, 0])).fill(1, 0, undefined), [1, 1], + compareArray(new TA([0, 0]).fill(1, 0, undefined), [1, 1]), 'If end is undefined, let relativeEnd be len' ); assert( - compareArray(new TA([0, 0])).fill(1, null), [1, 1], + compareArray(new TA([0, 0]).fill(1, null), [1, 1]), '`null` start coerced to 0' ); assert( - compareArray(new TA([0, 0])).fill(1, 0, null), [0, 0], + compareArray(new TA([0, 0]).fill(1, 0, null), [0, 0]), '`null` end coerced to 0' ); assert( - compareArray(new TA([0, 0])).fill(1, true), [0, 1], + compareArray(new TA([0, 0]).fill(1, true), [0, 1]), '`true` start coerced to 1' ); assert( - compareArray(new TA([0, 0])).fill(1, 0, true), [1, 0], + compareArray(new TA([0, 0]).fill(1, 0, true), [1, 0]), '`true` end coerced to 1' ); assert( - compareArray(new TA([0, 0])).fill(1, false), [1, 1], + compareArray(new TA([0, 0]).fill(1, false), [1, 1]), '`false` start coerced to 0' ); assert( - compareArray(new TA([0, 0])).fill(1, 0, false), [0, 0], + compareArray(new TA([0, 0]).fill(1, 0, false), [0, 0]), '`false` end coerced to 0' ); assert( - compareArray(new TA([0, 0])).fill(1, NaN), [1, 1], + compareArray(new TA([0, 0]).fill(1, NaN), [1, 1]), '`NaN` start coerced to 0' ); assert( - compareArray(new TA([0, 0])).fill(1, 0, NaN), [0, 0], + compareArray(new TA([0, 0]).fill(1, 0, NaN), [0, 0]), '`NaN` end coerced to 0' ); assert( - compareArray(new TA([0, 0])).fill(1, '1'), [0, 1], + compareArray(new TA([0, 0]).fill(1, '1'), [0, 1]), 'string start coerced' ); assert( - compareArray(new TA([0, 0])).fill(1, 0, '1'), [1, 0], + compareArray(new TA([0, 0]).fill(1, 0, '1'), [1, 0]), 'string end coerced' ); assert( - compareArray(new TA([0, 0])).fill(1, 1.5), [0, 1], + compareArray(new TA([0, 0]).fill(1, 1.5), [0, 1]), 'start as a float number coerced' ); assert( - compareArray(new TA([0, 0])).fill(1, 0, 1.5), [1, 0], + compareArray(new TA([0, 0]).fill(1, 0, 1.5), [1, 0]), 'end as a float number coerced' ); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js b/test/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js index ca66ad48c5929555ca61693cc5c156a7ded2fc1e..2a332b54f43ae8432d32f1d163eea75adaa206eb 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js @@ -34,9 +34,9 @@ features: [TypedArray] ---*/ testWithTypedArrayConstructors(function(TA) { - assert(compareArray(new TA([0, 0, 0])).fill(8, 1, 2), [0, 8, 0]); - assert(compareArray(new TA([0, 0, 0, 0, 0])).fill(8, -3, 4), [0, 0, 8, 8, 0]); - assert(compareArray(new TA([0, 0, 0, 0, 0])).fill(8, -2, -1), [0, 0, 0, 8, 0]); - assert(compareArray(new TA([0, 0, 0, 0, 0])).fill(8, -1, -3), [0, 0, 0, 0, 0]); - assert(compareArray(new TA([0, 0, 0, 0, 0])).fill(8, 1, 3), [0, 8, 8, 0, 0]); + assert(compareArray(new TA([0, 0, 0]).fill(8, 1, 2), [0, 8, 0])); + assert(compareArray(new TA([0, 0, 0, 0, 0]).fill(8, -3, 4), [0, 0, 8, 8, 0])); + assert(compareArray(new TA([0, 0, 0, 0, 0]).fill(8, -2, -1), [0, 0, 0, 8, 0])); + assert(compareArray(new TA([0, 0, 0, 0, 0]).fill(8, -1, -3), [0, 0, 0, 0, 0])); + assert(compareArray(new TA([0, 0, 0, 0, 0]).fill(8, 1, 3), [0, 8, 8, 0, 0])); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js b/test/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js index 13f76f4821cc258019fe9f7096d8d5b20fd0eec8..4926fdb57ae017daf6beb7c9780c5f57430b79a0 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js @@ -32,22 +32,22 @@ features: [TypedArray] testWithTypedArrayConstructors(function(TA) { assert( - compareArray(new TA([0, 0, 0])).fill(8, 0, 1), [8, 0, 0], + compareArray(new TA([0, 0, 0]).fill(8, 0, 1), [8, 0, 0]), "Fill elements from custom end position" ); assert( - compareArray(new TA([0, 0, 0])).fill(8, 0, -1), [8, 8, 0], + compareArray(new TA([0, 0, 0]).fill(8, 0, -1), [8, 8, 0]), "negative end sets final position to max((length + relativeEnd), 0)" ); assert( - compareArray(new TA([0, 0, 0])).fill(8, 0, 5), [8, 8, 8], + compareArray(new TA([0, 0, 0]).fill(8, 0, 5), [8, 8, 8]), "end position is never higher than of length" ); assert( - compareArray(new TA([0, 0, 0])).fill(8, 0, -4), [0, 0, 0], + compareArray(new TA([0, 0, 0]).fill(8, 0, -4), [0, 0, 0]), "end position is 0 when (len + relativeEnd) < 0" ); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js b/test/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js index 245c5d85632e8f24f79de2b1183c5bf823de9723..cb89c951fd4a4391455d40037a726abb704650f5 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js @@ -30,22 +30,22 @@ features: [TypedArray] testWithTypedArrayConstructors(function(TA) { assert( - compareArray(new TA([0, 0, 0])).fill(8, 1), [0, 8, 8], + compareArray(new TA([0, 0, 0]).fill(8, 1), [0, 8, 8]), "Fill elements from custom start position" ); assert( - compareArray(new TA([0, 0, 0])).fill(8, 4), [0, 0, 0], + compareArray(new TA([0, 0, 0]).fill(8, 4), [0, 0, 0]), "start position is never higher than length" ); assert( - compareArray(new TA([0, 0, 0])).fill(8, -1), [0, 0, 8], + compareArray(new TA([0, 0, 0]).fill(8, -1), [0, 0, 8]), "start < 0 sets initial position to max((len + relativeStart), 0)" ); assert( - compareArray(new TA([0, 0, 0])).fill(8, -5), [8, 8, 8], + compareArray(new TA([0, 0, 0]).fill(8, -5), [8, 8, 8]), "start position is 0 when (len + relativeStart) < 0" ); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values.js b/test/built-ins/TypedArray/prototype/fill/fill-values.js index cf632e77bf0bad104ac74916e79b5b63af0c1327..7d0faa44f38bcf7cc4944bccf3cd8fb8265e20b8 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values.js @@ -38,7 +38,7 @@ testWithTypedArrayConstructors(function(TA) { ); assert( - compareArray(new TA([0, 0, 0])).fill(8), [8, 8, 8], + compareArray(new TA([0, 0, 0]).fill(8), [8, 8, 8]), "Default start and end indexes are 0 and this.length" ); });