js/src/jit-test/tests/debug/Frame-onStep-07.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-onStep-07.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,23 @@
     1.4 +// The tracejit does not interfere with frame.onStep.
     1.5 +//
     1.6 +// The function f() writes 'L' to the log in a loop. If we enable stepping and
     1.7 +// write an 's' each time frame.onStep is called, any two Ls should have at
     1.8 +// least one 's' between them.
     1.9 +
    1.10 +var g = newGlobal();
    1.11 +g.N = 11;
    1.12 +g.log = '';
    1.13 +g.eval("function f() {\n" +
    1.14 +       "    for (var i = 0; i <= N; i++)\n" +
    1.15 +       "        log += 'L';\n" +
    1.16 +       "}\n");
    1.17 +g.f();
    1.18 +assertEq(/LL/.exec(g.log) !== null, true);
    1.19 +
    1.20 +var dbg = Debugger(g);
    1.21 +dbg.onEnterFrame = function (frame) {
    1.22 +    frame.onStep = function () { g.log += 's'; };
    1.23 +};
    1.24 +g.log = '';
    1.25 +g.f();
    1.26 +assertEq(/LL/.exec(g.log), null);

mercurial