|
1 // |jit-test| error: TypeError; |
|
2 function printStatus (msg) {} |
|
3 function toPrinted(value) { |
|
4 value = value.replace(/\\n/g, 'NL') |
|
5 } |
|
6 function reportCompare (expected, actual, description) { |
|
7 printStatus ("Expected value '" + toPrinted(expected) + "' matched actual value '" + toPrinted(actual) + "'"); |
|
8 } |
|
9 var UBound = 0; |
|
10 var statusitems = []; |
|
11 var actual = ''; |
|
12 var actualvalues = []; |
|
13 var expect= ''; |
|
14 var expectedvalues = []; |
|
15 testThis('x()'); |
|
16 testThis('"abc"()'); |
|
17 testThis('x()'); |
|
18 testThis('Date(12345)()'); |
|
19 testThis('x()'); |
|
20 testThis('1()'); |
|
21 testThis('x()'); |
|
22 testThis('void(0)()'); |
|
23 testThis('x()'); |
|
24 testThis('[1,2,3,4,5](1)'); |
|
25 gczeal(4); |
|
26 testThis('x(1)'); |
|
27 checkThis('(function (y) {return y+1;})("abc")'); |
|
28 checkThis('f("abc")'); |
|
29 function testThis(sInvalidSyntax) { |
|
30 expectedvalues[UBound] = expect; |
|
31 actualvalues[UBound] = actual; |
|
32 UBound++; |
|
33 } |
|
34 function checkThis(sValidSyntax) { |
|
35 for (var i=0; i<UBound; i++) |
|
36 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); |
|
37 } |
|
38 var actualvalues = []; |
|
39 for (var i=0; i<UBound; i++) |
|
40 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); |