diff --git a/harness/testBigIntTypedArray.js b/harness/testBigIntTypedArray.js index 4b0e332d856b1c101cba98586eb51fbbc1641fa6..dc6d50f93b90b175bd68b1afc687f09b45c02a69 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 bca03654b5a55f3576b61c9e2f808e64c31030a0..b5e3a5f02469166ccce595eec150c5a4548f9ccb 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 12f7d7a6e68093499b5bdf3a21ecff010b2e94f3..74ce8659e736440e2707ed0098db9033c5094667 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 2f8bfa00861c54b056e413ab3de5933195e5cfd8..c87b864f9341bedee465f11c311c3fc80c1f98ef 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 c8435afa6b9877cf55ffb4bca7f1089c6319a98b..dbf09b798ff23f7e11cddcb56a65948e4d02387e 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 9d7acf91bb7e42d370a2ec1eff4524cdb05727eb..13bd7fb011d2b36602d25be1f0ff94fefef51642 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 e4bc1b0bad2b934af222113f0db97b11966fd8d5..6bccf1c2dcf1a22973812c2ae6127b353740c908 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 9e140cd82f361efeff3e5aa3dca3b8c532e30fa5..df41cb4590fa000e25112126bb7669ffb2b1a71e 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 272879dfb1e0599855a1cd0a01073fc25d77ac33..d77a8ebda04b0fd274628951671c7594f287713e 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 7b5fc70c245bcf707e4ed2c01f194d723dc7ca8d..3442517c0b5f86419c19fa991f0c5f15cc828282 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 8deeed826ee848a8ab98e908f44852fbce319d50..d3d5c1aa4a7169c776b294e2968f3ded6e292833 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 93b074f1f28e4dce83c8f246dbf6b6a95ee526b5..092bf2e7daa2f2217650aa98d1eadb6c6a62a83a 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 641b2a0cb674e157a32e751eec0e5ab6708bcb17..c248960d336d5b333088f9b2708488d5208860d7 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 50d6e22fe7fe96935e5cb605bf32dfa77b258b6e..57b49155182bb9b89fef3c5841ffc5a02c9a69f7 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 c40f36561f53a6b16ed37717b448204c047e8a1e..82cd346b912d1b54dd248df27ace3c3107f2a754 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 9a9fe93d0b31699205df0069b0318f5f911f97e7..7fb9d63936f3d57cbdb96681cff1d92eb4f72452 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 b01c60feb7ff23c5d7e3a50a1f006657747c6d2d..ea5464d98e17781241ca0705d6c7b7a8adcb15ab 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 378b4e5b806b5249c02eba21274e6b622a74fc4b..e018468cc1f72f190b605f7e75d1d72605c5bf4f 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 3398b29ef61eb1ce948bc30601da778bc25c2835..058f684c3cb747497b4a72b7ea8e43fd2c878797 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 fceea34efa5451e727373d8e458d3b1217ddba8f..96259ba5d4973241bb9db01e75598b6b48a5dccc 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 1bac9b691dc1f812900cf953283dba812efbb747..987146990ab35cc717931c3f2dd7e4ab9d3a1d16 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 3c45b81c12e824303f5f609330bb9fd5c88858c6..cc0bd5ee6fbac33037daf0b69f51e913e1de9653 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 f683ad285ad0be99d0fa058fc91d65c30b540271..152095ebea19b77cd61006ff1888f34a4fb09310 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 c3588c70fb5b0944ab93e9d5dbcf6f1b11849f9e..99772306fe29be85f3fd73a60b1120189095ad9b 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 dc2904754eaa9bce13fd9bc06c752e5ddfe91d85..3924cb3b42041a01f298bf045ca199e5e975c0ed 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 ee21ba4cf87104f0f34c77cfd42b014e4b1c528f..c9a6b065260296d5d42426bd7fe3701f38f1157c 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 b16d6f9cc07f888bf917fc77cd09ad4ffc05a151..410c3244db0b0495454504ff72d3a5f7a3d7d009 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 82a37b242132c44184d89e5cac62e1b9286df490..cd012fc88b3c3551a4c73a79c66aecdbbcd01311 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 7de5fda267fb2b2f220ee8b8b2d3539d2d6ee33c..600bf2a1fb1325f7c1034c6ea64f8a67db0c9423 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 61f45e35eed2633ac4f08722e18ba3127e3532fa..1243cb6aa69867478ead81980aedb17d788ed6e5 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 94329f1853a7381391ed1d782aca4a600e0a9052..e71afc1b08c02bece9f82e87f0f24f23fbace400 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);