Sat, 03 Jan 2015 20:18:00 +0100
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.
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 *
8 * Date: 30 January 2003
9 * SUMMARY: Testing |this[name]| via Function.prototype.call(), apply()
10 *
11 * See http://bugzilla.mozilla.org/show_bug.cgi?id=191276
12 *
13 * Igor: "This script fails when run in Rhino compiled mode, but passes in
14 * interpreted mode. Note that presence of the never-called |unused_function|
15 * with |f('a')| line is essential; the script works OK without it."
16 *
17 */
18 //-----------------------------------------------------------------------------
19 var UBound = 0;
20 var BUGNUMBER = 191276;
21 var summary = 'Testing |this[name]| via Function.prototype.call(), apply()';
22 var status = '';
23 var statusitems = [];
24 var actual = '';
25 var actualvalues = [];
26 var expect= '';
27 var expectedvalues = [];
30 function F(name)
31 {
32 return this[name];
33 }
35 function unused_function()
36 {
37 F('a');
38 }
40 status = inSection(1);
41 actual = F.call({a: 'aaa'}, 'a');
42 expect = 'aaa';
43 addThis();
45 status = inSection(2);
46 actual = F.apply({a: 'aaa'}, ['a']);
47 expect = 'aaa';
48 addThis();
50 /*
51 * Try the same things with an object variable instead of a literal
52 */
53 var obj = {a: 'aaa'};
55 status = inSection(3);
56 actual = F.call(obj, 'a');
57 expect = 'aaa';
58 addThis();
60 status = inSection(4);
61 actual = F.apply(obj, ['a']);
62 expect = 'aaa';
63 addThis();
67 //-----------------------------------------------------------------------------
68 test();
69 //-----------------------------------------------------------------------------
73 function addThis()
74 {
75 statusitems[UBound] = status;
76 actualvalues[UBound] = actual;
77 expectedvalues[UBound] = expect;
78 UBound++;
79 }
82 function test()
83 {
84 enterFunc('test');
85 printBugNumber(BUGNUMBER);
86 printStatus(summary);
88 for (var i=0; i<UBound; i++)
89 {
90 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
91 }
93 exitFunc ('test');
94 }