blob: 1317e1e77e4336d4edb8b8307f635bd80a6a2f88 [file] [log] [blame]
//@ requireOptions("--usePrivateMethods=true")
let assert = {
sameValue: function (lhs, rhs) {
if (lhs !== rhs)
throw new Error("Expected: " + lhs + " bug got: " + rhs);
}
};
class C {
#m() { return this._v; }
getPrivateMethod() {
return this.#m;
}
}
let c = new C();
let o1 = {_v: 'test262'};
let o2 = {_v: 'foo'};
assert.sameValue(c.getPrivateMethod().call(o1), 'test262');
assert.sameValue(c.getPrivateMethod().call(o2), 'foo');