swc/crates/swc_ecma_parser/tests/tsc/privateNameMethodAsync.ts
2022-02-04 17:08:38 +09:00

16 lines
379 B
TypeScript

// @target: es2019
const C = class {
async #bar() { return await Promise.resolve(42); }
async foo() {
const b = await this.#bar();
return b + (this.#baz().next().value || 0) + ((await this.#qux().next()).value || 0);
}
*#baz() { yield 42; }
async *#qux() {
yield (await Promise.resolve(42));
}
}
new C().foo().then(console.log);