* Remove error for static private accessors * Private static accessors strict * Add loose mode support * Move `value` decl for early return * Reuse getter/setter template * Reuse getter/setter templates * Use `buildUndefinedNode` in accessor templates * Extract `isAccessor` variable
19 lines
396 B
JavaScript
19 lines
396 B
JavaScript
class Cl {
|
|
static #PRIVATE_STATIC_FIELD = "top secret string";
|
|
|
|
static get #privateStaticFieldValue() {
|
|
return Cl.#PRIVATE_STATIC_FIELD;
|
|
}
|
|
|
|
static set #privateStaticFieldValue(newValue) {
|
|
Cl.#PRIVATE_STATIC_FIELD = `Updated: ${newValue}`;
|
|
}
|
|
|
|
static getValue() {
|
|
return Cl.#privateStaticFieldValue;
|
|
}
|
|
|
|
static setValue() {
|
|
Cl.#privateStaticFieldValue = "dank";
|
|
}
|
|
} |