summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Set-iterator-3.js
blob: c337acb2f6bfaaaffb13b594bdad654f7a8f5f86 (plain)
1
2
3
4
5
6
7
8
9
10
11
// Iterating over a set of objects yields those exact objects.

var arr = [{}, {}, {}, [], /xyz/, new Date];
var set = new Set(arr);
assertEq(set.size, arr.length);

var i = 0;
for (var x of set)
    assertEq(x, arr[i++]);
assertEq(i, arr.length);