js/src/tests/js1_2/regexp/RegExp_lastMatch_as_array.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_lastMatch_as_array.js
     9    Description:  'Tests RegExps $& property (same tests as RegExp_lastMatch.js but using $&)'
    11    Author:       Nick Lerissa
    12    Date:         March 13, 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: $&';
    20 writeHeaderToLog('Executing script: RegExp_lastMatch_as_array.js');
    21 writeHeaderToLog( SECTION + " "+ TITLE);
    24 // 'foo'.match(/foo/); RegExp['$&']
    25 'foo'.match(/foo/);
    26 new TestCase ( SECTION, "'foo'.match(/foo/); RegExp['$&']",
    27 	       'foo', RegExp['$&']);
    29 // 'foo'.match(new RegExp('foo')); RegExp['$&']
    30 'foo'.match(new RegExp('foo'));
    31 new TestCase ( SECTION, "'foo'.match(new RegExp('foo')); RegExp['$&']",
    32 	       'foo', RegExp['$&']);
    34 // 'xxx'.match(/bar/); RegExp['$&']
    35 'xxx'.match(/bar/);
    36 new TestCase ( SECTION, "'xxx'.match(/bar/); RegExp['$&']",
    37 	       'foo', RegExp['$&']);
    39 // 'xxx'.match(/$/); RegExp['$&']
    40 'xxx'.match(/$/);
    41 new TestCase ( SECTION, "'xxx'.match(/$/); RegExp['$&']",
    42 	       '', RegExp['$&']);
    44 // 'abcdefg'.match(/^..(cd)[a-z]+/); RegExp['$&']
    45 'abcdefg'.match(/^..(cd)[a-z]+/);
    46 new TestCase ( SECTION, "'abcdefg'.match(/^..(cd)[a-z]+/); RegExp['$&']",
    47 	       'abcdefg', RegExp['$&']);
    49 // 'abcdefgabcdefg'.match(/(a(b(c(d)e)f)g)\1/); RegExp['$&']
    50 'abcdefgabcdefg'.match(/(a(b(c(d)e)f)g)\1/);
    51 new TestCase ( SECTION, "'abcdefgabcdefg'.match(/(a(b(c(d)e)f)g)\\1/); RegExp['$&']",
    52 	       'abcdefgabcdefg', RegExp['$&']);
    54 test();

mercurial