summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onEnterFrame-async-resumption-13.js
blob: f9e856a74cff5e7f498688d68c89a2e630964f61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// An onPop handler can return its input argument for async generators. The
// debugger correctly adjusts the state of the async generator object.

let g = newGlobal({newCompartment: true});
g.eval(`
    async function* f() {}
`);

let hits = 0;
let dbg = new Debugger(g);
dbg.onEnterFrame = frame => {
  frame.onPop = completion => {
      hits++;
      return completion;
  };
};

let it = g.f();
let p = it.next();

assertEq(hits, 1);