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
|
=== tests/cases/conformance/classes/members/privateNames/privateNameStaticAccessors.ts ===
class A1 {
>A1 : A1
static get #prop() { return ""; }
>#prop : string
>"" : ""
static set #prop(param: string) { }
>#prop : string
>param : string
static get #roProp() { return ""; }
>#roProp : string
>"" : ""
constructor(name: string) {
>name : string
A1.#prop = "";
>A1.#prop = "" : ""
>A1.#prop : string
>A1 : typeof A1
>"" : ""
A1.#roProp = ""; // Error
>A1.#roProp = "" : ""
>A1.#roProp : any
>A1 : typeof A1
>"" : ""
console.log(A1.#prop);
>console.log(A1.#prop) : void
>console.log : (...data: any[]) => void
>console : Console
>log : (...data: any[]) => void
>A1.#prop : string
>A1 : typeof A1
console.log(A1.#roProp);
>console.log(A1.#roProp) : void
>console.log : (...data: any[]) => void
>console : Console
>log : (...data: any[]) => void
>A1.#roProp : string
>A1 : typeof A1
}
}
|