js/src/jit-test/tests/basic/bug754150.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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]);

mercurial