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 // Error().stack (ScriptFrameIter) is no longer context-bound.
2 function beta() {
3 evaluate("function gamma() {\nstack = Error().stack;\n };\n gamma();", {newContext: true});
4 }
5 function alpha() {
6 beta();
7 }
8 alpha();
9 assertEq(/alpha@/.test(stack), true);
10 assertEq(/beta@/.test(stack), true);
11 assertEq(/gamma@/.test(stack), true);
12 assertEq(/delta@/.test(stack), false);
14 function delta() {
15 evaluate("stack = Error().stack", {newContext: true});
16 }
17 delta();
18 assertEq(/alpha@/.test(stack), false);
19 assertEq(/beta@/.test(stack), false);
20 assertEq(/gamma@/.test(stack), false);
21 assertEq(/delta@/.test(stack), true);