summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Array/includes-trailing-holes.js
blob: b783cc36d8574965d5ee4306bb043b7f37e861fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Array with trailing hole as explicit "magic elements hole".
assertEq([,].includes(), true);
assertEq([,].includes(undefined), true);
assertEq([,].includes(undefined, 0), true);
assertEq([,].includes(null), false);
assertEq([,].includes(null, 0), false);

// Array with trailing hole with no explicit "magic elements hole".
assertEq(Array(1).includes(), true);
assertEq(Array(1).includes(undefined), true);
assertEq(Array(1).includes(undefined, 0), true);
assertEq(Array(1).includes(null), false);
assertEq(Array(1).includes(null, 0), false);

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