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: 18 April 2003
9 * SUMMARY: Testing regexp with many backreferences
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=202564
11 *
12 * Note that in Section 1 below, we expect the 1st and 4th backreferences
13 * to hold |undefined| instead of the empty strings one gets in Perl and IE6.
14 * This is because per ECMA, regexp backreferences must hold |undefined|
15 * if not used. See http://bugzilla.mozilla.org/show_bug.cgi?id=123437.
16 *
17 */
18 //-----------------------------------------------------------------------------
19 var i = 0;
20 var BUGNUMBER = 202564;
21 var summary = 'Testing regexp with many backreferences';
22 var status = '';
23 var statusmessages = new Array();
24 var pattern = '';
25 var patterns = new Array();
26 var string = '';
27 var strings = new Array();
28 var actualmatch = '';
29 var actualmatches = new Array();
30 var expectedmatch = '';
31 var expectedmatches = new Array();
34 status = inSection(1);
35 string = 'Seattle, WA to Buckley, WA';
36 pattern = /(?:(.+), )?(.+), (..) to (?:(.+), )?(.+), (..)/;
37 actualmatch = string.match(pattern);
38 expectedmatch = Array(string, undefined, "Seattle", "WA", undefined, "Buckley", "WA");
39 addThis();
43 //-----------------------------------------------------------------------------
44 test();
45 //-----------------------------------------------------------------------------
49 function addThis()
50 {
51 statusmessages[i] = status;
52 patterns[i] = pattern;
53 strings[i] = string;
54 actualmatches[i] = actualmatch;
55 expectedmatches[i] = expectedmatch;
56 i++;
57 }
60 function test()
61 {
62 enterFunc ('test');
63 printBugNumber(BUGNUMBER);
64 printStatus (summary);
65 testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
66 exitFunc ('test');
67 }