Wed, 31 Dec 2014 07:53:36 +0100
Correct small whitespace inconsistency, lost while renaming variables.
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/. */
6 //-----------------------------------------------------------------------------
7 var BUGNUMBER = 452498;
8 var summary = 'TM: upvar2 regression tests';
9 var actual = '';
10 var expect = '';
13 //-----------------------------------------------------------------------------
14 test();
15 //-----------------------------------------------------------------------------
17 function test()
18 {
19 enterFunc ('test');
20 printBugNumber(BUGNUMBER);
21 printStatus (summary);
23 // ------- Comment #82 From Gary Kwong [:nth10sd]
25 // =====
27 (function(){function x(){} {let x = [] }});
29 // =====
31 var f = new Function("new function x(){ return x |= function(){} } ([], function(){})");
32 "" + f;
34 // =====
36 uneval(function(){[y] = [x];});
38 // =====
40 function g(code)
41 {
42 var f = new Function(code);
43 f();
44 }
45 g("for (var x = 0; x < 3; ++x)(new (function(){})());");
47 // =====
49 try
50 {
51 (function(){new (function ({}, x) { yield (x(1e-81) for (x4 in undefined)) })()})();
52 }
53 catch(ex)
54 {
55 }
56 // =====
58 try
59 {
60 (function(){[(function ([y]) { })() for each (x in [])];})();
61 }
62 catch(ex)
63 {
64 }
65 // =====
67 try
68 {
69 eval('(function(){for(var x2 = [function(id) { return id } for each (x in []) if ([])] in functional) function(){};})();');
70 }
71 catch(ex)
72 {
73 }
75 // =====
77 if (typeof window == 'undefined')
78 global = this;
79 else
80 global = window;
82 try
83 {
84 eval('(function(){with(global){1e-81; }for(let [x, x3] = global -= x in []) function(){}})();');
85 }
86 catch(ex)
87 {
88 }
90 // =====
91 try
92 {
93 eval(
94 'for(let [\n' +
95 'function x () { M:if([1,,]) }\n'
96 );
97 }
98 catch(ex)
99 {
100 }
102 // =====
104 try
105 {
106 function foo(code)
107 {
108 var c;
109 eval("const c, x5 = c;");
110 }
111 foo();
112 }
113 catch(ex)
114 {
115 }
117 // =====
119 var f = new Function("try { with({}) x = x; } catch(\u3056 if (function(){x = x2;})()) { let([] = [1.2e3.valueOf(\"number\")]) ((function(){})()); } ");
120 "" + f;
122 // =====
124 var f = new Function("[] = [( '' )()];");
125 "" + f;
127 // =====
129 try
130 {
131 eval(
132 'for(let x;' +
133 ' ([,,,]' +
134 ' .toExponential(new Function(), (function(){}))); [] = {})' +
135 ' for(var [x, x] = * in this.__defineSetter__("", function(){}));'
136 );
137 }
138 catch(ex)
139 {
140 }
142 // =====
144 reportCompare(expect, actual, summary);
146 exitFunc ('test');
147 }