Debian Codegraph @

rhino/testsrc/tests/js1_5/Regress/regress-349648.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-349648.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 349648;
9 var summary = 'Extra "[" in decomilation of nested array comprehensions';
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;
25
26 f = function(){ [[0 for (x in [])] for (y in []) ]; };
27 expect = 'function () {\n [[0 for (x in [])] for (y in [])];\n}';
28 actual = f + '';
29 reportCompare(expect, actual, summary + ':1');
30
31 f = function(){ [[0 for (x in [])] for (y in []) ]; };
32 expect = 'function () {\n [[0 for (x in [])] for (y in [])];\n}';
33 actual = f + '';
34 reportCompare(expect, actual, summary + ':2');
35
36 f = function(){ [[0 for (x in [])] for (yyyyyyyyyyy in []) ]; }
37 expect = 'function () {\n [[0 for (x in [])] for (yyyyyyyyyyy in [])];\n}';
38 actual = f + '';
39 reportCompare(expect, actual, summary + ':3');
40
41 f = function(){ [0 for (x in [])]; }
42 expect = 'function () {\n [0 for (x in [])];\n}';
43 actual = f + '';
44 reportCompare(expect, actual, summary + ':4');
45
46 f = function(){ [[[0 for (x in [])] for (yyyyyyyyyyy in []) ]
47 for (zzz in [])]; }
48 expect = 'function () {\n [[[0 for (x in [])] for (yyyyyyyyyyy in [])]' +
49 ' for (zzz in [])];\n}';
50 actual = f + '';
51 reportCompare(expect, actual, summary + ':5');
52
53 f = function(){ [[0 for (x in [])] for (y in []) ]; }
54 expect = 'function () {\n [[0 for (x in [])] for (y in [])];\n}';
55 actual = f + '';
56 reportCompare(expect, actual, summary + ':6');
57
58 f = function(){ [[11 for (x in [])] for (y in []) ]; }
59 expect = 'function () {\n [[11 for (x in [])] for (y in [])];\n}';
60 actual = f + '';
61 reportCompare(expect, actual, summary + ':7');
62
63 exitFunc ('test');
64 }