Debian Codegraph @

rhino/testsrc/tests/js1_5/decompilation/regress-350666.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-350666.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 350666;
9 var summary = 'decompilation for (;; delete expr)';
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 () { for(;; delete y.(x)) { } }
27 actual = f + '';
28 expect = 'function () {\n for (;; y.(x), true) {\n }\n}';
29 compareSource(expect, actual, summary);
30
31 try
32 {
33 eval('(' + expect + ')');
34 actual = 'No Error';
35 }
36 catch(ex)
37 {
38 actual = ex + '';
39 }
40 expect = 'No Error';
41 reportCompare(expect, actual, summary);
42
43 f = function () { for(;; delete (y+x)) { } }
44 actual = f + '';
45 expect = 'function () {\n for (;; y + x, true) {\n }\n}';
46 compareSource(expect, actual, summary);
47
48 try
49 {
50 eval('(' + expect + ')');
51 actual = 'No Error';
52 }
53 catch(ex)
54 {
55 actual = ex + '';
56 }
57 expect = 'No Error';
58 reportCompare(expect, actual, summary);
59
60 exitFunc ('test');
61 }