js/src/tests/ecma_3/RegExp/regress-375711.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 var BUGNUMBER = 375711;
     8 var summary = 'Do not assert with /[Q-b]/i.exec("")';
     9 var actual = '';
    10 var expect = '';
    13 //-----------------------------------------------------------------------------
    14 test();
    15 //-----------------------------------------------------------------------------
    17 function test()
    18 {
    19   enterFunc ('test');
    20   printBugNumber(BUGNUMBER);
    21   printStatus (summary);
    23   var s;
    25   // see bug 416933
    26   print('see bug 416933 for changed behavior on Gecko 1.9');
    28   try
    29   {
    30     s = '/[Q-b]/.exec("")';
    31     expect = 'No Error';
    32     print(s + ' expect ' + expect);
    33     eval(s);
    34     actual = 'No Error';
    35   }
    36   catch(ex)
    37   {
    38     actual = ex + '';
    39   }
    40   reportCompare(expect, actual, summary + ': ' + s);
    42   try
    43   {
    44     s ='/[Q-b]/i.exec("")';
    45     expect = 'No Error';
    46     print(s + ' expect ' + expect);
    47     eval(s);
    48     actual = 'No Error';
    49   }
    50   catch(ex)
    51   {
    52     actual = ex + '';
    53   }
    54   reportCompare(expect, actual, summary + ': ' + s);
    56   try
    57   {
    58     s = '/[q-b]/.exec("")';
    59     expect = 'SyntaxError: invalid range in character class';
    60     print(s + ' expect ' + expect);
    61     eval(s);
    62     actual = 'No Error';
    63   }
    64   catch(ex)
    65   {
    66     actual = ex + '';
    67   }
    68   reportCompare(expect, actual, summary + ': ' + s);
    70   try
    71   {
    72     s ='/[q-b]/i.exec("")';
    73     expect = 'SyntaxError: invalid range in character class';
    74     print(s + ' expect ' + expect);
    75     eval(s);
    76     actual = 'No Error';
    77   }
    78   catch(ex)
    79   {
    80     actual = ex + '';
    81   }
    82   reportCompare(expect, actual, summary + ': ' + s);
    84   exitFunc ('test');
    85 }

mercurial