blob: 177f0dddb19fca8fc2e26c4ea8cad4bc784e3492 [file] [log] [blame]
//@ requireOptions("--usePrivateMethods=true")
let assert = {
sameValue: function (lhs, rhs) {
if (lhs !== rhs)
throw new Error("Expected: " + rhs + " bug got: " + lhs);
}
};
(function () {
class C {
#m() { return 'test'; }
field = eval('this.#m()');
}
let c = new C();
assert.sameValue(c.field, 'test');
})();
(function () {
class C {
get #m() { return 'test'; }
field = eval('this.#m');
}
let c = new C();
assert.sameValue(c.field, 'test');
})();