js/src/jit-test/tests/debug/Frame-onPop-multiple-04.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/Frame-onPop-multiple-04.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,27 @@
     1.4 +// If one Debugger's onPop handler causes another Debugger to create a
     1.5 +// Debugger.Frame instance referring to the same frame, that frame still
     1.6 +// gets marked as not live after all the onPop handlers have run.
     1.7 +var g = newGlobal();
     1.8 +var dbg1 = new Debugger(g);
     1.9 +var dbg2 = new Debugger(g);
    1.10 +
    1.11 +var log;
    1.12 +var frame2;
    1.13 +
    1.14 +dbg1.onEnterFrame = function handleEnter(frame) {
    1.15 +    log += '(';
    1.16 +    frame.onPop = function handlerPop1(c) {
    1.17 +        log += ')';
    1.18 +        frame2 = dbg2.getNewestFrame();
    1.19 +        assertEq(frame2.live, true);
    1.20 +        frame2.onPop = function handlePop2(c) {
    1.21 +            assertEq("late frame's onPop handler ran",
    1.22 +                     "late frame's onPop handler should not run");
    1.23 +        };
    1.24 +    };
    1.25 +};
    1.26 +
    1.27 +log = '';
    1.28 +assertEq(g.eval('40 + 2'), 42);
    1.29 +assertEq(log, '()');
    1.30 +assertEq(frame2.live, false);

mercurial