@@ -24,6 +24,22 @@ async function* f4() {
24
24
for await ( x of y ) {
25
25
}
26
26
}
27
+ //// [file5.ts]
28
+ // https://github.com/Microsoft/TypeScript/issues/21363
29
+ async function f5 ( ) {
30
+ let y : any ;
31
+ outer: for await ( const x of y ) {
32
+ continue outer;
33
+ }
34
+ }
35
+ //// [file6.ts]
36
+ // https://github.com/Microsoft/TypeScript/issues/21363
37
+ async function * f6 ( ) {
38
+ let y : any ;
39
+ outer: for await ( const x of y ) {
40
+ continue outer;
41
+ }
42
+ }
27
43
28
44
//// [file1.js]
29
45
var __awaiter = ( this && this . __awaiter ) || function ( thisArg , _arguments , P , generator ) {
@@ -161,3 +177,75 @@ function f4() {
161
177
var e_1 , _a ;
162
178
} ) ;
163
179
}
180
+ //// [file5.js]
181
+ var __awaiter = ( this && this . __awaiter ) || function ( thisArg , _arguments , P , generator ) {
182
+ return new ( P || ( P = Promise ) ) ( function ( resolve , reject ) {
183
+ function fulfilled ( value ) { try { step ( generator . next ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
184
+ function rejected ( value ) { try { step ( generator [ "throw" ] ( value ) ) ; } catch ( e ) { reject ( e ) ; } }
185
+ function step ( result ) { result . done ? resolve ( result . value ) : new P ( function ( resolve ) { resolve ( result . value ) ; } ) . then ( fulfilled , rejected ) ; }
186
+ step ( ( generator = generator . apply ( thisArg , _arguments || [ ] ) ) . next ( ) ) ;
187
+ } ) ;
188
+ } ;
189
+ var __asyncValues = ( this && this . __asyncValues ) || function ( o ) {
190
+ if ( ! Symbol . asyncIterator ) throw new TypeError ( "Symbol.asyncIterator is not defined." ) ;
191
+ var m = o [ Symbol . asyncIterator ] ;
192
+ return m ? m . call ( o ) : typeof __values === "function" ? __values ( o ) : o [ Symbol . iterator ] ( ) ;
193
+ } ;
194
+ // https://github.com/Microsoft/TypeScript/issues/21363
195
+ function f5 ( ) {
196
+ return __awaiter ( this , void 0 , void 0 , function * ( ) {
197
+ let y ;
198
+ try {
199
+ outer: for ( var y_1 = __asyncValues ( y ) , y_1_1 ; y_1_1 = yield y_1 . next ( ) , ! y_1_1 . done ; ) {
200
+ const x = yield y_1_1 . value ;
201
+ continue outer;
202
+ }
203
+ }
204
+ catch ( e_1_1 ) { e_1 = { error : e_1_1 } ; }
205
+ finally {
206
+ try {
207
+ if ( y_1_1 && ! y_1_1 . done && ( _a = y_1 . return ) ) yield _a . call ( y_1 ) ;
208
+ }
209
+ finally { if ( e_1 ) throw e_1 . error ; }
210
+ }
211
+ var e_1 , _a ;
212
+ } ) ;
213
+ }
214
+ //// [file6.js]
215
+ var __asyncValues = ( this && this . __asyncValues ) || function ( o ) {
216
+ if ( ! Symbol . asyncIterator ) throw new TypeError ( "Symbol.asyncIterator is not defined." ) ;
217
+ var m = o [ Symbol . asyncIterator ] ;
218
+ return m ? m . call ( o ) : typeof __values === "function" ? __values ( o ) : o [ Symbol . iterator ] ( ) ;
219
+ } ;
220
+ var __await = ( this && this . __await ) || function ( v ) { return this instanceof __await ? ( this . v = v , this ) : new __await ( v ) ; }
221
+ var __asyncGenerator = ( this && this . __asyncGenerator ) || function ( thisArg , _arguments , generator ) {
222
+ if ( ! Symbol . asyncIterator ) throw new TypeError ( "Symbol.asyncIterator is not defined." ) ;
223
+ var g = generator . apply ( thisArg , _arguments || [ ] ) , i , q = [ ] ;
224
+ return i = { } , verb ( "next" ) , verb ( "throw" ) , verb ( "return" ) , i [ Symbol . asyncIterator ] = function ( ) { return this ; } , i ;
225
+ function verb ( n ) { if ( g [ n ] ) i [ n ] = function ( v ) { return new Promise ( function ( a , b ) { q . push ( [ n , v , a , b ] ) > 1 || resume ( n , v ) ; } ) ; } ; }
226
+ function resume ( n , v ) { try { step ( g [ n ] ( v ) ) ; } catch ( e ) { settle ( q [ 0 ] [ 3 ] , e ) ; } }
227
+ function step ( r ) { r . value instanceof __await ? Promise . resolve ( r . value . v ) . then ( fulfill , reject ) : settle ( q [ 0 ] [ 2 ] , r ) ; }
228
+ function fulfill ( value ) { resume ( "next" , value ) ; }
229
+ function reject ( value ) { resume ( "throw" , value ) ; }
230
+ function settle ( f , v ) { if ( f ( v ) , q . shift ( ) , q . length ) resume ( q [ 0 ] [ 0 ] , q [ 0 ] [ 1 ] ) ; }
231
+ } ;
232
+ // https://github.com/Microsoft/TypeScript/issues/21363
233
+ function f6 ( ) {
234
+ return __asyncGenerator ( this , arguments , function * f6_1 ( ) {
235
+ let y ;
236
+ try {
237
+ outer: for ( var y_1 = __asyncValues ( y ) , y_1_1 ; y_1_1 = yield __await ( y_1 . next ( ) ) , ! y_1_1 . done ; ) {
238
+ const x = yield __await ( y_1_1 . value ) ;
239
+ continue outer;
240
+ }
241
+ }
242
+ catch ( e_1_1 ) { e_1 = { error : e_1_1 } ; }
243
+ finally {
244
+ try {
245
+ if ( y_1_1 && ! y_1_1 . done && ( _a = y_1 . return ) ) yield __await ( _a . call ( y_1 ) ) ;
246
+ }
247
+ finally { if ( e_1 ) throw e_1 . error ; }
248
+ }
249
+ var e_1 , _a ;
250
+ } ) ;
251
+ }
0 commit comments