summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/collections/Set-constructor-generator-1.js
blob: c2f74bc6bb92be8425bfcc99f6443e5851036e0b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// The argument to Set can be a generator.

function hexData(n) {
    for (var i = 0; i < n; i++)
        yield i.toString(16);
}

var s = new Set(hexData(256));
assertEq(s.size, 256);
assertEq(s.has("0"), true);
assertEq(s.has(0), false);
assertEq(s.has("ff"), true);