| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'RegExp_lastIndex.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 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"; |
| 20 |
|
| 21 |
startTest(); |
| 22 |
writeHeaderToLog('Executing script: RegExp_lastIndex.js'); |
| 23 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 24 |
|
| 25 |
|
| 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'))); |
| 30 |
|
| 31 |
|
| 32 |
new TestCase ( SECTION, "re.lastIndex", |
| 33 |
8, re.lastIndex); |
| 34 |
|
| 35 |
|
| 36 |
new TestCase ( SECTION, "re.exec('xyabcdef')", |
| 37 |
null, re.exec('xyabcdef')); |
| 38 |
|
| 39 |
|
| 40 |
new TestCase ( SECTION, "re.lastIndex", |
| 41 |
0, re.lastIndex); |
| 42 |
|
| 43 |
|
| 44 |
new TestCase ( SECTION, "re.exec('xyabcdef')", |
| 45 |
'["xy"]', String(re.exec('xyabcdef'))); |
| 46 |
|
| 47 |
|
| 48 |
re.lastIndex=30; |
| 49 |
new TestCase ( SECTION, "re.lastIndex=30; re.exec('123xaxbxc456')", |
| 50 |
null, re.exec('123xaxbxc456')); |
| 51 |
|
| 52 |
test(); |