| 1 |
class Foo { |
| 2 |
static #x = 1; |
| 3 |
|
| 4 |
static self = Foo; |
| 5 |
static #m = function() { return this.#x; }; |
| 6 |
static getSelf() { return Foo } |
| 7 |
|
| 8 |
test() { |
| 9 |
const o = { Foo: Foo }; |
| 10 |
const fn = function () { |
| 11 |
return o; |
| 12 |
}; |
| 13 |
|
| 14 |
(Foo?.#m)(); |
| 15 |
(Foo?.#m)().toString; |
| 16 |
(Foo?.#m)().toString(); |
| 17 |
|
| 18 |
(o?.Foo.#m)(); |
| 19 |
(o?.Foo.#m)().toString; |
| 20 |
(o?.Foo.#m)().toString(); |
| 21 |
|
| 22 |
(((o.Foo?.self.getSelf)())?.#m)(); |
| 23 |
(((o.Foo.self?.getSelf)())?.#m)(); |
| 24 |
|
| 25 |
(((fn()?.Foo?.self.getSelf)())?.#m)(); |
| 26 |
(((fn?.().Foo.self?.getSelf)())?.#m)(); |
| 27 |
} |
| 28 |
} |
| 29 |
|
| 30 |
(new Foo).test(); |