File: privateNameFieldClassExpression.js

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (40 lines) | stat: -rw-r--r-- 1,098 bytes parent folder | download
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
//// [privateNameFieldClassExpression.ts]
class B {
    #foo = class {
        constructor() {
            console.log("hello");
        }
        static test = 123;
    };
    #foo2 = class Foo {
        static otherClass = 123;
    };
}




//// [privateNameFieldClassExpression.js]
var __setFunctionName = (this && this.__setFunctionName) || function (f, name, prefix) {
    if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
    return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
var _B_foo, _B_foo2;
class B {
    constructor() {
        var _a, _b;
        _B_foo.set(this, (_a = class {
                constructor() {
                    console.log("hello");
                }
            },
            __setFunctionName(_a, "#foo"),
            _a.test = 123,
            _a));
        _B_foo2.set(this, (_b = class Foo {
            },
            _b.otherClass = 123,
            _b));
    }
}
_B_foo = new WeakMap(), _B_foo2 = new WeakMap();