@datapos/datapos-development 0.3.321 → 0.3.323
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/datapos-development.es.js +552 -552
- package/dist/datapos-development.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -419,7 +419,7 @@ const _i = (e) => (t, i, r, n) => {
|
|
|
419
419
|
}, cn = (e) => (t, i, r) => _i(e)(t, i, r), hn = (e) => async (t, i, r) => {
|
|
420
420
|
const n = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
421
421
|
return ki(e)(t, i, n);
|
|
422
|
-
},
|
|
422
|
+
}, ln = (e) => async (t, i, r) => ki(e)(t, i, r), pn = (e) => (t, i, r) => {
|
|
423
423
|
const n = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
424
424
|
return Ut(e)(t, i, n);
|
|
425
425
|
}, fn = (e) => (t, i, r) => Ut(e)(t, i, r), dn = (e) => async (t, i, r) => {
|
|
@@ -899,9 +899,9 @@ const ta = {
|
|
|
899
899
|
t.pattern ?? (t.pattern = vn), W.init(e, t);
|
|
900
900
|
}), ha = /* @__PURE__ */ k("$ZodULID", (e, t) => {
|
|
901
901
|
t.pattern ?? (t.pattern = xn), W.init(e, t);
|
|
902
|
-
}),
|
|
902
|
+
}), la = /* @__PURE__ */ k("$ZodXID", (e, t) => {
|
|
903
903
|
t.pattern ?? (t.pattern = gn), W.init(e, t);
|
|
904
|
-
}),
|
|
904
|
+
}), pa = /* @__PURE__ */ k("$ZodKSUID", (e, t) => {
|
|
905
905
|
t.pattern ?? (t.pattern = bn), W.init(e, t);
|
|
906
906
|
}), fa = /* @__PURE__ */ k("$ZodISODateTime", (e, t) => {
|
|
907
907
|
t.pattern ?? (t.pattern = Dn(t)), W.init(e, t);
|
|
@@ -1168,14 +1168,14 @@ const La = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1168
1168
|
const S = [], w = h.shape;
|
|
1169
1169
|
for (const A of h.keys) {
|
|
1170
1170
|
const Z = w[A]._zod.run({ value: o[A], issues: [] }, y);
|
|
1171
|
-
Z instanceof Promise ? S.push(Z.then((
|
|
1171
|
+
Z instanceof Promise ? S.push(Z.then((le) => Mt(le, d, A, o))) : Mt(Z, d, A, o);
|
|
1172
1172
|
}
|
|
1173
1173
|
return u ? $r(S, o, d, y, r.value, e) : S.length ? Promise.all(S).then(() => d) : d;
|
|
1174
1174
|
};
|
|
1175
1175
|
}), Oa = /* @__PURE__ */ k("$ZodObjectJIT", (e, t) => {
|
|
1176
1176
|
La.init(e, t);
|
|
1177
1177
|
const i = e._zod.parse, r = vi(() => Fr(t)), n = (A) => {
|
|
1178
|
-
const F = new ea(["shape", "payload", "ctx"]), Z = r.value,
|
|
1178
|
+
const F = new ea(["shape", "payload", "ctx"]), Z = r.value, le = (Ce) => {
|
|
1179
1179
|
const be = Fi(Ce);
|
|
1180
1180
|
return `shape[${be}]._zod.run({ value: input[${be}], issues: [] }, ctx)`;
|
|
1181
1181
|
};
|
|
@@ -1187,7 +1187,7 @@ const La = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1187
1187
|
F.write("const newResult = {};");
|
|
1188
1188
|
for (const Ce of Z.keys) {
|
|
1189
1189
|
const be = D[Ce], Ke = Fi(Ce);
|
|
1190
|
-
F.write(`const ${be} = ${
|
|
1190
|
+
F.write(`const ${be} = ${le(Ce)};`), F.write(`
|
|
1191
1191
|
if (${be}.issues.length) {
|
|
1192
1192
|
payload.issues = payload.issues.concat(${be}.issues.map(iss => ({
|
|
1193
1193
|
...iss,
|
|
@@ -1703,7 +1703,7 @@ function ho(e, t) {
|
|
|
1703
1703
|
...R(t)
|
|
1704
1704
|
});
|
|
1705
1705
|
}
|
|
1706
|
-
function
|
|
1706
|
+
function lo(e, t) {
|
|
1707
1707
|
return new e({
|
|
1708
1708
|
type: "string",
|
|
1709
1709
|
format: "ipv4",
|
|
@@ -1712,7 +1712,7 @@ function po(e, t) {
|
|
|
1712
1712
|
...R(t)
|
|
1713
1713
|
});
|
|
1714
1714
|
}
|
|
1715
|
-
function
|
|
1715
|
+
function po(e, t) {
|
|
1716
1716
|
return new e({
|
|
1717
1717
|
type: "string",
|
|
1718
1718
|
format: "ipv6",
|
|
@@ -2062,7 +2062,7 @@ const Yo = (e, t) => {
|
|
|
2062
2062
|
});
|
|
2063
2063
|
}, Te = k("ZodError", Yo, {
|
|
2064
2064
|
Parent: Error
|
|
2065
|
-
}), Qo = /* @__PURE__ */ _i(Te), eu = /* @__PURE__ */ ki(Te), tu = /* @__PURE__ */ Ut(Te), iu = /* @__PURE__ */ qt(Te), ru = /* @__PURE__ */ un(Te), su = /* @__PURE__ */ cn(Te), nu = /* @__PURE__ */ hn(Te), au = /* @__PURE__ */
|
|
2065
|
+
}), Qo = /* @__PURE__ */ _i(Te), eu = /* @__PURE__ */ ki(Te), tu = /* @__PURE__ */ Ut(Te), iu = /* @__PURE__ */ qt(Te), ru = /* @__PURE__ */ un(Te), su = /* @__PURE__ */ cn(Te), nu = /* @__PURE__ */ hn(Te), au = /* @__PURE__ */ ln(Te), ou = /* @__PURE__ */ pn(Te), uu = /* @__PURE__ */ fn(Te), cu = /* @__PURE__ */ dn(Te), hu = /* @__PURE__ */ mn(Te), ee = /* @__PURE__ */ k("ZodType", (e, t) => (Y.init(e, t), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.check = (...i) => e.clone(Je(t, {
|
|
2066
2066
|
checks: [
|
|
2067
2067
|
...t.checks ?? [],
|
|
2068
2068
|
...i.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
|
|
@@ -2084,15 +2084,15 @@ const Yo = (e, t) => {
|
|
|
2084
2084
|
Si.init(e, t), ee.init(e, t);
|
|
2085
2085
|
const i = e._zod.bag;
|
|
2086
2086
|
e.format = i.format ?? null, e.minLength = i.minimum ?? null, e.maxLength = i.maximum ?? null, e.regex = (...r) => e.check(Eo(...r)), e.includes = (...r) => e.check(Lo(...r)), e.startsWith = (...r) => e.check(Oo(...r)), e.endsWith = (...r) => e.check(Ro(...r)), e.min = (...r) => e.check(Vt(...r)), e.max = (...r) => e.check(Br(...r)), e.length = (...r) => e.check(Zr(...r)), e.nonempty = (...r) => e.check(Vt(1, ...r)), e.lowercase = (r) => e.check(Io(r)), e.uppercase = (r) => e.check(No(r)), e.trim = () => e.check(Mo()), e.normalize = (...r) => e.check(Do(...r)), e.toLowerCase = () => e.check(Vo()), e.toUpperCase = () => e.check(zo()), e.slugify = () => e.check(jo());
|
|
2087
|
-
}),
|
|
2088
|
-
Si.init(e, t), Ur.init(e, t), e.email = (i) => e.check(Ya(
|
|
2087
|
+
}), lu = /* @__PURE__ */ k("ZodString", (e, t) => {
|
|
2088
|
+
Si.init(e, t), Ur.init(e, t), e.email = (i) => e.check(Ya(pu, i)), e.url = (i) => e.check(ro(fu, i)), e.jwt = (i) => e.check(go(Au, i)), e.emoji = (i) => e.check(so(du, i)), e.guid = (i) => e.check(Ji(tr, i)), e.uuid = (i) => e.check(Qa(Ot, i)), e.uuidv4 = (i) => e.check(eo(Ot, i)), e.uuidv6 = (i) => e.check(to(Ot, i)), e.uuidv7 = (i) => e.check(io(Ot, i)), e.nanoid = (i) => e.check(no(mu, i)), e.guid = (i) => e.check(Ji(tr, i)), e.cuid = (i) => e.check(ao(yu, i)), e.cuid2 = (i) => e.check(oo(vu, i)), e.ulid = (i) => e.check(uo(xu, i)), e.base64 = (i) => e.check(yo(Tu, i)), e.base64url = (i) => e.check(vo(Pu, i)), e.xid = (i) => e.check(co(gu, i)), e.ksuid = (i) => e.check(ho(bu, i)), e.ipv4 = (i) => e.check(lo(_u, i)), e.ipv6 = (i) => e.check(po(ku, i)), e.cidrv4 = (i) => e.check(fo(Su, i)), e.cidrv6 = (i) => e.check(mo(wu, i)), e.e164 = (i) => e.check(xo(Cu, i)), e.datetime = (i) => e.check(qo(i)), e.date = (i) => e.check(Go(i)), e.time = (i) => e.check(Ko(i)), e.duration = (i) => e.check(Jo(i));
|
|
2089
2089
|
});
|
|
2090
2090
|
function O(e) {
|
|
2091
|
-
return Ja(
|
|
2091
|
+
return Ja(lu, e);
|
|
2092
2092
|
}
|
|
2093
2093
|
const Q = /* @__PURE__ */ k("ZodStringFormat", (e, t) => {
|
|
2094
2094
|
W.init(e, t), Ur.init(e, t);
|
|
2095
|
-
}),
|
|
2095
|
+
}), pu = /* @__PURE__ */ k("ZodEmail", (e, t) => {
|
|
2096
2096
|
sa.init(e, t), Q.init(e, t);
|
|
2097
2097
|
}), tr = /* @__PURE__ */ k("ZodGUID", (e, t) => {
|
|
2098
2098
|
ia.init(e, t), Q.init(e, t);
|
|
@@ -2111,9 +2111,9 @@ const Q = /* @__PURE__ */ k("ZodStringFormat", (e, t) => {
|
|
|
2111
2111
|
}), xu = /* @__PURE__ */ k("ZodULID", (e, t) => {
|
|
2112
2112
|
ha.init(e, t), Q.init(e, t);
|
|
2113
2113
|
}), gu = /* @__PURE__ */ k("ZodXID", (e, t) => {
|
|
2114
|
-
pa.init(e, t), Q.init(e, t);
|
|
2115
|
-
}), bu = /* @__PURE__ */ k("ZodKSUID", (e, t) => {
|
|
2116
2114
|
la.init(e, t), Q.init(e, t);
|
|
2115
|
+
}), bu = /* @__PURE__ */ k("ZodKSUID", (e, t) => {
|
|
2116
|
+
pa.init(e, t), Q.init(e, t);
|
|
2117
2117
|
}), _u = /* @__PURE__ */ k("ZodIPv4", (e, t) => {
|
|
2118
2118
|
va.init(e, t), Q.init(e, t);
|
|
2119
2119
|
}), ku = /* @__PURE__ */ k("ZodIPv6", (e, t) => {
|
|
@@ -2210,7 +2210,7 @@ function ge(e, t, i) {
|
|
|
2210
2210
|
...R(i)
|
|
2211
2211
|
});
|
|
2212
2212
|
}
|
|
2213
|
-
const
|
|
2213
|
+
const li = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
2214
2214
|
Va.init(e, t), ee.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
|
|
2215
2215
|
const i = new Set(Object.keys(t.entries));
|
|
2216
2216
|
e.extract = (r, n) => {
|
|
@@ -2220,7 +2220,7 @@ const pi = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
2220
2220
|
u[h] = t.entries[h];
|
|
2221
2221
|
else
|
|
2222
2222
|
throw new Error(`Key ${h} not found in enum`);
|
|
2223
|
-
return new
|
|
2223
|
+
return new li({
|
|
2224
2224
|
...t,
|
|
2225
2225
|
checks: [],
|
|
2226
2226
|
...R(n),
|
|
@@ -2233,7 +2233,7 @@ const pi = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
2233
2233
|
delete u[h];
|
|
2234
2234
|
else
|
|
2235
2235
|
throw new Error(`Key ${h} not found in enum`);
|
|
2236
|
-
return new
|
|
2236
|
+
return new li({
|
|
2237
2237
|
...t,
|
|
2238
2238
|
checks: [],
|
|
2239
2239
|
...R(n),
|
|
@@ -2243,7 +2243,7 @@ const pi = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
2243
2243
|
});
|
|
2244
2244
|
function Gt(e, t) {
|
|
2245
2245
|
const i = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
|
|
2246
|
-
return new
|
|
2246
|
+
return new li({
|
|
2247
2247
|
type: "enum",
|
|
2248
2248
|
entries: i,
|
|
2249
2249
|
...R(t)
|
|
@@ -2402,7 +2402,7 @@ const sc = ["amber", "green", "red", "other"], nc = Gt(sc), ac = ["alpha", "beta
|
|
|
2402
2402
|
"presenter",
|
|
2403
2403
|
"presenterPresentation",
|
|
2404
2404
|
"tool"
|
|
2405
|
-
], cc = Gt(uc), hc = ae([b("en-au"), b("en-gb"), b("en-us"), b("es-es")]),
|
|
2405
|
+
], cc = Gt(uc), hc = ae([b("en-au"), b("en-gb"), b("en-us"), b("es-es")]), lc = ge(hc, O()), pc = Ne({
|
|
2406
2406
|
id: O(),
|
|
2407
2407
|
color: nc,
|
|
2408
2408
|
label: O()
|
|
@@ -2414,7 +2414,7 @@ const sc = ["amber", "green", "red", "other"], nc = Gt(sc), ac = ["alpha", "beta
|
|
|
2414
2414
|
icon: O().optional(),
|
|
2415
2415
|
iconDark: O().optional(),
|
|
2416
2416
|
lastUpdatedAt: De().optional(),
|
|
2417
|
-
status:
|
|
2417
|
+
status: pc.nullable().optional(),
|
|
2418
2418
|
statusId: oc,
|
|
2419
2419
|
typeId: cc
|
|
2420
2420
|
}), dc = ae([b("app"), b("engine"), b("connector"), b("context"), b("presenter"), b("tool")]), mc = Ne({
|
|
@@ -2425,7 +2425,7 @@ const sc = ["amber", "green", "red", "other"], nc = Gt(sc), ac = ["alpha", "beta
|
|
|
2425
2425
|
canDescribe: Nu().optional(),
|
|
2426
2426
|
id: O().optional(),
|
|
2427
2427
|
authMethodId: ae([b("apiKey"), b("disabled"), b("oAuth2"), b("none")]),
|
|
2428
|
-
label:
|
|
2428
|
+
label: lc.optional(),
|
|
2429
2429
|
maxConnectionCount: De().optional(),
|
|
2430
2430
|
params: He(ge(O(), O())).optional()
|
|
2431
2431
|
}), vc = ae([b("application"), b("curatedDataset"), b("database"), b("fileStore")]), xc = ae([
|
|
@@ -2597,7 +2597,7 @@ var Bc = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166,
|
|
|
2597
2597
|
"5module": ni + " export import",
|
|
2598
2598
|
6: ni + " const class extends export import super"
|
|
2599
2599
|
}, qc = /^in(stanceof)?$/, Hc = new RegExp("[" + Xr + "]"), Gc = new RegExp("[" + Xr + Zc + "]");
|
|
2600
|
-
function
|
|
2600
|
+
function pi(e, t) {
|
|
2601
2601
|
for (var i = 65536, r = 0; r < t.length; r += 2) {
|
|
2602
2602
|
if (i += t[r], i > e)
|
|
2603
2603
|
return !1;
|
|
@@ -2607,10 +2607,10 @@ function li(e, t) {
|
|
|
2607
2607
|
return !1;
|
|
2608
2608
|
}
|
|
2609
2609
|
function Ee(e, t) {
|
|
2610
|
-
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Hc.test(String.fromCharCode(e)) : t === !1 ? !1 :
|
|
2610
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Hc.test(String.fromCharCode(e)) : t === !1 ? !1 : pi(e, Kr);
|
|
2611
2611
|
}
|
|
2612
2612
|
function Me(e, t) {
|
|
2613
|
-
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Gc.test(String.fromCharCode(e)) : t === !1 ? !1 :
|
|
2613
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Gc.test(String.fromCharCode(e)) : t === !1 ? !1 : pi(e, Kr) || pi(e, Bc);
|
|
2614
2614
|
}
|
|
2615
2615
|
var z = function(t, i) {
|
|
2616
2616
|
i === void 0 && (i = {}), this.label = t, this.keyword = i.keyword, this.beforeExpr = !!i.beforeExpr, this.startsExpr = !!i.startsExpr, this.isLoop = !!i.isLoop, this.isAssign = !!i.isAssign, this.prefix = !!i.prefix, this.postfix = !!i.postfix, this.binop = i.binop || null, this.updateContext = null;
|
|
@@ -2622,7 +2622,7 @@ var ke = { beforeExpr: !0 }, fe = { startsExpr: !0 }, at = {};
|
|
|
2622
2622
|
function $(e, t) {
|
|
2623
2623
|
return t === void 0 && (t = {}), t.keyword = e, at[e] = new z(e, t);
|
|
2624
2624
|
}
|
|
2625
|
-
var
|
|
2625
|
+
var l = {
|
|
2626
2626
|
num: new z("num", fe),
|
|
2627
2627
|
regexp: new z("regexp", fe),
|
|
2628
2628
|
string: new z("string", fe),
|
|
@@ -2852,12 +2852,12 @@ var zt = {
|
|
|
2852
2852
|
// When enabled, parenthesized expressions are represented by
|
|
2853
2853
|
// (non-standard) ParenthesizedExpression nodes
|
|
2854
2854
|
preserveParens: !1
|
|
2855
|
-
},
|
|
2855
|
+
}, lr = !1;
|
|
2856
2856
|
function Jc(e) {
|
|
2857
2857
|
var t = {};
|
|
2858
2858
|
for (var i in zt)
|
|
2859
2859
|
t[i] = e && ht(e, i) ? e[i] : zt[i];
|
|
2860
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
2860
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!lr && typeof console == "object" && console.warn && (lr = !0, console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
2861
2861
|
Defaulting to 2020, but this will stop working in the future.`)), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved == null && (t.allowReserved = t.ecmaVersion < 5), (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), cr(t.onToken)) {
|
|
2862
2862
|
var r = t.onToken;
|
|
2863
2863
|
t.onToken = function(n) {
|
|
@@ -2877,9 +2877,9 @@ function Yc(e, t) {
|
|
|
2877
2877
|
e.locations && (y.loc = new kt(this, h, d)), e.ranges && (y.range = [n, u]), t.push(y);
|
|
2878
2878
|
};
|
|
2879
2879
|
}
|
|
2880
|
-
var _t = 1,
|
|
2880
|
+
var _t = 1, lt = 2, Pi = 4, es = 8, Ci = 16, ts = 32, Wt = 64, is = 128, Qe = 256, St = 512, Kt = _t | lt | Qe;
|
|
2881
2881
|
function Ai(e, t) {
|
|
2882
|
-
return
|
|
2882
|
+
return lt | (e ? Pi : 0) | (t ? es : 0);
|
|
2883
2883
|
}
|
|
2884
2884
|
var jt = 0, Ei = 1, je = 2, rs = 3, ss = 4, ns = 5, J = function(t, i, r) {
|
|
2885
2885
|
this.options = t = Jc(t), this.sourceFile = t.sourceFile, this.keywords = Ze(Uc[t.ecmaVersion >= 6 ? 6 : t.sourceType === "module" ? "5module" : 5]);
|
|
@@ -2887,14 +2887,14 @@ var jt = 0, Ei = 1, je = 2, rs = 3, ss = 4, ns = 5, J = function(t, i, r) {
|
|
|
2887
2887
|
t.allowReserved !== !0 && (n = si[t.ecmaVersion >= 6 ? 6 : t.ecmaVersion === 5 ? 5 : 3], t.sourceType === "module" && (n += " await")), this.reservedWords = Ze(n);
|
|
2888
2888
|
var u = (n ? n + " " : "") + si.strict;
|
|
2889
2889
|
this.reservedWordsStrict = Ze(u), this.reservedWordsStrictBind = Ze(u + " " + si.strictBind), this.input = String(i), this.containsEsc = !1, r ? (this.pos = r, this.lineStart = this.input.lastIndexOf(`
|
|
2890
|
-
`, r - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(ce).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type =
|
|
2890
|
+
`, r - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(ce).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = l.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = t.sourceType === "module", this.strict = this.inModule || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && t.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(_t), this.regexpState = null, this.privateNameStack = [];
|
|
2891
2891
|
}, Le = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
|
|
2892
2892
|
J.prototype.parse = function() {
|
|
2893
2893
|
var t = this.options.program || this.startNode();
|
|
2894
2894
|
return this.nextToken(), this.parseTopLevel(t);
|
|
2895
2895
|
};
|
|
2896
2896
|
Le.inFunction.get = function() {
|
|
2897
|
-
return (this.currentVarScope().flags &
|
|
2897
|
+
return (this.currentVarScope().flags & lt) > 0;
|
|
2898
2898
|
};
|
|
2899
2899
|
Le.inGenerator.get = function() {
|
|
2900
2900
|
return (this.currentVarScope().flags & es) > 0;
|
|
@@ -2907,7 +2907,7 @@ Le.canAwait.get = function() {
|
|
|
2907
2907
|
var t = this.scopeStack[e], i = t.flags;
|
|
2908
2908
|
if (i & (Qe | St))
|
|
2909
2909
|
return !1;
|
|
2910
|
-
if (i &
|
|
2910
|
+
if (i & lt)
|
|
2911
2911
|
return (i & Pi) > 0;
|
|
2912
2912
|
}
|
|
2913
2913
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
@@ -2925,7 +2925,7 @@ Le.treatFunctionsAsVar.get = function() {
|
|
|
2925
2925
|
Le.allowNewDotTarget.get = function() {
|
|
2926
2926
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
2927
2927
|
var t = this.scopeStack[e], i = t.flags;
|
|
2928
|
-
if (i & (Qe | St) || i &
|
|
2928
|
+
if (i & (Qe | St) || i & lt && !(i & Ci))
|
|
2929
2929
|
return !0;
|
|
2930
2930
|
}
|
|
2931
2931
|
return !1;
|
|
@@ -2971,7 +2971,7 @@ he.eat = function(e) {
|
|
|
2971
2971
|
return this.type === e ? (this.next(), !0) : !1;
|
|
2972
2972
|
};
|
|
2973
2973
|
he.isContextual = function(e) {
|
|
2974
|
-
return this.type ===
|
|
2974
|
+
return this.type === l.name && this.value === e && !this.containsEsc;
|
|
2975
2975
|
};
|
|
2976
2976
|
he.eatContextual = function(e) {
|
|
2977
2977
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
@@ -2980,14 +2980,14 @@ he.expectContextual = function(e) {
|
|
|
2980
2980
|
this.eatContextual(e) || this.unexpected();
|
|
2981
2981
|
};
|
|
2982
2982
|
he.canInsertSemicolon = function() {
|
|
2983
|
-
return this.type ===
|
|
2983
|
+
return this.type === l.eof || this.type === l.braceR || ce.test(this.input.slice(this.lastTokEnd, this.start));
|
|
2984
2984
|
};
|
|
2985
2985
|
he.insertSemicolon = function() {
|
|
2986
2986
|
if (this.canInsertSemicolon())
|
|
2987
2987
|
return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
2988
2988
|
};
|
|
2989
2989
|
he.semicolon = function() {
|
|
2990
|
-
!this.eat(
|
|
2990
|
+
!this.eat(l.semi) && !this.insertSemicolon() && this.unexpected();
|
|
2991
2991
|
};
|
|
2992
2992
|
he.afterTrailingComma = function(e, t) {
|
|
2993
2993
|
if (this.type === e)
|
|
@@ -3026,7 +3026,7 @@ he.isSimpleAssignTarget = function(e) {
|
|
|
3026
3026
|
var I = J.prototype;
|
|
3027
3027
|
I.parseTopLevel = function(e) {
|
|
3028
3028
|
var t = /* @__PURE__ */ Object.create(null);
|
|
3029
|
-
for (e.body || (e.body = []); this.type !==
|
|
3029
|
+
for (e.body || (e.body = []); this.type !== l.eof; ) {
|
|
3030
3030
|
var i = this.parseStatement(null, !0, t);
|
|
3031
3031
|
e.body.push(i);
|
|
3032
3032
|
}
|
|
@@ -3099,50 +3099,50 @@ I.isUsing = function(e) {
|
|
|
3099
3099
|
};
|
|
3100
3100
|
I.parseStatement = function(e, t, i) {
|
|
3101
3101
|
var r = this.type, n = this.startNode(), u;
|
|
3102
|
-
switch (this.isLet(e) && (r =
|
|
3103
|
-
case
|
|
3104
|
-
case
|
|
3102
|
+
switch (this.isLet(e) && (r = l._var, u = "let"), r) {
|
|
3103
|
+
case l._break:
|
|
3104
|
+
case l._continue:
|
|
3105
3105
|
return this.parseBreakContinueStatement(n, r.keyword);
|
|
3106
|
-
case
|
|
3106
|
+
case l._debugger:
|
|
3107
3107
|
return this.parseDebuggerStatement(n);
|
|
3108
|
-
case
|
|
3108
|
+
case l._do:
|
|
3109
3109
|
return this.parseDoStatement(n);
|
|
3110
|
-
case
|
|
3110
|
+
case l._for:
|
|
3111
3111
|
return this.parseForStatement(n);
|
|
3112
|
-
case
|
|
3112
|
+
case l._function:
|
|
3113
3113
|
return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(n, !1, !e);
|
|
3114
|
-
case
|
|
3114
|
+
case l._class:
|
|
3115
3115
|
return e && this.unexpected(), this.parseClass(n, !0);
|
|
3116
|
-
case
|
|
3116
|
+
case l._if:
|
|
3117
3117
|
return this.parseIfStatement(n);
|
|
3118
|
-
case
|
|
3118
|
+
case l._return:
|
|
3119
3119
|
return this.parseReturnStatement(n);
|
|
3120
|
-
case
|
|
3120
|
+
case l._switch:
|
|
3121
3121
|
return this.parseSwitchStatement(n);
|
|
3122
|
-
case
|
|
3122
|
+
case l._throw:
|
|
3123
3123
|
return this.parseThrowStatement(n);
|
|
3124
|
-
case
|
|
3124
|
+
case l._try:
|
|
3125
3125
|
return this.parseTryStatement(n);
|
|
3126
|
-
case
|
|
3127
|
-
case
|
|
3126
|
+
case l._const:
|
|
3127
|
+
case l._var:
|
|
3128
3128
|
return u = u || this.value, e && u !== "var" && this.unexpected(), this.parseVarStatement(n, u);
|
|
3129
|
-
case
|
|
3129
|
+
case l._while:
|
|
3130
3130
|
return this.parseWhileStatement(n);
|
|
3131
|
-
case
|
|
3131
|
+
case l._with:
|
|
3132
3132
|
return this.parseWithStatement(n);
|
|
3133
|
-
case
|
|
3133
|
+
case l.braceL:
|
|
3134
3134
|
return this.parseBlock(!0, n);
|
|
3135
|
-
case
|
|
3135
|
+
case l.semi:
|
|
3136
3136
|
return this.parseEmptyStatement(n);
|
|
3137
|
-
case
|
|
3138
|
-
case
|
|
3139
|
-
if (this.options.ecmaVersion > 10 && r ===
|
|
3137
|
+
case l._export:
|
|
3138
|
+
case l._import:
|
|
3139
|
+
if (this.options.ecmaVersion > 10 && r === l._import) {
|
|
3140
3140
|
ne.lastIndex = this.pos;
|
|
3141
3141
|
var h = ne.exec(this.input), d = this.pos + h[0].length, y = this.input.charCodeAt(d);
|
|
3142
3142
|
if (y === 40 || y === 46)
|
|
3143
3143
|
return this.parseExpressionStatement(n, this.parseExpression());
|
|
3144
3144
|
}
|
|
3145
|
-
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r ===
|
|
3145
|
+
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === l._import ? this.parseImport(n) : this.parseExport(n, i);
|
|
3146
3146
|
// If the statement does not start with a statement keyword or a
|
|
3147
3147
|
// brace, it's an ExpressionStatement or LabeledStatement. We
|
|
3148
3148
|
// simply start parsing an expression, and afterwards, if the
|
|
@@ -3155,12 +3155,12 @@ I.parseStatement = function(e, t, i) {
|
|
|
3155
3155
|
if (o)
|
|
3156
3156
|
return t && this.options.sourceType === "script" && this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script`"), o === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(n, !1, o), this.semicolon(), this.finishNode(n, "VariableDeclaration");
|
|
3157
3157
|
var S = this.value, w = this.parseExpression();
|
|
3158
|
-
return r ===
|
|
3158
|
+
return r === l.name && w.type === "Identifier" && this.eat(l.colon) ? this.parseLabeledStatement(n, S, w, e) : this.parseExpressionStatement(n, w);
|
|
3159
3159
|
}
|
|
3160
3160
|
};
|
|
3161
3161
|
I.parseBreakContinueStatement = function(e, t) {
|
|
3162
3162
|
var i = t === "break";
|
|
3163
|
-
this.next(), this.eat(
|
|
3163
|
+
this.next(), this.eat(l.semi) || this.insertSemicolon() ? e.label = null : this.type !== l.name ? this.unexpected() : (e.label = this.parseIdent(), this.semicolon());
|
|
3164
3164
|
for (var r = 0; r < this.labels.length; ++r) {
|
|
3165
3165
|
var n = this.labels[r];
|
|
3166
3166
|
if ((e.label == null || n.name === e.label.name) && (n.kind != null && (i || n.kind === "loop") || e.label && i))
|
|
@@ -3172,15 +3172,15 @@ I.parseDebuggerStatement = function(e) {
|
|
|
3172
3172
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
3173
3173
|
};
|
|
3174
3174
|
I.parseDoStatement = function(e) {
|
|
3175
|
-
return this.next(), this.labels.push(Ii), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(
|
|
3175
|
+
return this.next(), this.labels.push(Ii), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(l._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(l.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
3176
3176
|
};
|
|
3177
3177
|
I.parseForStatement = function(e) {
|
|
3178
3178
|
this.next();
|
|
3179
3179
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
3180
|
-
if (this.labels.push(Ii), this.enterScope(0), this.expect(
|
|
3180
|
+
if (this.labels.push(Ii), this.enterScope(0), this.expect(l.parenL), this.type === l.semi)
|
|
3181
3181
|
return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
3182
3182
|
var i = this.isLet();
|
|
3183
|
-
if (this.type ===
|
|
3183
|
+
if (this.type === l._var || this.type === l._const || i) {
|
|
3184
3184
|
var r = this.startNode(), n = i ? "let" : this.value;
|
|
3185
3185
|
return this.next(), this.parseVar(r, !0, n), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
3186
3186
|
}
|
|
@@ -3190,26 +3190,26 @@ I.parseForStatement = function(e) {
|
|
|
3190
3190
|
return this.next(), d === "await using" && this.next(), this.parseVar(y, !0, d), this.finishNode(y, "VariableDeclaration"), this.parseForAfterInit(e, y, t);
|
|
3191
3191
|
}
|
|
3192
3192
|
var o = this.containsEsc, S = new Xt(), w = this.start, A = t > -1 ? this.parseExprSubscripts(S, "await") : this.parseExpression(!0, S);
|
|
3193
|
-
return this.type ===
|
|
3193
|
+
return this.type === l._in || (h = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === l._in && this.unexpected(t), e.await = !0) : h && this.options.ecmaVersion >= 8 && (A.start === w && !o && A.type === "Identifier" && A.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), u && h && this.raise(A.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(A, !1, S), this.checkLValPattern(A), this.parseForIn(e, A)) : (this.checkExpressionErrors(S, !0), t > -1 && this.unexpected(t), this.parseFor(e, A));
|
|
3194
3194
|
};
|
|
3195
3195
|
I.parseForAfterInit = function(e, t, i) {
|
|
3196
|
-
return (this.type ===
|
|
3196
|
+
return (this.type === l._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === l._in ? i > -1 && this.unexpected(i) : e.await = i > -1), this.parseForIn(e, t)) : (i > -1 && this.unexpected(i), this.parseFor(e, t));
|
|
3197
3197
|
};
|
|
3198
3198
|
I.parseFunctionStatement = function(e, t, i) {
|
|
3199
3199
|
return this.next(), this.parseFunction(e, xt | (i ? 0 : fi), !1, t);
|
|
3200
3200
|
};
|
|
3201
3201
|
I.parseIfStatement = function(e) {
|
|
3202
|
-
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(
|
|
3202
|
+
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(l._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
3203
3203
|
};
|
|
3204
3204
|
I.parseReturnStatement = function(e) {
|
|
3205
|
-
return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(
|
|
3205
|
+
return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(l.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
3206
3206
|
};
|
|
3207
3207
|
I.parseSwitchStatement = function(e) {
|
|
3208
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(
|
|
3209
|
-
for (var t, i = !1; this.type !==
|
|
3210
|
-
if (this.type ===
|
|
3211
|
-
var r = this.type ===
|
|
3212
|
-
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (i && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), i = !0, t.test = null), this.expect(
|
|
3208
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(l.braceL), this.labels.push(eh), this.enterScope(0);
|
|
3209
|
+
for (var t, i = !1; this.type !== l.braceR; )
|
|
3210
|
+
if (this.type === l._case || this.type === l._default) {
|
|
3211
|
+
var r = this.type === l._case;
|
|
3212
|
+
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (i && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), i = !0, t.test = null), this.expect(l.colon);
|
|
3213
3213
|
} else
|
|
3214
3214
|
t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
3215
3215
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
@@ -3220,14 +3220,14 @@ I.parseThrowStatement = function(e) {
|
|
|
3220
3220
|
var th = [];
|
|
3221
3221
|
I.parseCatchClauseParam = function() {
|
|
3222
3222
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
3223
|
-
return this.enterScope(t ? ts : 0), this.checkLValPattern(e, t ? ss : je), this.expect(
|
|
3223
|
+
return this.enterScope(t ? ts : 0), this.checkLValPattern(e, t ? ss : je), this.expect(l.parenR), e;
|
|
3224
3224
|
};
|
|
3225
3225
|
I.parseTryStatement = function(e) {
|
|
3226
|
-
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type ===
|
|
3226
|
+
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === l._catch) {
|
|
3227
3227
|
var t = this.startNode();
|
|
3228
|
-
this.next(), this.eat(
|
|
3228
|
+
this.next(), this.eat(l.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
3229
3229
|
}
|
|
3230
|
-
return e.finalizer = this.eat(
|
|
3230
|
+
return e.finalizer = this.eat(l._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
3231
3231
|
};
|
|
3232
3232
|
I.parseVarStatement = function(e, t, i) {
|
|
3233
3233
|
return this.next(), this.parseVar(e, !1, t, i), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
@@ -3246,7 +3246,7 @@ I.parseLabeledStatement = function(e, t, i, r) {
|
|
|
3246
3246
|
var h = u[n];
|
|
3247
3247
|
h.name === t && this.raise(i.start, "Label '" + t + "' is already declared");
|
|
3248
3248
|
}
|
|
3249
|
-
for (var d = this.type.isLoop ? "loop" : this.type ===
|
|
3249
|
+
for (var d = this.type.isLoop ? "loop" : this.type === l._switch ? "switch" : null, y = this.labels.length - 1; y >= 0; y--) {
|
|
3250
3250
|
var o = this.labels[y];
|
|
3251
3251
|
if (o.statementStart === e.start)
|
|
3252
3252
|
o.statementStart = this.start, o.kind = d;
|
|
@@ -3259,26 +3259,26 @@ I.parseExpressionStatement = function(e, t) {
|
|
|
3259
3259
|
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
3260
3260
|
};
|
|
3261
3261
|
I.parseBlock = function(e, t, i) {
|
|
3262
|
-
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(
|
|
3262
|
+
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(l.braceL), e && this.enterScope(0); this.type !== l.braceR; ) {
|
|
3263
3263
|
var r = this.parseStatement(null);
|
|
3264
3264
|
t.body.push(r);
|
|
3265
3265
|
}
|
|
3266
3266
|
return i && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
3267
3267
|
};
|
|
3268
3268
|
I.parseFor = function(e, t) {
|
|
3269
|
-
return e.init = t, this.expect(
|
|
3269
|
+
return e.init = t, this.expect(l.semi), e.test = this.type === l.semi ? null : this.parseExpression(), this.expect(l.semi), e.update = this.type === l.parenR ? null : this.parseExpression(), this.expect(l.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
3270
3270
|
};
|
|
3271
3271
|
I.parseForIn = function(e, t) {
|
|
3272
|
-
var i = this.type ===
|
|
3272
|
+
var i = this.type === l._in;
|
|
3273
3273
|
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!i || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(
|
|
3274
3274
|
t.start,
|
|
3275
3275
|
(i ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"
|
|
3276
|
-
), e.left = t, e.right = i ? this.parseExpression() : this.parseMaybeAssign(), this.expect(
|
|
3276
|
+
), e.left = t, e.right = i ? this.parseExpression() : this.parseMaybeAssign(), this.expect(l.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, i ? "ForInStatement" : "ForOfStatement");
|
|
3277
3277
|
};
|
|
3278
3278
|
I.parseVar = function(e, t, i, r) {
|
|
3279
3279
|
for (e.declarations = [], e.kind = i; ; ) {
|
|
3280
3280
|
var n = this.startNode();
|
|
3281
|
-
if (this.parseVarId(n, i), this.eat(
|
|
3281
|
+
if (this.parseVarId(n, i), this.eat(l.eq) ? n.init = this.parseMaybeAssign(t) : !r && i === "const" && !(this.type === l._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (i === "using" || i === "await using") && this.options.ecmaVersion >= 17 && this.type !== l._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + i + " declaration") : !r && n.id.type !== "Identifier" && !(t && (this.type === l._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : n.init = null, e.declarations.push(this.finishNode(n, "VariableDeclarator")), !this.eat(l.comma))
|
|
3282
3282
|
break;
|
|
3283
3283
|
}
|
|
3284
3284
|
return e;
|
|
@@ -3288,38 +3288,38 @@ I.parseVarId = function(e, t) {
|
|
|
3288
3288
|
};
|
|
3289
3289
|
var xt = 1, fi = 2, as = 4;
|
|
3290
3290
|
I.parseFunction = function(e, t, i, r, n) {
|
|
3291
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type ===
|
|
3291
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === l.star && t & fi && this.unexpected(), e.generator = this.eat(l.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & xt && (e.id = t & as && this.type !== l.name ? null : this.parseIdent(), e.id && !(t & fi) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Ei : je : rs));
|
|
3292
3292
|
var u = this.yieldPos, h = this.awaitPos, d = this.awaitIdentPos;
|
|
3293
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ai(e.async, e.generator)), t & xt || (e.id = this.type ===
|
|
3293
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ai(e.async, e.generator)), t & xt || (e.id = this.type === l.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, i, !1, n), this.yieldPos = u, this.awaitPos = h, this.awaitIdentPos = d, this.finishNode(e, t & xt ? "FunctionDeclaration" : "FunctionExpression");
|
|
3294
3294
|
};
|
|
3295
3295
|
I.parseFunctionParams = function(e) {
|
|
3296
|
-
this.expect(
|
|
3296
|
+
this.expect(l.parenL), e.params = this.parseBindingList(l.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
3297
3297
|
};
|
|
3298
3298
|
I.parseClass = function(e, t) {
|
|
3299
3299
|
this.next();
|
|
3300
3300
|
var i = this.strict;
|
|
3301
3301
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
3302
3302
|
var r = this.enterClassBody(), n = this.startNode(), u = !1;
|
|
3303
|
-
for (n.body = [], this.expect(
|
|
3303
|
+
for (n.body = [], this.expect(l.braceL); this.type !== l.braceR; ) {
|
|
3304
3304
|
var h = this.parseClassElement(e.superClass !== null);
|
|
3305
3305
|
h && (n.body.push(h), h.type === "MethodDefinition" && h.kind === "constructor" ? (u && this.raiseRecoverable(h.start, "Duplicate constructor in the same class"), u = !0) : h.key && h.key.type === "PrivateIdentifier" && ih(r, h) && this.raiseRecoverable(h.key.start, "Identifier '#" + h.key.name + "' has already been declared"));
|
|
3306
3306
|
}
|
|
3307
3307
|
return this.strict = i, this.next(), e.body = this.finishNode(n, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
3308
3308
|
};
|
|
3309
3309
|
I.parseClassElement = function(e) {
|
|
3310
|
-
if (this.eat(
|
|
3310
|
+
if (this.eat(l.semi))
|
|
3311
3311
|
return null;
|
|
3312
3312
|
var t = this.options.ecmaVersion, i = this.startNode(), r = "", n = !1, u = !1, h = "method", d = !1;
|
|
3313
3313
|
if (this.eatContextual("static")) {
|
|
3314
|
-
if (t >= 13 && this.eat(
|
|
3314
|
+
if (t >= 13 && this.eat(l.braceL))
|
|
3315
3315
|
return this.parseClassStaticBlock(i), i;
|
|
3316
|
-
this.isClassElementNameStart() || this.type ===
|
|
3316
|
+
this.isClassElementNameStart() || this.type === l.star ? d = !0 : r = "static";
|
|
3317
3317
|
}
|
|
3318
|
-
if (i.static = d, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type ===
|
|
3318
|
+
if (i.static = d, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === l.star) && !this.canInsertSemicolon() ? u = !0 : r = "async"), !r && (t >= 9 || !u) && this.eat(l.star) && (n = !0), !r && !u && !n) {
|
|
3319
3319
|
var y = this.value;
|
|
3320
3320
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? h = y : r = y);
|
|
3321
3321
|
}
|
|
3322
|
-
if (r ? (i.computed = !1, i.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), i.key.name = r, this.finishNode(i.key, "Identifier")) : this.parseClassElementName(i), t < 13 || this.type ===
|
|
3322
|
+
if (r ? (i.computed = !1, i.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), i.key.name = r, this.finishNode(i.key, "Identifier")) : this.parseClassElementName(i), t < 13 || this.type === l.parenL || h !== "method" || n || u) {
|
|
3323
3323
|
var o = !i.static && Ft(i, "constructor"), S = o && e;
|
|
3324
3324
|
o && h !== "method" && this.raise(i.key.start, "Constructor can't have get/set modifier"), i.kind = o ? "constructor" : h, this.parseClassMethod(i, n, u, S);
|
|
3325
3325
|
} else
|
|
@@ -3327,10 +3327,10 @@ I.parseClassElement = function(e) {
|
|
|
3327
3327
|
return i;
|
|
3328
3328
|
};
|
|
3329
3329
|
I.isClassElementNameStart = function() {
|
|
3330
|
-
return this.type ===
|
|
3330
|
+
return this.type === l.name || this.type === l.privateId || this.type === l.num || this.type === l.string || this.type === l.bracketL || this.type.keyword;
|
|
3331
3331
|
};
|
|
3332
3332
|
I.parseClassElementName = function(e) {
|
|
3333
|
-
this.type ===
|
|
3333
|
+
this.type === l.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
|
|
3334
3334
|
};
|
|
3335
3335
|
I.parseClassMethod = function(e, t, i, r) {
|
|
3336
3336
|
var n = e.key;
|
|
@@ -3339,22 +3339,22 @@ I.parseClassMethod = function(e, t, i, r) {
|
|
|
3339
3339
|
return e.kind === "get" && u.params.length !== 0 && this.raiseRecoverable(u.start, "getter should have no params"), e.kind === "set" && u.params.length !== 1 && this.raiseRecoverable(u.start, "setter should have exactly one param"), e.kind === "set" && u.params[0].type === "RestElement" && this.raiseRecoverable(u.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
3340
3340
|
};
|
|
3341
3341
|
I.parseClassField = function(e) {
|
|
3342
|
-
return Ft(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Ft(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(
|
|
3342
|
+
return Ft(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Ft(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(l.eq) ? (this.enterScope(St | Wt), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
3343
3343
|
};
|
|
3344
3344
|
I.parseClassStaticBlock = function(e) {
|
|
3345
3345
|
e.body = [];
|
|
3346
3346
|
var t = this.labels;
|
|
3347
|
-
for (this.labels = [], this.enterScope(Qe | Wt); this.type !==
|
|
3347
|
+
for (this.labels = [], this.enterScope(Qe | Wt); this.type !== l.braceR; ) {
|
|
3348
3348
|
var i = this.parseStatement(null);
|
|
3349
3349
|
e.body.push(i);
|
|
3350
3350
|
}
|
|
3351
3351
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
3352
3352
|
};
|
|
3353
3353
|
I.parseClassId = function(e, t) {
|
|
3354
|
-
this.type ===
|
|
3354
|
+
this.type === l.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, je, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
3355
3355
|
};
|
|
3356
3356
|
I.parseClassSuper = function(e) {
|
|
3357
|
-
e.superClass = this.eat(
|
|
3357
|
+
e.superClass = this.eat(l._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
3358
3358
|
};
|
|
3359
3359
|
I.enterClassBody = function() {
|
|
3360
3360
|
var e = { declared: /* @__PURE__ */ Object.create(null), used: [] };
|
|
@@ -3377,18 +3377,18 @@ function Ft(e, t) {
|
|
|
3377
3377
|
return !i && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
3378
3378
|
}
|
|
3379
3379
|
I.parseExportAllDeclaration = function(e, t) {
|
|
3380
|
-
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !==
|
|
3380
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== l.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
3381
3381
|
};
|
|
3382
3382
|
I.parseExport = function(e, t) {
|
|
3383
|
-
if (this.next(), this.eat(
|
|
3383
|
+
if (this.next(), this.eat(l.star))
|
|
3384
3384
|
return this.parseExportAllDeclaration(e, t);
|
|
3385
|
-
if (this.eat(
|
|
3385
|
+
if (this.eat(l._default))
|
|
3386
3386
|
return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
3387
3387
|
if (this.shouldParseExportStatement())
|
|
3388
3388
|
e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
3389
3389
|
else {
|
|
3390
3390
|
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from"))
|
|
3391
|
-
this.type !==
|
|
3391
|
+
this.type !== l.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
3392
3392
|
else {
|
|
3393
3393
|
for (var i = 0, r = e.specifiers; i < r.length; i += 1) {
|
|
3394
3394
|
var n = r[i];
|
|
@@ -3405,10 +3405,10 @@ I.parseExportDeclaration = function(e) {
|
|
|
3405
3405
|
};
|
|
3406
3406
|
I.parseExportDefaultDeclaration = function() {
|
|
3407
3407
|
var e;
|
|
3408
|
-
if (this.type ===
|
|
3408
|
+
if (this.type === l._function || (e = this.isAsyncFunction())) {
|
|
3409
3409
|
var t = this.startNode();
|
|
3410
3410
|
return this.next(), e && this.next(), this.parseFunction(t, xt | as, !1, e);
|
|
3411
|
-
} else if (this.type ===
|
|
3411
|
+
} else if (this.type === l._class) {
|
|
3412
3412
|
var i = this.startNode();
|
|
3413
3413
|
return this.parseClass(i, "nullableID");
|
|
3414
3414
|
} else {
|
|
@@ -3455,17 +3455,17 @@ I.parseExportSpecifier = function(e) {
|
|
|
3455
3455
|
};
|
|
3456
3456
|
I.parseExportSpecifiers = function(e) {
|
|
3457
3457
|
var t = [], i = !0;
|
|
3458
|
-
for (this.expect(
|
|
3458
|
+
for (this.expect(l.braceL); !this.eat(l.braceR); ) {
|
|
3459
3459
|
if (i)
|
|
3460
3460
|
i = !1;
|
|
3461
|
-
else if (this.expect(
|
|
3461
|
+
else if (this.expect(l.comma), this.afterTrailingComma(l.braceR))
|
|
3462
3462
|
break;
|
|
3463
3463
|
t.push(this.parseExportSpecifier(e));
|
|
3464
3464
|
}
|
|
3465
3465
|
return t;
|
|
3466
3466
|
};
|
|
3467
3467
|
I.parseImport = function(e) {
|
|
3468
|
-
return this.next(), this.type ===
|
|
3468
|
+
return this.next(), this.type === l.string ? (e.specifiers = th, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === l.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
3469
3469
|
};
|
|
3470
3470
|
I.parseImportSpecifier = function() {
|
|
3471
3471
|
var e = this.startNode();
|
|
@@ -3481,14 +3481,14 @@ I.parseImportNamespaceSpecifier = function() {
|
|
|
3481
3481
|
};
|
|
3482
3482
|
I.parseImportSpecifiers = function() {
|
|
3483
3483
|
var e = [], t = !0;
|
|
3484
|
-
if (this.type ===
|
|
3484
|
+
if (this.type === l.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(l.comma)))
|
|
3485
3485
|
return e;
|
|
3486
|
-
if (this.type ===
|
|
3486
|
+
if (this.type === l.star)
|
|
3487
3487
|
return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
3488
|
-
for (this.expect(
|
|
3488
|
+
for (this.expect(l.braceL); !this.eat(l.braceR); ) {
|
|
3489
3489
|
if (t)
|
|
3490
3490
|
t = !1;
|
|
3491
|
-
else if (this.expect(
|
|
3491
|
+
else if (this.expect(l.comma), this.afterTrailingComma(l.braceR))
|
|
3492
3492
|
break;
|
|
3493
3493
|
e.push(this.parseImportSpecifier());
|
|
3494
3494
|
}
|
|
@@ -3496,13 +3496,13 @@ I.parseImportSpecifiers = function() {
|
|
|
3496
3496
|
};
|
|
3497
3497
|
I.parseWithClause = function() {
|
|
3498
3498
|
var e = [];
|
|
3499
|
-
if (!this.eat(
|
|
3499
|
+
if (!this.eat(l._with))
|
|
3500
3500
|
return e;
|
|
3501
|
-
this.expect(
|
|
3502
|
-
for (var t = {}, i = !0; !this.eat(
|
|
3501
|
+
this.expect(l.braceL);
|
|
3502
|
+
for (var t = {}, i = !0; !this.eat(l.braceR); ) {
|
|
3503
3503
|
if (i)
|
|
3504
3504
|
i = !1;
|
|
3505
|
-
else if (this.expect(
|
|
3505
|
+
else if (this.expect(l.comma), this.afterTrailingComma(l.braceR))
|
|
3506
3506
|
break;
|
|
3507
3507
|
var r = this.parseImportAttribute(), n = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
3508
3508
|
ht(t, n) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + n + "'"), t[n] = !0, e.push(r);
|
|
@@ -3511,10 +3511,10 @@ I.parseWithClause = function() {
|
|
|
3511
3511
|
};
|
|
3512
3512
|
I.parseImportAttribute = function() {
|
|
3513
3513
|
var e = this.startNode();
|
|
3514
|
-
return e.key = this.type ===
|
|
3514
|
+
return e.key = this.type === l.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(l.colon), this.type !== l.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
3515
3515
|
};
|
|
3516
3516
|
I.parseModuleExportName = function() {
|
|
3517
|
-
if (this.options.ecmaVersion >= 13 && this.type ===
|
|
3517
|
+
if (this.options.ecmaVersion >= 13 && this.type === l.string) {
|
|
3518
3518
|
var e = this.parseLiteral(this.value);
|
|
3519
3519
|
return Xc.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
3520
3520
|
}
|
|
@@ -3591,29 +3591,29 @@ Pe.parseSpread = function(e) {
|
|
|
3591
3591
|
};
|
|
3592
3592
|
Pe.parseRestBinding = function() {
|
|
3593
3593
|
var e = this.startNode();
|
|
3594
|
-
return this.next(), this.options.ecmaVersion === 6 && this.type !==
|
|
3594
|
+
return this.next(), this.options.ecmaVersion === 6 && this.type !== l.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
3595
3595
|
};
|
|
3596
3596
|
Pe.parseBindingAtom = function() {
|
|
3597
3597
|
if (this.options.ecmaVersion >= 6)
|
|
3598
3598
|
switch (this.type) {
|
|
3599
|
-
case
|
|
3599
|
+
case l.bracketL:
|
|
3600
3600
|
var e = this.startNode();
|
|
3601
|
-
return this.next(), e.elements = this.parseBindingList(
|
|
3602
|
-
case
|
|
3601
|
+
return this.next(), e.elements = this.parseBindingList(l.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
3602
|
+
case l.braceL:
|
|
3603
3603
|
return this.parseObj(!0);
|
|
3604
3604
|
}
|
|
3605
3605
|
return this.parseIdent();
|
|
3606
3606
|
};
|
|
3607
3607
|
Pe.parseBindingList = function(e, t, i, r) {
|
|
3608
3608
|
for (var n = [], u = !0; !this.eat(e); )
|
|
3609
|
-
if (u ? u = !1 : this.expect(
|
|
3609
|
+
if (u ? u = !1 : this.expect(l.comma), t && this.type === l.comma)
|
|
3610
3610
|
n.push(null);
|
|
3611
3611
|
else {
|
|
3612
3612
|
if (i && this.afterTrailingComma(e))
|
|
3613
3613
|
break;
|
|
3614
|
-
if (this.type ===
|
|
3614
|
+
if (this.type === l.ellipsis) {
|
|
3615
3615
|
var h = this.parseRestBinding();
|
|
3616
|
-
this.parseBindingListItem(h), n.push(h), this.type ===
|
|
3616
|
+
this.parseBindingListItem(h), n.push(h), this.type === l.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
3617
3617
|
break;
|
|
3618
3618
|
} else
|
|
3619
3619
|
n.push(this.parseAssignableListItem(r));
|
|
@@ -3628,7 +3628,7 @@ Pe.parseBindingListItem = function(e) {
|
|
|
3628
3628
|
return e;
|
|
3629
3629
|
};
|
|
3630
3630
|
Pe.parseMaybeDefault = function(e, t, i) {
|
|
3631
|
-
if (i = i || this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(
|
|
3631
|
+
if (i = i || this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(l.eq))
|
|
3632
3632
|
return i;
|
|
3633
3633
|
var r = this.startNodeAt(e, t);
|
|
3634
3634
|
return r.left = i, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
@@ -3700,18 +3700,18 @@ var ue = function(t, i, r, n, u) {
|
|
|
3700
3700
|
f_expr: new ue("function", !0),
|
|
3701
3701
|
f_expr_gen: new ue("function", !0, !1, null, !0),
|
|
3702
3702
|
f_gen: new ue("function", !1, !1, null, !0)
|
|
3703
|
-
},
|
|
3704
|
-
|
|
3703
|
+
}, pt = J.prototype;
|
|
3704
|
+
pt.initialContext = function() {
|
|
3705
3705
|
return [H.b_stat];
|
|
3706
3706
|
};
|
|
3707
|
-
|
|
3707
|
+
pt.curContext = function() {
|
|
3708
3708
|
return this.context[this.context.length - 1];
|
|
3709
3709
|
};
|
|
3710
|
-
|
|
3710
|
+
pt.braceIsBlock = function(e) {
|
|
3711
3711
|
var t = this.curContext();
|
|
3712
|
-
return t === H.f_expr || t === H.f_stat ? !0 : e ===
|
|
3712
|
+
return t === H.f_expr || t === H.f_stat ? !0 : e === l.colon && (t === H.b_stat || t === H.b_expr) ? !t.isExpr : e === l._return || e === l.name && this.exprAllowed ? ce.test(this.input.slice(this.lastTokEnd, this.start)) : e === l._else || e === l.semi || e === l.eof || e === l.parenR || e === l.arrow ? !0 : e === l.braceL ? t === H.b_stat : e === l._var || e === l._const || e === l.name ? !1 : !this.exprAllowed;
|
|
3713
3713
|
};
|
|
3714
|
-
|
|
3714
|
+
pt.inGeneratorContext = function() {
|
|
3715
3715
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
3716
3716
|
var t = this.context[e];
|
|
3717
3717
|
if (t.token === "function")
|
|
@@ -3719,14 +3719,14 @@ lt.inGeneratorContext = function() {
|
|
|
3719
3719
|
}
|
|
3720
3720
|
return !1;
|
|
3721
3721
|
};
|
|
3722
|
-
|
|
3722
|
+
pt.updateContext = function(e) {
|
|
3723
3723
|
var t, i = this.type;
|
|
3724
|
-
i.keyword && e ===
|
|
3724
|
+
i.keyword && e === l.dot ? this.exprAllowed = !1 : (t = i.updateContext) ? t.call(this, e) : this.exprAllowed = i.beforeExpr;
|
|
3725
3725
|
};
|
|
3726
|
-
|
|
3726
|
+
pt.overrideContext = function(e) {
|
|
3727
3727
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
3728
3728
|
};
|
|
3729
|
-
|
|
3729
|
+
l.parenR.updateContext = l.braceR.updateContext = function() {
|
|
3730
3730
|
if (this.context.length === 1) {
|
|
3731
3731
|
this.exprAllowed = !0;
|
|
3732
3732
|
return;
|
|
@@ -3734,37 +3734,37 @@ p.parenR.updateContext = p.braceR.updateContext = function() {
|
|
|
3734
3734
|
var e = this.context.pop();
|
|
3735
3735
|
e === H.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
3736
3736
|
};
|
|
3737
|
-
|
|
3737
|
+
l.braceL.updateContext = function(e) {
|
|
3738
3738
|
this.context.push(this.braceIsBlock(e) ? H.b_stat : H.b_expr), this.exprAllowed = !0;
|
|
3739
3739
|
};
|
|
3740
|
-
|
|
3740
|
+
l.dollarBraceL.updateContext = function() {
|
|
3741
3741
|
this.context.push(H.b_tmpl), this.exprAllowed = !0;
|
|
3742
3742
|
};
|
|
3743
|
-
|
|
3744
|
-
var t = e ===
|
|
3743
|
+
l.parenL.updateContext = function(e) {
|
|
3744
|
+
var t = e === l._if || e === l._for || e === l._with || e === l._while;
|
|
3745
3745
|
this.context.push(t ? H.p_stat : H.p_expr), this.exprAllowed = !0;
|
|
3746
3746
|
};
|
|
3747
|
-
|
|
3747
|
+
l.incDec.updateContext = function() {
|
|
3748
3748
|
};
|
|
3749
|
-
|
|
3750
|
-
e.beforeExpr && e !==
|
|
3749
|
+
l._function.updateContext = l._class.updateContext = function(e) {
|
|
3750
|
+
e.beforeExpr && e !== l._else && !(e === l.semi && this.curContext() !== H.p_stat) && !(e === l._return && ce.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === l.colon || e === l.braceL) && this.curContext() === H.b_stat) ? this.context.push(H.f_expr) : this.context.push(H.f_stat), this.exprAllowed = !1;
|
|
3751
3751
|
};
|
|
3752
|
-
|
|
3752
|
+
l.colon.updateContext = function() {
|
|
3753
3753
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
3754
3754
|
};
|
|
3755
|
-
|
|
3755
|
+
l.backQuote.updateContext = function() {
|
|
3756
3756
|
this.curContext() === H.q_tmpl ? this.context.pop() : this.context.push(H.q_tmpl), this.exprAllowed = !1;
|
|
3757
3757
|
};
|
|
3758
|
-
|
|
3759
|
-
if (e ===
|
|
3758
|
+
l.star.updateContext = function(e) {
|
|
3759
|
+
if (e === l._function) {
|
|
3760
3760
|
var t = this.context.length - 1;
|
|
3761
3761
|
this.context[t] === H.f_expr ? this.context[t] = H.f_expr_gen : this.context[t] = H.f_gen;
|
|
3762
3762
|
}
|
|
3763
3763
|
this.exprAllowed = !0;
|
|
3764
3764
|
};
|
|
3765
|
-
|
|
3765
|
+
l.name.updateContext = function(e) {
|
|
3766
3766
|
var t = !1;
|
|
3767
|
-
this.options.ecmaVersion >= 6 && e !==
|
|
3767
|
+
this.options.ecmaVersion >= 6 && e !== l.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
3768
3768
|
};
|
|
3769
3769
|
var M = J.prototype;
|
|
3770
3770
|
M.checkPropClash = function(e, t, i) {
|
|
@@ -3801,9 +3801,9 @@ M.checkPropClash = function(e, t, i) {
|
|
|
3801
3801
|
};
|
|
3802
3802
|
M.parseExpression = function(e, t) {
|
|
3803
3803
|
var i = this.start, r = this.startLoc, n = this.parseMaybeAssign(e, t);
|
|
3804
|
-
if (this.type ===
|
|
3804
|
+
if (this.type === l.comma) {
|
|
3805
3805
|
var u = this.startNodeAt(i, r);
|
|
3806
|
-
for (u.expressions = [n]; this.eat(
|
|
3806
|
+
for (u.expressions = [n]; this.eat(l.comma); )
|
|
3807
3807
|
u.expressions.push(this.parseMaybeAssign(e, t));
|
|
3808
3808
|
return this.finishNode(u, "SequenceExpression");
|
|
3809
3809
|
}
|
|
@@ -3818,11 +3818,11 @@ M.parseMaybeAssign = function(e, t, i) {
|
|
|
3818
3818
|
var r = !1, n = -1, u = -1, h = -1;
|
|
3819
3819
|
t ? (n = t.parenthesizedAssign, u = t.trailingComma, h = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new Xt(), r = !0);
|
|
3820
3820
|
var d = this.start, y = this.startLoc;
|
|
3821
|
-
(this.type ===
|
|
3821
|
+
(this.type === l.parenL || this.type === l.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
3822
3822
|
var o = this.parseMaybeConditional(e, t);
|
|
3823
3823
|
if (i && (o = i.call(this, o, d, y)), this.type.isAssign) {
|
|
3824
3824
|
var S = this.startNodeAt(d, y);
|
|
3825
|
-
return S.operator = this.value, this.type ===
|
|
3825
|
+
return S.operator = this.value, this.type === l.eq && (o = this.toAssignable(o, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= o.start && (t.shorthandAssign = -1), this.type === l.eq ? this.checkLValPattern(o) : this.checkLValSimple(o), S.left = o, this.next(), S.right = this.parseMaybeAssign(e), h > -1 && (t.doubleProto = h), this.finishNode(S, "AssignmentExpression");
|
|
3826
3826
|
} else
|
|
3827
3827
|
r && this.checkExpressionErrors(t, !0);
|
|
3828
3828
|
return n > -1 && (t.parenthesizedAssign = n), u > -1 && (t.trailingComma = u), o;
|
|
@@ -3831,9 +3831,9 @@ M.parseMaybeConditional = function(e, t) {
|
|
|
3831
3831
|
var i = this.start, r = this.startLoc, n = this.parseExprOps(e, t);
|
|
3832
3832
|
if (this.checkExpressionErrors(t))
|
|
3833
3833
|
return n;
|
|
3834
|
-
if (this.eat(
|
|
3834
|
+
if (this.eat(l.question)) {
|
|
3835
3835
|
var u = this.startNodeAt(i, r);
|
|
3836
|
-
return u.test = n, u.consequent = this.parseMaybeAssign(), this.expect(
|
|
3836
|
+
return u.test = n, u.consequent = this.parseMaybeAssign(), this.expect(l.colon), u.alternate = this.parseMaybeAssign(e), this.finishNode(u, "ConditionalExpression");
|
|
3837
3837
|
}
|
|
3838
3838
|
return n;
|
|
3839
3839
|
};
|
|
@@ -3843,13 +3843,13 @@ M.parseExprOps = function(e, t) {
|
|
|
3843
3843
|
};
|
|
3844
3844
|
M.parseExprOp = function(e, t, i, r, n) {
|
|
3845
3845
|
var u = this.type.binop;
|
|
3846
|
-
if (u != null && (!n || this.type !==
|
|
3847
|
-
var h = this.type ===
|
|
3848
|
-
d && (u =
|
|
3846
|
+
if (u != null && (!n || this.type !== l._in) && u > r) {
|
|
3847
|
+
var h = this.type === l.logicalOR || this.type === l.logicalAND, d = this.type === l.coalesce;
|
|
3848
|
+
d && (u = l.logicalAND.binop);
|
|
3849
3849
|
var y = this.value;
|
|
3850
3850
|
this.next();
|
|
3851
3851
|
var o = this.start, S = this.startLoc, w = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, n), o, S, u, n), A = this.buildBinary(t, i, e, w, y, h || d);
|
|
3852
|
-
return (h && this.type ===
|
|
3852
|
+
return (h && this.type === l.coalesce || d && (this.type === l.logicalOR || this.type === l.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(A, t, i, r, n);
|
|
3853
3853
|
}
|
|
3854
3854
|
return e;
|
|
3855
3855
|
};
|
|
@@ -3863,10 +3863,10 @@ M.parseMaybeUnary = function(e, t, i, r) {
|
|
|
3863
3863
|
if (this.isContextual("await") && this.canAwait)
|
|
3864
3864
|
h = this.parseAwait(r), t = !0;
|
|
3865
3865
|
else if (this.type.prefix) {
|
|
3866
|
-
var d = this.startNode(), y = this.type ===
|
|
3866
|
+
var d = this.startNode(), y = this.type === l.incDec;
|
|
3867
3867
|
d.operator = this.value, d.prefix = !0, this.next(), d.argument = this.parseMaybeUnary(null, !0, y, r), this.checkExpressionErrors(e, !0), y ? this.checkLValSimple(d.argument) : this.strict && d.operator === "delete" && os(d.argument) ? this.raiseRecoverable(d.start, "Deleting local variable in strict mode") : d.operator === "delete" && di(d.argument) ? this.raiseRecoverable(d.start, "Private fields can not be deleted") : t = !0, h = this.finishNode(d, y ? "UpdateExpression" : "UnaryExpression");
|
|
3868
|
-
} else if (!t && this.type ===
|
|
3869
|
-
(r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), h = this.parsePrivateIdent(), this.type !==
|
|
3868
|
+
} else if (!t && this.type === l.privateId)
|
|
3869
|
+
(r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), h = this.parsePrivateIdent(), this.type !== l._in && this.unexpected();
|
|
3870
3870
|
else {
|
|
3871
3871
|
if (h = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e))
|
|
3872
3872
|
return h;
|
|
@@ -3875,7 +3875,7 @@ M.parseMaybeUnary = function(e, t, i, r) {
|
|
|
3875
3875
|
o.operator = this.value, o.prefix = !1, o.argument = h, this.checkLValSimple(h), this.next(), h = this.finishNode(o, "UpdateExpression");
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
3878
|
-
if (!i && this.eat(
|
|
3878
|
+
if (!i && this.eat(l.starstar))
|
|
3879
3879
|
if (t)
|
|
3880
3880
|
this.unexpected(this.lastTokStart);
|
|
3881
3881
|
else
|
|
@@ -3910,28 +3910,28 @@ M.parseSubscripts = function(e, t, i, r, n) {
|
|
|
3910
3910
|
}
|
|
3911
3911
|
};
|
|
3912
3912
|
M.shouldParseAsyncArrow = function() {
|
|
3913
|
-
return !this.canInsertSemicolon() && this.eat(
|
|
3913
|
+
return !this.canInsertSemicolon() && this.eat(l.arrow);
|
|
3914
3914
|
};
|
|
3915
3915
|
M.parseSubscriptAsyncArrow = function(e, t, i, r) {
|
|
3916
3916
|
return this.parseArrowExpression(this.startNodeAt(e, t), i, !0, r);
|
|
3917
3917
|
};
|
|
3918
3918
|
M.parseSubscript = function(e, t, i, r, n, u, h) {
|
|
3919
|
-
var d = this.options.ecmaVersion >= 11, y = d && this.eat(
|
|
3919
|
+
var d = this.options.ecmaVersion >= 11, y = d && this.eat(l.questionDot);
|
|
3920
3920
|
r && y && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
3921
|
-
var o = this.eat(
|
|
3922
|
-
if (o || y && this.type !==
|
|
3921
|
+
var o = this.eat(l.bracketL);
|
|
3922
|
+
if (o || y && this.type !== l.parenL && this.type !== l.backQuote || this.eat(l.dot)) {
|
|
3923
3923
|
var S = this.startNodeAt(t, i);
|
|
3924
|
-
S.object = e, o ? (S.property = this.parseExpression(), this.expect(
|
|
3925
|
-
} else if (!r && this.eat(
|
|
3924
|
+
S.object = e, o ? (S.property = this.parseExpression(), this.expect(l.bracketR)) : this.type === l.privateId && e.type !== "Super" ? S.property = this.parsePrivateIdent() : S.property = this.parseIdent(this.options.allowReserved !== "never"), S.computed = !!o, d && (S.optional = y), e = this.finishNode(S, "MemberExpression");
|
|
3925
|
+
} else if (!r && this.eat(l.parenL)) {
|
|
3926
3926
|
var w = new Xt(), A = this.yieldPos, F = this.awaitPos, Z = this.awaitIdentPos;
|
|
3927
3927
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
3928
|
-
var
|
|
3928
|
+
var le = this.parseExprList(l.parenR, this.options.ecmaVersion >= 8, !1, w);
|
|
3929
3929
|
if (n && !y && this.shouldParseAsyncArrow())
|
|
3930
|
-
return this.checkPatternErrors(w, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = A, this.awaitPos = F, this.awaitIdentPos = Z, this.parseSubscriptAsyncArrow(t, i,
|
|
3930
|
+
return this.checkPatternErrors(w, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = A, this.awaitPos = F, this.awaitIdentPos = Z, this.parseSubscriptAsyncArrow(t, i, le, h);
|
|
3931
3931
|
this.checkExpressionErrors(w, !0), this.yieldPos = A || this.yieldPos, this.awaitPos = F || this.awaitPos, this.awaitIdentPos = Z || this.awaitIdentPos;
|
|
3932
3932
|
var D = this.startNodeAt(t, i);
|
|
3933
|
-
D.callee = e, D.arguments =
|
|
3934
|
-
} else if (this.type ===
|
|
3933
|
+
D.callee = e, D.arguments = le, d && (D.optional = y), e = this.finishNode(D, "CallExpression");
|
|
3934
|
+
} else if (this.type === l.backQuote) {
|
|
3935
3935
|
(y || u) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
3936
3936
|
var se = this.startNodeAt(t, i);
|
|
3937
3937
|
se.tag = e, se.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(se, "TaggedTemplateExpression");
|
|
@@ -3939,50 +3939,50 @@ M.parseSubscript = function(e, t, i, r, n, u, h) {
|
|
|
3939
3939
|
return e;
|
|
3940
3940
|
};
|
|
3941
3941
|
M.parseExprAtom = function(e, t, i) {
|
|
3942
|
-
this.type ===
|
|
3942
|
+
this.type === l.slash && this.readRegexp();
|
|
3943
3943
|
var r, n = this.potentialArrowAt === this.start;
|
|
3944
3944
|
switch (this.type) {
|
|
3945
|
-
case
|
|
3946
|
-
return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type ===
|
|
3947
|
-
case
|
|
3945
|
+
case l._super:
|
|
3946
|
+
return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === l.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== l.dot && this.type !== l.bracketL && this.type !== l.parenL && this.unexpected(), this.finishNode(r, "Super");
|
|
3947
|
+
case l._this:
|
|
3948
3948
|
return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
3949
|
-
case
|
|
3949
|
+
case l.name:
|
|
3950
3950
|
var u = this.start, h = this.startLoc, d = this.containsEsc, y = this.parseIdent(!1);
|
|
3951
|
-
if (this.options.ecmaVersion >= 8 && !d && y.name === "async" && !this.canInsertSemicolon() && this.eat(
|
|
3951
|
+
if (this.options.ecmaVersion >= 8 && !d && y.name === "async" && !this.canInsertSemicolon() && this.eat(l._function))
|
|
3952
3952
|
return this.overrideContext(H.f_expr), this.parseFunction(this.startNodeAt(u, h), 0, !1, !0, t);
|
|
3953
3953
|
if (n && !this.canInsertSemicolon()) {
|
|
3954
|
-
if (this.eat(
|
|
3954
|
+
if (this.eat(l.arrow))
|
|
3955
3955
|
return this.parseArrowExpression(this.startNodeAt(u, h), [y], !1, t);
|
|
3956
|
-
if (this.options.ecmaVersion >= 8 && y.name === "async" && this.type ===
|
|
3957
|
-
return y = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(
|
|
3956
|
+
if (this.options.ecmaVersion >= 8 && y.name === "async" && this.type === l.name && !d && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
|
|
3957
|
+
return y = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(l.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(u, h), [y], !0, t);
|
|
3958
3958
|
}
|
|
3959
3959
|
return y;
|
|
3960
|
-
case
|
|
3960
|
+
case l.regexp:
|
|
3961
3961
|
var o = this.value;
|
|
3962
3962
|
return r = this.parseLiteral(o.value), r.regex = { pattern: o.pattern, flags: o.flags }, r;
|
|
3963
|
-
case
|
|
3964
|
-
case
|
|
3963
|
+
case l.num:
|
|
3964
|
+
case l.string:
|
|
3965
3965
|
return this.parseLiteral(this.value);
|
|
3966
|
-
case
|
|
3967
|
-
case
|
|
3968
|
-
case
|
|
3969
|
-
return r = this.startNode(), r.value = this.type ===
|
|
3970
|
-
case
|
|
3966
|
+
case l._null:
|
|
3967
|
+
case l._true:
|
|
3968
|
+
case l._false:
|
|
3969
|
+
return r = this.startNode(), r.value = this.type === l._null ? null : this.type === l._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
|
|
3970
|
+
case l.parenL:
|
|
3971
3971
|
var S = this.start, w = this.parseParenAndDistinguishExpression(n, t);
|
|
3972
3972
|
return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(w) && (e.parenthesizedAssign = S), e.parenthesizedBind < 0 && (e.parenthesizedBind = S)), w;
|
|
3973
|
-
case
|
|
3974
|
-
return r = this.startNode(), this.next(), r.elements = this.parseExprList(
|
|
3975
|
-
case
|
|
3973
|
+
case l.bracketL:
|
|
3974
|
+
return r = this.startNode(), this.next(), r.elements = this.parseExprList(l.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
3975
|
+
case l.braceL:
|
|
3976
3976
|
return this.overrideContext(H.b_expr), this.parseObj(!1, e);
|
|
3977
|
-
case
|
|
3977
|
+
case l._function:
|
|
3978
3978
|
return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
3979
|
-
case
|
|
3979
|
+
case l._class:
|
|
3980
3980
|
return this.parseClass(this.startNode(), !1);
|
|
3981
|
-
case
|
|
3981
|
+
case l._new:
|
|
3982
3982
|
return this.parseNew();
|
|
3983
|
-
case
|
|
3983
|
+
case l.backQuote:
|
|
3984
3984
|
return this.parseTemplate();
|
|
3985
|
-
case
|
|
3985
|
+
case l._import:
|
|
3986
3986
|
return this.options.ecmaVersion >= 11 ? this.parseExprImport(i) : this.unexpected();
|
|
3987
3987
|
default:
|
|
3988
3988
|
return this.parseExprAtomDefault();
|
|
@@ -3993,9 +3993,9 @@ M.parseExprAtomDefault = function() {
|
|
|
3993
3993
|
};
|
|
3994
3994
|
M.parseExprImport = function(e) {
|
|
3995
3995
|
var t = this.startNode();
|
|
3996
|
-
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type ===
|
|
3996
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === l.parenL && !e)
|
|
3997
3997
|
return this.parseDynamicImport(t);
|
|
3998
|
-
if (this.type ===
|
|
3998
|
+
if (this.type === l.dot) {
|
|
3999
3999
|
var i = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
4000
4000
|
return i.name = "import", t.meta = this.finishNode(i, "Identifier"), this.parseImportMeta(t);
|
|
4001
4001
|
} else
|
|
@@ -4003,10 +4003,10 @@ M.parseExprImport = function(e) {
|
|
|
4003
4003
|
};
|
|
4004
4004
|
M.parseDynamicImport = function(e) {
|
|
4005
4005
|
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16)
|
|
4006
|
-
this.eat(
|
|
4007
|
-
else if (!this.eat(
|
|
4006
|
+
this.eat(l.parenR) ? e.options = null : (this.expect(l.comma), this.afterTrailingComma(l.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(l.parenR) || (this.expect(l.comma), this.afterTrailingComma(l.parenR) || this.unexpected())));
|
|
4007
|
+
else if (!this.eat(l.parenR)) {
|
|
4008
4008
|
var t = this.start;
|
|
4009
|
-
this.eat(
|
|
4009
|
+
this.eat(l.comma) && this.eat(l.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
4010
4010
|
}
|
|
4011
4011
|
return this.finishNode(e, "ImportExpression");
|
|
4012
4012
|
};
|
|
@@ -4020,9 +4020,9 @@ M.parseLiteral = function(e) {
|
|
|
4020
4020
|
return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value != null ? t.value.toString() : t.raw.slice(0, -1).replace(/_/g, "")), this.next(), this.finishNode(t, "Literal");
|
|
4021
4021
|
};
|
|
4022
4022
|
M.parseParenExpression = function() {
|
|
4023
|
-
this.expect(
|
|
4023
|
+
this.expect(l.parenL);
|
|
4024
4024
|
var e = this.parseExpression();
|
|
4025
|
-
return this.expect(
|
|
4025
|
+
return this.expect(l.parenR), e;
|
|
4026
4026
|
};
|
|
4027
4027
|
M.shouldParseArrow = function(e) {
|
|
4028
4028
|
return !this.canInsertSemicolon();
|
|
@@ -4032,22 +4032,22 @@ M.parseParenAndDistinguishExpression = function(e, t) {
|
|
|
4032
4032
|
if (this.options.ecmaVersion >= 6) {
|
|
4033
4033
|
this.next();
|
|
4034
4034
|
var h = this.start, d = this.startLoc, y = [], o = !0, S = !1, w = new Xt(), A = this.yieldPos, F = this.awaitPos, Z;
|
|
4035
|
-
for (this.yieldPos = 0, this.awaitPos = 0; this.type !==
|
|
4036
|
-
if (o ? o = !1 : this.expect(
|
|
4035
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== l.parenR; )
|
|
4036
|
+
if (o ? o = !1 : this.expect(l.comma), u && this.afterTrailingComma(l.parenR, !0)) {
|
|
4037
4037
|
S = !0;
|
|
4038
4038
|
break;
|
|
4039
|
-
} else if (this.type ===
|
|
4040
|
-
Z = this.start, y.push(this.parseParenItem(this.parseRestBinding())), this.type ===
|
|
4039
|
+
} else if (this.type === l.ellipsis) {
|
|
4040
|
+
Z = this.start, y.push(this.parseParenItem(this.parseRestBinding())), this.type === l.comma && this.raiseRecoverable(
|
|
4041
4041
|
this.start,
|
|
4042
4042
|
"Comma is not permitted after the rest element"
|
|
4043
4043
|
);
|
|
4044
4044
|
break;
|
|
4045
4045
|
} else
|
|
4046
4046
|
y.push(this.parseMaybeAssign(!1, w, this.parseParenItem));
|
|
4047
|
-
var
|
|
4048
|
-
if (this.expect(
|
|
4047
|
+
var le = this.lastTokEnd, D = this.lastTokEndLoc;
|
|
4048
|
+
if (this.expect(l.parenR), e && this.shouldParseArrow(y) && this.eat(l.arrow))
|
|
4049
4049
|
return this.checkPatternErrors(w, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = A, this.awaitPos = F, this.parseParenArrowList(i, r, y, t);
|
|
4050
|
-
(!y.length || S) && this.unexpected(this.lastTokStart), Z && this.unexpected(Z), this.checkExpressionErrors(w, !0), this.yieldPos = A || this.yieldPos, this.awaitPos = F || this.awaitPos, y.length > 1 ? (n = this.startNodeAt(h, d), n.expressions = y, this.finishNodeAt(n, "SequenceExpression",
|
|
4050
|
+
(!y.length || S) && this.unexpected(this.lastTokStart), Z && this.unexpected(Z), this.checkExpressionErrors(w, !0), this.yieldPos = A || this.yieldPos, this.awaitPos = F || this.awaitPos, y.length > 1 ? (n = this.startNodeAt(h, d), n.expressions = y, this.finishNodeAt(n, "SequenceExpression", le, D)) : n = y[0];
|
|
4051
4051
|
} else
|
|
4052
4052
|
n = this.parseParenExpression();
|
|
4053
4053
|
if (this.options.preserveParens) {
|
|
@@ -4066,18 +4066,18 @@ var rh = [];
|
|
|
4066
4066
|
M.parseNew = function() {
|
|
4067
4067
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
4068
4068
|
var e = this.startNode();
|
|
4069
|
-
if (this.next(), this.options.ecmaVersion >= 6 && this.type ===
|
|
4069
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === l.dot) {
|
|
4070
4070
|
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
4071
4071
|
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
4072
4072
|
var i = this.containsEsc;
|
|
4073
4073
|
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), i && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
4074
4074
|
}
|
|
4075
4075
|
var r = this.start, n = this.startLoc;
|
|
4076
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, n, !0, !1), this.eat(
|
|
4076
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, n, !0, !1), this.eat(l.parenL) ? e.arguments = this.parseExprList(l.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = rh, this.finishNode(e, "NewExpression");
|
|
4077
4077
|
};
|
|
4078
4078
|
M.parseTemplateElement = function(e) {
|
|
4079
4079
|
var t = e.isTagged, i = this.startNode();
|
|
4080
|
-
return this.type ===
|
|
4080
|
+
return this.type === l.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), i.value = {
|
|
4081
4081
|
raw: this.value.replace(/\r\n?/g, `
|
|
4082
4082
|
`),
|
|
4083
4083
|
cooked: null
|
|
@@ -4085,7 +4085,7 @@ M.parseTemplateElement = function(e) {
|
|
|
4085
4085
|
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, `
|
|
4086
4086
|
`),
|
|
4087
4087
|
cooked: this.value
|
|
4088
|
-
}, this.next(), i.tail = this.type ===
|
|
4088
|
+
}, this.next(), i.tail = this.type === l.backQuote, this.finishNode(i, "TemplateElement");
|
|
4089
4089
|
};
|
|
4090
4090
|
M.parseTemplate = function(e) {
|
|
4091
4091
|
e === void 0 && (e = {});
|
|
@@ -4095,18 +4095,18 @@ M.parseTemplate = function(e) {
|
|
|
4095
4095
|
this.next(), i.expressions = [];
|
|
4096
4096
|
var r = this.parseTemplateElement({ isTagged: t });
|
|
4097
4097
|
for (i.quasis = [r]; !r.tail; )
|
|
4098
|
-
this.type ===
|
|
4098
|
+
this.type === l.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(l.dollarBraceL), i.expressions.push(this.parseExpression()), this.expect(l.braceR), i.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
4099
4099
|
return this.next(), this.finishNode(i, "TemplateLiteral");
|
|
4100
4100
|
};
|
|
4101
4101
|
M.isAsyncProp = function(e) {
|
|
4102
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type ===
|
|
4102
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === l.name || this.type === l.num || this.type === l.string || this.type === l.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === l.star) && !ce.test(this.input.slice(this.lastTokEnd, this.start));
|
|
4103
4103
|
};
|
|
4104
4104
|
M.parseObj = function(e, t) {
|
|
4105
4105
|
var i = this.startNode(), r = !0, n = {};
|
|
4106
|
-
for (i.properties = [], this.next(); !this.eat(
|
|
4106
|
+
for (i.properties = [], this.next(); !this.eat(l.braceR); ) {
|
|
4107
4107
|
if (r)
|
|
4108
4108
|
r = !1;
|
|
4109
|
-
else if (this.expect(
|
|
4109
|
+
else if (this.expect(l.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(l.braceR))
|
|
4110
4110
|
break;
|
|
4111
4111
|
var u = this.parseProperty(e, t);
|
|
4112
4112
|
e || this.checkPropClash(u, n, t), i.properties.push(u);
|
|
@@ -4115,11 +4115,11 @@ M.parseObj = function(e, t) {
|
|
|
4115
4115
|
};
|
|
4116
4116
|
M.parseProperty = function(e, t) {
|
|
4117
4117
|
var i = this.startNode(), r, n, u, h;
|
|
4118
|
-
if (this.options.ecmaVersion >= 9 && this.eat(
|
|
4119
|
-
return e ? (i.argument = this.parseIdent(!1), this.type ===
|
|
4120
|
-
this.options.ecmaVersion >= 6 && (i.method = !1, i.shorthand = !1, (e || t) && (u = this.start, h = this.startLoc), e || (r = this.eat(
|
|
4118
|
+
if (this.options.ecmaVersion >= 9 && this.eat(l.ellipsis))
|
|
4119
|
+
return e ? (i.argument = this.parseIdent(!1), this.type === l.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(i, "RestElement")) : (i.argument = this.parseMaybeAssign(!1, t), this.type === l.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(i, "SpreadElement"));
|
|
4120
|
+
this.options.ecmaVersion >= 6 && (i.method = !1, i.shorthand = !1, (e || t) && (u = this.start, h = this.startLoc), e || (r = this.eat(l.star)));
|
|
4121
4121
|
var d = this.containsEsc;
|
|
4122
|
-
return this.parsePropertyName(i), !e && !d && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(i) ? (n = !0, r = this.options.ecmaVersion >= 9 && this.eat(
|
|
4122
|
+
return this.parsePropertyName(i), !e && !d && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(i) ? (n = !0, r = this.options.ecmaVersion >= 9 && this.eat(l.star), this.parsePropertyName(i)) : n = !1, this.parsePropertyValue(i, e, r, n, u, h, t, d), this.finishNode(i, "Property");
|
|
4123
4123
|
};
|
|
4124
4124
|
M.parseGetterSetter = function(e) {
|
|
4125
4125
|
var t = e.key.name;
|
|
@@ -4132,29 +4132,29 @@ M.parseGetterSetter = function(e) {
|
|
|
4132
4132
|
e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
4133
4133
|
};
|
|
4134
4134
|
M.parsePropertyValue = function(e, t, i, r, n, u, h, d) {
|
|
4135
|
-
(i || r) && this.type ===
|
|
4135
|
+
(i || r) && this.type === l.colon && this.unexpected(), this.eat(l.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, h), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === l.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(i, r), e.kind = "init") : !t && !d && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== l.comma && this.type !== l.braceR && this.type !== l.eq ? ((i || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((i || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = n), t ? e.value = this.parseMaybeDefault(n, u, this.copyNode(e.key)) : this.type === l.eq && h ? (h.shorthandAssign < 0 && (h.shorthandAssign = this.start), e.value = this.parseMaybeDefault(n, u, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
4136
4136
|
};
|
|
4137
4137
|
M.parsePropertyName = function(e) {
|
|
4138
4138
|
if (this.options.ecmaVersion >= 6) {
|
|
4139
|
-
if (this.eat(
|
|
4140
|
-
return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(
|
|
4139
|
+
if (this.eat(l.bracketL))
|
|
4140
|
+
return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(l.bracketR), e.key;
|
|
4141
4141
|
e.computed = !1;
|
|
4142
4142
|
}
|
|
4143
|
-
return e.key = this.type ===
|
|
4143
|
+
return e.key = this.type === l.num || this.type === l.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
4144
4144
|
};
|
|
4145
4145
|
M.initFunction = function(e) {
|
|
4146
4146
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
4147
4147
|
};
|
|
4148
4148
|
M.parseMethod = function(e, t, i) {
|
|
4149
4149
|
var r = this.startNode(), n = this.yieldPos, u = this.awaitPos, h = this.awaitIdentPos;
|
|
4150
|
-
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ai(t, r.generator) | Wt | (i ? is : 0)), this.expect(
|
|
4150
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ai(t, r.generator) | Wt | (i ? is : 0)), this.expect(l.parenL), r.params = this.parseBindingList(l.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = n, this.awaitPos = u, this.awaitIdentPos = h, this.finishNode(r, "FunctionExpression");
|
|
4151
4151
|
};
|
|
4152
4152
|
M.parseArrowExpression = function(e, t, i, r) {
|
|
4153
4153
|
var n = this.yieldPos, u = this.awaitPos, h = this.awaitIdentPos;
|
|
4154
4154
|
return this.enterScope(Ai(i, !1) | Ci), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!i), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = n, this.awaitPos = u, this.awaitIdentPos = h, this.finishNode(e, "ArrowFunctionExpression");
|
|
4155
4155
|
};
|
|
4156
4156
|
M.parseFunctionBody = function(e, t, i, r) {
|
|
4157
|
-
var n = t && this.type !==
|
|
4157
|
+
var n = t && this.type !== l.braceL, u = this.strict, h = !1;
|
|
4158
4158
|
if (n)
|
|
4159
4159
|
e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
4160
4160
|
else {
|
|
@@ -4183,10 +4183,10 @@ M.parseExprList = function(e, t, i, r) {
|
|
|
4183
4183
|
for (var n = [], u = !0; !this.eat(e); ) {
|
|
4184
4184
|
if (u)
|
|
4185
4185
|
u = !1;
|
|
4186
|
-
else if (this.expect(
|
|
4186
|
+
else if (this.expect(l.comma), t && this.afterTrailingComma(e))
|
|
4187
4187
|
break;
|
|
4188
4188
|
var h = void 0;
|
|
4189
|
-
i && this.type ===
|
|
4189
|
+
i && this.type === l.comma ? h = null : this.type === l.ellipsis ? (h = this.parseSpread(r), r && this.type === l.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : h = this.parseMaybeAssign(!1, r), n.push(h);
|
|
4190
4190
|
}
|
|
4191
4191
|
return n;
|
|
4192
4192
|
};
|
|
@@ -4203,16 +4203,16 @@ M.parseIdent = function(e) {
|
|
|
4203
4203
|
};
|
|
4204
4204
|
M.parseIdentNode = function() {
|
|
4205
4205
|
var e = this.startNode();
|
|
4206
|
-
return this.type ===
|
|
4206
|
+
return this.type === l.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = l.name) : this.unexpected(), e;
|
|
4207
4207
|
};
|
|
4208
4208
|
M.parsePrivateIdent = function() {
|
|
4209
4209
|
var e = this.startNode();
|
|
4210
|
-
return this.type ===
|
|
4210
|
+
return this.type === l.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
4211
4211
|
};
|
|
4212
4212
|
M.parseYield = function(e) {
|
|
4213
4213
|
this.yieldPos || (this.yieldPos = this.start);
|
|
4214
4214
|
var t = this.startNode();
|
|
4215
|
-
return this.next(), this.type ===
|
|
4215
|
+
return this.next(), this.type === l.semi || this.canInsertSemicolon() || this.type !== l.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(l.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
4216
4216
|
};
|
|
4217
4217
|
M.parseAwait = function(e) {
|
|
4218
4218
|
this.awaitPos || (this.awaitPos = this.start);
|
|
@@ -4241,7 +4241,7 @@ We.exitScope = function() {
|
|
|
4241
4241
|
this.scopeStack.pop();
|
|
4242
4242
|
};
|
|
4243
4243
|
We.treatFunctionsAsVarInScope = function(e) {
|
|
4244
|
-
return e.flags &
|
|
4244
|
+
return e.flags & lt || !this.inModule && e.flags & _t;
|
|
4245
4245
|
};
|
|
4246
4246
|
We.declareName = function(e, t, i) {
|
|
4247
4247
|
var r = !1;
|
|
@@ -4310,11 +4310,11 @@ Tt.copyNode = function(e) {
|
|
|
4310
4310
|
t[i] = e[i];
|
|
4311
4311
|
return t;
|
|
4312
4312
|
};
|
|
4313
|
-
var nh = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", cs = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", hs = cs + " Extended_Pictographic",
|
|
4313
|
+
var nh = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", cs = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", hs = cs + " Extended_Pictographic", ls = hs, ps = ls + " EBase EComp EMod EPres ExtPict", fs = ps, ah = fs, oh = {
|
|
4314
4314
|
9: cs,
|
|
4315
4315
|
10: hs,
|
|
4316
|
-
11:
|
|
4317
|
-
12:
|
|
4316
|
+
11: ls,
|
|
4317
|
+
12: ps,
|
|
4318
4318
|
13: fs,
|
|
4319
4319
|
14: ah
|
|
4320
4320
|
}, uh = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji", ch = {
|
|
@@ -4324,7 +4324,7 @@ var nh = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai
|
|
|
4324
4324
|
12: "",
|
|
4325
4325
|
13: "",
|
|
4326
4326
|
14: uh
|
|
4327
|
-
},
|
|
4327
|
+
}, pr = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", ds = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", ms = ds + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", ys = ms + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", vs = ys + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", xs = vs + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", hh = xs + " " + nh, lh = {
|
|
4328
4328
|
9: ds,
|
|
4329
4329
|
10: ms,
|
|
4330
4330
|
11: ys,
|
|
@@ -4332,20 +4332,20 @@ var nh = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai
|
|
|
4332
4332
|
13: xs,
|
|
4333
4333
|
14: hh
|
|
4334
4334
|
}, gs = {};
|
|
4335
|
-
function
|
|
4335
|
+
function ph(e) {
|
|
4336
4336
|
var t = gs[e] = {
|
|
4337
|
-
binary: Ze(oh[e] + " " +
|
|
4337
|
+
binary: Ze(oh[e] + " " + pr),
|
|
4338
4338
|
binaryOfStrings: Ze(ch[e]),
|
|
4339
4339
|
nonBinary: {
|
|
4340
|
-
General_Category: Ze(
|
|
4341
|
-
Script: Ze(
|
|
4340
|
+
General_Category: Ze(pr),
|
|
4341
|
+
Script: Ze(lh[e])
|
|
4342
4342
|
}
|
|
4343
4343
|
};
|
|
4344
4344
|
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
4345
4345
|
}
|
|
4346
4346
|
for (var ai = 0, fr = [9, 10, 11, 12, 13, 14]; ai < fr.length; ai += 1) {
|
|
4347
4347
|
var fh = fr[ai];
|
|
4348
|
-
|
|
4348
|
+
ph(fh);
|
|
4349
4349
|
}
|
|
4350
4350
|
var C = J.prototype, Bt = function(t, i) {
|
|
4351
4351
|
this.parent = t, this.base = i || this;
|
|
@@ -5192,7 +5192,7 @@ typeof Symbol < "u" && (j[Symbol.iterator] = function() {
|
|
|
5192
5192
|
next: function() {
|
|
5193
5193
|
var t = e.getToken();
|
|
5194
5194
|
return {
|
|
5195
|
-
done: t.type ===
|
|
5195
|
+
done: t.type === l.eof,
|
|
5196
5196
|
value: t
|
|
5197
5197
|
};
|
|
5198
5198
|
}
|
|
@@ -5201,7 +5201,7 @@ typeof Symbol < "u" && (j[Symbol.iterator] = function() {
|
|
|
5201
5201
|
j.nextToken = function() {
|
|
5202
5202
|
var e = this.curContext();
|
|
5203
5203
|
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length)
|
|
5204
|
-
return this.finishToken(
|
|
5204
|
+
return this.finishToken(l.eof);
|
|
5205
5205
|
if (e.override)
|
|
5206
5206
|
return e.override(this);
|
|
5207
5207
|
this.readToken(this.fullCharCodeAtPos());
|
|
@@ -5287,15 +5287,15 @@ j.readToken_dot = function() {
|
|
|
5287
5287
|
if (e >= 48 && e <= 57)
|
|
5288
5288
|
return this.readNumber(!0);
|
|
5289
5289
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
5290
|
-
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(
|
|
5290
|
+
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(l.ellipsis)) : (++this.pos, this.finishToken(l.dot));
|
|
5291
5291
|
};
|
|
5292
5292
|
j.readToken_slash = function() {
|
|
5293
5293
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
5294
|
-
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(
|
|
5294
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(l.assign, 2) : this.finishOp(l.slash, 1);
|
|
5295
5295
|
};
|
|
5296
5296
|
j.readToken_mult_modulo_exp = function(e) {
|
|
5297
|
-
var t = this.input.charCodeAt(this.pos + 1), i = 1, r = e === 42 ?
|
|
5298
|
-
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++i, r =
|
|
5297
|
+
var t = this.input.charCodeAt(this.pos + 1), i = 1, r = e === 42 ? l.star : l.modulo;
|
|
5298
|
+
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++i, r = l.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(l.assign, i + 1) : this.finishOp(r, i);
|
|
5299
5299
|
};
|
|
5300
5300
|
j.readToken_pipe_amp = function(e) {
|
|
5301
5301
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
@@ -5303,27 +5303,27 @@ j.readToken_pipe_amp = function(e) {
|
|
|
5303
5303
|
if (this.options.ecmaVersion >= 12) {
|
|
5304
5304
|
var i = this.input.charCodeAt(this.pos + 2);
|
|
5305
5305
|
if (i === 61)
|
|
5306
|
-
return this.finishOp(
|
|
5306
|
+
return this.finishOp(l.assign, 3);
|
|
5307
5307
|
}
|
|
5308
|
-
return this.finishOp(e === 124 ?
|
|
5308
|
+
return this.finishOp(e === 124 ? l.logicalOR : l.logicalAND, 2);
|
|
5309
5309
|
}
|
|
5310
|
-
return t === 61 ? this.finishOp(
|
|
5310
|
+
return t === 61 ? this.finishOp(l.assign, 2) : this.finishOp(e === 124 ? l.bitwiseOR : l.bitwiseAND, 1);
|
|
5311
5311
|
};
|
|
5312
5312
|
j.readToken_caret = function() {
|
|
5313
5313
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
5314
|
-
return e === 61 ? this.finishOp(
|
|
5314
|
+
return e === 61 ? this.finishOp(l.assign, 2) : this.finishOp(l.bitwiseXOR, 1);
|
|
5315
5315
|
};
|
|
5316
5316
|
j.readToken_plus_min = function(e) {
|
|
5317
5317
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
5318
|
-
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || ce.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(
|
|
5318
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || ce.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(l.incDec, 2) : t === 61 ? this.finishOp(l.assign, 2) : this.finishOp(l.plusMin, 1);
|
|
5319
5319
|
};
|
|
5320
5320
|
j.readToken_lt_gt = function(e) {
|
|
5321
5321
|
var t = this.input.charCodeAt(this.pos + 1), i = 1;
|
|
5322
|
-
return t === e ? (i = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + i) === 61 ? this.finishOp(
|
|
5322
|
+
return t === e ? (i = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + i) === 61 ? this.finishOp(l.assign, i + 1) : this.finishOp(l.bitShift, i)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (i = 2), this.finishOp(l.relational, i));
|
|
5323
5323
|
};
|
|
5324
5324
|
j.readToken_eq_excl = function(e) {
|
|
5325
5325
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
5326
|
-
return t === 61 ? this.finishOp(
|
|
5326
|
+
return t === 61 ? this.finishOp(l.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(l.arrow)) : this.finishOp(e === 61 ? l.eq : l.prefix, 1);
|
|
5327
5327
|
};
|
|
5328
5328
|
j.readToken_question = function() {
|
|
5329
5329
|
var e = this.options.ecmaVersion;
|
|
@@ -5332,23 +5332,23 @@ j.readToken_question = function() {
|
|
|
5332
5332
|
if (t === 46) {
|
|
5333
5333
|
var i = this.input.charCodeAt(this.pos + 2);
|
|
5334
5334
|
if (i < 48 || i > 57)
|
|
5335
|
-
return this.finishOp(
|
|
5335
|
+
return this.finishOp(l.questionDot, 2);
|
|
5336
5336
|
}
|
|
5337
5337
|
if (t === 63) {
|
|
5338
5338
|
if (e >= 12) {
|
|
5339
5339
|
var r = this.input.charCodeAt(this.pos + 2);
|
|
5340
5340
|
if (r === 61)
|
|
5341
|
-
return this.finishOp(
|
|
5341
|
+
return this.finishOp(l.assign, 3);
|
|
5342
5342
|
}
|
|
5343
|
-
return this.finishOp(
|
|
5343
|
+
return this.finishOp(l.coalesce, 2);
|
|
5344
5344
|
}
|
|
5345
5345
|
}
|
|
5346
|
-
return this.finishOp(
|
|
5346
|
+
return this.finishOp(l.question, 1);
|
|
5347
5347
|
};
|
|
5348
5348
|
j.readToken_numberSign = function() {
|
|
5349
5349
|
var e = this.options.ecmaVersion, t = 35;
|
|
5350
5350
|
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), Ee(t, !0) || t === 92))
|
|
5351
|
-
return this.finishToken(
|
|
5351
|
+
return this.finishToken(l.privateId, this.readWord1());
|
|
5352
5352
|
this.raise(this.pos, "Unexpected character '" + Ve(t) + "'");
|
|
5353
5353
|
};
|
|
5354
5354
|
j.getTokenFromCode = function(e) {
|
|
@@ -5359,27 +5359,27 @@ j.getTokenFromCode = function(e) {
|
|
|
5359
5359
|
return this.readToken_dot();
|
|
5360
5360
|
// Punctuation tokens.
|
|
5361
5361
|
case 40:
|
|
5362
|
-
return ++this.pos, this.finishToken(
|
|
5362
|
+
return ++this.pos, this.finishToken(l.parenL);
|
|
5363
5363
|
case 41:
|
|
5364
|
-
return ++this.pos, this.finishToken(
|
|
5364
|
+
return ++this.pos, this.finishToken(l.parenR);
|
|
5365
5365
|
case 59:
|
|
5366
|
-
return ++this.pos, this.finishToken(
|
|
5366
|
+
return ++this.pos, this.finishToken(l.semi);
|
|
5367
5367
|
case 44:
|
|
5368
|
-
return ++this.pos, this.finishToken(
|
|
5368
|
+
return ++this.pos, this.finishToken(l.comma);
|
|
5369
5369
|
case 91:
|
|
5370
|
-
return ++this.pos, this.finishToken(
|
|
5370
|
+
return ++this.pos, this.finishToken(l.bracketL);
|
|
5371
5371
|
case 93:
|
|
5372
|
-
return ++this.pos, this.finishToken(
|
|
5372
|
+
return ++this.pos, this.finishToken(l.bracketR);
|
|
5373
5373
|
case 123:
|
|
5374
|
-
return ++this.pos, this.finishToken(
|
|
5374
|
+
return ++this.pos, this.finishToken(l.braceL);
|
|
5375
5375
|
case 125:
|
|
5376
|
-
return ++this.pos, this.finishToken(
|
|
5376
|
+
return ++this.pos, this.finishToken(l.braceR);
|
|
5377
5377
|
case 58:
|
|
5378
|
-
return ++this.pos, this.finishToken(
|
|
5378
|
+
return ++this.pos, this.finishToken(l.colon);
|
|
5379
5379
|
case 96:
|
|
5380
5380
|
if (this.options.ecmaVersion < 6)
|
|
5381
5381
|
break;
|
|
5382
|
-
return ++this.pos, this.finishToken(
|
|
5382
|
+
return ++this.pos, this.finishToken(l.backQuote);
|
|
5383
5383
|
case 48:
|
|
5384
5384
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
5385
5385
|
if (t === 120 || t === 88)
|
|
@@ -5432,7 +5432,7 @@ j.getTokenFromCode = function(e) {
|
|
|
5432
5432
|
case 63:
|
|
5433
5433
|
return this.readToken_question();
|
|
5434
5434
|
case 126:
|
|
5435
|
-
return this.finishOp(
|
|
5435
|
+
return this.finishOp(l.prefix, 1);
|
|
5436
5436
|
case 35:
|
|
5437
5437
|
return this.readToken_numberSign();
|
|
5438
5438
|
}
|
|
@@ -5470,7 +5470,7 @@ j.readRegexp = function() {
|
|
|
5470
5470
|
y = new RegExp(n, h);
|
|
5471
5471
|
} catch {
|
|
5472
5472
|
}
|
|
5473
|
-
return this.finishToken(
|
|
5473
|
+
return this.finishToken(l.regexp, { pattern: n, flags: h, value: y });
|
|
5474
5474
|
};
|
|
5475
5475
|
j.readInt = function(e, t, i) {
|
|
5476
5476
|
for (var r = this.options.ecmaVersion >= 12 && t === void 0, n = i && this.input.charCodeAt(this.pos) === 48, u = this.pos, h = 0, d = 0, y = 0, o = t ?? 1 / 0; y < o; ++y, ++this.pos) {
|
|
@@ -5495,7 +5495,7 @@ j.readRadixNumber = function(e) {
|
|
|
5495
5495
|
var t = this.pos;
|
|
5496
5496
|
this.pos += 2;
|
|
5497
5497
|
var i = this.readInt(e);
|
|
5498
|
-
return i == null && this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (i = Cs(this.input.slice(t, this.pos)), ++this.pos) : Ee(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(
|
|
5498
|
+
return i == null && this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (i = Cs(this.input.slice(t, this.pos)), ++this.pos) : Ee(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(l.num, i);
|
|
5499
5499
|
};
|
|
5500
5500
|
j.readNumber = function(e) {
|
|
5501
5501
|
var t = this.pos;
|
|
@@ -5505,11 +5505,11 @@ j.readNumber = function(e) {
|
|
|
5505
5505
|
var r = this.input.charCodeAt(this.pos);
|
|
5506
5506
|
if (!i && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
5507
5507
|
var n = Cs(this.input.slice(t, this.pos));
|
|
5508
|
-
return ++this.pos, Ee(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(
|
|
5508
|
+
return ++this.pos, Ee(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(l.num, n);
|
|
5509
5509
|
}
|
|
5510
5510
|
i && /[89]/.test(this.input.slice(t, this.pos)) && (i = !1), r === 46 && !i && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !i && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), Ee(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
5511
5511
|
var u = wh(this.input.slice(t, this.pos), i);
|
|
5512
|
-
return this.finishToken(
|
|
5512
|
+
return this.finishToken(l.num, u);
|
|
5513
5513
|
};
|
|
5514
5514
|
j.readCodePoint = function() {
|
|
5515
5515
|
var e = this.input.charCodeAt(this.pos), t;
|
|
@@ -5529,7 +5529,7 @@ j.readString = function(e) {
|
|
|
5529
5529
|
break;
|
|
5530
5530
|
r === 92 ? (t += this.input.slice(i, this.pos), t += this.readEscapedChar(!1), i = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (Ye(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
5531
5531
|
}
|
|
5532
|
-
return t += this.input.slice(i, this.pos++), this.finishToken(
|
|
5532
|
+
return t += this.input.slice(i, this.pos++), this.finishToken(l.string, t);
|
|
5533
5533
|
};
|
|
5534
5534
|
var As = {};
|
|
5535
5535
|
j.tryReadTemplateToken = function() {
|
|
@@ -5554,7 +5554,7 @@ j.readTmplToken = function() {
|
|
|
5554
5554
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
5555
5555
|
var i = this.input.charCodeAt(this.pos);
|
|
5556
5556
|
if (i === 96 || i === 36 && this.input.charCodeAt(this.pos + 1) === 123)
|
|
5557
|
-
return this.pos === this.start && (this.type ===
|
|
5557
|
+
return this.pos === this.start && (this.type === l.template || this.type === l.invalidTemplate) ? i === 36 ? (this.pos += 2, this.finishToken(l.dollarBraceL)) : (++this.pos, this.finishToken(l.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(l.template, e));
|
|
5558
5558
|
if (i === 92)
|
|
5559
5559
|
e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
5560
5560
|
else if (Ye(i)) {
|
|
@@ -5585,7 +5585,7 @@ j.readInvalidTemplateToken = function() {
|
|
|
5585
5585
|
break;
|
|
5586
5586
|
// fall through
|
|
5587
5587
|
case "`":
|
|
5588
|
-
return this.finishToken(
|
|
5588
|
+
return this.finishToken(l.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
5589
5589
|
case "\r":
|
|
5590
5590
|
this.input[this.pos + 1] === `
|
|
5591
5591
|
` && ++this.pos;
|
|
@@ -5678,7 +5678,7 @@ j.readWord1 = function() {
|
|
|
5678
5678
|
return e + this.input.slice(i, this.pos);
|
|
5679
5679
|
};
|
|
5680
5680
|
j.readWord = function() {
|
|
5681
|
-
var e = this.readWord1(), t =
|
|
5681
|
+
var e = this.readWord1(), t = l.name;
|
|
5682
5682
|
return this.keywords.test(e) && (t = at[e]), this.finishToken(t, e);
|
|
5683
5683
|
};
|
|
5684
5684
|
var Es = "8.15.0";
|
|
@@ -5691,7 +5691,7 @@ J.acorn = {
|
|
|
5691
5691
|
getLineInfo: Ti,
|
|
5692
5692
|
Node: wt,
|
|
5693
5693
|
TokenType: z,
|
|
5694
|
-
tokTypes:
|
|
5694
|
+
tokTypes: l,
|
|
5695
5695
|
keywordTypes: at,
|
|
5696
5696
|
TokContext: ue,
|
|
5697
5697
|
tokContexts: H,
|
|
@@ -5733,7 +5733,7 @@ const Ah = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5733
5733
|
parse: Th,
|
|
5734
5734
|
parseExpressionAt: Ph,
|
|
5735
5735
|
tokContexts: H,
|
|
5736
|
-
tokTypes:
|
|
5736
|
+
tokTypes: l,
|
|
5737
5737
|
tokenizer: Ch,
|
|
5738
5738
|
version: Es
|
|
5739
5739
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
@@ -5807,19 +5807,19 @@ function Ih(e) {
|
|
|
5807
5807
|
this.context.push(n.tc_expr), this.context.push(n.tc_oTag), this.exprAllowed = !1;
|
|
5808
5808
|
}, r.jsxTagEnd.updateContext = function(h) {
|
|
5809
5809
|
var d = this.context.pop();
|
|
5810
|
-
d === n.tc_oTag && h ===
|
|
5810
|
+
d === n.tc_oTag && h === l.slash || d === n.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === n.tc_expr) : this.exprAllowed = !0;
|
|
5811
5811
|
}, t = { tokTypes: Zt({}, i, r), tokContexts: Zt({}, n), keywordsRegExp: u, tokenIsLiteralPropertyName: function(h) {
|
|
5812
|
-
return [
|
|
5812
|
+
return [l.name, l.string, l.num].concat(Object.values(at), Object.values(i)).includes(h);
|
|
5813
5813
|
}, tokenIsKeywordOrIdentifier: function(h) {
|
|
5814
|
-
return [
|
|
5814
|
+
return [l.name].concat(Object.values(at), Object.values(i)).includes(h);
|
|
5815
5815
|
}, tokenIsIdentifier: function(h) {
|
|
5816
|
-
return [].concat(Object.values(i), [
|
|
5816
|
+
return [].concat(Object.values(i), [l.name]).includes(h);
|
|
5817
5817
|
}, tokenIsTSDeclarationStart: function(h) {
|
|
5818
5818
|
return [i.abstract, i.declare, i.enum, i.module, i.namespace, i.interface, i.type].includes(h);
|
|
5819
5819
|
}, tokenIsTSTypeOperator: function(h) {
|
|
5820
5820
|
return [i.keyof, i.readonly, i.unique].includes(h);
|
|
5821
5821
|
}, tokenIsTemplate: function(h) {
|
|
5822
|
-
return h ===
|
|
5822
|
+
return h === l.invalidTemplate;
|
|
5823
5823
|
} };
|
|
5824
5824
|
}
|
|
5825
5825
|
return t;
|
|
@@ -5903,17 +5903,17 @@ function br(e) {
|
|
|
5903
5903
|
function jh(e) {
|
|
5904
5904
|
var t = {}, i = t.dts, r = i !== void 0 && i, n = t.allowSatisfies, u = n !== void 0 && n;
|
|
5905
5905
|
return function(h) {
|
|
5906
|
-
var d = h.acorn || Ah, y = Ih(d), o = d.tokTypes, S = d.keywordTypes, w = d.isIdentifierStart, A = d.lineBreak, F = d.isNewLine, Z = d.tokContexts,
|
|
5907
|
-
function Os(P,
|
|
5906
|
+
var d = h.acorn || Ah, y = Ih(d), o = d.tokTypes, S = d.keywordTypes, w = d.isIdentifierStart, A = d.lineBreak, F = d.isNewLine, Z = d.tokContexts, le = d.isIdentifierChar, D = y.tokTypes, se = y.tokContexts, ft = y.keywordsRegExp, Ce = y.tokenIsLiteralPropertyName, be = y.tokenIsTemplate, Ke = y.tokenIsTSDeclarationStart, q = y.tokenIsIdentifier, Ct = y.tokenIsKeywordOrIdentifier, Ls = y.tokenIsTSTypeOperator;
|
|
5907
|
+
function Os(P, pe, oe) {
|
|
5908
5908
|
oe === void 0 && (oe = P.length);
|
|
5909
|
-
for (var te =
|
|
5909
|
+
for (var te = pe; te < oe; te++) {
|
|
5910
5910
|
var B = P.charCodeAt(te);
|
|
5911
5911
|
if (F(B)) return te < oe - 1 && B === 13 && P.charCodeAt(te + 1) === 10 ? te + 2 : te + 1;
|
|
5912
5912
|
}
|
|
5913
5913
|
return -1;
|
|
5914
5914
|
}
|
|
5915
|
-
h = (function(P,
|
|
5916
|
-
var te = oe.tokTypes, B =
|
|
5915
|
+
h = (function(P, pe, oe) {
|
|
5916
|
+
var te = oe.tokTypes, B = pe.tokTypes;
|
|
5917
5917
|
return (function(f) {
|
|
5918
5918
|
function s() {
|
|
5919
5919
|
return f.apply(this, arguments) || this;
|
|
@@ -5921,44 +5921,44 @@ function jh(e) {
|
|
|
5921
5921
|
Rt(s, f);
|
|
5922
5922
|
var a = s.prototype;
|
|
5923
5923
|
return a.takeDecorators = function(c) {
|
|
5924
|
-
var
|
|
5925
|
-
|
|
5924
|
+
var p = this.decoratorStack[this.decoratorStack.length - 1];
|
|
5925
|
+
p.length && (c.decorators = p, this.resetStartLocationFromNode(c, p[0]), this.decoratorStack[this.decoratorStack.length - 1] = []);
|
|
5926
5926
|
}, a.parseDecorators = function(c) {
|
|
5927
|
-
for (var
|
|
5927
|
+
for (var p = this.decoratorStack[this.decoratorStack.length - 1]; this.match(B.at); ) {
|
|
5928
5928
|
var m = this.parseDecorator();
|
|
5929
|
-
|
|
5929
|
+
p.push(m);
|
|
5930
5930
|
}
|
|
5931
5931
|
this.match(te._export) ? c || this.unexpected() : this.canHaveLeadingDecorator() || this.raise(this.start, "Leading decorators must be attached to a class declaration.");
|
|
5932
5932
|
}, a.parseDecorator = function() {
|
|
5933
5933
|
var c = this.startNode();
|
|
5934
5934
|
this.next(), this.decoratorStack.push([]);
|
|
5935
|
-
var
|
|
5935
|
+
var p, m = this.start, v = this.startLoc;
|
|
5936
5936
|
if (this.match(te.parenL)) {
|
|
5937
5937
|
var x = this.start, g = this.startLoc;
|
|
5938
|
-
if (this.next(),
|
|
5938
|
+
if (this.next(), p = this.parseExpression(), this.expect(te.parenR), this.options.preserveParens) {
|
|
5939
5939
|
var _ = this.startNodeAt(x, g);
|
|
5940
|
-
_.expression =
|
|
5940
|
+
_.expression = p, p = this.finishNode(_, "ParenthesizedExpression");
|
|
5941
5941
|
}
|
|
5942
|
-
} else for (
|
|
5942
|
+
} else for (p = this.parseIdent(!1); this.eat(te.dot); ) {
|
|
5943
5943
|
var T = this.startNodeAt(m, v);
|
|
5944
|
-
T.object =
|
|
5944
|
+
T.object = p, T.property = this.parseIdent(!0), T.computed = !1, p = this.finishNode(T, "MemberExpression");
|
|
5945
5945
|
}
|
|
5946
|
-
return c.expression = this.parseMaybeDecoratorArguments(
|
|
5946
|
+
return c.expression = this.parseMaybeDecoratorArguments(p), this.decoratorStack.pop(), this.finishNode(c, "Decorator");
|
|
5947
5947
|
}, a.parseMaybeDecoratorArguments = function(c) {
|
|
5948
5948
|
if (this.eat(te.parenL)) {
|
|
5949
|
-
var
|
|
5950
|
-
return
|
|
5949
|
+
var p = this.startNodeAtNode(c);
|
|
5950
|
+
return p.callee = c, p.arguments = this.parseExprList(te.parenR, !1), this.finishNode(p, "CallExpression");
|
|
5951
5951
|
}
|
|
5952
5952
|
return c;
|
|
5953
5953
|
}, s;
|
|
5954
5954
|
})(P);
|
|
5955
|
-
})(h, y, d), h = (function(P,
|
|
5956
|
-
var B = P.tokTypes, f =
|
|
5957
|
-
return (function(
|
|
5955
|
+
})(h, y, d), h = (function(P, pe, oe, te) {
|
|
5956
|
+
var B = P.tokTypes, f = pe.tokTypes, s = P.isNewLine, a = P.isIdentifierChar, c = Object.assign({ allowNamespaces: !0, allowNamespacedObjects: !0 }, {});
|
|
5957
|
+
return (function(p) {
|
|
5958
5958
|
function m() {
|
|
5959
|
-
return
|
|
5959
|
+
return p.apply(this, arguments) || this;
|
|
5960
5960
|
}
|
|
5961
|
-
Rt(m,
|
|
5961
|
+
Rt(m, p);
|
|
5962
5962
|
var v = m.prototype;
|
|
5963
5963
|
return v.jsx_readToken = function() {
|
|
5964
5964
|
for (var x = "", g = this.pos; ; ) {
|
|
@@ -6085,8 +6085,8 @@ function jh(e) {
|
|
|
6085
6085
|
return this.next(), this.jsx_parseElementAt(x, g);
|
|
6086
6086
|
}, m;
|
|
6087
6087
|
})(oe);
|
|
6088
|
-
})(d, y, h), h = (function(P,
|
|
6089
|
-
var te =
|
|
6088
|
+
})(d, y, h), h = (function(P, pe, oe) {
|
|
6089
|
+
var te = pe.tokTypes, B = oe.tokTypes;
|
|
6090
6090
|
return (function(f) {
|
|
6091
6091
|
function s() {
|
|
6092
6092
|
return f.apply(this, arguments) || this;
|
|
@@ -6096,34 +6096,34 @@ function jh(e) {
|
|
|
6096
6096
|
return a.parseMaybeImportAttributes = function(c) {
|
|
6097
6097
|
if (this.type === B._with || this.type === te.assert) {
|
|
6098
6098
|
this.next();
|
|
6099
|
-
var
|
|
6100
|
-
|
|
6099
|
+
var p = this.parseImportAttributes();
|
|
6100
|
+
p && (c.attributes = p);
|
|
6101
6101
|
}
|
|
6102
6102
|
}, a.parseImportAttributes = function() {
|
|
6103
6103
|
this.expect(B.braceL);
|
|
6104
6104
|
var c = this.parseWithEntries();
|
|
6105
6105
|
return this.expect(B.braceR), c;
|
|
6106
6106
|
}, a.parseWithEntries = function() {
|
|
6107
|
-
var c = [],
|
|
6107
|
+
var c = [], p = /* @__PURE__ */ new Set();
|
|
6108
6108
|
do {
|
|
6109
6109
|
if (this.type === B.braceR) break;
|
|
6110
6110
|
var m, v = this.startNode();
|
|
6111
|
-
m = this.type === B.string ? this.parseLiteral(this.value) : this.parseIdent(!0), this.next(), v.key = m,
|
|
6111
|
+
m = this.type === B.string ? this.parseLiteral(this.value) : this.parseIdent(!0), this.next(), v.key = m, p.has(v.key.name) && this.raise(this.pos, "Duplicated key in attributes"), p.add(v.key.name), this.type !== B.string && this.raise(this.pos, "Only string is supported as an attribute value"), v.value = this.parseLiteral(this.value), c.push(this.finishNode(v, "ImportAttribute"));
|
|
6112
6112
|
} while (this.eat(B.comma));
|
|
6113
6113
|
return c;
|
|
6114
6114
|
}, s;
|
|
6115
6115
|
})(P);
|
|
6116
6116
|
})(h, y, d);
|
|
6117
6117
|
var Rs = /* @__PURE__ */ (function(P) {
|
|
6118
|
-
function
|
|
6119
|
-
var
|
|
6120
|
-
return (
|
|
6118
|
+
function pe(s, a, c) {
|
|
6119
|
+
var p;
|
|
6120
|
+
return (p = P.call(this, s, a, c) || this).preValue = null, p.preToken = null, p.isLookahead = !1, p.isAmbientContext = !1, p.inAbstractClass = !1, p.inType = !1, p.inDisallowConditionalTypesContext = !1, p.maybeInArrowParameters = !1, p.shouldParseArrowReturnType = void 0, p.shouldParseAsyncArrowReturnType = void 0, p.decoratorStack = [[]], p.importsStack = [[]], p.importOrExportOuterKind = void 0, p.tsParseConstModifier = p.tsParseModifiers.bind((function(m) {
|
|
6121
6121
|
if (m === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
6122
6122
|
return m;
|
|
6123
|
-
})(
|
|
6123
|
+
})(p), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: N.InvalidModifierOnTypeParameterPositions }), p;
|
|
6124
6124
|
}
|
|
6125
|
-
Rt(
|
|
6126
|
-
var oe, te, B, f =
|
|
6125
|
+
Rt(pe, P);
|
|
6126
|
+
var oe, te, B, f = pe.prototype;
|
|
6127
6127
|
return f.getTokenFromCodeInType = function(s) {
|
|
6128
6128
|
return s === 62 || s === 60 ? this.finishOp(o.relational, 1) : P.prototype.getTokenFromCode.call(this, s);
|
|
6129
6129
|
}, f.readToken = function(s) {
|
|
@@ -6152,9 +6152,9 @@ function jh(e) {
|
|
|
6152
6152
|
throw m === void 0 && (m = null), c.node = m, c;
|
|
6153
6153
|
}), error: null, thrown: !1, aborted: !1, failState: null };
|
|
6154
6154
|
} catch (m) {
|
|
6155
|
-
var
|
|
6156
|
-
if (this.setLookaheadState(a), m instanceof SyntaxError) return { node: null, error: m, thrown: !0, aborted: !1, failState:
|
|
6157
|
-
if (m === c) return { node: c.node, error: null, thrown: !1, aborted: !0, failState:
|
|
6155
|
+
var p = this.getCurLookaheadState();
|
|
6156
|
+
if (this.setLookaheadState(a), m instanceof SyntaxError) return { node: null, error: m, thrown: !0, aborted: !1, failState: p };
|
|
6157
|
+
if (m === c) return { node: c.node, error: null, thrown: !1, aborted: !0, failState: p };
|
|
6158
6158
|
throw m;
|
|
6159
6159
|
}
|
|
6160
6160
|
}, f.setOptionalParametersError = function(s, a) {
|
|
@@ -6189,13 +6189,13 @@ function jh(e) {
|
|
|
6189
6189
|
}, f.tsTryParseTypeOrTypePredicateAnnotation = function() {
|
|
6190
6190
|
return this.match(o.colon) ? this.tsParseTypeOrTypePredicateAnnotation(o.colon) : void 0;
|
|
6191
6191
|
}, f.tsTryParseGenericAsyncArrowFunction = function(s, a, c) {
|
|
6192
|
-
var
|
|
6192
|
+
var p = this;
|
|
6193
6193
|
if (this.tsMatchLeftRelational()) {
|
|
6194
6194
|
var m = this.maybeInArrowParameters;
|
|
6195
6195
|
this.maybeInArrowParameters = !0;
|
|
6196
6196
|
var v = this.tsTryParseAndCatch(function() {
|
|
6197
|
-
var x =
|
|
6198
|
-
return x.typeParameters =
|
|
6197
|
+
var x = p.startNodeAt(s, a);
|
|
6198
|
+
return x.typeParameters = p.tsParseTypeParameters(), P.prototype.parseFunctionParams.call(p, x), x.returnType = p.tsTryParseTypeOrTypePredicateAnnotation(), p.expect(o.arrow), x;
|
|
6199
6199
|
});
|
|
6200
6200
|
if (this.maybeInArrowParameters = m, v) return P.prototype.parseArrowExpression.call(this, v, null, !0, c);
|
|
6201
6201
|
}
|
|
@@ -6214,8 +6214,8 @@ function jh(e) {
|
|
|
6214
6214
|
}, f.isUnparsedContextual = function(s, a) {
|
|
6215
6215
|
var c = s + a.length;
|
|
6216
6216
|
if (this.input.slice(s, c) === a) {
|
|
6217
|
-
var
|
|
6218
|
-
return !(
|
|
6217
|
+
var p = this.input.charCodeAt(c);
|
|
6218
|
+
return !(le(p) || (64512 & p) == 55296);
|
|
6219
6219
|
}
|
|
6220
6220
|
return !1;
|
|
6221
6221
|
}, f.isAbstractConstructorSignature = function() {
|
|
@@ -6225,8 +6225,8 @@ function jh(e) {
|
|
|
6225
6225
|
}, f.lookaheadCharCode = function() {
|
|
6226
6226
|
return this.input.charCodeAt(this.nextTokenStart());
|
|
6227
6227
|
}, f.compareLookaheadState = function(s, a) {
|
|
6228
|
-
for (var c = 0,
|
|
6229
|
-
var m =
|
|
6228
|
+
for (var c = 0, p = Object.keys(s); c < p.length; c++) {
|
|
6229
|
+
var m = p[c];
|
|
6230
6230
|
if (s[m] !== a[m]) return !1;
|
|
6231
6231
|
}
|
|
6232
6232
|
return !0;
|
|
@@ -6246,8 +6246,8 @@ function jh(e) {
|
|
|
6246
6246
|
if (this.createLookaheadState(), this.isLookahead = !0, s !== void 0) for (var c = 0; c < s; c++) this.nextToken();
|
|
6247
6247
|
else this.nextToken();
|
|
6248
6248
|
this.isLookahead = !1;
|
|
6249
|
-
var
|
|
6250
|
-
return this.setLookaheadState(a),
|
|
6249
|
+
var p = this.getCurLookaheadState();
|
|
6250
|
+
return this.setLookaheadState(a), p;
|
|
6251
6251
|
}, f.readWord = function() {
|
|
6252
6252
|
var s = this.readWord1(), a = o.name;
|
|
6253
6253
|
return this.keywords.test(s) ? a = S[s] : new RegExp(ft).test(s) && (a = D[s]), this.finishToken(a, s);
|
|
@@ -6255,12 +6255,12 @@ function jh(e) {
|
|
|
6255
6255
|
var s;
|
|
6256
6256
|
this.isLookahead || (s = this.options.onComment && this.curPosition());
|
|
6257
6257
|
var a = this.pos, c = this.input.indexOf("*/", this.pos += 2);
|
|
6258
|
-
if (c === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = c + 2, this.options.locations) for (var
|
|
6258
|
+
if (c === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = c + 2, this.options.locations) for (var p, m = a; (p = Os(this.input, m, this.pos)) > -1; ) ++this.curLine, m = this.lineStart = p;
|
|
6259
6259
|
this.isLookahead || this.options.onComment && this.options.onComment(!0, this.input.slice(a + 2, c), a, this.pos, s, this.curPosition());
|
|
6260
6260
|
}, f.skipLineComment = function(s) {
|
|
6261
6261
|
var a, c = this.pos;
|
|
6262
6262
|
this.isLookahead || (a = this.options.onComment && this.curPosition());
|
|
6263
|
-
for (var
|
|
6263
|
+
for (var p = this.input.charCodeAt(this.pos += s); this.pos < this.input.length && !F(p); ) p = this.input.charCodeAt(++this.pos);
|
|
6264
6264
|
this.isLookahead || this.options.onComment && this.options.onComment(!1, this.input.slice(c + s, this.pos), c, this.pos, a, this.curPosition());
|
|
6265
6265
|
}, f.finishToken = function(s, a) {
|
|
6266
6266
|
this.preValue = this.value, this.preToken = this.type, this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
@@ -6272,10 +6272,10 @@ function jh(e) {
|
|
|
6272
6272
|
return this.eat(o.semi) || P.prototype.canInsertSemicolon.call(this);
|
|
6273
6273
|
}, f.hasFollowingLineBreak = function() {
|
|
6274
6274
|
return vr.lastIndex = this.end, vr.test(this.input);
|
|
6275
|
-
}, f.addExtra = function(s, a, c,
|
|
6276
|
-
if (
|
|
6275
|
+
}, f.addExtra = function(s, a, c, p) {
|
|
6276
|
+
if (p === void 0 && (p = !0), s) {
|
|
6277
6277
|
var m = s.extra = s.extra || {};
|
|
6278
|
-
|
|
6278
|
+
p ? m[a] = c : Object.defineProperty(m, a, { enumerable: p, value: c });
|
|
6279
6279
|
}
|
|
6280
6280
|
}, f.isLiteralPropertyName = function() {
|
|
6281
6281
|
return Ce(this.type);
|
|
@@ -6316,14 +6316,14 @@ function jh(e) {
|
|
|
6316
6316
|
return this.type === y.tokTypes[s];
|
|
6317
6317
|
}, f.ts_eatWithState = function(s, a, c) {
|
|
6318
6318
|
if (s === c.type) {
|
|
6319
|
-
for (var
|
|
6319
|
+
for (var p = 0; p < a; p++) this.next();
|
|
6320
6320
|
return !0;
|
|
6321
6321
|
}
|
|
6322
6322
|
return !1;
|
|
6323
6323
|
}, f.ts_eatContextualWithState = function(s, a, c) {
|
|
6324
6324
|
if (ft.test(s)) {
|
|
6325
6325
|
if (this.ts_isContextualWithState(c, D[s])) {
|
|
6326
|
-
for (var
|
|
6326
|
+
for (var p = 0; p < a; p++) this.next();
|
|
6327
6327
|
return !0;
|
|
6328
6328
|
}
|
|
6329
6329
|
return !1;
|
|
@@ -6364,18 +6364,18 @@ function jh(e) {
|
|
|
6364
6364
|
}, f.tsTryParseDeclare = function(s) {
|
|
6365
6365
|
var a = this;
|
|
6366
6366
|
if (!this.isLineTerminator()) {
|
|
6367
|
-
var c,
|
|
6368
|
-
return this.isContextual("let") && (
|
|
6369
|
-
if (
|
|
6370
|
-
if (
|
|
6371
|
-
if (
|
|
6372
|
-
if (
|
|
6373
|
-
if (
|
|
6374
|
-
if (
|
|
6367
|
+
var c, p = this.type;
|
|
6368
|
+
return this.isContextual("let") && (p = o._var, c = "let"), this.tsInAmbientContext(function() {
|
|
6369
|
+
if (p === o._function) return s.declare = !0, a.parseFunctionStatement(s, !1, !0);
|
|
6370
|
+
if (p === o._class) return s.declare = !0, a.parseClass(s, !0);
|
|
6371
|
+
if (p === D.enum) return a.tsParseEnumDeclaration(s, { declare: !0 });
|
|
6372
|
+
if (p === D.global) return a.tsParseAmbientExternalModuleDeclaration(s);
|
|
6373
|
+
if (p === o._const || p === o._var) return a.match(o._const) && a.isLookaheadContextual("enum") ? (a.expect(o._const), a.tsParseEnumDeclaration(s, { const: !0, declare: !0 })) : (s.declare = !0, a.parseVarStatement(s, c || a.value, !0));
|
|
6374
|
+
if (p === D.interface) {
|
|
6375
6375
|
var m = a.tsParseInterfaceDeclaration(s, { declare: !0 });
|
|
6376
6376
|
if (m) return m;
|
|
6377
6377
|
}
|
|
6378
|
-
return q(
|
|
6378
|
+
return q(p) ? a.tsParseDeclaration(s, a.value, !0) : void 0;
|
|
6379
6379
|
});
|
|
6380
6380
|
}
|
|
6381
6381
|
}, f.tsIsListTerminator = function(s) {
|
|
@@ -6390,7 +6390,7 @@ function jh(e) {
|
|
|
6390
6390
|
case "TypeParametersOrArguments":
|
|
6391
6391
|
return this.tsMatchRightRelational();
|
|
6392
6392
|
}
|
|
6393
|
-
}, f.tsParseDelimitedListWorker = function(s, a, c,
|
|
6393
|
+
}, f.tsParseDelimitedListWorker = function(s, a, c, p) {
|
|
6394
6394
|
for (var m = [], v = -1; !this.tsIsListTerminator(s); ) {
|
|
6395
6395
|
v = -1;
|
|
6396
6396
|
var x = a();
|
|
@@ -6401,14 +6401,14 @@ function jh(e) {
|
|
|
6401
6401
|
}
|
|
6402
6402
|
v = this.lastTokStart;
|
|
6403
6403
|
}
|
|
6404
|
-
return
|
|
6404
|
+
return p && (p.value = v), m;
|
|
6405
6405
|
}, f.tsParseDelimitedList = function(s, a, c) {
|
|
6406
|
-
return (function(
|
|
6407
|
-
if (
|
|
6408
|
-
return
|
|
6406
|
+
return (function(p) {
|
|
6407
|
+
if (p == null) throw new Error("Unexpected " + p + " value.");
|
|
6408
|
+
return p;
|
|
6409
6409
|
})(this.tsParseDelimitedListWorker(s, a, !0, c));
|
|
6410
|
-
}, f.tsParseBracketedList = function(s, a, c,
|
|
6411
|
-
|
|
6410
|
+
}, f.tsParseBracketedList = function(s, a, c, p, m) {
|
|
6411
|
+
p || this.expect(c ? o.bracketL : o.relational);
|
|
6412
6412
|
var v = this.tsParseDelimitedList(s, a, m);
|
|
6413
6413
|
return this.expect(c ? o.bracketR : o.relational), v;
|
|
6414
6414
|
}, f.tsParseTypeParameterName = function() {
|
|
@@ -6490,15 +6490,15 @@ function jh(e) {
|
|
|
6490
6490
|
return this.tsInType(function() {
|
|
6491
6491
|
var c = a.startNode();
|
|
6492
6492
|
a.expect(s);
|
|
6493
|
-
var
|
|
6493
|
+
var p = a.startNode(), m = !!a.tsTryParse(a.tsParseTypePredicateAsserts.bind(a));
|
|
6494
6494
|
if (m && a.match(o._this)) {
|
|
6495
6495
|
var v = a.tsParseThisTypeOrThisTypePredicate();
|
|
6496
|
-
return v.type === "TSThisType" ? (
|
|
6496
|
+
return v.type === "TSThisType" ? (p.parameterName = v, p.asserts = !0, p.typeAnnotation = null, v = a.finishNode(p, "TSTypePredicate")) : (a.resetStartLocationFromNode(v, p), v.asserts = !0), c.typeAnnotation = v, a.finishNode(c, "TSTypeAnnotation");
|
|
6497
6497
|
}
|
|
6498
6498
|
var x = a.tsIsIdentifier() && a.tsTryParse(a.tsParseTypePredicatePrefix.bind(a));
|
|
6499
|
-
if (!x) return m ? (
|
|
6499
|
+
if (!x) return m ? (p.parameterName = a.parseIdent(), p.asserts = m, p.typeAnnotation = null, c.typeAnnotation = a.finishNode(p, "TSTypePredicate"), a.finishNode(c, "TSTypeAnnotation")) : a.tsParseTypeAnnotation(!1, c);
|
|
6500
6500
|
var g = a.tsParseTypeAnnotation(!1);
|
|
6501
|
-
return
|
|
6501
|
+
return p.parameterName = x, p.typeAnnotation = g, p.asserts = m, c.typeAnnotation = a.finishNode(p, "TSTypePredicate"), a.finishNode(c, "TSTypeAnnotation");
|
|
6502
6502
|
});
|
|
6503
6503
|
}, f.tsFillSignature = function(s, a) {
|
|
6504
6504
|
var c = s === o.arrow;
|
|
@@ -6509,16 +6509,16 @@ function jh(e) {
|
|
|
6509
6509
|
var s = this.tsParseTypeReference();
|
|
6510
6510
|
return s.typeParameters && this.raise(s.typeName.start, N.CannotFindName({ name: "const" })), s;
|
|
6511
6511
|
}, f.tsParseFunctionOrConstructorType = function(s, a) {
|
|
6512
|
-
var c = this,
|
|
6513
|
-
return s === "TSConstructorType" && (
|
|
6514
|
-
return c.tsFillSignature(o.arrow,
|
|
6515
|
-
}), this.finishNode(
|
|
6512
|
+
var c = this, p = this.startNode();
|
|
6513
|
+
return s === "TSConstructorType" && (p.abstract = !!a, a && this.next(), this.next()), this.tsInAllowConditionalTypesContext(function() {
|
|
6514
|
+
return c.tsFillSignature(o.arrow, p);
|
|
6515
|
+
}), this.finishNode(p, s);
|
|
6516
6516
|
}, f.tsParseUnionOrIntersectionType = function(s, a, c) {
|
|
6517
|
-
var
|
|
6517
|
+
var p = this.startNode(), m = this.eat(c), v = [];
|
|
6518
6518
|
do
|
|
6519
6519
|
v.push(a());
|
|
6520
6520
|
while (this.eat(c));
|
|
6521
|
-
return v.length !== 1 || m ? (
|
|
6521
|
+
return v.length !== 1 || m ? (p.types = v, this.finishNode(p, s)) : v[0];
|
|
6522
6522
|
}, f.tsCheckTypeAnnotationForReadOnly = function(s) {
|
|
6523
6523
|
switch (s.typeAnnotation.type) {
|
|
6524
6524
|
case "TSTupleType":
|
|
@@ -6574,30 +6574,30 @@ function jh(e) {
|
|
|
6574
6574
|
var s = this.startNode();
|
|
6575
6575
|
return s.members = this.tsParseObjectTypeMembers(), this.finishNode(s, "TSTypeLiteral");
|
|
6576
6576
|
}, f.tsParseTupleElementType = function() {
|
|
6577
|
-
var s = this.startLoc, a = this.start, c = this.eat(o.ellipsis),
|
|
6577
|
+
var s = this.startLoc, a = this.start, c = this.eat(o.ellipsis), p = this.tsParseType(), m = this.eat(o.question);
|
|
6578
6578
|
if (this.eat(o.colon)) {
|
|
6579
|
-
var v = this.startNodeAtNode(
|
|
6580
|
-
v.optional = m,
|
|
6579
|
+
var v = this.startNodeAtNode(p);
|
|
6580
|
+
v.optional = m, p.type !== "TSTypeReference" || p.typeParameters || p.typeName.type !== "Identifier" ? (this.raise(p.start, N.InvalidTupleMemberLabel), v.label = p) : v.label = p.typeName, v.elementType = this.tsParseType(), p = this.finishNode(v, "TSNamedTupleMember");
|
|
6581
6581
|
} else if (m) {
|
|
6582
|
-
var x = this.startNodeAtNode(
|
|
6583
|
-
x.typeAnnotation =
|
|
6582
|
+
var x = this.startNodeAtNode(p);
|
|
6583
|
+
x.typeAnnotation = p, p = this.finishNode(x, "TSOptionalType");
|
|
6584
6584
|
}
|
|
6585
6585
|
if (c) {
|
|
6586
6586
|
var g = this.startNodeAt(a, s);
|
|
6587
|
-
g.typeAnnotation =
|
|
6587
|
+
g.typeAnnotation = p, p = this.finishNode(g, "TSRestType");
|
|
6588
6588
|
}
|
|
6589
|
-
return
|
|
6589
|
+
return p;
|
|
6590
6590
|
}, f.tsParseTupleType = function() {
|
|
6591
6591
|
var s = this, a = this.startNode();
|
|
6592
6592
|
a.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), !0, !1);
|
|
6593
|
-
var c = !1,
|
|
6593
|
+
var c = !1, p = null;
|
|
6594
6594
|
return a.elementTypes.forEach(function(m) {
|
|
6595
6595
|
var v = m.type;
|
|
6596
6596
|
!c || v === "TSRestType" || v === "TSOptionalType" || v === "TSNamedTupleMember" && m.optional || s.raise(m.start, N.OptionalTypeBeforeRequired), c || (c = v === "TSNamedTupleMember" && m.optional || v === "TSOptionalType");
|
|
6597
6597
|
var x = v;
|
|
6598
6598
|
v === "TSRestType" && (x = (m = m.typeAnnotation).type);
|
|
6599
6599
|
var g = x === "TSNamedTupleMember";
|
|
6600
|
-
|
|
6600
|
+
p != null || (p = g), p !== g && s.raise(m.start, N.MixedLabeledAndUnlabeledElements);
|
|
6601
6601
|
}), this.finishNode(a, "TSTupleType");
|
|
6602
6602
|
}, f.tsParseTemplateLiteralType = function() {
|
|
6603
6603
|
var s = this.startNode();
|
|
@@ -6670,8 +6670,8 @@ function jh(e) {
|
|
|
6670
6670
|
}
|
|
6671
6671
|
})(this.value);
|
|
6672
6672
|
if (c !== void 0 && this.lookaheadCharCode() !== 46) {
|
|
6673
|
-
var
|
|
6674
|
-
return this.next(), this.finishNode(
|
|
6673
|
+
var p = this.startNode();
|
|
6674
|
+
return this.next(), this.finishNode(p, c);
|
|
6675
6675
|
}
|
|
6676
6676
|
return this.tsParseTypeReference();
|
|
6677
6677
|
}
|
|
@@ -6757,17 +6757,17 @@ function jh(e) {
|
|
|
6757
6757
|
}
|
|
6758
6758
|
}
|
|
6759
6759
|
}, f.tsParseModifiersByMap = function(s) {
|
|
6760
|
-
for (var a = s.modified, c = s.map,
|
|
6761
|
-
var v = m[
|
|
6760
|
+
for (var a = s.modified, c = s.map, p = 0, m = Object.keys(c); p < m.length; p++) {
|
|
6761
|
+
var v = m[p];
|
|
6762
6762
|
a[v] = c[v];
|
|
6763
6763
|
}
|
|
6764
6764
|
}, f.tsParseModifiers = function(s) {
|
|
6765
|
-
for (var a = this, c = s.modified,
|
|
6765
|
+
for (var a = this, c = s.modified, p = s.allowedModifiers, m = s.disallowedModifiers, v = s.stopOnStartOfClassStaticBlock, x = s.errorTemplate, g = x === void 0 ? N.InvalidModifierOnTypeMember : x, _ = {}, T = function(K, G, X, ie) {
|
|
6766
6766
|
G === X && c[ie] && a.raise(K.column, N.InvalidModifiersOrder({ orderedModifiers: [X, ie] }));
|
|
6767
6767
|
}, L = function(K, G, X, ie) {
|
|
6768
6768
|
(c[X] && G === ie || c[ie] && G === X) && a.raise(K.column, N.IncompatibleModifiers({ modifiers: [X, ie] }));
|
|
6769
6769
|
}; ; ) {
|
|
6770
|
-
var V = this.startLoc, E = this.tsParseModifier(
|
|
6770
|
+
var V = this.startLoc, E = this.tsParseModifier(p.concat(m ?? []), v);
|
|
6771
6771
|
if (!E) break;
|
|
6772
6772
|
br(E) ? c.accessibility ? this.raise(this.start, N.DuplicateAccessibilityModifier()) : (T(V, E, E, "override"), T(V, E, E, "static"), T(V, E, E, "readonly"), T(V, E, E, "accessor"), _.accessibility = E, c.accessibility = E) : Vh(E) ? c[E] ? this.raise(this.start, N.DuplicateModifier({ modifier: E })) : (T(V, E, "in", "out"), _[E] = E, c[E] = !0) : Mh(E) ? c[E] ? this.raise(this.start, N.DuplicateModifier({ modifier: E })) : (L(V, E, "accessor", "readonly"), L(V, E, "accessor", "static"), L(V, E, "accessor", "override"), _[E] = E, c[E] = !0) : Object.hasOwnProperty.call(c, E) ? this.raise(this.start, N.DuplicateModifier({ modifier: E })) : (T(V, E, "static", "readonly"), T(V, E, "static", "override"), T(V, E, "override", "readonly"), T(V, E, "abstract", "override"), L(V, E, "declare", "override"), L(V, E, "static", "abstract"), _[E] = E, c[E] = !0), m != null && m.includes(E) && this.raise(this.start, g);
|
|
6773
6773
|
}
|
|
@@ -6782,11 +6782,11 @@ function jh(e) {
|
|
|
6782
6782
|
});
|
|
6783
6783
|
}), a.params.length === 0 && this.raise(this.start, N.EmptyTypeArguments), this.exprAllowed = !1, this.expect(o.relational), this.finishNode(a, "TSTypeParameterInstantiation");
|
|
6784
6784
|
}, f.tsParseHeritageClause = function(s) {
|
|
6785
|
-
var a = this, c = this.start,
|
|
6785
|
+
var a = this, c = this.start, p = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
6786
6786
|
var m = a.startNode();
|
|
6787
6787
|
return m.expression = a.tsParseEntityName(), a.tsMatchLeftRelational() && (m.typeParameters = a.tsParseTypeArguments()), a.finishNode(m, "TSExpressionWithTypeArguments");
|
|
6788
6788
|
});
|
|
6789
|
-
return
|
|
6789
|
+
return p.length || this.raise(c, N.EmptyHeritageClauseType({ token: s })), p;
|
|
6790
6790
|
}, f.tsParseTypeMemberSemicolon = function() {
|
|
6791
6791
|
this.eat(o.comma) || this.isLineTerminator() || this.expect(o.semi);
|
|
6792
6792
|
}, f.tsTryParseAndCatch = function(s) {
|
|
@@ -6801,19 +6801,19 @@ function jh(e) {
|
|
|
6801
6801
|
var c = s;
|
|
6802
6802
|
if (this.match(o.parenL) || this.tsMatchLeftRelational()) {
|
|
6803
6803
|
a && this.raise(s.start, N.ReadonlyForMethodSignature);
|
|
6804
|
-
var
|
|
6805
|
-
|
|
6804
|
+
var p = c;
|
|
6805
|
+
p.kind && this.tsMatchLeftRelational() && this.raise(this.start, N.AccesorCannotHaveTypeParameters), this.tsFillSignature(o.colon, p), this.tsParseTypeMemberSemicolon();
|
|
6806
6806
|
var m = "parameters", v = "typeAnnotation";
|
|
6807
|
-
if (
|
|
6808
|
-
else if (
|
|
6809
|
-
if (
|
|
6807
|
+
if (p.kind === "get") p[m].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(p[m][0]) && this.raise(this.start, N.AccesorCannotDeclareThisParameter));
|
|
6808
|
+
else if (p.kind === "set") {
|
|
6809
|
+
if (p[m].length !== 1) this.raise(this.start, "A 'get' accesor must not have any formal parameters.");
|
|
6810
6810
|
else {
|
|
6811
|
-
var x =
|
|
6811
|
+
var x = p[m][0];
|
|
6812
6812
|
this.isThisParam(x) && this.raise(this.start, N.AccesorCannotDeclareThisParameter), x.type === "Identifier" && x.optional && this.raise(this.start, N.SetAccesorCannotHaveOptionalParameter), x.type === "RestElement" && this.raise(this.start, N.SetAccesorCannotHaveRestParameter);
|
|
6813
6813
|
}
|
|
6814
|
-
|
|
6815
|
-
} else
|
|
6816
|
-
return this.finishNode(
|
|
6814
|
+
p[v] && this.raise(p[v].start, N.SetAccesorCannotHaveReturnType);
|
|
6815
|
+
} else p.kind = "method";
|
|
6816
|
+
return this.finishNode(p, "TSMethodSignature");
|
|
6817
6817
|
}
|
|
6818
6818
|
var g = c;
|
|
6819
6819
|
a && (g.readonly = !0);
|
|
@@ -6855,8 +6855,8 @@ function jh(e) {
|
|
|
6855
6855
|
case "global":
|
|
6856
6856
|
if (this.match(o.braceL)) {
|
|
6857
6857
|
P.prototype.enterScope.call(this, yt);
|
|
6858
|
-
var
|
|
6859
|
-
return
|
|
6858
|
+
var p = s;
|
|
6859
|
+
return p.global = !0, p.id = a, p.body = this.tsParseModuleBlock(), P.prototype.exitScope.call(this), this.finishNode(p, "TSModuleDeclaration");
|
|
6860
6860
|
}
|
|
6861
6861
|
break;
|
|
6862
6862
|
default:
|
|
@@ -6869,8 +6869,8 @@ function jh(e) {
|
|
|
6869
6869
|
if (q(s)) {
|
|
6870
6870
|
if (a && !this.containsEsc || c) return !1;
|
|
6871
6871
|
if ((s === D.type || s === D.interface) && !this.containsEsc) {
|
|
6872
|
-
var
|
|
6873
|
-
if (q(
|
|
6872
|
+
var p = this.lookahead();
|
|
6873
|
+
if (q(p.type) && !this.isContextualWithState("from", p) || p.type === o.braceL) return !1;
|
|
6874
6874
|
}
|
|
6875
6875
|
} else if (!this.match(o._default)) return !1;
|
|
6876
6876
|
var m = this.nextTokenStart(), v = this.isUnparsedContextual(m, "from");
|
|
@@ -6940,51 +6940,51 @@ function jh(e) {
|
|
|
6940
6940
|
if (q(a.type) && !this.isContextualWithState("from", a) || a.type === o.braceL) return !1;
|
|
6941
6941
|
}
|
|
6942
6942
|
} else if (!this.match(o._default)) return !1;
|
|
6943
|
-
var c = this.nextTokenStart(),
|
|
6944
|
-
if (this.input.charCodeAt(c) === 44 || q(this.type) &&
|
|
6945
|
-
if (this.match(o._default) &&
|
|
6943
|
+
var c = this.nextTokenStart(), p = this.isUnparsedContextual(c, "from");
|
|
6944
|
+
if (this.input.charCodeAt(c) === 44 || q(this.type) && p) return !0;
|
|
6945
|
+
if (this.match(o._default) && p) {
|
|
6946
6946
|
var m = this.input.charCodeAt(this.nextTokenStartSince(c + 4));
|
|
6947
6947
|
return m === 34 || m === 39;
|
|
6948
6948
|
}
|
|
6949
6949
|
return !1;
|
|
6950
6950
|
}, f.parseTemplate = function(s) {
|
|
6951
|
-
var a = (s === void 0 ? {} : s).isTagged, c = a !== void 0 && a,
|
|
6952
|
-
this.next(),
|
|
6951
|
+
var a = (s === void 0 ? {} : s).isTagged, c = a !== void 0 && a, p = this.startNode();
|
|
6952
|
+
this.next(), p.expressions = [];
|
|
6953
6953
|
var m = this.parseTemplateElement({ isTagged: c });
|
|
6954
|
-
for (
|
|
6955
|
-
return this.next(), this.finishNode(
|
|
6956
|
-
}, f.parseFunction = function(s, a, c,
|
|
6957
|
-
this.initFunction(s), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !
|
|
6954
|
+
for (p.quasis = [m]; !m.tail; ) this.type === o.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(o.dollarBraceL), p.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()), this.expect(o.braceR), p.quasis.push(m = this.parseTemplateElement({ isTagged: c }));
|
|
6955
|
+
return this.next(), this.finishNode(p, "TemplateLiteral");
|
|
6956
|
+
}, f.parseFunction = function(s, a, c, p, m) {
|
|
6957
|
+
this.initFunction(s), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !p) && (this.type === o.star && 2 & a && this.unexpected(), s.generator = this.eat(o.star)), this.options.ecmaVersion >= 8 && (s.async = !!p), 1 & a && (s.id = 4 & a && this.type !== o.name ? null : this.parseIdent());
|
|
6958
6958
|
var v = this.yieldPos, x = this.awaitPos, g = this.awaitIdentPos, _ = this.maybeInArrowParameters;
|
|
6959
6959
|
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(ui(s.async, s.generator)), 1 & a || (s.id = this.type === o.name ? this.parseIdent() : null), this.parseFunctionParams(s);
|
|
6960
6960
|
var T = 1 & a;
|
|
6961
6961
|
return this.parseFunctionBody(s, c, !1, m, { isFunctionDeclaration: T }), this.yieldPos = v, this.awaitPos = x, this.awaitIdentPos = g, 1 & a && s.id && !(2 & a) && this.checkLValSimple(s.id, s.body ? this.strict || s.generator || s.async ? this.treatFunctionsAsVar ? 1 : 2 : 3 : 0), this.maybeInArrowParameters = _, this.finishNode(s, T ? "FunctionDeclaration" : "FunctionExpression");
|
|
6962
|
-
}, f.parseFunctionBody = function(s, a, c,
|
|
6963
|
-
a === void 0 && (a = !1), c === void 0 && (c = !1),
|
|
6962
|
+
}, f.parseFunctionBody = function(s, a, c, p, m) {
|
|
6963
|
+
a === void 0 && (a = !1), c === void 0 && (c = !1), p === void 0 && (p = !1), this.match(o.colon) && (s.returnType = this.tsParseTypeOrTypePredicateAnnotation(o.colon));
|
|
6964
6964
|
var v = m != null && m.isFunctionDeclaration ? "TSDeclareFunction" : m != null && m.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
6965
|
-
return v && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(s, v) : v === "TSDeclareFunction" && this.isAmbientContext && (this.raise(s.start, N.DeclareFunctionHasImplementation), s.declare) ? (P.prototype.parseFunctionBody.call(this, s, a, c, !1), this.finishNode(s, v)) : (P.prototype.parseFunctionBody.call(this, s, a, c,
|
|
6965
|
+
return v && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(s, v) : v === "TSDeclareFunction" && this.isAmbientContext && (this.raise(s.start, N.DeclareFunctionHasImplementation), s.declare) ? (P.prototype.parseFunctionBody.call(this, s, a, c, !1), this.finishNode(s, v)) : (P.prototype.parseFunctionBody.call(this, s, a, c, p), s);
|
|
6966
6966
|
}, f.parseNew = function() {
|
|
6967
6967
|
var s;
|
|
6968
6968
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
6969
6969
|
var a = this.startNode(), c = this.parseIdent(!0);
|
|
6970
6970
|
if (this.options.ecmaVersion >= 6 && this.eat(o.dot)) {
|
|
6971
6971
|
a.meta = c;
|
|
6972
|
-
var
|
|
6973
|
-
return a.property = this.parseIdent(!0), a.property.name !== "target" && this.raiseRecoverable(a.property.start, "The only valid meta property for new is 'new.target'"),
|
|
6972
|
+
var p = this.containsEsc;
|
|
6973
|
+
return a.property = this.parseIdent(!0), a.property.name !== "target" && this.raiseRecoverable(a.property.start, "The only valid meta property for new is 'new.target'"), p && this.raiseRecoverable(a.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(a.start, "'new.target' can only be used in functions and class static block"), this.finishNode(a, "MetaProperty");
|
|
6974
6974
|
}
|
|
6975
6975
|
var m = this.start, v = this.startLoc, x = this.type === o._import;
|
|
6976
6976
|
a.callee = this.parseSubscripts(this.parseExprAtom(), m, v, !0, !1), x && a.callee.type === "ImportExpression" && this.raise(m, "Cannot use new with import()");
|
|
6977
6977
|
var g = a.callee;
|
|
6978
6978
|
return g.type !== "TSInstantiationExpression" || (s = g.extra) != null && s.parenthesized || (a.typeParameters = g.typeParameters, a.callee = g.expression), a.arguments = this.eat(o.parenL) ? this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1) : [], this.finishNode(a, "NewExpression");
|
|
6979
|
-
}, f.parseExprOp = function(s, a, c,
|
|
6979
|
+
}, f.parseExprOp = function(s, a, c, p, m) {
|
|
6980
6980
|
var v;
|
|
6981
|
-
if (o._in.binop >
|
|
6981
|
+
if (o._in.binop > p && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (v = "TSAsExpression"), u && this.isContextual("satisfies") && (v = "TSSatisfiesExpression"), v)) {
|
|
6982
6982
|
var x = this.startNodeAt(a, c);
|
|
6983
6983
|
x.expression = s;
|
|
6984
6984
|
var g = this.tsTryNextParseConstantContext();
|
|
6985
|
-
return x.typeAnnotation = g || this.tsNextThenParseType(), this.finishNode(x, v), this.reScan_lt_gt(), this.parseExprOp(x, a, c,
|
|
6985
|
+
return x.typeAnnotation = g || this.tsNextThenParseType(), this.finishNode(x, v), this.reScan_lt_gt(), this.parseExprOp(x, a, c, p, m);
|
|
6986
6986
|
}
|
|
6987
|
-
return P.prototype.parseExprOp.call(this, s, a, c,
|
|
6987
|
+
return P.prototype.parseExprOp.call(this, s, a, c, p, m);
|
|
6988
6988
|
}, f.parseImportSpecifiers = function() {
|
|
6989
6989
|
var s = [], a = !0;
|
|
6990
6990
|
if (y.tokenIsIdentifier(this.type) && (s.push(this.parseImportDefaultSpecifier()), !this.eat(o.comma))) return s;
|
|
@@ -7001,8 +7001,8 @@ function jh(e) {
|
|
|
7001
7001
|
var c = this.lookahead(2);
|
|
7002
7002
|
if (c.type !== o.comma && !this.isContextualWithState("from", c) && c.type !== o.eq && this.ts_eatContextualWithState("type", 1, a) && (this.importOrExportOuterKind = "type", s.importKind = "type", a = this.lookahead(), c = this.lookahead(2)), q(a.type) && c.type === o.eq) {
|
|
7003
7003
|
this.next();
|
|
7004
|
-
var
|
|
7005
|
-
return this.importOrExportOuterKind = "value",
|
|
7004
|
+
var p = this.tsParseImportEqualsDeclaration(s);
|
|
7005
|
+
return this.importOrExportOuterKind = "value", p;
|
|
7006
7006
|
}
|
|
7007
7007
|
}
|
|
7008
7008
|
return this.next(), this.type === o.string ? (s.specifiers = [], s.source = this.parseExprAtom()) : (s.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), s.source = this.type === o.string ? this.parseExprAtom() : this.unexpected()), this.parseMaybeImportAttributes(s), this.semicolon(), this.finishNode(s, "ImportDeclaration"), this.importOrExportOuterKind = "value", s.importKind === "type" && s.specifiers.length > 1 && s.specifiers[0].type === "ImportDefaultSpecifier" && this.raise(s.start, N.TypeImportCannotSpecifyDefaultAndNamed), s;
|
|
@@ -7032,8 +7032,8 @@ function jh(e) {
|
|
|
7032
7032
|
var c = this.lookahead();
|
|
7033
7033
|
if (this.ts_eatWithState(o._import, 2, c)) {
|
|
7034
7034
|
this.ts_isContextual(D.type) && this.lookaheadCharCode() !== 61 ? (s.importKind = "type", this.importOrExportOuterKind = "type", this.next()) : (s.importKind = "value", this.importOrExportOuterKind = "value");
|
|
7035
|
-
var
|
|
7036
|
-
return this.importOrExportOuterKind = void 0,
|
|
7035
|
+
var p = this.tsParseImportEqualsDeclaration(s, !0);
|
|
7036
|
+
return this.importOrExportOuterKind = void 0, p;
|
|
7037
7037
|
}
|
|
7038
7038
|
if (this.ts_eatWithState(o.eq, 2, c)) {
|
|
7039
7039
|
var m = s;
|
|
@@ -7061,14 +7061,14 @@ function jh(e) {
|
|
|
7061
7061
|
}, f.checkExport = function(s, a, c) {
|
|
7062
7062
|
s && (typeof a != "string" && (a = a.type === "Identifier" ? a.name : a.value), s[a] = !0);
|
|
7063
7063
|
}, f.parseMaybeDefault = function(s, a, c) {
|
|
7064
|
-
var
|
|
7065
|
-
return
|
|
7064
|
+
var p = P.prototype.parseMaybeDefault.call(this, s, a, c);
|
|
7065
|
+
return p.type === "AssignmentPattern" && p.typeAnnotation && p.right.start < p.typeAnnotation.start && this.raise(p.typeAnnotation.start, N.TypeAnnotationAfterAssign), p;
|
|
7066
7066
|
}, f.typeCastToParameter = function(s) {
|
|
7067
7067
|
return s.expression.typeAnnotation = s.typeAnnotation, this.resetEndLocation(s.expression, s.typeAnnotation.end), s.expression;
|
|
7068
7068
|
}, f.toAssignableList = function(s, a) {
|
|
7069
7069
|
for (var c = 0; c < s.length; c++) {
|
|
7070
|
-
var
|
|
7071
|
-
|
|
7070
|
+
var p = s[c];
|
|
7071
|
+
p?.type === "TSTypeCastExpression" && (s[c] = this.typeCastToParameter(p));
|
|
7072
7072
|
}
|
|
7073
7073
|
return P.prototype.toAssignableList.call(this, s, a);
|
|
7074
7074
|
}, f.reportReservedArrowTypeParam = function(s) {
|
|
@@ -7077,9 +7077,9 @@ function jh(e) {
|
|
|
7077
7077
|
if (this.type === D.jsxTagStart) return this.jsx_parseElement();
|
|
7078
7078
|
if (this.type === D.at) return this.parseDecorators(), this.parseExprAtom();
|
|
7079
7079
|
if (q(this.type)) {
|
|
7080
|
-
var
|
|
7080
|
+
var p = this.potentialArrowAt === this.start, m = this.start, v = this.startLoc, x = this.containsEsc, g = this.parseIdent(!1);
|
|
7081
7081
|
if (this.options.ecmaVersion >= 8 && !x && g.name === "async" && !this.canInsertSemicolon() && this.eat(o._function)) return this.overrideContext(Z.f_expr), this.parseFunction(this.startNodeAt(m, v), 0, !1, !0, a);
|
|
7082
|
-
if (
|
|
7082
|
+
if (p && !this.canInsertSemicolon()) {
|
|
7083
7083
|
if (this.eat(o.arrow)) return this.parseArrowExpression(this.startNodeAt(m, v), [g], !1, a);
|
|
7084
7084
|
if (this.options.ecmaVersion >= 8 && g.name === "async" && this.type === o.name && !x && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return g = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(m, v), [g], !0, a);
|
|
7085
7085
|
}
|
|
@@ -7090,9 +7090,9 @@ function jh(e) {
|
|
|
7090
7090
|
if (q(this.type)) {
|
|
7091
7091
|
var s = this.potentialArrowAt === this.start, a = this.containsEsc, c = this.parseIdent();
|
|
7092
7092
|
if (!a && c.name === "async" && !this.canInsertSemicolon()) {
|
|
7093
|
-
var
|
|
7094
|
-
if (
|
|
7095
|
-
if (q(
|
|
7093
|
+
var p = this.type;
|
|
7094
|
+
if (p === o._function) return this.next(), this.parseFunction(this.startNodeAtNode(c), void 0, !0, !0);
|
|
7095
|
+
if (q(p)) {
|
|
7096
7096
|
if (this.lookaheadCharCode() === 61) {
|
|
7097
7097
|
var m = this.parseIdent(!1);
|
|
7098
7098
|
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(c), [m], !0);
|
|
@@ -7108,10 +7108,10 @@ function jh(e) {
|
|
|
7108
7108
|
return Ct(this.type) ? (s.name = this.value, s) : P.prototype.parseIdentNode.call(this);
|
|
7109
7109
|
}, f.parseVarStatement = function(s, a, c) {
|
|
7110
7110
|
c === void 0 && (c = !1);
|
|
7111
|
-
var
|
|
7112
|
-
this.next(), P.prototype.parseVar.call(this, s, !1, a, c ||
|
|
7111
|
+
var p = this.isAmbientContext;
|
|
7112
|
+
this.next(), P.prototype.parseVar.call(this, s, !1, a, c || p), this.semicolon();
|
|
7113
7113
|
var m = this.finishNode(s, "VariableDeclaration");
|
|
7114
|
-
if (!
|
|
7114
|
+
if (!p) return m;
|
|
7115
7115
|
for (var v, x = yr(m.declarations); !(v = x()).done; ) {
|
|
7116
7116
|
var g = v.value, _ = g.init;
|
|
7117
7117
|
_ && (a !== "const" || g.id.typeAnnotation ? this.raise(_.start, N.InitializerNotAllowedInAmbientContext) : _.type !== "StringLiteral" && _.type !== "BooleanLiteral" && _.type !== "NumericLiteral" && _.type !== "BigIntLiteral" && (_.type !== "TemplateLiteral" || _.expressions.length > 0) && !zh(_) && this.raise(_.start, N.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));
|
|
@@ -7119,8 +7119,8 @@ function jh(e) {
|
|
|
7119
7119
|
return m;
|
|
7120
7120
|
}, f.parseStatement = function(s, a, c) {
|
|
7121
7121
|
if (this.match(D.at) && this.parseDecorators(!0), this.match(o._const) && this.isLookaheadContextual("enum")) {
|
|
7122
|
-
var
|
|
7123
|
-
return this.expect(o._const), this.tsParseEnumDeclaration(
|
|
7122
|
+
var p = this.startNode();
|
|
7123
|
+
return this.expect(o._const), this.tsParseEnumDeclaration(p, { const: !0 });
|
|
7124
7124
|
}
|
|
7125
7125
|
if (this.ts_isContextual(D.enum)) return this.tsParseEnumDeclaration(this.startNode());
|
|
7126
7126
|
if (this.ts_isContextual(D.interface)) {
|
|
@@ -7136,25 +7136,25 @@ function jh(e) {
|
|
|
7136
7136
|
return (a.type === "Identifier" ? this.tsParseExpressionStatement(s, a) : void 0) || P.prototype.parseExpressionStatement.call(this, s, a);
|
|
7137
7137
|
}, f.shouldParseExportStatement = function() {
|
|
7138
7138
|
return !!this.tsIsDeclarationStart() || !!this.match(D.at) || P.prototype.shouldParseExportStatement.call(this);
|
|
7139
|
-
}, f.parseConditional = function(s, a, c,
|
|
7139
|
+
}, f.parseConditional = function(s, a, c, p, m) {
|
|
7140
7140
|
if (this.eat(o.question)) {
|
|
7141
7141
|
var v = this.startNodeAt(a, c);
|
|
7142
|
-
return v.test = s, v.consequent = this.parseMaybeAssign(), this.expect(o.colon), v.alternate = this.parseMaybeAssign(
|
|
7142
|
+
return v.test = s, v.consequent = this.parseMaybeAssign(), this.expect(o.colon), v.alternate = this.parseMaybeAssign(p), this.finishNode(v, "ConditionalExpression");
|
|
7143
7143
|
}
|
|
7144
7144
|
return s;
|
|
7145
7145
|
}, f.parseMaybeConditional = function(s, a) {
|
|
7146
|
-
var c = this,
|
|
7146
|
+
var c = this, p = this.start, m = this.startLoc, v = this.parseExprOps(s, a);
|
|
7147
7147
|
if (this.checkExpressionErrors(a)) return v;
|
|
7148
|
-
if (!this.maybeInArrowParameters || !this.match(o.question)) return this.parseConditional(v,
|
|
7148
|
+
if (!this.maybeInArrowParameters || !this.match(o.question)) return this.parseConditional(v, p, m, s, a);
|
|
7149
7149
|
var x = this.tryParse(function() {
|
|
7150
|
-
return c.parseConditional(v,
|
|
7150
|
+
return c.parseConditional(v, p, m, s, a);
|
|
7151
7151
|
});
|
|
7152
7152
|
return x.node ? (x.error && this.setLookaheadState(x.failState), x.node) : (x.error && this.setOptionalParametersError(a, x.error), v);
|
|
7153
7153
|
}, f.parseParenItem = function(s) {
|
|
7154
7154
|
var a = this.start, c = this.startLoc;
|
|
7155
7155
|
if (s = P.prototype.parseParenItem.call(this, s), this.eat(o.question) && (s.optional = !0, this.resetEndLocation(s)), this.match(o.colon)) {
|
|
7156
|
-
var
|
|
7157
|
-
return
|
|
7156
|
+
var p = this.startNodeAt(a, c);
|
|
7157
|
+
return p.expression = s, p.typeAnnotation = this.tsParseTypeAnnotation(), this.finishNode(p, "TSTypeCastExpression");
|
|
7158
7158
|
}
|
|
7159
7159
|
return s;
|
|
7160
7160
|
}, f.parseExportDeclaration = function(s) {
|
|
@@ -7162,10 +7162,10 @@ function jh(e) {
|
|
|
7162
7162
|
if (!this.isAmbientContext && this.ts_isContextual(D.declare)) return this.tsInAmbientContext(function() {
|
|
7163
7163
|
return a.parseExportDeclaration(s);
|
|
7164
7164
|
});
|
|
7165
|
-
var c = this.start,
|
|
7165
|
+
var c = this.start, p = this.startLoc, m = this.eatContextual("declare");
|
|
7166
7166
|
!m || !this.ts_isContextual(D.declare) && this.shouldParseExportStatement() || this.raise(this.start, N.ExpectedAmbientAfterExportDeclare);
|
|
7167
7167
|
var v = q(this.type) && this.tsTryParseExportDeclaration() || this.parseStatement(null);
|
|
7168
|
-
return v ? ((v.type === "TSInterfaceDeclaration" || v.type === "TSTypeAliasDeclaration" || m) && (s.exportKind = "type"), m && (this.resetStartLocation(v, c,
|
|
7168
|
+
return v ? ((v.type === "TSInterfaceDeclaration" || v.type === "TSTypeAliasDeclaration" || m) && (s.exportKind = "type"), m && (this.resetStartLocation(v, c, p), v.declare = !0), v) : null;
|
|
7169
7169
|
}, f.parseClassId = function(s, a) {
|
|
7170
7170
|
if (a || !this.isContextual("implements")) {
|
|
7171
7171
|
P.prototype.parseClassId.call(this, s, a);
|
|
@@ -7183,37 +7183,37 @@ function jh(e) {
|
|
|
7183
7183
|
this.raise(this.start, N.AbstractPropertyHasInitializer({ propertyName: a.type !== "Identifier" || s.computed ? "[" + this.input.slice(a.start, a.end) + "]" : a.name }));
|
|
7184
7184
|
}
|
|
7185
7185
|
return P.prototype.parseClassField.call(this, s);
|
|
7186
|
-
}, f.parseClassMethod = function(s, a, c,
|
|
7186
|
+
}, f.parseClassMethod = function(s, a, c, p) {
|
|
7187
7187
|
var m = s.kind === "constructor", v = s.key.type === "PrivateIdentifier", x = this.tsTryParseTypeParameters();
|
|
7188
7188
|
v ? (x && (s.typeParameters = x), s.accessibility && this.raise(s.start, N.PrivateMethodsHasAccessibility({ modifier: s.accessibility }))) : x && m && this.raise(x.start, N.ConstructorHasTypeParameters);
|
|
7189
7189
|
var g = s.declare, _ = s.kind;
|
|
7190
7190
|
!(g !== void 0 && g) || _ !== "get" && _ !== "set" || this.raise(s.start, N.DeclareAccessor({ kind: _ })), x && (s.typeParameters = x);
|
|
7191
7191
|
var T = s.key;
|
|
7192
7192
|
s.kind === "constructor" ? (a && this.raise(T.start, "Constructor can't be a generator"), c && this.raise(T.start, "Constructor can't be an async method")) : s.static && xr(s, "prototype") && this.raise(T.start, "Classes may not have a static property named prototype");
|
|
7193
|
-
var L = s.value = this.parseMethod(a, c,
|
|
7193
|
+
var L = s.value = this.parseMethod(a, c, p, !0, s);
|
|
7194
7194
|
return s.kind === "get" && L.params.length !== 0 && this.raiseRecoverable(L.start, "getter should have no params"), s.kind === "set" && L.params.length !== 1 && this.raiseRecoverable(L.start, "setter should have exactly one param"), s.kind === "set" && L.params[0].type === "RestElement" && this.raiseRecoverable(L.params[0].start, "Setter cannot use rest params"), this.finishNode(s, "MethodDefinition");
|
|
7195
7195
|
}, f.isClassMethod = function() {
|
|
7196
7196
|
return this.match(o.relational);
|
|
7197
7197
|
}, f.parseClassElement = function(s) {
|
|
7198
7198
|
var a = this;
|
|
7199
7199
|
if (this.eat(o.semi)) return null;
|
|
7200
|
-
var c,
|
|
7200
|
+
var c, p = this.options.ecmaVersion, m = this.startNode(), v = "", x = !1, g = !1, _ = "method", T = ["declare", "private", "public", "protected", "accessor", "override", "abstract", "readonly", "static"], L = this.tsParseModifiers({ modified: m, allowedModifiers: T, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: !0, errorTemplate: N.InvalidModifierOnTypeParameterPositions });
|
|
7201
7201
|
c = !!L.static;
|
|
7202
7202
|
var V = function() {
|
|
7203
7203
|
if (!a.tsIsStartOfStaticBlocks()) {
|
|
7204
7204
|
var E = a.tsTryParseIndexSignature(m);
|
|
7205
7205
|
if (E) return m.abstract && a.raise(m.start, N.IndexSignatureHasAbstract), m.accessibility && a.raise(m.start, N.IndexSignatureHasAccessibility({ modifier: m.accessibility })), m.declare && a.raise(m.start, N.IndexSignatureHasDeclare), m.override && a.raise(m.start, N.IndexSignatureHasOverride), E;
|
|
7206
|
-
if (!a.inAbstractClass && m.abstract && a.raise(m.start, N.NonAbstractClassHasAbstractMethod), m.override && s && a.raise(m.start, N.OverrideNotInSubClass), m.static = c, c && (a.isClassElementNameStart() || a.type === o.star || (v = "static")), !v &&
|
|
7206
|
+
if (!a.inAbstractClass && m.abstract && a.raise(m.start, N.NonAbstractClassHasAbstractMethod), m.override && s && a.raise(m.start, N.OverrideNotInSubClass), m.static = c, c && (a.isClassElementNameStart() || a.type === o.star || (v = "static")), !v && p >= 8 && a.eatContextual("async") && (!a.isClassElementNameStart() && a.type !== o.star || a.canInsertSemicolon() ? v = "async" : g = !0), !v && (p >= 9 || !g) && a.eat(o.star) && (x = !0), !v && !g && !x) {
|
|
7207
7207
|
var K = a.value;
|
|
7208
7208
|
(a.eatContextual("get") || a.eatContextual("set")) && (a.isClassElementNameStart() ? _ = K : v = K);
|
|
7209
7209
|
}
|
|
7210
|
-
if (v ? (m.computed = !1, m.key = a.startNodeAt(a.lastTokStart, a.lastTokStartLoc), m.key.name = v, a.finishNode(m.key, "Identifier")) : a.parseClassElementName(m), a.parsePostMemberNameModifiers(m), a.isClassMethod() ||
|
|
7210
|
+
if (v ? (m.computed = !1, m.key = a.startNodeAt(a.lastTokStart, a.lastTokStartLoc), m.key.name = v, a.finishNode(m.key, "Identifier")) : a.parseClassElementName(m), a.parsePostMemberNameModifiers(m), a.isClassMethod() || p < 13 || a.type === o.parenL || _ !== "method" || x || g) {
|
|
7211
7211
|
var G = !m.static && xr(m, "constructor"), X = G && s;
|
|
7212
7212
|
G && _ !== "method" && a.raise(m.key.start, "Constructor can't have get/set modifier"), m.kind = G ? "constructor" : _, a.parseClassMethod(m, x, g, X);
|
|
7213
7213
|
} else a.parseClassField(m);
|
|
7214
7214
|
return m;
|
|
7215
7215
|
}
|
|
7216
|
-
if (a.next(), a.next(), a.tsHasSomeModifiers(m, T) && a.raise(a.start, N.StaticBlockCannotHaveModifier),
|
|
7216
|
+
if (a.next(), a.next(), a.tsHasSomeModifiers(m, T) && a.raise(a.start, N.StaticBlockCannotHaveModifier), p >= 13) return P.prototype.parseClassStaticBlock.call(a, m), m;
|
|
7217
7217
|
};
|
|
7218
7218
|
return m.declare ? this.tsInAmbientContext(V) : V(), m;
|
|
7219
7219
|
}, f.isClassElementNameStart = function() {
|
|
@@ -7227,29 +7227,29 @@ function jh(e) {
|
|
|
7227
7227
|
P.prototype.parseVarId.call(this, s, a), s.id.type === "Identifier" && !this.hasPrecedingLineBreak() && this.value === "!" && this.eat(o.prefix) && (s.definite = !0);
|
|
7228
7228
|
var c = this.tsTryParseTypeAnnotation();
|
|
7229
7229
|
c && (s.id.typeAnnotation = c, this.resetEndLocation(s.id));
|
|
7230
|
-
}, f.parseArrowExpression = function(s, a, c,
|
|
7230
|
+
}, f.parseArrowExpression = function(s, a, c, p) {
|
|
7231
7231
|
this.match(o.colon) && (s.returnType = this.tsParseTypeAnnotation());
|
|
7232
7232
|
var m = this.yieldPos, v = this.awaitPos, x = this.awaitIdentPos;
|
|
7233
7233
|
this.enterScope(16 | ui(c, !1)), this.initFunction(s);
|
|
7234
7234
|
var g = this.maybeInArrowParameters;
|
|
7235
|
-
return this.options.ecmaVersion >= 8 && (s.async = !!c), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, s.params = this.toAssignableList(a, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(s, !0, !1,
|
|
7235
|
+
return this.options.ecmaVersion >= 8 && (s.async = !!c), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, s.params = this.toAssignableList(a, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(s, !0, !1, p), this.yieldPos = m, this.awaitPos = v, this.awaitIdentPos = x, this.maybeInArrowParameters = g, this.finishNode(s, "ArrowFunctionExpression");
|
|
7236
7236
|
}, f.parseMaybeAssignOrigin = function(s, a, c) {
|
|
7237
7237
|
if (this.isContextual("yield")) {
|
|
7238
7238
|
if (this.inGenerator) return this.parseYield(s);
|
|
7239
7239
|
this.exprAllowed = !1;
|
|
7240
7240
|
}
|
|
7241
|
-
var
|
|
7242
|
-
a ? (m = a.parenthesizedAssign, v = a.trailingComma, x = a.doubleProto, a.parenthesizedAssign = a.trailingComma = -1) : (a = new vt(),
|
|
7241
|
+
var p = !1, m = -1, v = -1, x = -1;
|
|
7242
|
+
a ? (m = a.parenthesizedAssign, v = a.trailingComma, x = a.doubleProto, a.parenthesizedAssign = a.trailingComma = -1) : (a = new vt(), p = !0);
|
|
7243
7243
|
var g = this.start, _ = this.startLoc;
|
|
7244
7244
|
(this.type === o.parenL || q(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = s === "await");
|
|
7245
7245
|
var T = this.parseMaybeConditional(s, a);
|
|
7246
7246
|
if (c && (T = c.call(this, T, g, _)), this.type.isAssign) {
|
|
7247
7247
|
var L = this.startNodeAt(g, _);
|
|
7248
|
-
return L.operator = this.value, this.type === o.eq && (T = this.toAssignable(T, !0, a)),
|
|
7248
|
+
return L.operator = this.value, this.type === o.eq && (T = this.toAssignable(T, !0, a)), p || (a.parenthesizedAssign = a.trailingComma = a.doubleProto = -1), a.shorthandAssign >= T.start && (a.shorthandAssign = -1), this.type === o.eq ? this.checkLValPattern(T) : this.checkLValSimple(T), L.left = T, this.next(), L.right = this.parseMaybeAssign(s), x > -1 && (a.doubleProto = x), this.finishNode(L, "AssignmentExpression");
|
|
7249
7249
|
}
|
|
7250
|
-
return
|
|
7250
|
+
return p && this.checkExpressionErrors(a, !0), m > -1 && (a.parenthesizedAssign = m), v > -1 && (a.trailingComma = v), T;
|
|
7251
7251
|
}, f.parseMaybeAssign = function(s, a, c) {
|
|
7252
|
-
var
|
|
7252
|
+
var p, m, v, x, g, _, T, L, V, E, K, G = this;
|
|
7253
7253
|
if (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational()) {
|
|
7254
7254
|
if (L = this.cloneCurLookaheadState(), !(V = this.tryParse(function() {
|
|
7255
7255
|
return G.parseMaybeAssignOrigin(s, a, c);
|
|
@@ -7257,7 +7257,7 @@ function jh(e) {
|
|
|
7257
7257
|
var X = this.context, ie = X[X.length - 1];
|
|
7258
7258
|
ie === y.tokContexts.tc_oTag && X[X.length - 2] === y.tokContexts.tc_expr ? (X.pop(), X.pop()) : ie !== y.tokContexts.tc_oTag && ie !== y.tokContexts.tc_expr || X.pop();
|
|
7259
7259
|
}
|
|
7260
|
-
if (!((
|
|
7260
|
+
if (!((p = V) != null && p.error || this.tsMatchLeftRelational())) return this.parseMaybeAssignOrigin(s, a, c);
|
|
7261
7261
|
L && !this.compareLookaheadState(L, this.getCurLookaheadState()) || (L = this.cloneCurLookaheadState());
|
|
7262
7262
|
var ye = this.tryParse(function($e) {
|
|
7263
7263
|
var dt, mt;
|
|
@@ -7275,16 +7275,16 @@ function jh(e) {
|
|
|
7275
7275
|
throw (x = V) != null && x.thrown ? V.error : ye.thrown ? ye.error : (g = E) != null && g.thrown ? E.error : ((_ = V) == null ? void 0 : _.error) || ye.error || ((T = E) == null ? void 0 : T.error);
|
|
7276
7276
|
}, f.parseAssignableListItem = function(s) {
|
|
7277
7277
|
for (var a = []; this.match(D.at); ) a.push(this.parseDecorator());
|
|
7278
|
-
var c,
|
|
7278
|
+
var c, p = this.start, m = this.startLoc, v = !1, x = !1;
|
|
7279
7279
|
if (s !== void 0) {
|
|
7280
7280
|
var g = {};
|
|
7281
7281
|
this.tsParseModifiers({ modified: g, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), c = g.accessibility, x = g.override, v = g.readonly, s === !1 && (c || v || x) && this.raise(m.start, N.UnexpectedParameterModifier);
|
|
7282
7282
|
}
|
|
7283
|
-
var _ = this.parseMaybeDefault(
|
|
7283
|
+
var _ = this.parseMaybeDefault(p, m);
|
|
7284
7284
|
this.parseBindingListItem(_);
|
|
7285
7285
|
var T = this.parseMaybeDefault(_.start, _.loc, _);
|
|
7286
7286
|
if (a.length && (T.decorators = a), c || v || x) {
|
|
7287
|
-
var L = this.startNodeAt(
|
|
7287
|
+
var L = this.startNodeAt(p, m);
|
|
7288
7288
|
return c && (L.accessibility = c), v && (L.readonly = v), x && (L.override = x), T.type !== "Identifier" && T.type !== "AssignmentPattern" && this.raise(L.start, N.UnsupportedParameterPropertyKind), L.parameter = T, this.finishNode(L, "TSParameterProperty");
|
|
7289
7289
|
}
|
|
7290
7290
|
return T;
|
|
@@ -7307,9 +7307,9 @@ function jh(e) {
|
|
|
7307
7307
|
case "RestElement":
|
|
7308
7308
|
return !0;
|
|
7309
7309
|
case "ObjectExpression":
|
|
7310
|
-
var
|
|
7310
|
+
var p = s.properties.length - 1;
|
|
7311
7311
|
return s.properties.every(function(m, v) {
|
|
7312
|
-
return m.type !== "ObjectMethod" && (v ===
|
|
7312
|
+
return m.type !== "ObjectMethod" && (v === p || m.type !== "SpreadElement") && c.isAssignable(m);
|
|
7313
7313
|
});
|
|
7314
7314
|
case "Property":
|
|
7315
7315
|
case "ObjectProperty":
|
|
@@ -7378,21 +7378,21 @@ function jh(e) {
|
|
|
7378
7378
|
return c.isAssignable(m, !0);
|
|
7379
7379
|
}) : !this.canInsertSemicolon()) {
|
|
7380
7380
|
if (this.match(o.colon)) {
|
|
7381
|
-
var
|
|
7381
|
+
var p = this.tryParse(function(m) {
|
|
7382
7382
|
var v = c.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
7383
7383
|
return !c.canInsertSemicolon() && c.match(o.arrow) || m(), v;
|
|
7384
7384
|
});
|
|
7385
|
-
if (
|
|
7386
|
-
|
|
7385
|
+
if (p.aborted) return this.shouldParseArrowReturnType = void 0, !1;
|
|
7386
|
+
p.thrown || (p.error && this.setLookaheadState(p.failState), this.shouldParseArrowReturnType = p.node);
|
|
7387
7387
|
}
|
|
7388
7388
|
return !!this.match(o.arrow) || (this.shouldParseArrowReturnType = void 0, !1);
|
|
7389
7389
|
}
|
|
7390
7390
|
return this.shouldParseArrowReturnType = void 0, a;
|
|
7391
|
-
}, f.parseParenArrowList = function(s, a, c,
|
|
7391
|
+
}, f.parseParenArrowList = function(s, a, c, p) {
|
|
7392
7392
|
var m = this.startNodeAt(s, a);
|
|
7393
|
-
return m.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(m, c, !1,
|
|
7393
|
+
return m.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(m, c, !1, p);
|
|
7394
7394
|
}, f.parseParenAndDistinguishExpression = function(s, a) {
|
|
7395
|
-
var c,
|
|
7395
|
+
var c, p = this.start, m = this.startLoc, v = this.options.ecmaVersion >= 8;
|
|
7396
7396
|
if (this.options.ecmaVersion >= 6) {
|
|
7397
7397
|
var x = this.maybeInArrowParameters;
|
|
7398
7398
|
this.maybeInArrowParameters = !0, this.next();
|
|
@@ -7409,37 +7409,37 @@ function jh(e) {
|
|
|
7409
7409
|
L.push(this.parseMaybeAssign(a, K, this.parseParenItem));
|
|
7410
7410
|
}
|
|
7411
7411
|
var ie = this.lastTokEnd, ye = this.lastTokEndLoc;
|
|
7412
|
-
if (this.expect(o.parenR), this.maybeInArrowParameters = x, s && this.shouldParseArrow(L) && this.eat(o.arrow)) return this.checkPatternErrors(K, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = G, this.awaitPos = X, this.parseParenArrowList(
|
|
7412
|
+
if (this.expect(o.parenR), this.maybeInArrowParameters = x, s && this.shouldParseArrow(L) && this.eat(o.arrow)) return this.checkPatternErrors(K, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = G, this.awaitPos = X, this.parseParenArrowList(p, m, L, a);
|
|
7413
7413
|
L.length && !E || this.unexpected(this.lastTokStart), g && this.unexpected(g), this.checkExpressionErrors(K, !0), this.yieldPos = G || this.yieldPos, this.awaitPos = X || this.awaitPos, L.length > 1 ? ((c = this.startNodeAt(_, T)).expressions = L, this.finishNodeAt(c, "SequenceExpression", ie, ye)) : c = L[0];
|
|
7414
7414
|
} else c = this.parseParenExpression();
|
|
7415
7415
|
if (this.options.preserveParens) {
|
|
7416
|
-
var $e = this.startNodeAt(
|
|
7416
|
+
var $e = this.startNodeAt(p, m);
|
|
7417
7417
|
return $e.expression = c, this.finishNode($e, "ParenthesizedExpression");
|
|
7418
7418
|
}
|
|
7419
7419
|
return c;
|
|
7420
|
-
}, f.parseTaggedTemplateExpression = function(s, a, c,
|
|
7420
|
+
}, f.parseTaggedTemplateExpression = function(s, a, c, p) {
|
|
7421
7421
|
var m = this.startNodeAt(a, c);
|
|
7422
|
-
return m.tag = s, m.quasi = this.parseTemplate({ isTagged: !0 }),
|
|
7422
|
+
return m.tag = s, m.quasi = this.parseTemplate({ isTagged: !0 }), p && this.raise(a, "Tagged Template Literals are not allowed in optionalChain."), this.finishNode(m, "TaggedTemplateExpression");
|
|
7423
7423
|
}, f.shouldParseAsyncArrow = function() {
|
|
7424
7424
|
var s = this;
|
|
7425
7425
|
if (!this.match(o.colon)) return !this.canInsertSemicolon() && this.eat(o.arrow);
|
|
7426
7426
|
var a = this.tryParse(function(c) {
|
|
7427
|
-
var
|
|
7428
|
-
return !s.canInsertSemicolon() && s.match(o.arrow) || c(),
|
|
7427
|
+
var p = s.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
7428
|
+
return !s.canInsertSemicolon() && s.match(o.arrow) || c(), p;
|
|
7429
7429
|
});
|
|
7430
7430
|
return a.aborted ? (this.shouldParseAsyncArrowReturnType = void 0, !1) : a.thrown ? void 0 : (a.error && this.setLookaheadState(a.failState), this.shouldParseAsyncArrowReturnType = a.node, !this.canInsertSemicolon() && this.eat(o.arrow));
|
|
7431
|
-
}, f.parseSubscriptAsyncArrow = function(s, a, c,
|
|
7431
|
+
}, f.parseSubscriptAsyncArrow = function(s, a, c, p) {
|
|
7432
7432
|
var m = this.startNodeAt(s, a);
|
|
7433
|
-
return m.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(m, c, !0,
|
|
7434
|
-
}, f.parseExprList = function(s, a, c,
|
|
7433
|
+
return m.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(m, c, !0, p);
|
|
7434
|
+
}, f.parseExprList = function(s, a, c, p) {
|
|
7435
7435
|
for (var m = [], v = !0; !this.eat(s); ) {
|
|
7436
7436
|
if (v) v = !1;
|
|
7437
7437
|
else if (this.expect(o.comma), a && this.afterTrailingComma(s)) break;
|
|
7438
7438
|
var x = void 0;
|
|
7439
|
-
c && this.type === o.comma ? x = null : this.type === o.ellipsis ? (x = this.parseSpread(
|
|
7439
|
+
c && this.type === o.comma ? x = null : this.type === o.ellipsis ? (x = this.parseSpread(p), p && this.type === o.comma && p.trailingComma < 0 && (p.trailingComma = this.start)) : x = this.parseMaybeAssign(!1, p, this.parseParenItem), m.push(x);
|
|
7440
7440
|
}
|
|
7441
7441
|
return m;
|
|
7442
|
-
}, f.parseSubscript = function(s, a, c,
|
|
7442
|
+
}, f.parseSubscript = function(s, a, c, p, m, v, x) {
|
|
7443
7443
|
var g = this, _ = v;
|
|
7444
7444
|
if (!this.hasPrecedingLineBreak() && this.value === "!" && this.match(o.prefix)) {
|
|
7445
7445
|
this.exprAllowed = !1, this.next();
|
|
@@ -7448,12 +7448,12 @@ function jh(e) {
|
|
|
7448
7448
|
}
|
|
7449
7449
|
var L = !1;
|
|
7450
7450
|
if (this.match(o.questionDot) && this.lookaheadCharCode() === 60) {
|
|
7451
|
-
if (
|
|
7451
|
+
if (p) return s;
|
|
7452
7452
|
s.optional = !0, _ = L = !0, this.next();
|
|
7453
7453
|
}
|
|
7454
7454
|
if (this.tsMatchLeftRelational() || this.match(o.bitShift)) {
|
|
7455
7455
|
var V, E = this.tsTryParseAndCatch(function() {
|
|
7456
|
-
if (!
|
|
7456
|
+
if (!p && g.atPossibleAsyncArrow(s)) {
|
|
7457
7457
|
var Di = g.tsTryParseGenericAsyncArrowFunction(a, c, x);
|
|
7458
7458
|
if (Di) return s = Di;
|
|
7459
7459
|
}
|
|
@@ -7464,7 +7464,7 @@ function jh(e) {
|
|
|
7464
7464
|
var Mi = g.parseTaggedTemplateExpression(s, a, c, _);
|
|
7465
7465
|
return Mi.typeParameters = Et, Mi;
|
|
7466
7466
|
}
|
|
7467
|
-
if (!
|
|
7467
|
+
if (!p && g.eat(o.parenL)) {
|
|
7468
7468
|
var Vi = new vt(), et = g.startNodeAt(a, c);
|
|
7469
7469
|
return et.callee = s, et.arguments = g.parseExprList(o.parenR, g.options.ecmaVersion >= 8, !1, Vi), g.tsCheckForInvalidTypeCasts(et.arguments), et.typeParameters = Et, _ && (et.optional = L), g.checkExpressionErrors(Vi, !0), s = g.finishNode(et, "CallExpression");
|
|
7470
7470
|
}
|
|
@@ -7477,12 +7477,12 @@ function jh(e) {
|
|
|
7477
7477
|
if (V && this.unexpected(V), E) return E.type === "TSInstantiationExpression" && (this.match(o.dot) || this.match(o.questionDot) && this.lookaheadCharCode() !== 40) && this.raise(this.start, N.InvalidPropertyAccessAfterInstantiationExpression), s = E;
|
|
7478
7478
|
}
|
|
7479
7479
|
var K = this.options.ecmaVersion >= 11, G = K && this.eat(o.questionDot);
|
|
7480
|
-
|
|
7480
|
+
p && G && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
7481
7481
|
var X = this.eat(o.bracketL);
|
|
7482
7482
|
if (X || G && this.type !== o.parenL && this.type !== o.backQuote || this.eat(o.dot)) {
|
|
7483
7483
|
var ie = this.startNodeAt(a, c);
|
|
7484
7484
|
ie.object = s, X ? (ie.property = this.parseExpression(), this.expect(o.bracketR)) : ie.property = this.type === o.privateId && s.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), ie.computed = !!X, K && (ie.optional = G), s = this.finishNode(ie, "MemberExpression");
|
|
7485
|
-
} else if (!
|
|
7485
|
+
} else if (!p && this.eat(o.parenL)) {
|
|
7486
7486
|
var ye = this.maybeInArrowParameters;
|
|
7487
7487
|
this.maybeInArrowParameters = !0;
|
|
7488
7488
|
var $e = new vt(), dt = this.yieldPos, mt = this.awaitPos, Be = this.awaitIdentPos;
|
|
@@ -7503,14 +7503,14 @@ function jh(e) {
|
|
|
7503
7503
|
return s;
|
|
7504
7504
|
}, f.parseGetterSetter = function(s) {
|
|
7505
7505
|
s.kind = s.key.name, this.parsePropertyName(s), s.value = this.parseMethod(!1);
|
|
7506
|
-
var a = s.kind === "get" ? 0 : 1, c = s.value.params[0],
|
|
7507
|
-
s.value.params.length !== (a =
|
|
7506
|
+
var a = s.kind === "get" ? 0 : 1, c = s.value.params[0], p = c && this.isThisParam(c);
|
|
7507
|
+
s.value.params.length !== (a = p ? a + 1 : a) ? this.raiseRecoverable(s.value.start, s.kind === "get" ? "getter should have no params" : "setter should have exactly one param") : s.kind === "set" && s.value.params[0].type === "RestElement" && this.raiseRecoverable(s.value.params[0].start, "Setter cannot use rest params");
|
|
7508
7508
|
}, f.parseProperty = function(s, a) {
|
|
7509
7509
|
if (!s) {
|
|
7510
7510
|
var c = [];
|
|
7511
7511
|
if (this.match(D.at)) for (; this.match(D.at); ) c.push(this.parseDecorator());
|
|
7512
|
-
var
|
|
7513
|
-
return
|
|
7512
|
+
var p = P.prototype.parseProperty.call(this, s, a);
|
|
7513
|
+
return p.type === "SpreadElement" && c.length && this.raise(p.start, "Decorators can't be used with SpreadElement"), c.length && (p.decorators = c, c = []), p;
|
|
7514
7514
|
}
|
|
7515
7515
|
return P.prototype.parseProperty.call(this, s, a);
|
|
7516
7516
|
}, f.parseCatchClauseParam = function() {
|
|
@@ -7523,7 +7523,7 @@ function jh(e) {
|
|
|
7523
7523
|
this.inAbstractClass = !!s.abstract;
|
|
7524
7524
|
try {
|
|
7525
7525
|
this.next(), this.takeDecorators(s);
|
|
7526
|
-
var
|
|
7526
|
+
var p = this.strict;
|
|
7527
7527
|
this.strict = !0, this.parseClassId(s, a), this.parseClassSuper(s);
|
|
7528
7528
|
var m = this.enterClassBody(), v = this.startNode(), x = !1;
|
|
7529
7529
|
v.body = [];
|
|
@@ -7533,30 +7533,30 @@ function jh(e) {
|
|
|
7533
7533
|
var _ = this.parseClassElement(s.superClass !== null);
|
|
7534
7534
|
g.length && (_.decorators = g, this.resetStartLocationFromNode(_, g[0]), g = []), _ && (v.body.push(_), _.type === "MethodDefinition" && _.kind === "constructor" && _.value.type === "FunctionExpression" ? (x && this.raiseRecoverable(_.start, "Duplicate constructor in the same class"), x = !0, _.decorators && _.decorators.length > 0 && this.raise(_.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : _.key && _.key.type === "PrivateIdentifier" && Lh(m, _) && this.raiseRecoverable(_.key.start, "Identifier '#" + _.key.name + "' has already been declared"));
|
|
7535
7535
|
}
|
|
7536
|
-
return this.strict =
|
|
7536
|
+
return this.strict = p, this.next(), g.length && this.raise(this.start, "Decorators must be attached to a class element."), s.body = this.finishNode(v, "ClassBody"), this.exitClassBody(), this.finishNode(s, a ? "ClassDeclaration" : "ClassExpression");
|
|
7537
7537
|
} finally {
|
|
7538
7538
|
this.inAbstractClass = c;
|
|
7539
7539
|
}
|
|
7540
7540
|
}, f.parseClassFunctionParams = function() {
|
|
7541
7541
|
var s = this.tsTryParseTypeParameters(this.tsParseConstModifier), a = this.parseBindingList(o.parenR, !1, this.options.ecmaVersion >= 8, !0);
|
|
7542
7542
|
return s && (a.typeParameters = s), a;
|
|
7543
|
-
}, f.parseMethod = function(s, a, c,
|
|
7543
|
+
}, f.parseMethod = function(s, a, c, p, m) {
|
|
7544
7544
|
var v = this.startNode(), x = this.yieldPos, g = this.awaitPos, _ = this.awaitIdentPos;
|
|
7545
|
-
if (this.initFunction(v), this.options.ecmaVersion >= 6 && (v.generator = s), this.options.ecmaVersion >= 8 && (v.async = !!a), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | ui(a, v.generator) | (c ? 128 : 0)), this.expect(o.parenL), v.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(v, !1, !0, !1, { isClassMethod:
|
|
7545
|
+
if (this.initFunction(v), this.options.ecmaVersion >= 6 && (v.generator = s), this.options.ecmaVersion >= 8 && (v.async = !!a), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | ui(a, v.generator) | (c ? 128 : 0)), this.expect(o.parenL), v.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(v, !1, !0, !1, { isClassMethod: p }), this.yieldPos = x, this.awaitPos = g, this.awaitIdentPos = _, m && m.abstract && v.body) {
|
|
7546
7546
|
var T = m.key;
|
|
7547
7547
|
this.raise(m.start, N.AbstractMethodHasImplementation({ methodName: T.type !== "Identifier" || m.computed ? "[" + this.input.slice(T.start, T.end) + "]" : T.name }));
|
|
7548
7548
|
}
|
|
7549
7549
|
return this.finishNode(v, "FunctionExpression");
|
|
7550
|
-
},
|
|
7550
|
+
}, pe.parse = function(s, a) {
|
|
7551
7551
|
if (a.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
7552
7552
|
a.locations = !0;
|
|
7553
7553
|
var c = new this(a, s);
|
|
7554
7554
|
return r && (c.isAmbientContext = !0), c.parse();
|
|
7555
|
-
},
|
|
7555
|
+
}, pe.parseExpressionAt = function(s, a, c) {
|
|
7556
7556
|
if (c.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
7557
7557
|
c.locations = !0;
|
|
7558
|
-
var
|
|
7559
|
-
return r && (
|
|
7558
|
+
var p = new this(c, s, a);
|
|
7559
|
+
return r && (p.isAmbientContext = !0), p.nextToken(), p.parseExpression();
|
|
7560
7560
|
}, f.parseImportSpecifier = function() {
|
|
7561
7561
|
if (this.ts_isContextual(D.type)) {
|
|
7562
7562
|
var s = this.startNode();
|
|
@@ -7570,18 +7570,18 @@ function jh(e) {
|
|
|
7570
7570
|
var c = this.startNode();
|
|
7571
7571
|
return c.local = this.parseModuleExportName(), this.parseTypeOnlyImportExportSpecifier(c, !1, this.importOrExportOuterKind === "type"), this.finishNode(c, "ExportSpecifier"), this.checkExport(s, c.exported, c.exported.start), c;
|
|
7572
7572
|
}
|
|
7573
|
-
var
|
|
7574
|
-
return
|
|
7573
|
+
var p = P.prototype.parseExportSpecifier.call(this, s);
|
|
7574
|
+
return p.exportKind = "value", p;
|
|
7575
7575
|
}, f.parseTypeOnlyImportExportSpecifier = function(s, a, c) {
|
|
7576
|
-
var
|
|
7576
|
+
var p, m = a ? "imported" : "local", v = a ? "local" : "exported", x = s[m], g = !1, _ = !0, T = x.start;
|
|
7577
7577
|
if (this.isContextual("as")) {
|
|
7578
7578
|
var L = this.parseIdent();
|
|
7579
7579
|
if (this.isContextual("as")) {
|
|
7580
7580
|
var V = this.parseIdent();
|
|
7581
|
-
Ct(this.type) ? (g = !0, x = L,
|
|
7582
|
-
} else Ct(this.type) ? (_ = !1,
|
|
7581
|
+
Ct(this.type) ? (g = !0, x = L, p = a ? this.parseIdent() : this.parseModuleExportName(), _ = !1) : (p = V, _ = !1);
|
|
7582
|
+
} else Ct(this.type) ? (_ = !1, p = a ? this.parseIdent() : this.parseModuleExportName()) : (g = !0, x = L);
|
|
7583
7583
|
} else Ct(this.type) && (g = !0, a ? (x = P.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(x)) : x = this.parseModuleExportName());
|
|
7584
|
-
g && c && this.raise(T, a ? N.TypeModifierIsUsedInTypeImports : N.TypeModifierIsUsedInTypeExports), s[m] = x, s[v] =
|
|
7584
|
+
g && c && this.raise(T, a ? N.TypeModifierIsUsedInTypeImports : N.TypeModifierIsUsedInTypeExports), s[m] = x, s[v] = p, s[a ? "importKind" : "exportKind"] = g ? "type" : "value", _ && this.eatContextual("as") && (s[v] = a ? this.parseIdent() : this.parseModuleExportName()), s[v] || (s[v] = this.copyNode(s[m])), a && this.checkLValSimple(s[v], 2);
|
|
7585
7585
|
}, f.raiseCommonCheck = function(s, a, c) {
|
|
7586
7586
|
return a === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(o.comma) && this.lookaheadCharCode() === 41 ? void this.next() : P.prototype.raise.call(this, s, a) : c ? P.prototype.raiseRecoverable.call(this, s, a) : P.prototype.raise.call(this, s, a);
|
|
7587
7587
|
}, f.raiseRecoverable = function(s, a) {
|
|
@@ -7598,15 +7598,15 @@ function jh(e) {
|
|
|
7598
7598
|
this.context.length -= 2, this.context.push(se.tc_cTag), this.exprAllowed = !1;
|
|
7599
7599
|
}
|
|
7600
7600
|
}, f.jsx_parseOpeningElementAt = function(s, a) {
|
|
7601
|
-
var c = this,
|
|
7602
|
-
if (m && (
|
|
7601
|
+
var c = this, p = this.startNodeAt(s, a), m = this.jsx_parseElementName();
|
|
7602
|
+
if (m && (p.name = m), this.match(o.relational) || this.match(o.bitShift)) {
|
|
7603
7603
|
var v = this.tsTryParseAndCatch(function() {
|
|
7604
7604
|
return c.tsParseTypeArgumentsInExpression();
|
|
7605
7605
|
});
|
|
7606
|
-
v && (
|
|
7606
|
+
v && (p.typeParameters = v);
|
|
7607
7607
|
}
|
|
7608
|
-
for (
|
|
7609
|
-
return
|
|
7608
|
+
for (p.attributes = []; this.type !== o.slash && this.type !== D.jsxTagEnd; ) p.attributes.push(this.jsx_parseAttribute());
|
|
7609
|
+
return p.selfClosing = this.eat(o.slash), this.expect(D.jsxTagEnd), this.finishNode(p, m ? "JSXOpeningElement" : "JSXOpeningFragment");
|
|
7610
7610
|
}, f.enterScope = function(s) {
|
|
7611
7611
|
s === yt && this.importsStack.push([]), P.prototype.enterScope.call(this, s);
|
|
7612
7612
|
var a = P.prototype.currentScope.call(this);
|
|
@@ -7617,34 +7617,34 @@ function jh(e) {
|
|
|
7617
7617
|
var c = this.importsStack.length;
|
|
7618
7618
|
if (this.importsStack[c - 1].indexOf(s) > -1) return !0;
|
|
7619
7619
|
if (!a && c > 1) {
|
|
7620
|
-
for (var
|
|
7620
|
+
for (var p = 0; p < c - 1; p++) if (this.importsStack[p].indexOf(s) > -1) return !0;
|
|
7621
7621
|
}
|
|
7622
7622
|
return !1;
|
|
7623
7623
|
}, f.maybeExportDefined = function(s, a) {
|
|
7624
7624
|
this.inModule && 1 & s.flags && this.undefinedExports.delete(a);
|
|
7625
7625
|
}, f.isRedeclaredInScope = function(s, a, c) {
|
|
7626
7626
|
return !!(0 & c) && (2 & c ? s.lexical.indexOf(a) > -1 || s.functions.indexOf(a) > -1 || s.var.indexOf(a) > -1 : 3 & c ? s.lexical.indexOf(a) > -1 || !P.prototype.treatFunctionsAsVarInScope.call(this, s) && s.var.indexOf(a) > -1 : s.lexical.indexOf(a) > -1 && !(32 & s.flags && s.lexical[0] === a) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(a) > -1);
|
|
7627
|
-
}, f.checkRedeclarationInScope = function(s, a, c,
|
|
7628
|
-
this.isRedeclaredInScope(s, a, c) && this.raise(
|
|
7627
|
+
}, f.checkRedeclarationInScope = function(s, a, c, p) {
|
|
7628
|
+
this.isRedeclaredInScope(s, a, c) && this.raise(p, "Identifier '" + a + "' has already been declared.");
|
|
7629
7629
|
}, f.declareName = function(s, a, c) {
|
|
7630
7630
|
if (4096 & a) return this.hasImport(s, !0) && this.raise(c, "Identifier '" + s + "' has already been declared."), void this.importsStack[this.importsStack.length - 1].push(s);
|
|
7631
|
-
var
|
|
7632
|
-
if (1024 & a) return this.maybeExportDefined(
|
|
7633
|
-
P.prototype.declareName.call(this, s, a, c), 0 & a && (0 & a || (this.checkRedeclarationInScope(
|
|
7631
|
+
var p = this.currentScope();
|
|
7632
|
+
if (1024 & a) return this.maybeExportDefined(p, s), void p.exportOnlyBindings.push(s);
|
|
7633
|
+
P.prototype.declareName.call(this, s, a, c), 0 & a && (0 & a || (this.checkRedeclarationInScope(p, s, a, c), this.maybeExportDefined(p, s)), p.types.push(s)), 256 & a && p.enums.push(s), 512 & a && p.constEnums.push(s), 128 & a && p.classes.push(s);
|
|
7634
7634
|
}, f.checkLocalExport = function(s) {
|
|
7635
7635
|
var a = s.name;
|
|
7636
7636
|
if (!this.hasImport(a)) {
|
|
7637
7637
|
for (var c = this.scopeStack.length - 1; c >= 0; c--) {
|
|
7638
|
-
var
|
|
7639
|
-
if (
|
|
7638
|
+
var p = this.scopeStack[c];
|
|
7639
|
+
if (p.types.indexOf(a) > -1 || p.exportOnlyBindings.indexOf(a) > -1) return;
|
|
7640
7640
|
}
|
|
7641
7641
|
P.prototype.checkLocalExport.call(this, s);
|
|
7642
7642
|
}
|
|
7643
|
-
}, oe =
|
|
7643
|
+
}, oe = pe, B = [{ key: "acornTypeScript", get: function() {
|
|
7644
7644
|
return y;
|
|
7645
7645
|
} }], (te = [{ key: "acornTypeScript", get: function() {
|
|
7646
7646
|
return y;
|
|
7647
|
-
} }]) && dr(oe.prototype, te), B && dr(oe, B), Object.defineProperty(oe, "prototype", { writable: !1 }),
|
|
7647
|
+
} }]) && dr(oe.prototype, te), B && dr(oe, B), Object.defineProperty(oe, "prototype", { writable: !1 }), pe;
|
|
7648
7648
|
})(h);
|
|
7649
7649
|
return Rs;
|
|
7650
7650
|
};
|
|
@@ -7771,14 +7771,14 @@ const Uh = [
|
|
|
7771
7771
|
{ idPrefix: "datapos-shared", typeId: "shared", publish: !0, uploadGroupName: void 0 },
|
|
7772
7772
|
{ idPrefix: "datapos-tool", typeId: "tool", publish: !0, uploadGroupName: "tools" }
|
|
7773
7773
|
];
|
|
7774
|
-
async function
|
|
7774
|
+
async function hl() {
|
|
7775
7775
|
try {
|
|
7776
7776
|
Re("Build Project"), await Ie("1️⃣ Bundle project", "vite", ["build"]), Fe("Project built.");
|
|
7777
7777
|
} catch (e) {
|
|
7778
7778
|
console.error("❌ Error building project.", e), process.exit(1);
|
|
7779
7779
|
}
|
|
7780
7780
|
}
|
|
7781
|
-
async function
|
|
7781
|
+
async function ll() {
|
|
7782
7782
|
try {
|
|
7783
7783
|
Re("Release Project"), await Li();
|
|
7784
7784
|
const e = await de("package.json"), t = await de("config.json");
|
|
@@ -7824,7 +7824,7 @@ async function pp() {
|
|
|
7824
7824
|
console.error("❌ Error releasing project.", e), process.exit(1);
|
|
7825
7825
|
}
|
|
7826
7826
|
}
|
|
7827
|
-
async function
|
|
7827
|
+
async function pl() {
|
|
7828
7828
|
try {
|
|
7829
7829
|
Re("Synchronise Project with GitHub");
|
|
7830
7830
|
const e = await de("package.json");
|
|
@@ -7833,7 +7833,7 @@ async function lp() {
|
|
|
7833
7833
|
console.error("❌ Error synchronising project with GitHub.", e), process.exit(1);
|
|
7834
7834
|
}
|
|
7835
7835
|
}
|
|
7836
|
-
function
|
|
7836
|
+
function fl() {
|
|
7837
7837
|
try {
|
|
7838
7838
|
Re("Test Project"), console.log(`
|
|
7839
7839
|
❌ Test project is not implemented. No 'vitest' command.
|
|
@@ -7899,7 +7899,7 @@ const Xh = {
|
|
|
7899
7899
|
unknown: { color: "616161", label: "unknown" }
|
|
7900
7900
|
// See sample badges in ~/tests/sampleBadges.md. Also included 'info' colouring.
|
|
7901
7901
|
}, Sr = "<!-- OWASP_BADGES_START -->", Jh = "<!-- OWASP_BADGES_END -->";
|
|
7902
|
-
async function
|
|
7902
|
+
async function dl() {
|
|
7903
7903
|
try {
|
|
7904
7904
|
Re("Audit Dependencies"), await Li();
|
|
7905
7905
|
const e = await de("package.json");
|
|
@@ -7947,15 +7947,15 @@ async function Qh(e) {
|
|
|
7947
7947
|
}
|
|
7948
7948
|
return i;
|
|
7949
7949
|
}
|
|
7950
|
-
async function
|
|
7950
|
+
async function ml() {
|
|
7951
7951
|
try {
|
|
7952
7952
|
Re("Check Dependencies"), await Ie("1️⃣ Check using 'npm outdated'", "npm", ["outdated"], !0), await Ie("2️⃣ Check using 'npm-check-updates'", "npm-check-updates", ["-i"]), Fe("Dependencies checked.");
|
|
7953
7953
|
} catch (e) {
|
|
7954
7954
|
console.error("❌ Error checking dependencies.", e), process.exit(1);
|
|
7955
7955
|
}
|
|
7956
7956
|
}
|
|
7957
|
-
const wr = "<!-- DEPENDENCY_LICENSES_START -->",
|
|
7958
|
-
async function
|
|
7957
|
+
const wr = "<!-- DEPENDENCY_LICENSES_START -->", el = "<!-- DEPENDENCY_LICENSES_END -->";
|
|
7958
|
+
async function yl(e = [], t = !0) {
|
|
7959
7959
|
try {
|
|
7960
7960
|
Re("Document Dependencies"), await Li();
|
|
7961
7961
|
const i = e.flatMap((n) => ["--allowed", n]), r = $s(new Bs(import.meta.resolve("@datapos/datapos-development/license-report-config")));
|
|
@@ -7969,14 +7969,14 @@ async function yp(e = [], t = !0) {
|
|
|
7969
7969
|
"license-report-recursive",
|
|
7970
7970
|
["--only=prod,peer", "--output=tree", "--recurse", "--department.value=n/a", "--licensePeriod.value=n/a", "--material.value=n/a", "--relatedTo.value=n/a"],
|
|
7971
7971
|
"licenses/licenseTree.json"
|
|
7972
|
-
), await we("4️⃣ Check 'licenseTree.json' file", "license-report-check", ["--source", "licenses/licenseTree.json", "--output=table", ...i])) : (re("3️⃣ Skip 'licenses/licenseTree.json' file generate"), re("4️⃣ Skip 'licenses/licenseTree.json' file check")), await we("5️⃣ Download license files", "license-downloader", ["--source", "licenses/licenses.json", "--licDir", "licenses/downloads", "--download"]), await
|
|
7972
|
+
), await we("4️⃣ Check 'licenseTree.json' file", "license-report-check", ["--source", "licenses/licenseTree.json", "--output=table", ...i])) : (re("3️⃣ Skip 'licenses/licenseTree.json' file generate"), re("4️⃣ Skip 'licenses/licenseTree.json' file check")), await we("5️⃣ Download license files", "license-downloader", ["--source", "licenses/licenses.json", "--licDir", "licenses/downloads", "--download"]), await tl("6️⃣", t), Fe("Dependencies documented.");
|
|
7973
7973
|
} catch (i) {
|
|
7974
7974
|
console.error("❌ Error documenting dependencies.", i), process.exit(1);
|
|
7975
7975
|
}
|
|
7976
7976
|
}
|
|
7977
|
-
async function
|
|
7977
|
+
async function tl(e, t) {
|
|
7978
7978
|
re(`${e} Insert licenses into 'README.md'`);
|
|
7979
|
-
const i = await Pt("./README.md"), r = i.indexOf(wr), n = i.indexOf(
|
|
7979
|
+
const i = await Pt("./README.md"), r = i.indexOf(wr), n = i.indexOf(el);
|
|
7980
7980
|
if (r === -1 || n === -1) {
|
|
7981
7981
|
console.error("❌ No dependency license markers found in 'README.md'.");
|
|
7982
7982
|
return;
|
|
@@ -8000,13 +8000,13 @@ async function tp(e, t) {
|
|
|
8000
8000
|
return w.values();
|
|
8001
8001
|
})()
|
|
8002
8002
|
];
|
|
8003
|
-
let o = `|Name|Type|Installed|Latest|Latest
|
|
8003
|
+
let o = `|Name|Type|Installed|Latest|Latest Release|Deps|Document|
|
|
8004
8004
|
|:-|:-|:-:|:-:|:-|-:|:-|
|
|
8005
8005
|
`;
|
|
8006
8006
|
for (const w of y) {
|
|
8007
|
-
const A = w.installedVersion === w.remoteVersion ? w.installedVersion : `${w.installedVersion} ⚠️`, F = w.latestRemoteModified ?
|
|
8008
|
-
let
|
|
8009
|
-
w.licenseFileLink == null || w.licenseFileLink == "" ?
|
|
8007
|
+
const A = w.installedVersion === w.remoteVersion ? w.installedVersion : `${w.installedVersion} ⚠️`, F = w.latestRemoteModified ? il(w.latestRemoteModified.split("T")[0]) : "n/a", Z = w.dependencyCount != null && w.dependencyCount >= 0 ? w.dependencyCount : "n/a";
|
|
8008
|
+
let le;
|
|
8009
|
+
w.licenseFileLink == null || w.licenseFileLink == "" ? le = "⚠️ No license file" : le = `[${w.licenseFileLink.slice(Math.max(0, w.licenseFileLink.lastIndexOf("/") + 1))}](${w.licenseFileLink})`, o += `|${w.name}|${w.licenseType}|${A}|${w.remoteVersion}|${F}|${Z}|${le}|
|
|
8010
8010
|
`;
|
|
8011
8011
|
}
|
|
8012
8012
|
const S = `${i.slice(0, Math.max(0, r + wr.length))}
|
|
@@ -8014,34 +8014,34 @@ ${o}
|
|
|
8014
8014
|
${i.slice(Math.max(0, n))}`;
|
|
8015
8015
|
await Oi("README.md", S);
|
|
8016
8016
|
}
|
|
8017
|
-
function
|
|
8017
|
+
function il(e) {
|
|
8018
8018
|
if (e == null || e === "") return "n/a";
|
|
8019
8019
|
const t = e.split("T")[0];
|
|
8020
8020
|
if (t == null || t === "") return "n/a";
|
|
8021
8021
|
const i = new Date(t), r = /* @__PURE__ */ new Date();
|
|
8022
8022
|
let n = (r.getFullYear() - i.getFullYear()) * 12 + (r.getMonth() - i.getMonth());
|
|
8023
|
-
return r.getDate() < i.getDate() && (n -= 1), n === 0 ? `this month
|
|
8023
|
+
return r.getDate() < i.getDate() && (n -= 1), n === 0 ? `this month: ${t}` : n === 1 ? `1 month ago: ${t}` : n <= 6 ? `${n} months ago: ${t}` : n <= 12 ? `${n} months ago: ${t} ⚠️` : `${n} months ago: ${t}❗`;
|
|
8024
8024
|
}
|
|
8025
|
-
async function
|
|
8025
|
+
async function vl() {
|
|
8026
8026
|
try {
|
|
8027
8027
|
Re("Format Code"), await Ie("1️⃣ Format", "prettier", ["--write", "src/"]), Fe("Code formatted.");
|
|
8028
8028
|
} catch (e) {
|
|
8029
8029
|
console.error("❌ Error formatting code.", e), process.exit(1);
|
|
8030
8030
|
}
|
|
8031
8031
|
}
|
|
8032
|
-
async function
|
|
8032
|
+
async function xl() {
|
|
8033
8033
|
try {
|
|
8034
8034
|
Re("Lint Code"), await Ie("1️⃣ Lint", "eslint", []), Fe("Code linted.");
|
|
8035
8035
|
} catch (e) {
|
|
8036
8036
|
console.error("❌ Error linting code.", e), process.exit(1);
|
|
8037
8037
|
}
|
|
8038
8038
|
}
|
|
8039
|
-
const
|
|
8040
|
-
async function
|
|
8039
|
+
const rl = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣"];
|
|
8040
|
+
async function gl(e = []) {
|
|
8041
8041
|
try {
|
|
8042
8042
|
Re("Update '@datapos/datapos' Dependencies");
|
|
8043
8043
|
for (const [t, i] of e.entries()) {
|
|
8044
|
-
const r =
|
|
8044
|
+
const r = rl.at(t) ?? "🔢";
|
|
8045
8045
|
await Ie(`${r} Update '${i}'`, "npm", ["install", `@datapos/datapos-${i}@latest`]);
|
|
8046
8046
|
}
|
|
8047
8047
|
Fe("'@datapos/datapos' dependencies updated.");
|
|
@@ -8049,7 +8049,7 @@ async function gp(e = []) {
|
|
|
8049
8049
|
console.error("❌ Error updating '@datapos/datapos' dependencies.", t), process.exit(1);
|
|
8050
8050
|
}
|
|
8051
8051
|
}
|
|
8052
|
-
async function
|
|
8052
|
+
async function bl(e) {
|
|
8053
8053
|
try {
|
|
8054
8054
|
console.info(`🚀 Building public directory index for identifier '${e}'...`);
|
|
8055
8055
|
const t = {};
|
|
@@ -8084,16 +8084,16 @@ async function bp(e) {
|
|
|
8084
8084
|
}
|
|
8085
8085
|
}
|
|
8086
8086
|
export {
|
|
8087
|
-
|
|
8088
|
-
|
|
8089
|
-
|
|
8090
|
-
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8097
|
-
|
|
8087
|
+
dl as auditDependencies,
|
|
8088
|
+
bl as buildDirectoryIndex,
|
|
8089
|
+
hl as buildProject,
|
|
8090
|
+
ml as checkDependencies,
|
|
8091
|
+
yl as documentDependencies,
|
|
8092
|
+
vl as formatCode,
|
|
8093
|
+
xl as lintCode,
|
|
8094
|
+
ll as releaseProject,
|
|
8095
|
+
pl as syncProjectWithGitHub,
|
|
8096
|
+
fl as testProject,
|
|
8097
|
+
gl as updateDataPosDependencies
|
|
8098
8098
|
};
|
|
8099
8099
|
//# sourceMappingURL=datapos-development.es.js.map
|