Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | // The tracejit does not interfere with frame.onStep. |
michael@0 | 2 | // |
michael@0 | 3 | // The function f() writes 'L' to the log in a loop. If we enable stepping and |
michael@0 | 4 | // write an 's' each time frame.onStep is called, any two Ls should have at |
michael@0 | 5 | // least one 's' between them. |
michael@0 | 6 | |
michael@0 | 7 | var g = newGlobal(); |
michael@0 | 8 | g.N = 11; |
michael@0 | 9 | g.log = ''; |
michael@0 | 10 | g.eval("function f() {\n" + |
michael@0 | 11 | " for (var i = 0; i <= N; i++)\n" + |
michael@0 | 12 | " log += 'L';\n" + |
michael@0 | 13 | "}\n"); |
michael@0 | 14 | g.f(); |
michael@0 | 15 | assertEq(/LL/.exec(g.log) !== null, true); |
michael@0 | 16 | |
michael@0 | 17 | var dbg = Debugger(g); |
michael@0 | 18 | dbg.onEnterFrame = function (frame) { |
michael@0 | 19 | frame.onStep = function () { g.log += 's'; }; |
michael@0 | 20 | }; |
michael@0 | 21 | g.log = ''; |
michael@0 | 22 | g.f(); |
michael@0 | 23 | assertEq(/LL/.exec(g.log), null); |