| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'regress-001.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
var SECTION = "RegExp/hex-001.js"; |
| 19 |
var VERSION = "ECMA_2"; |
| 20 |
var TITLE = "JS regexp anchoring on empty match bug"; |
| 21 |
var BUGNUMBER = "2157"; |
| 22 |
|
| 23 |
startTest(); |
| 24 |
|
| 25 |
AddRegExpCases( /a||b/(''), |
| 26 |
"//a||b/('')", |
| 27 |
1, |
| 28 |
[''] ); |
| 29 |
|
| 30 |
test(); |
| 31 |
|
| 32 |
function AddRegExpCases( regexp, str_regexp, length, matches_array ) { |
| 33 |
|
| 34 |
AddTestCase( |
| 35 |
"( " + str_regexp + " ).length", |
| 36 |
regexp.length, |
| 37 |
regexp.length ); |
| 38 |
|
| 39 |
|
| 40 |
for ( var matches = 0; matches < matches_array.length; matches++ ) { |
| 41 |
AddTestCase( |
| 42 |
"( " + str_regexp + " )[" + matches +"]", |
| 43 |
matches_array[matches], |
| 44 |
regexp[matches] ); |
| 45 |
} |
| 46 |
} |