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
|
//// [autoAccessor2.ts]
class C1 {
accessor #a: any;
accessor #b = 1;
static accessor #c: any;
static accessor #d = 2;
constructor() {
this.#a = 3;
this.#b = 4;
}
static {
this.#c = 5;
this.#d = 6;
}
}
//// [autoAccessor2.js]
class C1 {
#a_accessor_storage;
get #a() { return this.#a_accessor_storage; }
set #a(value) { this.#a_accessor_storage = value; }
#b_accessor_storage = 1;
get #b() { return this.#b_accessor_storage; }
set #b(value) { this.#b_accessor_storage = value; }
static #c_accessor_storage;
static get #c() { return this.#c_accessor_storage; }
static set #c(value) { this.#c_accessor_storage = value; }
static #d_accessor_storage = 2;
static get #d() { return this.#d_accessor_storage; }
static set #d(value) { this.#d_accessor_storage = value; }
constructor() {
this.#a = 3;
this.#b = 4;
}
static {
this.#c = 5;
this.#d = 6;
}
}
|