1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
=== tests/cases/conformance/classes/members/privateNames/privateNamesAndMethods.ts ===
class A {
>A : A
#foo(a: number) {}
>#foo : (a: number) => void
>a : number
async #bar(a: number) {}
>#bar : (a: number) => Promise<void>
>a : number
async *#baz(a: number) {
>#baz : (a: number) => AsyncGenerator<never, number, unknown>
>a : number
return 3;
>3 : 3
}
#_quux: number;
>#_quux : number
get #quux (): number {
>#quux : number
return this.#_quux;
>this.#_quux : number
>this : this
}
set #quux (val: number) {
>#quux : number
>val : number
this.#_quux = val;
>this.#_quux = val : number
>this.#_quux : number
>this : this
>val : number
}
constructor () {
this.#foo(30);
>this.#foo(30) : void
>this.#foo : (a: number) => void
>this : this
>30 : 30
this.#bar(30);
>this.#bar(30) : Promise<void>
>this.#bar : (a: number) => Promise<void>
>this : this
>30 : 30
this.#baz(30);
>this.#baz(30) : AsyncGenerator<never, number, unknown>
>this.#baz : (a: number) => AsyncGenerator<never, number, unknown>
>this : this
>30 : 30
this.#quux = this.#quux + 1;
>this.#quux = this.#quux + 1 : number
>this.#quux : number
>this : this
>this.#quux + 1 : number
>this.#quux : number
>this : this
>1 : 1
this.#quux++;
>this.#quux++ : number
>this.#quux : number
>this : this
}
}
class B extends A {
>B : B
>A : A
#foo(a: string) {}
>#foo : (a: string) => void
>a : string
constructor () {
super();
>super() : void
>super : typeof A
this.#foo("str");
>this.#foo("str") : void
>this.#foo : (a: string) => void
>this : this
>"str" : "str"
}
}
|