@datapos/datapos-development 0.3.316 → 0.3.317
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.
|
@@ -9,14 +9,14 @@ function k(e, t, i) {
|
|
|
9
9
|
if (d._zod || Object.defineProperty(d, "_zod", {
|
|
10
10
|
value: {
|
|
11
11
|
def: y,
|
|
12
|
-
constr:
|
|
12
|
+
constr: c,
|
|
13
13
|
traits: /* @__PURE__ */ new Set()
|
|
14
14
|
},
|
|
15
15
|
enumerable: !1
|
|
16
16
|
}), d._zod.traits.has(e))
|
|
17
17
|
return;
|
|
18
18
|
d._zod.traits.add(e), t(d, y);
|
|
19
|
-
const o =
|
|
19
|
+
const o = c.prototype, w = Object.keys(o);
|
|
20
20
|
for (let S = 0; S < w.length; S++) {
|
|
21
21
|
const C = w[S];
|
|
22
22
|
C in d || (d[C] = o[C].bind(d));
|
|
@@ -26,7 +26,7 @@ function k(e, t, i) {
|
|
|
26
26
|
class u extends n {
|
|
27
27
|
}
|
|
28
28
|
Object.defineProperty(u, "name", { value: e });
|
|
29
|
-
function
|
|
29
|
+
function c(d) {
|
|
30
30
|
var y;
|
|
31
31
|
const o = i?.Parent ? new u() : this;
|
|
32
32
|
r(o, d), (y = o._zod).deferred ?? (y.deferred = []);
|
|
@@ -34,9 +34,9 @@ function k(e, t, i) {
|
|
|
34
34
|
w();
|
|
35
35
|
return o;
|
|
36
36
|
}
|
|
37
|
-
return Object.defineProperty(
|
|
37
|
+
return Object.defineProperty(c, "init", { value: r }), Object.defineProperty(c, Symbol.hasInstance, {
|
|
38
38
|
value: (d) => i?.Parent && d instanceof i.Parent ? !0 : d?._zod?.traits?.has(e)
|
|
39
|
-
}), Object.defineProperty(
|
|
39
|
+
}), Object.defineProperty(c, "name", { value: e }), c;
|
|
40
40
|
}
|
|
41
41
|
class rt extends Error {
|
|
42
42
|
constructor() {
|
|
@@ -83,8 +83,8 @@ function Us(e, t) {
|
|
|
83
83
|
const y = r.match(/\d?e-(\d?)/);
|
|
84
84
|
y?.[1] && (n = Number.parseInt(y[1]));
|
|
85
85
|
}
|
|
86
|
-
const u = i > n ? i : n,
|
|
87
|
-
return
|
|
86
|
+
const u = i > n ? i : n, c = Number.parseInt(e.toFixed(u).replace(".", "")), d = Number.parseInt(t.toFixed(u).replace(".", ""));
|
|
87
|
+
return c % d / 10 ** u;
|
|
88
88
|
}
|
|
89
89
|
const ji = Symbol("evaluating");
|
|
90
90
|
function U(e, t, i) {
|
|
@@ -260,20 +260,20 @@ function tn(e, t, i) {
|
|
|
260
260
|
get shape() {
|
|
261
261
|
const n = t._zod.def.shape, u = { ...n };
|
|
262
262
|
if (i)
|
|
263
|
-
for (const
|
|
264
|
-
if (!(
|
|
265
|
-
throw new Error(`Unrecognized key: "${
|
|
266
|
-
i[
|
|
263
|
+
for (const c in i) {
|
|
264
|
+
if (!(c in n))
|
|
265
|
+
throw new Error(`Unrecognized key: "${c}"`);
|
|
266
|
+
i[c] && (u[c] = e ? new e({
|
|
267
267
|
type: "optional",
|
|
268
|
-
innerType: n[
|
|
269
|
-
}) : n[
|
|
268
|
+
innerType: n[c]
|
|
269
|
+
}) : n[c]);
|
|
270
270
|
}
|
|
271
271
|
else
|
|
272
|
-
for (const
|
|
273
|
-
u[
|
|
272
|
+
for (const c in n)
|
|
273
|
+
u[c] = e ? new e({
|
|
274
274
|
type: "optional",
|
|
275
|
-
innerType: n[
|
|
276
|
-
}) : n[
|
|
275
|
+
innerType: n[c]
|
|
276
|
+
}) : n[c];
|
|
277
277
|
return Xe(this, "shape", u), u;
|
|
278
278
|
},
|
|
279
279
|
checks: []
|
|
@@ -285,19 +285,19 @@ function rn(e, t, i) {
|
|
|
285
285
|
get shape() {
|
|
286
286
|
const n = t._zod.def.shape, u = { ...n };
|
|
287
287
|
if (i)
|
|
288
|
-
for (const
|
|
289
|
-
if (!(
|
|
290
|
-
throw new Error(`Unrecognized key: "${
|
|
291
|
-
i[
|
|
288
|
+
for (const c in i) {
|
|
289
|
+
if (!(c in u))
|
|
290
|
+
throw new Error(`Unrecognized key: "${c}"`);
|
|
291
|
+
i[c] && (u[c] = new e({
|
|
292
292
|
type: "nonoptional",
|
|
293
|
-
innerType: n[
|
|
293
|
+
innerType: n[c]
|
|
294
294
|
}));
|
|
295
295
|
}
|
|
296
296
|
else
|
|
297
|
-
for (const
|
|
298
|
-
u[
|
|
297
|
+
for (const c in n)
|
|
298
|
+
u[c] = new e({
|
|
299
299
|
type: "nonoptional",
|
|
300
|
-
innerType: n[
|
|
300
|
+
innerType: n[c]
|
|
301
301
|
});
|
|
302
302
|
return Xe(this, "shape", u), u;
|
|
303
303
|
},
|
|
@@ -364,7 +364,7 @@ function nn(e, t = (i) => i.message) {
|
|
|
364
364
|
const i = { _errors: [] }, r = (n) => {
|
|
365
365
|
for (const u of n.issues)
|
|
366
366
|
if (u.code === "invalid_union" && u.errors.length)
|
|
367
|
-
u.errors.map((
|
|
367
|
+
u.errors.map((c) => r({ issues: c }));
|
|
368
368
|
else if (u.code === "invalid_key")
|
|
369
369
|
r({ issues: u.issues });
|
|
370
370
|
else if (u.code === "invalid_element")
|
|
@@ -372,46 +372,46 @@ function nn(e, t = (i) => i.message) {
|
|
|
372
372
|
else if (u.path.length === 0)
|
|
373
373
|
i._errors.push(t(u));
|
|
374
374
|
else {
|
|
375
|
-
let
|
|
375
|
+
let c = i, d = 0;
|
|
376
376
|
for (; d < u.path.length; ) {
|
|
377
377
|
const y = u.path[d];
|
|
378
|
-
d === u.path.length - 1 ? (
|
|
378
|
+
d === u.path.length - 1 ? (c[y] = c[y] || { _errors: [] }, c[y]._errors.push(t(u))) : c[y] = c[y] || { _errors: [] }, c = c[y], d++;
|
|
379
379
|
}
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
382
|
return r(e), i;
|
|
383
383
|
}
|
|
384
384
|
const _i = (e) => (t, i, r, n) => {
|
|
385
|
-
const u = r ? Object.assign(r, { async: !1 }) : { async: !1 },
|
|
386
|
-
if (
|
|
385
|
+
const u = r ? Object.assign(r, { async: !1 }) : { async: !1 }, c = t._zod.run({ value: i, issues: [] }, u);
|
|
386
|
+
if (c instanceof Promise)
|
|
387
387
|
throw new rt();
|
|
388
|
-
if (
|
|
389
|
-
const d = new (n?.Err ?? e)(
|
|
388
|
+
if (c.issues.length) {
|
|
389
|
+
const d = new (n?.Err ?? e)(c.issues.map((y) => qe(y, u, Ue())));
|
|
390
390
|
throw Cr(d, n?.callee), d;
|
|
391
391
|
}
|
|
392
|
-
return
|
|
392
|
+
return c.value;
|
|
393
393
|
}, ki = (e) => async (t, i, r, n) => {
|
|
394
394
|
const u = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
395
|
-
let
|
|
396
|
-
if (
|
|
397
|
-
const d = new (n?.Err ?? e)(
|
|
395
|
+
let c = t._zod.run({ value: i, issues: [] }, u);
|
|
396
|
+
if (c instanceof Promise && (c = await c), c.issues.length) {
|
|
397
|
+
const d = new (n?.Err ?? e)(c.issues.map((y) => qe(y, u, Ue())));
|
|
398
398
|
throw Cr(d, n?.callee), d;
|
|
399
399
|
}
|
|
400
|
-
return
|
|
400
|
+
return c.value;
|
|
401
401
|
}, Ut = (e) => (t, i, r) => {
|
|
402
402
|
const n = r ? { ...r, async: !1 } : { async: !1 }, u = t._zod.run({ value: i, issues: [] }, n);
|
|
403
403
|
if (u instanceof Promise)
|
|
404
404
|
throw new rt();
|
|
405
405
|
return u.issues.length ? {
|
|
406
406
|
success: !1,
|
|
407
|
-
error: new (e ?? Ir)(u.issues.map((
|
|
407
|
+
error: new (e ?? Ir)(u.issues.map((c) => qe(c, n, Ue())))
|
|
408
408
|
} : { success: !0, data: u.value };
|
|
409
409
|
}, an = /* @__PURE__ */ Ut(Nr), qt = (e) => async (t, i, r) => {
|
|
410
410
|
const n = r ? Object.assign(r, { async: !0 }) : { async: !0 };
|
|
411
411
|
let u = t._zod.run({ value: i, issues: [] }, n);
|
|
412
412
|
return u instanceof Promise && (u = await u), u.issues.length ? {
|
|
413
413
|
success: !1,
|
|
414
|
-
error: new e(u.issues.map((
|
|
414
|
+
error: new e(u.issues.map((c) => qe(c, n, Ue())))
|
|
415
415
|
} : { success: !0, data: u.value };
|
|
416
416
|
}, on = /* @__PURE__ */ qt(Nr), un = (e) => (t, i, r) => {
|
|
417
417
|
const n = r ? Object.assign(r, { direction: "backward" }) : { direction: "backward" };
|
|
@@ -506,14 +506,14 @@ const Mn = (e) => {
|
|
|
506
506
|
}), Zn = /* @__PURE__ */ k("$ZodCheckNumberFormat", (e, t) => {
|
|
507
507
|
me.init(e, t), t.format = t.format || "float64";
|
|
508
508
|
const i = t.format?.includes("int"), r = i ? "int" : "number", [n, u] = Gs[t.format];
|
|
509
|
-
e._zod.onattach.push((
|
|
510
|
-
const d =
|
|
509
|
+
e._zod.onattach.push((c) => {
|
|
510
|
+
const d = c._zod.bag;
|
|
511
511
|
d.format = t.format, d.minimum = n, d.maximum = u, i && (d.pattern = Vn);
|
|
512
|
-
}), e._zod.check = (
|
|
513
|
-
const d =
|
|
512
|
+
}), e._zod.check = (c) => {
|
|
513
|
+
const d = c.value;
|
|
514
514
|
if (i) {
|
|
515
515
|
if (!Number.isInteger(d)) {
|
|
516
|
-
|
|
516
|
+
c.issues.push({
|
|
517
517
|
expected: r,
|
|
518
518
|
format: t.format,
|
|
519
519
|
code: "invalid_type",
|
|
@@ -524,7 +524,7 @@ const Mn = (e) => {
|
|
|
524
524
|
return;
|
|
525
525
|
}
|
|
526
526
|
if (!Number.isSafeInteger(d)) {
|
|
527
|
-
d > 0 ?
|
|
527
|
+
d > 0 ? c.issues.push({
|
|
528
528
|
input: d,
|
|
529
529
|
code: "too_big",
|
|
530
530
|
maximum: Number.MAX_SAFE_INTEGER,
|
|
@@ -532,7 +532,7 @@ const Mn = (e) => {
|
|
|
532
532
|
inst: e,
|
|
533
533
|
origin: r,
|
|
534
534
|
continue: !t.abort
|
|
535
|
-
}) :
|
|
535
|
+
}) : c.issues.push({
|
|
536
536
|
input: d,
|
|
537
537
|
code: "too_small",
|
|
538
538
|
minimum: Number.MIN_SAFE_INTEGER,
|
|
@@ -544,7 +544,7 @@ const Mn = (e) => {
|
|
|
544
544
|
return;
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
|
-
d < n &&
|
|
547
|
+
d < n && c.issues.push({
|
|
548
548
|
origin: "number",
|
|
549
549
|
input: d,
|
|
550
550
|
code: "too_small",
|
|
@@ -552,7 +552,7 @@ const Mn = (e) => {
|
|
|
552
552
|
inclusive: !0,
|
|
553
553
|
inst: e,
|
|
554
554
|
continue: !t.abort
|
|
555
|
-
}), d > u &&
|
|
555
|
+
}), d > u && c.issues.push({
|
|
556
556
|
origin: "number",
|
|
557
557
|
input: d,
|
|
558
558
|
code: "too_big",
|
|
@@ -572,9 +572,9 @@ const Mn = (e) => {
|
|
|
572
572
|
const n = r.value;
|
|
573
573
|
if (n.length <= t.maximum)
|
|
574
574
|
return;
|
|
575
|
-
const
|
|
575
|
+
const c = bi(n);
|
|
576
576
|
r.issues.push({
|
|
577
|
-
origin:
|
|
577
|
+
origin: c,
|
|
578
578
|
code: "too_big",
|
|
579
579
|
maximum: t.maximum,
|
|
580
580
|
inclusive: !0,
|
|
@@ -595,9 +595,9 @@ const Mn = (e) => {
|
|
|
595
595
|
const n = r.value;
|
|
596
596
|
if (n.length >= t.minimum)
|
|
597
597
|
return;
|
|
598
|
-
const
|
|
598
|
+
const c = bi(n);
|
|
599
599
|
r.issues.push({
|
|
600
|
-
origin:
|
|
600
|
+
origin: c,
|
|
601
601
|
code: "too_small",
|
|
602
602
|
minimum: t.minimum,
|
|
603
603
|
inclusive: !0,
|
|
@@ -618,9 +618,9 @@ const Mn = (e) => {
|
|
|
618
618
|
const n = r.value, u = n.length;
|
|
619
619
|
if (u === t.length)
|
|
620
620
|
return;
|
|
621
|
-
const
|
|
621
|
+
const c = bi(n), d = u > t.length;
|
|
622
622
|
r.issues.push({
|
|
623
|
-
origin:
|
|
623
|
+
origin: c,
|
|
624
624
|
...d ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
|
|
625
625
|
inclusive: !0,
|
|
626
626
|
exact: !0,
|
|
@@ -731,9 +731,9 @@ class ea {
|
|
|
731
731
|
return;
|
|
732
732
|
}
|
|
733
733
|
const r = t.split(`
|
|
734
|
-
`).filter((
|
|
735
|
-
for (const
|
|
736
|
-
this.content.push(
|
|
734
|
+
`).filter((c) => c), n = Math.min(...r.map((c) => c.length - c.trimStart().length)), u = r.map((c) => c.slice(n)).map((c) => " ".repeat(this.indent * 2) + c);
|
|
735
|
+
for (const c of u)
|
|
736
|
+
this.content.push(c);
|
|
737
737
|
}
|
|
738
738
|
compile() {
|
|
739
739
|
const t = Function, i = this?.args, n = [...(this?.content ?? [""]).map((u) => ` ${u}`)];
|
|
@@ -758,31 +758,31 @@ const ta = {
|
|
|
758
758
|
e._zod.run = e._zod.parse;
|
|
759
759
|
});
|
|
760
760
|
else {
|
|
761
|
-
const n = (
|
|
762
|
-
let o = tt(
|
|
761
|
+
const n = (c, d, y) => {
|
|
762
|
+
let o = tt(c), w;
|
|
763
763
|
for (const S of d) {
|
|
764
764
|
if (S._zod.def.when) {
|
|
765
|
-
if (!S._zod.def.when(
|
|
765
|
+
if (!S._zod.def.when(c))
|
|
766
766
|
continue;
|
|
767
767
|
} else if (o)
|
|
768
768
|
continue;
|
|
769
|
-
const C =
|
|
769
|
+
const C = c.issues.length, j = S._zod.check(c);
|
|
770
770
|
if (j instanceof Promise && y?.async === !1)
|
|
771
771
|
throw new rt();
|
|
772
772
|
if (w || j instanceof Promise)
|
|
773
773
|
w = (w ?? Promise.resolve()).then(async () => {
|
|
774
|
-
await j,
|
|
774
|
+
await j, c.issues.length !== C && (o || (o = tt(c, C)));
|
|
775
775
|
});
|
|
776
776
|
else {
|
|
777
|
-
if (
|
|
777
|
+
if (c.issues.length === C)
|
|
778
778
|
continue;
|
|
779
|
-
o || (o = tt(
|
|
779
|
+
o || (o = tt(c, C));
|
|
780
780
|
}
|
|
781
781
|
}
|
|
782
|
-
return w ? w.then(() =>
|
|
783
|
-
}, u = (
|
|
784
|
-
if (tt(
|
|
785
|
-
return
|
|
782
|
+
return w ? w.then(() => c) : c;
|
|
783
|
+
}, u = (c, d, y) => {
|
|
784
|
+
if (tt(c))
|
|
785
|
+
return c.aborted = !0, c;
|
|
786
786
|
const o = n(d, r, y);
|
|
787
787
|
if (o instanceof Promise) {
|
|
788
788
|
if (y.async === !1)
|
|
@@ -791,14 +791,14 @@ const ta = {
|
|
|
791
791
|
}
|
|
792
792
|
return e._zod.parse(o, y);
|
|
793
793
|
};
|
|
794
|
-
e._zod.run = (
|
|
794
|
+
e._zod.run = (c, d) => {
|
|
795
795
|
if (d.skipChecks)
|
|
796
|
-
return e._zod.parse(
|
|
796
|
+
return e._zod.parse(c, d);
|
|
797
797
|
if (d.direction === "backward") {
|
|
798
|
-
const o = e._zod.parse({ value:
|
|
799
|
-
return o instanceof Promise ? o.then((w) => u(w,
|
|
798
|
+
const o = e._zod.parse({ value: c.value, issues: [] }, { ...d, skipChecks: !0 });
|
|
799
|
+
return o instanceof Promise ? o.then((w) => u(w, c, d)) : u(o, c, d);
|
|
800
800
|
}
|
|
801
|
-
const y = e._zod.parse(
|
|
801
|
+
const y = e._zod.parse(c, d);
|
|
802
802
|
if (y instanceof Promise) {
|
|
803
803
|
if (d.async === !1)
|
|
804
804
|
throw new rt();
|
|
@@ -813,7 +813,7 @@ const ta = {
|
|
|
813
813
|
const u = an(e, n);
|
|
814
814
|
return u.success ? { value: u.data } : { issues: u.error?.issues };
|
|
815
815
|
} catch {
|
|
816
|
-
return on(e, n).then((
|
|
816
|
+
return on(e, n).then((c) => c.success ? { value: c.data } : { issues: c.error?.issues });
|
|
817
817
|
}
|
|
818
818
|
},
|
|
819
819
|
vendor: "zod",
|
|
@@ -938,10 +938,10 @@ const ta = {
|
|
|
938
938
|
const [n, u] = r;
|
|
939
939
|
if (!u)
|
|
940
940
|
throw new Error();
|
|
941
|
-
const
|
|
942
|
-
if (`${
|
|
941
|
+
const c = Number(u);
|
|
942
|
+
if (`${c}` !== u)
|
|
943
943
|
throw new Error();
|
|
944
|
-
if (
|
|
944
|
+
if (c < 0 || c > 128)
|
|
945
945
|
throw new Error();
|
|
946
946
|
new URL(`http://[${n}]`);
|
|
947
947
|
} catch {
|
|
@@ -1081,12 +1081,12 @@ const Na = /* @__PURE__ */ k("$ZodArray", (e, t) => {
|
|
|
1081
1081
|
}), i;
|
|
1082
1082
|
i.value = Array(n.length);
|
|
1083
1083
|
const u = [];
|
|
1084
|
-
for (let
|
|
1085
|
-
const d = n[
|
|
1084
|
+
for (let c = 0; c < n.length; c++) {
|
|
1085
|
+
const d = n[c], y = t.element._zod.run({
|
|
1086
1086
|
value: d,
|
|
1087
1087
|
issues: []
|
|
1088
1088
|
}, r);
|
|
1089
|
-
y instanceof Promise ? u.push(y.then((o) => Bi(o, i,
|
|
1089
|
+
y instanceof Promise ? u.push(y.then((o) => Bi(o, i, c))) : Bi(y, i, c);
|
|
1090
1090
|
}
|
|
1091
1091
|
return u.length ? Promise.all(u).then(() => i) : i;
|
|
1092
1092
|
};
|
|
@@ -1109,20 +1109,20 @@ function $r(e) {
|
|
|
1109
1109
|
};
|
|
1110
1110
|
}
|
|
1111
1111
|
function Fr(e, t, i, r, n, u) {
|
|
1112
|
-
const
|
|
1112
|
+
const c = [], d = n.keySet, y = n.catchall._zod, o = y.def.type;
|
|
1113
1113
|
for (const w in t) {
|
|
1114
1114
|
if (d.has(w))
|
|
1115
1115
|
continue;
|
|
1116
1116
|
if (o === "never") {
|
|
1117
|
-
|
|
1117
|
+
c.push(w);
|
|
1118
1118
|
continue;
|
|
1119
1119
|
}
|
|
1120
1120
|
const S = y.run({ value: t[w], issues: [] }, r);
|
|
1121
1121
|
S instanceof Promise ? e.push(S.then((C) => Mt(C, i, w, t))) : Mt(S, i, w, t);
|
|
1122
1122
|
}
|
|
1123
|
-
return
|
|
1123
|
+
return c.length && i.issues.push({
|
|
1124
1124
|
code: "unrecognized_keys",
|
|
1125
|
-
keys:
|
|
1125
|
+
keys: c,
|
|
1126
1126
|
input: t,
|
|
1127
1127
|
inst: u
|
|
1128
1128
|
}), e.length ? Promise.all(e).then(() => i) : i;
|
|
@@ -1153,9 +1153,9 @@ const La = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1153
1153
|
return y;
|
|
1154
1154
|
});
|
|
1155
1155
|
const n = Dt, u = t.catchall;
|
|
1156
|
-
let
|
|
1156
|
+
let c;
|
|
1157
1157
|
e._zod.parse = (d, y) => {
|
|
1158
|
-
|
|
1158
|
+
c ?? (c = r.value);
|
|
1159
1159
|
const o = d.value;
|
|
1160
1160
|
if (!n(o))
|
|
1161
1161
|
return d.issues.push({
|
|
@@ -1165,8 +1165,8 @@ const La = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1165
1165
|
inst: e
|
|
1166
1166
|
}), d;
|
|
1167
1167
|
d.value = {};
|
|
1168
|
-
const w = [], S =
|
|
1169
|
-
for (const C of
|
|
1168
|
+
const w = [], S = c.shape;
|
|
1169
|
+
for (const C of c.keys) {
|
|
1170
1170
|
const Z = S[C]._zod.run({ value: o[C], issues: [] }, y);
|
|
1171
1171
|
Z instanceof Promise ? w.push(Z.then((le) => Mt(le, d, C, o))) : Mt(Z, d, C, o);
|
|
1172
1172
|
}
|
|
@@ -1211,12 +1211,12 @@ const La = /* @__PURE__ */ k("$ZodObject", (e, t) => {
|
|
|
1211
1211
|
return (Ce, be) => ft(C, Ce, be);
|
|
1212
1212
|
};
|
|
1213
1213
|
let u;
|
|
1214
|
-
const
|
|
1214
|
+
const c = Dt, d = !Pr.jitless, o = d && Hs.value, w = t.catchall;
|
|
1215
1215
|
let S;
|
|
1216
1216
|
e._zod.parse = (C, j) => {
|
|
1217
1217
|
S ?? (S = r.value);
|
|
1218
1218
|
const Z = C.value;
|
|
1219
|
-
return
|
|
1219
|
+
return c(Z) ? d && o && j?.async === !1 && j.jitless !== !0 ? (u || (u = n(t.shape)), C = u(C, j), w ? Fr([], Z, C, j, S, e) : C) : i(C, j) : (C.issues.push({
|
|
1220
1220
|
expected: "object",
|
|
1221
1221
|
code: "invalid_type",
|
|
1222
1222
|
input: Z,
|
|
@@ -1233,7 +1233,7 @@ function Zi(e, t, i, r) {
|
|
|
1233
1233
|
code: "invalid_union",
|
|
1234
1234
|
input: t.value,
|
|
1235
1235
|
inst: i,
|
|
1236
|
-
errors: e.map((u) => u.issues.map((
|
|
1236
|
+
errors: e.map((u) => u.issues.map((c) => qe(c, r, Ue())))
|
|
1237
1237
|
}), t);
|
|
1238
1238
|
}
|
|
1239
1239
|
const Ra = /* @__PURE__ */ k("$ZodUnion", (e, t) => {
|
|
@@ -1250,7 +1250,7 @@ const Ra = /* @__PURE__ */ k("$ZodUnion", (e, t) => {
|
|
|
1250
1250
|
e._zod.parse = (n, u) => {
|
|
1251
1251
|
if (i)
|
|
1252
1252
|
return r(n, u);
|
|
1253
|
-
let
|
|
1253
|
+
let c = !1;
|
|
1254
1254
|
const d = [];
|
|
1255
1255
|
for (const y of t.options) {
|
|
1256
1256
|
const o = y._zod.run({
|
|
@@ -1258,19 +1258,19 @@ const Ra = /* @__PURE__ */ k("$ZodUnion", (e, t) => {
|
|
|
1258
1258
|
issues: []
|
|
1259
1259
|
}, u);
|
|
1260
1260
|
if (o instanceof Promise)
|
|
1261
|
-
d.push(o),
|
|
1261
|
+
d.push(o), c = !0;
|
|
1262
1262
|
else {
|
|
1263
1263
|
if (o.issues.length === 0)
|
|
1264
1264
|
return o;
|
|
1265
1265
|
d.push(o);
|
|
1266
1266
|
}
|
|
1267
1267
|
}
|
|
1268
|
-
return
|
|
1268
|
+
return c ? Promise.all(d).then((y) => Zi(y, n, e, u)) : Zi(d, n, e, u);
|
|
1269
1269
|
};
|
|
1270
1270
|
}), Da = /* @__PURE__ */ k("$ZodIntersection", (e, t) => {
|
|
1271
1271
|
Y.init(e, t), e._zod.parse = (i, r) => {
|
|
1272
|
-
const n = i.value, u = t.left._zod.run({ value: n, issues: [] }, r),
|
|
1273
|
-
return u instanceof Promise ||
|
|
1272
|
+
const n = i.value, u = t.left._zod.run({ value: n, issues: [] }, r), c = t.right._zod.run({ value: n, issues: [] }, r);
|
|
1273
|
+
return u instanceof Promise || c instanceof Promise ? Promise.all([u, c]).then(([y, o]) => Ui(i, y, o)) : Ui(i, u, c);
|
|
1274
1274
|
};
|
|
1275
1275
|
});
|
|
1276
1276
|
function hi(e, t) {
|
|
@@ -1281,13 +1281,13 @@ function hi(e, t) {
|
|
|
1281
1281
|
if (st(e) && st(t)) {
|
|
1282
1282
|
const i = Object.keys(t), r = Object.keys(e).filter((u) => i.indexOf(u) !== -1), n = { ...e, ...t };
|
|
1283
1283
|
for (const u of r) {
|
|
1284
|
-
const
|
|
1285
|
-
if (!
|
|
1284
|
+
const c = hi(e[u], t[u]);
|
|
1285
|
+
if (!c.valid)
|
|
1286
1286
|
return {
|
|
1287
1287
|
valid: !1,
|
|
1288
|
-
mergeErrorPath: [u, ...
|
|
1288
|
+
mergeErrorPath: [u, ...c.mergeErrorPath]
|
|
1289
1289
|
};
|
|
1290
|
-
n[u] =
|
|
1290
|
+
n[u] = c.data;
|
|
1291
1291
|
}
|
|
1292
1292
|
return { valid: !0, data: n };
|
|
1293
1293
|
}
|
|
@@ -1296,13 +1296,13 @@ function hi(e, t) {
|
|
|
1296
1296
|
return { valid: !1, mergeErrorPath: [] };
|
|
1297
1297
|
const i = [];
|
|
1298
1298
|
for (let r = 0; r < e.length; r++) {
|
|
1299
|
-
const n = e[r], u = t[r],
|
|
1300
|
-
if (!
|
|
1299
|
+
const n = e[r], u = t[r], c = hi(n, u);
|
|
1300
|
+
if (!c.valid)
|
|
1301
1301
|
return {
|
|
1302
1302
|
valid: !1,
|
|
1303
|
-
mergeErrorPath: [r, ...
|
|
1303
|
+
mergeErrorPath: [r, ...c.mergeErrorPath]
|
|
1304
1304
|
};
|
|
1305
|
-
i.push(
|
|
1305
|
+
i.push(c.data);
|
|
1306
1306
|
}
|
|
1307
1307
|
return { valid: !0, data: i };
|
|
1308
1308
|
}
|
|
@@ -1326,11 +1326,11 @@ const Ma = /* @__PURE__ */ k("$ZodRecord", (e, t) => {
|
|
|
1326
1326
|
input: n,
|
|
1327
1327
|
inst: e
|
|
1328
1328
|
}), i;
|
|
1329
|
-
const u = [],
|
|
1330
|
-
if (
|
|
1329
|
+
const u = [], c = t.keyType._zod.values;
|
|
1330
|
+
if (c) {
|
|
1331
1331
|
i.value = {};
|
|
1332
1332
|
const d = /* @__PURE__ */ new Set();
|
|
1333
|
-
for (const o of
|
|
1333
|
+
for (const o of c)
|
|
1334
1334
|
if (typeof o == "string" || typeof o == "number" || typeof o == "symbol") {
|
|
1335
1335
|
d.add(typeof o == "number" ? o.toString() : o);
|
|
1336
1336
|
const w = t.valueType._zod.run({ value: n[o], issues: [] }, r);
|
|
@@ -1378,11 +1378,11 @@ const Ma = /* @__PURE__ */ k("$ZodRecord", (e, t) => {
|
|
|
1378
1378
|
Y.init(e, t);
|
|
1379
1379
|
const i = Zs(t.entries), r = new Set(i);
|
|
1380
1380
|
e._zod.values = r, e._zod.pattern = new RegExp(`^(${i.filter((n) => Ws.has(typeof n)).map((n) => typeof n == "string" ? nt(n) : n.toString()).join("|")})$`), e._zod.parse = (n, u) => {
|
|
1381
|
-
const
|
|
1382
|
-
return r.has(
|
|
1381
|
+
const c = n.value;
|
|
1382
|
+
return r.has(c) || n.issues.push({
|
|
1383
1383
|
code: "invalid_value",
|
|
1384
1384
|
values: i,
|
|
1385
|
-
input:
|
|
1385
|
+
input: c,
|
|
1386
1386
|
inst: e
|
|
1387
1387
|
}), n;
|
|
1388
1388
|
};
|
|
@@ -1405,7 +1405,7 @@ const Ma = /* @__PURE__ */ k("$ZodRecord", (e, t) => {
|
|
|
1405
1405
|
throw new Tr(e.constructor.name);
|
|
1406
1406
|
const n = t.transform(i.value, i);
|
|
1407
1407
|
if (r.async)
|
|
1408
|
-
return (n instanceof Promise ? n : Promise.resolve(n)).then((
|
|
1408
|
+
return (n instanceof Promise ? n : Promise.resolve(n)).then((c) => (i.value = c, i));
|
|
1409
1409
|
if (n instanceof Promise)
|
|
1410
1410
|
throw new rt();
|
|
1411
1411
|
return i.value = n, i;
|
|
@@ -1470,7 +1470,7 @@ const qa = /* @__PURE__ */ k("$ZodCatch", (e, t) => {
|
|
|
1470
1470
|
return n instanceof Promise ? n.then((u) => (i.value = u.value, u.issues.length && (i.value = t.catchValue({
|
|
1471
1471
|
...i,
|
|
1472
1472
|
error: {
|
|
1473
|
-
issues: u.issues.map((
|
|
1473
|
+
issues: u.issues.map((c) => qe(c, r, Ue()))
|
|
1474
1474
|
},
|
|
1475
1475
|
input: i.value
|
|
1476
1476
|
}), i.issues = []), i)) : (i.value = n.value, n.issues.length && (i.value = t.catchValue({
|
|
@@ -1485,7 +1485,7 @@ const qa = /* @__PURE__ */ k("$ZodCatch", (e, t) => {
|
|
|
1485
1485
|
Y.init(e, t), U(e._zod, "values", () => t.in._zod.values), U(e._zod, "optin", () => t.in._zod.optin), U(e._zod, "optout", () => t.out._zod.optout), U(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (i, r) => {
|
|
1486
1486
|
if (r.direction === "backward") {
|
|
1487
1487
|
const u = t.out._zod.run(i, r);
|
|
1488
|
-
return u instanceof Promise ? u.then((
|
|
1488
|
+
return u instanceof Promise ? u.then((c) => Nt(c, t.in, r)) : Nt(u, t.in, r);
|
|
1489
1489
|
}
|
|
1490
1490
|
const n = t.in._zod.run(i, r);
|
|
1491
1491
|
return n instanceof Promise ? n.then((u) => Nt(u, t.out, r)) : Nt(n, t.out, r);
|
|
@@ -2215,11 +2215,11 @@ const li = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
2215
2215
|
const i = new Set(Object.keys(t.entries));
|
|
2216
2216
|
e.extract = (r, n) => {
|
|
2217
2217
|
const u = {};
|
|
2218
|
-
for (const
|
|
2219
|
-
if (i.has(
|
|
2220
|
-
u[
|
|
2218
|
+
for (const c of r)
|
|
2219
|
+
if (i.has(c))
|
|
2220
|
+
u[c] = t.entries[c];
|
|
2221
2221
|
else
|
|
2222
|
-
throw new Error(`Key ${
|
|
2222
|
+
throw new Error(`Key ${c} not found in enum`);
|
|
2223
2223
|
return new li({
|
|
2224
2224
|
...t,
|
|
2225
2225
|
checks: [],
|
|
@@ -2228,11 +2228,11 @@ const li = /* @__PURE__ */ k("ZodEnum", (e, t) => {
|
|
|
2228
2228
|
});
|
|
2229
2229
|
}, e.exclude = (r, n) => {
|
|
2230
2230
|
const u = { ...t.entries };
|
|
2231
|
-
for (const
|
|
2232
|
-
if (i.has(
|
|
2233
|
-
delete u[
|
|
2231
|
+
for (const c of r)
|
|
2232
|
+
if (i.has(c))
|
|
2233
|
+
delete u[c];
|
|
2234
2234
|
else
|
|
2235
|
-
throw new Error(`Key ${
|
|
2235
|
+
throw new Error(`Key ${c} not found in enum`);
|
|
2236
2236
|
return new li({
|
|
2237
2237
|
...t,
|
|
2238
2238
|
checks: [],
|
|
@@ -2273,8 +2273,8 @@ const Bu = /* @__PURE__ */ k("ZodTransform", (e, t) => {
|
|
|
2273
2273
|
if (typeof u == "string")
|
|
2274
2274
|
i.issues.push(bt(u, i.value, t));
|
|
2275
2275
|
else {
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2276
|
+
const c = u;
|
|
2277
|
+
c.fatal && (c.continue = !1), c.code ?? (c.code = "custom"), c.input ?? (c.input = i.value), c.inst ?? (c.inst = e), i.issues.push(bt(c));
|
|
2278
2278
|
}
|
|
2279
2279
|
};
|
|
2280
2280
|
const n = t.transform(i.value, i);
|
|
@@ -2867,14 +2867,14 @@ Defaulting to 2020, but this will stop working in the future.`)), t.ecmaVersion
|
|
|
2867
2867
|
return cr(t.onComment) && (t.onComment = Yc(t, t.onComment)), t;
|
|
2868
2868
|
}
|
|
2869
2869
|
function Yc(e, t) {
|
|
2870
|
-
return function(i, r, n, u,
|
|
2870
|
+
return function(i, r, n, u, c, d) {
|
|
2871
2871
|
var y = {
|
|
2872
2872
|
type: i ? "Block" : "Line",
|
|
2873
2873
|
value: r,
|
|
2874
2874
|
start: n,
|
|
2875
2875
|
end: u
|
|
2876
2876
|
};
|
|
2877
|
-
e.locations && (y.loc = new kt(this,
|
|
2877
|
+
e.locations && (y.loc = new kt(this, c, d)), e.ranges && (y.range = [n, u]), t.push(y);
|
|
2878
2878
|
};
|
|
2879
2879
|
}
|
|
2880
2880
|
var _t = 1, lt = 2, Pi = 4, es = 8, Ci = 16, ts = 32, Kt = 64, is = 128, Qe = 256, wt = 512, Gt = _t | lt | Qe;
|
|
@@ -3079,8 +3079,8 @@ I.isUsingKeyword = function(e, t) {
|
|
|
3079
3079
|
if (this.input.slice(r, n) !== "using" || n === this.input.length || Me(u = this.input.charCodeAt(n)) || u > 55295 && u < 56320)
|
|
3080
3080
|
return !1;
|
|
3081
3081
|
ne.lastIndex = n;
|
|
3082
|
-
var
|
|
3083
|
-
if (
|
|
3082
|
+
var c = ne.exec(this.input);
|
|
3083
|
+
if (c && ce.test(this.input.slice(n, n + c[0].length)))
|
|
3084
3084
|
return !1;
|
|
3085
3085
|
}
|
|
3086
3086
|
if (t) {
|
|
@@ -3138,7 +3138,7 @@ I.parseStatement = function(e, t, i) {
|
|
|
3138
3138
|
case l._import:
|
|
3139
3139
|
if (this.options.ecmaVersion > 10 && r === l._import) {
|
|
3140
3140
|
ne.lastIndex = this.pos;
|
|
3141
|
-
var
|
|
3141
|
+
var c = ne.exec(this.input), d = this.pos + c[0].length, y = this.input.charCodeAt(d);
|
|
3142
3142
|
if (y === 40 || y === 46)
|
|
3143
3143
|
return this.parseExpressionStatement(n, this.parseExpression());
|
|
3144
3144
|
}
|
|
@@ -3184,13 +3184,13 @@ I.parseForStatement = function(e) {
|
|
|
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
|
}
|
|
3187
|
-
var u = this.isContextual("let"),
|
|
3187
|
+
var u = this.isContextual("let"), c = !1, d = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
3188
3188
|
if (d) {
|
|
3189
3189
|
var y = this.startNode();
|
|
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, w = new Xt(), S = this.start, C = t > -1 ? this.parseExprSubscripts(w, "await") : this.parseExpression(!0, w);
|
|
3193
|
-
return this.type === l._in || (
|
|
3193
|
+
return this.type === l._in || (c = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === l._in && this.unexpected(t), e.await = !0) : c && this.options.ecmaVersion >= 8 && (C.start === S && !o && C.type === "Identifier" && C.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), u && c && this.raise(C.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(C, !1, w), this.checkLValPattern(C), this.parseForIn(e, C)) : (this.checkExpressionErrors(w, !0), t > -1 && this.unexpected(t), this.parseFor(e, C));
|
|
3194
3194
|
};
|
|
3195
3195
|
I.parseForAfterInit = function(e, t, i) {
|
|
3196
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));
|
|
@@ -3243,8 +3243,8 @@ I.parseEmptyStatement = function(e) {
|
|
|
3243
3243
|
};
|
|
3244
3244
|
I.parseLabeledStatement = function(e, t, i, r) {
|
|
3245
3245
|
for (var n = 0, u = this.labels; n < u.length; n += 1) {
|
|
3246
|
-
var
|
|
3247
|
-
|
|
3246
|
+
var c = u[n];
|
|
3247
|
+
c.name === t && this.raise(i.start, "Label '" + t + "' is already declared");
|
|
3248
3248
|
}
|
|
3249
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];
|
|
@@ -3289,8 +3289,8 @@ I.parseVarId = function(e, t) {
|
|
|
3289
3289
|
var xt = 1, fi = 2, as = 4;
|
|
3290
3290
|
I.parseFunction = function(e, t, i, r, n) {
|
|
3291
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
|
-
var u = this.yieldPos,
|
|
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 =
|
|
3292
|
+
var u = this.yieldPos, c = 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 === l.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, i, !1, n), this.yieldPos = u, this.awaitPos = c, this.awaitIdentPos = d, this.finishNode(e, t & xt ? "FunctionDeclaration" : "FunctionExpression");
|
|
3294
3294
|
};
|
|
3295
3295
|
I.parseFunctionParams = function(e) {
|
|
3296
3296
|
this.expect(l.parenL), e.params = this.parseBindingList(l.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
@@ -3301,15 +3301,15 @@ I.parseClass = function(e, t) {
|
|
|
3301
3301
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
3302
3302
|
var r = this.enterClassBody(), n = this.startNode(), u = !1;
|
|
3303
3303
|
for (n.body = [], this.expect(l.braceL); this.type !== l.braceR; ) {
|
|
3304
|
-
var
|
|
3305
|
-
|
|
3304
|
+
var c = this.parseClassElement(e.superClass !== null);
|
|
3305
|
+
c && (n.body.push(c), c.type === "MethodDefinition" && c.kind === "constructor" ? (u && this.raiseRecoverable(c.start, "Duplicate constructor in the same class"), u = !0) : c.key && c.key.type === "PrivateIdentifier" && ih(r, c) && this.raiseRecoverable(c.key.start, "Identifier '#" + c.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
3310
|
if (this.eat(l.semi))
|
|
3311
3311
|
return null;
|
|
3312
|
-
var t = this.options.ecmaVersion, i = this.startNode(), r = "", n = !1, u = !1,
|
|
3312
|
+
var t = this.options.ecmaVersion, i = this.startNode(), r = "", n = !1, u = !1, c = "method", d = !1;
|
|
3313
3313
|
if (this.eatContextual("static")) {
|
|
3314
3314
|
if (t >= 13 && this.eat(l.braceL))
|
|
3315
3315
|
return this.parseClassStaticBlock(i), i;
|
|
@@ -3317,11 +3317,11 @@ I.parseClassElement = function(e) {
|
|
|
3317
3317
|
}
|
|
3318
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
|
-
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ?
|
|
3320
|
+
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? c = 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 === l.parenL ||
|
|
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 || c !== "method" || n || u) {
|
|
3323
3323
|
var o = !i.static && $t(i, "constructor"), w = o && e;
|
|
3324
|
-
o &&
|
|
3324
|
+
o && c !== "method" && this.raise(i.key.start, "Constructor can't have get/set modifier"), i.kind = o ? "constructor" : c, this.parseClassMethod(i, n, u, w);
|
|
3325
3325
|
} else
|
|
3326
3326
|
this.parseClassField(i);
|
|
3327
3327
|
return i;
|
|
@@ -3364,8 +3364,8 @@ I.exitClassBody = function() {
|
|
|
3364
3364
|
var e = this.privateNameStack.pop(), t = e.declared, i = e.used;
|
|
3365
3365
|
if (this.options.checkPrivateFields)
|
|
3366
3366
|
for (var r = this.privateNameStack.length, n = r === 0 ? null : this.privateNameStack[r - 1], u = 0; u < i.length; ++u) {
|
|
3367
|
-
var
|
|
3368
|
-
ht(t,
|
|
3367
|
+
var c = i[u];
|
|
3368
|
+
ht(t, c.name) || (n ? n.used.push(c) : this.raiseRecoverable(c.start, "Private field '#" + c.name + "' must be declared in an enclosing class"));
|
|
3369
3369
|
}
|
|
3370
3370
|
};
|
|
3371
3371
|
function ih(e, t) {
|
|
@@ -3429,8 +3429,8 @@ I.checkPatternExport = function(e, t) {
|
|
|
3429
3429
|
this.checkPatternExport(e, u);
|
|
3430
3430
|
}
|
|
3431
3431
|
else if (i === "ArrayPattern")
|
|
3432
|
-
for (var
|
|
3433
|
-
var y = d[
|
|
3432
|
+
for (var c = 0, d = t.elements; c < d.length; c += 1) {
|
|
3433
|
+
var y = d[c];
|
|
3434
3434
|
y && this.checkPatternExport(e, y);
|
|
3435
3435
|
}
|
|
3436
3436
|
else i === "Property" ? this.checkPatternExport(e, t.value) : i === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : i === "RestElement" && this.checkPatternExport(e, t.argument);
|
|
@@ -3612,8 +3612,8 @@ Pe.parseBindingList = function(e, t, i, r) {
|
|
|
3612
3612
|
if (i && this.afterTrailingComma(e))
|
|
3613
3613
|
break;
|
|
3614
3614
|
if (this.type === l.ellipsis) {
|
|
3615
|
-
var
|
|
3616
|
-
this.parseBindingListItem(
|
|
3615
|
+
var c = this.parseRestBinding();
|
|
3616
|
+
this.parseBindingListItem(c), n.push(c), 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));
|
|
@@ -3661,8 +3661,8 @@ Pe.checkLValPattern = function(e, t, i) {
|
|
|
3661
3661
|
}
|
|
3662
3662
|
break;
|
|
3663
3663
|
case "ArrayPattern":
|
|
3664
|
-
for (var
|
|
3665
|
-
var y = d[
|
|
3664
|
+
for (var c = 0, d = e.elements; c < d.length; c += 1) {
|
|
3665
|
+
var y = d[c];
|
|
3666
3666
|
y && this.checkLValInnerPattern(y, t, i);
|
|
3667
3667
|
}
|
|
3668
3668
|
break;
|
|
@@ -3786,17 +3786,17 @@ M.checkPropClash = function(e, t, i) {
|
|
|
3786
3786
|
return;
|
|
3787
3787
|
}
|
|
3788
3788
|
n = "$" + n;
|
|
3789
|
-
var
|
|
3790
|
-
if (
|
|
3789
|
+
var c = t[n];
|
|
3790
|
+
if (c) {
|
|
3791
3791
|
var d;
|
|
3792
|
-
u === "init" ? d = this.strict &&
|
|
3792
|
+
u === "init" ? d = this.strict && c.init || c.get || c.set : d = c.init || c[u], d && this.raiseRecoverable(r.start, "Redefinition of property");
|
|
3793
3793
|
} else
|
|
3794
|
-
|
|
3794
|
+
c = t[n] = {
|
|
3795
3795
|
init: !1,
|
|
3796
3796
|
get: !1,
|
|
3797
3797
|
set: !1
|
|
3798
3798
|
};
|
|
3799
|
-
|
|
3799
|
+
c[u] = !0;
|
|
3800
3800
|
}
|
|
3801
3801
|
};
|
|
3802
3802
|
M.parseExpression = function(e, t) {
|
|
@@ -3815,14 +3815,14 @@ M.parseMaybeAssign = function(e, t, i) {
|
|
|
3815
3815
|
return this.parseYield(e);
|
|
3816
3816
|
this.exprAllowed = !1;
|
|
3817
3817
|
}
|
|
3818
|
-
var r = !1, n = -1, u = -1,
|
|
3819
|
-
t ? (n = t.parenthesizedAssign, u = t.trailingComma,
|
|
3818
|
+
var r = !1, n = -1, u = -1, c = -1;
|
|
3819
|
+
t ? (n = t.parenthesizedAssign, u = t.trailingComma, c = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new Xt(), r = !0);
|
|
3820
3820
|
var d = this.start, y = this.startLoc;
|
|
3821
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 w = this.startNodeAt(d, y);
|
|
3825
|
-
return w.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), w.left = o, this.next(), w.right = this.parseMaybeAssign(e),
|
|
3825
|
+
return w.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), w.left = o, this.next(), w.right = this.parseMaybeAssign(e), c > -1 && (t.doubleProto = c), this.finishNode(w, "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;
|
|
@@ -3844,44 +3844,44 @@ M.parseExprOps = function(e, t) {
|
|
|
3844
3844
|
M.parseExprOp = function(e, t, i, r, n) {
|
|
3845
3845
|
var u = this.type.binop;
|
|
3846
3846
|
if (u != null && (!n || this.type !== l._in) && u > r) {
|
|
3847
|
-
var
|
|
3847
|
+
var c = this.type === l.logicalOR || this.type === l.logicalAND, d = this.type === l.coalesce;
|
|
3848
3848
|
d && (u = l.logicalAND.binop);
|
|
3849
3849
|
var y = this.value;
|
|
3850
3850
|
this.next();
|
|
3851
|
-
var o = this.start, w = this.startLoc, S = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, n), o, w, u, n), C = this.buildBinary(t, i, e, S, y,
|
|
3852
|
-
return (
|
|
3851
|
+
var o = this.start, w = this.startLoc, S = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, n), o, w, u, n), C = this.buildBinary(t, i, e, S, y, c || d);
|
|
3852
|
+
return (c && 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(C, t, i, r, n);
|
|
3853
3853
|
}
|
|
3854
3854
|
return e;
|
|
3855
3855
|
};
|
|
3856
3856
|
M.buildBinary = function(e, t, i, r, n, u) {
|
|
3857
3857
|
r.type === "PrivateIdentifier" && this.raise(r.start, "Private identifier can only be left side of binary expression");
|
|
3858
|
-
var
|
|
3859
|
-
return
|
|
3858
|
+
var c = this.startNodeAt(e, t);
|
|
3859
|
+
return c.left = i, c.operator = n, c.right = r, this.finishNode(c, u ? "LogicalExpression" : "BinaryExpression");
|
|
3860
3860
|
};
|
|
3861
3861
|
M.parseMaybeUnary = function(e, t, i, r) {
|
|
3862
|
-
var n = this.start, u = this.startLoc,
|
|
3862
|
+
var n = this.start, u = this.startLoc, c;
|
|
3863
3863
|
if (this.isContextual("await") && this.canAwait)
|
|
3864
|
-
|
|
3864
|
+
c = this.parseAwait(r), t = !0;
|
|
3865
3865
|
else if (this.type.prefix) {
|
|
3866
3866
|
var d = this.startNode(), y = this.type === l.incDec;
|
|
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,
|
|
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, c = this.finishNode(d, y ? "UpdateExpression" : "UnaryExpression");
|
|
3868
3868
|
} else if (!t && this.type === l.privateId)
|
|
3869
|
-
(r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(),
|
|
3869
|
+
(r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), c = this.parsePrivateIdent(), this.type !== l._in && this.unexpected();
|
|
3870
3870
|
else {
|
|
3871
|
-
if (
|
|
3872
|
-
return
|
|
3871
|
+
if (c = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e))
|
|
3872
|
+
return c;
|
|
3873
3873
|
for (; this.type.postfix && !this.canInsertSemicolon(); ) {
|
|
3874
3874
|
var o = this.startNodeAt(n, u);
|
|
3875
|
-
o.operator = this.value, o.prefix = !1, o.argument =
|
|
3875
|
+
o.operator = this.value, o.prefix = !1, o.argument = c, this.checkLValSimple(c), this.next(), c = this.finishNode(o, "UpdateExpression");
|
|
3876
3876
|
}
|
|
3877
3877
|
}
|
|
3878
3878
|
if (!i && this.eat(l.starstar))
|
|
3879
3879
|
if (t)
|
|
3880
3880
|
this.unexpected(this.lastTokStart);
|
|
3881
3881
|
else
|
|
3882
|
-
return this.buildBinary(n, u,
|
|
3882
|
+
return this.buildBinary(n, u, c, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
3883
3883
|
else
|
|
3884
|
-
return
|
|
3884
|
+
return c;
|
|
3885
3885
|
};
|
|
3886
3886
|
function os(e) {
|
|
3887
3887
|
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && os(e.expression);
|
|
@@ -3897,10 +3897,10 @@ M.parseExprSubscripts = function(e, t) {
|
|
|
3897
3897
|
return e && u.type === "MemberExpression" && (e.parenthesizedAssign >= u.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= u.start && (e.parenthesizedBind = -1), e.trailingComma >= u.start && (e.trailingComma = -1)), u;
|
|
3898
3898
|
};
|
|
3899
3899
|
M.parseSubscripts = function(e, t, i, r, n) {
|
|
3900
|
-
for (var u = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start,
|
|
3901
|
-
var d = this.parseSubscript(e, t, i, r, u,
|
|
3902
|
-
if (d.optional && (
|
|
3903
|
-
if (
|
|
3900
|
+
for (var u = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, c = !1; ; ) {
|
|
3901
|
+
var d = this.parseSubscript(e, t, i, r, u, c, n);
|
|
3902
|
+
if (d.optional && (c = !0), d === e || d.type === "ArrowFunctionExpression") {
|
|
3903
|
+
if (c) {
|
|
3904
3904
|
var y = this.startNodeAt(t, i);
|
|
3905
3905
|
y.expression = d, d = this.finishNode(y, "ChainExpression");
|
|
3906
3906
|
}
|
|
@@ -3915,7 +3915,7 @@ M.shouldParseAsyncArrow = function() {
|
|
|
3915
3915
|
M.parseSubscriptAsyncArrow = function(e, t, i, r) {
|
|
3916
3916
|
return this.parseArrowExpression(this.startNodeAt(e, t), i, !0, r);
|
|
3917
3917
|
};
|
|
3918
|
-
M.parseSubscript = function(e, t, i, r, n, u,
|
|
3918
|
+
M.parseSubscript = function(e, t, i, r, n, u, c) {
|
|
3919
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
3921
|
var o = this.eat(l.bracketL);
|
|
@@ -3927,7 +3927,7 @@ M.parseSubscript = function(e, t, i, r, n, u, h) {
|
|
|
3927
3927
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
3928
3928
|
var le = this.parseExprList(l.parenR, this.options.ecmaVersion >= 8, !1, S);
|
|
3929
3929
|
if (n && !y && this.shouldParseAsyncArrow())
|
|
3930
|
-
return this.checkPatternErrors(S, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = C, this.awaitPos = j, this.awaitIdentPos = Z, this.parseSubscriptAsyncArrow(t, i, le,
|
|
3930
|
+
return this.checkPatternErrors(S, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = C, this.awaitPos = j, this.awaitIdentPos = Z, this.parseSubscriptAsyncArrow(t, i, le, c);
|
|
3931
3931
|
this.checkExpressionErrors(S, !0), this.yieldPos = C || this.yieldPos, this.awaitPos = j || this.awaitPos, this.awaitIdentPos = Z || this.awaitIdentPos;
|
|
3932
3932
|
var D = this.startNodeAt(t, i);
|
|
3933
3933
|
D.callee = e, D.arguments = le, d && (D.optional = y), e = this.finishNode(D, "CallExpression");
|
|
@@ -3947,14 +3947,14 @@ M.parseExprAtom = function(e, t, i) {
|
|
|
3947
3947
|
case l._this:
|
|
3948
3948
|
return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
3949
3949
|
case l.name:
|
|
3950
|
-
var u = this.start,
|
|
3950
|
+
var u = this.start, c = this.startLoc, d = this.containsEsc, y = this.parseIdent(!1);
|
|
3951
3951
|
if (this.options.ecmaVersion >= 8 && !d && y.name === "async" && !this.canInsertSemicolon() && this.eat(l._function))
|
|
3952
|
-
return this.overrideContext(H.f_expr), this.parseFunction(this.startNodeAt(u,
|
|
3952
|
+
return this.overrideContext(H.f_expr), this.parseFunction(this.startNodeAt(u, c), 0, !1, !0, t);
|
|
3953
3953
|
if (n && !this.canInsertSemicolon()) {
|
|
3954
3954
|
if (this.eat(l.arrow))
|
|
3955
|
-
return this.parseArrowExpression(this.startNodeAt(u,
|
|
3955
|
+
return this.parseArrowExpression(this.startNodeAt(u, c), [y], !1, t);
|
|
3956
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,
|
|
3957
|
+
return y = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(l.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(u, c), [y], !0, t);
|
|
3958
3958
|
}
|
|
3959
3959
|
return y;
|
|
3960
3960
|
case l.regexp:
|
|
@@ -4031,7 +4031,7 @@ M.parseParenAndDistinguishExpression = function(e, t) {
|
|
|
4031
4031
|
var i = this.start, r = this.startLoc, n, u = this.options.ecmaVersion >= 8;
|
|
4032
4032
|
if (this.options.ecmaVersion >= 6) {
|
|
4033
4033
|
this.next();
|
|
4034
|
-
var
|
|
4034
|
+
var c = this.start, d = this.startLoc, y = [], o = !0, w = !1, S = new Xt(), C = this.yieldPos, j = this.awaitPos, Z;
|
|
4035
4035
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== l.parenR; )
|
|
4036
4036
|
if (o ? o = !1 : this.expect(l.comma), u && this.afterTrailingComma(l.parenR, !0)) {
|
|
4037
4037
|
w = !0;
|
|
@@ -4047,7 +4047,7 @@ M.parseParenAndDistinguishExpression = function(e, t) {
|
|
|
4047
4047
|
var le = this.lastTokEnd, D = this.lastTokEndLoc;
|
|
4048
4048
|
if (this.expect(l.parenR), e && this.shouldParseArrow(y) && this.eat(l.arrow))
|
|
4049
4049
|
return this.checkPatternErrors(S, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = C, this.awaitPos = j, this.parseParenArrowList(i, r, y, t);
|
|
4050
|
-
(!y.length || w) && this.unexpected(this.lastTokStart), Z && this.unexpected(Z), this.checkExpressionErrors(S, !0), this.yieldPos = C || this.yieldPos, this.awaitPos = j || this.awaitPos, y.length > 1 ? (n = this.startNodeAt(
|
|
4050
|
+
(!y.length || w) && this.unexpected(this.lastTokStart), Z && this.unexpected(Z), this.checkExpressionErrors(S, !0), this.yieldPos = C || this.yieldPos, this.awaitPos = j || this.awaitPos, y.length > 1 ? (n = this.startNodeAt(c, 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) {
|
|
@@ -4114,12 +4114,12 @@ M.parseObj = function(e, t) {
|
|
|
4114
4114
|
return this.finishNode(i, e ? "ObjectPattern" : "ObjectExpression");
|
|
4115
4115
|
};
|
|
4116
4116
|
M.parseProperty = function(e, t) {
|
|
4117
|
-
var i = this.startNode(), r, n, u,
|
|
4117
|
+
var i = this.startNode(), r, n, u, c;
|
|
4118
4118
|
if (this.options.ecmaVersion >= 9 && this.eat(l.ellipsis))
|
|
4119
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,
|
|
4120
|
+
this.options.ecmaVersion >= 6 && (i.method = !1, i.shorthand = !1, (e || t) && (u = this.start, c = 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(l.star), this.parsePropertyName(i)) : n = !1, this.parsePropertyValue(i, e, r, n, u,
|
|
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, c, t, d), this.finishNode(i, "Property");
|
|
4123
4123
|
};
|
|
4124
4124
|
M.parseGetterSetter = function(e) {
|
|
4125
4125
|
var t = e.key.name;
|
|
@@ -4131,8 +4131,8 @@ M.parseGetterSetter = function(e) {
|
|
|
4131
4131
|
} else
|
|
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
|
-
M.parsePropertyValue = function(e, t, i, r, n, u,
|
|
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,
|
|
4134
|
+
M.parsePropertyValue = function(e, t, i, r, n, u, c, d) {
|
|
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, c), 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 && c ? (c.shorthandAssign < 0 && (c.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) {
|
|
@@ -4146,22 +4146,22 @@ 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
|
-
var r = this.startNode(), n = this.yieldPos, u = this.awaitPos,
|
|
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) | Kt | (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 =
|
|
4149
|
+
var r = this.startNode(), n = this.yieldPos, u = this.awaitPos, c = 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) | Kt | (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 = c, this.finishNode(r, "FunctionExpression");
|
|
4151
4151
|
};
|
|
4152
4152
|
M.parseArrowExpression = function(e, t, i, r) {
|
|
4153
|
-
var n = this.yieldPos, u = this.awaitPos,
|
|
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 =
|
|
4153
|
+
var n = this.yieldPos, u = this.awaitPos, c = this.awaitIdentPos;
|
|
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 = c, this.finishNode(e, "ArrowFunctionExpression");
|
|
4155
4155
|
};
|
|
4156
4156
|
M.parseFunctionBody = function(e, t, i, r) {
|
|
4157
|
-
var n = t && this.type !== l.braceL, u = this.strict,
|
|
4157
|
+
var n = t && this.type !== l.braceL, u = this.strict, c = !1;
|
|
4158
4158
|
if (n)
|
|
4159
4159
|
e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
4160
4160
|
else {
|
|
4161
4161
|
var d = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
4162
|
-
(!u || d) && (
|
|
4162
|
+
(!u || d) && (c = this.strictDirective(this.end), c && d && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
4163
4163
|
var y = this.labels;
|
|
4164
|
-
this.labels = [],
|
|
4164
|
+
this.labels = [], c && (this.strict = !0), this.checkParams(e, !u && !c && !t && !i && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, ns), e.body = this.parseBlock(!1, void 0, c && !u), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = y;
|
|
4165
4165
|
}
|
|
4166
4166
|
this.exitScope();
|
|
4167
4167
|
};
|
|
@@ -4185,8 +4185,8 @@ M.parseExprList = function(e, t, i, r) {
|
|
|
4185
4185
|
u = !1;
|
|
4186
4186
|
else if (this.expect(l.comma), t && this.afterTrailingComma(e))
|
|
4187
4187
|
break;
|
|
4188
|
-
var
|
|
4189
|
-
i && this.type === l.comma ?
|
|
4188
|
+
var c = void 0;
|
|
4189
|
+
i && this.type === l.comma ? c = null : this.type === l.ellipsis ? (c = this.parseSpread(r), r && this.type === l.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : c = this.parseMaybeAssign(!1, r), n.push(c);
|
|
4190
4190
|
}
|
|
4191
4191
|
return n;
|
|
4192
4192
|
};
|
|
@@ -4252,8 +4252,8 @@ Ke.declareName = function(e, t, i) {
|
|
|
4252
4252
|
var u = this.currentScope();
|
|
4253
4253
|
u.lexical.push(e);
|
|
4254
4254
|
} else if (t === rs) {
|
|
4255
|
-
var
|
|
4256
|
-
this.treatFunctionsAsVar ? r =
|
|
4255
|
+
var c = this.currentScope();
|
|
4256
|
+
this.treatFunctionsAsVar ? r = c.lexical.indexOf(e) > -1 : r = c.lexical.indexOf(e) > -1 || c.var.indexOf(e) > -1, c.functions.push(e);
|
|
4257
4257
|
} else
|
|
4258
4258
|
for (var d = this.scopeStack.length - 1; d >= 0; --d) {
|
|
4259
4259
|
var y = this.scopeStack[d];
|
|
@@ -4378,16 +4378,16 @@ Oe.prototype.at = function(t, i) {
|
|
|
4378
4378
|
var u = r.charCodeAt(t);
|
|
4379
4379
|
if (!(i || this.switchU) || u <= 55295 || u >= 57344 || t + 1 >= n)
|
|
4380
4380
|
return u;
|
|
4381
|
-
var
|
|
4382
|
-
return
|
|
4381
|
+
var c = r.charCodeAt(t + 1);
|
|
4382
|
+
return c >= 56320 && c <= 57343 ? (u << 10) + c - 56613888 : u;
|
|
4383
4383
|
};
|
|
4384
4384
|
Oe.prototype.nextIndex = function(t, i) {
|
|
4385
4385
|
i === void 0 && (i = !1);
|
|
4386
4386
|
var r = this.source, n = r.length;
|
|
4387
4387
|
if (t >= n)
|
|
4388
4388
|
return n;
|
|
4389
|
-
var u = r.charCodeAt(t),
|
|
4390
|
-
return !(i || this.switchU) || u <= 55295 || u >= 57344 || t + 1 >= n || (
|
|
4389
|
+
var u = r.charCodeAt(t), c;
|
|
4390
|
+
return !(i || this.switchU) || u <= 55295 || u >= 57344 || t + 1 >= n || (c = r.charCodeAt(t + 1)) < 56320 || c > 57343 ? t + 1 : t + 2;
|
|
4391
4391
|
};
|
|
4392
4392
|
Oe.prototype.current = function(t) {
|
|
4393
4393
|
return t === void 0 && (t = !1), this.at(this.pos, t);
|
|
@@ -4404,8 +4404,8 @@ Oe.prototype.eat = function(t, i) {
|
|
|
4404
4404
|
Oe.prototype.eatChars = function(t, i) {
|
|
4405
4405
|
i === void 0 && (i = !1);
|
|
4406
4406
|
for (var r = this.pos, n = 0, u = t; n < u.length; n += 1) {
|
|
4407
|
-
var
|
|
4408
|
-
if (d === -1 || d !==
|
|
4407
|
+
var c = u[n], d = this.at(r, i);
|
|
4408
|
+
if (d === -1 || d !== c)
|
|
4409
4409
|
return !1;
|
|
4410
4410
|
r = this.nextIndex(r, i);
|
|
4411
4411
|
}
|
|
@@ -4413,8 +4413,8 @@ Oe.prototype.eatChars = function(t, i) {
|
|
|
4413
4413
|
};
|
|
4414
4414
|
A.validateRegExpFlags = function(e) {
|
|
4415
4415
|
for (var t = e.validFlags, i = e.flags, r = !1, n = !1, u = 0; u < i.length; u++) {
|
|
4416
|
-
var
|
|
4417
|
-
t.indexOf(
|
|
4416
|
+
var c = i.charAt(u);
|
|
4417
|
+
t.indexOf(c) === -1 && this.raise(e.start, "Invalid regular expression flag"), i.indexOf(c, u + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), c === "u" && (r = !0), c === "v" && (n = !0);
|
|
4418
4418
|
}
|
|
4419
4419
|
this.options.ecmaVersion >= 15 && r && n && this.raise(e.start, "Invalid regular expression flag");
|
|
4420
4420
|
};
|
|
@@ -4586,11 +4586,11 @@ A.regexp_eatUncapturingGroup = function(e) {
|
|
|
4586
4586
|
i.indexOf(u, n + 1) > -1 && e.raise("Duplicate regular expression modifiers");
|
|
4587
4587
|
}
|
|
4588
4588
|
if (r) {
|
|
4589
|
-
var
|
|
4590
|
-
!i && !
|
|
4591
|
-
for (var d = 0; d <
|
|
4592
|
-
var y =
|
|
4593
|
-
(
|
|
4589
|
+
var c = this.regexp_eatModifiers(e);
|
|
4590
|
+
!i && !c && e.current() === 58 && e.raise("Invalid regular expression modifiers");
|
|
4591
|
+
for (var d = 0; d < c.length; d++) {
|
|
4592
|
+
var y = c.charAt(d);
|
|
4593
|
+
(c.indexOf(y, d + 1) > -1 || i.indexOf(y) > -1) && e.raise("Duplicate regular expression modifiers");
|
|
4594
4594
|
}
|
|
4595
4595
|
}
|
|
4596
4596
|
}
|
|
@@ -4785,9 +4785,9 @@ A.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
4785
4785
|
117
|
|
4786
4786
|
/* u */
|
|
4787
4787
|
) && this.regexp_eatFixedHexDigits(e, 4)) {
|
|
4788
|
-
var
|
|
4789
|
-
if (
|
|
4790
|
-
return e.lastIntValue = (n - 55296) * 1024 + (
|
|
4788
|
+
var c = e.lastIntValue;
|
|
4789
|
+
if (c >= 56320 && c <= 57343)
|
|
4790
|
+
return e.lastIntValue = (n - 55296) * 1024 + (c - 56320) + 65536, !0;
|
|
4791
4791
|
}
|
|
4792
4792
|
e.pos = u, e.lastIntValue = n;
|
|
4793
4793
|
}
|
|
@@ -5461,19 +5461,19 @@ $.readRegexp = function() {
|
|
|
5461
5461
|
}
|
|
5462
5462
|
var n = this.input.slice(i, this.pos);
|
|
5463
5463
|
++this.pos;
|
|
5464
|
-
var u = this.pos,
|
|
5464
|
+
var u = this.pos, c = this.readWord1();
|
|
5465
5465
|
this.containsEsc && this.unexpected(u);
|
|
5466
5466
|
var d = this.regexpState || (this.regexpState = new Oe(this));
|
|
5467
|
-
d.reset(i, n,
|
|
5467
|
+
d.reset(i, n, c), this.validateRegExpFlags(d), this.validateRegExpPattern(d);
|
|
5468
5468
|
var y = null;
|
|
5469
5469
|
try {
|
|
5470
|
-
y = new RegExp(n,
|
|
5470
|
+
y = new RegExp(n, c);
|
|
5471
5471
|
} catch {
|
|
5472
5472
|
}
|
|
5473
|
-
return this.finishToken(l.regexp, { pattern: n, flags:
|
|
5473
|
+
return this.finishToken(l.regexp, { pattern: n, flags: c, value: y });
|
|
5474
5474
|
};
|
|
5475
5475
|
$.readInt = function(e, t, i) {
|
|
5476
|
-
for (var r = this.options.ecmaVersion >= 12 && t === void 0, n = i && this.input.charCodeAt(this.pos) === 48, u = this.pos,
|
|
5476
|
+
for (var r = this.options.ecmaVersion >= 12 && t === void 0, n = i && this.input.charCodeAt(this.pos) === 48, u = this.pos, c = 0, d = 0, y = 0, o = t ?? 1 / 0; y < o; ++y, ++this.pos) {
|
|
5477
5477
|
var w = this.input.charCodeAt(this.pos), S = void 0;
|
|
5478
5478
|
if (r && w === 95) {
|
|
5479
5479
|
n && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), d === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), y === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), d = w;
|
|
@@ -5481,9 +5481,9 @@ $.readInt = function(e, t, i) {
|
|
|
5481
5481
|
}
|
|
5482
5482
|
if (w >= 97 ? S = w - 97 + 10 : w >= 65 ? S = w - 65 + 10 : w >= 48 && w <= 57 ? S = w - 48 : S = 1 / 0, S >= e)
|
|
5483
5483
|
break;
|
|
5484
|
-
d = w,
|
|
5484
|
+
d = w, c = c * e + S;
|
|
5485
5485
|
}
|
|
5486
|
-
return r && d === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === u || t != null && this.pos - u !== t ? null :
|
|
5486
|
+
return r && d === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === u || t != null && this.pos - u !== t ? null : c;
|
|
5487
5487
|
};
|
|
5488
5488
|
function Sh(e, t) {
|
|
5489
5489
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
@@ -5669,8 +5669,8 @@ $.readWord1 = function() {
|
|
|
5669
5669
|
this.containsEsc = !0, e += this.input.slice(i, this.pos);
|
|
5670
5670
|
var u = this.pos;
|
|
5671
5671
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
5672
|
-
var
|
|
5673
|
-
(t ? Ee : Me)(
|
|
5672
|
+
var c = this.readCodePoint();
|
|
5673
|
+
(t ? Ee : Me)(c, r) || this.invalidStringToken(u, "Invalid Unicode escape"), e += Ve(c), i = this.pos;
|
|
5674
5674
|
} else
|
|
5675
5675
|
break;
|
|
5676
5676
|
t = !1;
|
|
@@ -5740,7 +5740,7 @@ const Ah = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
5740
5740
|
function dr(e, t) {
|
|
5741
5741
|
for (var i = 0; i < t.length; i++) {
|
|
5742
5742
|
var r = t[i];
|
|
5743
|
-
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, typeof (n = (function(u,
|
|
5743
|
+
r.enumerable = r.enumerable || !1, r.configurable = !0, "value" in r && (r.writable = !0), Object.defineProperty(e, typeof (n = (function(u, c) {
|
|
5744
5744
|
if (typeof u != "object" || u === null) return u;
|
|
5745
5745
|
var d = u[Symbol.toPrimitive];
|
|
5746
5746
|
if (d !== void 0) {
|
|
@@ -5781,8 +5781,8 @@ function yr(e, t) {
|
|
|
5781
5781
|
if (Array.isArray(e) || (i = (function(n, u) {
|
|
5782
5782
|
if (n) {
|
|
5783
5783
|
if (typeof n == "string") return mr(n, u);
|
|
5784
|
-
var
|
|
5785
|
-
return
|
|
5784
|
+
var c = Object.prototype.toString.call(n).slice(8, -1);
|
|
5785
|
+
return c === "Object" && n.constructor && (c = n.constructor.name), c === "Map" || c === "Set" ? Array.from(n) : c === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c) ? mr(n, u) : void 0;
|
|
5786
5786
|
}
|
|
5787
5787
|
})(e)) || t) {
|
|
5788
5788
|
i && (e = i);
|
|
@@ -5805,21 +5805,21 @@ function Ih(e) {
|
|
|
5805
5805
|
var i = { assert: xe(0, { startsExpr: ve }), asserts: xe(0, { startsExpr: ve }), global: xe(0, { startsExpr: ve }), keyof: xe(0, { startsExpr: ve }), readonly: xe(0, { startsExpr: ve }), unique: xe(0, { startsExpr: ve }), abstract: xe(0, { startsExpr: ve }), declare: xe(0, { startsExpr: ve }), enum: xe(0, { startsExpr: ve }), module: xe(0, { startsExpr: ve }), namespace: xe(0, { startsExpr: ve }), interface: xe(0, { startsExpr: ve }), type: xe(0, { startsExpr: ve }) }, r = { at: new z("@"), jsxName: new z("jsxName"), jsxText: new z("jsxText", { beforeExpr: !0 }), jsxTagStart: new z("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new z("jsxTagEnd") }, n = { tc_oTag: new ue("<tag", !1, !1), tc_cTag: new ue("</tag", !1, !1), tc_expr: new ue("<tag>...</tag>", !0, !0) }, u = new RegExp("^(?:" + Object.keys(i).join("|") + ")$");
|
|
5806
5806
|
r.jsxTagStart.updateContext = function() {
|
|
5807
5807
|
this.context.push(n.tc_expr), this.context.push(n.tc_oTag), this.exprAllowed = !1;
|
|
5808
|
-
}, r.jsxTagEnd.updateContext = function(
|
|
5808
|
+
}, r.jsxTagEnd.updateContext = function(c) {
|
|
5809
5809
|
var d = this.context.pop();
|
|
5810
|
-
d === n.tc_oTag &&
|
|
5811
|
-
}, t = { tokTypes: Zt({}, i, r), tokContexts: Zt({}, n), keywordsRegExp: u, tokenIsLiteralPropertyName: function(
|
|
5812
|
-
return [l.name, l.string, l.num].concat(Object.values(at), Object.values(i)).includes(
|
|
5813
|
-
}, tokenIsKeywordOrIdentifier: function(
|
|
5814
|
-
return [l.name].concat(Object.values(at), Object.values(i)).includes(
|
|
5815
|
-
}, tokenIsIdentifier: function(
|
|
5816
|
-
return [].concat(Object.values(i), [l.name]).includes(
|
|
5817
|
-
}, tokenIsTSDeclarationStart: function(
|
|
5818
|
-
return [i.abstract, i.declare, i.enum, i.module, i.namespace, i.interface, i.type].includes(
|
|
5819
|
-
}, tokenIsTSTypeOperator: function(
|
|
5820
|
-
return [i.keyof, i.readonly, i.unique].includes(
|
|
5821
|
-
}, tokenIsTemplate: function(
|
|
5822
|
-
return
|
|
5810
|
+
d === n.tc_oTag && c === l.slash || d === n.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === n.tc_expr) : this.exprAllowed = !0;
|
|
5811
|
+
}, t = { tokTypes: Zt({}, i, r), tokContexts: Zt({}, n), keywordsRegExp: u, tokenIsLiteralPropertyName: function(c) {
|
|
5812
|
+
return [l.name, l.string, l.num].concat(Object.values(at), Object.values(i)).includes(c);
|
|
5813
|
+
}, tokenIsKeywordOrIdentifier: function(c) {
|
|
5814
|
+
return [l.name].concat(Object.values(at), Object.values(i)).includes(c);
|
|
5815
|
+
}, tokenIsIdentifier: function(c) {
|
|
5816
|
+
return [].concat(Object.values(i), [l.name]).includes(c);
|
|
5817
|
+
}, tokenIsTSDeclarationStart: function(c) {
|
|
5818
|
+
return [i.abstract, i.declare, i.enum, i.module, i.namespace, i.interface, i.type].includes(c);
|
|
5819
|
+
}, tokenIsTSTypeOperator: function(c) {
|
|
5820
|
+
return [i.keyof, i.readonly, i.unique].includes(c);
|
|
5821
|
+
}, tokenIsTemplate: function(c) {
|
|
5822
|
+
return c === l.invalidTemplate;
|
|
5823
5823
|
} };
|
|
5824
5824
|
}
|
|
5825
5825
|
return t;
|
|
@@ -5902,8 +5902,8 @@ function br(e) {
|
|
|
5902
5902
|
}
|
|
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
|
-
return function(
|
|
5906
|
-
var d =
|
|
5905
|
+
return function(c) {
|
|
5906
|
+
var d = c.acorn || Ah, y = Ih(d), o = d.tokTypes, w = d.keywordTypes, S = d.isIdentifierStart, C = d.lineBreak, j = d.isNewLine, Z = d.tokContexts, le = d.isIdentifierChar, D = y.tokTypes, se = y.tokContexts, ft = y.keywordsRegExp, Ce = y.tokenIsLiteralPropertyName, be = y.tokenIsTemplate, Ge = y.tokenIsTSDeclarationStart, q = y.tokenIsIdentifier, Ct = y.tokenIsKeywordOrIdentifier, Ls = y.tokenIsTSTypeOperator;
|
|
5907
5907
|
function Os(P, pe, oe) {
|
|
5908
5908
|
oe === void 0 && (oe = P.length);
|
|
5909
5909
|
for (var te = pe; te < oe; te++) {
|
|
@@ -5912,7 +5912,7 @@ function jh(e) {
|
|
|
5912
5912
|
}
|
|
5913
5913
|
return -1;
|
|
5914
5914
|
}
|
|
5915
|
-
|
|
5915
|
+
c = (function(P, pe, oe) {
|
|
5916
5916
|
var te = oe.tokTypes, B = pe.tokTypes;
|
|
5917
5917
|
return (function(f) {
|
|
5918
5918
|
function s() {
|
|
@@ -5920,17 +5920,17 @@ function jh(e) {
|
|
|
5920
5920
|
}
|
|
5921
5921
|
Rt(s, f);
|
|
5922
5922
|
var a = s.prototype;
|
|
5923
|
-
return a.takeDecorators = function(
|
|
5923
|
+
return a.takeDecorators = function(h) {
|
|
5924
5924
|
var p = this.decoratorStack[this.decoratorStack.length - 1];
|
|
5925
|
-
p.length && (
|
|
5926
|
-
}, a.parseDecorators = function(
|
|
5925
|
+
p.length && (h.decorators = p, this.resetStartLocationFromNode(h, p[0]), this.decoratorStack[this.decoratorStack.length - 1] = []);
|
|
5926
|
+
}, a.parseDecorators = function(h) {
|
|
5927
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
|
-
this.match(te._export) ?
|
|
5931
|
+
this.match(te._export) ? h || this.unexpected() : this.canHaveLeadingDecorator() || this.raise(this.start, "Leading decorators must be attached to a class declaration.");
|
|
5932
5932
|
}, a.parseDecorator = function() {
|
|
5933
|
-
var
|
|
5933
|
+
var h = this.startNode();
|
|
5934
5934
|
this.next(), this.decoratorStack.push([]);
|
|
5935
5935
|
var p, m = this.start, v = this.startLoc;
|
|
5936
5936
|
if (this.match(te.parenL)) {
|
|
@@ -5943,17 +5943,17 @@ function jh(e) {
|
|
|
5943
5943
|
var T = this.startNodeAt(m, v);
|
|
5944
5944
|
T.object = p, T.property = this.parseIdent(!0), T.computed = !1, p = this.finishNode(T, "MemberExpression");
|
|
5945
5945
|
}
|
|
5946
|
-
return
|
|
5947
|
-
}, a.parseMaybeDecoratorArguments = function(
|
|
5946
|
+
return h.expression = this.parseMaybeDecoratorArguments(p), this.decoratorStack.pop(), this.finishNode(h, "Decorator");
|
|
5947
|
+
}, a.parseMaybeDecoratorArguments = function(h) {
|
|
5948
5948
|
if (this.eat(te.parenL)) {
|
|
5949
|
-
var p = this.startNodeAtNode(
|
|
5950
|
-
return p.callee =
|
|
5949
|
+
var p = this.startNodeAtNode(h);
|
|
5950
|
+
return p.callee = h, p.arguments = this.parseExprList(te.parenR, !1), this.finishNode(p, "CallExpression");
|
|
5951
5951
|
}
|
|
5952
|
-
return
|
|
5952
|
+
return h;
|
|
5953
5953
|
}, s;
|
|
5954
5954
|
})(P);
|
|
5955
|
-
})(
|
|
5956
|
-
var B = P.tokTypes, f = pe.tokTypes, s = P.isNewLine, a = P.isIdentifierChar,
|
|
5955
|
+
})(c, y, d), c = (function(P, pe, oe, te) {
|
|
5956
|
+
var B = P.tokTypes, f = pe.tokTypes, s = P.isNewLine, a = P.isIdentifierChar, h = Object.assign({ allowNamespaces: !0, allowNamespacedObjects: !0 }, {});
|
|
5957
5957
|
return (function(p) {
|
|
5958
5958
|
function m() {
|
|
5959
5959
|
return p.apply(this, arguments) || this;
|
|
@@ -6013,13 +6013,13 @@ function jh(e) {
|
|
|
6013
6013
|
return this.type === f.jsxName ? x.name = this.value : this.type.keyword ? x.name = this.type.keyword : this.unexpected(), this.next(), this.finishNode(x, "JSXIdentifier");
|
|
6014
6014
|
}, v.jsx_parseNamespacedName = function() {
|
|
6015
6015
|
var x = this.start, g = this.startLoc, _ = this.jsx_parseIdentifier();
|
|
6016
|
-
if (!
|
|
6016
|
+
if (!h.allowNamespaces || !this.eat(B.colon)) return _;
|
|
6017
6017
|
var T = this.startNodeAt(x, g);
|
|
6018
6018
|
return T.namespace = _, T.name = this.jsx_parseIdentifier(), this.finishNode(T, "JSXNamespacedName");
|
|
6019
6019
|
}, v.jsx_parseElementName = function() {
|
|
6020
6020
|
if (this.type === f.jsxTagEnd) return "";
|
|
6021
6021
|
var x = this.start, g = this.startLoc, _ = this.jsx_parseNamespacedName();
|
|
6022
|
-
for (this.type !== B.dot || _.type !== "JSXNamespacedName" ||
|
|
6022
|
+
for (this.type !== B.dot || _.type !== "JSXNamespacedName" || h.allowNamespacedObjects || this.unexpected(); this.eat(B.dot); ) {
|
|
6023
6023
|
var T = this.startNodeAt(x, g);
|
|
6024
6024
|
T.object = _, T.property = this.jsx_parseIdentifier(), _ = this.finishNode(T, "JSXMemberExpression");
|
|
6025
6025
|
}
|
|
@@ -6085,7 +6085,7 @@ function jh(e) {
|
|
|
6085
6085
|
return this.next(), this.jsx_parseElementAt(x, g);
|
|
6086
6086
|
}, m;
|
|
6087
6087
|
})(oe);
|
|
6088
|
-
})(d, y,
|
|
6088
|
+
})(d, y, c), c = (function(P, pe, oe) {
|
|
6089
6089
|
var te = pe.tokTypes, B = oe.tokTypes;
|
|
6090
6090
|
return (function(f) {
|
|
6091
6091
|
function s() {
|
|
@@ -6093,31 +6093,31 @@ function jh(e) {
|
|
|
6093
6093
|
}
|
|
6094
6094
|
Rt(s, f);
|
|
6095
6095
|
var a = s.prototype;
|
|
6096
|
-
return a.parseMaybeImportAttributes = function(
|
|
6096
|
+
return a.parseMaybeImportAttributes = function(h) {
|
|
6097
6097
|
if (this.type === B._with || this.type === te.assert) {
|
|
6098
6098
|
this.next();
|
|
6099
6099
|
var p = this.parseImportAttributes();
|
|
6100
|
-
p && (
|
|
6100
|
+
p && (h.attributes = p);
|
|
6101
6101
|
}
|
|
6102
6102
|
}, a.parseImportAttributes = function() {
|
|
6103
6103
|
this.expect(B.braceL);
|
|
6104
|
-
var
|
|
6105
|
-
return this.expect(B.braceR),
|
|
6104
|
+
var h = this.parseWithEntries();
|
|
6105
|
+
return this.expect(B.braceR), h;
|
|
6106
6106
|
}, a.parseWithEntries = function() {
|
|
6107
|
-
var
|
|
6107
|
+
var h = [], 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, 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),
|
|
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), h.push(this.finishNode(v, "ImportAttribute"));
|
|
6112
6112
|
} while (this.eat(B.comma));
|
|
6113
|
-
return
|
|
6113
|
+
return h;
|
|
6114
6114
|
}, s;
|
|
6115
6115
|
})(P);
|
|
6116
|
-
})(
|
|
6116
|
+
})(c, y, d);
|
|
6117
6117
|
var Rs = /* @__PURE__ */ (function(P) {
|
|
6118
|
-
function pe(s, a,
|
|
6118
|
+
function pe(s, a, h) {
|
|
6119
6119
|
var p;
|
|
6120
|
-
return (p = P.call(this, s, a,
|
|
6120
|
+
return (p = P.call(this, s, a, h) || 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;
|
|
@@ -6146,20 +6146,20 @@ function jh(e) {
|
|
|
6146
6146
|
return s.type !== "" && s.end !== 0 ? s : P.prototype.finishNode.call(this, s, a);
|
|
6147
6147
|
}, f.tryParse = function(s, a) {
|
|
6148
6148
|
a === void 0 && (a = this.cloneCurLookaheadState());
|
|
6149
|
-
var
|
|
6149
|
+
var h = { node: null };
|
|
6150
6150
|
try {
|
|
6151
6151
|
return { node: s(function(m) {
|
|
6152
|
-
throw m === void 0 && (m = null),
|
|
6152
|
+
throw m === void 0 && (m = null), h.node = m, h;
|
|
6153
6153
|
}), error: null, thrown: !1, aborted: !1, failState: null };
|
|
6154
6154
|
} catch (m) {
|
|
6155
6155
|
var p = this.getCurLookaheadState();
|
|
6156
6156
|
if (this.setLookaheadState(a), m instanceof SyntaxError) return { node: null, error: m, thrown: !0, aborted: !1, failState: p };
|
|
6157
|
-
if (m ===
|
|
6157
|
+
if (m === h) return { node: h.node, error: null, thrown: !1, aborted: !0, failState: p };
|
|
6158
6158
|
throw m;
|
|
6159
6159
|
}
|
|
6160
6160
|
}, f.setOptionalParametersError = function(s, a) {
|
|
6161
|
-
var
|
|
6162
|
-
s.optionalParametersLoc = (
|
|
6161
|
+
var h;
|
|
6162
|
+
s.optionalParametersLoc = (h = a?.loc) != null ? h : this.startLoc;
|
|
6163
6163
|
}, f.reScan_lt_gt = function() {
|
|
6164
6164
|
this.type === o.relational && (this.pos -= 1, this.readToken_lt_gt(this.fullCharCodeAtPos()));
|
|
6165
6165
|
}, f.reScan_lt = function() {
|
|
@@ -6172,15 +6172,15 @@ function jh(e) {
|
|
|
6172
6172
|
}, f.nextTokenStart = function() {
|
|
6173
6173
|
return this.nextTokenStartSince(this.pos);
|
|
6174
6174
|
}, f.tsHasSomeModifiers = function(s, a) {
|
|
6175
|
-
return a.some(function(
|
|
6176
|
-
return br(
|
|
6175
|
+
return a.some(function(h) {
|
|
6176
|
+
return br(h) ? s.accessibility === h : !!s[h];
|
|
6177
6177
|
});
|
|
6178
6178
|
}, f.tsIsStartOfStaticBlocks = function() {
|
|
6179
6179
|
return this.isContextual("static") && this.lookaheadCharCode() === 123;
|
|
6180
6180
|
}, f.tsCheckForInvalidTypeCasts = function(s) {
|
|
6181
6181
|
var a = this;
|
|
6182
|
-
s.forEach(function(
|
|
6183
|
-
|
|
6182
|
+
s.forEach(function(h) {
|
|
6183
|
+
h?.type === "TSTypeCastExpression" && a.raise(h.typeAnnotation.start, N.UnexpectedTypeAnnotation);
|
|
6184
6184
|
});
|
|
6185
6185
|
}, f.atPossibleAsyncArrow = function(s) {
|
|
6186
6186
|
return s.type === "Identifier" && s.name === "async" && this.lastTokEndLoc.column === s.end && !this.canInsertSemicolon() && s.end - s.start == 5 && s.start === this.potentialArrowAt;
|
|
@@ -6188,7 +6188,7 @@ function jh(e) {
|
|
|
6188
6188
|
return q(this.type);
|
|
6189
6189
|
}, f.tsTryParseTypeOrTypePredicateAnnotation = function() {
|
|
6190
6190
|
return this.match(o.colon) ? this.tsParseTypeOrTypePredicateAnnotation(o.colon) : void 0;
|
|
6191
|
-
}, f.tsTryParseGenericAsyncArrowFunction = function(s, a,
|
|
6191
|
+
}, f.tsTryParseGenericAsyncArrowFunction = function(s, a, h) {
|
|
6192
6192
|
var p = this;
|
|
6193
6193
|
if (this.tsMatchLeftRelational()) {
|
|
6194
6194
|
var m = this.maybeInArrowParameters;
|
|
@@ -6197,7 +6197,7 @@ function jh(e) {
|
|
|
6197
6197
|
var x = p.startNodeAt(s, a);
|
|
6198
6198
|
return x.typeParameters = p.tsParseTypeParameters(), P.prototype.parseFunctionParams.call(p, x), x.returnType = p.tsTryParseTypeOrTypePredicateAnnotation(), p.expect(o.arrow), x;
|
|
6199
6199
|
});
|
|
6200
|
-
if (this.maybeInArrowParameters = m, v) return P.prototype.parseArrowExpression.call(this, v, null, !0,
|
|
6200
|
+
if (this.maybeInArrowParameters = m, v) return P.prototype.parseArrowExpression.call(this, v, null, !0, h);
|
|
6201
6201
|
}
|
|
6202
6202
|
}, f.tsParseTypeArgumentsInExpression = function() {
|
|
6203
6203
|
if (this.reScan_lt() === o.relational) return this.tsParseTypeArguments();
|
|
@@ -6212,9 +6212,9 @@ function jh(e) {
|
|
|
6212
6212
|
}, f.tsTryParseTypeAnnotation = function() {
|
|
6213
6213
|
return this.match(o.colon) ? this.tsParseTypeAnnotation() : void 0;
|
|
6214
6214
|
}, f.isUnparsedContextual = function(s, a) {
|
|
6215
|
-
var
|
|
6216
|
-
if (this.input.slice(s,
|
|
6217
|
-
var p = this.input.charCodeAt(
|
|
6215
|
+
var h = s + a.length;
|
|
6216
|
+
if (this.input.slice(s, h) === a) {
|
|
6217
|
+
var p = this.input.charCodeAt(h);
|
|
6218
6218
|
return !(le(p) || (64512 & p) == 55296);
|
|
6219
6219
|
}
|
|
6220
6220
|
return !1;
|
|
@@ -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
|
|
6229
|
-
var m = p[
|
|
6228
|
+
for (var h = 0, p = Object.keys(s); h < p.length; h++) {
|
|
6229
|
+
var m = p[h];
|
|
6230
6230
|
if (s[m] !== a[m]) return !1;
|
|
6231
6231
|
}
|
|
6232
6232
|
return !0;
|
|
@@ -6239,11 +6239,11 @@ function jh(e) {
|
|
|
6239
6239
|
}, f.setLookaheadState = function(s) {
|
|
6240
6240
|
this.pos = s.pos, this.value = s.value, this.endLoc = s.endLoc, this.lastTokEnd = s.lastTokEnd, this.lastTokStart = s.lastTokStart, this.lastTokStartLoc = s.lastTokStartLoc, this.type = s.type, this.start = s.start, this.end = s.end, this.context = s.context, this.startLoc = s.startLoc, this.lastTokEndLoc = s.lastTokEndLoc, this.curLine = s.curLine, this.lineStart = s.lineStart, this.curPosition = s.curPosition, this.containsEsc = s.containsEsc;
|
|
6241
6241
|
}, f.tsLookAhead = function(s) {
|
|
6242
|
-
var a = this.getCurLookaheadState(),
|
|
6243
|
-
return this.setLookaheadState(a),
|
|
6242
|
+
var a = this.getCurLookaheadState(), h = s();
|
|
6243
|
+
return this.setLookaheadState(a), h;
|
|
6244
6244
|
}, f.lookahead = function(s) {
|
|
6245
6245
|
var a = this.getCurLookaheadState();
|
|
6246
|
-
if (this.createLookaheadState(), this.isLookahead = !0, s !== void 0) for (var
|
|
6246
|
+
if (this.createLookaheadState(), this.isLookahead = !0, s !== void 0) for (var h = 0; h < s; h++) this.nextToken();
|
|
6247
6247
|
else this.nextToken();
|
|
6248
6248
|
this.isLookahead = !1;
|
|
6249
6249
|
var p = this.getCurLookaheadState();
|
|
@@ -6254,28 +6254,28 @@ function jh(e) {
|
|
|
6254
6254
|
}, f.skipBlockComment = function() {
|
|
6255
6255
|
var s;
|
|
6256
6256
|
this.isLookahead || (s = this.options.onComment && this.curPosition());
|
|
6257
|
-
var a = this.pos,
|
|
6258
|
-
if (
|
|
6259
|
-
this.isLookahead || this.options.onComment && this.options.onComment(!0, this.input.slice(a + 2,
|
|
6257
|
+
var a = this.pos, h = this.input.indexOf("*/", this.pos += 2);
|
|
6258
|
+
if (h === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = h + 2, this.options.locations) for (var p, m = a; (p = Os(this.input, m, this.pos)) > -1; ) ++this.curLine, m = this.lineStart = p;
|
|
6259
|
+
this.isLookahead || this.options.onComment && this.options.onComment(!0, this.input.slice(a + 2, h), a, this.pos, s, this.curPosition());
|
|
6260
6260
|
}, f.skipLineComment = function(s) {
|
|
6261
|
-
var a,
|
|
6261
|
+
var a, h = this.pos;
|
|
6262
6262
|
this.isLookahead || (a = this.options.onComment && this.curPosition());
|
|
6263
6263
|
for (var p = this.input.charCodeAt(this.pos += s); this.pos < this.input.length && !j(p); ) p = this.input.charCodeAt(++this.pos);
|
|
6264
|
-
this.isLookahead || this.options.onComment && this.options.onComment(!1, this.input.slice(
|
|
6264
|
+
this.isLookahead || this.options.onComment && this.options.onComment(!1, this.input.slice(h + s, this.pos), h, 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());
|
|
6267
|
-
var
|
|
6268
|
-
this.type = s, this.value = a, this.isLookahead || this.updateContext(
|
|
6269
|
-
}, f.resetStartLocation = function(s, a,
|
|
6270
|
-
s.start = a, s.loc.start =
|
|
6267
|
+
var h = this.type;
|
|
6268
|
+
this.type = s, this.value = a, this.isLookahead || this.updateContext(h);
|
|
6269
|
+
}, f.resetStartLocation = function(s, a, h) {
|
|
6270
|
+
s.start = a, s.loc.start = h, this.options.ranges && (s.range[0] = a);
|
|
6271
6271
|
}, f.isLineTerminator = function() {
|
|
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,
|
|
6275
|
+
}, f.addExtra = function(s, a, h, p) {
|
|
6276
6276
|
if (p === void 0 && (p = !0), s) {
|
|
6277
6277
|
var m = s.extra = s.extra || {};
|
|
6278
|
-
p ? m[a] =
|
|
6278
|
+
p ? m[a] = h : Object.defineProperty(m, a, { enumerable: p, value: h });
|
|
6279
6279
|
}
|
|
6280
6280
|
}, f.isLiteralPropertyName = function() {
|
|
6281
6281
|
return Ce(this.type);
|
|
@@ -6314,21 +6314,21 @@ function jh(e) {
|
|
|
6314
6314
|
return this.type === s;
|
|
6315
6315
|
}, f.matchJsx = function(s) {
|
|
6316
6316
|
return this.type === y.tokTypes[s];
|
|
6317
|
-
}, f.ts_eatWithState = function(s, a,
|
|
6318
|
-
if (s ===
|
|
6317
|
+
}, f.ts_eatWithState = function(s, a, h) {
|
|
6318
|
+
if (s === h.type) {
|
|
6319
6319
|
for (var p = 0; p < a; p++) this.next();
|
|
6320
6320
|
return !0;
|
|
6321
6321
|
}
|
|
6322
6322
|
return !1;
|
|
6323
|
-
}, f.ts_eatContextualWithState = function(s, a,
|
|
6323
|
+
}, f.ts_eatContextualWithState = function(s, a, h) {
|
|
6324
6324
|
if (ft.test(s)) {
|
|
6325
|
-
if (this.ts_isContextualWithState(
|
|
6325
|
+
if (this.ts_isContextualWithState(h, D[s])) {
|
|
6326
6326
|
for (var p = 0; p < a; p++) this.next();
|
|
6327
6327
|
return !0;
|
|
6328
6328
|
}
|
|
6329
6329
|
return !1;
|
|
6330
6330
|
}
|
|
6331
|
-
if (!this.isContextualWithState(s,
|
|
6331
|
+
if (!this.isContextualWithState(s, h)) return !1;
|
|
6332
6332
|
for (var m = 0; m < a; m++) this.next();
|
|
6333
6333
|
return !0;
|
|
6334
6334
|
}, f.canHaveLeadingDecorator = function() {
|
|
@@ -6343,8 +6343,8 @@ function jh(e) {
|
|
|
6343
6343
|
}, f.tsParseEntityName = function(s) {
|
|
6344
6344
|
s === void 0 && (s = !0);
|
|
6345
6345
|
for (var a = this.parseIdent(s); this.eat(o.dot); ) {
|
|
6346
|
-
var
|
|
6347
|
-
|
|
6346
|
+
var h = this.startNodeAtNode(a);
|
|
6347
|
+
h.left = a, h.right = this.parseIdent(s), a = this.finishNode(h, "TSQualifiedName");
|
|
6348
6348
|
}
|
|
6349
6349
|
return a;
|
|
6350
6350
|
}, f.tsParseEnumMember = function() {
|
|
@@ -6364,13 +6364,13 @@ function jh(e) {
|
|
|
6364
6364
|
}, f.tsTryParseDeclare = function(s) {
|
|
6365
6365
|
var a = this;
|
|
6366
6366
|
if (!this.isLineTerminator()) {
|
|
6367
|
-
var
|
|
6368
|
-
return this.isContextual("let") && (p = o._var,
|
|
6367
|
+
var h, p = this.type;
|
|
6368
|
+
return this.isContextual("let") && (p = o._var, h = "let"), this.tsInAmbientContext(function() {
|
|
6369
6369
|
if (p === o._function) return s.declare = !0, a.parseFunctionStatement(s, !1, !0);
|
|
6370
6370
|
if (p === o._class) return s.declare = !0, a.parseClass(s, !0);
|
|
6371
6371
|
if (p === D.enum) return a.tsParseEnumDeclaration(s, { declare: !0 });
|
|
6372
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,
|
|
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, h || a.value, !0));
|
|
6374
6374
|
if (p === D.interface) {
|
|
6375
6375
|
var m = a.tsParseInterfaceDeclaration(s, { declare: !0 });
|
|
6376
6376
|
if (m) return m;
|
|
@@ -6390,27 +6390,27 @@ function jh(e) {
|
|
|
6390
6390
|
case "TypeParametersOrArguments":
|
|
6391
6391
|
return this.tsMatchRightRelational();
|
|
6392
6392
|
}
|
|
6393
|
-
}, f.tsParseDelimitedListWorker = function(s, a,
|
|
6393
|
+
}, f.tsParseDelimitedListWorker = function(s, a, h, p) {
|
|
6394
6394
|
for (var m = [], v = -1; !this.tsIsListTerminator(s); ) {
|
|
6395
6395
|
v = -1;
|
|
6396
6396
|
var x = a();
|
|
6397
6397
|
if (x == null) return;
|
|
6398
6398
|
if (m.push(x), !this.eat(o.comma)) {
|
|
6399
6399
|
if (this.tsIsListTerminator(s)) break;
|
|
6400
|
-
return void (
|
|
6400
|
+
return void (h && this.expect(o.comma));
|
|
6401
6401
|
}
|
|
6402
6402
|
v = this.lastTokStart;
|
|
6403
6403
|
}
|
|
6404
6404
|
return p && (p.value = v), m;
|
|
6405
|
-
}, f.tsParseDelimitedList = function(s, a,
|
|
6405
|
+
}, f.tsParseDelimitedList = function(s, a, h) {
|
|
6406
6406
|
return (function(p) {
|
|
6407
6407
|
if (p == null) throw new Error("Unexpected " + p + " value.");
|
|
6408
6408
|
return p;
|
|
6409
|
-
})(this.tsParseDelimitedListWorker(s, a, !0,
|
|
6410
|
-
}, f.tsParseBracketedList = function(s, a,
|
|
6411
|
-
p || this.expect(
|
|
6409
|
+
})(this.tsParseDelimitedListWorker(s, a, !0, h));
|
|
6410
|
+
}, f.tsParseBracketedList = function(s, a, h, p, m) {
|
|
6411
|
+
p || this.expect(h ? o.bracketL : o.relational);
|
|
6412
6412
|
var v = this.tsParseDelimitedList(s, a, m);
|
|
6413
|
-
return this.expect(
|
|
6413
|
+
return this.expect(h ? o.bracketR : o.relational), v;
|
|
6414
6414
|
}, f.tsParseTypeParameterName = function() {
|
|
6415
6415
|
return this.parseIdent().name;
|
|
6416
6416
|
}, f.tsEatThenParseType = function(s) {
|
|
@@ -6471,9 +6471,9 @@ function jh(e) {
|
|
|
6471
6471
|
var s = this.startNode();
|
|
6472
6472
|
return this.next(), this.finishNode(s, "TSThisType");
|
|
6473
6473
|
}, f.tsParseTypeAnnotation = function(s, a) {
|
|
6474
|
-
var
|
|
6474
|
+
var h = this;
|
|
6475
6475
|
return s === void 0 && (s = !0), a === void 0 && (a = this.startNode()), this.tsInType(function() {
|
|
6476
|
-
s &&
|
|
6476
|
+
s && h.expect(o.colon), a.typeAnnotation = h.tsParseType();
|
|
6477
6477
|
}), this.finishNode(a, "TSTypeAnnotation");
|
|
6478
6478
|
}, f.tsParseThisTypePredicate = function(s) {
|
|
6479
6479
|
this.next();
|
|
@@ -6488,36 +6488,36 @@ function jh(e) {
|
|
|
6488
6488
|
}, f.tsParseTypeOrTypePredicateAnnotation = function(s) {
|
|
6489
6489
|
var a = this;
|
|
6490
6490
|
return this.tsInType(function() {
|
|
6491
|
-
var
|
|
6491
|
+
var h = a.startNode();
|
|
6492
6492
|
a.expect(s);
|
|
6493
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" ? (p.parameterName = v, p.asserts = !0, p.typeAnnotation = null, v = a.finishNode(p, "TSTypePredicate")) : (a.resetStartLocationFromNode(v, p), v.asserts = !0),
|
|
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), h.typeAnnotation = v, a.finishNode(h, "TSTypeAnnotation");
|
|
6497
6497
|
}
|
|
6498
6498
|
var x = a.tsIsIdentifier() && a.tsTryParse(a.tsParseTypePredicatePrefix.bind(a));
|
|
6499
|
-
if (!x) return m ? (p.parameterName = a.parseIdent(), p.asserts = m, p.typeAnnotation = null,
|
|
6499
|
+
if (!x) return m ? (p.parameterName = a.parseIdent(), p.asserts = m, p.typeAnnotation = null, h.typeAnnotation = a.finishNode(p, "TSTypePredicate"), a.finishNode(h, "TSTypeAnnotation")) : a.tsParseTypeAnnotation(!1, h);
|
|
6500
6500
|
var g = a.tsParseTypeAnnotation(!1);
|
|
6501
|
-
return p.parameterName = x, p.typeAnnotation = g, p.asserts = m,
|
|
6501
|
+
return p.parameterName = x, p.typeAnnotation = g, p.asserts = m, h.typeAnnotation = a.finishNode(p, "TSTypePredicate"), a.finishNode(h, "TSTypeAnnotation");
|
|
6502
6502
|
});
|
|
6503
6503
|
}, f.tsFillSignature = function(s, a) {
|
|
6504
|
-
var
|
|
6505
|
-
a.typeParameters = this.tsTryParseTypeParameters(), this.expect(o.parenL), a.parameters = this.tsParseBindingListForSignature(), (
|
|
6504
|
+
var h = s === o.arrow;
|
|
6505
|
+
a.typeParameters = this.tsTryParseTypeParameters(), this.expect(o.parenL), a.parameters = this.tsParseBindingListForSignature(), (h || this.match(s)) && (a.typeAnnotation = this.tsParseTypeOrTypePredicateAnnotation(s));
|
|
6506
6506
|
}, f.tsTryNextParseConstantContext = function() {
|
|
6507
6507
|
if (this.lookahead().type !== o._const) return null;
|
|
6508
6508
|
this.next();
|
|
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
|
|
6512
|
+
var h = this, p = this.startNode();
|
|
6513
6513
|
return s === "TSConstructorType" && (p.abstract = !!a, a && this.next(), this.next()), this.tsInAllowConditionalTypesContext(function() {
|
|
6514
|
-
return
|
|
6514
|
+
return h.tsFillSignature(o.arrow, p);
|
|
6515
6515
|
}), this.finishNode(p, s);
|
|
6516
|
-
}, f.tsParseUnionOrIntersectionType = function(s, a,
|
|
6517
|
-
var p = this.startNode(), m = this.eat(
|
|
6516
|
+
}, f.tsParseUnionOrIntersectionType = function(s, a, h) {
|
|
6517
|
+
var p = this.startNode(), m = this.eat(h), v = [];
|
|
6518
6518
|
do
|
|
6519
6519
|
v.push(a());
|
|
6520
|
-
while (this.eat(
|
|
6520
|
+
while (this.eat(h));
|
|
6521
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) {
|
|
@@ -6541,10 +6541,10 @@ function jh(e) {
|
|
|
6541
6541
|
}, f.tsParseInferType = function() {
|
|
6542
6542
|
var s = this, a = this.startNode();
|
|
6543
6543
|
this.expectContextual("infer");
|
|
6544
|
-
var
|
|
6545
|
-
return
|
|
6544
|
+
var h = this.startNode();
|
|
6545
|
+
return h.name = this.tsParseTypeParameterName(), h.constraint = this.tsTryParse(function() {
|
|
6546
6546
|
return s.tsParseConstraintForInferType();
|
|
6547
|
-
}), a.typeParameter = this.finishNode(
|
|
6547
|
+
}), a.typeParameter = this.finishNode(h, "TSTypeParameter"), this.finishNode(a, "TSInferType");
|
|
6548
6548
|
}, f.tsParseLiteralTypeNode = function() {
|
|
6549
6549
|
var s = this, a = this.startNode();
|
|
6550
6550
|
return a.literal = (function() {
|
|
@@ -6574,7 +6574,7 @@ 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,
|
|
6577
|
+
var s = this.startLoc, a = this.start, h = this.eat(o.ellipsis), p = this.tsParseType(), m = this.eat(o.question);
|
|
6578
6578
|
if (this.eat(o.colon)) {
|
|
6579
6579
|
var v = this.startNodeAtNode(p);
|
|
6580
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");
|
|
@@ -6582,7 +6582,7 @@ function jh(e) {
|
|
|
6582
6582
|
var x = this.startNodeAtNode(p);
|
|
6583
6583
|
x.typeAnnotation = p, p = this.finishNode(x, "TSOptionalType");
|
|
6584
6584
|
}
|
|
6585
|
-
if (
|
|
6585
|
+
if (h) {
|
|
6586
6586
|
var g = this.startNodeAt(a, s);
|
|
6587
6587
|
g.typeAnnotation = p, p = this.finishNode(g, "TSRestType");
|
|
6588
6588
|
}
|
|
@@ -6590,10 +6590,10 @@ function jh(e) {
|
|
|
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
|
|
6593
|
+
var h = !1, p = null;
|
|
6594
6594
|
return a.elementTypes.forEach(function(m) {
|
|
6595
6595
|
var v = m.type;
|
|
6596
|
-
!
|
|
6596
|
+
!h || v === "TSRestType" || v === "TSOptionalType" || v === "TSNamedTupleMember" && m.optional || s.raise(m.start, N.OptionalTypeBeforeRequired), h || (h = 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";
|
|
@@ -6643,7 +6643,7 @@ function jh(e) {
|
|
|
6643
6643
|
default:
|
|
6644
6644
|
var a = this.type;
|
|
6645
6645
|
if (q(a) || a === o._void || a === o._null) {
|
|
6646
|
-
var
|
|
6646
|
+
var h = a === o._void ? "TSVoidKeyword" : a === o._null ? "TSNullKeyword" : (function(m) {
|
|
6647
6647
|
switch (m) {
|
|
6648
6648
|
case "any":
|
|
6649
6649
|
return "TSAnyKeyword";
|
|
@@ -6669,9 +6669,9 @@ function jh(e) {
|
|
|
6669
6669
|
return;
|
|
6670
6670
|
}
|
|
6671
6671
|
})(this.value);
|
|
6672
|
-
if (
|
|
6672
|
+
if (h !== void 0 && this.lookaheadCharCode() !== 46) {
|
|
6673
6673
|
var p = this.startNode();
|
|
6674
|
-
return this.next(), this.finishNode(p,
|
|
6674
|
+
return this.next(), this.finishNode(p, h);
|
|
6675
6675
|
}
|
|
6676
6676
|
return this.tsParseTypeReference();
|
|
6677
6677
|
}
|
|
@@ -6682,8 +6682,8 @@ function jh(e) {
|
|
|
6682
6682
|
var a = this.startNodeAtNode(s);
|
|
6683
6683
|
a.elementType = s, this.expect(o.bracketR), s = this.finishNode(a, "TSArrayType");
|
|
6684
6684
|
} else {
|
|
6685
|
-
var
|
|
6686
|
-
|
|
6685
|
+
var h = this.startNodeAtNode(s);
|
|
6686
|
+
h.objectType = s, h.indexType = this.tsParseType(), this.expect(o.bracketR), s = this.finishNode(h, "TSIndexedAccessType");
|
|
6687
6687
|
}
|
|
6688
6688
|
return s;
|
|
6689
6689
|
}, f.tsParseTypeOperatorOrHigher = function() {
|
|
@@ -6702,14 +6702,14 @@ function jh(e) {
|
|
|
6702
6702
|
gr(this.inType);
|
|
6703
6703
|
var a = this.tsParseNonConditionalType();
|
|
6704
6704
|
if (this.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(o._extends)) return a;
|
|
6705
|
-
var
|
|
6706
|
-
return
|
|
6705
|
+
var h = this.startNodeAtNode(a);
|
|
6706
|
+
return h.checkType = a, h.extendsType = this.tsInDisallowConditionalTypesContext(function() {
|
|
6707
6707
|
return s.tsParseNonConditionalType();
|
|
6708
|
-
}), this.expect(o.question),
|
|
6708
|
+
}), this.expect(o.question), h.trueType = this.tsInAllowConditionalTypesContext(function() {
|
|
6709
6709
|
return s.tsParseType();
|
|
6710
|
-
}), this.expect(o.colon),
|
|
6710
|
+
}), this.expect(o.colon), h.falseType = this.tsInAllowConditionalTypesContext(function() {
|
|
6711
6711
|
return s.tsParseType();
|
|
6712
|
-
}), this.finishNode(
|
|
6712
|
+
}), this.finishNode(h, "TSConditionalType");
|
|
6713
6713
|
}, f.tsIsUnambiguouslyIndexSignature = function() {
|
|
6714
6714
|
return this.next(), !!q(this.type) && (this.next(), this.match(o.colon));
|
|
6715
6715
|
}, f.tsInType = function(s) {
|
|
@@ -6725,8 +6725,8 @@ function jh(e) {
|
|
|
6725
6725
|
this.expect(o.bracketL);
|
|
6726
6726
|
var a = this.parseIdent();
|
|
6727
6727
|
a.typeAnnotation = this.tsParseTypeAnnotation(), this.resetEndLocation(a), this.expect(o.bracketR), s.parameters = [a];
|
|
6728
|
-
var
|
|
6729
|
-
return
|
|
6728
|
+
var h = this.tsTryParseTypeAnnotation();
|
|
6729
|
+
return h && (s.typeAnnotation = h), this.tsParseTypeMemberSemicolon(), this.finishNode(s, "TSIndexSignature");
|
|
6730
6730
|
}
|
|
6731
6731
|
}, f.tsParseNoneModifiers = function(s) {
|
|
6732
6732
|
this.tsParseModifiers({ modified: s, allowedModifiers: [], disallowedModifiers: ["in", "out"], errorTemplate: N.InvalidModifierOnTypeParameterPositions });
|
|
@@ -6737,39 +6737,39 @@ function jh(e) {
|
|
|
6737
6737
|
}, f.tsParseTypeParameters = function(s) {
|
|
6738
6738
|
var a = this.startNode();
|
|
6739
6739
|
this.tsMatchLeftRelational() || this.matchJsx("jsxTagStart") ? this.next() : this.unexpected();
|
|
6740
|
-
var
|
|
6741
|
-
return a.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, s), !1, !0,
|
|
6740
|
+
var h = { value: -1 };
|
|
6741
|
+
return a.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, s), !1, !0, h), a.params.length === 0 && this.raise(this.start, N.EmptyTypeParameters), h.value !== -1 && this.addExtra(a, "trailingComma", h.value), this.finishNode(a, "TSTypeParameterDeclaration");
|
|
6742
6742
|
}, f.tsTryParseTypeParameters = function(s) {
|
|
6743
6743
|
if (this.tsMatchLeftRelational()) return this.tsParseTypeParameters(s);
|
|
6744
6744
|
}, f.tsTryParse = function(s) {
|
|
6745
|
-
var a = this.getCurLookaheadState(),
|
|
6746
|
-
return
|
|
6745
|
+
var a = this.getCurLookaheadState(), h = s();
|
|
6746
|
+
return h !== void 0 && h !== !1 ? h : void this.setLookaheadState(a);
|
|
6747
6747
|
}, f.tsTokenCanFollowModifier = function() {
|
|
6748
6748
|
return (this.match(o.bracketL) || this.match(o.braceL) || this.match(o.star) || this.match(o.ellipsis) || this.match(o.privateId) || this.isLiteralPropertyName()) && !this.hasPrecedingLineBreak();
|
|
6749
6749
|
}, f.tsNextTokenCanFollowModifier = function() {
|
|
6750
6750
|
return this.next(!0), this.tsTokenCanFollowModifier();
|
|
6751
6751
|
}, f.tsParseModifier = function(s, a) {
|
|
6752
6752
|
if (q(this.type) || this.type === o._in) {
|
|
6753
|
-
var
|
|
6754
|
-
if (s.indexOf(
|
|
6753
|
+
var h = this.value;
|
|
6754
|
+
if (s.indexOf(h) !== -1 && !this.containsEsc) {
|
|
6755
6755
|
if (a && this.tsIsStartOfStaticBlocks()) return;
|
|
6756
|
-
if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) return
|
|
6756
|
+
if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) return h;
|
|
6757
6757
|
}
|
|
6758
6758
|
}
|
|
6759
6759
|
}, f.tsParseModifiersByMap = function(s) {
|
|
6760
|
-
for (var a = s.modified,
|
|
6760
|
+
for (var a = s.modified, h = s.map, p = 0, m = Object.keys(h); p < m.length; p++) {
|
|
6761
6761
|
var v = m[p];
|
|
6762
|
-
a[v] =
|
|
6762
|
+
a[v] = h[v];
|
|
6763
6763
|
}
|
|
6764
6764
|
}, f.tsParseModifiers = function(s) {
|
|
6765
|
-
for (var a = this,
|
|
6766
|
-
W === X &&
|
|
6765
|
+
for (var a = this, h = s.modified, p = s.allowedModifiers, m = s.disallowedModifiers, v = s.stopOnStartOfClassStaticBlock, x = s.errorTemplate, g = x === void 0 ? N.InvalidModifierOnTypeMember : x, _ = {}, T = function(G, W, X, ie) {
|
|
6766
|
+
W === X && h[ie] && a.raise(G.column, N.InvalidModifiersOrder({ orderedModifiers: [X, ie] }));
|
|
6767
6767
|
}, L = function(G, W, X, ie) {
|
|
6768
|
-
(
|
|
6768
|
+
(h[X] && W === ie || h[ie] && W === X) && a.raise(G.column, N.IncompatibleModifiers({ modifiers: [X, ie] }));
|
|
6769
6769
|
}; ; ) {
|
|
6770
6770
|
var V = this.startLoc, E = this.tsParseModifier(p.concat(m ?? []), v);
|
|
6771
6771
|
if (!E) break;
|
|
6772
|
-
br(E) ?
|
|
6772
|
+
br(E) ? h.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, h.accessibility = E) : Vh(E) ? h[E] ? this.raise(this.start, N.DuplicateModifier({ modifier: E })) : (T(V, E, "in", "out"), _[E] = E, h[E] = !0) : Mh(E) ? h[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, h[E] = !0) : Object.hasOwnProperty.call(h, 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, h[E] = !0), m != null && m.includes(E) && this.raise(this.start, g);
|
|
6773
6773
|
}
|
|
6774
6774
|
return _;
|
|
6775
6775
|
}, f.tsParseInOutModifiers = function(s) {
|
|
@@ -6782,26 +6782,26 @@ 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,
|
|
6785
|
+
var a = this, h = 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 p.length || this.raise(
|
|
6789
|
+
return p.length || this.raise(h, 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) {
|
|
6793
|
-
var a = this.tryParse(function(
|
|
6794
|
-
return s() ||
|
|
6793
|
+
var a = this.tryParse(function(h) {
|
|
6794
|
+
return s() || h();
|
|
6795
6795
|
});
|
|
6796
6796
|
if (!a.aborted && a.node) return a.error && this.setLookaheadState(a.failState), a.node;
|
|
6797
6797
|
}, f.tsParseSignatureMember = function(s, a) {
|
|
6798
6798
|
return this.tsFillSignature(o.colon, a), this.tsParseTypeMemberSemicolon(), this.finishNode(a, s);
|
|
6799
6799
|
}, f.tsParsePropertyOrMethodSignature = function(s, a) {
|
|
6800
6800
|
this.eat(o.question) && (s.optional = !0);
|
|
6801
|
-
var
|
|
6801
|
+
var h = s;
|
|
6802
6802
|
if (this.match(o.parenL) || this.tsMatchLeftRelational()) {
|
|
6803
6803
|
a && this.raise(s.start, N.ReadonlyForMethodSignature);
|
|
6804
|
-
var p =
|
|
6804
|
+
var p = h;
|
|
6805
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
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));
|
|
@@ -6815,7 +6815,7 @@ function jh(e) {
|
|
|
6815
6815
|
} else p.kind = "method";
|
|
6816
6816
|
return this.finishNode(p, "TSMethodSignature");
|
|
6817
6817
|
}
|
|
6818
|
-
var g =
|
|
6818
|
+
var g = h;
|
|
6819
6819
|
a && (g.readonly = !0);
|
|
6820
6820
|
var _ = this.tsTryParseTypeAnnotation();
|
|
6821
6821
|
return _ && (g.typeAnnotation = _), this.tsParseTypeMemberSemicolon(), this.finishNode(g, "TSPropertySignature");
|
|
@@ -6828,8 +6828,8 @@ function jh(e) {
|
|
|
6828
6828
|
}
|
|
6829
6829
|
return this.tsParseModifiers({ modified: s, allowedModifiers: ["readonly"], disallowedModifiers: ["declare", "abstract", "private", "protected", "public", "static", "override"] }), this.tsTryParseIndexSignature(s) || (this.parsePropertyName(s), s.computed || s.key.type !== "Identifier" || s.key.name !== "get" && s.key.name !== "set" || !this.tsTokenCanFollowModifier() || (s.kind = s.key.name, this.parsePropertyName(s)), this.tsParsePropertyOrMethodSignature(s, !!s.readonly));
|
|
6830
6830
|
}, f.tsParseList = function(s, a) {
|
|
6831
|
-
for (var
|
|
6832
|
-
return
|
|
6831
|
+
for (var h = []; !this.tsIsListTerminator(s); ) h.push(a());
|
|
6832
|
+
return h;
|
|
6833
6833
|
}, f.tsParseObjectTypeMembers = function() {
|
|
6834
6834
|
this.expect(o.braceL);
|
|
6835
6835
|
var s = this.tsParseList("TypeMembers", this.tsParseTypeMember.bind(this));
|
|
@@ -6837,8 +6837,8 @@ function jh(e) {
|
|
|
6837
6837
|
}, f.tsParseInterfaceDeclaration = function(s, a) {
|
|
6838
6838
|
if (a === void 0 && (a = {}), this.hasFollowingLineBreak()) return null;
|
|
6839
6839
|
this.expectContextual("interface"), a.declare && (s.declare = !0), q(this.type) ? (s.id = this.parseIdent(), this.checkLValSimple(s.id, 7)) : (s.id = null, this.raise(this.start, N.MissingInterfaceName)), s.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this)), this.eat(o._extends) && (s.extends = this.tsParseHeritageClause("extends"));
|
|
6840
|
-
var
|
|
6841
|
-
return
|
|
6840
|
+
var h = this.startNode();
|
|
6841
|
+
return h.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), s.body = this.finishNode(h, "TSInterfaceBody"), this.finishNode(s, "TSInterfaceDeclaration");
|
|
6842
6842
|
}, f.tsParseAbstractDeclaration = function(s) {
|
|
6843
6843
|
if (this.match(o._class)) return s.abstract = !0, this.parseClass(s, !0);
|
|
6844
6844
|
if (this.ts_isContextual(D.interface)) {
|
|
@@ -6849,8 +6849,8 @@ function jh(e) {
|
|
|
6849
6849
|
}, f.tsParseExpressionStatement = function(s, a) {
|
|
6850
6850
|
switch (a.name) {
|
|
6851
6851
|
case "declare":
|
|
6852
|
-
var
|
|
6853
|
-
if (
|
|
6852
|
+
var h = this.tsTryParseDeclare(s);
|
|
6853
|
+
if (h) return h.declare = !0, h;
|
|
6854
6854
|
break;
|
|
6855
6855
|
case "global":
|
|
6856
6856
|
if (this.match(o.braceL)) {
|
|
@@ -6865,9 +6865,9 @@ function jh(e) {
|
|
|
6865
6865
|
}, f.tsParseModuleReference = function() {
|
|
6866
6866
|
return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(!1);
|
|
6867
6867
|
}, f.tsIsExportDefaultSpecifier = function() {
|
|
6868
|
-
var s = this.type, a = this.isAsyncFunction(),
|
|
6868
|
+
var s = this.type, a = this.isAsyncFunction(), h = this.isLet();
|
|
6869
6869
|
if (q(s)) {
|
|
6870
|
-
if (a && !this.containsEsc ||
|
|
6870
|
+
if (a && !this.containsEsc || h) return !1;
|
|
6871
6871
|
if ((s === D.type || s === D.interface) && !this.containsEsc) {
|
|
6872
6872
|
var p = this.lookahead();
|
|
6873
6873
|
if (q(p.type) && !this.isContextualWithState("from", p) || p.type === o.braceL) return !1;
|
|
@@ -6892,44 +6892,44 @@ function jh(e) {
|
|
|
6892
6892
|
return s ? !this.hasFollowingLineBreak() && (this.next(), !0) : !this.isLineTerminator();
|
|
6893
6893
|
}, f.tsParseModuleOrNamespaceDeclaration = function(s, a) {
|
|
6894
6894
|
if (a === void 0 && (a = !1), s.id = this.parseIdent(), a || this.checkLValSimple(s.id, 8), this.eat(o.dot)) {
|
|
6895
|
-
var
|
|
6896
|
-
this.tsParseModuleOrNamespaceDeclaration(
|
|
6895
|
+
var h = this.startNode();
|
|
6896
|
+
this.tsParseModuleOrNamespaceDeclaration(h, !0), s.body = h;
|
|
6897
6897
|
} else P.prototype.enterScope.call(this, yt), s.body = this.tsParseModuleBlock(), P.prototype.exitScope.call(this);
|
|
6898
6898
|
return this.finishNode(s, "TSModuleDeclaration");
|
|
6899
|
-
}, f.checkLValSimple = function(s, a,
|
|
6900
|
-
return a === void 0 && (a = 0), P.prototype.checkLValSimple.call(this, s, a,
|
|
6899
|
+
}, f.checkLValSimple = function(s, a, h) {
|
|
6900
|
+
return a === void 0 && (a = 0), P.prototype.checkLValSimple.call(this, s, a, h);
|
|
6901
6901
|
}, f.tsParseTypeAliasDeclaration = function(s) {
|
|
6902
6902
|
var a = this;
|
|
6903
6903
|
return s.id = this.parseIdent(), this.checkLValSimple(s.id, 6), s.typeAnnotation = this.tsInType(function() {
|
|
6904
6904
|
if (s.typeParameters = a.tsTryParseTypeParameters(a.tsParseInOutModifiers.bind(a)), a.expect(o.eq), a.ts_isContextual(D.interface) && a.lookahead().type !== o.dot) {
|
|
6905
|
-
var
|
|
6906
|
-
return a.next(), a.finishNode(
|
|
6905
|
+
var h = a.startNode();
|
|
6906
|
+
return a.next(), a.finishNode(h, "TSIntrinsicKeyword");
|
|
6907
6907
|
}
|
|
6908
6908
|
return a.tsParseType();
|
|
6909
6909
|
}), this.semicolon(), this.finishNode(s, "TSTypeAliasDeclaration");
|
|
6910
|
-
}, f.tsParseDeclaration = function(s, a,
|
|
6910
|
+
}, f.tsParseDeclaration = function(s, a, h) {
|
|
6911
6911
|
switch (a) {
|
|
6912
6912
|
case "abstract":
|
|
6913
|
-
if (this.tsCheckLineTerminator(
|
|
6913
|
+
if (this.tsCheckLineTerminator(h) && (this.match(o._class) || q(this.type))) return this.tsParseAbstractDeclaration(s);
|
|
6914
6914
|
break;
|
|
6915
6915
|
case "module":
|
|
6916
|
-
if (this.tsCheckLineTerminator(
|
|
6916
|
+
if (this.tsCheckLineTerminator(h)) {
|
|
6917
6917
|
if (this.match(o.string)) return this.tsParseAmbientExternalModuleDeclaration(s);
|
|
6918
6918
|
if (q(this.type)) return this.tsParseModuleOrNamespaceDeclaration(s);
|
|
6919
6919
|
}
|
|
6920
6920
|
break;
|
|
6921
6921
|
case "namespace":
|
|
6922
|
-
if (this.tsCheckLineTerminator(
|
|
6922
|
+
if (this.tsCheckLineTerminator(h) && q(this.type)) return this.tsParseModuleOrNamespaceDeclaration(s);
|
|
6923
6923
|
break;
|
|
6924
6924
|
case "type":
|
|
6925
|
-
if (this.tsCheckLineTerminator(
|
|
6925
|
+
if (this.tsCheckLineTerminator(h) && q(this.type)) return this.tsParseTypeAliasDeclaration(s);
|
|
6926
6926
|
}
|
|
6927
6927
|
}, f.tsTryParseExportDeclaration = function() {
|
|
6928
6928
|
return this.tsParseDeclaration(this.startNode(), this.value, !0);
|
|
6929
6929
|
}, f.tsParseImportEqualsDeclaration = function(s, a) {
|
|
6930
6930
|
s.isExport = a || !1, s.id = this.parseIdent(), this.checkLValSimple(s.id, 2), P.prototype.expect.call(this, o.eq);
|
|
6931
|
-
var
|
|
6932
|
-
return s.importKind === "type" &&
|
|
6931
|
+
var h = this.tsParseModuleReference();
|
|
6932
|
+
return s.importKind === "type" && h.type !== "TSExternalModuleReference" && this.raise(h.start, N.ImportAliasHasImportType), s.moduleReference = h, P.prototype.semicolon.call(this), this.finishNode(s, "TSImportEqualsDeclaration");
|
|
6933
6933
|
}, f.isExportDefaultSpecifier = function() {
|
|
6934
6934
|
if (this.tsIsDeclarationStart()) return !1;
|
|
6935
6935
|
var s = this.type;
|
|
@@ -6940,35 +6940,35 @@ 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
|
|
6944
|
-
if (this.input.charCodeAt(
|
|
6943
|
+
var h = this.nextTokenStart(), p = this.isUnparsedContextual(h, "from");
|
|
6944
|
+
if (this.input.charCodeAt(h) === 44 || q(this.type) && p) return !0;
|
|
6945
6945
|
if (this.match(o._default) && p) {
|
|
6946
|
-
var m = this.input.charCodeAt(this.nextTokenStartSince(
|
|
6946
|
+
var m = this.input.charCodeAt(this.nextTokenStartSince(h + 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,
|
|
6951
|
+
var a = (s === void 0 ? {} : s).isTagged, h = a !== void 0 && a, p = this.startNode();
|
|
6952
6952
|
this.next(), p.expressions = [];
|
|
6953
|
-
var m = this.parseTemplateElement({ isTagged:
|
|
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:
|
|
6953
|
+
var m = this.parseTemplateElement({ isTagged: h });
|
|
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: h }));
|
|
6955
6955
|
return this.next(), this.finishNode(p, "TemplateLiteral");
|
|
6956
|
-
}, f.parseFunction = function(s, a,
|
|
6956
|
+
}, f.parseFunction = function(s, a, h, p, m) {
|
|
6957
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
|
-
return this.parseFunctionBody(s,
|
|
6962
|
-
}, f.parseFunctionBody = function(s, a,
|
|
6963
|
-
a === void 0 && (a = !1),
|
|
6961
|
+
return this.parseFunctionBody(s, h, !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, h, p, m) {
|
|
6963
|
+
a === void 0 && (a = !1), h === void 0 && (h = !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,
|
|
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, h, !1), this.finishNode(s, v)) : (P.prototype.parseFunctionBody.call(this, s, a, h, 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
|
-
var a = this.startNode(),
|
|
6969
|
+
var a = this.startNode(), h = this.parseIdent(!0);
|
|
6970
6970
|
if (this.options.ecmaVersion >= 6 && this.eat(o.dot)) {
|
|
6971
|
-
a.meta =
|
|
6971
|
+
a.meta = h;
|
|
6972
6972
|
var p = this.containsEsc;
|
|
6973
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
|
}
|
|
@@ -6976,15 +6976,15 @@ function jh(e) {
|
|
|
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,
|
|
6979
|
+
}, f.parseExprOp = function(s, a, h, p, m) {
|
|
6980
6980
|
var v;
|
|
6981
6981
|
if (o._in.binop > p && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (v = "TSAsExpression"), u && this.isContextual("satisfies") && (v = "TSSatisfiesExpression"), v)) {
|
|
6982
|
-
var x = this.startNodeAt(a,
|
|
6982
|
+
var x = this.startNodeAt(a, h);
|
|
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,
|
|
6985
|
+
return x.typeAnnotation = g || this.tsNextThenParseType(), this.finishNode(x, v), this.reScan_lt_gt(), this.parseExprOp(x, a, h, p, m);
|
|
6986
6986
|
}
|
|
6987
|
-
return P.prototype.parseExprOp.call(this, s, a,
|
|
6987
|
+
return P.prototype.parseExprOp.call(this, s, a, h, 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;
|
|
@@ -6998,8 +6998,8 @@ function jh(e) {
|
|
|
6998
6998
|
}, f.parseImport = function(s) {
|
|
6999
6999
|
var a = this.lookahead();
|
|
7000
7000
|
if (s.importKind = "value", this.importOrExportOuterKind = "value", q(a.type) || this.match(o.star) || this.match(o.braceL)) {
|
|
7001
|
-
var
|
|
7002
|
-
if (
|
|
7001
|
+
var h = this.lookahead(2);
|
|
7002
|
+
if (h.type !== o.comma && !this.isContextualWithState("from", h) && h.type !== o.eq && this.ts_eatContextualWithState("type", 1, a) && (this.importOrExportOuterKind = "type", s.importKind = "type", a = this.lookahead(), h = this.lookahead(2)), q(a.type) && h.type === o.eq) {
|
|
7003
7003
|
this.next();
|
|
7004
7004
|
var p = this.tsParseImportEqualsDeclaration(s);
|
|
7005
7005
|
return this.importOrExportOuterKind = "value", p;
|
|
@@ -7024,26 +7024,26 @@ function jh(e) {
|
|
|
7024
7024
|
s.arguments = [a];
|
|
7025
7025
|
}
|
|
7026
7026
|
if (!this.eat(o.parenR)) {
|
|
7027
|
-
var
|
|
7028
|
-
this.eat(o.comma) && this.eat(o.parenR) ? this.raiseRecoverable(
|
|
7027
|
+
var h = this.start;
|
|
7028
|
+
this.eat(o.comma) && this.eat(o.parenR) ? this.raiseRecoverable(h, "Trailing comma is not allowed in import()") : this.unexpected(h);
|
|
7029
7029
|
}
|
|
7030
7030
|
return this.finishNode(s, "ImportExpression");
|
|
7031
7031
|
}, f.parseExport = function(s, a) {
|
|
7032
|
-
var
|
|
7033
|
-
if (this.ts_eatWithState(o._import, 2,
|
|
7032
|
+
var h = this.lookahead();
|
|
7033
|
+
if (this.ts_eatWithState(o._import, 2, h)) {
|
|
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
7035
|
var p = this.tsParseImportEqualsDeclaration(s, !0);
|
|
7036
7036
|
return this.importOrExportOuterKind = void 0, p;
|
|
7037
7037
|
}
|
|
7038
|
-
if (this.ts_eatWithState(o.eq, 2,
|
|
7038
|
+
if (this.ts_eatWithState(o.eq, 2, h)) {
|
|
7039
7039
|
var m = s;
|
|
7040
7040
|
return m.expression = this.parseExpression(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(m, "TSExportAssignment");
|
|
7041
7041
|
}
|
|
7042
|
-
if (this.ts_eatContextualWithState("as", 2,
|
|
7042
|
+
if (this.ts_eatContextualWithState("as", 2, h)) {
|
|
7043
7043
|
var v = s;
|
|
7044
7044
|
return this.expectContextual("namespace"), v.id = this.parseIdent(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(v, "TSNamespaceExportDeclaration");
|
|
7045
7045
|
}
|
|
7046
|
-
if (this.ts_isContextualWithState(
|
|
7046
|
+
if (this.ts_isContextualWithState(h, D.type) && this.lookahead(2).type === o.braceL ? (this.next(), this.importOrExportOuterKind = "type", s.exportKind = "type") : (this.importOrExportOuterKind = "value", s.exportKind = "value"), this.next(), this.eat(o.star)) return this.parseExportAllDeclaration(s, a);
|
|
7047
7047
|
if (this.eat(o._default)) return this.checkExport(a, "default", this.lastTokStart), s.declaration = this.parseExportDefaultDeclaration(), this.finishNode(s, "ExportDefaultDeclaration");
|
|
7048
7048
|
if (this.shouldParseExportStatement()) s.declaration = this.parseExportDeclaration(s), s.declaration.type === "VariableDeclaration" ? this.checkVariableExport(a, s.declaration.declarations) : this.checkExport(a, s.declaration.id, s.declaration.id.start), s.specifiers = [], s.source = null;
|
|
7049
7049
|
else {
|
|
@@ -7058,21 +7058,21 @@ function jh(e) {
|
|
|
7058
7058
|
this.semicolon();
|
|
7059
7059
|
}
|
|
7060
7060
|
return this.finishNode(s, "ExportNamedDeclaration");
|
|
7061
|
-
}, f.checkExport = function(s, a,
|
|
7061
|
+
}, f.checkExport = function(s, a, h) {
|
|
7062
7062
|
s && (typeof a != "string" && (a = a.type === "Identifier" ? a.name : a.value), s[a] = !0);
|
|
7063
|
-
}, f.parseMaybeDefault = function(s, a,
|
|
7064
|
-
var p = P.prototype.parseMaybeDefault.call(this, s, a,
|
|
7063
|
+
}, f.parseMaybeDefault = function(s, a, h) {
|
|
7064
|
+
var p = P.prototype.parseMaybeDefault.call(this, s, a, h);
|
|
7065
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
|
-
for (var
|
|
7070
|
-
var p = s[
|
|
7071
|
-
p?.type === "TSTypeCastExpression" && (s[
|
|
7069
|
+
for (var h = 0; h < s.length; h++) {
|
|
7070
|
+
var p = s[h];
|
|
7071
|
+
p?.type === "TSTypeCastExpression" && (s[h] = this.typeCastToParameter(p));
|
|
7072
7072
|
}
|
|
7073
7073
|
return P.prototype.toAssignableList.call(this, s, a);
|
|
7074
7074
|
}, f.reportReservedArrowTypeParam = function(s) {
|
|
7075
|
-
}, f.parseExprAtom = function(s, a,
|
|
7075
|
+
}, f.parseExprAtom = function(s, a, h) {
|
|
7076
7076
|
if (this.type === D.jsxText) return this.jsx_parseText();
|
|
7077
7077
|
if (this.type === D.jsxTagStart) return this.jsx_parseElement();
|
|
7078
7078
|
if (this.type === D.at) return this.parseDecorators(), this.parseExprAtom();
|
|
@@ -7085,31 +7085,31 @@ function jh(e) {
|
|
|
7085
7085
|
}
|
|
7086
7086
|
return g;
|
|
7087
7087
|
}
|
|
7088
|
-
return P.prototype.parseExprAtom.call(this, s, a,
|
|
7088
|
+
return P.prototype.parseExprAtom.call(this, s, a, h);
|
|
7089
7089
|
}, f.parseExprAtomDefault = function() {
|
|
7090
7090
|
if (q(this.type)) {
|
|
7091
|
-
var s = this.potentialArrowAt === this.start, a = this.containsEsc,
|
|
7092
|
-
if (!a &&
|
|
7091
|
+
var s = this.potentialArrowAt === this.start, a = this.containsEsc, h = this.parseIdent();
|
|
7092
|
+
if (!a && h.name === "async" && !this.canInsertSemicolon()) {
|
|
7093
7093
|
var p = this.type;
|
|
7094
|
-
if (p === o._function) return this.next(), this.parseFunction(this.startNodeAtNode(
|
|
7094
|
+
if (p === o._function) return this.next(), this.parseFunction(this.startNodeAtNode(h), void 0, !0, !0);
|
|
7095
7095
|
if (q(p)) {
|
|
7096
7096
|
if (this.lookaheadCharCode() === 61) {
|
|
7097
7097
|
var m = this.parseIdent(!1);
|
|
7098
|
-
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(
|
|
7098
|
+
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(h), [m], !0);
|
|
7099
7099
|
}
|
|
7100
|
-
return
|
|
7100
|
+
return h;
|
|
7101
7101
|
}
|
|
7102
7102
|
}
|
|
7103
|
-
return s && this.match(o.arrow) && !this.canInsertSemicolon() ? (this.next(), this.parseArrowExpression(this.startNodeAtNode(
|
|
7103
|
+
return s && this.match(o.arrow) && !this.canInsertSemicolon() ? (this.next(), this.parseArrowExpression(this.startNodeAtNode(h), [h], !1)) : h;
|
|
7104
7104
|
}
|
|
7105
7105
|
this.unexpected();
|
|
7106
7106
|
}, f.parseIdentNode = function() {
|
|
7107
7107
|
var s = this.startNode();
|
|
7108
7108
|
return Ct(this.type) ? (s.name = this.value, s) : P.prototype.parseIdentNode.call(this);
|
|
7109
|
-
}, f.parseVarStatement = function(s, a,
|
|
7110
|
-
|
|
7109
|
+
}, f.parseVarStatement = function(s, a, h) {
|
|
7110
|
+
h === void 0 && (h = !1);
|
|
7111
7111
|
var p = this.isAmbientContext;
|
|
7112
|
-
this.next(), P.prototype.parseVar.call(this, s, !1, a,
|
|
7112
|
+
this.next(), P.prototype.parseVar.call(this, s, !1, a, h || p), this.semicolon();
|
|
7113
7113
|
var m = this.finishNode(s, "VariableDeclaration");
|
|
7114
7114
|
if (!p) return m;
|
|
7115
7115
|
for (var v, x = yr(m.declarations); !(v = x()).done; ) {
|
|
@@ -7117,7 +7117,7 @@ function jh(e) {
|
|
|
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));
|
|
7118
7118
|
}
|
|
7119
7119
|
return m;
|
|
7120
|
-
}, f.parseStatement = function(s, a,
|
|
7120
|
+
}, f.parseStatement = function(s, a, h) {
|
|
7121
7121
|
if (this.match(D.at) && this.parseDecorators(!0), this.match(o._const) && this.isLookaheadContextual("enum")) {
|
|
7122
7122
|
var p = this.startNode();
|
|
7123
7123
|
return this.expect(o._const), this.tsParseEnumDeclaration(p, { const: !0 });
|
|
@@ -7127,7 +7127,7 @@ function jh(e) {
|
|
|
7127
7127
|
var m = this.tsParseInterfaceDeclaration(this.startNode());
|
|
7128
7128
|
if (m) return m;
|
|
7129
7129
|
}
|
|
7130
|
-
return P.prototype.parseStatement.call(this, s, a,
|
|
7130
|
+
return P.prototype.parseStatement.call(this, s, a, h);
|
|
7131
7131
|
}, f.parseAccessModifier = function() {
|
|
7132
7132
|
return this.tsParseModifier(["public", "protected", "private"]);
|
|
7133
7133
|
}, f.parsePostMemberNameModifiers = function(s) {
|
|
@@ -7136,24 +7136,24 @@ 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,
|
|
7139
|
+
}, f.parseConditional = function(s, a, h, p, m) {
|
|
7140
7140
|
if (this.eat(o.question)) {
|
|
7141
|
-
var v = this.startNodeAt(a,
|
|
7141
|
+
var v = this.startNodeAt(a, h);
|
|
7142
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
|
|
7146
|
+
var h = this, p = this.start, m = this.startLoc, v = this.parseExprOps(s, a);
|
|
7147
7147
|
if (this.checkExpressionErrors(a)) return v;
|
|
7148
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
|
|
7150
|
+
return h.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
|
-
var a = this.start,
|
|
7154
|
+
var a = this.start, h = 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 p = this.startNodeAt(a,
|
|
7156
|
+
var p = this.startNodeAt(a, h);
|
|
7157
7157
|
return p.expression = s, p.typeAnnotation = this.tsParseTypeAnnotation(), this.finishNode(p, "TSTypeCastExpression");
|
|
7158
7158
|
}
|
|
7159
7159
|
return s;
|
|
@@ -7162,15 +7162,15 @@ 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
|
|
7165
|
+
var h = 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,
|
|
7168
|
+
return v ? ((v.type === "TSInterfaceDeclaration" || v.type === "TSTypeAliasDeclaration" || m) && (s.exportKind = "type"), m && (this.resetStartLocation(v, h, 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);
|
|
7172
|
-
var
|
|
7173
|
-
|
|
7172
|
+
var h = this.tsTryParseTypeParameters(this.tsParseInOutModifiers.bind(this));
|
|
7173
|
+
h && (s.typeParameters = h);
|
|
7174
7174
|
}
|
|
7175
7175
|
}, f.parseClassPropertyAnnotation = function(s) {
|
|
7176
7176
|
s.optional || (this.value === "!" && this.eat(o.prefix) ? s.definite = !0 : this.eat(o.question) && (s.optional = !0));
|
|
@@ -7183,27 +7183,27 @@ 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,
|
|
7186
|
+
}, f.parseClassMethod = function(s, a, h, 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
|
-
s.kind === "constructor" ? (a && this.raise(T.start, "Constructor can't be a generator"),
|
|
7193
|
-
var L = s.value = this.parseMethod(a,
|
|
7192
|
+
s.kind === "constructor" ? (a && this.raise(T.start, "Constructor can't be a generator"), h && 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, h, 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
|
|
7201
|
-
|
|
7200
|
+
var h, 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
|
+
h = !!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 =
|
|
7206
|
+
if (!a.inAbstractClass && m.abstract && a.raise(m.start, N.NonAbstractClassHasAbstractMethod), m.override && s && a.raise(m.start, N.OverrideNotInSubClass), m.static = h, h && (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 G = a.value;
|
|
7208
7208
|
(a.eatContextual("get") || a.eatContextual("set")) && (a.isClassElementNameStart() ? _ = G : v = G);
|
|
7209
7209
|
}
|
|
@@ -7225,15 +7225,15 @@ function jh(e) {
|
|
|
7225
7225
|
a && (s.typeParameters = a), P.prototype.parseFunctionParams.call(this, s);
|
|
7226
7226
|
}, f.parseVarId = function(s, a) {
|
|
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
|
-
var
|
|
7229
|
-
|
|
7230
|
-
}, f.parseArrowExpression = function(s, a,
|
|
7228
|
+
var h = this.tsTryParseTypeAnnotation();
|
|
7229
|
+
h && (s.id.typeAnnotation = h, this.resetEndLocation(s.id));
|
|
7230
|
+
}, f.parseArrowExpression = function(s, a, h, p) {
|
|
7231
7231
|
this.match(o.colon) && (s.returnType = this.tsParseTypeAnnotation());
|
|
7232
7232
|
var m = this.yieldPos, v = this.awaitPos, x = this.awaitIdentPos;
|
|
7233
|
-
this.enterScope(16 | ui(
|
|
7233
|
+
this.enterScope(16 | ui(h, !1)), this.initFunction(s);
|
|
7234
7234
|
var g = this.maybeInArrowParameters;
|
|
7235
|
-
return this.options.ecmaVersion >= 8 && (s.async = !!
|
|
7236
|
-
}, f.parseMaybeAssignOrigin = function(s, a,
|
|
7235
|
+
return this.options.ecmaVersion >= 8 && (s.async = !!h), 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
|
+
}, f.parseMaybeAssignOrigin = function(s, a, h) {
|
|
7237
7237
|
if (this.isContextual("yield")) {
|
|
7238
7238
|
if (this.inGenerator) return this.parseYield(s);
|
|
7239
7239
|
this.exprAllowed = !1;
|
|
@@ -7243,31 +7243,31 @@ function jh(e) {
|
|
|
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
|
-
if (
|
|
7246
|
+
if (h && (T = h.call(this, T, g, _)), this.type.isAssign) {
|
|
7247
7247
|
var L = this.startNodeAt(g, _);
|
|
7248
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
7250
|
return p && this.checkExpressionErrors(a, !0), m > -1 && (a.parenthesizedAssign = m), v > -1 && (a.trailingComma = v), T;
|
|
7251
|
-
}, f.parseMaybeAssign = function(s, a,
|
|
7251
|
+
}, f.parseMaybeAssign = function(s, a, h) {
|
|
7252
7252
|
var p, m, v, x, g, _, T, L, V, E, G, W = this;
|
|
7253
7253
|
if (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational()) {
|
|
7254
7254
|
if (L = this.cloneCurLookaheadState(), !(V = this.tryParse(function() {
|
|
7255
|
-
return W.parseMaybeAssignOrigin(s, a,
|
|
7255
|
+
return W.parseMaybeAssignOrigin(s, a, h);
|
|
7256
7256
|
}, L)).error) return V.node;
|
|
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 (!((p = V) != null && p.error || this.tsMatchLeftRelational())) return this.parseMaybeAssignOrigin(s, a,
|
|
7260
|
+
if (!((p = V) != null && p.error || this.tsMatchLeftRelational())) return this.parseMaybeAssignOrigin(s, a, h);
|
|
7261
7261
|
L && !this.compareLookaheadState(L, this.getCurLookaheadState()) || (L = this.cloneCurLookaheadState());
|
|
7262
7262
|
var ye = this.tryParse(function(Fe) {
|
|
7263
7263
|
var dt, mt;
|
|
7264
7264
|
G = W.tsParseTypeParameters();
|
|
7265
|
-
var Be = W.parseMaybeAssignOrigin(s, a,
|
|
7265
|
+
var Be = W.parseMaybeAssignOrigin(s, a, h);
|
|
7266
7266
|
return (Be.type !== "ArrowFunctionExpression" || (dt = Be.extra) != null && dt.parenthesized) && Fe(), ((mt = G) == null ? void 0 : mt.params.length) !== 0 && W.resetStartLocationFromNode(Be, G), Be.typeParameters = G, Be;
|
|
7267
7267
|
}, L);
|
|
7268
7268
|
if (!ye.error && !ye.aborted) return G && this.reportReservedArrowTypeParam(G), ye.node;
|
|
7269
7269
|
if (!V && (gr(!0), !(E = this.tryParse(function() {
|
|
7270
|
-
return W.parseMaybeAssignOrigin(s, a,
|
|
7270
|
+
return W.parseMaybeAssignOrigin(s, a, h);
|
|
7271
7271
|
}, L)).error)) return E.node;
|
|
7272
7272
|
if ((m = V) != null && m.node) return this.setLookaheadState(V.failState), V.node;
|
|
7273
7273
|
if (ye.node) return this.setLookaheadState(ye.failState), G && this.reportReservedArrowTypeParam(G), ye.node;
|
|
@@ -7275,27 +7275,27 @@ 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
|
|
7278
|
+
var h, p = this.start, m = this.startLoc, v = !1, x = !1;
|
|
7279
7279
|
if (s !== void 0) {
|
|
7280
7280
|
var g = {};
|
|
7281
|
-
this.tsParseModifiers({ modified: g, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }),
|
|
7281
|
+
this.tsParseModifiers({ modified: g, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), h = g.accessibility, x = g.override, v = g.readonly, s === !1 && (h || v || x) && this.raise(m.start, N.UnexpectedParameterModifier);
|
|
7282
7282
|
}
|
|
7283
7283
|
var _ = this.parseMaybeDefault(p, m);
|
|
7284
7284
|
this.parseBindingListItem(_);
|
|
7285
7285
|
var T = this.parseMaybeDefault(_.start, _.loc, _);
|
|
7286
|
-
if (a.length && (T.decorators = a),
|
|
7286
|
+
if (a.length && (T.decorators = a), h || v || x) {
|
|
7287
7287
|
var L = this.startNodeAt(p, m);
|
|
7288
|
-
return
|
|
7288
|
+
return h && (L.accessibility = h), 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;
|
|
7291
|
-
}, f.checkLValInnerPattern = function(s, a,
|
|
7292
|
-
a === void 0 && (a = 0), s.type === "TSParameterProperty" ? this.checkLValInnerPattern(s.parameter, a,
|
|
7291
|
+
}, f.checkLValInnerPattern = function(s, a, h) {
|
|
7292
|
+
a === void 0 && (a = 0), s.type === "TSParameterProperty" ? this.checkLValInnerPattern(s.parameter, a, h) : P.prototype.checkLValInnerPattern.call(this, s, a, h);
|
|
7293
7293
|
}, f.parseBindingListItem = function(s) {
|
|
7294
7294
|
this.eat(o.question) && (s.type === "Identifier" || this.isAmbientContext || this.inType || this.raise(s.start, N.PatternIsOptional), s.optional = !0);
|
|
7295
7295
|
var a = this.tsTryParseTypeAnnotation();
|
|
7296
7296
|
return a && (s.typeAnnotation = a), this.resetEndLocation(s), s;
|
|
7297
7297
|
}, f.isAssignable = function(s, a) {
|
|
7298
|
-
var
|
|
7298
|
+
var h = this;
|
|
7299
7299
|
switch (s.type) {
|
|
7300
7300
|
case "TSTypeCastExpression":
|
|
7301
7301
|
return this.isAssignable(s.expression, a);
|
|
@@ -7309,7 +7309,7 @@ function jh(e) {
|
|
|
7309
7309
|
case "ObjectExpression":
|
|
7310
7310
|
var p = s.properties.length - 1;
|
|
7311
7311
|
return s.properties.every(function(m, v) {
|
|
7312
|
-
return m.type !== "ObjectMethod" && (v === p || m.type !== "SpreadElement") &&
|
|
7312
|
+
return m.type !== "ObjectMethod" && (v === p || m.type !== "SpreadElement") && h.isAssignable(m);
|
|
7313
7313
|
});
|
|
7314
7314
|
case "Property":
|
|
7315
7315
|
case "ObjectProperty":
|
|
@@ -7318,7 +7318,7 @@ function jh(e) {
|
|
|
7318
7318
|
return this.isAssignable(s.argument);
|
|
7319
7319
|
case "ArrayExpression":
|
|
7320
7320
|
return s.elements.every(function(m) {
|
|
7321
|
-
return m === null ||
|
|
7321
|
+
return m === null || h.isAssignable(m);
|
|
7322
7322
|
});
|
|
7323
7323
|
case "AssignmentExpression":
|
|
7324
7324
|
return s.operator === "=";
|
|
@@ -7330,57 +7330,57 @@ function jh(e) {
|
|
|
7330
7330
|
default:
|
|
7331
7331
|
return !1;
|
|
7332
7332
|
}
|
|
7333
|
-
}, f.toAssignable = function(s, a,
|
|
7334
|
-
switch (a === void 0 && (a = !1),
|
|
7333
|
+
}, f.toAssignable = function(s, a, h) {
|
|
7334
|
+
switch (a === void 0 && (a = !1), h === void 0 && (h = new vt()), s.type) {
|
|
7335
7335
|
case "ParenthesizedExpression":
|
|
7336
|
-
return this.toAssignableParenthesizedExpression(s, a,
|
|
7336
|
+
return this.toAssignableParenthesizedExpression(s, a, h);
|
|
7337
7337
|
case "TSAsExpression":
|
|
7338
7338
|
case "TSSatisfiesExpression":
|
|
7339
7339
|
case "TSNonNullExpression":
|
|
7340
7340
|
case "TSTypeAssertion":
|
|
7341
|
-
return a || this.raise(s.start, N.UnexpectedTypeCastInParameter), this.toAssignable(s.expression, a,
|
|
7341
|
+
return a || this.raise(s.start, N.UnexpectedTypeCastInParameter), this.toAssignable(s.expression, a, h);
|
|
7342
7342
|
case "MemberExpression":
|
|
7343
7343
|
break;
|
|
7344
7344
|
case "AssignmentExpression":
|
|
7345
|
-
return a || s.left.type !== "TSTypeCastExpression" || (s.left = this.typeCastToParameter(s.left)), P.prototype.toAssignable.call(this, s, a,
|
|
7345
|
+
return a || s.left.type !== "TSTypeCastExpression" || (s.left = this.typeCastToParameter(s.left)), P.prototype.toAssignable.call(this, s, a, h);
|
|
7346
7346
|
case "TSTypeCastExpression":
|
|
7347
7347
|
return this.typeCastToParameter(s);
|
|
7348
7348
|
default:
|
|
7349
|
-
return P.prototype.toAssignable.call(this, s, a,
|
|
7349
|
+
return P.prototype.toAssignable.call(this, s, a, h);
|
|
7350
7350
|
}
|
|
7351
7351
|
return s;
|
|
7352
|
-
}, f.toAssignableParenthesizedExpression = function(s, a,
|
|
7352
|
+
}, f.toAssignableParenthesizedExpression = function(s, a, h) {
|
|
7353
7353
|
switch (s.expression.type) {
|
|
7354
7354
|
case "TSAsExpression":
|
|
7355
7355
|
case "TSSatisfiesExpression":
|
|
7356
7356
|
case "TSNonNullExpression":
|
|
7357
7357
|
case "TSTypeAssertion":
|
|
7358
7358
|
case "ParenthesizedExpression":
|
|
7359
|
-
return this.toAssignable(s.expression, a,
|
|
7359
|
+
return this.toAssignable(s.expression, a, h);
|
|
7360
7360
|
default:
|
|
7361
|
-
return P.prototype.toAssignable.call(this, s, a,
|
|
7361
|
+
return P.prototype.toAssignable.call(this, s, a, h);
|
|
7362
7362
|
}
|
|
7363
7363
|
}, f.curPosition = function() {
|
|
7364
7364
|
if (this.options.locations) {
|
|
7365
7365
|
var s = P.prototype.curPosition.call(this);
|
|
7366
7366
|
return Object.defineProperty(s, "offset", { get: function() {
|
|
7367
7367
|
return function(a) {
|
|
7368
|
-
var
|
|
7369
|
-
return
|
|
7368
|
+
var h = new d.Position(this.line, this.column + a);
|
|
7369
|
+
return h.index = this.index + a, h;
|
|
7370
7370
|
};
|
|
7371
7371
|
} }), s.index = this.pos, s;
|
|
7372
7372
|
}
|
|
7373
7373
|
}, f.parseBindingAtom = function() {
|
|
7374
7374
|
return this.type === o._this ? this.parseIdent(!0) : P.prototype.parseBindingAtom.call(this);
|
|
7375
7375
|
}, f.shouldParseArrow = function(s) {
|
|
7376
|
-
var a,
|
|
7376
|
+
var a, h = this;
|
|
7377
7377
|
if (a = this.match(o.colon) ? s.every(function(m) {
|
|
7378
|
-
return
|
|
7378
|
+
return h.isAssignable(m, !0);
|
|
7379
7379
|
}) : !this.canInsertSemicolon()) {
|
|
7380
7380
|
if (this.match(o.colon)) {
|
|
7381
7381
|
var p = this.tryParse(function(m) {
|
|
7382
|
-
var v =
|
|
7383
|
-
return !
|
|
7382
|
+
var v = h.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
7383
|
+
return !h.canInsertSemicolon() && h.match(o.arrow) || m(), v;
|
|
7384
7384
|
});
|
|
7385
7385
|
if (p.aborted) return this.shouldParseArrowReturnType = void 0, !1;
|
|
7386
7386
|
p.thrown || (p.error && this.setLookaheadState(p.failState), this.shouldParseArrowReturnType = p.node);
|
|
@@ -7388,11 +7388,11 @@ function jh(e) {
|
|
|
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,
|
|
7391
|
+
}, f.parseParenArrowList = function(s, a, h, p) {
|
|
7392
7392
|
var m = this.startNodeAt(s, a);
|
|
7393
|
-
return m.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(m,
|
|
7393
|
+
return m.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(m, h, !1, p);
|
|
7394
7394
|
}, f.parseParenAndDistinguishExpression = function(s, a) {
|
|
7395
|
-
var
|
|
7395
|
+
var h, 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();
|
|
@@ -7410,40 +7410,40 @@ function jh(e) {
|
|
|
7410
7410
|
}
|
|
7411
7411
|
var ie = this.lastTokEnd, ye = this.lastTokEndLoc;
|
|
7412
7412
|
if (this.expect(o.parenR), this.maybeInArrowParameters = x, s && this.shouldParseArrow(L) && this.eat(o.arrow)) return this.checkPatternErrors(G, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = W, this.awaitPos = X, this.parseParenArrowList(p, m, L, a);
|
|
7413
|
-
L.length && !E || this.unexpected(this.lastTokStart), g && this.unexpected(g), this.checkExpressionErrors(G, !0), this.yieldPos = W || this.yieldPos, this.awaitPos = X || this.awaitPos, L.length > 1 ? ((
|
|
7414
|
-
} else
|
|
7413
|
+
L.length && !E || this.unexpected(this.lastTokStart), g && this.unexpected(g), this.checkExpressionErrors(G, !0), this.yieldPos = W || this.yieldPos, this.awaitPos = X || this.awaitPos, L.length > 1 ? ((h = this.startNodeAt(_, T)).expressions = L, this.finishNodeAt(h, "SequenceExpression", ie, ye)) : h = L[0];
|
|
7414
|
+
} else h = this.parseParenExpression();
|
|
7415
7415
|
if (this.options.preserveParens) {
|
|
7416
7416
|
var Fe = this.startNodeAt(p, m);
|
|
7417
|
-
return Fe.expression =
|
|
7417
|
+
return Fe.expression = h, this.finishNode(Fe, "ParenthesizedExpression");
|
|
7418
7418
|
}
|
|
7419
|
-
return
|
|
7420
|
-
}, f.parseTaggedTemplateExpression = function(s, a,
|
|
7421
|
-
var m = this.startNodeAt(a,
|
|
7419
|
+
return h;
|
|
7420
|
+
}, f.parseTaggedTemplateExpression = function(s, a, h, p) {
|
|
7421
|
+
var m = this.startNodeAt(a, h);
|
|
7422
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
|
-
var a = this.tryParse(function(
|
|
7426
|
+
var a = this.tryParse(function(h) {
|
|
7427
7427
|
var p = s.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
7428
|
-
return !s.canInsertSemicolon() && s.match(o.arrow) ||
|
|
7428
|
+
return !s.canInsertSemicolon() && s.match(o.arrow) || h(), 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,
|
|
7431
|
+
}, f.parseSubscriptAsyncArrow = function(s, a, h, p) {
|
|
7432
7432
|
var m = this.startNodeAt(s, a);
|
|
7433
|
-
return m.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(m,
|
|
7434
|
-
}, f.parseExprList = function(s, a,
|
|
7433
|
+
return m.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(m, h, !0, p);
|
|
7434
|
+
}, f.parseExprList = function(s, a, h, 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
|
-
|
|
7439
|
+
h && 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,
|
|
7442
|
+
}, f.parseSubscript = function(s, a, h, 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();
|
|
7446
|
-
var T = this.startNodeAt(a,
|
|
7446
|
+
var T = this.startNodeAt(a, h);
|
|
7447
7447
|
return T.expression = s, s = this.finishNode(T, "TSNonNullExpression");
|
|
7448
7448
|
}
|
|
7449
7449
|
var L = !1;
|
|
@@ -7454,23 +7454,23 @@ function jh(e) {
|
|
|
7454
7454
|
if (this.tsMatchLeftRelational() || this.match(o.bitShift)) {
|
|
7455
7455
|
var V, E = this.tsTryParseAndCatch(function() {
|
|
7456
7456
|
if (!p && g.atPossibleAsyncArrow(s)) {
|
|
7457
|
-
var Di = g.tsTryParseGenericAsyncArrowFunction(a,
|
|
7457
|
+
var Di = g.tsTryParseGenericAsyncArrowFunction(a, h, x);
|
|
7458
7458
|
if (Di) return s = Di;
|
|
7459
7459
|
}
|
|
7460
7460
|
var Et = g.tsParseTypeArgumentsInExpression();
|
|
7461
7461
|
if (!Et) return s;
|
|
7462
7462
|
if (L && !g.match(o.parenL)) return V = g.curPosition(), s;
|
|
7463
7463
|
if (be(g.type) || g.type === o.backQuote) {
|
|
7464
|
-
var Mi = g.parseTaggedTemplateExpression(s, a,
|
|
7464
|
+
var Mi = g.parseTaggedTemplateExpression(s, a, h, _);
|
|
7465
7465
|
return Mi.typeParameters = Et, Mi;
|
|
7466
7466
|
}
|
|
7467
7467
|
if (!p && g.eat(o.parenL)) {
|
|
7468
|
-
var Vi = new vt(), et = g.startNodeAt(a,
|
|
7468
|
+
var Vi = new vt(), et = g.startNodeAt(a, h);
|
|
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
|
}
|
|
7471
7471
|
var ei = g.type;
|
|
7472
7472
|
if (!(g.tsMatchRightRelational() || ei === o.bitShift || ei !== o.parenL && (zi = ei, !!zi.startsExpr) && !g.hasPrecedingLineBreak())) {
|
|
7473
|
-
var zi, ti = g.startNodeAt(a,
|
|
7473
|
+
var zi, ti = g.startNodeAt(a, h);
|
|
7474
7474
|
return ti.expression = s, ti.typeParameters = Et, g.finishNode(ti, "TSInstantiationExpression");
|
|
7475
7475
|
}
|
|
7476
7476
|
});
|
|
@@ -7480,7 +7480,7 @@ function jh(e) {
|
|
|
7480
7480
|
p && W && 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 || W && this.type !== o.parenL && this.type !== o.backQuote || this.eat(o.dot)) {
|
|
7483
|
-
var ie = this.startNodeAt(a,
|
|
7483
|
+
var ie = this.startNodeAt(a, h);
|
|
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, G && (ie.optional = W), s = this.finishNode(ie, "MemberExpression");
|
|
7485
7485
|
} else if (!p && this.eat(o.parenL)) {
|
|
7486
7486
|
var ye = this.maybeInArrowParameters;
|
|
@@ -7488,38 +7488,38 @@ function jh(e) {
|
|
|
7488
7488
|
var Fe = new vt(), dt = this.yieldPos, mt = this.awaitPos, Be = this.awaitIdentPos;
|
|
7489
7489
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
7490
7490
|
var Ri = this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1, Fe);
|
|
7491
|
-
if (m && !W && this.shouldParseAsyncArrow()) this.checkPatternErrors(Fe, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = dt, this.awaitPos = mt, this.awaitIdentPos = Be, s = this.parseSubscriptAsyncArrow(a,
|
|
7491
|
+
if (m && !W && this.shouldParseAsyncArrow()) this.checkPatternErrors(Fe, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = dt, this.awaitPos = mt, this.awaitIdentPos = Be, s = this.parseSubscriptAsyncArrow(a, h, Ri, x);
|
|
7492
7492
|
else {
|
|
7493
7493
|
this.checkExpressionErrors(Fe, !0), this.yieldPos = dt || this.yieldPos, this.awaitPos = mt || this.awaitPos, this.awaitIdentPos = Be || this.awaitIdentPos;
|
|
7494
|
-
var At = this.startNodeAt(a,
|
|
7494
|
+
var At = this.startNodeAt(a, h);
|
|
7495
7495
|
At.callee = s, At.arguments = Ri, G && (At.optional = W), s = this.finishNode(At, "CallExpression");
|
|
7496
7496
|
}
|
|
7497
7497
|
this.maybeInArrowParameters = ye;
|
|
7498
7498
|
} else if (this.type === o.backQuote) {
|
|
7499
7499
|
(W || _) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
7500
|
-
var Qt = this.startNodeAt(a,
|
|
7500
|
+
var Qt = this.startNodeAt(a, h);
|
|
7501
7501
|
Qt.tag = s, Qt.quasi = this.parseTemplate({ isTagged: !0 }), s = this.finishNode(Qt, "TaggedTemplateExpression");
|
|
7502
7502
|
}
|
|
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,
|
|
7506
|
+
var a = s.kind === "get" ? 0 : 1, h = s.value.params[0], p = h && this.isThisParam(h);
|
|
7507
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
|
-
var
|
|
7511
|
-
if (this.match(D.at)) for (; this.match(D.at); )
|
|
7510
|
+
var h = [];
|
|
7511
|
+
if (this.match(D.at)) for (; this.match(D.at); ) h.push(this.parseDecorator());
|
|
7512
7512
|
var p = P.prototype.parseProperty.call(this, s, a);
|
|
7513
|
-
return p.type === "SpreadElement" &&
|
|
7513
|
+
return p.type === "SpreadElement" && h.length && this.raise(p.start, "Decorators can't be used with SpreadElement"), h.length && (p.decorators = h, h = []), p;
|
|
7514
7514
|
}
|
|
7515
7515
|
return P.prototype.parseProperty.call(this, s, a);
|
|
7516
7516
|
}, f.parseCatchClauseParam = function() {
|
|
7517
7517
|
var s = this.parseBindingAtom(), a = s.type === "Identifier";
|
|
7518
7518
|
this.enterScope(a ? 32 : 0), this.checkLValPattern(s, a ? 4 : 2);
|
|
7519
|
-
var
|
|
7520
|
-
return
|
|
7519
|
+
var h = this.tsTryParseTypeAnnotation();
|
|
7520
|
+
return h && (s.typeAnnotation = h, this.resetEndLocation(s)), this.expect(o.parenR), s;
|
|
7521
7521
|
}, f.parseClass = function(s, a) {
|
|
7522
|
-
var
|
|
7522
|
+
var h = this.inAbstractClass;
|
|
7523
7523
|
this.inAbstractClass = !!s.abstract;
|
|
7524
7524
|
try {
|
|
7525
7525
|
this.next(), this.takeDecorators(s);
|
|
@@ -7535,14 +7535,14 @@ function jh(e) {
|
|
|
7535
7535
|
}
|
|
7536
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
|
-
this.inAbstractClass =
|
|
7538
|
+
this.inAbstractClass = h;
|
|
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,
|
|
7543
|
+
}, f.parseMethod = function(s, a, h, 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) | (
|
|
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) | (h ? 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
|
}
|
|
@@ -7550,12 +7550,12 @@ function jh(e) {
|
|
|
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
|
-
var
|
|
7554
|
-
return r && (
|
|
7555
|
-
}, pe.parseExpressionAt = function(s, a,
|
|
7556
|
-
if (
|
|
7557
|
-
|
|
7558
|
-
var p = new this(
|
|
7553
|
+
var h = new this(a, s);
|
|
7554
|
+
return r && (h.isAmbientContext = !0), h.parse();
|
|
7555
|
+
}, pe.parseExpressionAt = function(s, a, h) {
|
|
7556
|
+
if (h.locations === !1) throw new Error("You have to enable options.locations while using acorn-typescript");
|
|
7557
|
+
h.locations = !0;
|
|
7558
|
+
var p = new this(h, s, a);
|
|
7559
7559
|
return r && (p.isAmbientContext = !0), p.nextToken(), p.parseExpression();
|
|
7560
7560
|
}, f.parseImportSpecifier = function() {
|
|
7561
7561
|
if (this.ts_isContextual(D.type)) {
|
|
@@ -7567,12 +7567,12 @@ function jh(e) {
|
|
|
7567
7567
|
}, f.parseExportSpecifier = function(s) {
|
|
7568
7568
|
var a = this.ts_isContextual(D.type);
|
|
7569
7569
|
if (!this.match(o.string) && a) {
|
|
7570
|
-
var
|
|
7571
|
-
return
|
|
7570
|
+
var h = this.startNode();
|
|
7571
|
+
return h.local = this.parseModuleExportName(), this.parseTypeOnlyImportExportSpecifier(h, !1, this.importOrExportOuterKind === "type"), this.finishNode(h, "ExportSpecifier"), this.checkExport(s, h.exported, h.exported.start), h;
|
|
7572
7572
|
}
|
|
7573
7573
|
var p = P.prototype.parseExportSpecifier.call(this, s);
|
|
7574
7574
|
return p.exportKind = "value", p;
|
|
7575
|
-
}, f.parseTypeOnlyImportExportSpecifier = function(s, a,
|
|
7575
|
+
}, f.parseTypeOnlyImportExportSpecifier = function(s, a, h) {
|
|
7576
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();
|
|
@@ -7581,9 +7581,9 @@ function jh(e) {
|
|
|
7581
7581
|
Ct(this.type) ? (g = !0, x = L, p = a ? this.parseIdent() : this.parseModuleExportName(), _ = !1) : (p = V, _ = !1);
|
|
7582
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 &&
|
|
7585
|
-
}, f.raiseCommonCheck = function(s, a,
|
|
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) :
|
|
7584
|
+
g && h && 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
|
+
}, f.raiseCommonCheck = function(s, a, h) {
|
|
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) : h ? P.prototype.raiseRecoverable.call(this, s, a) : P.prototype.raise.call(this, s, a);
|
|
7587
7587
|
}, f.raiseRecoverable = function(s, a) {
|
|
7588
7588
|
return this.raiseCommonCheck(s, a, !0);
|
|
7589
7589
|
}, f.raise = function(s, a) {
|
|
@@ -7591,17 +7591,17 @@ function jh(e) {
|
|
|
7591
7591
|
}, f.updateContext = function(s) {
|
|
7592
7592
|
var a = this.type;
|
|
7593
7593
|
if (a == o.braceL) {
|
|
7594
|
-
var
|
|
7595
|
-
|
|
7594
|
+
var h = this.curContext();
|
|
7595
|
+
h == se.tc_oTag ? this.context.push(Z.b_expr) : h == se.tc_expr ? this.context.push(Z.b_tmpl) : P.prototype.updateContext.call(this, s), this.exprAllowed = !0;
|
|
7596
7596
|
} else {
|
|
7597
7597
|
if (a !== o.slash || s !== D.jsxTagStart) return P.prototype.updateContext.call(this, s);
|
|
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
|
|
7601
|
+
var h = this, p = this.startNodeAt(s, a), m = this.jsx_parseElementName();
|
|
7602
7602
|
if (m && (p.name = m), this.match(o.relational) || this.match(o.bitShift)) {
|
|
7603
7603
|
var v = this.tsTryParseAndCatch(function() {
|
|
7604
|
-
return
|
|
7604
|
+
return h.tsParseTypeArgumentsInExpression();
|
|
7605
7605
|
});
|
|
7606
7606
|
v && (p.typeParameters = v);
|
|
7607
7607
|
}
|
|
@@ -7614,28 +7614,28 @@ function jh(e) {
|
|
|
7614
7614
|
}, f.exitScope = function() {
|
|
7615
7615
|
P.prototype.currentScope.call(this).flags === yt && this.importsStack.pop(), P.prototype.exitScope.call(this);
|
|
7616
7616
|
}, f.hasImport = function(s, a) {
|
|
7617
|
-
var
|
|
7618
|
-
if (this.importsStack[
|
|
7619
|
-
if (!a &&
|
|
7620
|
-
for (var p = 0; p <
|
|
7617
|
+
var h = this.importsStack.length;
|
|
7618
|
+
if (this.importsStack[h - 1].indexOf(s) > -1) return !0;
|
|
7619
|
+
if (!a && h > 1) {
|
|
7620
|
+
for (var p = 0; p < h - 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
|
-
}, f.isRedeclaredInScope = function(s, a,
|
|
7626
|
-
return !!(0 &
|
|
7627
|
-
}, f.checkRedeclarationInScope = function(s, a,
|
|
7628
|
-
this.isRedeclaredInScope(s, a,
|
|
7629
|
-
}, f.declareName = function(s, a,
|
|
7630
|
-
if (4096 & a) return this.hasImport(s, !0) && this.raise(
|
|
7625
|
+
}, f.isRedeclaredInScope = function(s, a, h) {
|
|
7626
|
+
return !!(0 & h) && (2 & h ? s.lexical.indexOf(a) > -1 || s.functions.indexOf(a) > -1 || s.var.indexOf(a) > -1 : 3 & h ? 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, h, p) {
|
|
7628
|
+
this.isRedeclaredInScope(s, a, h) && this.raise(p, "Identifier '" + a + "' has already been declared.");
|
|
7629
|
+
}, f.declareName = function(s, a, h) {
|
|
7630
|
+
if (4096 & a) return this.hasImport(s, !0) && this.raise(h, "Identifier '" + s + "' has already been declared."), void this.importsStack[this.importsStack.length - 1].push(s);
|
|
7631
7631
|
var p = this.currentScope();
|
|
7632
7632
|
if (1024 & a) return this.maybeExportDefined(p, s), void p.exportOnlyBindings.push(s);
|
|
7633
|
-
P.prototype.declareName.call(this, s, a,
|
|
7633
|
+
P.prototype.declareName.call(this, s, a, h), 0 & a && (0 & a || (this.checkRedeclarationInScope(p, s, a, h), 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
|
-
for (var
|
|
7638
|
-
var p = this.scopeStack[
|
|
7637
|
+
for (var h = this.scopeStack.length - 1; h >= 0; h--) {
|
|
7638
|
+
var p = this.scopeStack[h];
|
|
7639
7639
|
if (p.types.indexOf(a) > -1 || p.exportOnlyBindings.indexOf(a) > -1) return;
|
|
7640
7640
|
}
|
|
7641
7641
|
P.prototype.checkLocalExport.call(this, s);
|
|
@@ -7645,7 +7645,7 @@ function jh(e) {
|
|
|
7645
7645
|
} }], (te = [{ key: "acornTypeScript", get: function() {
|
|
7646
7646
|
return y;
|
|
7647
7647
|
} }]) && dr(oe.prototype, te), B && dr(oe, B), Object.defineProperty(oe, "prototype", { writable: !1 }), pe;
|
|
7648
|
-
})(
|
|
7648
|
+
})(c);
|
|
7649
7649
|
return Rs;
|
|
7650
7650
|
};
|
|
7651
7651
|
}
|
|
@@ -7658,17 +7658,17 @@ function Ni(e) {
|
|
|
7658
7658
|
}), r = [];
|
|
7659
7659
|
return yi(i, (n) => {
|
|
7660
7660
|
if (n.type !== "MethodDefinition") return;
|
|
7661
|
-
const u = n,
|
|
7662
|
-
if (
|
|
7663
|
-
const d =
|
|
7661
|
+
const u = n, c = u.key;
|
|
7662
|
+
if (c.type !== "Identifier") return;
|
|
7663
|
+
const d = c.name;
|
|
7664
7664
|
d && d !== "constructor" && u.accessibility !== "private" && r.push(d);
|
|
7665
7665
|
}), r;
|
|
7666
7666
|
}
|
|
7667
7667
|
async function Se(e, t, i = [], r) {
|
|
7668
7668
|
const n = `${t} ${i.join(" ")}`;
|
|
7669
7669
|
e !== void 0 && re(`${e} - exec(${n})`);
|
|
7670
|
-
const { stdout: u, stderr:
|
|
7671
|
-
r === void 0 ? u.trim() && console.log(u.trim()) : await Ae.writeFile(r, u.trim(), "utf8"),
|
|
7670
|
+
const { stdout: u, stderr: c } = await $h(n);
|
|
7671
|
+
r === void 0 ? u.trim() && console.log(u.trim()) : await Ae.writeFile(r, u.trim(), "utf8"), c.trim() && console.error(c.trim());
|
|
7672
7672
|
}
|
|
7673
7673
|
async function Fh(e, t) {
|
|
7674
7674
|
return Ae.readdir(e, t);
|
|
@@ -7724,8 +7724,8 @@ function yi(e, t) {
|
|
|
7724
7724
|
const n = r;
|
|
7725
7725
|
if (Array.isArray(n))
|
|
7726
7726
|
for (const u of n) {
|
|
7727
|
-
const
|
|
7728
|
-
|
|
7727
|
+
const c = u;
|
|
7728
|
+
c && typeof c.type == "string" && yi(c, t);
|
|
7729
7729
|
}
|
|
7730
7730
|
else n && typeof n == "object" && typeof n.type == "string" && yi(n, t);
|
|
7731
7731
|
}
|
|
@@ -7749,8 +7749,8 @@ async function _r(e) {
|
|
|
7749
7749
|
async function kr(e, t) {
|
|
7750
7750
|
const i = `v${e.version}`;
|
|
7751
7751
|
async function r(n, u = "") {
|
|
7752
|
-
const
|
|
7753
|
-
for (const d of
|
|
7752
|
+
const c = await Fh(n, { withFileTypes: !0 });
|
|
7753
|
+
for (const d of c) {
|
|
7754
7754
|
const y = `${n}/${d.name}`, o = u ? `${u}/${d.name}` : d.name;
|
|
7755
7755
|
if (d.isDirectory()) continue;
|
|
7756
7756
|
const w = `${t}_${i}/${o}`.replaceAll("\\", "/"), S = d.name.endsWith(".css") ? "text/css" : "application/octet-stream", C = d.name.endsWith(".js") ? "application/javascript" : S;
|
|
@@ -7795,16 +7795,28 @@ async function fl() {
|
|
|
7795
7795
|
re("7️⃣ Registration NOT required.");
|
|
7796
7796
|
else {
|
|
7797
7797
|
re("7️⃣ Register module"), await _r(t);
|
|
7798
|
-
const
|
|
7799
|
-
await kr(e, `datapos-engine-eu/${r}/${
|
|
7798
|
+
const c = t.id.split("-").slice(2).join("-");
|
|
7799
|
+
await kr(e, `datapos-engine-eu/${r}/${c}`);
|
|
7800
7800
|
}
|
|
7801
|
-
if (
|
|
7802
|
-
|
|
7801
|
+
if ({
|
|
7802
|
+
app: { publish: !1 },
|
|
7803
|
+
api: { publish: !1 },
|
|
7804
|
+
connector: { publish: !0 },
|
|
7805
|
+
context: { publish: !0 },
|
|
7806
|
+
dev: { publish: !0 },
|
|
7807
|
+
engine: { publish: !1 },
|
|
7808
|
+
presenter: { publish: !0 },
|
|
7809
|
+
resources: { publish: !1 },
|
|
7810
|
+
shared: { publish: !0 },
|
|
7811
|
+
tool: { publish: !0 },
|
|
7812
|
+
other: { publish: !1 }
|
|
7813
|
+
}[i].publish) {
|
|
7814
|
+
const c = ".npmrc";
|
|
7803
7815
|
try {
|
|
7804
|
-
await Oi(
|
|
7805
|
-
//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN}`), await Ie("8️⃣ Publish to npm", "npm", ["publish", "--access", "public"]);
|
|
7816
|
+
await Oi(c, `registry=https://registry.npmjs.org/
|
|
7817
|
+
//registry.npmjs.org/:_authToken=${process.env.NPM_TOKEN ?? ""}`), await Ie("8️⃣ Publish to npm", "npm", ["publish", "--access", "public"]);
|
|
7806
7818
|
} finally {
|
|
7807
|
-
await Bh(
|
|
7819
|
+
await Bh(c);
|
|
7808
7820
|
}
|
|
7809
7821
|
} else
|
|
7810
7822
|
re(`8️⃣ Publishing NOT required for package with type identifier of '${i}'.`);
|
|
@@ -7843,8 +7855,8 @@ async function qh(e, t) {
|
|
|
7843
7855
|
console.log("❌ Configuration is invalid:"), console.table(n.error.issues);
|
|
7844
7856
|
return;
|
|
7845
7857
|
}
|
|
7846
|
-
const u = Ni(r),
|
|
7847
|
-
u.length > 0 ? (console.info(`ℹ️ Implements ${u.length} operations:`), console.table(u)) : console.warn("⚠️ Implements no operations."),
|
|
7858
|
+
const u = Ni(r), c = Kh(u);
|
|
7859
|
+
u.length > 0 ? (console.info(`ℹ️ Implements ${u.length} operations:`), console.table(u)) : console.warn("⚠️ Implements no operations."), c === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports '${c}' usage.`), t.name != null && (i.id = t.name.replace("@datapos/", "").replace("@data-positioning/", "")), t.version != null && (i.version = t.version), i.operations = u, i.usageId = c, await ut("config.json", i);
|
|
7848
7860
|
}
|
|
7849
7861
|
async function Hh(e, t) {
|
|
7850
7862
|
re(`${e} Build context project configuration`);
|
|
@@ -7952,12 +7964,12 @@ async function el(e) {
|
|
|
7952
7964
|
} else
|
|
7953
7965
|
i.unknown++;
|
|
7954
7966
|
}
|
|
7955
|
-
const r = await tl(i), n = await Pt("./README.md"), u = n.indexOf(wr),
|
|
7956
|
-
if (u === -1 ||
|
|
7967
|
+
const r = await tl(i), n = await Pt("./README.md"), u = n.indexOf(wr), c = n.indexOf(Qh);
|
|
7968
|
+
if (u === -1 || c === -1) {
|
|
7957
7969
|
console.error("❌ No OWASP badge markers found in 'README.md'.");
|
|
7958
7970
|
return;
|
|
7959
7971
|
}
|
|
7960
|
-
const d = r.join(" "), y = n.slice(0, Math.max(0, u + wr.length)) + d + n.slice(Math.max(0,
|
|
7972
|
+
const d = r.join(" "), y = n.slice(0, Math.max(0, u + wr.length)) + d + n.slice(Math.max(0, c));
|
|
7961
7973
|
await Oi("README.md", y), console.info("OWASP audit badge(s) inserted into 'README.md'");
|
|
7962
7974
|
}
|
|
7963
7975
|
async function tl(e) {
|
|
@@ -7966,9 +7978,9 @@ async function tl(e) {
|
|
|
7966
7978
|
console.info("No vulnerabilities found."), i.push(`[](https://data-positioning.github.io/${t.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
7967
7979
|
else
|
|
7968
7980
|
for (const [n, u] of Object.entries(e)) {
|
|
7969
|
-
const
|
|
7970
|
-
if (console.warn(`⚠️ ${u} ${
|
|
7971
|
-
const d = `https://img.shields.io/badge/OWASP-${u}%20${
|
|
7981
|
+
const c = Yh[n];
|
|
7982
|
+
if (console.warn(`⚠️ ${u} ${c.label} vulnerability(ies) found.`), u === 0) continue;
|
|
7983
|
+
const d = `https://img.shields.io/badge/OWASP-${u}%20${c.label}-${c.color}`;
|
|
7972
7984
|
i.push(`[](https://data-positioning.github.io/${t.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
7973
7985
|
}
|
|
7974
7986
|
return i;
|
|
@@ -8007,7 +8019,7 @@ async function rl(e, t) {
|
|
|
8007
8019
|
console.error("❌ No dependency license markers found in 'README.md'.");
|
|
8008
8020
|
return;
|
|
8009
8021
|
}
|
|
8010
|
-
const u = await de("licenses/licenses.json"),
|
|
8022
|
+
const u = await de("licenses/licenses.json"), c = await de("licenses/downloads/licenses.ext.json");
|
|
8011
8023
|
let d = [];
|
|
8012
8024
|
t && (d = await de("licenses/licenseTree.json"));
|
|
8013
8025
|
const y = [
|
|
@@ -8015,7 +8027,7 @@ async function rl(e, t) {
|
|
|
8015
8027
|
const S = /* @__PURE__ */ new Map();
|
|
8016
8028
|
for (const C of u)
|
|
8017
8029
|
S.set(C.name, { ...C });
|
|
8018
|
-
for (const C of
|
|
8030
|
+
for (const C of c) {
|
|
8019
8031
|
const j = S.get(C.name);
|
|
8020
8032
|
S.set(C.name, j ? { ...j, ...C } : { ...C });
|
|
8021
8033
|
}
|
|
@@ -8081,24 +8093,24 @@ async function kl(e) {
|
|
|
8081
8093
|
const t = {};
|
|
8082
8094
|
async function i(n, u) {
|
|
8083
8095
|
console.info(`⚙️ Processing directory '${n}'...`);
|
|
8084
|
-
const
|
|
8085
|
-
t[d === "" ? "/" : d] =
|
|
8096
|
+
const c = [], d = n.slice(`public/${e}`.length);
|
|
8097
|
+
t[d === "" ? "/" : d] = c;
|
|
8086
8098
|
for (const y of u) {
|
|
8087
8099
|
const o = `${n}/${y}`;
|
|
8088
8100
|
try {
|
|
8089
8101
|
const w = await Ae.stat(o);
|
|
8090
8102
|
if (w.isDirectory()) {
|
|
8091
8103
|
const S = await Ae.readdir(o), C = { childCount: S.length, name: y, typeId: "folder" };
|
|
8092
|
-
|
|
8104
|
+
c.push(C), await i(o, S);
|
|
8093
8105
|
} else {
|
|
8094
8106
|
const S = { id: Ds(), lastModifiedAt: w.mtimeMs, name: y, size: w.size, typeId: "object" };
|
|
8095
|
-
|
|
8107
|
+
c.push(S);
|
|
8096
8108
|
}
|
|
8097
8109
|
} catch (w) {
|
|
8098
8110
|
throw new Error(`Unable to get information for '${y}' in 'buildPublicDirectoryIndex'. ${String(w)}`);
|
|
8099
8111
|
}
|
|
8100
8112
|
}
|
|
8101
|
-
|
|
8113
|
+
c.sort((y, o) => {
|
|
8102
8114
|
const w = y.typeId.localeCompare(o.typeId);
|
|
8103
8115
|
return w === 0 ? y.name.localeCompare(o.name) : w;
|
|
8104
8116
|
});
|