summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/testGeneratorDeepBail.js
blob: 50c62b0742924a6ca332597ef6ee796eb13193fe (plain)
1
2
3
4
5
6
7
8
9
10
11
function testGeneratorDeepBail() {
    function g() { yield 2; }
    var iterables = [[1], [], [], [], g()];

    var total = 0;
    for (let i = 0; i < iterables.length; i++)
        for each (let j in iterables[i])
                     total += j;
    return total;
}
assertEq(testGeneratorDeepBail(), 3);