summaryrefslogtreecommitdiff
path: root/test/built-ins/TypedArray/prototype/set
diff options
context:
space:
mode:
Diffstat (limited to 'test/built-ins/TypedArray/prototype/set')
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-offset-tointeger.js108
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-length.js2
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-value.js10
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length-symbol.js2
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length.js2
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value-symbol.js10
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value.js10
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-toobject-offset.js2
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values-in-order.js8
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values.js30
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-tonumber-value-type-conversions.js2
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-values-are-not-cached.js20
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-target-arraylength-internal.js2
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-get-src-value-throws.js4
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-offset-tointeger.js74
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type.js14
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type.js14
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type.js12
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-arraylength-internal.js2
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-byteoffset-internal.js4
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-arraylength-internal.js2
-rw-r--r--test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-byteoffset-internal.js4
22 files changed, 169 insertions, 169 deletions
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-offset-tointeger.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-offset-tointeger.js
index b47dc9de6..e5d504634 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-offset-tointeger.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-offset-tointeger.js
@@ -21,75 +21,75 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample;
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], "");
- assert(compareArray(sample, convertToBigInt([42, 2])), "the empty string");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], "");
+ assert(compareArray(sample, [42n, 2n]), "the empty string");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], "0");
- assert(compareArray(sample, convertToBigInt([42, 2])), "'0'");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], "0");
+ assert(compareArray(sample, [42n, 2n]), "'0'");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], false);
- assert(compareArray(sample, convertToBigInt([42, 2])), "false");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], false);
+ assert(compareArray(sample, [42n, 2n]), "false");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], 0.1);
- assert(compareArray(sample, convertToBigInt([42, 2])), "0.1");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], 0.1);
+ assert(compareArray(sample, [42n, 2n]), "0.1");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], 0.9);
- assert(compareArray(sample, convertToBigInt([42, 2])), "0.9");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], 0.9);
+ assert(compareArray(sample, [42n, 2n]), "0.9");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], -0.5);
- assert(compareArray(sample, convertToBigInt([42, 2])), "-0.5");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], -0.5);
+ assert(compareArray(sample, [42n, 2n]), "-0.5");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], 1.1);
- assert(compareArray(sample, convertToBigInt([1, 42])), "1.1");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], 1.1);
+ assert(compareArray(sample, [1n, 42n]), "1.1");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], NaN);
- assert(compareArray(sample, convertToBigInt([42, 2])), "NaN");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], NaN);
+ assert(compareArray(sample, [42n, 2n]), "NaN");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], null);
- assert(compareArray(sample, convertToBigInt([42, 2])), "null");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], null);
+ assert(compareArray(sample, [42n, 2n]), "null");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], undefined);
- assert(compareArray(sample, convertToBigInt([42, 2])), "undefined");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], undefined);
+ assert(compareArray(sample, [42n, 2n]), "undefined");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], {});
- assert(compareArray(sample, convertToBigInt([42, 2])), "{}");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], {});
+ assert(compareArray(sample, [42n, 2n]), "{}");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], []);
- assert(compareArray(sample, convertToBigInt([42, 2])), "[]");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], []);
+ assert(compareArray(sample, [42n, 2n]), "[]");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], [0]);
- assert(compareArray(sample, convertToBigInt([42, 2])), "[0]");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], [0]);
+ assert(compareArray(sample, [42n, 2n]), "[0]");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], true);
- assert(compareArray(sample, convertToBigInt([1, 42])), "true");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], true);
+ assert(compareArray(sample, [1n, 42n]), "true");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], "1");
- assert(compareArray(sample, convertToBigInt([1, 42])), "'1'");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], "1");
+ assert(compareArray(sample, [1n, 42n]), "'1'");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], [1]);
- assert(compareArray(sample, convertToBigInt([1, 42])), "[1]");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], [1]);
+ assert(compareArray(sample, [1n, 42n]), "[1]");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], { valueOf: function() {return 1;} });
- assert(compareArray(sample, convertToBigInt([1, 42])), "valueOf");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], { valueOf: function() {return 1;} });
+ assert(compareArray(sample, [1n, 42n]), "valueOf");
- sample = new TA(convertToBigInt([1, 2]));
- sample.set([convertToBigInt(42)], { toString: function() {return 1;} });
- assert(compareArray(sample, convertToBigInt([1, 42])), "toString");
+ sample = new TA([1n, 2n]);
+ sample.set([42n], { toString: function() {return 1;} });
+ assert(compareArray(sample, [1n, 42n]), "toString");
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-length.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-length.js
index 2dd5b23ea..bd6a28723 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-length.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-length.js
@@ -25,7 +25,7 @@ Object.defineProperty(obj, "length", {
});
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([1, 2, 3]));
+ var sample = new TA([1n, 2n, 3n]);
assert.throws(Test262Error, function() {
sample.set(obj);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-value.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-value.js
index 451e7bad1..237c94645 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-value.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-get-value.js
@@ -25,9 +25,9 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var obj = {
length: 4,
- "0": convertToBigInt(42),
- "1": convertToBigInt(43),
- "3": convertToBigInt(44)
+ "0": 42n,
+ "1": 43n,
+ "3": 44n
};
Object.defineProperty(obj, "2", {
get: function() {
@@ -35,14 +35,14 @@ testWithBigIntTypedArrayConstructors(function(TA) {
}
});
- var sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ var sample = new TA([1n, 2n, 3n, 4n]);
assert.throws(Test262Error, function() {
sample.set(obj);
});
assert(
- compareArray(sample, convertToBigInt([42, 43, 3, 4])),
+ compareArray(sample, [42n, 43n, 3n, 4n]),
"values are set until exception"
);
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length-symbol.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length-symbol.js
index f1a65b06e..e0393870d 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length-symbol.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length-symbol.js
@@ -22,7 +22,7 @@ var obj = {
};
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([1, 2, 3]));
+ var sample = new TA([1n, 2n, 3n]);
assert.throws(TypeError, function() {
sample.set(obj);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length.js
index 401a486db..f2bea7374 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-length.js
@@ -34,7 +34,7 @@ var obj2 = {
};
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([1, 2, 3]));
+ var sample = new TA([1n, 2n, 3n]);
assert.throws(Test262Error, function() {
sample.set(obj1);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value-symbol.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value-symbol.js
index fd9121934..683d318f0 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value-symbol.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value-symbol.js
@@ -25,20 +25,20 @@ features: [BigInt, Symbol, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var obj = {
length: 4,
- "0": convertToBigInt(42),
- "1": convertToBigInt(43),
+ "0": 42n,
+ "1": 43n,
"2": Symbol("1"),
- "3": convertToBigInt(44)
+ "3": 44n
};
- var sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ var sample = new TA([1n, 2n, 3n, 4n]);
assert.throws(TypeError, function() {
sample.set(obj);
});
assert(
- compareArray(sample, convertToBigInt([42, 43, 3, 4])),
+ compareArray(sample, [42n, 43n, 3n, 4n]),
"values are set until exception"
);
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value.js
index af1f98349..7195d3f7d 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-src-tonumber-value.js
@@ -25,24 +25,24 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var obj = {
length: 4,
- "0": convertToBigInt(42),
- "1": convertToBigInt(43),
+ "0": 42n,
+ "1": 43n,
"2": {
valueOf: function() {
throw new Test262Error();
}
},
- "3": convertToBigInt(44)
+ "3": 44n
};
- var sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ var sample = new TA([1n, 2n, 3n, 4n]);
assert.throws(Test262Error, function() {
sample.set(obj);
});
assert(
- compareArray(sample, convertToBigInt([42, 43, 3, 4])),
+ compareArray(sample, [42n, 43n, 3n, 4n]),
"values are set until exception"
);
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-toobject-offset.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-toobject-offset.js
index 8ee19ce7c..d55c05cd5 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-toobject-offset.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-return-abrupt-from-toobject-offset.js
@@ -18,7 +18,7 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([1, 2, 3]));
+ var sample = new TA([1n, 2n, 3n]);
assert.throws(TypeError, function() {
sample.set(undefined);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values-in-order.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values-in-order.js
index 7a5ed9850..3eb5722ef 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values-in-order.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values-in-order.js
@@ -32,7 +32,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
get: function() {
calls.push(0);
calls.push(sample.join());
- return convertToBigInt(42);
+ return 42n;
}
});
@@ -40,7 +40,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
get: function() {
calls.push(1);
calls.push(sample.join());
- return convertToBigInt(43);
+ return 43n;
}
});
@@ -48,7 +48,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
get: function() {
calls.push(2);
calls.push(sample.join());
- return convertToBigInt(44);
+ return 44n;
}
});
@@ -61,7 +61,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
sample.set(obj, 1);
assert(
- compareArray(sample, convertToBigInt([0, 42, 43, 44, 0])),
+ compareArray(sample, [0n, 42n, 43n, 44n, 0n]),
"values are set for src length"
);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values.js
index 3a5888726..1e3a226f8 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-set-values.js
@@ -23,41 +23,41 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var src = convertToBigInt([42, 43]);
+ var src = [42n, 43n];
var srcObj = {
length: 2,
- '0': convertToBigInt(7),
- '1': convertToBigInt(17)
+ '0': 7n,
+ '1': 17n
};
var sample, result;
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 0);
- assert(compareArray(sample, convertToBigInt([42, 43, 3, 4])), "offset: 0, result: " + sample);
+ assert(compareArray(sample, [42n, 43n, 3n, 4n]), "offset: 0, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 1);
- assert(compareArray(sample, convertToBigInt([1, 42, 43, 4])), "offset: 1, result: " + sample);
+ assert(compareArray(sample, [1n, 42n, 43n, 4n]), "offset: 1, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 2);
- assert(compareArray(sample, convertToBigInt([1, 2, 42, 43])), "offset: 2, result: " + sample);
+ assert(compareArray(sample, [1n, 2n, 42n, 43n]), "offset: 2, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(srcObj, 0);
- assert(compareArray(sample, convertToBigInt([7, 17, 3, 4])), "offset: 0, result: " + sample);
+ assert(compareArray(sample, [7n, 17n, 3n, 4n]), "offset: 0, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(srcObj, 1);
- assert(compareArray(sample, convertToBigInt([1, 7, 17, 4])), "offset: 1, result: " + sample);
+ assert(compareArray(sample, [1n, 7n, 17n, 4n]), "offset: 1, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(srcObj, 2);
- assert(compareArray(sample, convertToBigInt([1, 2, 7, 17])), "offset: 2, result: " + sample);
+ assert(compareArray(sample, [1n, 2n, 7n, 17n]), "offset: 2, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
});
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 a07ffab4f..8deeed826 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
@@ -25,7 +25,7 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var obj1 = {
valueOf: function() {
- return convertToBigInt(42);
+ return 42n;
}
};
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-values-are-not-cached.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-values-are-not-cached.js
index 3ad61f0b6..d6156af97 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-values-are-not-cached.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-src-values-are-not-cached.js
@@ -26,22 +26,22 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(5);
var obj = {
length: 5,
- '1': convertToBigInt(7),
- '2': convertToBigInt(7),
- '3': convertToBigInt(7),
- '4': convertToBigInt(7)
+ '1': 7n,
+ '2': 7n,
+ '3': 7n,
+ '4': 7n
};
Object.defineProperty(obj, 0, {
get: function() {
- obj[1] = convertToBigInt(43);
- obj[2] = convertToBigInt(44);
- obj[3] = convertToBigInt(45);
- obj[4] = convertToBigInt(46);
- return convertToBigInt(42);
+ obj[1] = 43n;
+ obj[2] = 44n;
+ obj[3] = 45n;
+ obj[4] = 46n;
+ return 42n;
}
});
sample.set(obj);
- assert(compareArray(sample, convertToBigInt([42, 43, 44, 45, 46])));
+ assert(compareArray(sample, [42n, 43n, 44n, 45n, 46n]));
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-target-arraylength-internal.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-target-arraylength-internal.js
index 95c1a9776..a6e6a3d34 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-target-arraylength-internal.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-target-arraylength-internal.js
@@ -35,7 +35,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
Object.defineProperty(TA.prototype, "length", desc);
Object.defineProperty(sample, "length", desc);
- sample.set(convertToBigInt([42, 43]));
+ sample.set([42n, 43n]);
assert.sameValue(getCalls, 0, "ignores length properties");
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-get-src-value-throws.js b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-get-src-value-throws.js
index 7e53f4221..568e8b9b0 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-get-src-value-throws.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/array-arg-targetbuffer-detached-on-get-src-value-throws.js
@@ -23,10 +23,10 @@ features: [BigInt, TypedArray]
---*/
testWithBigIntTypedArrayConstructors(function(TA) {
- var sample = new TA(convertToBigInt([1, 2, 3]));
+ var sample = new TA([1n, 2n, 3n]);
var obj = {
length: 3,
- "0": convertToBigInt(42)
+ "0": 42n
};
Object.defineProperty(obj, 1, {
get: function() {
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-offset-tointeger.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-offset-tointeger.js
index 9d5b2478f..3b191aa4e 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-offset-tointeger.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-offset-tointeger.js
@@ -17,77 +17,77 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample;
- var src = new TA(convertToBigInt([42]));
+ var src = new TA([42n]);
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, "");
- assert(compareArray(sample, convertToBigInt([42, 2])), "the empty string");
+ assert(compareArray(sample, [42n, 2n]), "the empty string");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, "0");
- assert(compareArray(sample, convertToBigInt([42, 2])), "'0'");
+ assert(compareArray(sample, [42n, 2n]), "'0'");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, false);
- assert(compareArray(sample, convertToBigInt([42, 2])), "false");
+ assert(compareArray(sample, [42n, 2n]), "false");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, 0.1);
- assert(compareArray(sample, convertToBigInt([42, 2])), "0.1");
+ assert(compareArray(sample, [42n, 2n]), "0.1");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, 0.9);
- assert(compareArray(sample, convertToBigInt([42, 2])), "0.9");
+ assert(compareArray(sample, [42n, 2n]), "0.9");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, -0.5);
- assert(compareArray(sample, convertToBigInt([42, 2])), "-0.5");
+ assert(compareArray(sample, [42n, 2n]), "-0.5");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, 1.1);
- assert(compareArray(sample, convertToBigInt([1, 42])), "1.1");
+ assert(compareArray(sample, [1n, 42n]), "1.1");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, NaN);
- assert(compareArray(sample, convertToBigInt([42, 2])), "NaN");
+ assert(compareArray(sample, [42n, 2n]), "NaN");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, null);
- assert(compareArray(sample, convertToBigInt([42, 2])), "null");
+ assert(compareArray(sample, [42n, 2n]), "null");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, undefined);
- assert(compareArray(sample, convertToBigInt([42, 2])), "undefined");
+ assert(compareArray(sample, [42n, 2n]), "undefined");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, {});
- assert(compareArray(sample, convertToBigInt([42, 2])), "{}");
+ assert(compareArray(sample, [42n, 2n]), "{}");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, []);
- assert(compareArray(sample, convertToBigInt([42, 2])), "[]");
+ assert(compareArray(sample, [42n, 2n]), "[]");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, [0]);
- assert(compareArray(sample, convertToBigInt([42, 2])), "[0]");
+ assert(compareArray(sample, [42n, 2n]), "[0]");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, true);
- assert(compareArray(sample, convertToBigInt([1, 42])), "true");
+ assert(compareArray(sample, [1n, 42n]), "true");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, "1");
- assert(compareArray(sample, convertToBigInt([1, 42])), "'1'");
+ assert(compareArray(sample, [1n, 42n]), "'1'");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, [1]);
- assert(compareArray(sample, convertToBigInt([1, 42])), "[1]");
+ assert(compareArray(sample, [1n, 42n]), "[1]");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, { valueOf: function() {return 1;} });
- assert(compareArray(sample, convertToBigInt([1, 42])), "valueOf");
+ assert(compareArray(sample, [1n, 42n]), "valueOf");
- sample = new TA(convertToBigInt([1, 2]));
+ sample = new TA([1n, 2n]);
sample.set(src, { toString: function() {return 1;} });
- assert(compareArray(sample, convertToBigInt([1, 42])), "toString");
+ assert(compareArray(sample, [1n, 42n]), "toString");
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type.js
index 1b1869345..4456c5dcc 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-other-type.js
@@ -28,21 +28,21 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array;
- var src = new other(convertToBigInt([42, 43]));
+ var src = new other([42n, 43n]);
var sample, result;
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 0);
- assert(compareArray(sample, convertToBigInt([42, 43, 3, 4])), "offset: 0, result: " + sample);
+ assert(compareArray(sample, [42n, 43n, 3n, 4n]), "offset: 0, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 1);
- assert(compareArray(sample, convertToBigInt([1, 42, 43, 4])), "offset: 1, result: " + sample);
+ assert(compareArray(sample, [1n, 42n, 43n, 4n]), "offset: 1, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 2);
- assert(compareArray(sample, convertToBigInt([1, 2, 42, 43])), "offset: 2, result: " + sample);
+ assert(compareArray(sample, [1n, 2n, 42n, 43n]), "offset: 2, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type.js
index be938ca51..d806b6a6c 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-diff-buffer-same-type.js
@@ -31,20 +31,20 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample, result;
- var src = new TA(convertToBigInt([42, 43]));
+ var src = new TA([42n, 43n]);
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 1);
- assert(compareArray(sample, convertToBigInt([1, 42, 43, 4])), "offset: 1, result: " + sample);
+ assert(compareArray(sample, [1n, 42n, 43n, 4n]), "offset: 1, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 0);
- assert(compareArray(sample, convertToBigInt([42, 43, 3, 4])), "offset: 0, result: " + sample);
+ assert(compareArray(sample, [42n, 43n, 3n, 4n]), "offset: 0, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
result = sample.set(src, 2);
- assert(compareArray(sample, convertToBigInt([1, 2, 42, 43])), "offset: 2, result: " + sample);
+ assert(compareArray(sample, [1n, 2n, 42n, 43n]), "offset: 2, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type.js
index 8daad3956..ab1454760 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-set-values-same-buffer-same-type.js
@@ -33,21 +33,21 @@ features: [BigInt, TypedArray]
testWithBigIntTypedArrayConstructors(function(TA) {
var sample, src, result;
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
src = new TA(sample.buffer, 0, 2);
result = sample.set(src, 0);
- assert(compareArray(sample, convertToBigInt([1, 2, 3, 4])), "offset: 0, result: " + sample);
+ assert(compareArray(sample, [1n, 2n, 3n, 4n]), "offset: 0, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
src = new TA(sample.buffer, 0, 2);
result = sample.set(src, 1);
- assert(compareArray(sample, convertToBigInt([1, 1, 2, 4])), "offset: 1, result: " + sample);
+ assert(compareArray(sample, [1n, 1n, 2n, 4n]), "offset: 1, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
- sample = new TA(convertToBigInt([1, 2, 3, 4]));
+ sample = new TA([1n, 2n, 3n, 4n]);
src = new TA(sample.buffer, 0, 2);
result = sample.set(src, 2);
- assert(compareArray(sample, convertToBigInt([1, 2, 1, 2])), "offset: 2, result: " + sample);
+ assert(compareArray(sample, [1n, 2n, 1n, 2n]), "offset: 2, result: " + sample);
assert.sameValue(result, undefined, "returns undefined");
});
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-arraylength-internal.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-arraylength-internal.js
index 9da7cbdcf..96ea335ec 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-arraylength-internal.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-arraylength-internal.js
@@ -30,7 +30,7 @@ Object.defineProperty(TypedArray.prototype, "length", desc);
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(2);
- var src = new TA(convertToBigInt([42, 43]));
+ var src = new TA([42n, 43n]);
Object.defineProperty(TA.prototype, "length", desc);
Object.defineProperty(src, "length", desc);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-byteoffset-internal.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-byteoffset-internal.js
index b75cbbd8e..35c3ace2a 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-byteoffset-internal.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-src-byteoffset-internal.js
@@ -27,9 +27,9 @@ Object.defineProperty(TypedArray.prototype, "byteOffset", desc);
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(2);
- var src = new TA(convertToBigInt([42, 43]));
+ var src = new TA([42n, 43n]);
var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array;
- var src2 = new other(convertToBigInt([42, 43]));
+ var src2 = new other([42n, 43n]);
var src3 = new other(sample.buffer, 0, 2);
Object.defineProperty(TA.prototype, "byteOffset", desc);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-arraylength-internal.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-arraylength-internal.js
index 7eed1fff1..9f13dc2b1 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-arraylength-internal.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-arraylength-internal.js
@@ -31,7 +31,7 @@ Object.defineProperty(TypedArray.prototype, "length", desc);
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(2);
- var src = new TA(convertToBigInt([42, 43]));
+ var src = new TA([42n, 43n]);
Object.defineProperty(TA.prototype, "length", desc);
Object.defineProperty(sample, "length", desc);
diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-byteoffset-internal.js b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-byteoffset-internal.js
index ba1909dd5..13b7978fc 100644
--- a/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-byteoffset-internal.js
+++ b/test/built-ins/TypedArray/prototype/set/BigInt/typedarray-arg-target-byteoffset-internal.js
@@ -28,9 +28,9 @@ Object.defineProperty(TypedArray.prototype, "byteOffset", desc);
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(2);
- var src = new TA(convertToBigInt([42, 43]));
+ var src = new TA([42n, 43n]);
var other = TA === BigInt64Array ? BigUint64Array : BigInt64Array;
- var src2 = new other(convertToBigInt([42, 43]));
+ var src2 = new other([42n, 43n]);
var src3 = new other(sample.buffer, 0, 2);
Object.defineProperty(TA.prototype, "byteOffset", desc);