summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-eval-stack.js
blob: 1199dfd72d74674c2b11cf75bc6927772aa58f7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
var g = newGlobal();
var dbg = new Debugger(g);

g.eval("function h() { debugger; }");
g.eval("function g() { h() }");
g.eval("function f() { var blah = 333; g() }");

dbg.onDebuggerStatement = function(frame) {
    frame = frame.older;
    g.trace = frame.older.eval("(new Error()).stack;").return;
}
g.f();

assertEq(typeof g.trace, "string");

var frames = g.trace.split("\n");
assertEq(frames[0].includes("eval code"), true);
assertEq(frames[1].startsWith("f@"), true);
assertEq(frames[2].startsWith("@"), true);