summaryrefslogtreecommitdiff
path: root/test/built-ins/TypedArray/prototype/findIndex
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/TypedArray/prototype/findIndex')
-rw-r--r--test/built-ins/TypedArray/prototype/findIndex/BigInt/get-length-ignores-length-prop.js2
-rw-r--r--test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-changes-value.js16
-rw-r--r--test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-parameters.js8
-rw-r--r--test/built-ins/TypedArray/prototype/findIndex/BigInt/return-index-predicate-result-is-true.js4
-rw-r--r--test/built-ins/TypedArray/prototype/findIndex/BigInt/return-negative-one-if-predicate-returns-false-value.js2
5 files changed, 16 insertions, 16 deletions
diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/get-length-ignores-length-prop.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/get-length-ignores-length-prop.js
index 47ea12773..d4287dfbd 100644
--- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/get-length-ignores-length-prop.js
+++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/get-length-ignores-length-prop.js
@@ -36,7 +36,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
}
});
- var sample = new TA(convertToBigInt([42]));
+ var sample = new TA([42n]);
Object.defineProperty(sample, "length", {
get: function() {
diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-changes-value.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-changes-value.js
index d20b670eb..2fa760323 100644
--- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-changes-value.js
+++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-changes-value.js
@@ -26,7 +26,7 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var arr = convertToBigInt([10, 20, 30]);
+ var arr = [10n, 20n, 30n];
var sample;
var result;
@@ -34,34 +34,34 @@ testWithBigIntTypedArrayConstructors(function(TA) {
sample.findIndex(function(val, i) {
sample[i] = arr[i];
- assert.sameValue(val, convertToBigInt(0), "value is not mapped to instance");
+ assert.sameValue(val, 0n, "value is not mapped to instance");
});
assert(compareArray(sample, arr), "values set during each predicate call");
sample = new TA(arr);
result = sample.findIndex(function(val, i) {
if ( i === 0 ) {
- sample[2] = convertToBigInt(7);
+ sample[2] = 7n;
}
- return val === convertToBigInt(7);
+ return val === 7n;
});
assert.sameValue(result, 2, "value found");
sample = new TA(arr);
result = sample.findIndex(function(val, i) {
if ( i === 0 ) {
- sample[2] = convertToBigInt(7);
+ sample[2] = 7n;
}
- return val === convertToBigInt(30);
+ return val === 30n;
});
assert.sameValue(result, -1, "value not found");
sample = new TA(arr);
result = sample.findIndex(function(val, i) {
if ( i > 0 ) {
- sample[0] = convertToBigInt(7);
+ sample[0] = 7n;
}
- return val === convertToBigInt(7);
+ return val === 7n;
});
assert.sameValue(result, -1, "value not found - changed after call");
});
diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-parameters.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-parameters.js
index eb73cd7e1..1025bbb24 100644
--- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-parameters.js
+++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/predicate-call-parameters.js
@@ -28,7 +28,7 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([39, 2, 62]));
+ var sample = new TA([39n, 2n, 62n]);
var results = [];
var result;
@@ -41,19 +41,19 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.sameValue(results.length, 3, "predicate is called for each index");
result = results[0];
- assert.sameValue(result[0], convertToBigInt(39), "results[0][0] === 39, value");
+ assert.sameValue(result[0], 39n, "results[0][0] === 39, value");
assert.sameValue(result[1], 0, "results[0][1] === 0, index");
assert.sameValue(result[2], sample, "results[0][2] === sample, instance");
assert.sameValue(result.length, 3, "results[0].length === 3, arguments");
result = results[1];
- assert.sameValue(result[0], convertToBigInt(2), "results[1][0] === 2, value");
+ assert.sameValue(result[0], 2n, "results[1][0] === 2, value");
assert.sameValue(result[1], 1, "results[1][1] === 1, index");
assert.sameValue(result[2], sample, "results[1][2] === sample, instance");
assert.sameValue(result.length, 3, "results[1].length === 3, arguments");
result = results[2];
- assert.sameValue(result[0], convertToBigInt(62), "results[2][0] === 62, value");
+ assert.sameValue(result[0], 62n, "results[2][0] === 62, value");
assert.sameValue(result[1], 2, "results[2][1] === 2, index");
assert.sameValue(result[2], sample, "results[2][2] === sample, instance");
assert.sameValue(result.length, 3, "results[2].length === 3, arguments");
diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/return-index-predicate-result-is-true.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/return-index-predicate-result-is-true.js
index f19c09910..25e26d808 100644
--- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/return-index-predicate-result-is-true.js
+++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/return-index-predicate-result-is-true.js
@@ -28,7 +28,7 @@ features: [BigInt, Symbol, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([39, 3, 9]));
+ var sample = new TA([39n, 3n, 9n]);
var called = 0;
var result = sample.findIndex(function() {
@@ -42,7 +42,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
called = 0;
result = sample.findIndex(function(val) {
called++;
- return val === convertToBigInt(9);
+ return val === 9n;
});
assert.sameValue(called, 3, "predicate was called three times");
diff --git a/test/built-ins/TypedArray/prototype/findIndex/BigInt/return-negative-one-if-predicate-returns-false-value.js b/test/built-ins/TypedArray/prototype/findIndex/BigInt/return-negative-one-if-predicate-returns-false-value.js
index 933985462..fcf5d800c 100644
--- a/test/built-ins/TypedArray/prototype/findIndex/BigInt/return-negative-one-if-predicate-returns-false-value.js
+++ b/test/built-ins/TypedArray/prototype/findIndex/BigInt/return-negative-one-if-predicate-returns-false-value.js
@@ -27,7 +27,7 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([1, 2, 3]));
+ var sample = new TA([1n, 2n, 3n]);
var called = 0;
var result = sample.findIndex(function() {