TypeScript/tests/cases/conformance/statements/for-await-ofStatements/emitter.forAwait.ts
Ron Buckton 968943f355
Reset error variable in downlevel for-await-of loop (#38170)
* Rename forAwait tests

* Reset error var in for-await loop
2020-04-24 14:59:41 -07:00

51 lines
1 KiB
TypeScript

// @target: es2018,es2017,es2015,es5
// @lib: esnext
// @filename: file1.ts
async function f1() {
let y: any;
for await (const x of y) {
}
}
// @filename: file2.ts
async function f2() {
let x: any, y: any;
for await (x of y) {
}
}
// @filename: file3.ts
async function* f3() {
let y: any;
for await (const x of y) {
}
}
// @filename: file4.ts
async function* f4() {
let x: any, y: any;
for await (x of y) {
}
}
// @filename: file5.ts
// https://github.com/Microsoft/TypeScript/issues/21363
async function f5() {
let y: any;
outer: for await (const x of y) {
continue outer;
}
}
// @filename: file6.ts
// https://github.com/Microsoft/TypeScript/issues/21363
async function* f6() {
let y: any;
outer: for await (const x of y) {
continue outer;
}
}
// @filename: file7.ts
// https://github.com/microsoft/TypeScript/issues/36166
async function* f7() {
let y: any;
for (;;) {
for await (const x of y) {
}
}
}