forked from babel/babel
/
output.js
86 lines (86 loc) · 2.2 KB
/
output.js
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
var _initStatic, _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _computedKey, _init_computedKey7;
const logs = [];
const dec = (value, context) => {
logs.push(context.name);
};
const f = () => {
logs.push("computing f");
return {
[Symbol.toPrimitive]: () => (logs.push("calling toPrimitive"), "f()")
};
};
_computedKey = babelHelpers.toPropertyKey(f());
class Foo {
static {
[_init_a, _init_a2, _get_a, _set_a, _init_computedKey, _init_computedKey2, _init_computedKey3, _init_computedKey4, _init_computedKey5, _init_computedKey6, _init_computedKey7, _initStatic] = babelHelpers.applyDecs(this, [[dec, 6, "a"], [dec, 6, "a", function () {
return this.#B;
}, function (value) {
this.#B = value;
}], [dec, 6, "b"], [dec, 6, "c"], [dec, 6, 0], [dec, 6, 1], [dec, 6, 2n], [dec, 6, 3n], [dec, 6, _computedKey]], []);
_initStatic(this);
}
static #A = _init_a(this);
static get a() {
return this.#A;
}
static set a(v) {
this.#A = v;
}
static #B = _init_a2(this);
static set #a(v) {
_set_a(this, v);
}
static get #a() {
return _get_a(this);
}
static #C = _init_computedKey(this);
static get "b"() {
return this.#C;
}
static set "b"(v) {
this.#C = v;
}
static #D = _init_computedKey2(this);
static get ["c"]() {
return this.#D;
}
static set ["c"](v) {
this.#D = v;
}
static #E = _init_computedKey3(this);
static get 0() {
return this.#E;
}
static set 0(v) {
this.#E = v;
}
static #F = _init_computedKey4(this);
static get [1]() {
return this.#F;
}
static set [1](v) {
this.#F = v;
}
static #G = _init_computedKey5(this);
static get 2n() {
return this.#G;
}
static set 2n(v) {
this.#G = v;
}
static #H = _init_computedKey6(this);
static get [3n]() {
return this.#H;
}
static set [3n](v) {
this.#H = v;
}
static #I = _init_computedKey7(this);
static get [_computedKey]() {
return this.#I;
}
static set [_computedKey](v) {
this.#I = v;
}
}
expect(logs).toStrictEqual(["computing f", "calling toPrimitive", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]);