summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/for-of/generators-1.js
blob: 05761f5e64eb78a1a2bda30bdc79fc9230b8c2ef (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');