mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
17 lines
282 B
JavaScript
17 lines
282 B
JavaScript
class A {
|
|
counter = 0;
|
|
#method() {}
|
|
self() {
|
|
this.counter++;
|
|
return this;
|
|
}
|
|
|
|
constructor() {
|
|
expect(() => this.self().#method = 2).toThrow(TypeError);
|
|
expect(this.counter).toBe(1);
|
|
expect(() => ([this.#method] = [2])).toThrow(TypeError);
|
|
}
|
|
}
|
|
|
|
new A;
|