Thu, 15 Jan 2015 15:59:08 +0100
Implement a real Private Browsing Mode condition by changing the API/ABI;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
1 // Within a series of evals and calls, all their frames' scripts appear in findScripts' result.
2 var g = newGlobal();
3 var dbg = new Debugger(g);
4 var log;
6 g.check = function () {
7 log += 'c';
8 var scripts = dbg.findScripts();
10 var innerEvalFrame = dbg.getNewestFrame();
11 assertEq(innerEvalFrame.type, "eval");
12 assertEq(scripts.indexOf(innerEvalFrame.script) != -1, true);
14 var callFrame = innerEvalFrame.older;
15 assertEq(callFrame.type, "call");
16 assertEq(scripts.indexOf(callFrame.script) != -1, true);
18 var outerEvalFrame = callFrame.older;
19 assertEq(outerEvalFrame.type, "eval");
20 assertEq(scripts.indexOf(outerEvalFrame.script) != -1, true);
21 assertEq(innerEvalFrame != outerEvalFrame, true);
22 };
24 g.eval('function f() { eval("check();") }');
25 log = '';
26 g.eval('f();');
27 assertEq(log, 'c');