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: 10 December 2001
9 * SUMMARY: Regression test for bug 114491
10 * See http://bugzilla.mozilla.org/show_bug.cgi?id=114491
11 *
12 * Rhino crashed on this code. It should produce a syntax error, not a crash.
13 * Using the () operator after a function STATEMENT is incorrect syntax.
14 * Rhino correctly caught the error when there was no |if (true)|.
15 * With the |if (true)|, however, Rhino crashed -
16 *
17 */
18 //-----------------------------------------------------------------------------
19 var UBound = 0;
20 var BUGNUMBER = 114491;
21 var summary = 'Regression test for bug 114491';
22 var status = '';
23 var statusitems = [];
24 var actual = '';
25 var actualvalues = [];
26 var expect= '';
27 var expectedvalues = [];
30 status = inSection(1);
31 actual = 'Program execution did NOT fall into catch-block';
32 expect = 'Program execution fell into into catch-block';
33 try
34 {
35 var sEval = 'if (true) function f(){}()';
36 eval(sEval);
37 }
38 catch(e)
39 {
40 actual = expect;
41 }
42 addThis();
46 //-----------------------------------------------------------------------------
47 test();
48 //-----------------------------------------------------------------------------
51 function addThis()
52 {
53 statusitems[UBound] = status;
54 actualvalues[UBound] = actual;
55 expectedvalues[UBound] = expect;
56 UBound++;
57 }
60 function test()
61 {
62 enterFunc ('test');
63 printBugNumber(BUGNUMBER);
64 printStatus (summary);
66 for (var i = 0; i < UBound; i++)
67 {
68 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
69 }
71 exitFunc ('test');
72 }