diff options
Diffstat (limited to 'test/built-ins/TypedArray/prototype/filter/BigInt')
16 files changed, 38 insertions, 38 deletions
diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-with-thisarg.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-with-thisarg.js index d0d796be5..2d32a8a78 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-with-thisarg.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-with-thisarg.js @@ -17,7 +17,7 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 44])); + var sample = new TA([42n, 43n, 44n]); var results = []; var thisArg = ["test262", 0, "ecma262", 0]; @@ -30,17 +30,17 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(thisArg.length, 4, "thisArg.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], convertToBigInt(42), "results[0][0] - kValue"); + assert.sameValue(results[0][0], 42n, "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], convertToBigInt(43), "results[1][0] - kValue"); + assert.sameValue(results[1][0], 43n, "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], convertToBigInt(44), "results[2][0] - kValue"); + assert.sameValue(results[2][0], 44n, "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-without-thisarg.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-without-thisarg.js index ca3e078d2..5c9d91b6d 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-without-thisarg.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-arguments-without-thisarg.js @@ -17,7 +17,7 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 44])); + var sample = new TA([42n, 43n, 44n]); var results = []; @@ -28,17 +28,17 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(results.length, 3, "results.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], convertToBigInt(42), "results[0][0] - kValue"); + assert.sameValue(results[0][0], 42n, "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], convertToBigInt(43), "results[1][0] - kValue"); + assert.sameValue(results[1][0], 43n, "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], convertToBigInt(44), "results[2][0] - kValue"); + assert.sameValue(results[2][0], 44n, "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-no-iteration-over-non-integer.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-no-iteration-over-non-integer.js index b980efe72..2162cbe16 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-no-iteration-over-non-integer.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-no-iteration-over-non-integer.js @@ -17,7 +17,7 @@ features: [BigInt, Symbol, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([7, 8])); + var sample = new TA([7n, 8n]); var results = []; @@ -33,6 +33,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); - assert.sameValue(results[0][0], convertToBigInt(7), "results[0][0] - kValue"); - assert.sameValue(results[1][0], convertToBigInt(8), "results[1][0] - kValue"); + assert.sameValue(results[0][0], 7n, "results[0][0] - kValue"); + assert.sameValue(results[1][0], 8n, "results[1][0] - kValue"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-return-does-not-change-instance.js index 4bac77886..4ace9cecc 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-return-does-not-change-instance.js @@ -11,13 +11,13 @@ features: [BigInt, TypedArray] testWithBigIntTypedArrayConstructors(function(TA) { var sample1 = new TA(3); - sample1[1] = convertToBigInt(1); + sample1[1] = 1n; sample1.filter(function() { return 42; }); - assert.sameValue(sample1[0], convertToBigInt(0), "[0] == 0"); - assert.sameValue(sample1[1], convertToBigInt(1), "[1] == 1"); - assert.sameValue(sample1[2], convertToBigInt(0), "[2] == 0"); + assert.sameValue(sample1[0], 0n, "[0] == 0"); + assert.sameValue(sample1[1], 1n, "[1] == 1"); + assert.sameValue(sample1[2], 0n, "[2] == 0"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-set-value-during-iteration.js b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-set-value-during-iteration.js index a4e86b427..c8435afa6 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-set-value-during-iteration.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-set-value-during-iteration.js @@ -17,7 +17,7 @@ features: [BigInt, Reflect.set, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 44])); + var sample = new TA([42n, 43n, 44n]); var newVal = 0; sample.filter(function(val, i) { @@ -27,7 +27,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 0, convertToBigInt(7)), + Reflect.set(sample, 0, 7n), true, "re-set a value for sample[0]" ); @@ -41,7 +41,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { newVal++; }); - assert.sameValue(sample[0], convertToBigInt(7), "changed values after interaction [0] == 7"); - assert.sameValue(sample[1], convertToBigInt(1), "changed values after interaction [1] == 1"); - assert.sameValue(sample[2], convertToBigInt(2), "changed values after interaction [2] == 2"); + assert.sameValue(sample[0], 7n, "changed values after interaction [0] == 7"); + assert.sameValue(sample[1], 1n, "changed values after interaction [1] == 1"); + assert.sameValue(sample[2], 2n, "changed values after interaction [2] == 2"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/result-does-not-share-buffer.js b/test/built-ins/TypedArray/prototype/filter/BigInt/result-does-not-share-buffer.js index 1a84196dc..70c11fca3 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/result-does-not-share-buffer.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/result-does-not-share-buffer.js @@ -16,7 +16,7 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40, 41, 42])); + var sample = new TA([40n, 41n, 42n]); var result; result = sample.filter(function() { return true; }); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/result-full-callbackfn-returns-true.js b/test/built-ins/TypedArray/prototype/filter/BigInt/result-full-callbackfn-returns-true.js index d63ba8691..b539ca2ec 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/result-full-callbackfn-returns-true.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/result-full-callbackfn-returns-true.js @@ -17,7 +17,7 @@ features: [BigInt, Symbol, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40, 41, 42])); + var sample = new TA([40n, 41n, 42n]); [ true, diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-abrupt.js index 9b7bc9dfc..ea71fee89 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-abrupt.js @@ -27,7 +27,7 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40, 41, 42, 43])); + var sample = new TA([40n, 41n, 42n, 43n]); Object.defineProperty(sample, "constructor", { get: function() { diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-inherited.js b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-inherited.js index 35fe965b0..7de9e3d69 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-inherited.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-inherited.js @@ -27,7 +27,7 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40, 41, 42, 43])); + var sample = new TA([40n, 41n, 42n, 43n]); var calls = 0; var result; diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-returns-throws.js b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-returns-throws.js index 79e40b47c..52fb99998 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-returns-throws.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor-returns-throws.js @@ -31,7 +31,7 @@ features: [BigInt, Symbol, TypedArray] var callbackfn = function() { return true; }; testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40, 41, 42, 43])); + var sample = new TA([40n, 41n, 42n, 43n]); sample.constructor = 42; assert.throws(TypeError, function() { diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor.js index 0b64ac3ca..2fa985b26 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-ctor.js @@ -27,7 +27,7 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40, 41, 42, 43])); + var sample = new TA([40n, 41n, 42n, 43n]); var calls = 0; var result; diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js index 1efefe1be..5b3f2af2b 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-invocation.js @@ -37,7 +37,7 @@ features: [BigInt, Symbol.species, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40, 42, 42])); + var sample = new TA([40n, 42n, 42n]); var result, ctorThis; sample.constructor = {}; @@ -47,7 +47,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { return new TA(count); }; - sample.filter(function(v) { return v === convertToBigInt(42); }); + sample.filter(function(v) { return v === 42n; }); assert.sameValue(result.length, 1, "called with 1 argument"); assert.sameValue(result[0], 2, "[0] is the new captured length"); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js index 31f2887b3..8ad970667 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor-returns-another-instance.js @@ -37,7 +37,7 @@ features: [BigInt, Symbol.species, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40])); + var sample = new TA([40n]); var otherTA = TA === Int8Array ? Int16Array : Int8Array; var other = new otherTA([1, 0, 1]); var result; diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor.js b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor.js index f881f792d..4e4da9bee 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/speciesctor-get-species-custom-ctor.js @@ -37,7 +37,7 @@ features: [BigInt, Symbol.species, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([40, 41, 42])); + var sample = new TA([40n, 41n, 42n]); var calls = 0; var other, result; @@ -52,5 +52,5 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(calls, 1, "ctor called once"); assert.sameValue(result, other, "return is instance of custom constructor"); - assert(compareArray(result, convertToBigInt([40, 41, 42])), "values are set on the new obj"); + assert(compareArray(result, [40n, 41n, 42n]), "values are set on the new obj"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/filter/BigInt/values-are-not-cached.js index 25b7eb24a..d2a982a31 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/values-are-not-cached.js @@ -17,15 +17,15 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 44])); + var sample = new TA([42n, 43n, 44n]); sample.filter(function(v, i) { if (i < sample.length - 1) { - sample[i+1] = convertToBigInt(42); + sample[i+1] = 42n; } assert.sameValue( - v, convertToBigInt(42), "method does not cache values before callbackfn calls" + v, 42n, "method does not cache values before callbackfn calls" ); }); }); diff --git a/test/built-ins/TypedArray/prototype/filter/BigInt/values-are-set.js b/test/built-ins/TypedArray/prototype/filter/BigInt/values-are-set.js index b7f2775f2..49c65cacf 100644 --- a/test/built-ins/TypedArray/prototype/filter/BigInt/values-are-set.js +++ b/test/built-ins/TypedArray/prototype/filter/BigInt/values-are-set.js @@ -17,14 +17,14 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([41, 1, 42, 7])); + var sample = new TA([41n, 1n, 42n, 7n]); var result; result = sample.filter(function() { return true; }); - assert(compareArray(result, convertToBigInt([41, 1, 42, 7])), "values are set #1"); + assert(compareArray(result, [41n, 1n, 42n, 7n]), "values are set #1"); result = sample.filter(function(v) { - return v > convertToBigInt(40); + return v > 40n; }); - assert(compareArray(result, convertToBigInt([41, 42])), "values are set #2"); + assert(compareArray(result, [41n, 42n]), "values are set #2"); }); |