summaryrefslogtreecommitdiff
path: root/test/built-ins/TypedArray/prototype/sort/BigInt
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/TypedArray/prototype/sort/BigInt')
-rw-r--r--test/built-ins/TypedArray/prototype/sort/BigInt/arraylength-internal.js2
-rw-r--r--test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-call-throws.js2
-rw-r--r--test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js6
-rw-r--r--test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-nonfunction-call-throws.js2
-rw-r--r--test/built-ins/TypedArray/prototype/sort/BigInt/return-same-instance.js2
-rw-r--r--test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js4
-rw-r--r--test/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js14
7 files changed, 16 insertions, 16 deletions
diff --git a/test/built-ins/TypedArray/prototype/sort/BigInt/arraylength-internal.js b/test/built-ins/TypedArray/prototype/sort/BigInt/arraylength-internal.js
index b8436a5f3..8a3d5a7f8 100644
--- a/test/built-ins/TypedArray/prototype/sort/BigInt/arraylength-internal.js
+++ b/test/built-ins/TypedArray/prototype/sort/BigInt/arraylength-internal.js
@@ -23,7 +23,7 @@ var desc = {
Object.defineProperty(TypedArray.prototype, "length", desc);
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 42, 42]));
+ var sample = new TA([42n, 42n, 42n]);
getCalls = 0;
Object.defineProperty(TA.prototype, "length", desc);
diff --git a/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-call-throws.js b/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-call-throws.js
index d319341a7..668f33e06 100644
--- a/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-call-throws.js
+++ b/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-call-throws.js
@@ -26,7 +26,7 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 43, 44, 45, 46]));
+ var sample = new TA([42n, 43n, 44n, 45n, 46n]);
var calls = 0;
var comparefn = function() {
diff --git a/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js b/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js
index c058cddac..0e8846c13 100644
--- a/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js
+++ b/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-calls.js
@@ -23,7 +23,7 @@ var expectedThis = (function() {
})();
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 42, 42, 42, 42]));
+ var sample = new TA([42n, 42n, 42n, 42n, 42n]);
var calls = [];
var comparefn = function() {
@@ -36,7 +36,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
calls.forEach(function(args) {
assert.sameValue(args[0], expectedThis, "comparefn is called no specific this");
assert.sameValue(args[1].length, 2, "comparefn is always called with 2 args");
- assert.sameValue(args[1][0], convertToBigInt(42), "x is a listed value");
- assert.sameValue(args[1][0], convertToBigInt(42), "y is a listed value");
+ assert.sameValue(args[1][0], 42n, "x is a listed value");
+ assert.sameValue(args[1][0], 42n, "y is a listed value");
});
});
diff --git a/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-nonfunction-call-throws.js b/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-nonfunction-call-throws.js
index 80f23f618..4770b66da 100644
--- a/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-nonfunction-call-throws.js
+++ b/test/built-ins/TypedArray/prototype/sort/BigInt/comparefn-nonfunction-call-throws.js
@@ -19,7 +19,7 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([42, 43, 44, 45, 46]));
+ var sample = new TA([42n, 43n, 44n, 45n, 46n]);
assert.throws(TypeError, function() {
sample.sort(null);
diff --git a/test/built-ins/TypedArray/prototype/sort/BigInt/return-same-instance.js b/test/built-ins/TypedArray/prototype/sort/BigInt/return-same-instance.js
index d3ad6056f..702f45015 100644
--- a/test/built-ins/TypedArray/prototype/sort/BigInt/return-same-instance.js
+++ b/test/built-ins/TypedArray/prototype/sort/BigInt/return-same-instance.js
@@ -15,7 +15,7 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([2, 1]));
+ var sample = new TA([2n, 1n]);
var result = sample.sort();
assert.sameValue(sample, result, "without comparefn");
diff --git a/test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js b/test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js
index b7f73c650..3f6402c66 100644
--- a/test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js
+++ b/test/built-ins/TypedArray/prototype/sort/BigInt/sortcompare-with-no-tostring.js
@@ -21,7 +21,7 @@ features: [BigInt, TypedArray]
var origToString = Number.prototype.toString;
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([20, 100, 3]));
+ var sample = new TA([20n, 100n, 3n]);
var result = sample.sort();
- assert(compareArray(result, convertToBigInt([3, 20, 100])));
+ assert(compareArray(result, [3n, 20n, 100n]));
});
diff --git a/test/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js b/test/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js
index 588f1b49f..50d6e22fe 100644
--- a/test/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js
+++ b/test/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js
@@ -17,17 +17,17 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample;
- sample = new TA(convertToBigInt([4, 3, 2, 1])).sort();
- assert(compareArray(sample, convertToBigInt([1, 2, 3, 4])), "descending values");
+ sample = new TA([4n, 3n, 2n, 1n]).sort();
+ assert(compareArray(sample, [1n, 2n, 3n, 4n]), "descending values");
- sample = new TA(convertToBigInt([3, 4, 1, 2])).sort();
- assert(compareArray(sample, convertToBigInt([1, 2, 3, 4])), "mixed numbers");
+ sample = new TA([3n, 4n, 1n, 2n]).sort();
+ assert(compareArray(sample, [1n, 2n, 3n, 4n]), "mixed numbers");
- sample = new TA(convertToBigInt([3, 4, 3, 1, 0, 1, 2])).sort();
- assert(compareArray(sample, convertToBigInt([0, 1, 1, 2, 3, 3, 4])), "repeating numbers");
+ sample = new TA([3n, 4n, 3n, 1n, 0n, 1n, 2n]).sort();
+ assert(compareArray(sample, [0n, 1n, 1n, 2n, 3n, 3n, 4n]), "repeating numbers");
sample = new TA(convertToBigInt([1, 0, -0, 2])).sort();
- assert(compareArray(sample, convertToBigInt([0, 0, 1, 2])), "0s");
+ assert(compareArray(sample, [0n, 0n, 1n, 2n]), "0s");
});
testWithBigIntTypedArrayConstructors(function(TA) {