js/src/tests/ecma_3/RegExp/regress-31316.js

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

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  * Date: 01 May 2001
     8  *
     9  * SUMMARY:  Regression test for Bugzilla bug 31316:
    10  * "Rhino: Regexp matches return garbage"
    11  *
    12  * See http://bugzilla.mozilla.org/show_bug.cgi?id=31316
    13  */
    14 //-----------------------------------------------------------------------------
    15 var i = 0;
    16 var BUGNUMBER = 31316;
    17 var summary = 'Regression test for Bugzilla bug 31316';
    18 var cnEmptyString = '';
    19 var status = '';
    20 var statusmessages = new Array();
    21 var pattern = '';
    22 var patterns = new Array();
    23 var string = '';
    24 var strings = new Array();
    25 var actualmatch = '';
    26 var actualmatches = new Array();
    27 var expectedmatch = '';
    28 var expectedmatches = new Array();
    31 status = inSection(1);
    32 pattern = /<([^\/<>][^<>]*[^\/])>|<([^\/<>])>/;
    33 string = '<p>Some<br />test</p>';
    34 actualmatch = string.match(pattern);
    35 expectedmatch = Array('<p>', undefined, 'p');
    36 addThis();
    39 //-------------------------------------------------------------------------------------------------
    40 test();
    41 //-------------------------------------------------------------------------------------------------
    44 function addThis()
    45 {
    46   statusmessages[i] = status;
    47   patterns[i] = pattern;
    48   strings[i] = string;
    49   actualmatches[i] = actualmatch;
    50   expectedmatches[i] = expectedmatch;
    51   i++;
    52 }
    55 function test()
    56 {
    57   enterFunc ('test');
    58   printBugNumber(BUGNUMBER);
    59   printStatus (summary);
    60   testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
    61   exitFunc ('test');
    62 }

mercurial