Debian Codegraph @

js/src/jit-test/tests/debug/Frame-type-01.js

raw
1 // Debugger.Frame.prototype.type on a normal function.
2
3 load(libdir + "asserts.js");
4
5 const g = newGlobal({ newCompartment: true });
6 const dbg = Debugger(g);
7
8 g.eval(`
9 function f() {}
10 `);
11
12 let frame;
13 dbg.onEnterFrame = function(f) {
14 frame = f;
15 assertEq(frame.type, "call");
16 };
17
18 g.f();
19
20 assertEq(!!frame, true);
21 // Throws because the frame has terminated.
22 assertThrowsInstanceOf(() => frame.type, Error);