1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
|
// SPDX-License-Identifier: MIT OR LGPL-2.0-or-later
// SPDX-FileCopyrightText: 2018 Philip Chimento <philip.chimento@gmail.com>
const a = {
foo: 1,
bar: null,
tres: undefined,
[Symbol('s')]: 'string',
};
class Parent {
#privateField;
constructor() {
this.#privateField = 1;
}
}
class Child extends Parent {
#subPrivateField;
meaningOfLife = 42;
constructor() {
super();
this.#subPrivateField = 2;
}
}
class PrivateTest extends Child {
#child;
childVisible;
#customToStringChild;
#circular1;
#circular2;
#selfRef;
#date;
#privateFunc;
constructor() {
super();
this.#child = new Child();
this.childVisible = new Child();
this.#customToStringChild = new Child();
this.#customToStringChild.toString = () => 'Custom child!';
this.#circular2 = {};
this.#circular1 = {n: this.#circular2};
this.#circular2.n = this.#circular1;
this.#selfRef = this;
this.#date = new Date('2025-01-07T00:53:42.417Z');
this.#privateFunc = () => 1;
}
}
const b = new PrivateTest();
debugger;
void (a, b);
|