diff options
Diffstat (limited to 'test/built-ins/TypedArray/prototype/includes')
8 files changed, 47 insertions, 47 deletions
diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-infinity.js b/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-infinity.js index 0d44d7a65..56dd73515 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-infinity.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-infinity.js @@ -30,15 +30,15 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 43, 41])); + var sample = new TA([42n, 43n, 43n, 41n]); assert.sameValue( - sample.includes(convertToBigInt(43), Infinity), + sample.includes(43n, Infinity), false, "includes(43, Infinity)" ); assert.sameValue( - sample.includes(convertToBigInt(43), -Infinity), + sample.includes(43n, -Infinity), true, "includes(43, -Infinity)"); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-minus-zero.js b/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-minus-zero.js index 285a7c316..83ee261a7 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-minus-zero.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/fromIndex-minus-zero.js @@ -27,8 +27,8 @@ features: [BigInt, TypedArray] testWithBigIntTypedArrayConstructors(function(TA) { var sample; - sample = new TA(convertToBigInt([42, 43])); - assert.sameValue(sample.includes(convertToBigInt(42), -0), true, "-0 [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), -0), true, "-0 [1]"); - assert.sameValue(sample.includes(convertToBigInt(44), -0), false, "-0 [2]"); + sample = new TA([42n, 43n]); + assert.sameValue(sample.includes(42n, -0), true, "-0 [0]"); + assert.sameValue(sample.includes(43n, -0), true, "-0 [1]"); + assert.sameValue(sample.includes(44n, -0), false, "-0 [2]"); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/includes/BigInt/get-length-uses-internal-arraylength.js index 85ab71b09..2117ea212 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/get-length-uses-internal-arraylength.js @@ -24,10 +24,10 @@ features: [BigInt, TypedArray] Object.defineProperty(TypedArray.prototype, "length", {value: 0}); testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([7])); + var sample = new TA([7n]); Object.defineProperty(TA.prototype, "length", {value: 0}); Object.defineProperty(sample, "length", {value: 0}); - assert.sameValue(sample.includes(convertToBigInt(7)), true); + assert.sameValue(sample.includes(7n), true); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex-symbol.js b/test/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex-symbol.js index 33c8861ab..0625bfbcf 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex-symbol.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex-symbol.js @@ -25,9 +25,9 @@ features: [BigInt, Symbol, TypedArray] var fromIndex = Symbol("1"); testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([7])); + var sample = new TA([7n]); assert.throws(TypeError, function() { - sample.includes(convertToBigInt(7), fromIndex); + sample.includes(7n, fromIndex); }); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex.js index 6ddcb1f70..1013df57e 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/return-abrupt-tointeger-fromindex.js @@ -29,9 +29,9 @@ var fromIndex = { }; testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([7])); + var sample = new TA([7n]); assert.throws(Test262Error, function() { - sample.includes(convertToBigInt(7), fromIndex); + sample.includes(7n, fromIndex); }); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/search-found-returns-true.js b/test/built-ins/TypedArray/prototype/includes/BigInt/search-found-returns-true.js index f11212ce4..3d1140a0a 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/search-found-returns-true.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/search-found-returns-true.js @@ -30,15 +30,15 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 42, 41])); - assert.sameValue(sample.includes(convertToBigInt(42)), true, "includes(42)"); - assert.sameValue(sample.includes(convertToBigInt(43)), true, "includes(43)"); - assert.sameValue(sample.includes(convertToBigInt(43), 1), true, "includes(43, 1)"); - assert.sameValue(sample.includes(convertToBigInt(42), 1), true, "includes(42, 1)"); - assert.sameValue(sample.includes(convertToBigInt(42), 2), true, "includes(42, 2)"); + var sample = new TA([42n, 43n, 42n, 41n]); + assert.sameValue(sample.includes(42n), true, "includes(42)"); + assert.sameValue(sample.includes(43n), true, "includes(43)"); + assert.sameValue(sample.includes(43n, 1), true, "includes(43, 1)"); + assert.sameValue(sample.includes(42n, 1), true, "includes(42, 1)"); + assert.sameValue(sample.includes(42n, 2), true, "includes(42, 2)"); - assert.sameValue(sample.includes(convertToBigInt(42), -4), true, "includes(42, -4)"); - assert.sameValue(sample.includes(convertToBigInt(42), -3), true, "includes(42, -3)"); - assert.sameValue(sample.includes(convertToBigInt(42), -2), true, "includes(42, -2)"); - assert.sameValue(sample.includes(convertToBigInt(42), -5), true, "includes(42, -5)"); + assert.sameValue(sample.includes(42n, -4), true, "includes(42, -4)"); + assert.sameValue(sample.includes(42n, -3), true, "includes(42, -3)"); + assert.sameValue(sample.includes(42n, -2), true, "includes(42, -2)"); + assert.sameValue(sample.includes(42n, -5), true, "includes(42, -5)"); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/search-not-found-returns-false.js b/test/built-ins/TypedArray/prototype/includes/BigInt/search-not-found-returns-false.js index 5bf3b9086..9d4673e8c 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/search-not-found-returns-false.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/search-not-found-returns-false.js @@ -32,11 +32,11 @@ features: [BigInt, TypedArray] testWithBigIntTypedArrayConstructors(function(TA) { var sample; - sample = new TA(convertToBigInt([42, 43, 42, 41])); - assert.sameValue(sample.includes(convertToBigInt(44)), false, "includes(44)"); - assert.sameValue(sample.includes(convertToBigInt(43), 2), false, "includes(43, 2)"); - assert.sameValue(sample.includes(convertToBigInt(42), 3), false, "includes(42, 3)"); - assert.sameValue(sample.includes(convertToBigInt(44), -4), false, "includes(44, -4)"); - assert.sameValue(sample.includes(convertToBigInt(44), -5), false, "includes(44, -5)"); - assert.sameValue(sample.includes(convertToBigInt(42), -1), false, "includes(42, -1)"); + sample = new TA([42n, 43n, 42n, 41n]); + assert.sameValue(sample.includes(44n), false, "includes(44)"); + assert.sameValue(sample.includes(43n, 2), false, "includes(43, 2)"); + assert.sameValue(sample.includes(42n, 3), false, "includes(42, 3)"); + assert.sameValue(sample.includes(44n, -4), false, "includes(44, -4)"); + assert.sameValue(sample.includes(44n, -5), false, "includes(44, -5)"); + assert.sameValue(sample.includes(42n, -1), false, "includes(42, -1)"); }); diff --git a/test/built-ins/TypedArray/prototype/includes/BigInt/tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/includes/BigInt/tointeger-fromindex.js index 67fbd38da..4c5872be6 100644 --- a/test/built-ins/TypedArray/prototype/includes/BigInt/tointeger-fromindex.js +++ b/test/built-ins/TypedArray/prototype/includes/BigInt/tointeger-fromindex.js @@ -38,28 +38,28 @@ var obj = { testWithBigIntTypedArrayConstructors(function(TA) { var sample; - sample = new TA(convertToBigInt([42, 43])); - assert.sameValue(sample.includes(convertToBigInt(42), "1"), false, "string [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), "1"), true, "string [1]"); + sample = new TA([42n, 43n]); + assert.sameValue(sample.includes(42n, "1"), false, "string [0]"); + assert.sameValue(sample.includes(43n, "1"), true, "string [1]"); - assert.sameValue(sample.includes(convertToBigInt(42), true), false, "true [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), true), true, "true [1]"); + assert.sameValue(sample.includes(42n, true), false, "true [0]"); + assert.sameValue(sample.includes(43n, true), true, "true [1]"); - assert.sameValue(sample.includes(convertToBigInt(42), false), true, "false [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), false), true, "false [1]"); + assert.sameValue(sample.includes(42n, false), true, "false [0]"); + assert.sameValue(sample.includes(43n, false), true, "false [1]"); - assert.sameValue(sample.includes(convertToBigInt(42), NaN), true, "NaN [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), NaN), true, "NaN [1]"); + assert.sameValue(sample.includes(42n, NaN), true, "NaN [0]"); + assert.sameValue(sample.includes(43n, NaN), true, "NaN [1]"); - assert.sameValue(sample.includes(convertToBigInt(42), null), true, "null [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), null), true, "null [1]"); + assert.sameValue(sample.includes(42n, null), true, "null [0]"); + assert.sameValue(sample.includes(43n, null), true, "null [1]"); - assert.sameValue(sample.includes(convertToBigInt(42), undefined), true, "undefined [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), undefined), true, "undefined [1]"); + assert.sameValue(sample.includes(42n, undefined), true, "undefined [0]"); + assert.sameValue(sample.includes(43n, undefined), true, "undefined [1]"); - assert.sameValue(sample.includes(convertToBigInt(42), null), true, "null [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), null), true, "null [1]"); + assert.sameValue(sample.includes(42n, null), true, "null [0]"); + assert.sameValue(sample.includes(43n, null), true, "null [1]"); - assert.sameValue(sample.includes(convertToBigInt(42), obj), false, "object [0]"); - assert.sameValue(sample.includes(convertToBigInt(43), obj), true, "object [1]"); + assert.sameValue(sample.includes(42n, obj), false, "object [0]"); + assert.sameValue(sample.includes(43n, obj), true, "object [1]"); }); |