80 lines
3.2 KiB
Plaintext
80 lines
3.2 KiB
Plaintext
|
=== tests/cases/conformance/classes/members/privateNames/privateNameStaticMethodAsync.ts ===
|
||
|
const C = class {
|
||
|
>C : typeof C
|
||
|
>class { static async #bar() { return await Promise.resolve(42); } static async foo() { const b = await this.#bar(); return b + (this.#baz().next().value || 0) + ((await this.#qux().next()).value || 0); } static *#baz() { yield 42; } static async *#qux() { yield (await Promise.resolve(42)); } async static *#bazBad() { yield 42; }} : typeof C
|
||
|
|
||
|
static async #bar() { return await Promise.resolve(42); }
|
||
|
>#bar : () => Promise<number>
|
||
|
>await Promise.resolve(42) : number
|
||
|
>Promise.resolve(42) : Promise<number>
|
||
|
>Promise.resolve : { (): Promise<void>; <T>(value: T | PromiseLike<T>): Promise<T>; }
|
||
|
>Promise : PromiseConstructor
|
||
|
>resolve : { (): Promise<void>; <T>(value: T | PromiseLike<T>): Promise<T>; }
|
||
|
>42 : 42
|
||
|
|
||
|
static async foo() {
|
||
|
>foo : () => Promise<number>
|
||
|
|
||
|
const b = await this.#bar();
|
||
|
>b : number
|
||
|
>await this.#bar() : number
|
||
|
>this.#bar() : Promise<number>
|
||
|
>this.#bar : () => Promise<number>
|
||
|
>this : typeof C
|
||
|
|
||
|
return b + (this.#baz().next().value || 0) + ((await this.#qux().next()).value || 0);
|
||
|
>b + (this.#baz().next().value || 0) + ((await this.#qux().next()).value || 0) : number
|
||
|
>b + (this.#baz().next().value || 0) : number
|
||
|
>b : number
|
||
|
>(this.#baz().next().value || 0) : number
|
||
|
>this.#baz().next().value || 0 : number
|
||
|
>this.#baz().next().value : number | void
|
||
|
>this.#baz().next() : IteratorResult<number, void>
|
||
|
>this.#baz().next : (...args: [] | [unknown]) => IteratorResult<number, void>
|
||
|
>this.#baz() : Generator<number, void, unknown>
|
||
|
>this.#baz : () => Generator<number, void, unknown>
|
||
|
>this : typeof C
|
||
|
>next : (...args: [] | [unknown]) => IteratorResult<number, void>
|
||
|
>value : number | void
|
||
|
>0 : 0
|
||
|
>((await this.#qux().next()).value || 0) : number
|
||
|
>(await this.#qux().next()).value || 0 : number
|
||
|
>(await this.#qux().next()).value : number | void
|
||
|
>(await this.#qux().next()) : IteratorResult<number, void>
|
||
|
>await this.#qux().next() : IteratorResult<number, void>
|
||
|
>this.#qux().next() : Promise<IteratorResult<number, void>>
|
||
|
>this.#qux().next : (...args: [] | [unknown]) => Promise<IteratorResult<number, void>>
|
||
|
>this.#qux() : AsyncGenerator<number, void, unknown>
|
||
|
>this.#qux : () => AsyncGenerator<number, void, unknown>
|
||
|
>this : typeof C
|
||
|
>next : (...args: [] | [unknown]) => Promise<IteratorResult<number, void>>
|
||
|
>value : number | void
|
||
|
>0 : 0
|
||
|
}
|
||
|
static *#baz() { yield 42; }
|
||
|
>#baz : () => Generator<number, void, unknown>
|
||
|
>yield 42 : any
|
||
|
>42 : 42
|
||
|
|
||
|
static async *#qux() {
|
||
|
>#qux : () => AsyncGenerator<number, void, unknown>
|
||
|
|
||
|
yield (await Promise.resolve(42));
|
||
|
>yield (await Promise.resolve(42)) : any
|
||
|
>(await Promise.resolve(42)) : number
|
||
|
>await Promise.resolve(42) : number
|
||
|
>Promise.resolve(42) : Promise<number>
|
||
|
>Promise.resolve : { (): Promise<void>; <T>(value: T | PromiseLike<T>): Promise<T>; }
|
||
|
>Promise : PromiseConstructor
|
||
|
>resolve : { (): Promise<void>; <T>(value: T | PromiseLike<T>): Promise<T>; }
|
||
|
>42 : 42
|
||
|
}
|
||
|
async static *#bazBad() { yield 42; }
|
||
|
>#bazBad : () => AsyncGenerator<number, void, unknown>
|
||
|
>yield 42 : any
|
||
|
>42 : 42
|
||
|
}
|
||
|
|
||
|
|
||
|
|