| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'RegExp_leftContext_as_array.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 |
startTest(); |
| 19 |
var TITLE = 'RegExp: $`'; |
| 20 |
|
| 21 |
writeHeaderToLog('Executing script: RegExp_leftContext_as_array.js'); |
| 22 |
writeHeaderToLog( SECTION + " "+ TITLE); |
| 23 |
|
| 24 |
|
| 25 |
'abc123xyz'.match(/123/); |
| 26 |
new TestCase ( SECTION, "'abc123xyz'.match(/123/); RegExp['$`']", |
| 27 |
'abc', RegExp['$`']); |
| 28 |
|
| 29 |
|
| 30 |
'abc123xyz'.match(/456/); |
| 31 |
new TestCase ( SECTION, "'abc123xyz'.match(/456/); RegExp['$`']", |
| 32 |
'abc', RegExp['$`']); |
| 33 |
|
| 34 |
|
| 35 |
'abc123xyz'.match(/abc123xyz/); |
| 36 |
new TestCase ( SECTION, "'abc123xyz'.match(/abc123xyz/); RegExp['$`']", |
| 37 |
'', RegExp['$`']); |
| 38 |
|
| 39 |
|
| 40 |
'xxxx'.match(/$/); |
| 41 |
new TestCase ( SECTION, "'xxxx'.match(/$/); RegExp['$`']", |
| 42 |
'xxxx', RegExp['$`']); |
| 43 |
|
| 44 |
|
| 45 |
'test'.match(/^/); |
| 46 |
new TestCase ( SECTION, "'test'.match(/^/); RegExp['$`']", |
| 47 |
'', RegExp['$`']); |
| 48 |
|
| 49 |
|
| 50 |
'xxxx'.match(new RegExp('$')); |
| 51 |
new TestCase ( SECTION, "'xxxx'.match(new RegExp('$')); RegExp['$`']", |
| 52 |
'xxxx', RegExp['$`']); |
| 53 |
|
| 54 |
|
| 55 |
'test'.match(new RegExp('^')); |
| 56 |
new TestCase ( SECTION, "'test'.match(new RegExp('^')); RegExp['$`']", |
| 57 |
'', RegExp['$`']); |
| 58 |
|
| 59 |
test(); |