summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/onEnterFrame-generator-resumption-05.js
blob: f1f5a3860a10e2b8f80cecdd2b1390db6496ea5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// {return:} from the initial onEnterFrame for a generator is an error.

load(libdir + "asserts.js");

let g = newGlobal({newCompartment: true});
g.values = [1, 2, 3];
g.eval(`function* f(arr=values) { yield* arr; }`);

let dbg = Debugger(g);

let hits = 0;
dbg.onEnterFrame = frame => {
    assertEq(frame.callee.name, "f");
    hits++;
    return {return: 123};
};
dbg.uncaughtExceptionHook = exc => {
  assertEq(exc instanceof TypeError, true);
  return {throw: "REJECTED"};
}
assertThrowsValue(g.f, "REJECTED");
assertEq(hits, 1);