summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/dispatch-02.js
blob: 549f68342fb487ac0e0915ebdbdbc047838d0130 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Disabling a Debugger object causes events to stop being delivered to it
// immediately, even if we're in the middle of dispatching.

var g = newGlobal();
var log;

var arr = [];
for (var i = 0; i < 4; i++) {
    arr[i] = new Debugger(g);
    arr[i].num = i;
    arr[i].onDebuggerStatement = function () {
        log += this.num;
        // Disable them all.
        for (var j = 0; j < arr.length; j++)
            arr[j].enabled = false;
    };
}

log = '';
g.eval("debugger; debugger;");
assertEq(log, '0');