[d24f17c] | 1 | var _typeof = require("./typeof.js")["default"];
|
---|
| 2 | var _Array$isArray = require("core-js-pure/features/array/is-array.js");
|
---|
| 3 | var _Object$getOwnPropertyDescriptor = require("core-js-pure/features/object/get-own-property-descriptor.js");
|
---|
| 4 | var _bindInstanceProperty = require("core-js-pure/features/instance/bind.js");
|
---|
| 5 | var _pushInstanceProperty = require("core-js-pure/features/instance/push.js");
|
---|
| 6 | var _Object$defineProperty = require("core-js-pure/features/object/define-property.js");
|
---|
| 7 | var _Symbol$metadata = require("core-js-pure/features/symbol/metadata.js");
|
---|
| 8 | var _Symbol$for = require("core-js-pure/features/symbol/for.js");
|
---|
| 9 | var _Object$create = require("core-js-pure/features/object/create.js");
|
---|
| 10 | var _Map = require("core-js-pure/features/map/index.js");
|
---|
| 11 | var checkInRHS = require("./checkInRHS.js");
|
---|
| 12 | var setFunctionName = require("./setFunctionName.js");
|
---|
| 13 | var toPropertyKey = require("./toPropertyKey.js");
|
---|
| 14 | function applyDecs2305(e, t, r, n, o, a) {
|
---|
| 15 | function i(e, t, r) {
|
---|
| 16 | return function (n, o) {
|
---|
| 17 | return r && r(n), e[t].call(n, o);
|
---|
| 18 | };
|
---|
| 19 | }
|
---|
| 20 | function c(e, t) {
|
---|
| 21 | for (var r = 0; r < e.length; r++) e[r].call(t);
|
---|
| 22 | return t;
|
---|
| 23 | }
|
---|
| 24 | function s(e, t, r, n) {
|
---|
| 25 | if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined"));
|
---|
| 26 | return e;
|
---|
| 27 | }
|
---|
| 28 | function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) {
|
---|
| 29 | var _context2;
|
---|
| 30 | function m(e) {
|
---|
| 31 | if (!h(e)) throw new TypeError("Attempted to access private element on non-instance");
|
---|
| 32 | }
|
---|
| 33 | var y,
|
---|
| 34 | v = t[0],
|
---|
| 35 | g = t[3],
|
---|
| 36 | b = !u;
|
---|
| 37 | if (!b) {
|
---|
| 38 | r || _Array$isArray(v) || (v = [v]);
|
---|
| 39 | var w = {},
|
---|
| 40 | S = [],
|
---|
| 41 | A = 3 === o ? "get" : 4 === o || d ? "set" : "value";
|
---|
| 42 | f ? (p || d ? w = {
|
---|
| 43 | get: setFunctionName(function () {
|
---|
| 44 | return g(this);
|
---|
| 45 | }, n, "get"),
|
---|
| 46 | set: function set(e) {
|
---|
| 47 | t[4](this, e);
|
---|
| 48 | }
|
---|
| 49 | } : w[A] = g, p || setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = _Object$getOwnPropertyDescriptor(e, n));
|
---|
| 50 | }
|
---|
| 51 | for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) {
|
---|
| 52 | var _context;
|
---|
| 53 | var D = v[j],
|
---|
| 54 | E = r ? v[j - 1] : void 0,
|
---|
| 55 | I = {},
|
---|
| 56 | O = {
|
---|
| 57 | kind: ["field", "accessor", "method", "getter", "setter", "class"][o],
|
---|
| 58 | name: n,
|
---|
| 59 | metadata: a,
|
---|
| 60 | addInitializer: _bindInstanceProperty(_context = function _context(e, t) {
|
---|
| 61 | if (e.v) throw new Error("attempted to call addInitializer after decoration was finished");
|
---|
| 62 | s(t, "An initializer", "be", !0), _pushInstanceProperty(c).call(c, t);
|
---|
| 63 | }).call(_context, null, I)
|
---|
| 64 | };
|
---|
| 65 | try {
|
---|
| 66 | if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else {
|
---|
| 67 | var k, F;
|
---|
| 68 | O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) {
|
---|
| 69 | return m(e), w.value;
|
---|
| 70 | } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) {
|
---|
| 71 | return e[n];
|
---|
| 72 | }, (o < 2 || 4 === o) && (F = function F(e, t) {
|
---|
| 73 | e[n] = t;
|
---|
| 74 | }));
|
---|
| 75 | var N = O.access = {
|
---|
| 76 | has: f ? _bindInstanceProperty(h).call(h) : function (e) {
|
---|
| 77 | return n in e;
|
---|
| 78 | }
|
---|
| 79 | };
|
---|
| 80 | if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? {
|
---|
| 81 | get: w.get,
|
---|
| 82 | set: w.set
|
---|
| 83 | } : w[A], O), d) {
|
---|
| 84 | if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && _pushInstanceProperty(S).call(S, y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
---|
| 85 | } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? _pushInstanceProperty(S).call(S, P) : w[A] = P);
|
---|
| 86 | }
|
---|
| 87 | } finally {
|
---|
| 88 | I.v = !0;
|
---|
| 89 | }
|
---|
| 90 | }
|
---|
| 91 | return (p || d) && _pushInstanceProperty(u).call(u, function (e, t) {
|
---|
| 92 | for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t);
|
---|
| 93 | return t;
|
---|
| 94 | }), p || b || (f ? d ? _pushInstanceProperty(u).call(u, i(w, "get"), i(w, "set")) : _pushInstanceProperty(u).call(u, 2 === o ? w[A] : _bindInstanceProperty(_context2 = i.call).call(_context2, w[A])) : _Object$defineProperty(e, n, w)), P;
|
---|
| 95 | }
|
---|
| 96 | function u(e, t) {
|
---|
| 97 | return _Object$defineProperty(e, _Symbol$metadata || _Symbol$for("Symbol.metadata"), {
|
---|
| 98 | configurable: !0,
|
---|
| 99 | enumerable: !0,
|
---|
| 100 | value: t
|
---|
| 101 | });
|
---|
| 102 | }
|
---|
| 103 | if (arguments.length >= 6) var l = a[_Symbol$metadata || _Symbol$for("Symbol.metadata")];
|
---|
| 104 | var f = _Object$create(null == l ? null : l),
|
---|
| 105 | p = function (e, t, r, n) {
|
---|
| 106 | var o,
|
---|
| 107 | a,
|
---|
| 108 | i = [],
|
---|
| 109 | s = function s(t) {
|
---|
| 110 | return checkInRHS(t) === e;
|
---|
| 111 | },
|
---|
| 112 | u = new _Map();
|
---|
| 113 | function l(e) {
|
---|
| 114 | e && _pushInstanceProperty(i).call(i, _bindInstanceProperty(c).call(c, null, e));
|
---|
| 115 | }
|
---|
| 116 | for (var f = 0; f < t.length; f++) {
|
---|
| 117 | var p = t[f];
|
---|
| 118 | if (_Array$isArray(p)) {
|
---|
| 119 | var d = p[1],
|
---|
| 120 | h = p[2],
|
---|
| 121 | m = p.length > 3,
|
---|
| 122 | y = 16 & d,
|
---|
| 123 | v = !!(8 & d),
|
---|
| 124 | g = 0 == (d &= 7),
|
---|
| 125 | b = h + "/" + v;
|
---|
| 126 | if (!g && !m) {
|
---|
| 127 | var w = u.get(b);
|
---|
| 128 | if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h);
|
---|
| 129 | u.set(b, !(d > 2) || d);
|
---|
| 130 | }
|
---|
| 131 | applyDec(v ? e : e.prototype, p, y, m ? "#" + h : toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r);
|
---|
| 132 | }
|
---|
| 133 | }
|
---|
| 134 | return l(o), l(a), i;
|
---|
| 135 | }(e, t, o, f);
|
---|
| 136 | return r.length || u(e, f), {
|
---|
| 137 | e: p,
|
---|
| 138 | get c() {
|
---|
| 139 | var t = [];
|
---|
| 140 | return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), _bindInstanceProperty(c).call(c, null, t, e)];
|
---|
| 141 | }
|
---|
| 142 | };
|
---|
| 143 | }
|
---|
| 144 | module.exports = applyDecs2305, module.exports.__esModule = true, module.exports["default"] = module.exports; |
---|