summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/elements.js
blob: 81ff41a0bfea06cbf64f9c7713a1303ecd4f0b01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// |reftest| skip-if(!this.hasOwnProperty("Tuple"))

var tup = Tuple(1, 2, 10n ** 100n, Tuple(5, 6));

assertEq(tup[0], 1);
assertEq(tup[1], 2);
assertEq(tup[2], 10n ** 100n);
assertEq(typeof tup[3], "tuple");
assertEq(tup[3][0], 5);
assertEq(tup[3][1], 6);

assertEq(Object(tup)[0], 1);

assertEq(tup.length, 4);
assertEq(Object(tup).length, 4);

assertEq("0" in Object(tup), true);

if (typeof reportCompare === "function") reportCompare(0, 0);