summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-02.js
blob: dddb1e7024aa7d1246adaca64d8a2785223549eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// When the debugger is triggered twice from the same stack frame, the same
// Debugger.Frame object is passed to the hook both times.

var g = newGlobal({newCompartment: true});
var hits, frame;
var dbg = Debugger(g);
dbg.onDebuggerStatement = function (f) {
    if (hits++ == 0)
        frame = f;
    else
        assertEq(f, frame);
};

hits = 0;
g.evaluate("debugger; debugger;");
assertEq(hits, 2);

hits = 0;
g.evaluate("function f() { debugger; debugger; }  f();");
assertEq(hits, 2);

hits = 0;
g.evaluate("eval('debugger; debugger;');");
assertEq(hits, 2);