blob: a77aa30bae81cf00aa4b26707c3b7b2b9893fc95 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
// Debuggers with enabled hooks should not be GC'd even if they are otherwise
// unreachable.
var g = newGlobal();
var actual = 0;
var expected = 0;
function f() {
for (var i = 0; i < 20; i++) {
var dbg = new Debugger(g);
dbg.num = i;
dbg.onDebuggerStatement = function (stack) { actual += this.num; };
expected += i;
}
}
f();
gc(); gc(); gc();
g.eval("debugger;");
assertEq(actual, expected);
|