js/src/tests/ecma_3_1/RegExp/regress-305064.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 // |reftest| fails
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     7 //-----------------------------------------------------------------------------
     8 var BUGNUMBER = 305064;
     9 var summary = 'CharacterClassEscape \\s';
    10 var actual = '';
    11 var expect = '';
    13 //-----------------------------------------------------------------------------
    14 test();
    15 //-----------------------------------------------------------------------------
    17 function test()
    18 {
    19   enterFunc ('test');
    20   printBugNumber(BUGNUMBER);
    21   printStatus (summary);
    23   /** List from ES 3.1 Recommendation for String.trim (bug 305064) **/
    24   var whitespace = [
    25     {s : '\u0009', t : 'HORIZONTAL TAB'},
    26     {s : '\u000B', t : 'VERTICAL TAB'},
    27     {s : '\u000C', t : 'FORMFEED'},
    28     {s : '\u0020', t : 'SPACE'},
    29     {s : '\u00A0', t : 'NO-BREAK SPACE'},
    30     {s : '\u1680', t : 'OGHAM SPACE MARK'},
    31     {s : '\u180E', t : 'MONGOLIAN VOWEL SEPARATOR'},
    32     {s : '\u2000', t : 'EN QUAD'},
    33     {s : '\u2001', t : 'EM QUAD'},
    34     {s : '\u2002', t : 'EN SPACE'},
    35     {s : '\u2003', t : 'EM SPACE'},
    36     {s : '\u2004', t : 'THREE-PER-EM SPACE'},
    37     {s : '\u2005', t : 'FOUR-PER-EM SPACE'},
    38     {s : '\u2006', t : 'SIX-PER-EM SPACE'},
    39     {s : '\u2007', t : 'FIGURE SPACE'},
    40     {s : '\u2008', t : 'PUNCTUATION SPACE'},
    41     {s : '\u2009', t : 'THIN SPACE'},
    42     {s : '\u200A', t : 'HAIR SPACE'},
    43     {s : '\u202F', t : 'NARROW NO-BREAK SPACE'},
    44     {s : '\u205F', t : 'MEDIUM MATHEMATICAL SPACE'},
    45     {s : '\u3000', t : 'IDEOGRAPHIC SPACE'},
    46     {s : '\u000A', t : 'LINE FEED OR NEW LINE'},
    47     {s : '\u000D', t : 'CARRIAGE RETURN'},
    48     {s : '\u2028', t : 'LINE SEPARATOR'},
    49     {s : '\u2029', t : 'PARAGRAPH SEPARATOR'},
    50     {s : '\u200B', t : 'ZERO WIDTH SPACE (category Cf)'}
    51     ];
    53   for (var i = 0; i < whitespace.length; ++i)
    54   {
    55     var v = whitespace[i];
    56     reportCompare(true, !!(/\s/.test(v.s)), 'Is ' + v.t + ' a space');
    57   }
    59   exitFunc ('test');
    60 }

mercurial