js/src/tests/js1_2/regexp/RegExp_dollar_number.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/. */
     7 /**
     8    Filename:     RegExp_dollar_number.js
     9    Description:  'Tests RegExps $1, ..., $9 properties'
    11    Author:       Nick Lerissa
    12    Date:         March 12, 1998
    13 */
    15 var SECTION = 'As described in Netscape doc "What\'s new in JavaScript 1.2"';
    16 var VERSION = 'no version';
    17 var TITLE   = 'RegExp: $1, ..., $9';
    18 var BUGNUMBER="123802";
    20 startTest();
    21 writeHeaderToLog('Executing script: RegExp_dollar_number.js');
    22 writeHeaderToLog( SECTION + " "+ TITLE);
    25 // 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$1
    26 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/);
    27 new TestCase ( SECTION, "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$1",
    28 	       'abcdefghi', RegExp.$1);
    30 // 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$2
    31 new TestCase ( SECTION, "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$2",
    32 	       'bcdefgh', RegExp.$2);
    34 // 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$3
    35 new TestCase ( SECTION, "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$3",
    36 	       'cdefg', RegExp.$3);
    38 // 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$4
    39 new TestCase ( SECTION, "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$4",
    40 	       'def', RegExp.$4);
    42 // 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$5
    43 new TestCase ( SECTION, "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$5",
    44 	       'e', RegExp.$5);
    46 // 'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$6
    47 new TestCase ( SECTION, "'abcdefghi'.match(/(a(b(c(d(e)f)g)h)i)/); RegExp.$6",
    48 	       '', RegExp.$6);
    50 var a_to_z = 'abcdefghijklmnopqrstuvwxyz';
    51 var regexp1 = /(a)b(c)d(e)f(g)h(i)j(k)l(m)n(o)p(q)r(s)t(u)v(w)x(y)z/
    52   // 'abcdefghijklmnopqrstuvwxyz'.match(/(a)b(c)d(e)f(g)h(i)j(k)l(m)n(o)p(q)r(s)t(u)v(w)x(y)z/); RegExp.$1
    53   a_to_z.match(regexp1);
    55 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$1",
    56 	       'a', RegExp.$1);
    57 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$2",
    58 	       'c', RegExp.$2);
    59 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$3",
    60 	       'e', RegExp.$3);
    61 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$4",
    62 	       'g', RegExp.$4);
    63 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$5",
    64 	       'i', RegExp.$5);
    65 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$6",
    66 	       'k', RegExp.$6);
    67 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$7",
    68 	       'm', RegExp.$7);
    69 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$8",
    70 	       'o', RegExp.$8);
    71 new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$9",
    72 	       'q', RegExp.$9);
    73 /*
    74   new TestCase ( SECTION, "'" + a_to_z + "'.match((a)b(c)....(y)z); RegExp.$10",
    75   's', RegExp.$10);
    76 */
    77 test();

mercurial