forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathargumentsUsedInClassFieldInitializerOrStaticInitializationBlock.js
More file actions
227 lines (213 loc) · 4.34 KB
/
argumentsUsedInClassFieldInitializerOrStaticInitializationBlock.js
File metadata and controls
227 lines (213 loc) · 4.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
//// [argumentsUsedInClassFieldInitializerOrStaticInitializationBlock.ts]
function A() {
return class T {
a = arguments
}
}
function A1() {
return new class T {
a = arguments
}
}
function B() {
return class T {
a = { b: arguments }
}
}
function B1() {
return new class T {
a = { b: arguments }
}
}
function C() {
return class T {
a = function () { arguments }
}
}
function D() {
return class T {
a = () => arguments // should error
}
}
function D1() {
return class T {
a = () => {
arguments; // should error
const b = () => {
return arguments; // should error
}
function f() {
return arguments; // ok
}
}
}
}
function D2() {
return class {
constructor() {
arguments; // ok
}
get foo() {
return arguments; // ok
}
set foo(foo: any) {
arguments; // ok
}
bar() {
arguments; // ok
}
[Symbol.iterator]() {
arguments; // ok
}
}
}
function D3() {
return class T {
static {
arguments; // should error
while(1) {
arguments // should error
}
}
}
}
function D4() {
return class T {
static {
function f() {
arguments; // ok
}
}
}
}
function D5() {
return class T {
a = (() => { return arguments; })() // should error
}
}
//// [argumentsUsedInClassFieldInitializerOrStaticInitializationBlock.js]
function A() {
return /** @class */ (function () {
function T() {
this.a = arguments;
}
return T;
}());
}
function A1() {
return new /** @class */ (function () {
function T() {
this.a = arguments;
}
return T;
}());
}
function B() {
return /** @class */ (function () {
function T() {
this.a = { b: arguments };
}
return T;
}());
}
function B1() {
return new /** @class */ (function () {
function T() {
this.a = { b: arguments };
}
return T;
}());
}
function C() {
return /** @class */ (function () {
function T() {
this.a = function () { arguments; };
}
return T;
}());
}
function D() {
return /** @class */ (function () {
function T() {
this.a = function () { return arguments; }; // should error
}
return T;
}());
}
function D1() {
return /** @class */ (function () {
function T() {
this.a = function () {
arguments; // should error
var b = function () {
return arguments; // should error
};
function f() {
return arguments; // ok
}
};
}
return T;
}());
}
function D2() {
return /** @class */ (function () {
function class_1() {
arguments; // ok
}
Object.defineProperty(class_1.prototype, "foo", {
get: function () {
return arguments; // ok
},
set: function (foo) {
arguments; // ok
},
enumerable: false,
configurable: true
});
class_1.prototype.bar = function () {
arguments; // ok
};
class_1.prototype[Symbol.iterator] = function () {
arguments; // ok
};
return class_1;
}());
}
function D3() {
var _a;
return _a = /** @class */ (function () {
function T() {
}
return T;
}()),
(function () {
arguments; // should error
while (1) {
arguments; // should error
}
})(),
_a;
}
function D4() {
var _a;
return _a = /** @class */ (function () {
function T() {
}
return T;
}()),
(function () {
function f() {
arguments; // ok
}
})(),
_a;
}
function D5() {
return /** @class */ (function () {
function T() {
this.a = (function () { return arguments; })(); // should error
}
return T;
}());
}