michael@0: // |jit-test| error: TypeError; michael@0: function printStatus (msg) {} michael@0: function toPrinted(value) { michael@0: value = value.replace(/\\n/g, 'NL') michael@0: } michael@0: function reportCompare (expected, actual, description) { michael@0: printStatus ("Expected value '" + toPrinted(expected) + "' matched actual value '" + toPrinted(actual) + "'"); michael@0: } michael@0: var UBound = 0; michael@0: var statusitems = []; michael@0: var actual = ''; michael@0: var actualvalues = []; michael@0: var expect= ''; michael@0: var expectedvalues = []; michael@0: testThis('x()'); michael@0: testThis('"abc"()'); michael@0: testThis('x()'); michael@0: testThis('Date(12345)()'); michael@0: testThis('x()'); michael@0: testThis('1()'); michael@0: testThis('x()'); michael@0: testThis('void(0)()'); michael@0: testThis('x()'); michael@0: testThis('[1,2,3,4,5](1)'); michael@0: gczeal(4); michael@0: testThis('x(1)'); michael@0: checkThis('(function (y) {return y+1;})("abc")'); michael@0: checkThis('f("abc")'); michael@0: function testThis(sInvalidSyntax) { michael@0: expectedvalues[UBound] = expect; michael@0: actualvalues[UBound] = actual; michael@0: UBound++; michael@0: } michael@0: function checkThis(sValidSyntax) { michael@0: for (var i=0; i