js/src/tests/js1_2/regexp/source.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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:     source.js
     9    Description:  'Tests RegExp attribute source'
    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: source';
    20 writeHeaderToLog('Executing script: source.js');
    21 writeHeaderToLog( SECTION + " "+ TITLE);
    24 // /xyz/g.source
    25 new TestCase ( SECTION, "/xyz/g.source",
    26 	       "xyz", /xyz/g.source);
    28 // /xyz/.source
    29 new TestCase ( SECTION, "/xyz/.source",
    30 	       "xyz", /xyz/.source);
    32 // /abc\\def/.source
    33 new TestCase ( SECTION, "/abc\\\\def/.source",
    34 	       "abc\\\\def", /abc\\def/.source);
    36 // /abc[\b]def/.source
    37 new TestCase ( SECTION, "/abc[\\b]def/.source",
    38 	       "abc[\\b]def", /abc[\b]def/.source);
    40 // (new RegExp('xyz')).source
    41 new TestCase ( SECTION, "(new RegExp('xyz')).source",
    42 	       "xyz", (new RegExp('xyz')).source);
    44 // (new RegExp('xyz','g')).source
    45 new TestCase ( SECTION, "(new RegExp('xyz','g')).source",
    46 	       "xyz", (new RegExp('xyz','g')).source);
    48 // (new RegExp('abc\\\\def')).source
    49 new TestCase ( SECTION, "(new RegExp('abc\\\\\\\\def')).source",
    50 	       "abc\\\\def", (new RegExp('abc\\\\def')).source);
    52 // (new RegExp('abc[\\b]def')).source
    53 new TestCase ( SECTION, "(new RegExp('abc[\\\\b]def')).source",
    54 	       "abc[\\b]def", (new RegExp('abc[\\b]def')).source);
    56 test();

mercurial