summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-getNewestFrame-02.js
blob: b91afe80cbe9f94e51e1133a9a4e22c521a29654 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Hooks and Debugger.prototype.getNewestFrame produce the same Frame object.

var g = newGlobal();
var dbg = Debugger(g);
var hits = 0;
var savedFrame, savedCallee;
dbg.onDebuggerStatement = function (frame) {
    assertEq(frame, savedFrame);
    assertEq(frame.live, true);
    assertEq(frame.callee, savedCallee);
    hits++;
};
g.h = function () {
    savedFrame = dbg.getNewestFrame();
    savedCallee = savedFrame.callee;
    assertEq(savedCallee.name, "f");
};
g.eval("function f() { h(); debugger; }");
g.f();
assertEq(hits, 1);