* Add accessor loose support * Add private accessors spec support * Fix private dupe name check * Changes from code review * Add duplicated names tests * Add get/set-only tests * Move accessors tests * Split out updates tests * Add helper change tests * Update test output * Update test options
23 lines
410 B
JavaScript
23 lines
410 B
JavaScript
class Cl {
|
|
#privateField = "top secret string";
|
|
|
|
constructor() {
|
|
this.publicField = "not secret string";
|
|
}
|
|
|
|
get #privateFieldValue() {
|
|
return this.#privateField;
|
|
}
|
|
|
|
set #privateFieldValue(newValue) {
|
|
this.#privateField = newValue;
|
|
}
|
|
|
|
publicGetPrivateField() {
|
|
return this.#privateFieldValue;
|
|
}
|
|
|
|
publicSetPrivateField(newValue) {
|
|
this.#privateFieldValue = newValue;
|
|
}
|
|
} |