js/src/tests/js1_2/regexp/RegExp_lastParen.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_lastParen.js
     9    Description:  'Tests RegExps lastParen property'
    11    Author:       Nick Lerissa
    12    Date:         March 12, 1998
    13 */
    15 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
    16 var VERSION = 'no version';
    17 startTest();
    18 var TITLE   = 'RegExp: lastParen';
    20 writeHeaderToLog('Executing script: RegExp_lastParen.js');
    21 writeHeaderToLog( SECTION + " "+ TITLE);
    23 // 'abcd'.match(/(abc)d/); RegExp.lastParen
    24 'abcd'.match(/(abc)d/);
    25 new TestCase ( SECTION, "'abcd'.match(/(abc)d/); RegExp.lastParen",
    26 	       'abc', RegExp.lastParen);
    28 // 'abcd'.match(new RegExp('(abc)d')); RegExp.lastParen
    29 'abcd'.match(new RegExp('(abc)d'));
    30 new TestCase ( SECTION, "'abcd'.match(new RegExp('(abc)d')); RegExp.lastParen",
    31 	       'abc', RegExp.lastParen);
    33 // 'abcd'.match(/(bcd)e/); RegExp.lastParen
    34 'abcd'.match(/(bcd)e/);
    35 new TestCase ( SECTION, "'abcd'.match(/(bcd)e/); RegExp.lastParen",
    36 	       'abc', RegExp.lastParen);
    38 // 'abcdefg'.match(/(a(b(c(d)e)f)g)/); RegExp.lastParen
    39 'abcdefg'.match(/(a(b(c(d)e)f)g)/);
    40 new TestCase ( SECTION, "'abcdefg'.match(/(a(b(c(d)e)f)g)/); RegExp.lastParen",
    41 	       'd', RegExp.lastParen);
    43 // 'abcdefg'.match(/(a(b)c)(d(e)f)/); RegExp.lastParen
    44 'abcdefg'.match(/(a(b)c)(d(e)f)/);
    45 new TestCase ( SECTION, "'abcdefg'.match(/(a(b)c)(d(e)f)/); RegExp.lastParen",
    46 	       'e', RegExp.lastParen);
    48 // 'abcdefg'.match(/(^)abc/); RegExp.lastParen
    49 'abcdefg'.match(/(^)abc/);
    50 new TestCase ( SECTION, "'abcdefg'.match(/(^)abc/); RegExp.lastParen",
    51 	       '', RegExp.lastParen);
    53 // 'abcdefg'.match(/(^a)bc/); RegExp.lastParen
    54 'abcdefg'.match(/(^a)bc/);
    55 new TestCase ( SECTION, "'abcdefg'.match(/(^a)bc/); RegExp.lastParen",
    56 	       'a', RegExp.lastParen);
    58 // 'abcdefg'.match(new RegExp('(^a)bc')); RegExp.lastParen
    59 'abcdefg'.match(new RegExp('(^a)bc'));
    60 new TestCase ( SECTION, "'abcdefg'.match(new RegExp('(^a)bc')); RegExp.lastParen",
    61 	       'a', RegExp.lastParen);
    63 // 'abcdefg'.match(/bc/); RegExp.lastParen
    64 'abcdefg'.match(/bc/);
    65 new TestCase ( SECTION, "'abcdefg'.match(/bc/); RegExp.lastParen",
    66 	       '', RegExp.lastParen);
    68 test();

mercurial