Debian Codegraph @

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

raw
1 // |jit-test| error: TypeError;
2
3 // String.prototype.replace takes too long time with gczeal(4) if
4 // --no-baseline --no-ion options.
5 if (typeof inJit == "function" && typeof inJit() == "string") {
6 assertEq(inJit(), "Baseline is disabled.");
7 // This test expects TypeError.
8 toPrinted(null);
9 }
10
11 function printStatus (msg) {}
12 function toPrinted(value) {
13 value = value.replace(/\\n/g, 'NL')
14 }
15 function reportCompare (expected, actual, description) {
16 printStatus ("Expected value '" + toPrinted(expected) + "' matched actual value '" + toPrinted(actual) + "'");
17 }
18 var UBound = 0;
19 var statusitems = [];
20 var actual = '';
21 var actualvalues = [];
22 var expect= '';
23 var expectedvalues = [];
24 testThis('x()');
25 testThis('"abc"()');
26 testThis('x()');
27 testThis('Date(12345)()');
28 testThis('x()');
29 testThis('1()');
30 testThis('x()');
31 testThis('void(0)()');
32 testThis('x()');
33 testThis('[1,2,3,4,5](1)');
34 gczeal(4);
35 testThis('x(1)');
36 checkThis('(function (y) {return y+1;})("abc")');
37 checkThis('f("abc")');
38 function testThis(sInvalidSyntax) {
39 expectedvalues[UBound] = expect;
40 actualvalues[UBound] = actual;
41 UBound++;
42 }
43 function checkThis(sValidSyntax) {
44 for (var i=0; i<UBound; i++)
45 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);
46 }
47 var actualvalues = [];
48 for (var i=0; i<UBound; i++)
49 reportCompare(expectedvalues[i], actualvalues[i], statusitems[i]);