summaryrefslogtreecommitdiff
path: root/test/built-ins/TypedArray/prototype/indexOf
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/TypedArray/prototype/indexOf')
-rw-r--r--test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-infinity.js6
-rw-r--r--test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-minus-zero.js6
-rw-r--r--test/built-ins/TypedArray/prototype/indexOf/BigInt/get-length-uses-internal-arraylength.js4
-rw-r--r--test/built-ins/TypedArray/prototype/indexOf/BigInt/search-found-returns-index.js20
-rw-r--r--test/built-ins/TypedArray/prototype/indexOf/BigInt/search-not-found-returns-minus-one.js14
-rw-r--r--test/built-ins/TypedArray/prototype/indexOf/BigInt/tointeger-fromindex.js34
6 files changed, 42 insertions, 42 deletions
diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-infinity.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-infinity.js
index 38a6515cf..07bcd38a4 100644
--- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-infinity.js
+++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-infinity.js
@@ -32,8 +32,8 @@ 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.indexOf(convertToBigInt(43), Infinity), -1, "indexOf(43, Infinity)");
- assert.sameValue(sample.indexOf(convertToBigInt(43), -Infinity), 1, "indexOf(43, -Infinity)");
+ assert.sameValue(sample.indexOf(43n, Infinity), -1, "indexOf(43, Infinity)");
+ assert.sameValue(sample.indexOf(43n, -Infinity), 1, "indexOf(43, -Infinity)");
});
diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-minus-zero.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-minus-zero.js
index bd141027d..90dc45150 100644
--- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-minus-zero.js
+++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/fromIndex-minus-zero.js
@@ -24,7 +24,7 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample;
- sample = new TA(convertToBigInt([42, 43]));
- assert.sameValue(sample.indexOf(convertToBigInt(42), -0), 0, "-0 [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), -0), 1, "-0 [1]");
+ sample = new TA([42n, 43n]);
+ assert.sameValue(sample.indexOf(42n, -0), 0, "-0 [0]");
+ assert.sameValue(sample.indexOf(43n, -0), 1, "-0 [1]");
});
diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/get-length-uses-internal-arraylength.js
index 61a961bd4..9c386b222 100644
--- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/get-length-uses-internal-arraylength.js
+++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/get-length-uses-internal-arraylength.js
@@ -23,10 +23,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.indexOf(convertToBigInt(7)), 0);
+ assert.sameValue(sample.indexOf(7n), 0);
});
diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/search-found-returns-index.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/search-found-returns-index.js
index e932c2689..484e16f5c 100644
--- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/search-found-returns-index.js
+++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/search-found-returns-index.js
@@ -32,15 +32,15 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 43, 42, 41]));
- assert.sameValue(sample.indexOf(convertToBigInt(42)), 0, "indexOf(42)");
- assert.sameValue(sample.indexOf(convertToBigInt(43)), 1, "indexOf(43)");
- assert.sameValue(sample.indexOf(convertToBigInt(43), 1), 1, "indexOf(43, 1)");
- assert.sameValue(sample.indexOf(convertToBigInt(42), 1), 2, "indexOf(42, 1)");
- assert.sameValue(sample.indexOf(convertToBigInt(42), 2), 2, "indexOf(42, 2)");
+ var sample = new TA([42n, 43n, 42n, 41n]);
+ assert.sameValue(sample.indexOf(42n), 0, "indexOf(42)");
+ assert.sameValue(sample.indexOf(43n), 1, "indexOf(43)");
+ assert.sameValue(sample.indexOf(43n, 1), 1, "indexOf(43, 1)");
+ assert.sameValue(sample.indexOf(42n, 1), 2, "indexOf(42, 1)");
+ assert.sameValue(sample.indexOf(42n, 2), 2, "indexOf(42, 2)");
- assert.sameValue(sample.indexOf(convertToBigInt(42), -4), 0, "indexOf(42, -4)");
- assert.sameValue(sample.indexOf(convertToBigInt(42), -3), 2, "indexOf(42, -3)");
- assert.sameValue(sample.indexOf(convertToBigInt(42), -2), 2, "indexOf(42, -2)");
- assert.sameValue(sample.indexOf(convertToBigInt(42), -5), 0, "indexOf(42, -5)");
+ assert.sameValue(sample.indexOf(42n, -4), 0, "indexOf(42, -4)");
+ assert.sameValue(sample.indexOf(42n, -3), 2, "indexOf(42, -3)");
+ assert.sameValue(sample.indexOf(42n, -2), 2, "indexOf(42, -2)");
+ assert.sameValue(sample.indexOf(42n, -5), 0, "indexOf(42, -5)");
});
diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/search-not-found-returns-minus-one.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/search-not-found-returns-minus-one.js
index 94dc9285e..2ef363213 100644
--- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/search-not-found-returns-minus-one.js
+++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/search-not-found-returns-minus-one.js
@@ -28,11 +28,11 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample;
- sample = new TA(convertToBigInt([42, 43, 42, 41]));
- assert.sameValue(sample.indexOf(convertToBigInt(44)), -1, "indexOf(44)");
- assert.sameValue(sample.indexOf(convertToBigInt(43), 2), -1, "indexOf(43, 2)");
- assert.sameValue(sample.indexOf(convertToBigInt(42), 3), -1, "indexOf(42, 3)");
- assert.sameValue(sample.indexOf(convertToBigInt(44), -4), -1, "indexOf(44, -4)");
- assert.sameValue(sample.indexOf(convertToBigInt(44), -5), -1, "indexOf(44, -5)");
- assert.sameValue(sample.indexOf(convertToBigInt(42), -1), -1, "indexOf(42, -1)");
+ sample = new TA([42n, 43n, 42n, 41n]);
+ assert.sameValue(sample.indexOf(44n), -1, "indexOf(44)");
+ assert.sameValue(sample.indexOf(43n, 2), -1, "indexOf(43, 2)");
+ assert.sameValue(sample.indexOf(42n, 3), -1, "indexOf(42, 3)");
+ assert.sameValue(sample.indexOf(44n, -4), -1, "indexOf(44, -4)");
+ assert.sameValue(sample.indexOf(44n, -5), -1, "indexOf(44, -5)");
+ assert.sameValue(sample.indexOf(42n, -1), -1, "indexOf(42, -1)");
});
diff --git a/test/built-ins/TypedArray/prototype/indexOf/BigInt/tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/indexOf/BigInt/tointeger-fromindex.js
index e338bf1a4..dd62589c5 100644
--- a/test/built-ins/TypedArray/prototype/indexOf/BigInt/tointeger-fromindex.js
+++ b/test/built-ins/TypedArray/prototype/indexOf/BigInt/tointeger-fromindex.js
@@ -30,28 +30,28 @@ var obj = {
testWithBigIntTypedArrayConstructors(function(TA) {
var sample;
- sample = new TA(convertToBigInt([42, 43]));
- assert.sameValue(sample.indexOf(convertToBigInt(42), "1"), -1, "string [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), "1"), 1, "string [1]");
+ sample = new TA([42n, 43n]);
+ assert.sameValue(sample.indexOf(42n, "1"), -1, "string [0]");
+ assert.sameValue(sample.indexOf(43n, "1"), 1, "string [1]");
- assert.sameValue(sample.indexOf(convertToBigInt(42), true), -1, "true [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), true), 1, "true [1]");
+ assert.sameValue(sample.indexOf(42n, true), -1, "true [0]");
+ assert.sameValue(sample.indexOf(43n, true), 1, "true [1]");
- assert.sameValue(sample.indexOf(convertToBigInt(42), false), 0, "false [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), false), 1, "false [1]");
+ assert.sameValue(sample.indexOf(42n, false), 0, "false [0]");
+ assert.sameValue(sample.indexOf(43n, false), 1, "false [1]");
- assert.sameValue(sample.indexOf(convertToBigInt(42), NaN), 0, "NaN [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), NaN), 1, "NaN [1]");
+ assert.sameValue(sample.indexOf(42n, NaN), 0, "NaN [0]");
+ assert.sameValue(sample.indexOf(43n, NaN), 1, "NaN [1]");
- assert.sameValue(sample.indexOf(convertToBigInt(42), null), 0, "null [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), null), 1, "null [1]");
+ assert.sameValue(sample.indexOf(42n, null), 0, "null [0]");
+ assert.sameValue(sample.indexOf(43n, null), 1, "null [1]");
- assert.sameValue(sample.indexOf(convertToBigInt(42), undefined), 0, "undefined [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), undefined), 1, "undefined [1]");
+ assert.sameValue(sample.indexOf(42n, undefined), 0, "undefined [0]");
+ assert.sameValue(sample.indexOf(43n, undefined), 1, "undefined [1]");
- assert.sameValue(sample.indexOf(convertToBigInt(42), null), 0, "null [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), null), 1, "null [1]");
+ assert.sameValue(sample.indexOf(42n, null), 0, "null [0]");
+ assert.sameValue(sample.indexOf(43n, null), 1, "null [1]");
- assert.sameValue(sample.indexOf(convertToBigInt(42), obj), -1, "object [0]");
- assert.sameValue(sample.indexOf(convertToBigInt(43), obj), 1, "object [1]");
+ assert.sameValue(sample.indexOf(42n, obj), -1, "object [0]");
+ assert.sameValue(sample.indexOf(43n, obj), 1, "object [1]");
});