diff --git a/harness/testBigIntTypedArray.js b/harness/testBigIntTypedArray.js index 4b0e332d85..dc6d50f93b 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 bca03654b5..b5e3a5f024 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 12f7d7a6e6..74ce8659e7 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 2f8bfa0086..c87b864f93 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 c8435afa6b..dbf09b798f 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 9d7acf91bb..13bd7fb011 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 e4bc1b0bad..6bccf1c2dc 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 9e140cd82f..df41cb4590 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 272879dfb1..d77a8ebda0 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 7b5fc70c24..3442517c0b 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 8deeed826e..d3d5c1aa4a 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 93b074f1f2..092bf2e7da 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 641b2a0cb6..c248960d33 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 50d6e22fe7..57b4915518 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 c40f36561f..82cd346b91 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 9a9fe93d0b..7fb9d63936 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 b01c60feb7..ea5464d98e 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 378b4e5b80..e018468cc1 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 3398b29ef6..058f684c3c 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 fceea34efa..96259ba5d4 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 1bac9b691d..987146990a 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 3c45b81c12..cc0bd5ee6f 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 f683ad285a..152095ebea 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 c3588c70fb..99772306fe 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 dc2904754e..3924cb3b42 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 ee21ba4cf8..c9a6b06526 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 b16d6f9cc0..410c3244db 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 82a37b2421..cd012fc88b 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 7de5fda267..600bf2a1fb 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 61f45e35ee..1243cb6aa6 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 94329f1853..e71afc1b08 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);