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 | // Debugger.Frame preserves Ion frame identity |
michael@0 | 2 | |
michael@0 | 3 | load(libdir + "jitopts.js"); |
michael@0 | 4 | |
michael@0 | 5 | if (!jitTogglesMatch(Opts_Ion2NoParallelCompilation)) |
michael@0 | 6 | quit(); |
michael@0 | 7 | |
michael@0 | 8 | withJitOptions(Opts_Ion2NoParallelCompilation, function () { |
michael@0 | 9 | var g = newGlobal(); |
michael@0 | 10 | var dbg1 = new Debugger; |
michael@0 | 11 | var dbg2 = new Debugger; |
michael@0 | 12 | |
michael@0 | 13 | g.toggle = function toggle(x, d) { |
michael@0 | 14 | if (d) { |
michael@0 | 15 | dbg1.addDebuggee(g); |
michael@0 | 16 | dbg2.addDebuggee(g); |
michael@0 | 17 | var frame1 = dbg1.getNewestFrame(); |
michael@0 | 18 | assertEq(frame1.environment.getVariable("x"), x); |
michael@0 | 19 | assertEq(frame1.implementation, "ion"); |
michael@0 | 20 | frame1.environment.setVariable("x", "not 42"); |
michael@0 | 21 | assertEq(dbg2.getNewestFrame().environment.getVariable("x"), "not 42"); |
michael@0 | 22 | } |
michael@0 | 23 | }; |
michael@0 | 24 | |
michael@0 | 25 | g.eval("" + function f(x, d) { toggle(x, d); }); |
michael@0 | 26 | |
michael@0 | 27 | g.eval("(" + function test() { |
michael@0 | 28 | for (var i = 0; i < 5; i++) |
michael@0 | 29 | f(42, false); |
michael@0 | 30 | f(42, true); |
michael@0 | 31 | } + ")();"); |
michael@0 | 32 | }); |