summaryrefslogtreecommitdiff
path: root/test/built-ins/TypedArray/prototype/reduce/BigInt
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/TypedArray/prototype/reduce/BigInt')
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-custom-accumulator.js8
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-default-accumulator.js12
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-no-iteration-over-non-integer-properties.js6
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-return-does-not-change-instance.js8
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js10
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/get-length-uses-internal-arraylength.js2
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/result-is-last-callbackfn-return.js4
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/result-of-any-type.js2
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/return-first-value-without-callbackfn.js4
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/values-are-not-cached.js6
10 files changed, 31 insertions, 31 deletions
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-custom-accumulator.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-custom-accumulator.js
index 8527302fd..6b54c191c 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-custom-accumulator.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-custom-accumulator.js
@@ -27,7 +27,7 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 43, 44]));
+ var sample = new TA([42n, 43n, 44n]);
var results = [];
@@ -40,19 +40,19 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.sameValue(results[0].length, 4, "results[0].length");
assert.sameValue(results[0][0], 7, "results[0][0] - accumulator");
- assert.sameValue(results[0][1], convertToBigInt(42), "results[0][1] - kValue");
+ assert.sameValue(results[0][1], 42n, "results[0][1] - kValue");
assert.sameValue(results[0][2], 0, "results[0][2] - k");
assert.sameValue(results[0][3], sample, "results[0][3] - this");
assert.sameValue(results[1].length, 4, "results[1].length");
assert.sameValue(results[1][0], 8, "results[1][0] - accumulator");
- assert.sameValue(results[1][1], convertToBigInt(43), "results[1][1] - kValue");
+ assert.sameValue(results[1][1], 43n, "results[1][1] - kValue");
assert.sameValue(results[1][2], 1, "results[1][2] - k");
assert.sameValue(results[1][3], sample, "results[1][3] - this");
assert.sameValue(results[2].length, 4, "results[2].length");
assert.sameValue(results[2][0], 9, "results[2][0] - accumulator");
- assert.sameValue(results[2][1], convertToBigInt(44), "results[2][1] - kValue");
+ assert.sameValue(results[2][1], 44n, "results[2][1] - kValue");
assert.sameValue(results[2][2], 2, "results[2][2] - k");
assert.sameValue(results[2][3], sample, "results[2][3] - this");
});
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-default-accumulator.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-default-accumulator.js
index b4514895a..ab9e5a286 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-default-accumulator.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-arguments-default-accumulator.js
@@ -34,26 +34,26 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 43, 44]));
+ var sample = new TA([42n, 43n, 44n]);
var results = [];
sample.reduce(function(accumulator) {
results.push(arguments);
- return accumulator - convertToBigInt(1);
+ return accumulator - 1n;
});
assert.sameValue(results.length, 2, "results.length");
assert.sameValue(results[0].length, 4, "results[1].length");
- assert.sameValue(results[0][0], convertToBigInt(42), "results[1][0] - accumulator");
- assert.sameValue(results[0][1], convertToBigInt(43), "results[1][1] - kValue");
+ assert.sameValue(results[0][0], 42n, "results[1][0] - accumulator");
+ assert.sameValue(results[0][1], 43n, "results[1][1] - kValue");
assert.sameValue(results[0][2], 1, "results[1][2] - k");
assert.sameValue(results[0][3], sample, "results[1][3] - this");
assert.sameValue(results[1].length, 4, "results[2].length");
- assert.sameValue(results[1][0], convertToBigInt(41), "results[2][0] - accumulator");
- assert.sameValue(results[1][1], convertToBigInt(44), "results[2][1] - kValue");
+ assert.sameValue(results[1][0], 41n, "results[2][0] - accumulator");
+ assert.sameValue(results[1][1], 44n, "results[2][1] - kValue");
assert.sameValue(results[1][2], 2, "results[2][2] - k");
assert.sameValue(results[1][3], sample, "results[2][3] - this");
});
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-no-iteration-over-non-integer-properties.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-no-iteration-over-non-integer-properties.js
index b230de900..f8282a42e 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-no-iteration-over-non-integer-properties.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-no-iteration-over-non-integer-properties.js
@@ -27,7 +27,7 @@ features: [BigInt, Symbol, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([7, 8]));
+ var sample = new TA([7n, 8n]);
var results = [];
@@ -43,6 +43,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.sameValue(results[0][2], 0, "results[0][2] - k");
assert.sameValue(results[1][2], 1, "results[1][2] - k");
- assert.sameValue(results[0][1], convertToBigInt(7), "results[0][1] - kValue");
- assert.sameValue(results[1][1], convertToBigInt(8), "results[1][1] - kValue");
+ assert.sameValue(results[0][1], 7n, "results[0][1] - kValue");
+ assert.sameValue(results[1][1], 8n, "results[1][1] - kValue");
});
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-return-does-not-change-instance.js
index 05a8adddf..31785cec9 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-return-does-not-change-instance.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-return-does-not-change-instance.js
@@ -9,13 +9,13 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([0, 1, 0]));
+ var sample = new TA([0n, 1n, 0n]);
sample.reduce(function() {
return 42;
}, 7);
- assert.sameValue(sample[0], convertToBigInt(0), "[0] == 0");
- assert.sameValue(sample[1], convertToBigInt(1), "[1] == 1");
- assert.sameValue(sample[2], convertToBigInt(0), "[2] == 0");
+ assert.sameValue(sample[0], 0n, "[0] == 0");
+ assert.sameValue(sample[1], 1n, "[1] == 1");
+ assert.sameValue(sample[2], 0n, "[2] == 0");
});
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js
index 395a5aea7..272879dfb 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js
@@ -19,7 +19,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.reduce(function(acc, val, i) {
@@ -29,7 +29,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]"
);
@@ -43,7 +43,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
newVal++;
}, 0);
- assert.sameValue(sample[0], convertToBigInt(7), "changed values after iteration [0] == 7");
- assert.sameValue(sample[1], convertToBigInt(1), "changed values after iteration [1] == 1");
- assert.sameValue(sample[2], convertToBigInt(2), "changed values after iteration [2] == 2");
+ assert.sameValue(sample[0], 7n, "changed values after iteration [0] == 7");
+ assert.sameValue(sample[1], 1n, "changed values after iteration [1] == 1");
+ assert.sameValue(sample[2], 2n, "changed values after iteration [2] == 2");
});
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/get-length-uses-internal-arraylength.js
index a4f6c763e..98ff2510d 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/get-length-uses-internal-arraylength.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/get-length-uses-internal-arraylength.js
@@ -31,7 +31,7 @@ var desc = {
Object.defineProperty(TypedArray.prototype, "length", desc);
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 43]));
+ var sample = new TA([42n, 43n]);
var calls = 0;
Object.defineProperty(TA.prototype, "length", desc);
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/result-is-last-callbackfn-return.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/result-is-last-callbackfn-return.js
index 83e9a723f..2c424d4c8 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/result-is-last-callbackfn-return.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/result-is-last-callbackfn-return.js
@@ -38,7 +38,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var calls, result;
calls = 0;
- result = new TA(convertToBigInt([1, 2, 3])).reduce(function() {
+ result = new TA([1n, 2n, 3n]).reduce(function() {
calls++;
if (calls == 2) {
@@ -48,7 +48,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.sameValue(result, 42, "using default accumulator");
calls = 0;
- result = new TA(convertToBigInt([1, 2, 3])).reduce(function() {
+ result = new TA([1n, 2n, 3n]).reduce(function() {
calls++;
if (calls == 3) {
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/result-of-any-type.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/result-of-any-type.js
index 370a5b052..e67a68dc3 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/result-of-any-type.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/result-of-any-type.js
@@ -35,7 +35,7 @@ features: [BigInt, Symbol, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 43, 44]));
+ var sample = new TA([42n, 43n, 44n]);
[
["test262", "string"],
["", "empty string"],
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/return-first-value-without-callbackfn.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/return-first-value-without-callbackfn.js
index 7fbd76fa0..766bcdb62 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/return-first-value-without-callbackfn.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/return-first-value-without-callbackfn.js
@@ -33,10 +33,10 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var called = false;
- var result = new TA(convertToBigInt([42])).reduce(function() {
+ var result = new TA([42n]).reduce(function() {
called = true;
});
- assert.sameValue(result, convertToBigInt(42));
+ assert.sameValue(result, 42n);
assert.sameValue(called, false);
});
diff --git a/test/built-ins/TypedArray/prototype/reduce/BigInt/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/reduce/BigInt/values-are-not-cached.js
index 7b602dd9d..5362bf1dd 100644
--- a/test/built-ins/TypedArray/prototype/reduce/BigInt/values-are-not-cached.js
+++ b/test/built-ins/TypedArray/prototype/reduce/BigInt/values-are-not-cached.js
@@ -27,15 +27,15 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 43, 44]));
+ var sample = new TA([42n, 43n, 44n]);
sample.reduce(function(a, 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"
);
}, 0);
});