blob: 750c6614b87f4c6c147d9a5cbf2acf14ff859275 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
// Basic call chain.
var g = newGlobal({newCompartment: true});
var result = null;
var dbg = new Debugger(g);
dbg.onDebuggerStatement = function (frame) {
var a = [];
assertEq(frame === frame.older, false);
for (; frame; frame = frame.older)
a.push(frame.type === 'call' ? frame.callee.name : frame.type);
a.reverse();
result = a.join(", ");
};
g.eval("function first() { return second(); }");
g.eval("function second() { return eval('third()'); }");
g.eval("function third() { debugger; }");
g.evaluate("first();");
assertEq(result, "global, first, second, eval, third");
|