Debian Codegraph @

rhino/testsrc/tests/js1_5/decompilation/regress-352013.js

raw symbols SCIP
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6 var gTestfile = 'regress-352013.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 352013;
9 var summary = 'decompilation of new parenthetic expressions';
10 var actual = '';
11 var expect = '';
12
13
14 //-----------------------------------------------------------------------------
15 test();
16 //-----------------------------------------------------------------------------
17
18 function test()
19 {
20 enterFunc ('test');
21 printBugNumber(BUGNUMBER);
22 printStatus (summary);
23
24 var f, g, h;
25 var x = Function;
26 var z = 'actual += arguments[0];';
27 var w = 42;
28
29 f = function() { new (x(z))(w) }
30 expect = 'function() { new (x(z))(w); }';
31 actual = f + '';
32 compareSource(expect, actual, summary);
33
34 g = function () { new x(z)(w); }
35 expect = 'function () { (new x(z))(w); }';
36 actual = g + '';
37 compareSource(expect, actual, summary);
38
39 expect = '4242';
40 actual = '';
41 f();
42 g();
43 reportCompare(expect, actual, summary);
44
45 h = function () { new (x(y)(z)); }
46 expect = 'function () { new (x(y)(z)); }';
47 actual = h + '';
48 compareSource(expect, actual, summary);
49
50 h = function () { new (x(y).z); }
51 expect = 'function () { new (x(y).z); }';
52 actual = h + '';
53 compareSource(expect, actual, summary);
54
55 h = function () { new x(y).z; }
56 expect = 'function () { (new x(y)).z; }';
57 actual = h + '';
58 compareSource(expect, actual, summary);
59
60 exitFunc ('test');
61 }