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