* rename esnext.ts as es2018.ts * remove ES2018 transforms for ES2018 target * change target from esnext to es2018 * rename tests
36 lines
878 B
TypeScript
36 lines
878 B
TypeScript
// @target: es2018
|
|
// @lib: esnext
|
|
// @noEmit: true
|
|
declare const asyncIterable: AsyncIterable<number>;
|
|
declare const iterable: Iterable<number>;
|
|
declare const iterableOfPromise: Iterable<Promise<number>>;
|
|
async function f1() {
|
|
let y: number;
|
|
for await (const x of asyncIterable) {
|
|
}
|
|
for await (const x of iterable) {
|
|
}
|
|
for await (const x of iterableOfPromise) {
|
|
}
|
|
for await (y of asyncIterable) {
|
|
}
|
|
for await (y of iterable) {
|
|
}
|
|
for await (y of iterableOfPromise) {
|
|
}
|
|
}
|
|
async function * f2() {
|
|
let y: number;
|
|
for await (const x of asyncIterable) {
|
|
}
|
|
for await (const x of iterable) {
|
|
}
|
|
for await (const x of iterableOfPromise) {
|
|
}
|
|
for await (y of asyncIterable) {
|
|
}
|
|
for await (y of iterable) {
|
|
}
|
|
for await (y of iterableOfPromise) {
|
|
}
|
|
}
|