js/src/jit-test/tests/debug/Frame-eval-22.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

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 });

mercurial