js/src/jit-test/tests/baseline/bug836742.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 // |jit-test| debug
michael@0 2 // Ensure the correct frame is passed to exception unwind hooks.
michael@0 3 var g = newGlobal();
michael@0 4 g.debuggeeGlobal = this;
michael@0 5 g.eval("(" + function () {
michael@0 6 frames = [];
michael@0 7 var dbg = Debugger(debuggeeGlobal);
michael@0 8 dbg.onEnterFrame = function(frame) {
michael@0 9 frames.push(frame);
michael@0 10 };
michael@0 11 dbg.onExceptionUnwind = function(frame) {
michael@0 12 assertEq(frames.indexOf(frame), frames.length - 1);
michael@0 13 frames.pop();
michael@0 14 assertEq(frame, dbg.getNewestFrame());
michael@0 15 }
michael@0 16 } + ")()");
michael@0 17
michael@0 18 function f(n) {
michael@0 19 debugger;
michael@0 20 n--;
michael@0 21 if (n > 0) {
michael@0 22 f(n);
michael@0 23 } else {
michael@0 24 assertEq(g.frames.length, 10);
michael@0 25 throw "fit";
michael@0 26 }
michael@0 27 }
michael@0 28 try {
michael@0 29 f(10);
michael@0 30 assertEq(0, 1);
michael@0 31 } catch (e) {
michael@0 32 assertEq(e, "fit");
michael@0 33 }
michael@0 34 assertEq(g.frames.length, 0);

mercurial