| 1 |
class Foo { |
| 2 |
static #x = 1; |
| 3 |
static #self = Foo; |
| 4 |
static self = Foo; |
| 5 |
static getSelf() { return this } |
| 6 |
|
| 7 |
static test() { |
| 8 |
const o = { Foo: Foo }; |
| 9 |
const deep = { very: { o } }; |
| 10 |
function fn() { |
| 11 |
return o; |
| 12 |
} |
| 13 |
function fnDeep() { |
| 14 |
return deep; |
| 15 |
} |
| 16 |
|
| 17 |
o?.Foo.#x; |
| 18 |
o?.Foo.#x.toString; |
| 19 |
o?.Foo.#x.toString(); |
| 20 |
|
| 21 |
deep?.very.o?.Foo.#x; |
| 22 |
deep?.very.o?.Foo.#x.toString; |
| 23 |
deep?.very.o?.Foo.#x.toString(); |
| 24 |
|
| 25 |
o?.Foo.#self.#x; |
| 26 |
o?.Foo.#self.self.#x; |
| 27 |
o?.Foo.#self?.self.#x; |
| 28 |
o?.Foo.#self.self?.self.#x; |
| 29 |
o?.Foo.#self?.self?.self.#x; |
| 30 |
|
| 31 |
o?.Foo.#self.getSelf().#x; |
| 32 |
o?.Foo.#self.getSelf?.().#x; |
| 33 |
o?.Foo.#self?.getSelf().#x; |
| 34 |
o?.Foo.#self?.getSelf?.().#x; |
| 35 |
o?.Foo.#self.getSelf()?.self.#x; |
| 36 |
o?.Foo.#self.getSelf?.()?.self.#x; |
| 37 |
o?.Foo.#self?.getSelf()?.self.#x; |
| 38 |
o?.Foo.#self?.getSelf?.()?.self.#x; |
| 39 |
|
| 40 |
fn?.().Foo.#x; |
| 41 |
fn?.().Foo.#x.toString; |
| 42 |
fn?.().Foo.#x.toString(); |
| 43 |
|
| 44 |
fnDeep?.().very.o?.Foo.#x; |
| 45 |
fnDeep?.().very.o?.Foo.#x.toString; |
| 46 |
fnDeep?.().very.o?.Foo.#x.toString(); |
| 47 |
|
| 48 |
fn?.().Foo.#self.#x; |
| 49 |
fn?.().Foo.#self.self.#x; |
| 50 |
fn?.().Foo.#self?.self.#x; |
| 51 |
fn?.().Foo.#self.self?.self.#x; |
| 52 |
fn?.().Foo.#self?.self?.self.#x; |
| 53 |
|
| 54 |
fn?.().Foo.#self.getSelf().#x; |
| 55 |
fn?.().Foo.#self.getSelf?.().#x; |
| 56 |
fn?.().Foo.#self?.getSelf().#x; |
| 57 |
fn?.().Foo.#self?.getSelf?.().#x; |
| 58 |
fn?.().Foo.#self.getSelf()?.self.#x; |
| 59 |
fn?.().Foo.#self.getSelf?.()?.self.#x; |
| 60 |
fn?.().Foo.#self?.getSelf()?.self.#x; |
| 61 |
fn?.().Foo.#self?.getSelf?.()?.self.#x; |
| 62 |
|
| 63 |
} |
| 64 |
} |
| 65 |
|
| 66 |
Foo.test(); |