summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/generators-1.js
blob: 417465a508a3cb117bf5d907a01feb778a7da870 (plain)
1
2
3
4
5
6
7
8
9
10
11
// for-of works with generators.

function* range(n) {
    for (var i = 0; i < n; i++)
        yield i;
}

var s = '';
for (var a of range(4))
    s += a;
assertEq(s, '0123');