forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcircularRefFromClassMember.js
More file actions
40 lines (36 loc) · 919 Bytes
/
circularRefFromClassMember.js
File metadata and controls
40 lines (36 loc) · 919 Bytes
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
//// [tests/cases/compiler/circularRefFromClassMember.ts] ////
//// [circularRefFromClassMember.ts]
// Test for #61606
const result: boolean[] = [];
class Test {
n: 42 | "" = 42 as any;
foo(): void {
if (this.n === "") {
return;
}
for (let i = 0; i < 1; i++) {
const localN = this.n;
const localN_alias = localN;
result[localN_alias] = true;
}
}
}
//// [circularRefFromClassMember.js]
// Test for #61606
var result = [];
var Test = /** @class */ (function () {
function Test() {
this.n = 42;
}
Test.prototype.foo = function () {
if (this.n === "") {
return;
}
for (var i = 0; i < 1; i++) {
var localN = this.n;
var localN_alias = localN;
result[localN_alias] = true;
}
};
return Test;
}());