Debian Codegraph @

rhino/testsrc/tests/js1_7/decompilation/regress-350991.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-350991.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 350991;
9 var summary = 'decompilation of function () { for (let...;...;}} ';
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 expect = 'function () {\n for ((let (y) 3);;) {\n }\n}';
27 try
28 {
29 f = eval('(function () { for ((let (y) 3); ;) { } })');
30 actual = f + '';
31 }
32 catch(ex)
33 {
34 actual = ex + '';
35 }
36
37 compareSource(expect, actual, summary);
38
39 expect = 'function () {\n let x = 5;\n while (x-- > 0) {\n' +
40 ' for (let x = x, q = 5;;) {\n }\n }\n}';
41 try
42 {
43 f = function() { let x = 5; while (x-- > 0) { for (let x = x, q = 5;;); } }
44 actual = f + '';
45 }
46 catch(ex)
47 {
48 actual = ex + '';
49 }
50
51 compareSource(expect, actual, summary);
52
53 exitFunc ('test');
54 }