summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Balter <leonardo.balter@gmail.com>2018-02-15 14:33:06 -0500
committerLeo Balter <leonardo.balter@gmail.com>2018-02-15 16:45:10 -0500
commitc6cd53594089d5ef80da752b7875b1cd01d73540 (patch)
tree47ea58eea2b4813bfa779fb015f289492f3d282b
parent3325e2a516a38936686fb0163b8f8a5292f8256e (diff)
downloadqtdeclarative-testsuites-c6cd53594089d5ef80da752b7875b1cd01d73540.tar.gz
Last cases of convertToBigInt
-rw-r--r--harness/testBigIntTypedArray.js4
-rw-r--r--test/built-ins/TypedArray/prototype/entries/BigInt/return-itor.js4
-rw-r--r--test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-set-value-during-interaction.js6
-rw-r--r--test/built-ins/TypedArray/prototype/fill/BigInt/fill-values-conversion-once.js6
-rw-r--r--test/built-ins/TypedArray/prototype/filter/BigInt/callbackfn-set-value-during-iteration.js6
-rw-r--r--test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-set-value-during-interaction.js6
-rw-r--r--test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js4
-rw-r--r--test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-set-value-during-interaction.js6
-rw-r--r--test/built-ins/TypedArray/prototype/reduce/BigInt/callbackfn-set-value-during-iteration.js6
-rw-r--r--test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-set-value-during-iteration.js6
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js5
-rw-r--r--test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js6
-rw-r--r--test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-set-value-during-interaction.js6
-rw-r--r--test/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js2
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js5
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js4
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js3
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js4
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js4
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js4
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js4
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js4
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js4
-rw-r--r--test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js4
-rw-r--r--test/built-ins/TypedArray/prototype/values/BigInt/return-itor.js4
-rw-r--r--test/built-ins/TypedArrays/ctors-bigint/object-arg/object-arg-as-array-returns.js4
-rw-r--r--test/built-ins/TypedArrays/from/BigInt/mapfn-this-without-thisarg-non-strict.js5
-rw-r--r--test/built-ins/TypedArrays/from/BigInt/new-instance-using-custom-ctor.js4
-rw-r--r--test/built-ins/TypedArrays/from/BigInt/new-instance-with-mapfn.js6
-rw-r--r--test/built-ins/TypedArrays/from/BigInt/new-instance-without-mapfn.js4
-rw-r--r--test/built-ins/TypedArrays/of/BigInt/new-instance.js2
31 files changed, 54 insertions, 88 deletions
diff --git a/harness/testBigIntTypedArray.js b/harness/testBigIntTypedArray.js
index 4b0e332d8..dc6d50f93 100644
--- a/harness/testBigIntTypedArray.js
+++ b/harness/testBigIntTypedArray.js
@@ -18,10 +18,6 @@ var BigIntTypedArrayConstructors = [
*/
var TypedArray = Object.getPrototypeOf(Int8Array);
-function convertToBigInt(x) {
- return (Array.isArray(x)) ? x.map(convertToBigInt) : BigInt(x);
-}
-
/**
* Callback for testing a typed array constructor.
*
diff --git a/test/built-ins/TypedArray/prototype/entries/BigInt/return-itor.js b/test/built-ins/TypedArray/prototype/entries/BigInt/return-itor.js
index bca03654b..b5e3a5f02 100644
--- a/test/built-ins/TypedArray/prototype/entries/BigInt/return-itor.js
+++ b/test/built-ins/TypedArray/prototype/entries/BigInt/return-itor.js
@@ -12,10 +12,8 @@ includes: [testBigIntTypedArray.js, compareArray.js]
features: [BigInt, TypedArray]
---*/
-var sample = [0, 42, 64];
-
testWithBigIntTypedArrayConstructors(function(TA) {
- var typedArray = new TA(convertToBigInt(sample));
+ var typedArray = new TA([0n, 42n, 64n]);
var itor = typedArray.entries();
var next = itor.next();
diff --git a/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-set-value-during-interaction.js b/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-set-value-during-interaction.js
index 12f7d7a6e..74ce8659e 100644
--- a/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-set-value-during-interaction.js
+++ b/test/built-ins/TypedArray/prototype/every/BigInt/callbackfn-set-value-during-interaction.js
@@ -27,12 +27,12 @@ features: [BigInt, Reflect.set, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n, 43n, 44n]);
- var newVal = 0;
+ var newVal = 0n;
sample.every(function(val, i) {
if (i > 0) {
assert.sameValue(
- sample[i - 1], convertToBigInt(newVal - 1),
+ sample[i - 1], newVal - 1n,
"get the changed value during the loop"
);
assert.sameValue(
@@ -42,7 +42,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
);
}
assert.sameValue(
- Reflect.set(sample, i, convertToBigInt(newVal)),
+ Reflect.set(sample, i, newVal),
true,
"set value during iteration"
);
diff --git a/test/built-ins/TypedArray/prototype/fill/BigInt/fill-values-conversion-once.js b/test/built-ins/TypedArray/prototype/fill/BigInt/fill-values-conversion-once.js
index 2f8bfa008..c87b864f9 100644
--- a/test/built-ins/TypedArray/prototype/fill/BigInt/fill-values-conversion-once.js
+++ b/test/built-ins/TypedArray/prototype/fill/BigInt/fill-values-conversion-once.js
@@ -17,10 +17,10 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(2);
- var n = 1;
- sample.fill({ valueOf() { return convertToBigInt(n++); } });
+ var n = 1n;
+ sample.fill({ valueOf() { return n++; } });
- assert.sameValue(n, 2, "additional unexpected ToNumber() calls");
+ assert.sameValue(n, 2n, "additional unexpected ToNumber() calls");
assert.sameValue(sample[0], 1n, "incorrect ToNumber result in index 0");
assert.sameValue(sample[1], 1n, "incorrect ToNumber result in index 1");
});
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 c8435afa6..dbf09b798 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
@@ -18,12 +18,12 @@ features: [BigInt, Reflect.set, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n, 43n, 44n]);
- var newVal = 0;
+ var newVal = 0n;
sample.filter(function(val, i) {
if (i > 0) {
assert.sameValue(
- sample[i - 1], convertToBigInt(newVal - 1),
+ sample[i - 1], newVal - 1n,
"get the changed value during the loop"
);
assert.sameValue(
@@ -33,7 +33,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
);
}
assert.sameValue(
- Reflect.set(sample, i, convertToBigInt(newVal)),
+ Reflect.set(sample, i, newVal),
true,
"set value during interaction"
);
diff --git a/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-set-value-during-interaction.js b/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-set-value-during-interaction.js
index 9d7acf91b..13bd7fb01 100644
--- a/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-set-value-during-interaction.js
+++ b/test/built-ins/TypedArray/prototype/forEach/BigInt/callbackfn-set-value-during-interaction.js
@@ -18,12 +18,12 @@ features: [BigInt, Reflect.set, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n, 43n, 44n]);
- var newVal = 0;
+ var newVal = 0n;
sample.forEach(function(val, i) {
if (i > 0) {
assert.sameValue(
- sample[i - 1], convertToBigInt(newVal - 1),
+ sample[i - 1], newVal - 1n,
"get the changed value during the loop"
);
assert.sameValue(
@@ -33,7 +33,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
);
}
assert.sameValue(
- Reflect.set(sample, i, convertToBigInt(newVal)),
+ Reflect.set(sample, i, newVal),
true,
"set value during iteration"
);
diff --git a/test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js b/test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js
index e4bc1b0ba..6bccf1c2d 100644
--- a/test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js
+++ b/test/built-ins/TypedArray/prototype/keys/BigInt/return-itor.js
@@ -13,10 +13,10 @@ includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
---*/
-var sample = [0, 42, 64];
+var sample = [0n, 42n, 64n];
testWithBigIntTypedArrayConstructors(function(TA) {
- var typedArray = new TA(convertToBigInt(sample));
+ var typedArray = new TA(sample);
var itor = typedArray.keys();
var next = itor.next();
diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-set-value-during-interaction.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-set-value-during-interaction.js
index 9e140cd82..df41cb459 100644
--- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-set-value-during-interaction.js
+++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-set-value-during-interaction.js
@@ -13,12 +13,12 @@ features: [BigInt, Reflect.set, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n, 43n, 44n]);
- var newVal = 0;
+ var newVal = 0n;
sample.map(function(val, i) {
if (i > 0) {
assert.sameValue(
- sample[i - 1], convertToBigInt(newVal - 1),
+ sample[i - 1], newVal - 1n,
"get the changed value during the loop"
);
assert.sameValue(
@@ -28,7 +28,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
);
}
assert.sameValue(
- Reflect.set(sample, i, convertToBigInt(newVal)),
+ Reflect.set(sample, i, newVal),
true,
"set value during iteration"
);
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 272879dfb..d77a8ebda 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
@@ -20,12 +20,12 @@ features: [BigInt, Reflect.set, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n, 43n, 44n]);
- var newVal = 0;
+ var newVal = 0n;
sample.reduce(function(acc, val, i) {
if (i > 0) {
assert.sameValue(
- sample[i - 1], convertToBigInt(newVal - 1),
+ sample[i - 1], newVal - 1n,
"get the changed value during the loop"
);
assert.sameValue(
@@ -35,7 +35,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
);
}
assert.sameValue(
- Reflect.set(sample, i, convertToBigInt(newVal)),
+ Reflect.set(sample, i, newVal),
true,
"set value during iteration"
);
diff --git a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-set-value-during-iteration.js b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-set-value-during-iteration.js
index 7b5fc70c2..3442517c0 100644
--- a/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-set-value-during-iteration.js
+++ b/test/built-ins/TypedArray/prototype/reduceRight/BigInt/callbackfn-set-value-during-iteration.js
@@ -20,12 +20,12 @@ features: [BigInt, Reflect.set, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n, 43n, 44n]);
- var newVal = 0;
+ var newVal = 0n;
sample.reduceRight(function(acc, val, i) {
if (i < sample.length - 1) {
assert.sameValue(
- sample[i + 1], convertToBigInt(newVal - 1),
+ sample[i + 1], newVal - 1n,
"get the changed value during the loop"
);
assert.sameValue(
@@ -35,7 +35,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
);
}
assert.sameValue(
- Reflect.set(sample, i, convertToBigInt(newVal)),
+ Reflect.set(sample, i, newVal),
true,
"set value during iteration"
);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js
index 8deeed826..d3d5c1aa4 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js
@@ -35,11 +35,10 @@ testWithBigIntTypedArrayConstructors(function(TA) {
}
};
- // undefined and NaN covered on typedArrayConversions
- var arr = ["1", "", false, true, nullish, obj1, obj2, [], [1]];
+ var arr = [false, true, obj1, [], [1]];
var sample = new TA(arr.length);
- var expected = new TA(convertToBigInt([1, 0, 0, 1, 42, 42, 0, 1]));
+ var expected = new TA([0n, 1n, 42n, 0n, 1n]);
sample.set(arr);
diff --git a/test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js b/test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js
index 93b074f1f..092bf2e7d 100644
--- a/test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js
+++ b/test/built-ins/TypedArray/prototype/slice/BigInt/set-values-from-different-ctor-type.js
@@ -30,10 +30,10 @@ includes: [testBigIntTypedArray.js, compareArray.js]
features: [BigInt, Symbol.species, TypedArray]
---*/
-var arr = [42, 43, 44];
+var arr = [42n 43n, 44n];
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA(arr);
var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array;
sample.constructor = {};
@@ -41,7 +41,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var result = sample.slice();
- assert(compareArray(result, convertToBigInt(arr)), "values are set");
+ assert(compareArray(result, arr), "values are set");
assert.notSameValue(result.buffer, sample.buffer, "creates a new buffer");
assert.sameValue(result.constructor, other, "used the custom ctor");
});
diff --git a/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-set-value-during-interaction.js b/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-set-value-during-interaction.js
index 641b2a0cb..c248960d3 100644
--- a/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-set-value-during-interaction.js
+++ b/test/built-ins/TypedArray/prototype/some/BigInt/callbackfn-set-value-during-interaction.js
@@ -27,12 +27,12 @@ features: [BigInt, Reflect.set, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA([42n, 43n, 44n]);
- var newVal = 0;
+ var newVal = 0n;
sample.some(function(val, i) {
if (i > 0) {
assert.sameValue(
- sample[i - 1], convertToBigInt(newVal - 1),
+ sample[i - 1], newVal - 1n,
"get the changed value during the loop"
);
assert.sameValue(
@@ -42,7 +42,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
);
}
assert.sameValue(
- Reflect.set(sample, i, convertToBigInt(newVal)),
+ Reflect.set(sample, i, newVal),
true,
"set value during iteration"
);
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 50d6e22fe..57b491551 100644
--- a/test/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js
+++ b/test/built-ins/TypedArray/prototype/sort/BigInt/sorted-values.js
@@ -26,7 +26,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
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();
+ sample = new TA([1n, 0n, -0n, 2n]).sort();
assert(compareArray(sample, [0n, 0n, 1n, 2n]), "0s");
});
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js
index c40f36561..82cd346b9 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tolocalestring-from-each-value.js
@@ -39,15 +39,14 @@ BigInt.prototype.toLocaleString = function() {
return "hacks" + calls.length;
};
-var arr = [42, 0];
var expected = ["hacks1", "hacks2"].join(separator);
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n]);
calls = [];
assert.sameValue(sample.toLocaleString(), expected, "returns expected value");
assert(
- compareArray(new TA(convertToBigInt(calls)), sample),
+ compareArray(new TA(calls), sample),
"toLocaleString called for each item"
);
});
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js
index 9a9fe93d0..7fb9d6393 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-tostring-from-each-value.js
@@ -47,11 +47,11 @@ BigInt.prototype.toLocaleString = function() {
};
};
-var arr = [42, 0];
+var arr = [42n, 0n];
var expected = ["hacks1", "hacks2"].join(separator);
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA(arr);
calls = 0;
assert.sameValue(sample.toLocaleString(), expected, "returns expected value");
assert.sameValue(calls, 2, "toString called once for each item");
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js
index b01c60feb..ea5464d98 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/calls-valueof-from-each-value.js
@@ -45,11 +45,10 @@ BigInt.prototype.toLocaleString = function() {
};
};
-var arr = [42, 0];
var expected = ["hacks1", "hacks2"].join(separator);
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n]);
calls = 0;
assert.sameValue(sample.toLocaleString(), expected, "returns expected value");
assert.sameValue(calls, 2, "valueOf called once for each item");
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js
index 378b4e5b8..e018468cc 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tolocalestring.js
@@ -31,11 +31,9 @@ BigInt.prototype.toLocaleString = function() {
throw new Test262Error();
};
-var arr = [42, 0];
-
testWithBigIntTypedArrayConstructors(function(TA) {
calls = 0;
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n]);
assert.throws(Test262Error, function() {
sample.toLocaleString();
});
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js
index 3398b29ef..058f684c3 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-tostring.js
@@ -43,10 +43,8 @@ BigInt.prototype.toLocaleString = function() {
};
};
-var arr = [42, 0];
-
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n]);
calls = 0;
assert.throws(Test262Error, function() {
sample.toLocaleString();
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js
index fceea34ef..96259ba5d 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-firstelement-valueof.js
@@ -44,10 +44,8 @@ BigInt.prototype.toLocaleString = function() {
};
};
-var arr = [42, 0];
-
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n]);
calls = 0;
assert.throws(Test262Error, function() {
sample.toLocaleString();
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js
index 1bac9b691..987146990 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tolocalestring.js
@@ -34,11 +34,9 @@ BigInt.prototype.toLocaleString = function() {
}
};
-var arr = [42, 0];
-
testWithBigIntTypedArrayConstructors(function(TA) {
calls = 0;
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n]);
assert.throws(Test262Error, function() {
sample.toLocaleString();
});
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js
index 3c45b81c1..cc0bd5ee6 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-tostring.js
@@ -45,10 +45,8 @@ BigInt.prototype.toLocaleString = function() {
};
};
-var arr = [42, 0];
-
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n]);
calls = 0;
assert.throws(Test262Error, function() {
sample.toLocaleString();
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js
index f683ad285..152095ebe 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-abrupt-from-nextelement-valueof.js
@@ -46,10 +46,8 @@ BigInt.prototype.toLocaleString = function() {
};
};
-var arr = [42, 0];
-
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n]);
calls = 0;
assert.throws(Test262Error, function() {
sample.toLocaleString();
diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js
index c3588c70f..99772306f 100644
--- a/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js
+++ b/test/built-ins/TypedArray/prototype/toLocaleString/BigInt/return-result.js
@@ -33,10 +33,8 @@ features: [BigInt, TypedArray]
var separator = ["", ""].toLocaleString();
-var arr = [42, 0, 43];
-
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt(arr));
+ var sample = new TA([42n, 0n, 43n]);
var expected =
sample[0].toLocaleString().toString() +
separator +
diff --git a/test/built-ins/TypedArray/prototype/values/BigInt/return-itor.js b/test/built-ins/TypedArray/prototype/values/BigInt/return-itor.js
index dc2904754..3924cb3b4 100644
--- a/test/built-ins/TypedArray/prototype/values/BigInt/return-itor.js
+++ b/test/built-ins/TypedArray/prototype/values/BigInt/return-itor.js
@@ -13,10 +13,8 @@ includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
---*/
-var sample = [0, 42, 64];
-
testWithBigIntTypedArrayConstructors(function(TA) {
- var typedArray = new TA(convertToBigInt(sample));
+ var typedArray = new TA([0n, 42n, 64n]);
var itor = typedArray.values();
var next = itor.next();
diff --git a/test/built-ins/TypedArrays/ctors-bigint/object-arg/object-arg-as-array-returns.js b/test/built-ins/TypedArrays/ctors-bigint/object-arg/object-arg-as-array-returns.js
index ee21ba4cf..c9a6b0652 100644
--- a/test/built-ins/TypedArrays/ctors-bigint/object-arg/object-arg-as-array-returns.js
+++ b/test/built-ins/TypedArrays/ctors-bigint/object-arg/object-arg-as-array-returns.js
@@ -16,10 +16,8 @@ includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
---*/
-var obj = [7, 42];
-
testWithTypedArrayConstructors(function(TA) {
- var typedArray = new TA(convertToBigInt(obj));
+ var typedArray = new TA([7n, 42n]);
assert.sameValue(typedArray.length, 2);
assert.sameValue(typedArray[0], 7n);
assert.sameValue(typedArray[1], 42n);
diff --git a/test/built-ins/TypedArrays/from/BigInt/mapfn-this-without-thisarg-non-strict.js b/test/built-ins/TypedArrays/from/BigInt/mapfn-this-without-thisarg-non-strict.js
index b16d6f9cc..410c3244d 100644
--- a/test/built-ins/TypedArrays/from/BigInt/mapfn-this-without-thisarg-non-strict.js
+++ b/test/built-ins/TypedArrays/from/BigInt/mapfn-this-without-thisarg-non-strict.js
@@ -20,17 +20,16 @@ flags: [noStrict]
features: [BigInt, TypedArray]
---*/
-var source = [42, 43];
var global = this;
testWithBigIntTypedArrayConstructors(function(TA) {
var results = [];
var mapfn = function(x) {
results.push(this);
- return convertToBigInt(x);
+ return x;
};
- TA.from(convertToBigInt(source), mapfn);
+ TA.from([42n, 43n], mapfn);
assert.sameValue(results.length, 2);
assert.sameValue(results[0], global);
diff --git a/test/built-ins/TypedArrays/from/BigInt/new-instance-using-custom-ctor.js b/test/built-ins/TypedArrays/from/BigInt/new-instance-using-custom-ctor.js
index 82a37b242..cd012fc88 100644
--- a/test/built-ins/TypedArrays/from/BigInt/new-instance-using-custom-ctor.js
+++ b/test/built-ins/TypedArrays/from/BigInt/new-instance-using-custom-ctor.js
@@ -8,8 +8,6 @@ includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
---*/
-var source = [42, 43, 42];
-
testWithBigIntTypedArrayConstructors(function(TA) {
var called = 0;
@@ -19,7 +17,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
return new TA(len);
};
- var result = TA.from.call(ctor, convertToBigInt(source));
+ var result = TA.from.call(ctor, [42n, 43n, 42n]);
assert.sameValue(result.length, 3);
assert.sameValue(result[0], 42n);
assert.sameValue(result[1], 43n);
diff --git a/test/built-ins/TypedArrays/from/BigInt/new-instance-with-mapfn.js b/test/built-ins/TypedArrays/from/BigInt/new-instance-with-mapfn.js
index 7de5fda26..600bf2a1f 100644
--- a/test/built-ins/TypedArrays/from/BigInt/new-instance-with-mapfn.js
+++ b/test/built-ins/TypedArrays/from/BigInt/new-instance-with-mapfn.js
@@ -8,14 +8,12 @@ includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
---*/
-var source = [42, 43, 42];
-
testWithBigIntTypedArrayConstructors(function(TA) {
var mapfn = function(kValue) {
- return convertToBigInt(kValue * 2);
+ return kValue * 2n;
};
- var result = TA.from(source, mapfn);
+ var result = TA.from([42n, 43n, 42n], mapfn);
assert.sameValue(result.length, 3);
assert.sameValue(result[0], 84n);
assert.sameValue(result[1], 86n);
diff --git a/test/built-ins/TypedArrays/from/BigInt/new-instance-without-mapfn.js b/test/built-ins/TypedArrays/from/BigInt/new-instance-without-mapfn.js
index 61f45e35e..1243cb6aa 100644
--- a/test/built-ins/TypedArrays/from/BigInt/new-instance-without-mapfn.js
+++ b/test/built-ins/TypedArrays/from/BigInt/new-instance-without-mapfn.js
@@ -8,10 +8,8 @@ includes: [testBigIntTypedArray.js]
features: [BigInt, TypedArray]
---*/
-var source = [42, 43, 42];
-
testWithBigIntTypedArrayConstructors(function(TA) {
- var result = TA.from(convertToBigInt(source));
+ var result = TA.from([42n, 43n, 42n]);
assert.sameValue(result.length, 3);
assert.sameValue(result[0], 42n);
assert.sameValue(result[1], 43n);
diff --git a/test/built-ins/TypedArrays/of/BigInt/new-instance.js b/test/built-ins/TypedArrays/of/BigInt/new-instance.js
index 94329f185..e71afc1b0 100644
--- a/test/built-ins/TypedArrays/of/BigInt/new-instance.js
+++ b/test/built-ins/TypedArrays/of/BigInt/new-instance.js
@@ -24,7 +24,7 @@ features: [BigInt, TypedArray]
---*/
testWithTypedArrayConstructors(function(TA) {
- var result = TA.of(42n, 43n, convertToBigInt(false));
+ var result = TA.of(42n, 43n, 0n);
assert.sameValue(result.length, 3);
assert.sameValue(result[0], 42n);
assert.sameValue(result[1], 43n);