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: 09 November 2002
9 * SUMMARY: JS should treat --> as a single-line comment indicator.
10 * Whitespace may occur before the --> on the same line.
11 *
12 * See http://bugzilla.mozilla.org/show_bug.cgi?id=31255
13 * and http://bugzilla.mozilla.org/show_bug.cgi?id=179366 (Rhino version)
14 *
15 * Note: <!--, --> are the HTML multi-line comment opener, closer.
16 * JS already accepted <!-- as a single-line comment indicator.
17 *
18 */
19 //-----------------------------------------------------------------------------
20 var UBound = 0;
21 var BUGNUMBER = 31255;
22 var summary = 'JS should treat --> as a single-line comment indicator';
23 var status = '';
24 var statusitems = [];
25 var actual = '';
26 var actualvalues = [];
27 var expect= '';
28 var expectedvalues = [];
31 <!-- HTML comment start is already a single-line JS comment indicator
32 var x = 1; <!-- until end-of-line
34 status = inSection(1);
35 actual = (x == 1);
36 expect = true;
37 addThis();
39 --> HTML comment end is JS comments until end-of-line
40 --> but only if it follows a possible whitespace after line start
41 --> so in the following --> should not be treated as comments
42 if (x-->0)
43 x = 2;
45 status = inSection(2);
46 actual = (x == 2);
47 expect = true;
48 addThis();
52 //-----------------------------------------------------------------------------
53 test();
54 //-----------------------------------------------------------------------------
58 function addThis()
59 {
60 statusitems[UBound] = status;
61 actualvalues[UBound] = actual;
62 expectedvalues[UBound] = expect;
63 UBound++;
64 }
67 function test()
68 {
69 enterFunc('test');
70 printBugNumber(BUGNUMBER);
71 printStatus(summary);
73 for (var i=0; i<UBound; i++)
74 {
75 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
76 }
78 exitFunc ('test');
79 }