js/src/tests/ecma_3/RegExp/regress-223535.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  *
     8  * Date:    24 October 2003
     9  * SUMMARY: Testing regexps with empty alternatives
    10  *
    11  * See http://bugzilla.mozilla.org/show_bug.cgi?id=223535
    12  *
    13  */
    14 //-----------------------------------------------------------------------------
    15 var i = 0;
    16 var BUGNUMBER = 223535;
    17 var summary = 'Testing regexps with empty alternatives';
    18 var status = '';
    19 var statusmessages = new Array();
    20 var pattern = '';
    21 var patterns = new Array();
    22 var string = '';
    23 var strings = new Array();
    24 var actualmatch = '';
    25 var actualmatches = new Array();
    26 var expectedmatch = '';
    27 var expectedmatches = new Array();
    30 string = 'a';
    31 status = inSection(1);
    32 pattern = /a|/;
    33 actualmatch = string.match(pattern);
    34 expectedmatch = Array('a');
    35 addThis();
    37 status = inSection(2);
    38 pattern = /|a/;
    39 actualmatch = string.match(pattern);
    40 expectedmatch = Array('');
    41 addThis();
    43 status = inSection(3);
    44 pattern = /|/;
    45 actualmatch = string.match(pattern);
    46 expectedmatch = Array('');
    47 addThis();
    49 status = inSection(4);
    50 pattern = /(a|)/;
    51 actualmatch = string.match(pattern);
    52 expectedmatch = Array('a', 'a');
    53 addThis();
    55 status = inSection(5);
    56 pattern = /(a||)/;
    57 actualmatch = string.match(pattern);
    58 expectedmatch = Array('a', 'a');
    59 addThis();
    61 status = inSection(6);
    62 pattern = /(|a)/;
    63 actualmatch = string.match(pattern);
    64 expectedmatch = Array('', '');
    65 addThis();
    67 status = inSection(7);
    68 pattern = /(|a|)/;
    69 actualmatch = string.match(pattern);
    70 expectedmatch = Array('', '');
    71 addThis();
    75 //-------------------------------------------------------------------------------------------------
    76 test();
    77 //-------------------------------------------------------------------------------------------------
    81 function addThis()
    82 {
    83   statusmessages[i] = status;
    84   patterns[i] = pattern;
    85   strings[i] = string;
    86   actualmatches[i] = actualmatch;
    87   expectedmatches[i] = expectedmatch;
    88   i++;
    89 }
    92 function test()
    93 {
    94   enterFunc ('test');
    95   printBugNumber(BUGNUMBER);
    96   printStatus (summary);
    97   testRegExp(statusmessages, patterns, strings, actualmatches, expectedmatches);
    98   exitFunc ('test');
    99 }

mercurial