summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/auto-regress/bug748119.js
blob: 759db8cb105c107efee1210045182ed1abde42e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
// Binary: cache/js-dbg-32-17af008937e3-linux
// Flags: -m -n -a
//
var lfcode = new Array();
lfcode.push("\
var gTestcases = new Array();\
var gTc = gTestcases.length;\
function TestCase(n, d, e, a) {\
  this.passed = getTestCaseResult(e, a);\
  this.bugnumber = typeof(BUGNUMER) != 'undefined' ? BUGNUMBER : '';\
  gTestcases[gTc++] = this;\
}\
for (var i=0; i<len; i++) {}\
function reportCompare (expected, actual, description) {\
  var testcase = new TestCase(\"unknown-test-name\", description, expected, actual);\
  if (testcase.passed)\
  printStatus (\"Expected match to '\" + toPrinted(expectedRegExp) + \"' matched actual value '\" + toPrinted(actual) + \"'\");\
}\
function getTestCaseResult(expected, actual)\
function stopTest() {}\
");
lfcode.push("\
var UBound = 0;\
var TEST_PASSED = 'SyntaxError';\
var TEST_FAILED = 'Generated an error, but NOT a SyntaxError!';\
var statusitems = [];\
var actualvalues = [];\
var expectedvalues = [];\
testThis(' /a**/ ');\
testThis(' /a***/ ');\
testThis(' /a++/ ');\
testThis(' /a+++/ ');\
testThis(' /a???/ ');\
testThis(' /a????/ ');\
testThis(' /+a/ ');\
testThis(' /++a/ ');\
testThis(' /?a/ ');\
testThis(' /??a/ ');\
testThis(' /x{1}{1}/ ');\
testThis(' /x{1,}{1}/ ');\
testThis(' /x{1,2}{1}/ ');\
testThis(' /x{1}{1,}/ ');\
testThis(' /x{1,}{1,}/ ');\
testThis(' /x{1,2}{1,}/ ');\
testThis(' /x{1}{1,2}/ ');\
testThis(' /x{1,}{1,2}/ ');\
function testThis(sInvalidSyntax) {\
  try {\
    eval(sInvalidSyntax);\
  } catch(e) {\
    actual = TEST_PASSED;\
  }\
}\
function checkThis(sAllowedSyntax) {}\
reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);\
exitFunc ('test');\
");
lfcode.push("gczeal(4);");
lfcode.push("\
var MSG_PATTERN = '\\nregexp = ';\
var MSG_STRING = '\\nstring = ';\
var MSG_EXPECT = '\\nExpect: ';\
var MSG_ACTUAL = '\\nActual: ';\
var TYPE_STRING = typeof 'abc';\
function testRegExp(statuses, patterns, strings, actualmatches, expectedmatches)\
        lExpect = expectedmatch.length;\
        lActual = actualmatch.length;\
        var expected = formatArray(expectedmatch);\
          reportCompare(expected, actual, state + ERR_MATCH +  CHAR_NL  );\
function getState(status, pattern, string) {\
  var delim = CHAR_COMMA + CHAR_SPACE;\
");
lfcode.push("\
var gTestcases = new Array;\
function TestCase(n, d, e, a) {}\
function toPrinted(value) value=value.replace(/\\\\n/g, 'NL').replace(/[^\\x20-\\x7E]+/g, escapeString);\
");
lfcode.push("\
var summary = 'Regression test for bug 385393';\
var expect = 'No Crash';\
  reportCompare(expect, actual, summary);\
");
while (true) {
	var file = lfcode.shift(); if (file == undefined) { break; }
                loadFile(file);
}
function loadFile(lfVarx) {
	try {
		if (lfVarx.substr(-3) == ".js") {
			switch (lfRunTypeId) {			}
		} else {
			evaluate(lfVarx);
		}
	} catch (lfVare) {	}
}