Debian Codegraph @

rhino/testsrc/tests/js1_5/extensions/regress-352261.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-352261.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 352261;
9 var summary = 'Decompilation should preserve right associativity';
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 g, h;
25
26 g = function(a,b,c) { return a - (b + c) }
27 expect = 'function(a,b,c) { return a - (b + c); }';
28 actual = g + '';
29 compareSource(expect, actual, summary);
30
31 h = eval(uneval(g));
32 expect = g(1, 10, 100);
33 actual = h(1, 10, 100);
34 reportCompare(expect, actual, summary);
35
36 var p, q;
37
38 p = function (a,b,c) { return a + (b - c) }
39 expect = 'function (a,b,c) { return a + (b - c);}';
40 actual = p + '';
41 compareSource(expect, actual, summary);
42
43 q = eval(uneval(p));
44 expect = p(3, "4", "5");
45 actual = q(3, "4", "5");
46 reportCompare(expect, actual, summary);
47
48 exitFunc ('test');
49 }