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 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 //-----------------------------------------------------------------------------
7 // this test originally was only seen if typed into the js shell.
8 // loading as a script file did not exhibit the problem.
9 // this test case may not exercise the problem properly.
11 var BUGNUMBER = 254974;
12 var summary = 'all var and arg properties should be JSPROP_SHARED';
13 var actual = '';
14 var expect = '';
16 printBugNumber(BUGNUMBER);
17 printStatus (summary);
19 function testfunc(tokens) {
20 function eek(y) {} /* remove function eek and the code will change its behavior */
21 return tokens.split(/\]?(?:\[|$)/).shift();
22 }
23 bad=testfunc;
24 function testfunc(tokens) {
25 return tokens.split(/\]?(?:\[|$)/).shift();
26 }
27 good=testfunc;
29 var goodvalue = good("DIV[@id=\"test\"]");
30 var badvalue = bad("DIV[@id=\"test\"]");
32 printStatus(goodvalue);
33 printStatus(badvalue);
35 expect = goodvalue;
36 actual = badvalue;
38 reportCompare(expect, actual, summary);