swc/crates/swc_ecma_parser/tests/tsc/nullishCoalescingOperatorInAsyncGenerator.ts

13 lines
260 B
TypeScript

// @target: esnext,es2015,es5
// @lib: esnext
// @noEmitHelpers: true
// @noTypesAndSymbols: true
// https://github.com/microsoft/TypeScript/issues/37686
async function* f(a: { b?: number }) {
let c = a.b ?? 10;
while (c) {
yield c--;
}
}