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