js/src/tests/js1_2/regexp/RegExp_lastIndex.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 // |reftest| skip -- obsolete test
     2 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     3 /* This Source Code Form is subject to the terms of the Mozilla Public
     4  * License, v. 2.0. If a copy of the MPL was not distributed with this
     5  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     8 /**
     9    Filename:     RegExp_lastIndex.js
    10    Description:  'Tests RegExps lastIndex property'
    12    Author:       Nick Lerissa
    13    Date:         March 17, 1998
    14 */
    16 var SECTION = 'As described in Netscape doc "Whats new in JavaScript 1.2"';
    17 var VERSION = 'no version';
    18 var TITLE   = 'RegExp: lastIndex';
    19 var BUGNUMBER="123802";
    21 startTest();
    22 writeHeaderToLog('Executing script: RegExp_lastIndex.js');
    23 writeHeaderToLog( SECTION + " "+ TITLE);
    25 // re=/x./g; re.lastIndex=4; re.exec('xyabcdxa');
    26 re=/x./g;
    27 re.lastIndex=4;
    28 new TestCase ( SECTION, "re=/x./g; re.lastIndex=4; re.exec('xyabcdxa')",
    29 	       '["xa"]', String(re.exec('xyabcdxa')));
    31 // re.lastIndex
    32 new TestCase ( SECTION, "re.lastIndex",
    33 	       8, re.lastIndex);
    35 // re.exec('xyabcdef');
    36 new TestCase ( SECTION, "re.exec('xyabcdef')",
    37 	       null, re.exec('xyabcdef'));
    39 // re.lastIndex
    40 new TestCase ( SECTION, "re.lastIndex",
    41 	       0, re.lastIndex);
    43 // re.exec('xyabcdef');
    44 new TestCase ( SECTION, "re.exec('xyabcdef')",
    45 	       '["xy"]', String(re.exec('xyabcdef')));
    47 // re.lastIndex=30; re.exec('123xaxbxc456');
    48 re.lastIndex=30;
    49 new TestCase ( SECTION, "re.lastIndex=30; re.exec('123xaxbxc456')",
    50 	       null, re.exec('123xaxbxc456'));
    52 test();

mercurial