js/src/jit-test/tests/debug/gc-09.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/gc-09.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,15 @@
     1.4 +// Bug 717104 - Unreachable debuggee globals should not keep their debuggers
     1.5 +// alive. The loop is to defeat conservative stack scanning; if the same stack
     1.6 +// locations are used each time through the loop, at least three of the
     1.7 +// debuggers should be collected.
     1.8 +
     1.9 +for (var i = 0; i < 4; i++) {
    1.10 +    var g = newGlobal();
    1.11 +    var dbg = new Debugger(g);
    1.12 +    dbg.onDebuggerStatement = function () { throw "FAIL"; };
    1.13 +    dbg.o = makeFinalizeObserver();
    1.14 +    dbg.loop = g; // make a cycle of strong references with dbg and g
    1.15 +}
    1.16 +
    1.17 +gc();
    1.18 +assertEq(finalizeCount() > 0, true);

mercurial