js/src/tests/ecma_3/RegExp/regress-169534.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:    20 Sep 2002
     9  * SUMMARY: RegExp conformance test
    10  * See http://bugzilla.mozilla.org/show_bug.cgi?id=169534
    11  *
    12  */
    13 //-----------------------------------------------------------------------------
    14 var UBound = 0;
    15 var BUGNUMBER = 169534;
    16 var summary = 'RegExp conformance test';
    17 var status = '';
    18 var statusitems = [];
    19 var actual = '';
    20 var actualvalues = [];
    21 var expect= '';
    22 var expectedvalues = [];
    25 status = inSection(1);
    26 var re = /(\|)([\w\x81-\xff ]*)(\|)([\/a-z][\w:\/\.]*\.[a-z]{3,4})(\|)/ig;
    27 var str = "To sign up click |here|https://www.xxxx.org/subscribe.htm|";
    28 actual = str.replace(re, '<a href="$4">$2</a>');
    29 expect = 'To sign up click <a href="https://www.xxxx.org/subscribe.htm">here</a>';
    30 addThis();
    34 //-----------------------------------------------------------------------------
    35 test();
    36 //-----------------------------------------------------------------------------
    40 function addThis()
    41 {
    42   statusitems[UBound] = status;
    43   actualvalues[UBound] = actual;
    44   expectedvalues[UBound] = expect;
    45   UBound++;
    46 }
    49 function test()
    50 {
    51   enterFunc('test');
    52   printBugNumber(BUGNUMBER);
    53   printStatus(summary);
    55   for (var i=0; i<UBound; i++)
    56   {
    57     reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
    58   }
    60   exitFunc ('test');
    61 }

mercurial