summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/bug1368736.js
blob: f4495822e212a21a4f646235c93b5d3329202daa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
g = newGlobal({newCompartment: true});
hits = 0;
Debugger(g).onDebuggerStatement = function(frame) {
    // Set a breakpoint at the JSOP_AFTERYIELD op.
    frame.script.setBreakpoint(120, {hit: function() { hits++; }});
}
g.eval(`
function* range() {
    eval("");
    debugger;
    for (var i = 0; i < 3; i++) {
        yield i;
    }
}
var iter = range();
for (var i = 0; i < 3; i++)
    assertEq(iter.next().value, i);
`);
assertEq(hits, 2);