summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onPop-06.js
blob: f627e248ba86a38f5f0ec1d5f13a1887c37649fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// dbg.getNewestFrame in an onPop handler returns the frame being popped.
var g = newGlobal();
g.eval("function f() { debugger; }");
g.eval("function g() { f(); }");
g.eval("function h() { g(); }");
g.eval("function i() { h(); }");

var dbg = new Debugger(g);
var log;
dbg.onEnterFrame = function handleEnter(f) {
    log += "(" + f.callee.name;
    f.onPop = function handlePop(c) {
        log += ")" + f.callee.name;  
        assertEq(dbg.getNewestFrame(), this);
    };
};
log = '';
g.i();
assertEq(log, "(i(h(g(f)f)g)h)i");