1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/basic/bug754150.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,40 @@ 1.4 +// |jit-test| error: TypeError; 1.5 +function printStatus (msg) {} 1.6 +function toPrinted(value) { 1.7 + value = value.replace(/\\n/g, 'NL') 1.8 +} 1.9 +function reportCompare (expected, actual, description) { 1.10 + printStatus ("Expected value '" + toPrinted(expected) + "' matched actual value '" + toPrinted(actual) + "'"); 1.11 +} 1.12 +var UBound = 0; 1.13 +var statusitems = []; 1.14 +var actual = ''; 1.15 +var actualvalues = []; 1.16 +var expect= ''; 1.17 +var expectedvalues = []; 1.18 +testThis('x()'); 1.19 +testThis('"abc"()'); 1.20 +testThis('x()'); 1.21 +testThis('Date(12345)()'); 1.22 +testThis('x()'); 1.23 +testThis('1()'); 1.24 +testThis('x()'); 1.25 +testThis('void(0)()'); 1.26 +testThis('x()'); 1.27 +testThis('[1,2,3,4,5](1)'); 1.28 +gczeal(4); 1.29 +testThis('x(1)'); 1.30 +checkThis('(function (y) {return y+1;})("abc")'); 1.31 +checkThis('f("abc")'); 1.32 +function testThis(sInvalidSyntax) { 1.33 + expectedvalues[UBound] = expect; 1.34 + actualvalues[UBound] = actual; 1.35 + UBound++; 1.36 +} 1.37 +function checkThis(sValidSyntax) { 1.38 + for (var i=0; i<UBound; i++) 1.39 + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]); 1.40 +} 1.41 +var actualvalues = []; 1.42 +for (var i=0; i<UBound; i++) 1.43 + reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);