* 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
14 lines
210 B
JavaScript
14 lines
210 B
JavaScript
class Cl {
|
|
#privateField = 0;
|
|
|
|
get #privateFieldValue() {
|
|
return this.#privateField;
|
|
}
|
|
|
|
constructor() {
|
|
expect(() => this.#privateFieldValue = 1).toThrow(TypeError);
|
|
}
|
|
}
|
|
|
|
const cl = new Cl();
|