Debian Codegraph @

rhino/testsrc/tests/js1_8_1/regress/regress-452498-082.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-452498-082.js';
7 //-----------------------------------------------------------------------------
8 var BUGNUMBER = 452498;
9 var summary = 'TM: upvar2 regression tests';
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 // ------- Comment #82 From Gary Kwong [:nth10sd]
25
26 // =====
27
28 (function(){function x(){} {let x = [] }});
29
30 // =====
31
32 var f = new Function("new function x(){ return x |= function(){} } ([], function(){})");
33 "" + f;
34
35 // =====
36
37 var f = new Function("for(let [] = [0]; (y) = *; new (*::*)()) {}");
38 "" + f;
39
40 // =====
41
42 uneval(function(){[y] = [x];});
43
44 // =====
45
46 function g(code)
47 {
48 var f = new Function(code);
49 f();
50 }
51 g("for (var x = 0; x < 3; ++x)(new (function(){})());");
52
53 // =====
54
55 try
56 {
57 (function(){new (function ({}, x) { yield (x(1e-81) for (x4 in undefined)) })()})();
58 }
59 catch(ex)
60 {
61 }
62 // =====
63
64 try
65 {
66 (function(){[(function ([y]) { })() for each (x in [])];})();
67 }
68 catch(ex)
69 {
70 }
71 // =====
72
73 try
74 {
75 eval('(function(){for(var x2 = [function(id) { return id } for each (x in []) if ([])] in functional) function(){};})();');
76 }
77 catch(ex)
78 {
79 }
80
81 // =====
82
83 if (typeof window == 'undefined')
84 global = this;
85 else
86 global = window;
87
88 try
89 {
90 eval('(function(){with(global){1e-81; }for(let [x, x3] = global -= x in []) function(){}})();');
91 }
92 catch(ex)
93 {
94 }
95
96 // =====
97 try
98 {
99 eval(
100 'for(let [\n' +
101 'function x () { M:if([1,,]) }\n'
102 );
103 }
104 catch(ex)
105 {
106 }
107
108 // =====
109
110 try
111 {
112 function foo(code)
113 {
114 var c;
115 eval("const c, x5 = c;");
116 }
117 foo();
118 }
119 catch(ex)
120 {
121 }
122
123 // =====
124
125 var f = new Function("try { with({}) x = x; } catch(\u3056 if (function(){x = x2;})()) { let([] = [1.2e3.valueOf(\"number\")]) ((function(){})()); } ");
126 "" + f;
127
128 // =====
129
130 var f = new Function("[] = [( '' )()];");
131 "" + f;
132
133 // =====
134
135 var f = new Function("let ([] = [({ get x5 this (x) {} })]) { for(let y in []) with({}) {} }");
136 "" + f;
137
138 // =====
139
140 try
141 {
142 eval(
143 'for(let x;' +
144 ' ([,,,]' +
145 ' .toExponential(new Function(), (function(){}))); [] = {})' +
146 ' for(var [x, x] = * in this.__defineSetter__("", function(){}));'
147 );
148 }
149 catch(ex)
150 {
151 }
152
153 // =====
154
155 reportCompare(expect, actual, summary);
156
157 exitFunc ('test');
158 }