diff options
Diffstat (limited to 'test/built-ins/TypedArray/prototype/map')
11 files changed, 41 insertions, 41 deletions
diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js b/test/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js index c74501315..a23cca257 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/arraylength-internal.js @@ -22,7 +22,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample1.map(function() { loop++; - return convertToBigInt(0); + return 0n; }); assert.sameValue(loop, 42, "data descriptor"); @@ -38,7 +38,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample2.map(function() { loop++; - return convertToBigInt(0); + return 0n; }); assert.sameValue(loop, 4, "accessor descriptor"); }); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-with-thisarg.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-with-thisarg.js index 85ff13e4e..169a83dee 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-with-thisarg.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-with-thisarg.js @@ -18,31 +18,31 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 44])); + var sample = new TA([42n, 43n, 44n]); var results = []; var thisArg = ["test262", 0, "ecma262", 0]; sample.map(function() { results.push(arguments); - return convertToBigInt(0); + return 0n; }, thisArg); assert.sameValue(results.length, 3, "results.length"); assert.sameValue(thisArg.length, 4, "thisArg.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], convertToBigInt(42), "results[0][0] - kValue"); + assert.sameValue(results[0][0], 42n, "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], convertToBigInt(43), "results[1][0] - kValue"); + assert.sameValue(results[1][0], 43n, "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], convertToBigInt(44), "results[2][0] - kValue"); + assert.sameValue(results[2][0], 44n, "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-without-thisarg.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-without-thisarg.js index 1e12f5551..13e7c1500 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-without-thisarg.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-arguments-without-thisarg.js @@ -18,29 +18,29 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 44])); + var sample = new TA([42n, 43n, 44n]); var results = []; sample.map(function() { results.push(arguments); - return convertToBigInt(0); + return 0n; }); assert.sameValue(results.length, 3, "results.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], convertToBigInt(42), "results[0][0] - kValue"); + assert.sameValue(results[0][0], 42n, "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], convertToBigInt(43), "results[1][0] - kValue"); + assert.sameValue(results[1][0], 43n, "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], convertToBigInt(44), "results[2][0] - kValue"); + assert.sameValue(results[2][0], 44n, "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js index 94bf74867..d8abe4bd4 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-detachbuffer.js @@ -28,7 +28,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { } $DETACHBUFFER(sample.buffer); loops++; - return convertToBigInt(0); + return 0n; }); }); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-no-interaction-over-non-integer-properties.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-no-interaction-over-non-integer-properties.js index a1b5639f1..e8bf86d04 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-no-interaction-over-non-integer-properties.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-no-interaction-over-non-integer-properties.js @@ -19,7 +19,7 @@ features: [BigInt, Symbol, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([7, 8])); + var sample = new TA([7n, 8n]); var results = []; @@ -28,7 +28,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample.map(function() { results.push(arguments); - return convertToBigInt(0); + return 0n; }); assert.sameValue(results.length, 2, "results.length"); @@ -36,6 +36,6 @@ testWithBigIntTypedArrayConstructors(function(TA) { assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); - assert.sameValue(results[0][0], convertToBigInt(7), "results[0][0] - kValue"); - assert.sameValue(results[1][0], convertToBigInt(8), "results[1][0] - kValue"); + assert.sameValue(results[0][0], 7n, "results[0][0] - kValue"); + assert.sameValue(results[1][0], 8n, "results[1][0] - kValue"); }); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-affects-returned-object.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-affects-returned-object.js index cfd180d1f..f2f679a6d 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-affects-returned-object.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-affects-returned-object.js @@ -20,12 +20,12 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([1, 2, 4])); + var sample = new TA([1n, 2n, 4n]); var result = sample.map(function(v) { - return v * convertToBigInt(3); + return v * 3n; }); - assert.sameValue(result[0], convertToBigInt(3), "result[0] == 3"); - assert.sameValue(result[1], convertToBigInt(6), "result[1] == 6"); - assert.sameValue(result[2], convertToBigInt(12), "result[2] == 12"); + assert.sameValue(result[0], 3n, "result[0] == 3"); + assert.sameValue(result[1], 6n, "result[1] == 6"); + assert.sameValue(result[2], 12n, "result[2] == 12"); }); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-change-instance.js index bc0f6f32b..dfd441f3c 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-change-instance.js @@ -13,13 +13,13 @@ features: [BigInt, TypedArray] testWithBigIntTypedArrayConstructors(function(TA) { var sample1 = new TA(3); - sample1[1] = convertToBigInt(1); + sample1[1] = 1n; sample1.map(function() { - return convertToBigInt(42); + return 42n; }); - assert.sameValue(sample1[0], convertToBigInt(0), "[0] == 0"); - assert.sameValue(sample1[1], convertToBigInt(1), "[1] == 1"); - assert.sameValue(sample1[2], convertToBigInt(0), "[2] == 0"); + assert.sameValue(sample1[0], 0n, "[0] == 0"); + assert.sameValue(sample1[1], 1n, "[1] == 1"); + assert.sameValue(sample1[2], 0n, "[2] == 0"); }); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-copy-non-integer-properties.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-copy-non-integer-properties.js index a672b35bd..4783a2a1e 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-copy-non-integer-properties.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-return-does-not-copy-non-integer-properties.js @@ -18,14 +18,14 @@ features: [BigInt, Symbol, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([7, 8])); + var sample = new TA([7n, 8n]); var bar = Symbol("1"); sample.foo = 42; sample[bar] = 1; var result = sample.map(function() { - return convertToBigInt(0); + return 0n; }); assert.sameValue(result.length, 2, "result.length"); 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 2e0f7eed1..9e140cd82 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 @@ -12,7 +12,7 @@ features: [BigInt, Reflect.set, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 44])); + var sample = new TA([42n, 43n, 44n]); var newVal = 0; sample.map(function(val, i) { @@ -22,7 +22,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 0, convertToBigInt(7)), + Reflect.set(sample, 0, 7n), true, "re-set a value for sample[0]" ); @@ -34,10 +34,10 @@ testWithBigIntTypedArrayConstructors(function(TA) { ); newVal++; - return convertToBigInt(0); + return 0n; }); - assert.sameValue(sample[0], convertToBigInt(7), "changed values after iteration [0] == 7"); - assert.sameValue(sample[1], convertToBigInt(1), "changed values after iteration [1] == 1"); - assert.sameValue(sample[2], convertToBigInt(2), "changed values after iteration [2] == 2"); + assert.sameValue(sample[0], 7n, "changed values after iteration [0] == 7"); + assert.sameValue(sample[1], 1n, "changed values after iteration [1] == 1"); + assert.sameValue(sample[2], 2n, "changed values after iteration [2] == 2"); }); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-this.js b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-this.js index e5ee5393c..820dfb198 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-this.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/callbackfn-this.js @@ -28,7 +28,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample.map(function() { results1.push(this); - return convertToBigInt(0); + return 0n; }); assert.sameValue(results1.length, 3, "results1"); @@ -40,7 +40,7 @@ testWithBigIntTypedArrayConstructors(function(TA) { sample.map(function() { results2.push(this); - return convertToBigInt(0); + return 0n; }, thisArg); assert.sameValue(results2.length, 3, "results2"); diff --git a/test/built-ins/TypedArray/prototype/map/BigInt/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/map/BigInt/values-are-not-cached.js index a8665d931..6b6728228 100644 --- a/test/built-ins/TypedArray/prototype/map/BigInt/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/map/BigInt/values-are-not-cached.js @@ -12,17 +12,17 @@ features: [BigInt, TypedArray] ---*/ testWithBigIntTypedArrayConstructors(function(TA) { - var sample = new TA(convertToBigInt([42, 43, 44])); + var sample = new TA([42n, 43n, 44n]); sample.map(function(v, i) { if (i < sample.length - 1) { - sample[i+1] = convertToBigInt(42); + sample[i+1] = 42n; } assert.sameValue( - v, convertToBigInt(42), "method does not cache values before callbackfn calls" + v, 42n, "method does not cache values before callbackfn calls" ); - return convertToBigInt(0); + return 0n; }); }); |