summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-type-01.js
blob: b17338874c1cc470d29032f05200d6650ff4f98d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Debugger.Frame.prototype.type on a normal function.

load(libdir + "asserts.js");

const g = newGlobal({ newCompartment: true });
const dbg = Debugger(g);

g.eval(`
function f() {}
`);

let frame;
dbg.onEnterFrame = function(f) {
  frame = f;
  assertEq(frame.type, "call");
};

g.f();

assertEq(!!frame, true);
// Throws because the frame has terminated.
assertThrowsInstanceOf(() => frame.type, Error);