@@ -20,76 +20,99 @@ class Test {
20
20
p4 = 0;
21
21
>p4 : Symbol(Test.p4, Decl(classUsedBeforeInitializedVariables.ts, 3, 17))
22
22
23
+ p5?: number;
24
+ >p5 : Symbol(Test.p5, Decl(classUsedBeforeInitializedVariables.ts, 4, 11))
25
+
26
+ p6?: string;
27
+ >p6 : Symbol(Test.p6, Decl(classUsedBeforeInitializedVariables.ts, 5, 16))
28
+
29
+ p7 = {
30
+ >p7 : Symbol(Test.p7, Decl(classUsedBeforeInitializedVariables.ts, 7, 16))
31
+
32
+ hello: (this.p6 = "string"),
33
+ >hello : Symbol(hello, Decl(classUsedBeforeInitializedVariables.ts, 8, 10))
34
+ >this.p6 : Symbol(Test.p6, Decl(classUsedBeforeInitializedVariables.ts, 5, 16))
35
+ >this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
36
+ >p6 : Symbol(Test.p6, Decl(classUsedBeforeInitializedVariables.ts, 5, 16))
37
+
38
+ };
39
+
23
40
directlyAssigned: any = this.directlyAssigned;
24
- >directlyAssigned : Symbol(Test.directlyAssigned, Decl(classUsedBeforeInitializedVariables.ts, 4, 11 ))
25
- >this.directlyAssigned : Symbol(Test.directlyAssigned, Decl(classUsedBeforeInitializedVariables.ts, 4, 11 ))
41
+ >directlyAssigned : Symbol(Test.directlyAssigned, Decl(classUsedBeforeInitializedVariables.ts, 10, 6 ))
42
+ >this.directlyAssigned : Symbol(Test.directlyAssigned, Decl(classUsedBeforeInitializedVariables.ts, 10, 6 ))
26
43
>this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
27
- >directlyAssigned : Symbol(Test.directlyAssigned, Decl(classUsedBeforeInitializedVariables.ts, 4, 11 ))
44
+ >directlyAssigned : Symbol(Test.directlyAssigned, Decl(classUsedBeforeInitializedVariables.ts, 10, 6 ))
28
45
29
46
withinArrowFunction: any = () => this.withinArrowFunction;
30
- >withinArrowFunction : Symbol(Test.withinArrowFunction, Decl(classUsedBeforeInitializedVariables.ts, 6 , 50))
31
- >this.withinArrowFunction : Symbol(Test.withinArrowFunction, Decl(classUsedBeforeInitializedVariables.ts, 6 , 50))
47
+ >withinArrowFunction : Symbol(Test.withinArrowFunction, Decl(classUsedBeforeInitializedVariables.ts, 12 , 50))
48
+ >this.withinArrowFunction : Symbol(Test.withinArrowFunction, Decl(classUsedBeforeInitializedVariables.ts, 12 , 50))
32
49
>this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
33
- >withinArrowFunction : Symbol(Test.withinArrowFunction, Decl(classUsedBeforeInitializedVariables.ts, 6 , 50))
50
+ >withinArrowFunction : Symbol(Test.withinArrowFunction, Decl(classUsedBeforeInitializedVariables.ts, 12 , 50))
34
51
35
52
withinFunction: any = function () {
36
- >withinFunction : Symbol(Test.withinFunction, Decl(classUsedBeforeInitializedVariables.ts, 8 , 62))
53
+ >withinFunction : Symbol(Test.withinFunction, Decl(classUsedBeforeInitializedVariables.ts, 14 , 62))
37
54
38
55
return this.withinFunction;
39
56
};
40
57
41
58
withinObjectLiteral: any = {
42
- >withinObjectLiteral : Symbol(Test.withinObjectLiteral, Decl(classUsedBeforeInitializedVariables.ts, 12 , 6))
59
+ >withinObjectLiteral : Symbol(Test.withinObjectLiteral, Decl(classUsedBeforeInitializedVariables.ts, 18 , 6))
43
60
44
61
[this.withinObjectLiteral]: true,
45
- >[this.withinObjectLiteral] : Symbol([this.withinObjectLiteral], Decl(classUsedBeforeInitializedVariables.ts, 14 , 32))
46
- >this.withinObjectLiteral : Symbol(Test.withinObjectLiteral, Decl(classUsedBeforeInitializedVariables.ts, 12 , 6))
62
+ >[this.withinObjectLiteral] : Symbol([this.withinObjectLiteral], Decl(classUsedBeforeInitializedVariables.ts, 20 , 32))
63
+ >this.withinObjectLiteral : Symbol(Test.withinObjectLiteral, Decl(classUsedBeforeInitializedVariables.ts, 18 , 6))
47
64
>this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
48
- >withinObjectLiteral : Symbol(Test.withinObjectLiteral, Decl(classUsedBeforeInitializedVariables.ts, 12 , 6))
65
+ >withinObjectLiteral : Symbol(Test.withinObjectLiteral, Decl(classUsedBeforeInitializedVariables.ts, 18 , 6))
49
66
50
67
};
51
68
52
69
withinObjectLiteralGetterName: any = {
53
- >withinObjectLiteralGetterName : Symbol(Test.withinObjectLiteralGetterName, Decl(classUsedBeforeInitializedVariables.ts, 16 , 6))
70
+ >withinObjectLiteralGetterName : Symbol(Test.withinObjectLiteralGetterName, Decl(classUsedBeforeInitializedVariables.ts, 22 , 6))
54
71
55
72
get [this.withinObjectLiteralGetterName]() {
56
- >[this.withinObjectLiteralGetterName] : Symbol([this.withinObjectLiteralGetterName], Decl(classUsedBeforeInitializedVariables.ts, 18 , 42))
57
- >this.withinObjectLiteralGetterName : Symbol(Test.withinObjectLiteralGetterName, Decl(classUsedBeforeInitializedVariables.ts, 16 , 6))
73
+ >[this.withinObjectLiteralGetterName] : Symbol([this.withinObjectLiteralGetterName], Decl(classUsedBeforeInitializedVariables.ts, 24 , 42))
74
+ >this.withinObjectLiteralGetterName : Symbol(Test.withinObjectLiteralGetterName, Decl(classUsedBeforeInitializedVariables.ts, 22 , 6))
58
75
>this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
59
- >withinObjectLiteralGetterName : Symbol(Test.withinObjectLiteralGetterName, Decl(classUsedBeforeInitializedVariables.ts, 16 , 6))
76
+ >withinObjectLiteralGetterName : Symbol(Test.withinObjectLiteralGetterName, Decl(classUsedBeforeInitializedVariables.ts, 22 , 6))
60
77
61
78
return true;
62
79
}
63
80
};
64
81
65
82
withinObjectLiteralSetterName: any = {
66
- >withinObjectLiteralSetterName : Symbol(Test.withinObjectLiteralSetterName, Decl(classUsedBeforeInitializedVariables.ts, 22 , 6))
83
+ >withinObjectLiteralSetterName : Symbol(Test.withinObjectLiteralSetterName, Decl(classUsedBeforeInitializedVariables.ts, 28 , 6))
67
84
68
85
set [this.withinObjectLiteralSetterName](_: any) {}
69
- >[this.withinObjectLiteralSetterName] : Symbol([this.withinObjectLiteralSetterName], Decl(classUsedBeforeInitializedVariables.ts, 24 , 42))
70
- >this.withinObjectLiteralSetterName : Symbol(Test.withinObjectLiteralSetterName, Decl(classUsedBeforeInitializedVariables.ts, 22 , 6))
86
+ >[this.withinObjectLiteralSetterName] : Symbol([this.withinObjectLiteralSetterName], Decl(classUsedBeforeInitializedVariables.ts, 30 , 42))
87
+ >this.withinObjectLiteralSetterName : Symbol(Test.withinObjectLiteralSetterName, Decl(classUsedBeforeInitializedVariables.ts, 28 , 6))
71
88
>this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
72
- >withinObjectLiteralSetterName : Symbol(Test.withinObjectLiteralSetterName, Decl(classUsedBeforeInitializedVariables.ts, 22 , 6))
73
- >_ : Symbol(_, Decl(classUsedBeforeInitializedVariables.ts, 25 , 49))
89
+ >withinObjectLiteralSetterName : Symbol(Test.withinObjectLiteralSetterName, Decl(classUsedBeforeInitializedVariables.ts, 28 , 6))
90
+ >_ : Symbol(_, Decl(classUsedBeforeInitializedVariables.ts, 31 , 49))
74
91
75
92
};
76
93
77
94
withinClassDeclarationExtension: any = (class extends this.withinClassDeclarationExtension { });
78
- >withinClassDeclarationExtension : Symbol(Test.withinClassDeclarationExtension, Decl(classUsedBeforeInitializedVariables.ts, 26, 6))
79
- >this.withinClassDeclarationExtension : Symbol(Test.withinClassDeclarationExtension, Decl(classUsedBeforeInitializedVariables.ts, 26, 6))
95
+ >withinClassDeclarationExtension : Symbol(Test.withinClassDeclarationExtension, Decl(classUsedBeforeInitializedVariables.ts, 32, 6))
96
+ >this.withinClassDeclarationExtension : Symbol(Test.withinClassDeclarationExtension, Decl(classUsedBeforeInitializedVariables.ts, 32, 6))
97
+ >this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
98
+ >withinClassDeclarationExtension : Symbol(Test.withinClassDeclarationExtension, Decl(classUsedBeforeInitializedVariables.ts, 32, 6))
99
+
100
+ fromOptional = this.p5;
101
+ >fromOptional : Symbol(Test.fromOptional, Decl(classUsedBeforeInitializedVariables.ts, 34, 100))
102
+ >this.p5 : Symbol(Test.p5, Decl(classUsedBeforeInitializedVariables.ts, 4, 11))
80
103
>this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
81
- >withinClassDeclarationExtension : Symbol(Test.withinClassDeclarationExtension , Decl(classUsedBeforeInitializedVariables.ts, 26, 6 ))
104
+ >p5 : Symbol(Test.p5 , Decl(classUsedBeforeInitializedVariables.ts, 4, 11 ))
82
105
83
106
// These error cases are ignored (not checked by control flow analysis)
84
107
85
108
assignedByArrowFunction: any = (() => this.assignedByFunction)();
86
- >assignedByArrowFunction : Symbol(Test.assignedByArrowFunction, Decl(classUsedBeforeInitializedVariables.ts, 28, 100 ))
87
- >this.assignedByFunction : Symbol(Test.assignedByFunction, Decl(classUsedBeforeInitializedVariables.ts, 32 , 69))
109
+ >assignedByArrowFunction : Symbol(Test.assignedByArrowFunction, Decl(classUsedBeforeInitializedVariables.ts, 36, 27 ))
110
+ >this.assignedByFunction : Symbol(Test.assignedByFunction, Decl(classUsedBeforeInitializedVariables.ts, 40 , 69))
88
111
>this : Symbol(Test, Decl(classUsedBeforeInitializedVariables.ts, 0, 0))
89
- >assignedByFunction : Symbol(Test.assignedByFunction, Decl(classUsedBeforeInitializedVariables.ts, 32 , 69))
112
+ >assignedByFunction : Symbol(Test.assignedByFunction, Decl(classUsedBeforeInitializedVariables.ts, 40 , 69))
90
113
91
114
assignedByFunction: any = (function () {
92
- >assignedByFunction : Symbol(Test.assignedByFunction, Decl(classUsedBeforeInitializedVariables.ts, 32 , 69))
115
+ >assignedByFunction : Symbol(Test.assignedByFunction, Decl(classUsedBeforeInitializedVariables.ts, 40 , 69))
93
116
94
117
return this.assignedByFunction;
95
118
})();
0 commit comments