| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
gTestfile = 'octal-001.js'; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
var SECTION = "RegExp/octal-001.js"; |
| 17 |
var VERSION = "ECMA_2"; |
| 18 |
var TITLE = "RegExp patterns that contain OctalEscapeSequences"; |
| 19 |
var BUGNUMBER="http://scopus/bugsplat/show_bug.cgi?id=346196"; |
| 20 |
|
| 21 |
startTest(); |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
AddRegExpCases( |
| 26 |
/(.)\1/, |
| 27 |
"/(.)\\1/", |
| 28 |
"HI!!", |
| 29 |
"HI!", |
| 30 |
2, |
| 31 |
["!!", "!"] ); |
| 32 |
|
| 33 |
test(); |
| 34 |
|
| 35 |
function AddRegExpCases( |
| 36 |
regexp, str_regexp, pattern, str_pattern, index, matches_array ) { |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
if ( regexp.exec(pattern) == null || matches_array == null ) { |
| 41 |
AddTestCase( |
| 42 |
regexp + ".exec(" + str_pattern +")", |
| 43 |
matches_array, |
| 44 |
regexp.exec(pattern) ); |
| 45 |
|
| 46 |
return; |
| 47 |
} |
| 48 |
AddTestCase( |
| 49 |
str_regexp + ".exec(" + str_pattern +").length", |
| 50 |
matches_array.length, |
| 51 |
regexp.exec(pattern).length ); |
| 52 |
|
| 53 |
AddTestCase( |
| 54 |
str_regexp + ".exec(" + str_pattern +").index", |
| 55 |
index, |
| 56 |
regexp.exec(pattern).index ); |
| 57 |
|
| 58 |
AddTestCase( |
| 59 |
str_regexp + ".exec(" + str_pattern +").input", |
| 60 |
pattern, |
| 61 |
regexp.exec(pattern).input ); |
| 62 |
|
| 63 |
AddTestCase( |
| 64 |
str_regexp + ".exec(" + str_pattern +").toString()", |
| 65 |
matches_array.toString(), |
| 66 |
regexp.exec(pattern).toString() ); |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
} |