File tree Expand file tree Collapse file tree 5 files changed +1136
-0
lines changed
tests/baselines/reference Expand file tree Collapse file tree 5 files changed +1136
-0
lines changed Original file line number Diff line number Diff line change
1
+ //// [controlFlowLetVar.ts]
2
+
3
+ declare let cond: boolean ;
4
+
5
+ function f1 ( ) {
6
+ let x ;
7
+ if ( cond ) {
8
+ x = 1 ;
9
+ }
10
+ if ( cond ) {
11
+ x = "hello" ;
12
+ }
13
+ const y = x ;
14
+ }
15
+
16
+ function f2 ( ) {
17
+ let x = undefined ;
18
+ if ( cond ) {
19
+ x = 1 ;
20
+ }
21
+ if ( cond ) {
22
+ x = "hello" ;
23
+ }
24
+ const y = x ;
25
+ }
26
+
27
+ function f3 ( ) {
28
+ let x = null ;
29
+ if ( cond ) {
30
+ x = 1 ;
31
+ }
32
+ if ( cond ) {
33
+ x = "hello" ;
34
+ }
35
+ const y = x ;
36
+ }
37
+
38
+ function f4 ( ) {
39
+ let x : any ;
40
+ if ( cond ) {
41
+ x = 1 ;
42
+ }
43
+ if ( cond ) {
44
+ x = "hello" ;
45
+ }
46
+ const y = x ;
47
+ }
48
+
49
+ function f5 ( ) {
50
+ var x ;
51
+ if ( cond ) {
52
+ x = 1 ;
53
+ }
54
+ if ( cond ) {
55
+ x = "hello" ;
56
+ }
57
+ const y = x ;
58
+ }
59
+
60
+ function f6 ( ) {
61
+ var x = undefined ;
62
+ if ( cond ) {
63
+ x = 1 ;
64
+ }
65
+ if ( cond ) {
66
+ x = "hello" ;
67
+ }
68
+ const y = x ;
69
+ }
70
+
71
+ function f7 ( ) {
72
+ var x = null ;
73
+ if ( cond ) {
74
+ x = 1 ;
75
+ }
76
+ if ( cond ) {
77
+ x = "hello" ;
78
+ }
79
+ const y = x ;
80
+ }
81
+
82
+ function f8 ( ) {
83
+ var x : any ;
84
+ if ( cond ) {
85
+ x = 1 ;
86
+ }
87
+ if ( cond ) {
88
+ x = "hello" ;
89
+ }
90
+ const y = x ;
91
+ }
92
+
93
+ function f9 ( ) {
94
+ let x ;
95
+ if ( cond ) {
96
+ x = 1 ;
97
+ }
98
+ if ( cond ) {
99
+ x = "hello" ;
100
+ }
101
+ const y = x ;
102
+ function f ( ) {
103
+ const z = x ;
104
+ }
105
+ }
106
+
107
+ function f10 ( ) {
108
+ let x ;
109
+ if ( cond ) {
110
+ x = 1 ;
111
+ }
112
+ if ( cond ) {
113
+ x = "hello" ;
114
+ }
115
+ const y = x ;
116
+ const f = ( ) => {
117
+ const z = x ;
118
+ } ;
119
+ }
120
+
121
+ //// [controlFlowLetVar.js]
122
+ function f1 ( ) {
123
+ var x ;
124
+ if ( cond ) {
125
+ x = 1 ;
126
+ }
127
+ if ( cond ) {
128
+ x = "hello" ;
129
+ }
130
+ var y = x ;
131
+ }
132
+ function f2 ( ) {
133
+ var x = undefined ;
134
+ if ( cond ) {
135
+ x = 1 ;
136
+ }
137
+ if ( cond ) {
138
+ x = "hello" ;
139
+ }
140
+ var y = x ;
141
+ }
142
+ function f3 ( ) {
143
+ var x = null ;
144
+ if ( cond ) {
145
+ x = 1 ;
146
+ }
147
+ if ( cond ) {
148
+ x = "hello" ;
149
+ }
150
+ var y = x ;
151
+ }
152
+ function f4 ( ) {
153
+ var x ;
154
+ if ( cond ) {
155
+ x = 1 ;
156
+ }
157
+ if ( cond ) {
158
+ x = "hello" ;
159
+ }
160
+ var y = x ;
161
+ }
162
+ function f5 ( ) {
163
+ var x ;
164
+ if ( cond ) {
165
+ x = 1 ;
166
+ }
167
+ if ( cond ) {
168
+ x = "hello" ;
169
+ }
170
+ var y = x ;
171
+ }
172
+ function f6 ( ) {
173
+ var x = undefined ;
174
+ if ( cond ) {
175
+ x = 1 ;
176
+ }
177
+ if ( cond ) {
178
+ x = "hello" ;
179
+ }
180
+ var y = x ;
181
+ }
182
+ function f7 ( ) {
183
+ var x = null ;
184
+ if ( cond ) {
185
+ x = 1 ;
186
+ }
187
+ if ( cond ) {
188
+ x = "hello" ;
189
+ }
190
+ var y = x ;
191
+ }
192
+ function f8 ( ) {
193
+ var x ;
194
+ if ( cond ) {
195
+ x = 1 ;
196
+ }
197
+ if ( cond ) {
198
+ x = "hello" ;
199
+ }
200
+ var y = x ;
201
+ }
202
+ function f9 ( ) {
203
+ var x ;
204
+ if ( cond ) {
205
+ x = 1 ;
206
+ }
207
+ if ( cond ) {
208
+ x = "hello" ;
209
+ }
210
+ var y = x ;
211
+ function f ( ) {
212
+ var z = x ;
213
+ }
214
+ }
215
+ function f10 ( ) {
216
+ var x ;
217
+ if ( cond ) {
218
+ x = 1 ;
219
+ }
220
+ if ( cond ) {
221
+ x = "hello" ;
222
+ }
223
+ var y = x ;
224
+ var f = function ( ) {
225
+ var z = x ;
226
+ } ;
227
+ }
You can’t perform that action at this time.
0 commit comments