blob: 898dccc487c8a3c366583b9c15f123c5d7ee54ae [file] [log] [blame]
function assert(a, e) {
if (a !== e)
throw new Error("Expected: " + e + " but got: " + a);
}
class C {
#m() {
return this.#f;
}
method() {
return this.#m();
}
#f = 4;
}
let c = new C();
assert(c.method(), 4);
try {
class C {
#m() { return 3; }
}
let o = new C();
c.method.call(o);
} catch (e) {
assert(e instanceof TypeError, true);
}