Debian Codegraph @

js/src/jit-test/tests/debug/Frame-onPop-06.js

raw
1 // dbg.getNewestFrame in an onPop handler returns the frame being popped.
2
3 var g = newGlobal({newCompartment: true});
4 g.eval("function f() { debugger; }");
5 g.eval("function g() { f(); }");
6 g.eval("function h() { g(); }");
7 g.eval("function i() { h(); }");
8
9 var dbg = new Debugger(g);
10 var log;
11 dbg.onEnterFrame = function handleEnter(f) {
12 log += "(" + f.callee.name;
13 f.onPop = function handlePop(c) {
14 log += ")" + f.callee.name;
15 assertEq(dbg.getNewestFrame(), this);
16 };
17 };
18 log = '';
19 g.i();
20 assertEq(log, "(i(h(g(f)f)g)h)i");