10 lines
113 B
JavaScript

class A {
#method() {}
run() {
this.#method = 2;
}
}
expect(() => new A().run()).toThrow(TypeError);