|
| 1 | +var _init_a, _init_a2, _get_a, _set_a, _init_computedKey, _computedKey, _init_computedKey2, _init_computedKey3, _computedKey2, _init_computedKey4, _init_computedKey5, _computedKey3, _init_computedKey6, _computedKey4, _init_computedKey7, _initStatic, _class; |
| 2 | +const logs = []; |
| 3 | +const dec = (value, context) => { |
| 4 | + logs.push(context.name); |
| 5 | +}; |
| 6 | +const f = () => { |
| 7 | + logs.push("computing f"); |
| 8 | + return { |
| 9 | + [Symbol.toPrimitive]: () => "f()" |
| 10 | + }; |
| 11 | +}; |
| 12 | +_computedKey = "c"; |
| 13 | +_computedKey2 = 1; |
| 14 | +_computedKey3 = 3n; |
| 15 | +_computedKey4 = f(); |
| 16 | +var _a = /*#__PURE__*/new WeakMap(); |
| 17 | +class Foo { |
| 18 | + constructor() { |
| 19 | + babelHelpers.classPrivateFieldInitSpec(this, _a, { |
| 20 | + get: _get_a2, |
| 21 | + set: _set_a2 |
| 22 | + }); |
| 23 | + } |
| 24 | + static get a() { |
| 25 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _A); |
| 26 | + } |
| 27 | + static set a(v) { |
| 28 | + babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _A, v); |
| 29 | + } |
| 30 | + static get "b"() { |
| 31 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _C); |
| 32 | + } |
| 33 | + static set "b"(v) { |
| 34 | + babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _C, v); |
| 35 | + } |
| 36 | + static get [_computedKey]() { |
| 37 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _D); |
| 38 | + } |
| 39 | + static set [_computedKey](v) { |
| 40 | + babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _D, v); |
| 41 | + } |
| 42 | + static get 0() { |
| 43 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _E); |
| 44 | + } |
| 45 | + static set 0(v) { |
| 46 | + babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _E, v); |
| 47 | + } |
| 48 | + static get [_computedKey2]() { |
| 49 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _F); |
| 50 | + } |
| 51 | + static set [_computedKey2](v) { |
| 52 | + babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _F, v); |
| 53 | + } |
| 54 | + static get 2n() { |
| 55 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _G); |
| 56 | + } |
| 57 | + static set 2n(v) { |
| 58 | + babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _G, v); |
| 59 | + } |
| 60 | + static get [_computedKey3]() { |
| 61 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _H); |
| 62 | + } |
| 63 | + static set [_computedKey3](v) { |
| 64 | + babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _H, v); |
| 65 | + } |
| 66 | + static get [_computedKey4]() { |
| 67 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, Foo, _I); |
| 68 | + } |
| 69 | + static set [_computedKey4](v) { |
| 70 | + babelHelpers.classStaticPrivateFieldSpecSet(this, Foo, _I, v); |
| 71 | + } |
| 72 | +} |
| 73 | +_class = Foo; |
| 74 | +function _set_a2(v) { |
| 75 | + _set_a(this, v); |
| 76 | +} |
| 77 | +function _get_a2() { |
| 78 | + return _get_a(this); |
| 79 | +} |
| 80 | +(() => { |
| 81 | + [_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(_class, [[dec, 6, "a"], [dec, 6, "a", function () { |
| 82 | + return babelHelpers.classStaticPrivateFieldSpecGet(this, _class, _B); |
| 83 | + }, function (value) { |
| 84 | + babelHelpers.classStaticPrivateFieldSpecSet(this, _class, _B, value); |
| 85 | + }], [dec, 6, "b"], [dec, 6, _computedKey], [dec, 6, 0], [dec, 6, _computedKey2], [dec, 6, 2n], [dec, 6, _computedKey3], [dec, 6, _computedKey4]], []); |
| 86 | + _initStatic(_class); |
| 87 | +})(); |
| 88 | +var _A = { |
| 89 | + writable: true, |
| 90 | + value: _init_a(_class) |
| 91 | +}; |
| 92 | +var _B = { |
| 93 | + writable: true, |
| 94 | + value: _init_a2(_class) |
| 95 | +}; |
| 96 | +var _C = { |
| 97 | + writable: true, |
| 98 | + value: _init_computedKey(_class) |
| 99 | +}; |
| 100 | +var _D = { |
| 101 | + writable: true, |
| 102 | + value: _init_computedKey2(_class) |
| 103 | +}; |
| 104 | +var _E = { |
| 105 | + writable: true, |
| 106 | + value: _init_computedKey3(_class) |
| 107 | +}; |
| 108 | +var _F = { |
| 109 | + writable: true, |
| 110 | + value: _init_computedKey4(_class) |
| 111 | +}; |
| 112 | +var _G = { |
| 113 | + writable: true, |
| 114 | + value: _init_computedKey5(_class) |
| 115 | +}; |
| 116 | +var _H = { |
| 117 | + writable: true, |
| 118 | + value: _init_computedKey6(_class) |
| 119 | +}; |
| 120 | +var _I = { |
| 121 | + writable: true, |
| 122 | + value: _init_computedKey7(_class) |
| 123 | +}; |
| 124 | +expect(logs).toStrictEqual(["computing f", "a", "#a", "b", "c", "0", "1", "2", "3", "f()"]); |
0 commit comments