diff options
Diffstat (limited to 'test/built-ins/TypedArray/prototype/toLocaleString')
10 files changed, 12 insertions, 28 deletions
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 + |