class Foo { #x = 0; #y = this.#x + 1; test() { return this.#y; } } const f = new Foo(); expect(f.test()).toBe(1);