js/src/tests/js1_2/regexp/backspace.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:     backspace.js
     9    Description:  'Tests regular expressions containing [\b]'
    11    Author:       Nick Lerissa
    12    Date:         March 10, 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: [\b]';
    20 writeHeaderToLog('Executing script: backspace.js');
    21 writeHeaderToLog( SECTION + " "+ TITLE);
    23 // 'abc\bdef'.match(new RegExp('.[\b].'))
    24 new TestCase ( SECTION, "'abc\bdef'.match(new RegExp('.[\\b].'))",
    25 	       String(["c\bd"]), String('abc\bdef'.match(new RegExp('.[\\b].'))));
    27 // 'abc\\bdef'.match(new RegExp('.[\b].'))
    28 new TestCase ( SECTION, "'abc\\bdef'.match(new RegExp('.[\\b].'))",
    29 	       null, 'abc\\bdef'.match(new RegExp('.[\\b].')));
    31 // 'abc\b\b\bdef'.match(new RegExp('c[\b]{3}d'))
    32 new TestCase ( SECTION, "'abc\b\b\bdef'.match(new RegExp('c[\\b]{3}d'))",
    33 	       String(["c\b\b\bd"]), String('abc\b\b\bdef'.match(new RegExp('c[\\b]{3}d'))));
    35 // 'abc\bdef'.match(new RegExp('[^\\[\b\\]]+'))
    36 new TestCase ( SECTION, "'abc\bdef'.match(new RegExp('[^\\[\\b\\]]+'))",
    37 	       String(["abc"]), String('abc\bdef'.match(new RegExp('[^\\[\\b\\]]+'))));
    39 // 'abcdef'.match(new RegExp('[^\\[\b\\]]+'))
    40 new TestCase ( SECTION, "'abcdef'.match(new RegExp('[^\\[\\b\\]]+'))",
    41 	       String(["abcdef"]), String('abcdef'.match(new RegExp('[^\\[\\b\\]]+'))));
    43 // 'abcdef'.match(/[^\[\b\]]+/)
    44 new TestCase ( SECTION, "'abcdef'.match(/[^\\[\\b\\]]+/)",
    45 	       String(["abcdef"]), String('abcdef'.match(/[^\[\b\]]+/)));
    47 test();

mercurial