summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/array-iterator-empty.js
blob: 5b448befaebce10419d85d289c09e1a7ee447123 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Array.keys() and .entries() on an empty array produce empty iterators

var arr = [];
var ki = arr.keys(), ei = arr.entries();
var p = Object.getPrototypeOf(ki);
assertEq(Object.getPrototypeOf(ei), p);

for (let k of ki)
  throw "FAIL";
for (let [k, v] of ei)
  throw "FAIL";