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/. */
7 /**
8 * File Name: RegExp/octal-001.js
9 * ECMA Section: 15.7.1
10 * Description: Based on ECMA 2 Draft 7 February 1999
11 * Simple test cases for matching OctalEscapeSequences.
12 * Author: christine@netscape.com
13 * Date: 19 February 1999
14 */
15 var SECTION = "RegExp/octal-001.js";
16 var VERSION = "ECMA_2";
17 var TITLE = "RegExp patterns that contain OctalEscapeSequences";
18 var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346196";
20 startTest();
23 // backreference
24 AddRegExpCases(
25 /(.)\1/,
26 "/(.)\\1/",
27 "HI!!",
28 "HI!",
29 2,
30 ["!!", "!"] );
32 test();
34 function AddRegExpCases(
35 regexp, str_regexp, pattern, str_pattern, index, matches_array ) {
37 // prevent a runtime error
39 if ( regexp.exec(pattern) == null || matches_array == null ) {
40 AddTestCase(
41 regexp + ".exec(" + str_pattern +")",
42 matches_array,
43 regexp.exec(pattern) );
45 return;
46 }
47 AddTestCase(
48 str_regexp + ".exec(" + str_pattern +").length",
49 matches_array.length,
50 regexp.exec(pattern).length );
52 AddTestCase(
53 str_regexp + ".exec(" + str_pattern +").index",
54 index,
55 regexp.exec(pattern).index );
57 AddTestCase(
58 str_regexp + ".exec(" + str_pattern +").input",
59 pattern,
60 regexp.exec(pattern).input );
62 AddTestCase(
63 str_regexp + ".exec(" + str_pattern +").toString()",
64 matches_array.toString(),
65 regexp.exec(pattern).toString() );
66 /*
67 var limit = matches_array.length > regexp.exec(pattern).length
68 ? matches_array.length
69 : regexp.exec(pattern).length;
71 for ( var matches = 0; matches < limit; matches++ ) {
72 AddTestCase(
73 str_regexp + ".exec(" + str_pattern +")[" + matches +"]",
74 matches_array[matches],
75 regexp.exec(pattern)[matches] );
76 }
77 */
78 }