@cloud-cli/on 1.7.10 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard.d.ts +11 -0
- package/dist/dashboard.d.ts.map +1 -0
- package/dist/html-state.d.ts +2 -0
- package/dist/html-state.d.ts.map +1 -0
- package/dist/on.js +1184 -1601
- package/dist/queue.d.ts +2 -3
- package/dist/queue.d.ts.map +1 -1
- package/dist/reporters/html.reporter.d.ts +0 -4
- package/dist/reporters/html.reporter.d.ts.map +1 -1
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/types.d.ts +6 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/worker.d.ts +5 -1
- package/dist/worker.d.ts.map +1 -1
- package/package.json +1 -2
package/dist/on.js
CHANGED
|
@@ -3285,7 +3285,7 @@ function Ur(e) {
|
|
|
3285
3285
|
}
|
|
3286
3286
|
//#endregion
|
|
3287
3287
|
//#region node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/lexer.js
|
|
3288
|
-
function
|
|
3288
|
+
function P(e) {
|
|
3289
3289
|
switch (e) {
|
|
3290
3290
|
case void 0:
|
|
3291
3291
|
case " ":
|
|
@@ -3295,7 +3295,7 @@ function Wr(e) {
|
|
|
3295
3295
|
default: return !1;
|
|
3296
3296
|
}
|
|
3297
3297
|
}
|
|
3298
|
-
var
|
|
3298
|
+
var Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), Kr = /* @__PURE__ */ new Set(",[]{}"), qr = /* @__PURE__ */ new Set(" ,[]{}\n\r "), Jr = (e) => !e || qr.has(e), Yr = class {
|
|
3299
3299
|
constructor() {
|
|
3300
3300
|
this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
|
|
3301
3301
|
}
|
|
@@ -3329,7 +3329,7 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3329
3329
|
}
|
|
3330
3330
|
if (t === "-" || t === ".") {
|
|
3331
3331
|
let t = this.buffer.substr(e, 3);
|
|
3332
|
-
if ((t === "---" || t === "...") &&
|
|
3332
|
+
if ((t === "---" || t === "...") && P(this.buffer[e + 3])) return -1;
|
|
3333
3333
|
}
|
|
3334
3334
|
return e;
|
|
3335
3335
|
}
|
|
@@ -3391,14 +3391,14 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3391
3391
|
if (e === "-" || e === ".") {
|
|
3392
3392
|
if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start");
|
|
3393
3393
|
let e = this.peek(3);
|
|
3394
|
-
if ((e === "---" || e === "...") &&
|
|
3394
|
+
if ((e === "---" || e === "...") && P(this.charAt(3))) return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, e === "---" ? "doc" : "stream";
|
|
3395
3395
|
}
|
|
3396
|
-
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !
|
|
3396
|
+
return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !P(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
|
|
3397
3397
|
}
|
|
3398
3398
|
*parseBlockStart() {
|
|
3399
3399
|
let [e, t] = this.peek(2);
|
|
3400
3400
|
if (!t && !this.atEnd) return this.setNext("block-start");
|
|
3401
|
-
if ((e === "-" || e === "?" || e === ":") &&
|
|
3401
|
+
if ((e === "-" || e === "?" || e === ":") && P(t)) {
|
|
3402
3402
|
let e = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
|
|
3403
3403
|
return this.indentNext = this.indentValue + 1, this.indentValue += e, "block-start";
|
|
3404
3404
|
}
|
|
@@ -3416,7 +3416,7 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3416
3416
|
case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel = 1, "flow";
|
|
3417
3417
|
case "}":
|
|
3418
3418
|
case "]": return yield* this.pushCount(1), "doc";
|
|
3419
|
-
case "*": return yield* this.pushUntil(
|
|
3419
|
+
case "*": return yield* this.pushUntil(Jr), "doc";
|
|
3420
3420
|
case "\"":
|
|
3421
3421
|
case "'": return yield* this.parseQuotedScalar();
|
|
3422
3422
|
case "|":
|
|
@@ -3431,7 +3431,7 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3431
3431
|
while (e + t > 0);
|
|
3432
3432
|
let r = this.getLine();
|
|
3433
3433
|
if (r === null) return this.setNext("flow");
|
|
3434
|
-
if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) &&
|
|
3434
|
+
if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) && P(r[3])) && (n !== this.indentNext - 1 || this.flowLevel !== 1 || r[0] !== "]" && r[0] !== "}")) return this.flowLevel = 0, yield "", yield* this.parseLineStart();
|
|
3435
3435
|
let i = 0;
|
|
3436
3436
|
for (; r[i] === ",";) i += yield* this.pushCount(1), i += yield* this.pushSpaces(!0), this.flowKey = !1;
|
|
3437
3437
|
switch (i += yield* this.pushIndicators(), r[i]) {
|
|
@@ -3441,12 +3441,12 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3441
3441
|
case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel += 1, "flow";
|
|
3442
3442
|
case "}":
|
|
3443
3443
|
case "]": return yield* this.pushCount(1), this.flowKey = !0, --this.flowLevel, this.flowLevel ? "flow" : "doc";
|
|
3444
|
-
case "*": return yield* this.pushUntil(
|
|
3444
|
+
case "*": return yield* this.pushUntil(Jr), "flow";
|
|
3445
3445
|
case "\"":
|
|
3446
3446
|
case "'": return this.flowKey = !0, yield* this.parseQuotedScalar();
|
|
3447
3447
|
case ":": {
|
|
3448
3448
|
let e = this.charAt(1);
|
|
3449
|
-
if (this.flowKey ||
|
|
3449
|
+
if (this.flowKey || P(e) || e === ",") return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
|
|
3450
3450
|
}
|
|
3451
3451
|
default: return this.flowKey = !1, yield* this.parsePlainScalar();
|
|
3452
3452
|
}
|
|
@@ -3484,7 +3484,7 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3484
3484
|
else if (t > "0" && t <= "9") this.blockScalarIndent = Number(t) - 1;
|
|
3485
3485
|
else if (t !== "-") break;
|
|
3486
3486
|
}
|
|
3487
|
-
return yield* this.pushUntil((e) =>
|
|
3487
|
+
return yield* this.pushUntil((e) => P(e) || e === "#");
|
|
3488
3488
|
}
|
|
3489
3489
|
*parseBlockScalar() {
|
|
3490
3490
|
let e = this.pos - 1, t = 0, n;
|
|
@@ -3534,18 +3534,18 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3534
3534
|
let e = this.flowLevel > 0, t = this.pos - 1, n = this.pos - 1, r;
|
|
3535
3535
|
for (; r = this.buffer[++n];) if (r === ":") {
|
|
3536
3536
|
let r = this.buffer[n + 1];
|
|
3537
|
-
if (
|
|
3537
|
+
if (P(r) || e && Kr.has(r)) break;
|
|
3538
3538
|
t = n;
|
|
3539
|
-
} else if (
|
|
3539
|
+
} else if (P(r)) {
|
|
3540
3540
|
let i = this.buffer[n + 1];
|
|
3541
|
-
if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e &&
|
|
3541
|
+
if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e && Kr.has(i)) break;
|
|
3542
3542
|
if (r === "\n") {
|
|
3543
3543
|
let e = this.continueScalar(n + 1);
|
|
3544
3544
|
if (e === -1) break;
|
|
3545
3545
|
n = Math.max(n, e - 2);
|
|
3546
3546
|
}
|
|
3547
3547
|
} else {
|
|
3548
|
-
if (e &&
|
|
3548
|
+
if (e && Kr.has(r)) break;
|
|
3549
3549
|
t = n;
|
|
3550
3550
|
}
|
|
3551
3551
|
return !r && !this.atEnd ? this.setNext("plain-scalar") : (yield "", yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
|
|
@@ -3565,13 +3565,13 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3565
3565
|
e += yield* this.pushTag(), e += yield* this.pushSpaces(!0);
|
|
3566
3566
|
continue loop;
|
|
3567
3567
|
case "&":
|
|
3568
|
-
e += yield* this.pushUntil(
|
|
3568
|
+
e += yield* this.pushUntil(Jr), e += yield* this.pushSpaces(!0);
|
|
3569
3569
|
continue loop;
|
|
3570
3570
|
case "-":
|
|
3571
3571
|
case "?":
|
|
3572
3572
|
case ":": {
|
|
3573
3573
|
let t = this.flowLevel > 0, n = this.charAt(1);
|
|
3574
|
-
if (
|
|
3574
|
+
if (P(n) || t && Kr.has(n)) {
|
|
3575
3575
|
t ? this.flowKey &&= !1 : this.indentNext = this.indentValue + 1, e += yield* this.pushCount(1), e += yield* this.pushSpaces(!0);
|
|
3576
3576
|
continue loop;
|
|
3577
3577
|
}
|
|
@@ -3584,13 +3584,13 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3584
3584
|
*pushTag() {
|
|
3585
3585
|
if (this.charAt(1) === "<") {
|
|
3586
3586
|
let e = this.pos + 2, t = this.buffer[e];
|
|
3587
|
-
for (; !
|
|
3587
|
+
for (; !P(t) && t !== ">";) t = this.buffer[++e];
|
|
3588
3588
|
return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
|
|
3589
3589
|
}
|
|
3590
3590
|
{
|
|
3591
3591
|
let e = this.pos + 1, t = this.buffer[e];
|
|
3592
|
-
for (; t;) if (
|
|
3593
|
-
else if (t === "%" &&
|
|
3592
|
+
for (; t;) if (Gr.has(t)) t = this.buffer[++e];
|
|
3593
|
+
else if (t === "%" && Wr.has(this.buffer[e + 1]) && Wr.has(this.buffer[e + 2])) t = this.buffer[e += 3];
|
|
3594
3594
|
else break;
|
|
3595
3595
|
return yield* this.pushToIndex(e, !1);
|
|
3596
3596
|
}
|
|
@@ -3612,7 +3612,7 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3612
3612
|
for (; !e(n);) n = this.buffer[++t];
|
|
3613
3613
|
return yield* this.pushToIndex(t, !1);
|
|
3614
3614
|
}
|
|
3615
|
-
},
|
|
3615
|
+
}, Xr = class {
|
|
3616
3616
|
constructor() {
|
|
3617
3617
|
this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
|
|
3618
3618
|
let t = 0, n = this.lineStarts.length;
|
|
@@ -3638,11 +3638,11 @@ var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */
|
|
|
3638
3638
|
};
|
|
3639
3639
|
//#endregion
|
|
3640
3640
|
//#region node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/parse/parser.js
|
|
3641
|
-
function
|
|
3641
|
+
function Zr(e, t) {
|
|
3642
3642
|
for (let n = 0; n < e.length; ++n) if (e[n].type === t) return !0;
|
|
3643
3643
|
return !1;
|
|
3644
3644
|
}
|
|
3645
|
-
function
|
|
3645
|
+
function Qr(e) {
|
|
3646
3646
|
for (let t = 0; t < e.length; ++t) switch (e[t].type) {
|
|
3647
3647
|
case "space":
|
|
3648
3648
|
case "comment":
|
|
@@ -3651,7 +3651,7 @@ function $r(e) {
|
|
|
3651
3651
|
}
|
|
3652
3652
|
return -1;
|
|
3653
3653
|
}
|
|
3654
|
-
function
|
|
3654
|
+
function $r(e) {
|
|
3655
3655
|
switch (e?.type) {
|
|
3656
3656
|
case "alias":
|
|
3657
3657
|
case "scalar":
|
|
@@ -3661,7 +3661,7 @@ function ei(e) {
|
|
|
3661
3661
|
default: return !1;
|
|
3662
3662
|
}
|
|
3663
3663
|
}
|
|
3664
|
-
function
|
|
3664
|
+
function ei(e) {
|
|
3665
3665
|
switch (e.type) {
|
|
3666
3666
|
case "document": return e.start;
|
|
3667
3667
|
case "block-map": {
|
|
@@ -3673,7 +3673,7 @@ function ti(e) {
|
|
|
3673
3673
|
default: return [];
|
|
3674
3674
|
}
|
|
3675
3675
|
}
|
|
3676
|
-
function
|
|
3676
|
+
function ti(e) {
|
|
3677
3677
|
if (e.length === 0) return [];
|
|
3678
3678
|
let t = e.length;
|
|
3679
3679
|
loop: for (; --t >= 0;) switch (e[t].type) {
|
|
@@ -3686,16 +3686,16 @@ function ni(e) {
|
|
|
3686
3686
|
for (; e[++t]?.type === "space";);
|
|
3687
3687
|
return e.splice(t, e.length);
|
|
3688
3688
|
}
|
|
3689
|
-
function
|
|
3689
|
+
function ni(e, t) {
|
|
3690
3690
|
if (t.length < 1e5) Array.prototype.push.apply(e, t);
|
|
3691
3691
|
else for (let n = 0; n < t.length; ++n) e.push(t[n]);
|
|
3692
3692
|
}
|
|
3693
|
-
function
|
|
3694
|
-
if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !
|
|
3693
|
+
function ri(e) {
|
|
3694
|
+
if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !Zr(t.start, "explicit-key-ind") && !Zr(t.sep, "map-value-ind") && (t.key && (t.value = t.key), delete t.key, $r(t.value) ? t.value.end ? ni(t.value.end, t.sep) : t.value.end = t.sep : ni(t.start, t.sep), delete t.sep);
|
|
3695
3695
|
}
|
|
3696
|
-
var
|
|
3696
|
+
var ii = class {
|
|
3697
3697
|
constructor(e) {
|
|
3698
|
-
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new
|
|
3698
|
+
this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new Yr(), this.onNewLine = e;
|
|
3699
3699
|
}
|
|
3700
3700
|
*parse(e, t = !1) {
|
|
3701
3701
|
this.onNewLine && this.offset === 0 && this.onNewLine(0);
|
|
@@ -3790,7 +3790,7 @@ var ai = class {
|
|
|
3790
3790
|
else if (this.stack.length === 0) yield t;
|
|
3791
3791
|
else {
|
|
3792
3792
|
let e = this.peek(1);
|
|
3793
|
-
switch (t.type === "block-scalar" ? t.indent = "indent" in e ? e.indent : 0 : t.type === "flow-collection" && e.type === "document" && (t.indent = 0), t.type === "flow-collection" &&
|
|
3793
|
+
switch (t.type === "block-scalar" ? t.indent = "indent" in e ? e.indent : 0 : t.type === "flow-collection" && e.type === "document" && (t.indent = 0), t.type === "flow-collection" && ri(t), e.type) {
|
|
3794
3794
|
case "document":
|
|
3795
3795
|
e.value = t;
|
|
3796
3796
|
break;
|
|
@@ -3842,7 +3842,7 @@ var ai = class {
|
|
|
3842
3842
|
}
|
|
3843
3843
|
if ((e.type === "document" || e.type === "block-map" || e.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
|
|
3844
3844
|
let n = t.items[t.items.length - 1];
|
|
3845
|
-
n && !n.sep && !n.value && n.start.length > 0 &&
|
|
3845
|
+
n && !n.sep && !n.value && n.start.length > 0 && Qr(n.start) === -1 && (t.indent === 0 || n.start.every((e) => e.type !== "comment" || e.indent < t.indent)) && (e.type === "document" ? e.end = n.start : e.items.push({ start: n.start }), t.items.splice(-1, 1));
|
|
3846
3846
|
}
|
|
3847
3847
|
}
|
|
3848
3848
|
}
|
|
@@ -3883,7 +3883,7 @@ var ai = class {
|
|
|
3883
3883
|
if (e.value) return yield* this.lineEnd(e);
|
|
3884
3884
|
switch (this.type) {
|
|
3885
3885
|
case "doc-start":
|
|
3886
|
-
|
|
3886
|
+
Qr(e.start) === -1 ? e.start.push(this.sourceToken) : (yield* this.pop(), yield* this.step());
|
|
3887
3887
|
return;
|
|
3888
3888
|
case "anchor":
|
|
3889
3889
|
case "tag":
|
|
@@ -3903,7 +3903,7 @@ var ai = class {
|
|
|
3903
3903
|
}
|
|
3904
3904
|
*scalar(e) {
|
|
3905
3905
|
if (this.type === "map-value-ind") {
|
|
3906
|
-
let t =
|
|
3906
|
+
let t = ti(ei(this.peek(2))), n;
|
|
3907
3907
|
e.end ? (n = e.end, n.push(this.sourceToken), delete e.end) : n = [this.sourceToken];
|
|
3908
3908
|
let r = {
|
|
3909
3909
|
type: "block-map",
|
|
@@ -3953,7 +3953,7 @@ var ai = class {
|
|
|
3953
3953
|
if (this.atIndentedComment(t.start, e.indent)) {
|
|
3954
3954
|
let n = e.items[e.items.length - 2]?.value?.end;
|
|
3955
3955
|
if (Array.isArray(n)) {
|
|
3956
|
-
|
|
3956
|
+
ni(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
3957
3957
|
return;
|
|
3958
3958
|
}
|
|
3959
3959
|
}
|
|
@@ -4002,12 +4002,12 @@ var ai = class {
|
|
|
4002
4002
|
case "map-value-ind":
|
|
4003
4003
|
if (t.explicitKey) {
|
|
4004
4004
|
if (!t.sep) {
|
|
4005
|
-
if (
|
|
4005
|
+
if (Zr(t.start, "newline")) Object.assign(t, {
|
|
4006
4006
|
key: null,
|
|
4007
4007
|
sep: [this.sourceToken]
|
|
4008
4008
|
});
|
|
4009
4009
|
else {
|
|
4010
|
-
let e =
|
|
4010
|
+
let e = ti(t.start);
|
|
4011
4011
|
this.stack.push({
|
|
4012
4012
|
type: "block-map",
|
|
4013
4013
|
offset: this.offset,
|
|
@@ -4024,7 +4024,7 @@ var ai = class {
|
|
|
4024
4024
|
key: null,
|
|
4025
4025
|
sep: [this.sourceToken]
|
|
4026
4026
|
});
|
|
4027
|
-
else if (
|
|
4027
|
+
else if (Zr(t.sep, "map-value-ind")) this.stack.push({
|
|
4028
4028
|
type: "block-map",
|
|
4029
4029
|
offset: this.offset,
|
|
4030
4030
|
indent: this.indent,
|
|
@@ -4034,8 +4034,8 @@ var ai = class {
|
|
|
4034
4034
|
sep: [this.sourceToken]
|
|
4035
4035
|
}]
|
|
4036
4036
|
});
|
|
4037
|
-
else if (
|
|
4038
|
-
let e =
|
|
4037
|
+
else if ($r(t.key) && !Zr(t.sep, "newline")) {
|
|
4038
|
+
let e = ti(t.start), n = t.key, r = t.sep;
|
|
4039
4039
|
r.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
|
|
4040
4040
|
type: "block-map",
|
|
4041
4041
|
offset: this.offset,
|
|
@@ -4051,7 +4051,7 @@ var ai = class {
|
|
|
4051
4051
|
start: i,
|
|
4052
4052
|
key: null,
|
|
4053
4053
|
sep: [this.sourceToken]
|
|
4054
|
-
}) :
|
|
4054
|
+
}) : Zr(t.sep, "map-value-ind") ? this.stack.push({
|
|
4055
4055
|
type: "block-map",
|
|
4056
4056
|
offset: this.offset,
|
|
4057
4057
|
indent: this.indent,
|
|
@@ -4085,7 +4085,7 @@ var ai = class {
|
|
|
4085
4085
|
let r = this.startBlockValue(e);
|
|
4086
4086
|
if (r) {
|
|
4087
4087
|
if (r.type === "block-seq") {
|
|
4088
|
-
if (!t.explicitKey && t.sep && !
|
|
4088
|
+
if (!t.explicitKey && t.sep && !Zr(t.sep, "newline")) {
|
|
4089
4089
|
yield* this.pop({
|
|
4090
4090
|
type: "error",
|
|
4091
4091
|
offset: this.offset,
|
|
@@ -4119,7 +4119,7 @@ var ai = class {
|
|
|
4119
4119
|
if (this.atIndentedComment(t.start, e.indent)) {
|
|
4120
4120
|
let n = e.items[e.items.length - 2]?.value?.end;
|
|
4121
4121
|
if (Array.isArray(n)) {
|
|
4122
|
-
|
|
4122
|
+
ni(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
4123
4123
|
return;
|
|
4124
4124
|
}
|
|
4125
4125
|
}
|
|
@@ -4133,7 +4133,7 @@ var ai = class {
|
|
|
4133
4133
|
return;
|
|
4134
4134
|
case "seq-item-ind":
|
|
4135
4135
|
if (this.indent !== e.indent) break;
|
|
4136
|
-
t.value ||
|
|
4136
|
+
t.value || Zr(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
|
|
4137
4137
|
return;
|
|
4138
4138
|
}
|
|
4139
4139
|
if (this.indent > e.indent) {
|
|
@@ -4202,8 +4202,8 @@ var ai = class {
|
|
|
4202
4202
|
let t = this.peek(2);
|
|
4203
4203
|
if (t.type === "block-map" && (this.type === "map-value-ind" && t.indent === e.indent || this.type === "newline" && !t.items[t.items.length - 1].sep)) yield* this.pop(), yield* this.step();
|
|
4204
4204
|
else if (this.type === "map-value-ind" && t.type !== "flow-collection") {
|
|
4205
|
-
let n =
|
|
4206
|
-
|
|
4205
|
+
let n = ti(ei(t));
|
|
4206
|
+
ri(e);
|
|
4207
4207
|
let r = e.end.splice(1, e.end.length);
|
|
4208
4208
|
r.push(this.sourceToken);
|
|
4209
4209
|
let i = {
|
|
@@ -4262,7 +4262,7 @@ var ai = class {
|
|
|
4262
4262
|
};
|
|
4263
4263
|
case "explicit-key-ind": {
|
|
4264
4264
|
this.onKeyLine = !0;
|
|
4265
|
-
let t =
|
|
4265
|
+
let t = ti(ei(e));
|
|
4266
4266
|
return t.push(this.sourceToken), {
|
|
4267
4267
|
type: "block-map",
|
|
4268
4268
|
offset: this.offset,
|
|
@@ -4275,7 +4275,7 @@ var ai = class {
|
|
|
4275
4275
|
}
|
|
4276
4276
|
case "map-value-ind": {
|
|
4277
4277
|
this.onKeyLine = !0;
|
|
4278
|
-
let t =
|
|
4278
|
+
let t = ti(ei(e));
|
|
4279
4279
|
return {
|
|
4280
4280
|
type: "block-map",
|
|
4281
4281
|
offset: this.offset,
|
|
@@ -4313,20 +4313,20 @@ var ai = class {
|
|
|
4313
4313
|
};
|
|
4314
4314
|
//#endregion
|
|
4315
4315
|
//#region node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/dist/public-api.js
|
|
4316
|
-
function
|
|
4316
|
+
function ai(e) {
|
|
4317
4317
|
let t = e.prettyErrors !== !1;
|
|
4318
4318
|
return {
|
|
4319
|
-
lineCounter: e.lineCounter || t && new
|
|
4319
|
+
lineCounter: e.lineCounter || t && new Xr() || null,
|
|
4320
4320
|
prettyErrors: t
|
|
4321
4321
|
};
|
|
4322
4322
|
}
|
|
4323
|
-
function
|
|
4324
|
-
let { lineCounter: n, prettyErrors: r } =
|
|
4323
|
+
function oi(e, t = {}) {
|
|
4324
|
+
let { lineCounter: n, prettyErrors: r } = ai(t), i = new ii(n?.addNewLine), a = new wr(t), o = Array.from(a.compose(i.parse(e)));
|
|
4325
4325
|
if (r && n) for (let t of o) t.errors.forEach(Hn(e, n)), t.warnings.forEach(Hn(e, n));
|
|
4326
4326
|
return o.length > 0 ? o : Object.assign([], { empty: !0 }, a.streamInfo());
|
|
4327
4327
|
}
|
|
4328
|
-
function
|
|
4329
|
-
let { lineCounter: n, prettyErrors: r } =
|
|
4328
|
+
function si(e, t = {}) {
|
|
4329
|
+
let { lineCounter: n, prettyErrors: r } = ai(t), i = new ii(n?.addNewLine), a = new wr(t), o = null;
|
|
4330
4330
|
for (let t of a.compose(i.parse(e), !0, e.length)) if (!o) o = t;
|
|
4331
4331
|
else if (o.options.logLevel !== "silent") {
|
|
4332
4332
|
o.errors.push(new Bn(t.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
@@ -4334,10 +4334,10 @@ function ci(e, t = {}) {
|
|
|
4334
4334
|
}
|
|
4335
4335
|
return r && n && (o.errors.forEach(Hn(e, n)), o.warnings.forEach(Hn(e, n))), o;
|
|
4336
4336
|
}
|
|
4337
|
-
function
|
|
4337
|
+
function ci(e, t, n) {
|
|
4338
4338
|
let r;
|
|
4339
4339
|
typeof t == "function" ? r = t : n === void 0 && t && typeof t == "object" && (n = t);
|
|
4340
|
-
let i =
|
|
4340
|
+
let i = si(e, n);
|
|
4341
4341
|
if (!i) return null;
|
|
4342
4342
|
if (i.warnings.forEach((e) => bt(i.options.logLevel, e)), i.errors.length > 0) {
|
|
4343
4343
|
if (i.options.logLevel !== "silent") throw i.errors[0];
|
|
@@ -4345,7 +4345,7 @@ function li(e, t, n) {
|
|
|
4345
4345
|
}
|
|
4346
4346
|
return i.toJS(Object.assign({ reviver: r }, n));
|
|
4347
4347
|
}
|
|
4348
|
-
function
|
|
4348
|
+
function li(e, t, n) {
|
|
4349
4349
|
let r = null;
|
|
4350
4350
|
if (typeof t == "function" || Array.isArray(t) ? r = t : n === void 0 && t && (n = t), typeof n == "string" && (n = n.length), typeof n == "number") {
|
|
4351
4351
|
let e = Math.round(n);
|
|
@@ -4359,15 +4359,15 @@ function ui(e, t, n) {
|
|
|
4359
4359
|
}
|
|
4360
4360
|
//#endregion
|
|
4361
4361
|
//#region node_modules/.pnpm/yaml@2.9.0/node_modules/yaml/browser/index.js
|
|
4362
|
-
var
|
|
4362
|
+
var ui = /* @__PURE__ */ b({
|
|
4363
4363
|
Alias: () => He,
|
|
4364
4364
|
CST: () => zr,
|
|
4365
4365
|
Composer: () => wr,
|
|
4366
4366
|
Document: () => Ln,
|
|
4367
|
-
Lexer: () =>
|
|
4368
|
-
LineCounter: () =>
|
|
4367
|
+
Lexer: () => Yr,
|
|
4368
|
+
LineCounter: () => Xr,
|
|
4369
4369
|
Pair: () => j,
|
|
4370
|
-
Parser: () =>
|
|
4370
|
+
Parser: () => ii,
|
|
4371
4371
|
Scalar: () => A,
|
|
4372
4372
|
Schema: () => Fn,
|
|
4373
4373
|
YAMLError: () => zn,
|
|
@@ -4383,13 +4383,13 @@ var di = /* @__PURE__ */ b({
|
|
|
4383
4383
|
isPair: () => w,
|
|
4384
4384
|
isScalar: () => T,
|
|
4385
4385
|
isSeq: () => Se,
|
|
4386
|
-
parse: () =>
|
|
4387
|
-
parseAllDocuments: () =>
|
|
4388
|
-
parseDocument: () =>
|
|
4389
|
-
stringify: () =>
|
|
4386
|
+
parse: () => ci,
|
|
4387
|
+
parseAllDocuments: () => oi,
|
|
4388
|
+
parseDocument: () => si,
|
|
4389
|
+
stringify: () => li,
|
|
4390
4390
|
visit: () => Ee,
|
|
4391
4391
|
visitAsync: () => Oe
|
|
4392
|
-
}),
|
|
4392
|
+
}), di = class {
|
|
4393
4393
|
baseDir;
|
|
4394
4394
|
maxDepth;
|
|
4395
4395
|
constructor(e, t = 5) {
|
|
@@ -4404,7 +4404,7 @@ var di = /* @__PURE__ */ b({
|
|
|
4404
4404
|
throw Error(`Circular 'includes' dependency detected: ${e}`);
|
|
4405
4405
|
}
|
|
4406
4406
|
if (n.add(i), !e.existsSync(i)) throw Error(`Included workflow partial not found: ${t}`);
|
|
4407
|
-
let o = e.readFileSync(i, "utf-8"), s =
|
|
4407
|
+
let o = e.readFileSync(i, "utf-8"), s = ui.parse(o);
|
|
4408
4408
|
if (Array.isArray(s.includes)) {
|
|
4409
4409
|
for (let e of s.includes) {
|
|
4410
4410
|
let t = this.resolve(e, new Set(n), r + 1);
|
|
@@ -4420,7 +4420,7 @@ var di = /* @__PURE__ */ b({
|
|
|
4420
4420
|
};
|
|
4421
4421
|
//#endregion
|
|
4422
4422
|
//#region src/parser/matrix-expander.ts
|
|
4423
|
-
function
|
|
4423
|
+
function fi(e) {
|
|
4424
4424
|
if (!e.strategy?.matrix || Object.keys(e.strategy.matrix).length === 0) return [e];
|
|
4425
4425
|
let t = e.strategy.matrix;
|
|
4426
4426
|
return Object.keys(t).reduce((e, n) => {
|
|
@@ -4447,7 +4447,7 @@ function pi(e) {
|
|
|
4447
4447
|
}
|
|
4448
4448
|
//#endregion
|
|
4449
4449
|
//#region src/queue.ts
|
|
4450
|
-
var
|
|
4450
|
+
var pi = class {
|
|
4451
4451
|
workerId;
|
|
4452
4452
|
constructor(e) {
|
|
4453
4453
|
this.workerId = e;
|
|
@@ -4468,6 +4468,13 @@ var mi = class {
|
|
|
4468
4468
|
async finishJob(e, t) {
|
|
4469
4469
|
await S.run("UPDATE jobs SET status = ?, finished_at = CURRENT_TIMESTAMP WHERE id = ?;", [t, e]);
|
|
4470
4470
|
}
|
|
4471
|
+
async completeJob(e, t, n) {
|
|
4472
|
+
await S.run("UPDATE jobs\n SET status = ?, report = ?, updated_at = CURRENT_TIMESTAMP, finished_at = CURRENT_TIMESTAMP\n WHERE id = ?;", [
|
|
4473
|
+
t,
|
|
4474
|
+
JSON.stringify(n),
|
|
4475
|
+
e
|
|
4476
|
+
]);
|
|
4477
|
+
}
|
|
4471
4478
|
async restartJob(e) {
|
|
4472
4479
|
let t = await this.getJob(e);
|
|
4473
4480
|
if (t) return t.status === "running" && await S.run("UPDATE jobs SET status = 'cancelled', finished_at = CURRENT_TIMESTAMP WHERE id = ?;", [e]), (await S.get("INSERT INTO jobs (parentId, workflow_id, concurrency_key, payload) SELECT id, workflow_id, concurrency_key, payload FROM jobs WHERE id = ? RETURNING *", [e])).id;
|
|
@@ -4479,7 +4486,7 @@ var mi = class {
|
|
|
4479
4486
|
return await S.run("UPDATE jobs SET status = 'pending', worker_id = NULL WHERE status = 'running' AND started_at < datetime('now', '-1 hour');");
|
|
4480
4487
|
}
|
|
4481
4488
|
async createTables() {
|
|
4482
|
-
await S.exec("\n CREATE TABLE IF NOT EXISTS jobs (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parentId INTEGER,\n workflow_id TEXT NOT NULL,\n payload TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT 'pending',\n concurrency_key TEXT,\n worker_id TEXT,\n report TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n started_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n finished_at DATETIME DEFAULT CURRENT_TIMESTAMP\n );\n\n CREATE TABLE IF NOT EXISTS step_logs (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n job_id INTEGER NOT NULL,\n step_id TEXT NOT NULL,\n log_content TEXT NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY(job_id) REFERENCES jobs(id) ON DELETE CASCADE\n );\n\n CREATE INDEX IF NOT EXISTS idx_step_logs_job ON step_logs(job_id);\n ");
|
|
4489
|
+
await S.exec("\n CREATE TABLE IF NOT EXISTS jobs (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n parentId INTEGER,\n workflow_id TEXT NOT NULL,\n payload TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT 'pending',\n concurrency_key TEXT,\n worker_id TEXT,\n report TEXT,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n updated_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n started_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n finished_at DATETIME DEFAULT CURRENT_TIMESTAMP\n );\n\n CREATE TABLE IF NOT EXISTS step_logs (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n job_id INTEGER NOT NULL,\n step_id TEXT NOT NULL,\n log_content TEXT NOT NULL,\n created_at DATETIME DEFAULT CURRENT_TIMESTAMP,\n FOREIGN KEY(job_id) REFERENCES jobs(id) ON DELETE CASCADE\n );\n\n CREATE INDEX IF NOT EXISTS idx_step_logs_job ON step_logs(job_id);\n\n DELETE FROM step_logs\n WHERE id NOT IN (\n SELECT MAX(id) FROM step_logs GROUP BY job_id, step_id\n );\n CREATE UNIQUE INDEX IF NOT EXISTS idx_step_logs_job_step ON step_logs(job_id, step_id);\n ");
|
|
4483
4490
|
}
|
|
4484
4491
|
async getJob(e) {
|
|
4485
4492
|
return S.get("SELECT * FROM jobs WHERE id = ?", [e]);
|
|
@@ -4491,7 +4498,7 @@ var mi = class {
|
|
|
4491
4498
|
await S.run("UPDATE jobs SET report = ?, updated_at = CURRENT_TIMESTAMP WHERE id = ?", [JSON.stringify(t), e]);
|
|
4492
4499
|
}
|
|
4493
4500
|
async saveStepLog(e, t, n) {
|
|
4494
|
-
|
|
4501
|
+
await S.run("INSERT INTO step_logs (job_id, step_id, log_content) VALUES (?, ?, ?)\n ON CONFLICT(job_id, step_id) DO UPDATE SET\n log_content = excluded.log_content,\n created_at = CURRENT_TIMESTAMP", [
|
|
4495
4502
|
e,
|
|
4496
4503
|
t,
|
|
4497
4504
|
n
|
|
@@ -4502,7 +4509,7 @@ var mi = class {
|
|
|
4502
4509
|
for (let e of t) n[e.step_id] = e.log_content;
|
|
4503
4510
|
return n;
|
|
4504
4511
|
}
|
|
4505
|
-
},
|
|
4512
|
+
}, mi = class {
|
|
4506
4513
|
envFilePath;
|
|
4507
4514
|
secrets = /* @__PURE__ */ new Map();
|
|
4508
4515
|
constructor(e) {
|
|
@@ -4527,7 +4534,7 @@ var mi = class {
|
|
|
4527
4534
|
for (let n of t) e = e.replaceAll(n, "****");
|
|
4528
4535
|
return e;
|
|
4529
4536
|
}
|
|
4530
|
-
},
|
|
4537
|
+
}, hi = [
|
|
4531
4538
|
509,
|
|
4532
4539
|
0,
|
|
4533
4540
|
227,
|
|
@@ -4858,7 +4865,7 @@ var mi = class {
|
|
|
4858
4865
|
9,
|
|
4859
4866
|
787719,
|
|
4860
4867
|
239
|
|
4861
|
-
],
|
|
4868
|
+
], gi = [
|
|
4862
4869
|
0,
|
|
4863
4870
|
11,
|
|
4864
4871
|
2,
|
|
@@ -5477,216 +5484,216 @@ var mi = class {
|
|
|
5477
5484
|
4938,
|
|
5478
5485
|
6,
|
|
5479
5486
|
8489
|
|
5480
|
-
],
|
|
5487
|
+
], _i = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", vi = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", yi = {
|
|
5481
5488
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
5482
5489
|
5: "class enum extends super const export import",
|
|
5483
5490
|
6: "enum",
|
|
5484
5491
|
strict: "implements interface let package private protected public static yield",
|
|
5485
5492
|
strictBind: "eval arguments"
|
|
5486
|
-
},
|
|
5487
|
-
5:
|
|
5488
|
-
"5module":
|
|
5489
|
-
6:
|
|
5490
|
-
},
|
|
5491
|
-
function
|
|
5493
|
+
}, bi = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", xi = {
|
|
5494
|
+
5: bi,
|
|
5495
|
+
"5module": bi + " export import",
|
|
5496
|
+
6: bi + " const class extends export import super"
|
|
5497
|
+
}, Si = /^in(stanceof)?$/, Ci = RegExp("[" + vi + "]"), wi = RegExp("[" + vi + _i + "]");
|
|
5498
|
+
function Ti(e, t) {
|
|
5492
5499
|
for (var n = 65536, r = 0; r < t.length; r += 2) {
|
|
5493
5500
|
if (n += t[r], n > e) return !1;
|
|
5494
5501
|
if (n += t[r + 1], n >= e) return !0;
|
|
5495
5502
|
}
|
|
5496
5503
|
return !1;
|
|
5497
5504
|
}
|
|
5498
|
-
function
|
|
5499
|
-
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 &&
|
|
5505
|
+
function Ei(e, t) {
|
|
5506
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && Ci.test(String.fromCharCode(e)) : t !== !1 && Ti(e, gi);
|
|
5500
5507
|
}
|
|
5501
|
-
function
|
|
5502
|
-
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 &&
|
|
5508
|
+
function Di(e, t) {
|
|
5509
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && wi.test(String.fromCharCode(e)) : t === !1 ? !1 : Ti(e, gi) || Ti(e, hi);
|
|
5503
5510
|
}
|
|
5504
|
-
var
|
|
5511
|
+
var F = function(e, t) {
|
|
5505
5512
|
t === void 0 && (t = {}), this.label = e, this.keyword = t.keyword, this.beforeExpr = !!t.beforeExpr, this.startsExpr = !!t.startsExpr, this.isLoop = !!t.isLoop, this.isAssign = !!t.isAssign, this.prefix = !!t.prefix, this.postfix = !!t.postfix, this.binop = t.binop || null, this.updateContext = null;
|
|
5506
5513
|
};
|
|
5507
|
-
function
|
|
5508
|
-
return new
|
|
5514
|
+
function I(e, t) {
|
|
5515
|
+
return new F(e, {
|
|
5509
5516
|
beforeExpr: !0,
|
|
5510
5517
|
binop: t
|
|
5511
5518
|
});
|
|
5512
5519
|
}
|
|
5513
|
-
var
|
|
5514
|
-
function
|
|
5515
|
-
return t === void 0 && (t = {}), t.keyword = e,
|
|
5516
|
-
}
|
|
5517
|
-
var
|
|
5518
|
-
num: new
|
|
5519
|
-
regexp: new
|
|
5520
|
-
string: new
|
|
5521
|
-
name: new
|
|
5522
|
-
privateId: new
|
|
5523
|
-
eof: new
|
|
5524
|
-
bracketL: new
|
|
5520
|
+
var L = { beforeExpr: !0 }, R = { startsExpr: !0 }, Oi = {};
|
|
5521
|
+
function z(e, t) {
|
|
5522
|
+
return t === void 0 && (t = {}), t.keyword = e, Oi[e] = new F(e, t);
|
|
5523
|
+
}
|
|
5524
|
+
var B = {
|
|
5525
|
+
num: new F("num", R),
|
|
5526
|
+
regexp: new F("regexp", R),
|
|
5527
|
+
string: new F("string", R),
|
|
5528
|
+
name: new F("name", R),
|
|
5529
|
+
privateId: new F("privateId", R),
|
|
5530
|
+
eof: new F("eof"),
|
|
5531
|
+
bracketL: new F("[", {
|
|
5525
5532
|
beforeExpr: !0,
|
|
5526
5533
|
startsExpr: !0
|
|
5527
5534
|
}),
|
|
5528
|
-
bracketR: new
|
|
5529
|
-
braceL: new
|
|
5535
|
+
bracketR: new F("]"),
|
|
5536
|
+
braceL: new F("{", {
|
|
5530
5537
|
beforeExpr: !0,
|
|
5531
5538
|
startsExpr: !0
|
|
5532
5539
|
}),
|
|
5533
|
-
braceR: new
|
|
5534
|
-
parenL: new
|
|
5540
|
+
braceR: new F("}"),
|
|
5541
|
+
parenL: new F("(", {
|
|
5535
5542
|
beforeExpr: !0,
|
|
5536
5543
|
startsExpr: !0
|
|
5537
5544
|
}),
|
|
5538
|
-
parenR: new
|
|
5539
|
-
comma: new
|
|
5540
|
-
semi: new
|
|
5541
|
-
colon: new
|
|
5542
|
-
dot: new
|
|
5543
|
-
question: new
|
|
5544
|
-
questionDot: new
|
|
5545
|
-
arrow: new
|
|
5546
|
-
template: new
|
|
5547
|
-
invalidTemplate: new
|
|
5548
|
-
ellipsis: new
|
|
5549
|
-
backQuote: new
|
|
5550
|
-
dollarBraceL: new
|
|
5545
|
+
parenR: new F(")"),
|
|
5546
|
+
comma: new F(",", L),
|
|
5547
|
+
semi: new F(";", L),
|
|
5548
|
+
colon: new F(":", L),
|
|
5549
|
+
dot: new F("."),
|
|
5550
|
+
question: new F("?", L),
|
|
5551
|
+
questionDot: new F("?."),
|
|
5552
|
+
arrow: new F("=>", L),
|
|
5553
|
+
template: new F("template"),
|
|
5554
|
+
invalidTemplate: new F("invalidTemplate"),
|
|
5555
|
+
ellipsis: new F("...", L),
|
|
5556
|
+
backQuote: new F("`", R),
|
|
5557
|
+
dollarBraceL: new F("${", {
|
|
5551
5558
|
beforeExpr: !0,
|
|
5552
5559
|
startsExpr: !0
|
|
5553
5560
|
}),
|
|
5554
|
-
eq: new
|
|
5561
|
+
eq: new F("=", {
|
|
5555
5562
|
beforeExpr: !0,
|
|
5556
5563
|
isAssign: !0
|
|
5557
5564
|
}),
|
|
5558
|
-
assign: new
|
|
5565
|
+
assign: new F("_=", {
|
|
5559
5566
|
beforeExpr: !0,
|
|
5560
5567
|
isAssign: !0
|
|
5561
5568
|
}),
|
|
5562
|
-
incDec: new
|
|
5569
|
+
incDec: new F("++/--", {
|
|
5563
5570
|
prefix: !0,
|
|
5564
5571
|
postfix: !0,
|
|
5565
5572
|
startsExpr: !0
|
|
5566
5573
|
}),
|
|
5567
|
-
prefix: new
|
|
5574
|
+
prefix: new F("!/~", {
|
|
5568
5575
|
beforeExpr: !0,
|
|
5569
5576
|
prefix: !0,
|
|
5570
5577
|
startsExpr: !0
|
|
5571
5578
|
}),
|
|
5572
|
-
logicalOR:
|
|
5573
|
-
logicalAND:
|
|
5574
|
-
bitwiseOR:
|
|
5575
|
-
bitwiseXOR:
|
|
5576
|
-
bitwiseAND:
|
|
5577
|
-
equality:
|
|
5578
|
-
relational:
|
|
5579
|
-
bitShift:
|
|
5580
|
-
plusMin: new
|
|
5579
|
+
logicalOR: I("||", 1),
|
|
5580
|
+
logicalAND: I("&&", 2),
|
|
5581
|
+
bitwiseOR: I("|", 3),
|
|
5582
|
+
bitwiseXOR: I("^", 4),
|
|
5583
|
+
bitwiseAND: I("&", 5),
|
|
5584
|
+
equality: I("==/!=/===/!==", 6),
|
|
5585
|
+
relational: I("</>/<=/>=", 7),
|
|
5586
|
+
bitShift: I("<</>>/>>>", 8),
|
|
5587
|
+
plusMin: new F("+/-", {
|
|
5581
5588
|
beforeExpr: !0,
|
|
5582
5589
|
binop: 9,
|
|
5583
5590
|
prefix: !0,
|
|
5584
5591
|
startsExpr: !0
|
|
5585
5592
|
}),
|
|
5586
|
-
modulo:
|
|
5587
|
-
star:
|
|
5588
|
-
slash:
|
|
5589
|
-
starstar: new
|
|
5590
|
-
coalesce:
|
|
5591
|
-
_break:
|
|
5592
|
-
_case:
|
|
5593
|
-
_catch:
|
|
5594
|
-
_continue:
|
|
5595
|
-
_debugger:
|
|
5596
|
-
_default:
|
|
5597
|
-
_do:
|
|
5593
|
+
modulo: I("%", 10),
|
|
5594
|
+
star: I("*", 10),
|
|
5595
|
+
slash: I("/", 10),
|
|
5596
|
+
starstar: new F("**", { beforeExpr: !0 }),
|
|
5597
|
+
coalesce: I("??", 1),
|
|
5598
|
+
_break: z("break"),
|
|
5599
|
+
_case: z("case", L),
|
|
5600
|
+
_catch: z("catch"),
|
|
5601
|
+
_continue: z("continue"),
|
|
5602
|
+
_debugger: z("debugger"),
|
|
5603
|
+
_default: z("default", L),
|
|
5604
|
+
_do: z("do", {
|
|
5598
5605
|
isLoop: !0,
|
|
5599
5606
|
beforeExpr: !0
|
|
5600
5607
|
}),
|
|
5601
|
-
_else:
|
|
5602
|
-
_finally:
|
|
5603
|
-
_for:
|
|
5604
|
-
_function:
|
|
5605
|
-
_if:
|
|
5606
|
-
_return:
|
|
5607
|
-
_switch:
|
|
5608
|
-
_throw:
|
|
5609
|
-
_try:
|
|
5610
|
-
_var:
|
|
5611
|
-
_const:
|
|
5612
|
-
_while:
|
|
5613
|
-
_with:
|
|
5614
|
-
_new:
|
|
5608
|
+
_else: z("else", L),
|
|
5609
|
+
_finally: z("finally"),
|
|
5610
|
+
_for: z("for", { isLoop: !0 }),
|
|
5611
|
+
_function: z("function", R),
|
|
5612
|
+
_if: z("if"),
|
|
5613
|
+
_return: z("return", L),
|
|
5614
|
+
_switch: z("switch"),
|
|
5615
|
+
_throw: z("throw", L),
|
|
5616
|
+
_try: z("try"),
|
|
5617
|
+
_var: z("var"),
|
|
5618
|
+
_const: z("const"),
|
|
5619
|
+
_while: z("while", { isLoop: !0 }),
|
|
5620
|
+
_with: z("with"),
|
|
5621
|
+
_new: z("new", {
|
|
5615
5622
|
beforeExpr: !0,
|
|
5616
5623
|
startsExpr: !0
|
|
5617
5624
|
}),
|
|
5618
|
-
_this:
|
|
5619
|
-
_super:
|
|
5620
|
-
_class:
|
|
5621
|
-
_extends:
|
|
5622
|
-
_export:
|
|
5623
|
-
_import:
|
|
5624
|
-
_null:
|
|
5625
|
-
_true:
|
|
5626
|
-
_false:
|
|
5627
|
-
_in:
|
|
5625
|
+
_this: z("this", R),
|
|
5626
|
+
_super: z("super", R),
|
|
5627
|
+
_class: z("class", R),
|
|
5628
|
+
_extends: z("extends", L),
|
|
5629
|
+
_export: z("export"),
|
|
5630
|
+
_import: z("import", R),
|
|
5631
|
+
_null: z("null", R),
|
|
5632
|
+
_true: z("true", R),
|
|
5633
|
+
_false: z("false", R),
|
|
5634
|
+
_in: z("in", {
|
|
5628
5635
|
beforeExpr: !0,
|
|
5629
5636
|
binop: 7
|
|
5630
5637
|
}),
|
|
5631
|
-
_instanceof:
|
|
5638
|
+
_instanceof: z("instanceof", {
|
|
5632
5639
|
beforeExpr: !0,
|
|
5633
5640
|
binop: 7
|
|
5634
5641
|
}),
|
|
5635
|
-
_typeof:
|
|
5642
|
+
_typeof: z("typeof", {
|
|
5636
5643
|
beforeExpr: !0,
|
|
5637
5644
|
prefix: !0,
|
|
5638
5645
|
startsExpr: !0
|
|
5639
5646
|
}),
|
|
5640
|
-
_void:
|
|
5647
|
+
_void: z("void", {
|
|
5641
5648
|
beforeExpr: !0,
|
|
5642
5649
|
prefix: !0,
|
|
5643
5650
|
startsExpr: !0
|
|
5644
5651
|
}),
|
|
5645
|
-
_delete:
|
|
5652
|
+
_delete: z("delete", {
|
|
5646
5653
|
beforeExpr: !0,
|
|
5647
5654
|
prefix: !0,
|
|
5648
5655
|
startsExpr: !0
|
|
5649
5656
|
})
|
|
5650
|
-
},
|
|
5651
|
-
function
|
|
5657
|
+
}, V = /\r\n?|\n|\u2028|\u2029/, ki = new RegExp(V.source, "g");
|
|
5658
|
+
function Ai(e) {
|
|
5652
5659
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
5653
5660
|
}
|
|
5654
|
-
function
|
|
5661
|
+
function ji(e, t, n) {
|
|
5655
5662
|
n === void 0 && (n = e.length);
|
|
5656
5663
|
for (var r = t; r < n; r++) {
|
|
5657
5664
|
var i = e.charCodeAt(r);
|
|
5658
|
-
if (
|
|
5665
|
+
if (Ai(i)) return r < n - 1 && i === 13 && e.charCodeAt(r + 1) === 10 ? r + 2 : r + 1;
|
|
5659
5666
|
}
|
|
5660
5667
|
return -1;
|
|
5661
5668
|
}
|
|
5662
|
-
var
|
|
5663
|
-
return
|
|
5664
|
-
}),
|
|
5665
|
-
return
|
|
5666
|
-
}),
|
|
5667
|
-
function
|
|
5668
|
-
return
|
|
5669
|
+
var Mi = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, H = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, Ni = Object.prototype, Pi = Ni.hasOwnProperty, Fi = Ni.toString, Ii = Object.hasOwn || (function(e, t) {
|
|
5670
|
+
return Pi.call(e, t);
|
|
5671
|
+
}), Li = Array.isArray || (function(e) {
|
|
5672
|
+
return Fi.call(e) === "[object Array]";
|
|
5673
|
+
}), Ri = Object.create(null);
|
|
5674
|
+
function zi(e) {
|
|
5675
|
+
return Ri[e] || (Ri[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
5669
5676
|
}
|
|
5670
|
-
function
|
|
5677
|
+
function Bi(e) {
|
|
5671
5678
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
5672
5679
|
}
|
|
5673
|
-
var
|
|
5680
|
+
var Vi = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, Hi = function(e, t) {
|
|
5674
5681
|
this.line = e, this.column = t;
|
|
5675
5682
|
};
|
|
5676
|
-
|
|
5677
|
-
return new
|
|
5683
|
+
Hi.prototype.offset = function(e) {
|
|
5684
|
+
return new Hi(this.line, this.column + e);
|
|
5678
5685
|
};
|
|
5679
|
-
var
|
|
5686
|
+
var Ui = function(e, t, n) {
|
|
5680
5687
|
this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
5681
5688
|
};
|
|
5682
|
-
function
|
|
5689
|
+
function Wi(e, t) {
|
|
5683
5690
|
for (var n = 1, r = 0;;) {
|
|
5684
|
-
var i =
|
|
5685
|
-
if (i < 0) return new
|
|
5691
|
+
var i = ji(e, r, t);
|
|
5692
|
+
if (i < 0) return new Hi(n, t - r);
|
|
5686
5693
|
++n, r = i;
|
|
5687
5694
|
}
|
|
5688
5695
|
}
|
|
5689
|
-
var
|
|
5696
|
+
var Gi = {
|
|
5690
5697
|
ecmaVersion: null,
|
|
5691
5698
|
sourceType: "script",
|
|
5692
5699
|
strict: !1,
|
|
@@ -5708,20 +5715,20 @@ var Ki = {
|
|
|
5708
5715
|
sourceFile: null,
|
|
5709
5716
|
directSourceFile: null,
|
|
5710
5717
|
preserveParens: !1
|
|
5711
|
-
},
|
|
5712
|
-
function
|
|
5718
|
+
}, Ki = !1;
|
|
5719
|
+
function qi(e) {
|
|
5713
5720
|
var t = {};
|
|
5714
|
-
for (var n in
|
|
5715
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
5721
|
+
for (var n in Gi) t[n] = e && Ii(e, n) ? e[n] : Gi[n];
|
|
5722
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!Ki && typeof console == "object" && console.warn && (Ki = !0, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved ??= t.ecmaVersion < 5, (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), Li(t.onToken)) {
|
|
5716
5723
|
var r = t.onToken;
|
|
5717
5724
|
t.onToken = function(e) {
|
|
5718
5725
|
return r.push(e);
|
|
5719
5726
|
};
|
|
5720
5727
|
}
|
|
5721
|
-
if (
|
|
5728
|
+
if (Li(t.onComment) && (t.onComment = Ji(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
5722
5729
|
return t;
|
|
5723
5730
|
}
|
|
5724
|
-
function
|
|
5731
|
+
function Ji(e, t) {
|
|
5725
5732
|
return function(n, r, i, a, o, s) {
|
|
5726
5733
|
var c = {
|
|
5727
5734
|
type: n ? "Block" : "Line",
|
|
@@ -5729,20 +5736,20 @@ function Yi(e, t) {
|
|
|
5729
5736
|
start: i,
|
|
5730
5737
|
end: a
|
|
5731
5738
|
};
|
|
5732
|
-
e.locations && (c.loc = new
|
|
5739
|
+
e.locations && (c.loc = new Ui(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
5733
5740
|
};
|
|
5734
5741
|
}
|
|
5735
|
-
var
|
|
5736
|
-
function
|
|
5737
|
-
return
|
|
5742
|
+
var Yi = 1, Xi = 2, Zi = 4, Qi = 8, $i = 16, ea = 32, ta = 64, na = 128, ra = 256, ia = 512, aa = 1024, oa = Yi | Xi | ra;
|
|
5743
|
+
function sa(e, t) {
|
|
5744
|
+
return Xi | (e ? Zi : 0) | (t ? Qi : 0);
|
|
5738
5745
|
}
|
|
5739
|
-
var
|
|
5740
|
-
this.options = e =
|
|
5746
|
+
var ca = 0, la = 1, ua = 2, da = 3, fa = 4, pa = 5, U = function(e, t, n) {
|
|
5747
|
+
this.options = e = qi(e), this.sourceFile = e.sourceFile, this.keywords = zi(xi[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
5741
5748
|
var r = "";
|
|
5742
|
-
e.allowReserved !== !0 && (r =
|
|
5743
|
-
var i = (r ? r + " " : "") +
|
|
5744
|
-
this.reservedWordsStrict =
|
|
5745
|
-
},
|
|
5749
|
+
e.allowReserved !== !0 && (r = yi[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = zi(r);
|
|
5750
|
+
var i = (r ? r + " " : "") + yi.strict;
|
|
5751
|
+
this.reservedWordsStrict = zi(i), this.reservedWordsStrictBind = zi(i + " " + yi.strictBind), this.input = String(t), this.containsEsc = !1, this.pos = n || 0, this.curLine = 1, e.startLocation ? (this.lineStart = this.pos - e.startLocation.column, this.curLine = e.startLocation.line) : n ? (this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.options.locations && (this.curLine = this.input.slice(0, this.lineStart).split(V).length)) : this.lineStart = 0, this.type = B.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? Xi : Yi), this.regexpState = null, this.privateNameStack = [];
|
|
5752
|
+
}, W = {
|
|
5746
5753
|
inFunction: { configurable: !0 },
|
|
5747
5754
|
inGenerator: { configurable: !0 },
|
|
5748
5755
|
inAsync: { configurable: !0 },
|
|
@@ -5755,120 +5762,120 @@ var la = 0, ua = 1, da = 2, fa = 3, pa = 4, ma = 5, H = function(e, t, n) {
|
|
|
5755
5762
|
allowUsing: { configurable: !0 },
|
|
5756
5763
|
inClassStaticBlock: { configurable: !0 }
|
|
5757
5764
|
};
|
|
5758
|
-
|
|
5765
|
+
U.prototype.parse = function() {
|
|
5759
5766
|
var e = this, t = this.options.program || this.startNode();
|
|
5760
5767
|
return this.nextToken(), this.catchStackOverflow(function() {
|
|
5761
5768
|
return e.parseTopLevel(t);
|
|
5762
5769
|
});
|
|
5763
|
-
},
|
|
5764
|
-
return (this.currentVarScope().flags &
|
|
5765
|
-
},
|
|
5766
|
-
return (this.currentVarScope().flags & $i) > 0;
|
|
5767
|
-
}, U.inAsync.get = function() {
|
|
5770
|
+
}, W.inFunction.get = function() {
|
|
5771
|
+
return (this.currentVarScope().flags & Xi) > 0;
|
|
5772
|
+
}, W.inGenerator.get = function() {
|
|
5768
5773
|
return (this.currentVarScope().flags & Qi) > 0;
|
|
5769
|
-
},
|
|
5774
|
+
}, W.inAsync.get = function() {
|
|
5775
|
+
return (this.currentVarScope().flags & Zi) > 0;
|
|
5776
|
+
}, W.canAwait.get = function() {
|
|
5770
5777
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
5771
5778
|
var t = this.scopeStack[e].flags;
|
|
5772
|
-
if (t & (
|
|
5773
|
-
if (t &
|
|
5779
|
+
if (t & (ra | ia)) return !1;
|
|
5780
|
+
if (t & Xi) return (t & Zi) > 0;
|
|
5774
5781
|
}
|
|
5775
5782
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
5776
|
-
},
|
|
5777
|
-
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags &
|
|
5778
|
-
},
|
|
5779
|
-
return (this.currentThisScope().flags &
|
|
5780
|
-
},
|
|
5781
|
-
return (this.currentThisScope().flags &
|
|
5782
|
-
},
|
|
5783
|
+
}, W.allowReturn.get = function() {
|
|
5784
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & Yi);
|
|
5785
|
+
}, W.allowSuper.get = function() {
|
|
5786
|
+
return (this.currentThisScope().flags & ta) > 0 || this.options.allowSuperOutsideMethod;
|
|
5787
|
+
}, W.allowDirectSuper.get = function() {
|
|
5788
|
+
return (this.currentThisScope().flags & na) > 0;
|
|
5789
|
+
}, W.treatFunctionsAsVar.get = function() {
|
|
5783
5790
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
5784
|
-
},
|
|
5791
|
+
}, W.allowNewDotTarget.get = function() {
|
|
5785
5792
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
5786
5793
|
var t = this.scopeStack[e].flags;
|
|
5787
|
-
if (t & (
|
|
5794
|
+
if (t & (ra | ia) || t & Xi && !(t & $i)) return !0;
|
|
5788
5795
|
}
|
|
5789
5796
|
return !1;
|
|
5790
|
-
},
|
|
5797
|
+
}, W.allowUsing.get = function() {
|
|
5791
5798
|
var e = this.currentScope().flags;
|
|
5792
|
-
return !(e &
|
|
5793
|
-
},
|
|
5794
|
-
return (this.currentVarScope().flags &
|
|
5795
|
-
},
|
|
5799
|
+
return !(e & aa || !this.inModule && e & Yi);
|
|
5800
|
+
}, W.inClassStaticBlock.get = function() {
|
|
5801
|
+
return (this.currentVarScope().flags & ra) > 0;
|
|
5802
|
+
}, U.extend = function() {
|
|
5796
5803
|
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
5797
5804
|
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
5798
5805
|
return n;
|
|
5799
|
-
},
|
|
5806
|
+
}, U.parse = function(e, t) {
|
|
5800
5807
|
return new this(t, e).parse();
|
|
5801
|
-
},
|
|
5808
|
+
}, U.parseExpressionAt = function(e, t, n) {
|
|
5802
5809
|
var r = new this(n, e, t);
|
|
5803
5810
|
return r.nextToken(), r.parseExpression();
|
|
5804
|
-
},
|
|
5811
|
+
}, U.tokenizer = function(e, t) {
|
|
5805
5812
|
return new this(t, e);
|
|
5806
|
-
}, Object.defineProperties(
|
|
5807
|
-
var
|
|
5808
|
-
|
|
5813
|
+
}, Object.defineProperties(U.prototype, W);
|
|
5814
|
+
var G = U.prototype, ma = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
5815
|
+
G.strictDirective = function(e) {
|
|
5809
5816
|
if (this.options.ecmaVersion < 5) return !1;
|
|
5810
5817
|
for (;;) {
|
|
5811
|
-
|
|
5812
|
-
var t =
|
|
5818
|
+
H.lastIndex = e, e += H.exec(this.input)[0].length;
|
|
5819
|
+
var t = ma.exec(this.input.slice(e));
|
|
5813
5820
|
if (!t) return !1;
|
|
5814
5821
|
if ((t[1] || t[2]) === "use strict") {
|
|
5815
|
-
|
|
5816
|
-
var n =
|
|
5817
|
-
return i === ";" || i === "}" ||
|
|
5822
|
+
H.lastIndex = e + t[0].length;
|
|
5823
|
+
var n = H.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
|
|
5824
|
+
return i === ";" || i === "}" || V.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
|
|
5818
5825
|
}
|
|
5819
|
-
e += t[0].length,
|
|
5826
|
+
e += t[0].length, H.lastIndex = e, e += H.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
5820
5827
|
}
|
|
5821
|
-
},
|
|
5828
|
+
}, G.eat = function(e) {
|
|
5822
5829
|
return this.type === e && (this.next(), !0);
|
|
5823
|
-
},
|
|
5824
|
-
return this.type ===
|
|
5825
|
-
},
|
|
5830
|
+
}, G.isContextual = function(e) {
|
|
5831
|
+
return this.type === B.name && this.value === e && !this.containsEsc;
|
|
5832
|
+
}, G.eatContextual = function(e) {
|
|
5826
5833
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
5827
|
-
},
|
|
5834
|
+
}, G.catchStackOverflow = function(e) {
|
|
5828
5835
|
try {
|
|
5829
5836
|
return e();
|
|
5830
5837
|
} catch (e) {
|
|
5831
5838
|
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
|
|
5832
5839
|
else throw e;
|
|
5833
5840
|
}
|
|
5834
|
-
},
|
|
5841
|
+
}, G.expectContextual = function(e) {
|
|
5835
5842
|
this.eatContextual(e) || this.unexpected();
|
|
5836
|
-
},
|
|
5837
|
-
return this.type ===
|
|
5838
|
-
},
|
|
5843
|
+
}, G.canInsertSemicolon = function() {
|
|
5844
|
+
return this.type === B.eof || this.type === B.braceR || V.test(this.input.slice(this.lastTokEnd, this.start));
|
|
5845
|
+
}, G.insertSemicolon = function() {
|
|
5839
5846
|
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
5840
|
-
},
|
|
5841
|
-
!this.eat(
|
|
5842
|
-
},
|
|
5847
|
+
}, G.semicolon = function() {
|
|
5848
|
+
!this.eat(B.semi) && !this.insertSemicolon() && this.unexpected();
|
|
5849
|
+
}, G.afterTrailingComma = function(e, t) {
|
|
5843
5850
|
if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
5844
|
-
},
|
|
5851
|
+
}, G.expect = function(e) {
|
|
5845
5852
|
this.eat(e) || this.unexpected();
|
|
5846
|
-
},
|
|
5853
|
+
}, G.unexpected = function(e) {
|
|
5847
5854
|
this.raise(e ?? this.start, "Unexpected token");
|
|
5848
5855
|
};
|
|
5849
|
-
var
|
|
5856
|
+
var ha = function() {
|
|
5850
5857
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
5851
5858
|
};
|
|
5852
|
-
|
|
5859
|
+
G.checkPatternErrors = function(e, t) {
|
|
5853
5860
|
if (e) {
|
|
5854
5861
|
e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
|
|
5855
5862
|
var n = t ? e.parenthesizedAssign : e.parenthesizedBind;
|
|
5856
5863
|
n > -1 && this.raiseRecoverable(n, t ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
5857
5864
|
}
|
|
5858
|
-
},
|
|
5865
|
+
}, G.checkExpressionErrors = function(e, t) {
|
|
5859
5866
|
if (!e) return !1;
|
|
5860
5867
|
var n = e.shorthandAssign, r = e.doubleProto;
|
|
5861
5868
|
if (!t) return n >= 0 || r >= 0;
|
|
5862
5869
|
n >= 0 && this.raise(n, "Shorthand property assignments are valid only in destructuring patterns"), r >= 0 && this.raiseRecoverable(r, "Redefinition of __proto__ property");
|
|
5863
|
-
},
|
|
5870
|
+
}, G.checkYieldAwaitInDefaultParams = function() {
|
|
5864
5871
|
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
5865
|
-
},
|
|
5872
|
+
}, G.isSimpleAssignTarget = function(e) {
|
|
5866
5873
|
return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
|
|
5867
5874
|
};
|
|
5868
|
-
var
|
|
5869
|
-
|
|
5875
|
+
var K = U.prototype;
|
|
5876
|
+
K.parseTopLevel = function(e) {
|
|
5870
5877
|
var t = Object.create(null);
|
|
5871
|
-
for (e.body ||= []; this.type !==
|
|
5878
|
+
for (e.body ||= []; this.type !== B.eof;) {
|
|
5872
5879
|
var n = this.parseStatement(null, !0, t);
|
|
5873
5880
|
e.body.push(n);
|
|
5874
5881
|
}
|
|
@@ -5878,114 +5885,114 @@ G.parseTopLevel = function(e) {
|
|
|
5878
5885
|
}
|
|
5879
5886
|
return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType, this.finishNode(e, "Program");
|
|
5880
5887
|
};
|
|
5881
|
-
var
|
|
5882
|
-
|
|
5888
|
+
var ga = { kind: "loop" }, _a = { kind: "switch" };
|
|
5889
|
+
K.isLet = function(e) {
|
|
5883
5890
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
5884
|
-
|
|
5885
|
-
var t =
|
|
5891
|
+
H.lastIndex = this.pos;
|
|
5892
|
+
var t = H.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
5886
5893
|
if (r === 91 || r === 92) return !0;
|
|
5887
5894
|
if (e) return !1;
|
|
5888
5895
|
if (r === 123) return !0;
|
|
5889
|
-
if (
|
|
5896
|
+
if (Ei(r)) {
|
|
5890
5897
|
var i = n;
|
|
5891
5898
|
do
|
|
5892
5899
|
n += r <= 65535 ? 1 : 2;
|
|
5893
|
-
while (
|
|
5900
|
+
while (Di(r = this.fullCharCodeAt(n)));
|
|
5894
5901
|
if (r === 92) return !0;
|
|
5895
5902
|
var a = this.input.slice(i, n);
|
|
5896
|
-
if (!
|
|
5903
|
+
if (!Si.test(a)) return !0;
|
|
5897
5904
|
}
|
|
5898
5905
|
return !1;
|
|
5899
|
-
},
|
|
5906
|
+
}, K.isAsyncFunction = function() {
|
|
5900
5907
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
5901
|
-
|
|
5902
|
-
var e =
|
|
5903
|
-
return !
|
|
5904
|
-
},
|
|
5908
|
+
H.lastIndex = this.pos;
|
|
5909
|
+
var e = H.exec(this.input), t = this.pos + e[0].length, n;
|
|
5910
|
+
return !V.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(Di(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
5911
|
+
}, K.isUsingKeyword = function(e, t) {
|
|
5905
5912
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
5906
|
-
|
|
5907
|
-
var n =
|
|
5908
|
-
if (
|
|
5913
|
+
H.lastIndex = this.pos;
|
|
5914
|
+
var n = H.exec(this.input), r = this.pos + n[0].length;
|
|
5915
|
+
if (V.test(this.input.slice(this.pos, r))) return !1;
|
|
5909
5916
|
if (e) {
|
|
5910
5917
|
var i = r + 5, a;
|
|
5911
|
-
if (this.input.slice(r, i) !== "using" || i === this.input.length ||
|
|
5912
|
-
|
|
5913
|
-
var o =
|
|
5914
|
-
if (r = i + o[0].length, o &&
|
|
5918
|
+
if (this.input.slice(r, i) !== "using" || i === this.input.length || Di(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
5919
|
+
H.lastIndex = i;
|
|
5920
|
+
var o = H.exec(this.input);
|
|
5921
|
+
if (r = i + o[0].length, o && V.test(this.input.slice(i, r))) return !1;
|
|
5915
5922
|
}
|
|
5916
5923
|
var s = this.fullCharCodeAt(r);
|
|
5917
|
-
if (!
|
|
5924
|
+
if (!Ei(s) && s !== 92) return !1;
|
|
5918
5925
|
var c = r;
|
|
5919
5926
|
do
|
|
5920
5927
|
r += s <= 65535 ? 1 : 2;
|
|
5921
|
-
while (
|
|
5928
|
+
while (Di(s = this.fullCharCodeAt(r)));
|
|
5922
5929
|
if (s === 92) return !0;
|
|
5923
5930
|
var l = this.input.slice(c, r);
|
|
5924
|
-
if (
|
|
5931
|
+
if (Si.test(l)) return !1;
|
|
5925
5932
|
if (t && !e && l === "of") {
|
|
5926
|
-
|
|
5927
|
-
var u =
|
|
5933
|
+
H.lastIndex = r;
|
|
5934
|
+
var u = H.exec(this.input);
|
|
5928
5935
|
if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
5929
5936
|
}
|
|
5930
5937
|
return !0;
|
|
5931
|
-
},
|
|
5938
|
+
}, K.isAwaitUsing = function(e) {
|
|
5932
5939
|
return this.isUsingKeyword(!0, e);
|
|
5933
|
-
},
|
|
5940
|
+
}, K.isUsing = function(e) {
|
|
5934
5941
|
return this.isUsingKeyword(!1, e);
|
|
5935
|
-
},
|
|
5942
|
+
}, K.parseStatement = function(e, t, n) {
|
|
5936
5943
|
var r = this.type, i = this.startNode(), a;
|
|
5937
|
-
switch (this.isLet(e) && (r =
|
|
5938
|
-
case
|
|
5939
|
-
case
|
|
5940
|
-
case
|
|
5941
|
-
case
|
|
5942
|
-
case
|
|
5943
|
-
case
|
|
5944
|
-
case
|
|
5945
|
-
case
|
|
5946
|
-
case
|
|
5947
|
-
case
|
|
5948
|
-
case
|
|
5949
|
-
case
|
|
5950
|
-
case
|
|
5951
|
-
case
|
|
5952
|
-
case
|
|
5953
|
-
case
|
|
5954
|
-
case
|
|
5955
|
-
case
|
|
5956
|
-
case
|
|
5957
|
-
case
|
|
5958
|
-
if (this.options.ecmaVersion > 10 && r ===
|
|
5959
|
-
|
|
5960
|
-
var o =
|
|
5944
|
+
switch (this.isLet(e) && (r = B._var, a = "let"), r) {
|
|
5945
|
+
case B._break:
|
|
5946
|
+
case B._continue: return this.parseBreakContinueStatement(i, r.keyword);
|
|
5947
|
+
case B._debugger: return this.parseDebuggerStatement(i);
|
|
5948
|
+
case B._do: return this.parseDoStatement(i);
|
|
5949
|
+
case B._for: return this.parseForStatement(i);
|
|
5950
|
+
case B._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(i, !1, !e);
|
|
5951
|
+
case B._class: return e && this.unexpected(), this.parseClass(i, !0);
|
|
5952
|
+
case B._if: return this.parseIfStatement(i);
|
|
5953
|
+
case B._return: return this.parseReturnStatement(i);
|
|
5954
|
+
case B._switch: return this.parseSwitchStatement(i);
|
|
5955
|
+
case B._throw: return this.parseThrowStatement(i);
|
|
5956
|
+
case B._try: return this.parseTryStatement(i);
|
|
5957
|
+
case B._const:
|
|
5958
|
+
case B._var: return a ||= this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(i, a);
|
|
5959
|
+
case B._while: return this.parseWhileStatement(i);
|
|
5960
|
+
case B._with: return this.parseWithStatement(i);
|
|
5961
|
+
case B.braceL: return this.parseBlock(!0, i);
|
|
5962
|
+
case B.semi: return this.parseEmptyStatement(i);
|
|
5963
|
+
case B._export:
|
|
5964
|
+
case B._import:
|
|
5965
|
+
if (this.options.ecmaVersion > 10 && r === B._import) {
|
|
5966
|
+
H.lastIndex = this.pos;
|
|
5967
|
+
var o = H.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
|
|
5961
5968
|
if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
|
|
5962
5969
|
}
|
|
5963
|
-
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r ===
|
|
5970
|
+
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === B._import ? this.parseImport(i) : this.parseExport(i, n);
|
|
5964
5971
|
default:
|
|
5965
5972
|
if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
|
|
5966
5973
|
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
5967
5974
|
if (l) return this.allowUsing || this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"), e && this.raise(this.start, "Using declaration is not allowed in single-statement positions"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(i, !1, l), this.semicolon(), this.finishNode(i, "VariableDeclaration");
|
|
5968
5975
|
var u = this.value, d = this.parseExpression();
|
|
5969
|
-
return r ===
|
|
5976
|
+
return r === B.name && d.type === "Identifier" && this.eat(B.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
5970
5977
|
}
|
|
5971
|
-
},
|
|
5978
|
+
}, K.parseBreakContinueStatement = function(e, t) {
|
|
5972
5979
|
var n = t === "break";
|
|
5973
|
-
this.next(), this.eat(
|
|
5980
|
+
this.next(), this.eat(B.semi) || this.insertSemicolon() ? e.label = null : this.type === B.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
|
|
5974
5981
|
for (var r = 0; r < this.labels.length; ++r) {
|
|
5975
5982
|
var i = this.labels[r];
|
|
5976
5983
|
if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
|
|
5977
5984
|
}
|
|
5978
5985
|
return r === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, n ? "BreakStatement" : "ContinueStatement");
|
|
5979
|
-
},
|
|
5986
|
+
}, K.parseDebuggerStatement = function(e) {
|
|
5980
5987
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
5981
|
-
},
|
|
5982
|
-
return this.next(), this.labels.push(
|
|
5983
|
-
},
|
|
5988
|
+
}, K.parseDoStatement = function(e) {
|
|
5989
|
+
return this.next(), this.labels.push(ga), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(B._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(B.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
5990
|
+
}, K.parseForStatement = function(e) {
|
|
5984
5991
|
this.next();
|
|
5985
5992
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
5986
|
-
if (this.labels.push(
|
|
5993
|
+
if (this.labels.push(ga), this.enterScope(0), this.expect(B.parenL), this.type === B.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
5987
5994
|
var n = this.isLet();
|
|
5988
|
-
if (this.type ===
|
|
5995
|
+
if (this.type === B._var || this.type === B._const || n) {
|
|
5989
5996
|
var r = this.startNode(), i = n ? "let" : this.value;
|
|
5990
5997
|
return this.next(), this.parseVar(r, !0, i), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
5991
5998
|
}
|
|
@@ -5994,47 +6001,47 @@ G.isLet = function(e) {
|
|
|
5994
6001
|
var c = this.startNode();
|
|
5995
6002
|
return this.next(), s === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.parseVar(c, !0, s), this.finishNode(c, "VariableDeclaration"), this.parseForAfterInit(e, c, t);
|
|
5996
6003
|
}
|
|
5997
|
-
var l = this.containsEsc, u = new
|
|
5998
|
-
return this.type ===
|
|
5999
|
-
},
|
|
6000
|
-
return (this.type ===
|
|
6001
|
-
},
|
|
6002
|
-
return this.next(), this.parseFunction(e,
|
|
6003
|
-
},
|
|
6004
|
-
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(
|
|
6005
|
-
},
|
|
6006
|
-
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(
|
|
6007
|
-
},
|
|
6008
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(
|
|
6009
|
-
for (var t, n = !1; this.type !==
|
|
6010
|
-
var r = this.type ===
|
|
6011
|
-
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(
|
|
6004
|
+
var l = this.containsEsc, u = new ha(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
6005
|
+
return this.type === B._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === B._in && this.unexpected(t), e.await = !0) : o && this.options.ecmaVersion >= 8 && (f.start === d && !l && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && o && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, u), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(u, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
|
|
6006
|
+
}, K.parseForAfterInit = function(e, t, n) {
|
|
6007
|
+
return (this.type === B._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === B._in ? ((t.kind === "using" || t.kind === "await using") && !t.declarations[0].init && this.raise(this.start, "Using declaration is not allowed in for-in loops"), this.options.ecmaVersion >= 9 && n > -1 && this.unexpected(n)) : this.options.ecmaVersion >= 9 && (e.await = n > -1), this.parseForIn(e, t)) : (n > -1 && this.unexpected(n), this.parseFor(e, t));
|
|
6008
|
+
}, K.parseFunctionStatement = function(e, t, n) {
|
|
6009
|
+
return this.next(), this.parseFunction(e, ya | (n ? 0 : ba), !1, t);
|
|
6010
|
+
}, K.parseIfStatement = function(e) {
|
|
6011
|
+
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(B._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
6012
|
+
}, K.parseReturnStatement = function(e) {
|
|
6013
|
+
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(B.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
6014
|
+
}, K.parseSwitchStatement = function(e) {
|
|
6015
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(B.braceL), this.labels.push(_a), this.enterScope(aa);
|
|
6016
|
+
for (var t, n = !1; this.type !== B.braceR;) if (this.type === B._case || this.type === B._default) {
|
|
6017
|
+
var r = this.type === B._case;
|
|
6018
|
+
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(B.colon);
|
|
6012
6019
|
} else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
6013
6020
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
6014
|
-
},
|
|
6015
|
-
return this.next(),
|
|
6021
|
+
}, K.parseThrowStatement = function(e) {
|
|
6022
|
+
return this.next(), V.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
|
|
6016
6023
|
};
|
|
6017
|
-
var
|
|
6018
|
-
|
|
6024
|
+
var va = [];
|
|
6025
|
+
K.parseCatchClauseParam = function() {
|
|
6019
6026
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
6020
|
-
return this.enterScope(t ?
|
|
6021
|
-
},
|
|
6022
|
-
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type ===
|
|
6027
|
+
return this.enterScope(t ? ea : 0), this.checkLValPattern(e, t ? fa : ua), this.expect(B.parenR), e;
|
|
6028
|
+
}, K.parseTryStatement = function(e) {
|
|
6029
|
+
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === B._catch) {
|
|
6023
6030
|
var t = this.startNode();
|
|
6024
|
-
this.next(), this.eat(
|
|
6031
|
+
this.next(), this.eat(B.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
6025
6032
|
}
|
|
6026
|
-
return e.finalizer = this.eat(
|
|
6027
|
-
},
|
|
6033
|
+
return e.finalizer = this.eat(B._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
6034
|
+
}, K.parseVarStatement = function(e, t, n) {
|
|
6028
6035
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
6029
|
-
},
|
|
6030
|
-
return this.next(), e.test = this.parseParenExpression(), this.labels.push(
|
|
6031
|
-
},
|
|
6036
|
+
}, K.parseWhileStatement = function(e) {
|
|
6037
|
+
return this.next(), e.test = this.parseParenExpression(), this.labels.push(ga), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
6038
|
+
}, K.parseWithStatement = function(e) {
|
|
6032
6039
|
return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
|
|
6033
|
-
},
|
|
6040
|
+
}, K.parseEmptyStatement = function(e) {
|
|
6034
6041
|
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
6035
|
-
},
|
|
6042
|
+
}, K.parseLabeledStatement = function(e, t, n, r) {
|
|
6036
6043
|
for (var i = 0, a = this.labels; i < a.length; i += 1) a[i].name === t && this.raise(n.start, "Label '" + t + "' is already declared");
|
|
6037
|
-
for (var o = this.type.isLoop ? "loop" : this.type ===
|
|
6044
|
+
for (var o = this.type.isLoop ? "loop" : this.type === B._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
|
|
6038
6045
|
var c = this.labels[s];
|
|
6039
6046
|
if (c.statementStart === e.start) c.statementStart = this.start, c.kind = o;
|
|
6040
6047
|
else break;
|
|
@@ -6044,113 +6051,113 @@ G.parseCatchClauseParam = function() {
|
|
|
6044
6051
|
kind: o,
|
|
6045
6052
|
statementStart: this.start
|
|
6046
6053
|
}), e.body = this.parseStatement(r ? r.indexOf("label") === -1 ? r + "label" : r : "label"), this.labels.pop(), e.label = n, this.finishNode(e, "LabeledStatement");
|
|
6047
|
-
},
|
|
6054
|
+
}, K.parseExpressionStatement = function(e, t) {
|
|
6048
6055
|
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
6049
|
-
},
|
|
6050
|
-
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(
|
|
6056
|
+
}, K.parseBlock = function(e, t, n) {
|
|
6057
|
+
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(B.braceL), e && this.enterScope(0); this.type !== B.braceR;) {
|
|
6051
6058
|
var r = this.parseStatement(null);
|
|
6052
6059
|
t.body.push(r);
|
|
6053
6060
|
}
|
|
6054
6061
|
return n && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
6055
|
-
},
|
|
6056
|
-
return e.init = t, this.expect(
|
|
6057
|
-
},
|
|
6058
|
-
var n = this.type ===
|
|
6059
|
-
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(
|
|
6060
|
-
},
|
|
6062
|
+
}, K.parseFor = function(e, t) {
|
|
6063
|
+
return e.init = t, this.expect(B.semi), e.test = this.type === B.semi ? null : this.parseExpression(), this.expect(B.semi), e.update = this.type === B.parenR ? null : this.parseExpression(), this.expect(B.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
6064
|
+
}, K.parseForIn = function(e, t) {
|
|
6065
|
+
var n = this.type === B._in;
|
|
6066
|
+
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(B.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
|
|
6067
|
+
}, K.parseVar = function(e, t, n, r) {
|
|
6061
6068
|
for (e.declarations = [], e.kind = n;;) {
|
|
6062
6069
|
var i = this.startNode();
|
|
6063
|
-
if (this.parseVarId(i, n), this.eat(
|
|
6070
|
+
if (this.parseVarId(i, n), this.eat(B.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === B._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== B._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && !(t && (this.type === B._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, e.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(B.comma)) break;
|
|
6064
6071
|
}
|
|
6065
6072
|
return e;
|
|
6066
|
-
},
|
|
6067
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ?
|
|
6073
|
+
}, K.parseVarId = function(e, t) {
|
|
6074
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? la : ua, !1);
|
|
6068
6075
|
};
|
|
6069
|
-
var
|
|
6070
|
-
|
|
6071
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type ===
|
|
6076
|
+
var ya = 1, ba = 2, xa = 4;
|
|
6077
|
+
K.parseFunction = function(e, t, n, r, i) {
|
|
6078
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === B.star && t & ba && this.unexpected(), e.generator = this.eat(B.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & ya && (e.id = t & xa && this.type !== B.name ? null : this.parseIdent(), e.id && !(t & ba) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? la : ua : da));
|
|
6072
6079
|
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
6073
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
6074
|
-
},
|
|
6075
|
-
this.expect(
|
|
6076
|
-
},
|
|
6080
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(sa(e.async, e.generator)), t & ya || (e.id = this.type === B.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, n, !1, i), this.yieldPos = a, this.awaitPos = o, this.awaitIdentPos = s, this.finishNode(e, t & ya ? "FunctionDeclaration" : "FunctionExpression");
|
|
6081
|
+
}, K.parseFunctionParams = function(e) {
|
|
6082
|
+
this.expect(B.parenL), e.params = this.parseBindingList(B.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
6083
|
+
}, K.parseClass = function(e, t) {
|
|
6077
6084
|
this.next();
|
|
6078
6085
|
var n = this.strict;
|
|
6079
6086
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
6080
6087
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
6081
|
-
for (i.body = [], this.expect(
|
|
6088
|
+
for (i.body = [], this.expect(B.braceL); this.type !== B.braceR;) {
|
|
6082
6089
|
var o = this.parseClassElement(e.superClass !== null);
|
|
6083
|
-
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" &&
|
|
6090
|
+
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" && Sa(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
6084
6091
|
}
|
|
6085
6092
|
return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
6086
|
-
},
|
|
6087
|
-
if (this.eat(
|
|
6093
|
+
}, K.parseClassElement = function(e) {
|
|
6094
|
+
if (this.eat(B.semi)) return null;
|
|
6088
6095
|
var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
|
|
6089
6096
|
if (this.eatContextual("static")) {
|
|
6090
|
-
if (t >= 13 && this.eat(
|
|
6091
|
-
this.isClassElementNameStart() || this.type ===
|
|
6097
|
+
if (t >= 13 && this.eat(B.braceL)) return this.parseClassStaticBlock(n), n;
|
|
6098
|
+
this.isClassElementNameStart() || this.type === B.star ? s = !0 : r = "static";
|
|
6092
6099
|
}
|
|
6093
|
-
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type ===
|
|
6100
|
+
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === B.star) && !this.canInsertSemicolon() ? a = !0 : r = "async"), !r && (t >= 9 || !a) && this.eat(B.star) && (i = !0), !r && !a && !i) {
|
|
6094
6101
|
var c = this.value;
|
|
6095
6102
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
6096
6103
|
}
|
|
6097
|
-
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type ===
|
|
6098
|
-
var l = !n.static &&
|
|
6104
|
+
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type === B.parenL || o !== "method" || i || a) {
|
|
6105
|
+
var l = !n.static && Ca(n, "constructor"), u = l && e;
|
|
6099
6106
|
l && o !== "method" && this.raise(n.key.start, "Constructor can't have get/set modifier"), n.kind = l ? "constructor" : o, this.parseClassMethod(n, i, a, u);
|
|
6100
6107
|
} else this.parseClassField(n);
|
|
6101
6108
|
return n;
|
|
6102
|
-
},
|
|
6103
|
-
return this.type ===
|
|
6104
|
-
},
|
|
6105
|
-
this.type ===
|
|
6106
|
-
},
|
|
6109
|
+
}, K.isClassElementNameStart = function() {
|
|
6110
|
+
return this.type === B.name || this.type === B.privateId || this.type === B.num || this.type === B.string || this.type === B.bracketL || this.type.keyword;
|
|
6111
|
+
}, K.parseClassElementName = function(e) {
|
|
6112
|
+
this.type === B.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
|
|
6113
|
+
}, K.parseClassMethod = function(e, t, n, r) {
|
|
6107
6114
|
var i = e.key;
|
|
6108
|
-
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static &&
|
|
6115
|
+
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static && Ca(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
6109
6116
|
var a = e.value = this.parseMethod(t, n, r);
|
|
6110
6117
|
return e.kind === "get" && a.params.length !== 0 && this.raiseRecoverable(a.start, "getter should have no params"), e.kind === "set" && a.params.length !== 1 && this.raiseRecoverable(a.start, "setter should have exactly one param"), e.kind === "set" && a.params[0].type === "RestElement" && this.raiseRecoverable(a.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
6111
|
-
},
|
|
6112
|
-
return
|
|
6113
|
-
},
|
|
6118
|
+
}, K.parseClassField = function(e) {
|
|
6119
|
+
return Ca(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Ca(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(B.eq) ? (this.enterScope(ia | ta), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
6120
|
+
}, K.parseClassStaticBlock = function(e) {
|
|
6114
6121
|
e.body = [];
|
|
6115
6122
|
var t = this.labels;
|
|
6116
|
-
for (this.labels = [], this.enterScope(
|
|
6123
|
+
for (this.labels = [], this.enterScope(ra | ta); this.type !== B.braceR;) {
|
|
6117
6124
|
var n = this.parseStatement(null);
|
|
6118
6125
|
e.body.push(n);
|
|
6119
6126
|
}
|
|
6120
6127
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
6121
|
-
},
|
|
6122
|
-
this.type ===
|
|
6123
|
-
},
|
|
6124
|
-
e.superClass = this.eat(
|
|
6125
|
-
},
|
|
6128
|
+
}, K.parseClassId = function(e, t) {
|
|
6129
|
+
this.type === B.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, ua, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
6130
|
+
}, K.parseClassSuper = function(e) {
|
|
6131
|
+
e.superClass = this.eat(B._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
6132
|
+
}, K.enterClassBody = function() {
|
|
6126
6133
|
var e = {
|
|
6127
6134
|
declared: Object.create(null),
|
|
6128
6135
|
used: []
|
|
6129
6136
|
};
|
|
6130
6137
|
return this.privateNameStack.push(e), e.declared;
|
|
6131
|
-
},
|
|
6138
|
+
}, K.exitClassBody = function() {
|
|
6132
6139
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
6133
6140
|
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
6134
6141
|
var o = n[a];
|
|
6135
|
-
|
|
6142
|
+
Ii(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
6136
6143
|
}
|
|
6137
6144
|
};
|
|
6138
|
-
function
|
|
6145
|
+
function Sa(e, t) {
|
|
6139
6146
|
var n = t.key.name, r = e[n], i = "true";
|
|
6140
6147
|
return t.type === "MethodDefinition" && (t.kind === "get" || t.kind === "set") && (i = (t.static ? "s" : "i") + t.kind), r === "iget" && i === "iset" || r === "iset" && i === "iget" || r === "sget" && i === "sset" || r === "sset" && i === "sget" ? (e[n] = "true", !1) : r ? !0 : (e[n] = i, !1);
|
|
6141
6148
|
}
|
|
6142
|
-
function
|
|
6149
|
+
function Ca(e, t) {
|
|
6143
6150
|
var n = e.computed, r = e.key;
|
|
6144
6151
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
6145
6152
|
}
|
|
6146
|
-
|
|
6147
|
-
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !==
|
|
6148
|
-
},
|
|
6149
|
-
if (this.next(), this.eat(
|
|
6150
|
-
if (this.eat(
|
|
6153
|
+
K.parseExportAllDeclaration = function(e, t) {
|
|
6154
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== B.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
6155
|
+
}, K.parseExport = function(e, t) {
|
|
6156
|
+
if (this.next(), this.eat(B.star)) return this.parseExportAllDeclaration(e, t);
|
|
6157
|
+
if (this.eat(B._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
6151
6158
|
if (this.shouldParseExportStatement()) e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
6152
6159
|
else {
|
|
6153
|
-
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !==
|
|
6160
|
+
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== B.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
6154
6161
|
else {
|
|
6155
6162
|
for (var n = 0, r = e.specifiers; n < r.length; n += 1) {
|
|
6156
6163
|
var i = r[n];
|
|
@@ -6161,23 +6168,23 @@ G.parseExportAllDeclaration = function(e, t) {
|
|
|
6161
6168
|
this.semicolon();
|
|
6162
6169
|
}
|
|
6163
6170
|
return this.finishNode(e, "ExportNamedDeclaration");
|
|
6164
|
-
},
|
|
6171
|
+
}, K.parseExportDeclaration = function(e) {
|
|
6165
6172
|
return this.parseStatement(null);
|
|
6166
|
-
},
|
|
6173
|
+
}, K.parseExportDefaultDeclaration = function() {
|
|
6167
6174
|
var e;
|
|
6168
|
-
if (this.type ===
|
|
6175
|
+
if (this.type === B._function || (e = this.isAsyncFunction())) {
|
|
6169
6176
|
var t = this.startNode();
|
|
6170
|
-
return this.next(), e && this.next(), this.parseFunction(t,
|
|
6177
|
+
return this.next(), e && this.next(), this.parseFunction(t, ya | xa, !1, e);
|
|
6171
6178
|
}
|
|
6172
|
-
if (this.type ===
|
|
6179
|
+
if (this.type === B._class) {
|
|
6173
6180
|
var n = this.startNode();
|
|
6174
6181
|
return this.parseClass(n, "nullableID");
|
|
6175
6182
|
}
|
|
6176
6183
|
var r = this.parseMaybeAssign();
|
|
6177
6184
|
return this.semicolon(), r;
|
|
6178
|
-
},
|
|
6179
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
6180
|
-
},
|
|
6185
|
+
}, K.checkExport = function(e, t, n) {
|
|
6186
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), Ii(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
6187
|
+
}, K.checkPatternExport = function(e, t) {
|
|
6181
6188
|
var n = t.type;
|
|
6182
6189
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
6183
6190
|
else if (n === "ObjectPattern") for (var r = 0, i = t.properties; r < i.length; r += 1) {
|
|
@@ -6189,72 +6196,72 @@ G.parseExportAllDeclaration = function(e, t) {
|
|
|
6189
6196
|
c && this.checkPatternExport(e, c);
|
|
6190
6197
|
}
|
|
6191
6198
|
else n === "Property" ? this.checkPatternExport(e, t.value) : n === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : n === "RestElement" && this.checkPatternExport(e, t.argument);
|
|
6192
|
-
},
|
|
6199
|
+
}, K.checkVariableExport = function(e, t) {
|
|
6193
6200
|
if (e) for (var n = 0, r = t; n < r.length; n += 1) {
|
|
6194
6201
|
var i = r[n];
|
|
6195
6202
|
this.checkPatternExport(e, i.id);
|
|
6196
6203
|
}
|
|
6197
|
-
},
|
|
6204
|
+
}, K.shouldParseExportStatement = function() {
|
|
6198
6205
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
6199
|
-
},
|
|
6206
|
+
}, K.parseExportSpecifier = function(e) {
|
|
6200
6207
|
var t = this.startNode();
|
|
6201
6208
|
return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(e, t.exported, t.exported.start), this.finishNode(t, "ExportSpecifier");
|
|
6202
|
-
},
|
|
6209
|
+
}, K.parseExportSpecifiers = function(e) {
|
|
6203
6210
|
var t = [], n = !0;
|
|
6204
|
-
for (this.expect(
|
|
6211
|
+
for (this.expect(B.braceL); !this.eat(B.braceR);) {
|
|
6205
6212
|
if (n) n = !1;
|
|
6206
|
-
else if (this.expect(
|
|
6213
|
+
else if (this.expect(B.comma), this.afterTrailingComma(B.braceR)) break;
|
|
6207
6214
|
t.push(this.parseExportSpecifier(e));
|
|
6208
6215
|
}
|
|
6209
6216
|
return t;
|
|
6210
|
-
},
|
|
6211
|
-
return this.next(), this.type ===
|
|
6212
|
-
},
|
|
6217
|
+
}, K.parseImport = function(e) {
|
|
6218
|
+
return this.next(), this.type === B.string ? (e.specifiers = va, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === B.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
6219
|
+
}, K.parseImportSpecifier = function() {
|
|
6213
6220
|
var e = this.startNode();
|
|
6214
|
-
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local,
|
|
6215
|
-
},
|
|
6221
|
+
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, ua), this.finishNode(e, "ImportSpecifier");
|
|
6222
|
+
}, K.parseImportDefaultSpecifier = function() {
|
|
6216
6223
|
var e = this.startNode();
|
|
6217
|
-
return e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
6218
|
-
},
|
|
6224
|
+
return e.local = this.parseIdent(), this.checkLValSimple(e.local, ua), this.finishNode(e, "ImportDefaultSpecifier");
|
|
6225
|
+
}, K.parseImportNamespaceSpecifier = function() {
|
|
6219
6226
|
var e = this.startNode();
|
|
6220
|
-
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
6221
|
-
},
|
|
6227
|
+
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, ua), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
6228
|
+
}, K.parseImportSpecifiers = function() {
|
|
6222
6229
|
var e = [], t = !0;
|
|
6223
|
-
if (this.type ===
|
|
6224
|
-
if (this.type ===
|
|
6225
|
-
for (this.expect(
|
|
6230
|
+
if (this.type === B.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(B.comma))) return e;
|
|
6231
|
+
if (this.type === B.star) return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
6232
|
+
for (this.expect(B.braceL); !this.eat(B.braceR);) {
|
|
6226
6233
|
if (t) t = !1;
|
|
6227
|
-
else if (this.expect(
|
|
6234
|
+
else if (this.expect(B.comma), this.afterTrailingComma(B.braceR)) break;
|
|
6228
6235
|
e.push(this.parseImportSpecifier());
|
|
6229
6236
|
}
|
|
6230
6237
|
return e;
|
|
6231
|
-
},
|
|
6238
|
+
}, K.parseWithClause = function() {
|
|
6232
6239
|
var e = [];
|
|
6233
|
-
if (!this.eat(
|
|
6234
|
-
this.expect(
|
|
6235
|
-
for (var t = {}, n = !0; !this.eat(
|
|
6240
|
+
if (!this.eat(B._with)) return e;
|
|
6241
|
+
this.expect(B.braceL);
|
|
6242
|
+
for (var t = {}, n = !0; !this.eat(B.braceR);) {
|
|
6236
6243
|
if (n) n = !1;
|
|
6237
|
-
else if (this.expect(
|
|
6244
|
+
else if (this.expect(B.comma), this.afterTrailingComma(B.braceR)) break;
|
|
6238
6245
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
6239
|
-
|
|
6246
|
+
Ii(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
6240
6247
|
}
|
|
6241
6248
|
return e;
|
|
6242
|
-
},
|
|
6249
|
+
}, K.parseImportAttribute = function() {
|
|
6243
6250
|
var e = this.startNode();
|
|
6244
|
-
return e.key = this.type ===
|
|
6245
|
-
},
|
|
6246
|
-
if (this.options.ecmaVersion >= 13 && this.type ===
|
|
6251
|
+
return e.key = this.type === B.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(B.colon), this.type !== B.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
6252
|
+
}, K.parseModuleExportName = function() {
|
|
6253
|
+
if (this.options.ecmaVersion >= 13 && this.type === B.string) {
|
|
6247
6254
|
var e = this.parseLiteral(this.value);
|
|
6248
|
-
return
|
|
6255
|
+
return Vi.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
6249
6256
|
}
|
|
6250
6257
|
return this.parseIdent(!0);
|
|
6251
|
-
},
|
|
6258
|
+
}, K.adaptDirectivePrologue = function(e) {
|
|
6252
6259
|
for (var t = 0; t < e.length && this.isDirectiveCandidate(e[t]); ++t) e[t].directive = e[t].expression.raw.slice(1, -1);
|
|
6253
|
-
},
|
|
6260
|
+
}, K.isDirectiveCandidate = function(e) {
|
|
6254
6261
|
return this.options.ecmaVersion >= 5 && e.type === "ExpressionStatement" && e.expression.type === "Literal" && typeof e.expression.value == "string" && (this.input[e.start] === "\"" || this.input[e.start] === "'");
|
|
6255
6262
|
};
|
|
6256
|
-
var
|
|
6257
|
-
|
|
6263
|
+
var q = U.prototype;
|
|
6264
|
+
q.toAssignable = function(e, t, n) {
|
|
6258
6265
|
if (this.options.ecmaVersion >= 6 && e) switch (e.type) {
|
|
6259
6266
|
case "Identifier":
|
|
6260
6267
|
this.inAsync && e.name === "await" && this.raise(e.start, "Cannot use 'await' as identifier inside an async function");
|
|
@@ -6293,7 +6300,7 @@ K.toAssignable = function(e, t, n) {
|
|
|
6293
6300
|
}
|
|
6294
6301
|
else n && this.checkPatternErrors(n, !0);
|
|
6295
6302
|
return e;
|
|
6296
|
-
},
|
|
6303
|
+
}, q.toAssignableList = function(e, t) {
|
|
6297
6304
|
for (var n = e.length, r = 0; r < n; r++) {
|
|
6298
6305
|
var i = e[r];
|
|
6299
6306
|
i && this.toAssignable(i, t);
|
|
@@ -6303,44 +6310,44 @@ K.toAssignable = function(e, t, n) {
|
|
|
6303
6310
|
this.options.ecmaVersion === 6 && t && a && a.type === "RestElement" && a.argument.type !== "Identifier" && this.unexpected(a.argument.start);
|
|
6304
6311
|
}
|
|
6305
6312
|
return e;
|
|
6306
|
-
},
|
|
6313
|
+
}, q.parseSpread = function(e) {
|
|
6307
6314
|
var t = this.startNode();
|
|
6308
6315
|
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
6309
|
-
},
|
|
6316
|
+
}, q.parseRestBinding = function() {
|
|
6310
6317
|
var e = this.startNode();
|
|
6311
|
-
return this.next(), this.options.ecmaVersion === 6 && this.type !==
|
|
6312
|
-
},
|
|
6318
|
+
return this.next(), this.options.ecmaVersion === 6 && this.type !== B.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
6319
|
+
}, q.parseBindingAtom = function() {
|
|
6313
6320
|
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
6314
|
-
case
|
|
6321
|
+
case B.bracketL:
|
|
6315
6322
|
var e = this.startNode();
|
|
6316
|
-
return this.next(), e.elements = this.parseBindingList(
|
|
6317
|
-
case
|
|
6323
|
+
return this.next(), e.elements = this.parseBindingList(B.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
6324
|
+
case B.braceL: return this.parseObj(!0);
|
|
6318
6325
|
}
|
|
6319
6326
|
return this.parseIdent();
|
|
6320
|
-
},
|
|
6321
|
-
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(
|
|
6327
|
+
}, q.parseBindingList = function(e, t, n, r) {
|
|
6328
|
+
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(B.comma), t && this.type === B.comma) i.push(null);
|
|
6322
6329
|
else if (n && this.afterTrailingComma(e)) break;
|
|
6323
|
-
else if (this.type ===
|
|
6330
|
+
else if (this.type === B.ellipsis) {
|
|
6324
6331
|
var o = this.parseRestBinding();
|
|
6325
|
-
this.parseBindingListItem(o), i.push(o), this.type ===
|
|
6332
|
+
this.parseBindingListItem(o), i.push(o), this.type === B.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
6326
6333
|
break;
|
|
6327
6334
|
} else i.push(this.parseAssignableListItem(r));
|
|
6328
6335
|
return i;
|
|
6329
|
-
},
|
|
6336
|
+
}, q.parseAssignableListItem = function(e) {
|
|
6330
6337
|
var t = this.parseMaybeDefault(this.start, this.startLoc);
|
|
6331
6338
|
return this.parseBindingListItem(t), t;
|
|
6332
|
-
},
|
|
6339
|
+
}, q.parseBindingListItem = function(e) {
|
|
6333
6340
|
return e;
|
|
6334
|
-
},
|
|
6335
|
-
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(
|
|
6341
|
+
}, q.parseMaybeDefault = function(e, t, n) {
|
|
6342
|
+
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(B.eq)) return n;
|
|
6336
6343
|
var r = this.startNodeAt(e, t);
|
|
6337
6344
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
6338
|
-
},
|
|
6339
|
-
t === void 0 && (t =
|
|
6340
|
-
var r = t !==
|
|
6345
|
+
}, q.checkLValSimple = function(e, t, n) {
|
|
6346
|
+
t === void 0 && (t = ca);
|
|
6347
|
+
var r = t !== ca;
|
|
6341
6348
|
switch (e.type) {
|
|
6342
6349
|
case "Identifier":
|
|
6343
|
-
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t ===
|
|
6350
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === ua && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (Ii(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== pa && this.declareName(e.name, t, e.start));
|
|
6344
6351
|
break;
|
|
6345
6352
|
case "ChainExpression":
|
|
6346
6353
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -6351,8 +6358,8 @@ K.toAssignable = function(e, t, n) {
|
|
|
6351
6358
|
case "ParenthesizedExpression": return r && this.raiseRecoverable(e.start, "Binding parenthesized expression"), this.checkLValSimple(e.expression, t, n);
|
|
6352
6359
|
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
6353
6360
|
}
|
|
6354
|
-
},
|
|
6355
|
-
switch (t === void 0 && (t =
|
|
6361
|
+
}, q.checkLValPattern = function(e, t, n) {
|
|
6362
|
+
switch (t === void 0 && (t = ca), e.type) {
|
|
6356
6363
|
case "ObjectPattern":
|
|
6357
6364
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
6358
6365
|
var a = i[r];
|
|
@@ -6367,8 +6374,8 @@ K.toAssignable = function(e, t, n) {
|
|
|
6367
6374
|
break;
|
|
6368
6375
|
default: this.checkLValSimple(e, t, n);
|
|
6369
6376
|
}
|
|
6370
|
-
},
|
|
6371
|
-
switch (t === void 0 && (t =
|
|
6377
|
+
}, q.checkLValInnerPattern = function(e, t, n) {
|
|
6378
|
+
switch (t === void 0 && (t = ca), e.type) {
|
|
6372
6379
|
case "Property":
|
|
6373
6380
|
this.checkLValInnerPattern(e.value, t, n);
|
|
6374
6381
|
break;
|
|
@@ -6381,72 +6388,72 @@ K.toAssignable = function(e, t, n) {
|
|
|
6381
6388
|
default: this.checkLValPattern(e, t, n);
|
|
6382
6389
|
}
|
|
6383
6390
|
};
|
|
6384
|
-
var
|
|
6391
|
+
var J = function(e, t, n, r, i) {
|
|
6385
6392
|
this.token = e, this.isExpr = !!t, this.preserveSpace = !!n, this.override = r, this.generator = !!i;
|
|
6386
|
-
},
|
|
6387
|
-
b_stat: new
|
|
6388
|
-
b_expr: new
|
|
6389
|
-
b_tmpl: new
|
|
6390
|
-
p_stat: new
|
|
6391
|
-
p_expr: new
|
|
6392
|
-
q_tmpl: new
|
|
6393
|
+
}, Y = {
|
|
6394
|
+
b_stat: new J("{", !1),
|
|
6395
|
+
b_expr: new J("{", !0),
|
|
6396
|
+
b_tmpl: new J("${", !1),
|
|
6397
|
+
p_stat: new J("(", !1),
|
|
6398
|
+
p_expr: new J("(", !0),
|
|
6399
|
+
q_tmpl: new J("`", !0, !0, function(e) {
|
|
6393
6400
|
return e.tryReadTemplateToken();
|
|
6394
6401
|
}),
|
|
6395
|
-
f_stat: new
|
|
6396
|
-
f_expr: new
|
|
6397
|
-
f_expr_gen: new
|
|
6398
|
-
f_gen: new
|
|
6399
|
-
},
|
|
6400
|
-
|
|
6401
|
-
return [
|
|
6402
|
-
},
|
|
6402
|
+
f_stat: new J("function", !1),
|
|
6403
|
+
f_expr: new J("function", !0),
|
|
6404
|
+
f_expr_gen: new J("function", !0, !1, null, !0),
|
|
6405
|
+
f_gen: new J("function", !1, !1, null, !0)
|
|
6406
|
+
}, wa = U.prototype;
|
|
6407
|
+
wa.initialContext = function() {
|
|
6408
|
+
return [Y.b_stat];
|
|
6409
|
+
}, wa.curContext = function() {
|
|
6403
6410
|
return this.context[this.context.length - 1];
|
|
6404
|
-
},
|
|
6411
|
+
}, wa.braceIsBlock = function(e) {
|
|
6405
6412
|
var t = this.curContext();
|
|
6406
|
-
return t ===
|
|
6407
|
-
},
|
|
6413
|
+
return t === Y.f_expr || t === Y.f_stat ? !0 : e === B.colon && (t === Y.b_stat || t === Y.b_expr) ? !t.isExpr : e === B._return || e === B.name && this.exprAllowed ? V.test(this.input.slice(this.lastTokEnd, this.start)) : e === B._else || e === B.semi || e === B.eof || e === B.parenR || e === B.arrow ? !0 : e === B.braceL ? t === Y.b_stat : e === B._var || e === B._const || e === B.name ? !1 : !this.exprAllowed;
|
|
6414
|
+
}, wa.inGeneratorContext = function() {
|
|
6408
6415
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
6409
6416
|
var t = this.context[e];
|
|
6410
6417
|
if (t.token === "function") return t.generator;
|
|
6411
6418
|
}
|
|
6412
6419
|
return !1;
|
|
6413
|
-
},
|
|
6420
|
+
}, wa.updateContext = function(e) {
|
|
6414
6421
|
var t, n = this.type;
|
|
6415
|
-
n.keyword && e ===
|
|
6416
|
-
},
|
|
6422
|
+
n.keyword && e === B.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
6423
|
+
}, wa.overrideContext = function(e) {
|
|
6417
6424
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
6418
|
-
},
|
|
6425
|
+
}, B.parenR.updateContext = B.braceR.updateContext = function() {
|
|
6419
6426
|
if (this.context.length === 1) {
|
|
6420
6427
|
this.exprAllowed = !0;
|
|
6421
6428
|
return;
|
|
6422
6429
|
}
|
|
6423
6430
|
var e = this.context.pop();
|
|
6424
|
-
e ===
|
|
6425
|
-
},
|
|
6426
|
-
this.context.push(this.braceIsBlock(e) ?
|
|
6427
|
-
},
|
|
6428
|
-
this.context.push(
|
|
6429
|
-
},
|
|
6430
|
-
var t = e ===
|
|
6431
|
-
this.context.push(t ?
|
|
6432
|
-
},
|
|
6433
|
-
e.beforeExpr && e !==
|
|
6434
|
-
},
|
|
6431
|
+
e === Y.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
6432
|
+
}, B.braceL.updateContext = function(e) {
|
|
6433
|
+
this.context.push(this.braceIsBlock(e) ? Y.b_stat : Y.b_expr), this.exprAllowed = !0;
|
|
6434
|
+
}, B.dollarBraceL.updateContext = function() {
|
|
6435
|
+
this.context.push(Y.b_tmpl), this.exprAllowed = !0;
|
|
6436
|
+
}, B.parenL.updateContext = function(e) {
|
|
6437
|
+
var t = e === B._if || e === B._for || e === B._with || e === B._while;
|
|
6438
|
+
this.context.push(t ? Y.p_stat : Y.p_expr), this.exprAllowed = !0;
|
|
6439
|
+
}, B.incDec.updateContext = function() {}, B._function.updateContext = B._class.updateContext = function(e) {
|
|
6440
|
+
e.beforeExpr && e !== B._else && (e !== B.semi || this.curContext() === Y.p_stat) && !(e === B._return && V.test(this.input.slice(this.lastTokEnd, this.start))) && (e !== B.colon && e !== B.braceL || this.curContext() !== Y.b_stat) ? this.context.push(Y.f_expr) : this.context.push(Y.f_stat), this.exprAllowed = !1;
|
|
6441
|
+
}, B.colon.updateContext = function() {
|
|
6435
6442
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
6436
|
-
},
|
|
6437
|
-
this.curContext() ===
|
|
6438
|
-
},
|
|
6439
|
-
if (e ===
|
|
6443
|
+
}, B.backQuote.updateContext = function() {
|
|
6444
|
+
this.curContext() === Y.q_tmpl ? this.context.pop() : this.context.push(Y.q_tmpl), this.exprAllowed = !1;
|
|
6445
|
+
}, B.star.updateContext = function(e) {
|
|
6446
|
+
if (e === B._function) {
|
|
6440
6447
|
var t = this.context.length - 1;
|
|
6441
|
-
this.context[t] ===
|
|
6448
|
+
this.context[t] === Y.f_expr ? this.context[t] = Y.f_expr_gen : this.context[t] = Y.f_gen;
|
|
6442
6449
|
}
|
|
6443
6450
|
this.exprAllowed = !0;
|
|
6444
|
-
},
|
|
6451
|
+
}, B.name.updateContext = function(e) {
|
|
6445
6452
|
var t = !1;
|
|
6446
|
-
this.options.ecmaVersion >= 6 && e !==
|
|
6453
|
+
this.options.ecmaVersion >= 6 && e !== B.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
6447
6454
|
};
|
|
6448
|
-
var
|
|
6449
|
-
|
|
6455
|
+
var X = U.prototype;
|
|
6456
|
+
X.checkPropClash = function(e, t, n) {
|
|
6450
6457
|
if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
|
|
6451
6458
|
var r = e.key, i;
|
|
6452
6459
|
switch (r.type) {
|
|
@@ -6471,65 +6478,65 @@ Y.checkPropClash = function(e, t, n) {
|
|
|
6471
6478
|
set: !1
|
|
6472
6479
|
}, o[a] = !0;
|
|
6473
6480
|
}
|
|
6474
|
-
},
|
|
6481
|
+
}, X.parseExpression = function(e, t) {
|
|
6475
6482
|
var n = this;
|
|
6476
6483
|
return this.catchStackOverflow(function() {
|
|
6477
6484
|
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
6478
|
-
if (n.type ===
|
|
6485
|
+
if (n.type === B.comma) {
|
|
6479
6486
|
var o = n.startNodeAt(r, i);
|
|
6480
|
-
for (o.expressions = [a]; n.eat(
|
|
6487
|
+
for (o.expressions = [a]; n.eat(B.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
|
|
6481
6488
|
return n.finishNode(o, "SequenceExpression");
|
|
6482
6489
|
}
|
|
6483
6490
|
return a;
|
|
6484
6491
|
});
|
|
6485
|
-
},
|
|
6492
|
+
}, X.parseMaybeAssign = function(e, t, n) {
|
|
6486
6493
|
if (this.isContextual("yield")) {
|
|
6487
6494
|
if (this.inGenerator) return this.parseYield(e);
|
|
6488
6495
|
this.exprAllowed = !1;
|
|
6489
6496
|
}
|
|
6490
6497
|
var r = !1, i = -1, a = -1, o = -1;
|
|
6491
|
-
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
6498
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new ha(), r = !0);
|
|
6492
6499
|
var s = this.start, c = this.startLoc;
|
|
6493
|
-
(this.type ===
|
|
6500
|
+
(this.type === B.parenL || this.type === B.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
6494
6501
|
var l = this.parseMaybeConditional(e, t);
|
|
6495
6502
|
if (n && (l = n.call(this, l, s, c)), this.type.isAssign) {
|
|
6496
6503
|
var u = this.startNodeAt(s, c);
|
|
6497
|
-
return u.operator = this.value, this.type ===
|
|
6504
|
+
return u.operator = this.value, this.type === B.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === B.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), u.left = l, this.next(), u.right = this.parseMaybeAssign(e), o > -1 && (t.doubleProto = o), this.finishNode(u, "AssignmentExpression");
|
|
6498
6505
|
}
|
|
6499
6506
|
return r && this.checkExpressionErrors(t, !0), i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
6500
|
-
},
|
|
6507
|
+
}, X.parseMaybeConditional = function(e, t) {
|
|
6501
6508
|
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
6502
6509
|
if (this.checkExpressionErrors(t)) return i;
|
|
6503
|
-
if ((i.type !== "ArrowFunctionExpression" || i.start !== n) && this.eat(
|
|
6510
|
+
if ((i.type !== "ArrowFunctionExpression" || i.start !== n) && this.eat(B.question)) {
|
|
6504
6511
|
var a = this.startNodeAt(n, r);
|
|
6505
|
-
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(
|
|
6512
|
+
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(B.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
6506
6513
|
}
|
|
6507
6514
|
return i;
|
|
6508
|
-
},
|
|
6515
|
+
}, X.parseExprOps = function(e, t) {
|
|
6509
6516
|
var n = this.start, r = this.startLoc, i = this.parseMaybeUnary(t, !1, !1, e);
|
|
6510
6517
|
return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
|
|
6511
|
-
},
|
|
6518
|
+
}, X.parseExprOp = function(e, t, n, r, i) {
|
|
6512
6519
|
var a = this.type.binop;
|
|
6513
|
-
if (a != null && (!i || this.type !==
|
|
6514
|
-
var o = this.type ===
|
|
6515
|
-
s && (a =
|
|
6520
|
+
if (a != null && (!i || this.type !== B._in) && a > r) {
|
|
6521
|
+
var o = this.type === B.logicalOR || this.type === B.logicalAND, s = this.type === B.coalesce;
|
|
6522
|
+
s && (a = B.logicalAND.binop);
|
|
6516
6523
|
var c = this.value;
|
|
6517
6524
|
this.next();
|
|
6518
6525
|
var l = this.start, u = this.startLoc, d = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, i), l, u, a, i), f = this.buildBinary(t, n, e, d, c, o || s);
|
|
6519
|
-
return (o && this.type ===
|
|
6526
|
+
return (o && this.type === B.coalesce || s && (this.type === B.logicalOR || this.type === B.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(f, t, n, r, i);
|
|
6520
6527
|
}
|
|
6521
6528
|
return e;
|
|
6522
|
-
},
|
|
6529
|
+
}, X.buildBinary = function(e, t, n, r, i, a) {
|
|
6523
6530
|
r.type === "PrivateIdentifier" && this.raise(r.start, "Private identifier can only be left side of binary expression");
|
|
6524
6531
|
var o = this.startNodeAt(e, t);
|
|
6525
6532
|
return o.left = n, o.operator = i, o.right = r, this.finishNode(o, a ? "LogicalExpression" : "BinaryExpression");
|
|
6526
|
-
},
|
|
6533
|
+
}, X.parseMaybeUnary = function(e, t, n, r) {
|
|
6527
6534
|
var i = this.start, a = this.startLoc, o;
|
|
6528
6535
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
6529
6536
|
else if (this.type.prefix) {
|
|
6530
|
-
var s = this.startNode(), c = this.type ===
|
|
6531
|
-
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" &&
|
|
6532
|
-
} else if (!t && this.type ===
|
|
6537
|
+
var s = this.startNode(), c = this.type === B.incDec;
|
|
6538
|
+
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" && Ta(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && Ea(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
|
|
6539
|
+
} else if (!t && this.type === B.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== B._in && this.unexpected();
|
|
6533
6540
|
else {
|
|
6534
6541
|
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
6535
6542
|
for (; this.type.postfix && !this.canInsertSemicolon();) {
|
|
@@ -6537,23 +6544,23 @@ Y.checkPropClash = function(e, t, n) {
|
|
|
6537
6544
|
l.operator = this.value, l.prefix = !1, l.argument = o, this.checkLValSimple(o), this.next(), o = this.finishNode(l, "UpdateExpression");
|
|
6538
6545
|
}
|
|
6539
6546
|
}
|
|
6540
|
-
if (!n && (o.type !== "ArrowFunctionExpression" || o.start !== i) && this.eat(
|
|
6547
|
+
if (!n && (o.type !== "ArrowFunctionExpression" || o.start !== i) && this.eat(B.starstar)) {
|
|
6541
6548
|
if (t) this.unexpected(this.lastTokStart);
|
|
6542
6549
|
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
6543
6550
|
} else return o;
|
|
6544
6551
|
};
|
|
6545
|
-
function
|
|
6546
|
-
return e.type === "Identifier" || e.type === "ParenthesizedExpression" &&
|
|
6552
|
+
function Ta(e) {
|
|
6553
|
+
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && Ta(e.expression);
|
|
6547
6554
|
}
|
|
6548
|
-
function
|
|
6549
|
-
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" &&
|
|
6555
|
+
function Ea(e) {
|
|
6556
|
+
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && Ea(e.expression) || e.type === "ParenthesizedExpression" && Ea(e.expression);
|
|
6550
6557
|
}
|
|
6551
|
-
|
|
6558
|
+
X.parseExprSubscripts = function(e, t) {
|
|
6552
6559
|
var n = this.start, r = this.startLoc, i = this.parseExprAtom(e, t);
|
|
6553
6560
|
if (i.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") return i;
|
|
6554
6561
|
var a = this.parseSubscripts(i, n, r, !1, t);
|
|
6555
6562
|
return e && a.type === "MemberExpression" && (e.parenthesizedAssign >= a.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= a.start && (e.parenthesizedBind = -1), e.trailingComma >= a.start && (e.trailingComma = -1)), a;
|
|
6556
|
-
},
|
|
6563
|
+
}, X.parseSubscripts = function(e, t, n, r, i) {
|
|
6557
6564
|
for (var a = 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, o = !1;;) {
|
|
6558
6565
|
var s = this.parseSubscript(e, t, n, r, a, o, i);
|
|
6559
6566
|
if (s.optional && (o = !0), s === e || s.type === "ArrowFunctionExpression") {
|
|
@@ -6565,116 +6572,116 @@ Y.parseExprSubscripts = function(e, t) {
|
|
|
6565
6572
|
}
|
|
6566
6573
|
e = s;
|
|
6567
6574
|
}
|
|
6568
|
-
},
|
|
6569
|
-
return !this.canInsertSemicolon() && this.eat(
|
|
6570
|
-
},
|
|
6575
|
+
}, X.shouldParseAsyncArrow = function() {
|
|
6576
|
+
return !this.canInsertSemicolon() && this.eat(B.arrow);
|
|
6577
|
+
}, X.parseSubscriptAsyncArrow = function(e, t, n, r) {
|
|
6571
6578
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
|
|
6572
|
-
},
|
|
6573
|
-
var s = this.options.ecmaVersion >= 11, c = s && this.eat(
|
|
6579
|
+
}, X.parseSubscript = function(e, t, n, r, i, a, o) {
|
|
6580
|
+
var s = this.options.ecmaVersion >= 11, c = s && this.eat(B.questionDot);
|
|
6574
6581
|
r && c && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
6575
|
-
var l = this.eat(
|
|
6576
|
-
if (l || c && this.type !==
|
|
6582
|
+
var l = this.eat(B.bracketL);
|
|
6583
|
+
if (l || c && this.type !== B.parenL && this.type !== B.backQuote || this.eat(B.dot)) {
|
|
6577
6584
|
var u = this.startNodeAt(t, n);
|
|
6578
|
-
u.object = e, l ? (u.property = this.parseExpression(), this.expect(
|
|
6579
|
-
} else if (!r && this.eat(
|
|
6580
|
-
var d = new
|
|
6585
|
+
u.object = e, l ? (u.property = this.parseExpression(), this.expect(B.bracketR)) : u.property = this.type === B.privateId && e.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
6586
|
+
} else if (!r && this.eat(B.parenL)) {
|
|
6587
|
+
var d = new ha(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
6581
6588
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
6582
|
-
var h = this.parseExprList(
|
|
6589
|
+
var h = this.parseExprList(B.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
6583
6590
|
if (i && !c && this.shouldParseAsyncArrow()) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = f, this.awaitPos = p, this.awaitIdentPos = m, this.parseSubscriptAsyncArrow(t, n, h, o);
|
|
6584
6591
|
this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
|
|
6585
6592
|
var g = this.startNodeAt(t, n);
|
|
6586
6593
|
g.callee = e, g.arguments = h, s && (g.optional = c), e = this.finishNode(g, "CallExpression");
|
|
6587
|
-
} else if (this.type ===
|
|
6594
|
+
} else if (this.type === B.backQuote) {
|
|
6588
6595
|
(c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
6589
6596
|
var _ = this.startNodeAt(t, n);
|
|
6590
6597
|
_.tag = e, _.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(_, "TaggedTemplateExpression");
|
|
6591
6598
|
}
|
|
6592
6599
|
return e;
|
|
6593
|
-
},
|
|
6594
|
-
this.type ===
|
|
6600
|
+
}, X.parseExprAtom = function(e, t, n) {
|
|
6601
|
+
this.type === B.slash && this.readRegexp();
|
|
6595
6602
|
var r, i = this.potentialArrowAt === this.start;
|
|
6596
6603
|
switch (this.type) {
|
|
6597
|
-
case
|
|
6598
|
-
case
|
|
6599
|
-
case
|
|
6604
|
+
case B._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === B.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== B.dot && this.type !== B.bracketL && this.type !== B.parenL && this.unexpected(), this.finishNode(r, "Super");
|
|
6605
|
+
case B._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
6606
|
+
case B.name:
|
|
6600
6607
|
var a = this.start, o = this.startLoc, s = this.containsEsc, c = this.parseIdent(!1);
|
|
6601
|
-
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(
|
|
6608
|
+
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(B._function)) return this.overrideContext(Y.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
|
|
6602
6609
|
if (i && !this.canInsertSemicolon()) {
|
|
6603
|
-
if (this.eat(
|
|
6604
|
-
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type ===
|
|
6610
|
+
if (this.eat(B.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
|
|
6611
|
+
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === B.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(B.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
|
|
6605
6612
|
}
|
|
6606
6613
|
return c;
|
|
6607
|
-
case
|
|
6614
|
+
case B.regexp:
|
|
6608
6615
|
var l = this.value;
|
|
6609
6616
|
return r = this.parseLiteral(l.value), r.regex = {
|
|
6610
6617
|
pattern: l.pattern,
|
|
6611
6618
|
flags: l.flags
|
|
6612
6619
|
}, r;
|
|
6613
|
-
case
|
|
6614
|
-
case
|
|
6615
|
-
case
|
|
6616
|
-
case
|
|
6617
|
-
case
|
|
6618
|
-
case
|
|
6620
|
+
case B.num:
|
|
6621
|
+
case B.string: return this.parseLiteral(this.value);
|
|
6622
|
+
case B._null:
|
|
6623
|
+
case B._true:
|
|
6624
|
+
case B._false: return r = this.startNode(), r.value = this.type === B._null ? null : this.type === B._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
|
|
6625
|
+
case B.parenL:
|
|
6619
6626
|
var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
|
|
6620
6627
|
return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(d) && (e.parenthesizedAssign = u), e.parenthesizedBind < 0 && (e.parenthesizedBind = u)), d;
|
|
6621
|
-
case
|
|
6622
|
-
case
|
|
6623
|
-
case
|
|
6624
|
-
case
|
|
6625
|
-
case
|
|
6626
|
-
case
|
|
6627
|
-
case
|
|
6628
|
+
case B.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(B.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
6629
|
+
case B.braceL: return this.overrideContext(Y.b_expr), this.parseObj(!1, e);
|
|
6630
|
+
case B._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
6631
|
+
case B._class: return this.parseClass(this.startNode(), !1);
|
|
6632
|
+
case B._new: return this.parseNew();
|
|
6633
|
+
case B.backQuote: return this.parseTemplate();
|
|
6634
|
+
case B._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
|
|
6628
6635
|
default: return this.parseExprAtomDefault();
|
|
6629
6636
|
}
|
|
6630
|
-
},
|
|
6637
|
+
}, X.parseExprAtomDefault = function() {
|
|
6631
6638
|
this.unexpected();
|
|
6632
|
-
},
|
|
6639
|
+
}, X.parseExprImport = function(e) {
|
|
6633
6640
|
var t = this.startNode();
|
|
6634
|
-
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type ===
|
|
6635
|
-
if (this.type ===
|
|
6641
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === B.parenL && !e) return this.parseDynamicImport(t);
|
|
6642
|
+
if (this.type === B.dot) {
|
|
6636
6643
|
var n = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
6637
6644
|
return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
|
|
6638
6645
|
}
|
|
6639
6646
|
this.unexpected();
|
|
6640
|
-
},
|
|
6641
|
-
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(
|
|
6642
|
-
else if (!this.eat(
|
|
6647
|
+
}, X.parseDynamicImport = function(e) {
|
|
6648
|
+
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(B.parenR) ? e.options = null : (this.expect(B.comma), this.afterTrailingComma(B.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(B.parenR) || (this.expect(B.comma), this.afterTrailingComma(B.parenR) || this.unexpected())));
|
|
6649
|
+
else if (!this.eat(B.parenR)) {
|
|
6643
6650
|
var t = this.start;
|
|
6644
|
-
this.eat(
|
|
6651
|
+
this.eat(B.comma) && this.eat(B.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
6645
6652
|
}
|
|
6646
6653
|
return this.finishNode(e, "ImportExpression");
|
|
6647
|
-
},
|
|
6654
|
+
}, X.parseImportMeta = function(e) {
|
|
6648
6655
|
this.next();
|
|
6649
6656
|
var t = this.containsEsc;
|
|
6650
6657
|
return e.property = this.parseIdent(!0), e.property.name !== "meta" && this.raiseRecoverable(e.property.start, "The only valid meta property for import is 'import.meta'"), t && this.raiseRecoverable(e.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(e.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e, "MetaProperty");
|
|
6651
|
-
},
|
|
6658
|
+
}, X.parseLiteral = function(e) {
|
|
6652
6659
|
var t = this.startNode();
|
|
6653
6660
|
return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value == null ? t.raw.slice(0, -1).replace(/_/g, "") : t.value.toString()), this.next(), this.finishNode(t, "Literal");
|
|
6654
|
-
},
|
|
6655
|
-
this.expect(
|
|
6661
|
+
}, X.parseParenExpression = function() {
|
|
6662
|
+
this.expect(B.parenL);
|
|
6656
6663
|
var e = this.parseExpression();
|
|
6657
|
-
return this.expect(
|
|
6658
|
-
},
|
|
6664
|
+
return this.expect(B.parenR), e;
|
|
6665
|
+
}, X.shouldParseArrow = function(e) {
|
|
6659
6666
|
return !this.canInsertSemicolon();
|
|
6660
|
-
},
|
|
6667
|
+
}, X.parseParenAndDistinguishExpression = function(e, t) {
|
|
6661
6668
|
var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
|
|
6662
6669
|
if (this.options.ecmaVersion >= 6) {
|
|
6663
6670
|
this.next();
|
|
6664
|
-
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new
|
|
6665
|
-
for (this.yieldPos = 0, this.awaitPos = 0; this.type !==
|
|
6666
|
-
if (l ? l = !1 : this.expect(
|
|
6671
|
+
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new ha(), f = this.yieldPos, p = this.awaitPos, m;
|
|
6672
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== B.parenR;) {
|
|
6673
|
+
if (l ? l = !1 : this.expect(B.comma), a && this.afterTrailingComma(B.parenR, !0)) {
|
|
6667
6674
|
u = !0;
|
|
6668
6675
|
break;
|
|
6669
6676
|
}
|
|
6670
|
-
if (this.type ===
|
|
6671
|
-
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type ===
|
|
6677
|
+
if (this.type === B.ellipsis) {
|
|
6678
|
+
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type === B.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
6672
6679
|
break;
|
|
6673
6680
|
}
|
|
6674
6681
|
c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
|
|
6675
6682
|
}
|
|
6676
6683
|
var h = this.lastTokEnd, g = this.lastTokEndLoc;
|
|
6677
|
-
if (this.expect(
|
|
6684
|
+
if (this.expect(B.parenR), e && this.shouldParseArrow(c) && this.eat(B.arrow)) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = f, this.awaitPos = p, this.parseParenArrowList(n, r, c, t);
|
|
6678
6685
|
(!c.length || u) && this.unexpected(this.lastTokStart), m && this.unexpected(m), this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, c.length > 1 ? (i = this.startNodeAt(o, s), i.expressions = c, this.finishNodeAt(i, "SequenceExpression", h, g)) : i = c[0];
|
|
6679
6686
|
} else i = this.parseParenExpression();
|
|
6680
6687
|
if (this.options.preserveParens) {
|
|
@@ -6682,59 +6689,59 @@ Y.parseExprSubscripts = function(e, t) {
|
|
|
6682
6689
|
return _.expression = i, this.finishNode(_, "ParenthesizedExpression");
|
|
6683
6690
|
}
|
|
6684
6691
|
return i;
|
|
6685
|
-
},
|
|
6692
|
+
}, X.parseParenItem = function(e) {
|
|
6686
6693
|
return e;
|
|
6687
|
-
},
|
|
6694
|
+
}, X.parseParenArrowList = function(e, t, n, r) {
|
|
6688
6695
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !1, r);
|
|
6689
6696
|
};
|
|
6690
|
-
var
|
|
6691
|
-
|
|
6697
|
+
var Da = [];
|
|
6698
|
+
X.parseNew = function() {
|
|
6692
6699
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
6693
6700
|
var e = this.startNode();
|
|
6694
|
-
if (this.next(), this.options.ecmaVersion >= 6 && this.type ===
|
|
6701
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === B.dot) {
|
|
6695
6702
|
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
6696
6703
|
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
6697
6704
|
var n = this.containsEsc;
|
|
6698
6705
|
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), n && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
6699
6706
|
}
|
|
6700
6707
|
var r = this.start, i = this.startLoc;
|
|
6701
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), e.arguments = this.eat(
|
|
6702
|
-
},
|
|
6708
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), e.arguments = this.eat(B.parenL) ? this.parseExprList(B.parenR, this.options.ecmaVersion >= 8, !1) : Da, this.finishNode(e, "NewExpression");
|
|
6709
|
+
}, X.parseTemplateElement = function(e) {
|
|
6703
6710
|
var t = e.isTagged, n = this.startNode();
|
|
6704
|
-
return this.type ===
|
|
6711
|
+
return this.type === B.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
6705
6712
|
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
6706
6713
|
cooked: null
|
|
6707
6714
|
}) : n.value = {
|
|
6708
6715
|
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
|
|
6709
6716
|
cooked: this.value
|
|
6710
|
-
}, this.next(), n.tail = this.type ===
|
|
6711
|
-
},
|
|
6717
|
+
}, this.next(), n.tail = this.type === B.backQuote, this.finishNode(n, "TemplateElement");
|
|
6718
|
+
}, X.parseTemplate = function(e) {
|
|
6712
6719
|
e === void 0 && (e = {});
|
|
6713
6720
|
var t = e.isTagged;
|
|
6714
6721
|
t === void 0 && (t = !1);
|
|
6715
6722
|
var n = this.startNode();
|
|
6716
6723
|
this.next(), n.expressions = [];
|
|
6717
6724
|
var r = this.parseTemplateElement({ isTagged: t });
|
|
6718
|
-
for (n.quasis = [r]; !r.tail;) this.type ===
|
|
6725
|
+
for (n.quasis = [r]; !r.tail;) this.type === B.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(B.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(B.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
6719
6726
|
return this.next(), this.finishNode(n, "TemplateLiteral");
|
|
6720
|
-
},
|
|
6721
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type ===
|
|
6722
|
-
},
|
|
6727
|
+
}, X.isAsyncProp = function(e) {
|
|
6728
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === B.name || this.type === B.num || this.type === B.string || this.type === B.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === B.star) && !V.test(this.input.slice(this.lastTokEnd, this.start));
|
|
6729
|
+
}, X.parseObj = function(e, t) {
|
|
6723
6730
|
var n = this.startNode(), r = !0, i = {};
|
|
6724
|
-
for (n.properties = [], this.next(); !this.eat(
|
|
6731
|
+
for (n.properties = [], this.next(); !this.eat(B.braceR);) {
|
|
6725
6732
|
if (r) r = !1;
|
|
6726
|
-
else if (this.expect(
|
|
6733
|
+
else if (this.expect(B.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(B.braceR)) break;
|
|
6727
6734
|
var a = this.parseProperty(e, t);
|
|
6728
6735
|
e || this.checkPropClash(a, i, t), n.properties.push(a);
|
|
6729
6736
|
}
|
|
6730
6737
|
return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
|
|
6731
|
-
},
|
|
6738
|
+
}, X.parseProperty = function(e, t) {
|
|
6732
6739
|
var n = this.startNode(), r, i, a, o;
|
|
6733
|
-
if (this.options.ecmaVersion >= 9 && this.eat(
|
|
6734
|
-
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(
|
|
6740
|
+
if (this.options.ecmaVersion >= 9 && this.eat(B.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === B.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(n, "RestElement")) : (n.argument = this.parseMaybeAssign(!1, t), this.type === B.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
|
|
6741
|
+
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(B.star)));
|
|
6735
6742
|
var s = this.containsEsc;
|
|
6736
|
-
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(
|
|
6737
|
-
},
|
|
6743
|
+
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(B.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
|
|
6744
|
+
}, X.parseGetterSetter = function(e) {
|
|
6738
6745
|
var t = e.key.name;
|
|
6739
6746
|
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
6740
6747
|
var n = e.kind === "get" ? 0 : 1;
|
|
@@ -6742,202 +6749,202 @@ Y.parseNew = function() {
|
|
|
6742
6749
|
var r = e.value.start;
|
|
6743
6750
|
e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
|
|
6744
6751
|
} else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
6745
|
-
},
|
|
6746
|
-
(n || r) && this.type ===
|
|
6747
|
-
},
|
|
6752
|
+
}, X.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
|
|
6753
|
+
(n || r) && this.type === B.colon && this.unexpected(), this.eat(B.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === B.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(n, r), e.kind = "init") : !t && !s && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== B.comma && this.type !== B.braceR && this.type !== B.eq ? ((n || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((n || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = i), t ? e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key)) : this.type === B.eq && o ? (o.shorthandAssign < 0 && (o.shorthandAssign = this.start), e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
6754
|
+
}, X.parsePropertyName = function(e) {
|
|
6748
6755
|
if (this.options.ecmaVersion >= 6) {
|
|
6749
|
-
if (this.eat(
|
|
6756
|
+
if (this.eat(B.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(B.bracketR), e.key;
|
|
6750
6757
|
e.computed = !1;
|
|
6751
6758
|
}
|
|
6752
|
-
return e.key = this.type ===
|
|
6753
|
-
},
|
|
6759
|
+
return e.key = this.type === B.num || this.type === B.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
6760
|
+
}, X.initFunction = function(e) {
|
|
6754
6761
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
6755
|
-
},
|
|
6762
|
+
}, X.parseMethod = function(e, t, n) {
|
|
6756
6763
|
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
6757
|
-
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(
|
|
6758
|
-
},
|
|
6764
|
+
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(sa(t, r.generator) | ta | (n ? na : 0)), this.expect(B.parenL), r.params = this.parseBindingList(B.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(r, "FunctionExpression");
|
|
6765
|
+
}, X.parseArrowExpression = function(e, t, n, r) {
|
|
6759
6766
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
6760
|
-
return this.enterScope(
|
|
6761
|
-
},
|
|
6762
|
-
var i = t && this.type !==
|
|
6767
|
+
return this.enterScope(sa(n, !1) | $i), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(e, "ArrowFunctionExpression");
|
|
6768
|
+
}, X.parseFunctionBody = function(e, t, n, r) {
|
|
6769
|
+
var i = t && this.type !== B.braceL, a = this.strict, o = !1;
|
|
6763
6770
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
6764
6771
|
else {
|
|
6765
6772
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
6766
6773
|
(!a || s) && (o = this.strictDirective(this.end), o && s && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
6767
6774
|
var c = this.labels;
|
|
6768
|
-
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id,
|
|
6775
|
+
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, pa), e.body = this.parseBlock(!1, void 0, o && !a), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = c;
|
|
6769
6776
|
}
|
|
6770
6777
|
this.exitScope();
|
|
6771
|
-
},
|
|
6778
|
+
}, X.isSimpleParamList = function(e) {
|
|
6772
6779
|
for (var t = 0, n = e; t < n.length; t += 1) if (n[t].type !== "Identifier") return !1;
|
|
6773
6780
|
return !0;
|
|
6774
|
-
},
|
|
6781
|
+
}, X.checkParams = function(e, t) {
|
|
6775
6782
|
for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
|
|
6776
6783
|
var a = i[r];
|
|
6777
|
-
this.checkLValInnerPattern(a,
|
|
6784
|
+
this.checkLValInnerPattern(a, la, t ? null : n);
|
|
6778
6785
|
}
|
|
6779
|
-
},
|
|
6786
|
+
}, X.parseExprList = function(e, t, n, r) {
|
|
6780
6787
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
6781
6788
|
if (a) a = !1;
|
|
6782
|
-
else if (this.expect(
|
|
6789
|
+
else if (this.expect(B.comma), t && this.afterTrailingComma(e)) break;
|
|
6783
6790
|
var o = void 0;
|
|
6784
|
-
n && this.type ===
|
|
6791
|
+
n && this.type === B.comma ? o = null : this.type === B.ellipsis ? (o = this.parseSpread(r), r && this.type === B.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
|
|
6785
6792
|
}
|
|
6786
6793
|
return i;
|
|
6787
|
-
},
|
|
6794
|
+
}, X.checkUnreserved = function(e) {
|
|
6788
6795
|
var t = e.start, n = e.end, r = e.name;
|
|
6789
|
-
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags &
|
|
6790
|
-
},
|
|
6796
|
+
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & oa) && r === "arguments" && this.raiseRecoverable(t, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (r === "arguments" || r === "await") && this.raise(t, "Cannot use " + r + " in class static initialization block"), this.keywords.test(r) && this.raise(t, "Unexpected keyword '" + r + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(t, n).indexOf("\\") !== -1) && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(r) && (!this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t, "The keyword '" + r + "' is reserved"));
|
|
6797
|
+
}, X.parseIdent = function(e) {
|
|
6791
6798
|
var t = this.parseIdentNode();
|
|
6792
6799
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
6793
|
-
},
|
|
6800
|
+
}, X.parseIdentNode = function() {
|
|
6794
6801
|
var e = this.startNode();
|
|
6795
|
-
return this.type ===
|
|
6796
|
-
},
|
|
6802
|
+
return this.type === B.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = B.name) : this.unexpected(), e;
|
|
6803
|
+
}, X.parsePrivateIdent = function() {
|
|
6797
6804
|
var e = this.startNode();
|
|
6798
|
-
return this.type ===
|
|
6799
|
-
},
|
|
6805
|
+
return this.type === B.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
6806
|
+
}, X.parseYield = function(e) {
|
|
6800
6807
|
this.yieldPos ||= this.start;
|
|
6801
6808
|
var t = this.startNode();
|
|
6802
|
-
return this.next(), this.type ===
|
|
6803
|
-
},
|
|
6809
|
+
return this.next(), this.type === B.semi || this.canInsertSemicolon() || this.type !== B.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(B.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
6810
|
+
}, X.parseAwait = function(e) {
|
|
6804
6811
|
this.awaitPos ||= this.start;
|
|
6805
6812
|
var t = this.startNode();
|
|
6806
6813
|
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
6807
6814
|
};
|
|
6808
|
-
var
|
|
6809
|
-
|
|
6810
|
-
var n =
|
|
6815
|
+
var Oa = U.prototype;
|
|
6816
|
+
Oa.raise = function(e, t) {
|
|
6817
|
+
var n = Wi(this.input, e);
|
|
6811
6818
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
6812
6819
|
var r = SyntaxError(t);
|
|
6813
6820
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
6814
|
-
},
|
|
6815
|
-
if (this.options.locations) return new
|
|
6821
|
+
}, Oa.raiseRecoverable = Oa.raise, Oa.curPosition = function() {
|
|
6822
|
+
if (this.options.locations) return new Hi(this.curLine, this.pos - this.lineStart);
|
|
6816
6823
|
};
|
|
6817
|
-
var
|
|
6824
|
+
var ka = U.prototype, Aa = function(e) {
|
|
6818
6825
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
6819
6826
|
};
|
|
6820
|
-
|
|
6821
|
-
this.scopeStack.push(new
|
|
6822
|
-
},
|
|
6827
|
+
ka.enterScope = function(e) {
|
|
6828
|
+
this.scopeStack.push(new Aa(e));
|
|
6829
|
+
}, ka.exitScope = function() {
|
|
6823
6830
|
this.scopeStack.pop();
|
|
6824
|
-
},
|
|
6825
|
-
return e.flags &
|
|
6826
|
-
},
|
|
6831
|
+
}, ka.treatFunctionsAsVarInScope = function(e) {
|
|
6832
|
+
return e.flags & Xi || !this.inModule && e.flags & Yi;
|
|
6833
|
+
}, ka.declareName = function(e, t, n) {
|
|
6827
6834
|
var r = !1;
|
|
6828
|
-
if (t ===
|
|
6835
|
+
if (t === ua) {
|
|
6829
6836
|
var i = this.currentScope();
|
|
6830
|
-
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags &
|
|
6831
|
-
} else if (t ===
|
|
6832
|
-
else if (t ===
|
|
6837
|
+
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & Yi && delete this.undefinedExports[e];
|
|
6838
|
+
} else if (t === fa) this.currentScope().lexical.push(e);
|
|
6839
|
+
else if (t === da) {
|
|
6833
6840
|
var a = this.currentScope();
|
|
6834
6841
|
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
6835
6842
|
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
6836
6843
|
var s = this.scopeStack[o];
|
|
6837
|
-
if (s.lexical.indexOf(e) > -1 && !(s.flags &
|
|
6844
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & ea && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
6838
6845
|
r = !0;
|
|
6839
6846
|
break;
|
|
6840
6847
|
}
|
|
6841
|
-
if (s.var.push(e), this.inModule && s.flags &
|
|
6848
|
+
if (s.var.push(e), this.inModule && s.flags & Yi && delete this.undefinedExports[e], s.flags & oa) break;
|
|
6842
6849
|
}
|
|
6843
6850
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
6844
|
-
},
|
|
6851
|
+
}, ka.checkLocalExport = function(e) {
|
|
6845
6852
|
this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
|
|
6846
|
-
},
|
|
6853
|
+
}, ka.currentScope = function() {
|
|
6847
6854
|
return this.scopeStack[this.scopeStack.length - 1];
|
|
6848
|
-
},
|
|
6855
|
+
}, ka.currentVarScope = function() {
|
|
6849
6856
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
6850
6857
|
var t = this.scopeStack[e];
|
|
6851
|
-
if (t.flags & (
|
|
6858
|
+
if (t.flags & (oa | ia | ra)) return t;
|
|
6852
6859
|
}
|
|
6853
|
-
},
|
|
6860
|
+
}, ka.currentThisScope = function() {
|
|
6854
6861
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
6855
6862
|
var t = this.scopeStack[e];
|
|
6856
|
-
if (t.flags & (
|
|
6863
|
+
if (t.flags & (oa | ia | ra) && !(t.flags & $i)) return t;
|
|
6857
6864
|
}
|
|
6858
6865
|
};
|
|
6859
|
-
var
|
|
6860
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
6861
|
-
},
|
|
6862
|
-
|
|
6863
|
-
return new
|
|
6864
|
-
},
|
|
6865
|
-
return new
|
|
6866
|
+
var ja = function(e, t, n) {
|
|
6867
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new Ui(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
6868
|
+
}, Ma = U.prototype;
|
|
6869
|
+
Ma.startNode = function() {
|
|
6870
|
+
return new ja(this, this.start, this.startLoc);
|
|
6871
|
+
}, Ma.startNodeAt = function(e, t) {
|
|
6872
|
+
return new ja(this, e, t);
|
|
6866
6873
|
};
|
|
6867
|
-
function
|
|
6874
|
+
function Na(e, t, n, r) {
|
|
6868
6875
|
return e.type = t, e.end = n, this.options.locations && (e.loc.end = r), this.options.ranges && (e.range[1] = n), e;
|
|
6869
6876
|
}
|
|
6870
|
-
|
|
6871
|
-
return
|
|
6872
|
-
},
|
|
6873
|
-
return
|
|
6874
|
-
},
|
|
6875
|
-
var t = new
|
|
6877
|
+
Ma.finishNode = function(e, t) {
|
|
6878
|
+
return Na.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
|
|
6879
|
+
}, Ma.finishNodeAt = function(e, t, n, r) {
|
|
6880
|
+
return Na.call(this, e, t, n, r);
|
|
6881
|
+
}, Ma.copyNode = function(e) {
|
|
6882
|
+
var t = new ja(this, e.start, this.startLoc);
|
|
6876
6883
|
for (var n in e) t[n] = e[n];
|
|
6877
6884
|
return t;
|
|
6878
6885
|
};
|
|
6879
|
-
var
|
|
6880
|
-
9:
|
|
6881
|
-
10:
|
|
6882
|
-
11:
|
|
6883
|
-
12:
|
|
6884
|
-
13:
|
|
6885
|
-
14:
|
|
6886
|
-
},
|
|
6886
|
+
var Pa = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz", Fa = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", Ia = Fa + " Extended_Pictographic", La = Ia, Ra = La + " EBase EComp EMod EPres ExtPict", za = Ra, Ba = {
|
|
6887
|
+
9: Fa,
|
|
6888
|
+
10: Ia,
|
|
6889
|
+
11: La,
|
|
6890
|
+
12: Ra,
|
|
6891
|
+
13: za,
|
|
6892
|
+
14: za
|
|
6893
|
+
}, Va = {
|
|
6887
6894
|
9: "",
|
|
6888
6895
|
10: "",
|
|
6889
6896
|
11: "",
|
|
6890
6897
|
12: "",
|
|
6891
6898
|
13: "",
|
|
6892
6899
|
14: "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"
|
|
6893
|
-
},
|
|
6894
|
-
9:
|
|
6895
|
-
10:
|
|
6896
|
-
11:
|
|
6897
|
-
12:
|
|
6898
|
-
13:
|
|
6899
|
-
14:
|
|
6900
|
-
},
|
|
6901
|
-
function
|
|
6902
|
-
var t =
|
|
6903
|
-
binary:
|
|
6904
|
-
binaryOfStrings:
|
|
6900
|
+
}, Ha = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", Ua = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", Wa = Ua + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", Ga = Wa + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", Ka = Ga + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", qa = Ka + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", Ja = {
|
|
6901
|
+
9: Ua,
|
|
6902
|
+
10: Wa,
|
|
6903
|
+
11: Ga,
|
|
6904
|
+
12: Ka,
|
|
6905
|
+
13: qa,
|
|
6906
|
+
14: qa + " " + Pa
|
|
6907
|
+
}, Ya = {};
|
|
6908
|
+
function Xa(e) {
|
|
6909
|
+
var t = Ya[e] = {
|
|
6910
|
+
binary: zi(Ba[e] + " " + Ha),
|
|
6911
|
+
binaryOfStrings: zi(Va[e]),
|
|
6905
6912
|
nonBinary: {
|
|
6906
|
-
General_Category:
|
|
6907
|
-
Script:
|
|
6913
|
+
General_Category: zi(Ha),
|
|
6914
|
+
Script: zi(Ja[e])
|
|
6908
6915
|
}
|
|
6909
6916
|
};
|
|
6910
6917
|
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
6911
6918
|
}
|
|
6912
|
-
for (var
|
|
6919
|
+
for (var Za = 0, Qa = [
|
|
6913
6920
|
9,
|
|
6914
6921
|
10,
|
|
6915
6922
|
11,
|
|
6916
6923
|
12,
|
|
6917
6924
|
13,
|
|
6918
6925
|
14
|
|
6919
|
-
];
|
|
6920
|
-
var
|
|
6921
|
-
|
|
6926
|
+
]; Za < Qa.length; Za += 1) {
|
|
6927
|
+
var $a = Qa[Za];
|
|
6928
|
+
Xa($a);
|
|
6922
6929
|
}
|
|
6923
|
-
var
|
|
6930
|
+
var Z = U.prototype, eo = function(e, t) {
|
|
6924
6931
|
this.parent = e, this.base = t || this;
|
|
6925
6932
|
};
|
|
6926
|
-
|
|
6933
|
+
eo.prototype.separatedFrom = function(e) {
|
|
6927
6934
|
for (var t = this; t; t = t.parent) for (var n = e; n; n = n.parent) if (t.base === n.base && t !== n) return !0;
|
|
6928
6935
|
return !1;
|
|
6929
|
-
},
|
|
6930
|
-
return new
|
|
6936
|
+
}, eo.prototype.sibling = function() {
|
|
6937
|
+
return new eo(this.parent, this.base);
|
|
6931
6938
|
};
|
|
6932
|
-
var
|
|
6933
|
-
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties =
|
|
6939
|
+
var to = function(e) {
|
|
6940
|
+
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = Ya[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
6934
6941
|
};
|
|
6935
|
-
|
|
6942
|
+
to.prototype.reset = function(e, t, n) {
|
|
6936
6943
|
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
6937
6944
|
this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
|
|
6938
|
-
},
|
|
6945
|
+
}, to.prototype.raise = function(e) {
|
|
6939
6946
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
6940
|
-
},
|
|
6947
|
+
}, to.prototype.at = function(e, t) {
|
|
6941
6948
|
t === void 0 && (t = !1);
|
|
6942
6949
|
var n = this.source, r = n.length;
|
|
6943
6950
|
if (e >= r) return -1;
|
|
@@ -6945,21 +6952,21 @@ no.prototype.reset = function(e, t, n) {
|
|
|
6945
6952
|
if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
|
|
6946
6953
|
var a = n.charCodeAt(e + 1);
|
|
6947
6954
|
return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
|
|
6948
|
-
},
|
|
6955
|
+
}, to.prototype.nextIndex = function(e, t) {
|
|
6949
6956
|
t === void 0 && (t = !1);
|
|
6950
6957
|
var n = this.source, r = n.length;
|
|
6951
6958
|
if (e >= r) return r;
|
|
6952
6959
|
var i = n.charCodeAt(e), a;
|
|
6953
6960
|
return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
|
|
6954
|
-
},
|
|
6961
|
+
}, to.prototype.current = function(e) {
|
|
6955
6962
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
6956
|
-
},
|
|
6963
|
+
}, to.prototype.lookahead = function(e) {
|
|
6957
6964
|
return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
|
|
6958
|
-
},
|
|
6965
|
+
}, to.prototype.advance = function(e) {
|
|
6959
6966
|
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
6960
|
-
},
|
|
6967
|
+
}, to.prototype.eat = function(e, t) {
|
|
6961
6968
|
return t === void 0 && (t = !1), this.current(t) === e && (this.advance(t), !0);
|
|
6962
|
-
},
|
|
6969
|
+
}, to.prototype.eatChars = function(e, t) {
|
|
6963
6970
|
t === void 0 && (t = !1);
|
|
6964
6971
|
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
6965
6972
|
var a = i[r], o = this.at(n, t);
|
|
@@ -6967,34 +6974,34 @@ no.prototype.reset = function(e, t, n) {
|
|
|
6967
6974
|
n = this.nextIndex(n, t);
|
|
6968
6975
|
}
|
|
6969
6976
|
return this.pos = n, !0;
|
|
6970
|
-
},
|
|
6977
|
+
}, Z.validateRegExpFlags = function(e) {
|
|
6971
6978
|
for (var t = e.validFlags, n = e.flags, r = !1, i = !1, a = 0; a < n.length; a++) {
|
|
6972
6979
|
var o = n.charAt(a);
|
|
6973
6980
|
t.indexOf(o) === -1 && this.raise(e.start, "Invalid regular expression flag"), n.indexOf(o, a + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), o === "u" && (r = !0), o === "v" && (i = !0);
|
|
6974
6981
|
}
|
|
6975
6982
|
this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
|
|
6976
6983
|
};
|
|
6977
|
-
function
|
|
6984
|
+
function no(e) {
|
|
6978
6985
|
for (var t in e) return !0;
|
|
6979
6986
|
return !1;
|
|
6980
6987
|
}
|
|
6981
|
-
|
|
6982
|
-
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 &&
|
|
6983
|
-
},
|
|
6988
|
+
Z.validateRegExpPattern = function(e) {
|
|
6989
|
+
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && no(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
6990
|
+
}, Z.regexp_pattern = function(e) {
|
|
6984
6991
|
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
6985
6992
|
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
6986
6993
|
var r = n[t];
|
|
6987
6994
|
e.groupNames[r] || e.raise("Invalid named capture referenced");
|
|
6988
6995
|
}
|
|
6989
|
-
},
|
|
6996
|
+
}, Z.regexp_disjunction = function(e) {
|
|
6990
6997
|
var t = this.options.ecmaVersion >= 16;
|
|
6991
|
-
for (t && (e.branchID = new
|
|
6998
|
+
for (t && (e.branchID = new eo(e.branchID, null)), this.regexp_alternative(e); e.eat(124);) t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
|
|
6992
6999
|
t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, !0) && e.raise("Nothing to repeat"), e.eat(123) && e.raise("Lone quantifier brackets");
|
|
6993
|
-
},
|
|
7000
|
+
}, Z.regexp_alternative = function(e) {
|
|
6994
7001
|
for (; e.pos < e.source.length && this.regexp_eatTerm(e););
|
|
6995
|
-
},
|
|
7002
|
+
}, Z.regexp_eatTerm = function(e) {
|
|
6996
7003
|
return this.regexp_eatAssertion(e) ? (e.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e) && e.switchU && e.raise("Invalid quantifier"), !0) : (e.switchU ? this.regexp_eatAtom(e) : this.regexp_eatExtendedAtom(e)) ? (this.regexp_eatQuantifier(e), !0) : !1;
|
|
6997
|
-
},
|
|
7004
|
+
}, Z.regexp_eatAssertion = function(e) {
|
|
6998
7005
|
var t = e.pos;
|
|
6999
7006
|
if (e.lastAssertionIsQuantifiable = !1, e.eat(94) || e.eat(36)) return !0;
|
|
7000
7007
|
if (e.eat(92)) {
|
|
@@ -7006,11 +7013,11 @@ X.validateRegExpPattern = function(e) {
|
|
|
7006
7013
|
if (this.options.ecmaVersion >= 9 && (n = e.eat(60)), e.eat(61) || e.eat(33)) return this.regexp_disjunction(e), e.eat(41) || e.raise("Unterminated group"), e.lastAssertionIsQuantifiable = !n, !0;
|
|
7007
7014
|
}
|
|
7008
7015
|
return e.pos = t, !1;
|
|
7009
|
-
},
|
|
7016
|
+
}, Z.regexp_eatQuantifier = function(e, t) {
|
|
7010
7017
|
return t === void 0 && (t = !1), this.regexp_eatQuantifierPrefix(e, t) ? (e.eat(63), !0) : !1;
|
|
7011
|
-
},
|
|
7018
|
+
}, Z.regexp_eatQuantifierPrefix = function(e, t) {
|
|
7012
7019
|
return e.eat(42) || e.eat(43) || e.eat(63) || this.regexp_eatBracedQuantifier(e, t);
|
|
7013
|
-
},
|
|
7020
|
+
}, Z.regexp_eatBracedQuantifier = function(e, t) {
|
|
7014
7021
|
var n = e.pos;
|
|
7015
7022
|
if (e.eat(123)) {
|
|
7016
7023
|
var r = 0, i = -1;
|
|
@@ -7018,16 +7025,16 @@ X.validateRegExpPattern = function(e) {
|
|
|
7018
7025
|
e.switchU && !t && e.raise("Incomplete quantifier"), e.pos = n;
|
|
7019
7026
|
}
|
|
7020
7027
|
return !1;
|
|
7021
|
-
},
|
|
7028
|
+
}, Z.regexp_eatAtom = function(e) {
|
|
7022
7029
|
return this.regexp_eatPatternCharacters(e) || e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e);
|
|
7023
|
-
},
|
|
7030
|
+
}, Z.regexp_eatReverseSolidusAtomEscape = function(e) {
|
|
7024
7031
|
var t = e.pos;
|
|
7025
7032
|
if (e.eat(92)) {
|
|
7026
7033
|
if (this.regexp_eatAtomEscape(e)) return !0;
|
|
7027
7034
|
e.pos = t;
|
|
7028
7035
|
}
|
|
7029
7036
|
return !1;
|
|
7030
|
-
},
|
|
7037
|
+
}, Z.regexp_eatUncapturingGroup = function(e) {
|
|
7031
7038
|
var t = e.pos;
|
|
7032
7039
|
if (e.eat(40)) {
|
|
7033
7040
|
if (e.eat(63)) {
|
|
@@ -7056,37 +7063,37 @@ X.validateRegExpPattern = function(e) {
|
|
|
7056
7063
|
e.pos = t;
|
|
7057
7064
|
}
|
|
7058
7065
|
return !1;
|
|
7059
|
-
},
|
|
7066
|
+
}, Z.regexp_eatCapturingGroup = function(e) {
|
|
7060
7067
|
if (e.eat(40)) {
|
|
7061
7068
|
if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e) : e.current() === 63 && e.raise("Invalid group"), this.regexp_disjunction(e), e.eat(41)) return e.numCapturingParens += 1, !0;
|
|
7062
7069
|
e.raise("Unterminated group");
|
|
7063
7070
|
}
|
|
7064
7071
|
return !1;
|
|
7065
|
-
},
|
|
7066
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 &&
|
|
7072
|
+
}, Z.regexp_eatModifiers = function(e) {
|
|
7073
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && ro(n);) t += Bi(n), e.advance();
|
|
7067
7074
|
return t;
|
|
7068
7075
|
};
|
|
7069
|
-
function
|
|
7076
|
+
function ro(e) {
|
|
7070
7077
|
return e === 105 || e === 109 || e === 115;
|
|
7071
7078
|
}
|
|
7072
|
-
|
|
7079
|
+
Z.regexp_eatExtendedAtom = function(e) {
|
|
7073
7080
|
return e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e) || this.regexp_eatInvalidBracedQuantifier(e) || this.regexp_eatExtendedPatternCharacter(e);
|
|
7074
|
-
},
|
|
7081
|
+
}, Z.regexp_eatInvalidBracedQuantifier = function(e) {
|
|
7075
7082
|
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
7076
|
-
},
|
|
7083
|
+
}, Z.regexp_eatSyntaxCharacter = function(e) {
|
|
7077
7084
|
var t = e.current();
|
|
7078
|
-
return
|
|
7085
|
+
return io(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
7079
7086
|
};
|
|
7080
|
-
function
|
|
7087
|
+
function io(e) {
|
|
7081
7088
|
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
7082
7089
|
}
|
|
7083
|
-
|
|
7084
|
-
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !
|
|
7090
|
+
Z.regexp_eatPatternCharacters = function(e) {
|
|
7091
|
+
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !io(n);) e.advance();
|
|
7085
7092
|
return e.pos !== t;
|
|
7086
|
-
},
|
|
7093
|
+
}, Z.regexp_eatExtendedPatternCharacter = function(e) {
|
|
7087
7094
|
var t = e.current();
|
|
7088
7095
|
return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 && (e.advance(), !0);
|
|
7089
|
-
},
|
|
7096
|
+
}, Z.regexp_groupSpecifier = function(e) {
|
|
7090
7097
|
if (e.eat(63)) {
|
|
7091
7098
|
this.regexp_eatGroupName(e) || e.raise("Invalid group");
|
|
7092
7099
|
var t = this.options.ecmaVersion >= 16, n = e.groupNames[e.lastStringValue];
|
|
@@ -7096,35 +7103,35 @@ X.regexp_eatPatternCharacters = function(e) {
|
|
|
7096
7103
|
}
|
|
7097
7104
|
t ? (n || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = !0;
|
|
7098
7105
|
}
|
|
7099
|
-
},
|
|
7106
|
+
}, Z.regexp_eatGroupName = function(e) {
|
|
7100
7107
|
if (e.lastStringValue = "", e.eat(60)) {
|
|
7101
7108
|
if (this.regexp_eatRegExpIdentifierName(e) && e.eat(62)) return !0;
|
|
7102
7109
|
e.raise("Invalid capture group name");
|
|
7103
7110
|
}
|
|
7104
7111
|
return !1;
|
|
7105
|
-
},
|
|
7112
|
+
}, Z.regexp_eatRegExpIdentifierName = function(e) {
|
|
7106
7113
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
7107
|
-
for (e.lastStringValue +=
|
|
7114
|
+
for (e.lastStringValue += Bi(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += Bi(e.lastIntValue);
|
|
7108
7115
|
return !0;
|
|
7109
7116
|
}
|
|
7110
7117
|
return !1;
|
|
7111
|
-
},
|
|
7118
|
+
}, Z.regexp_eatRegExpIdentifierStart = function(e) {
|
|
7112
7119
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
7113
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
7120
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), ao(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
7114
7121
|
};
|
|
7115
|
-
function
|
|
7116
|
-
return
|
|
7122
|
+
function ao(e) {
|
|
7123
|
+
return Ei(e, !0) || e === 36 || e === 95;
|
|
7117
7124
|
}
|
|
7118
|
-
|
|
7125
|
+
Z.regexp_eatRegExpIdentifierPart = function(e) {
|
|
7119
7126
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
7120
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
7127
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), oo(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
7121
7128
|
};
|
|
7122
|
-
function
|
|
7123
|
-
return
|
|
7129
|
+
function oo(e) {
|
|
7130
|
+
return Di(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
7124
7131
|
}
|
|
7125
|
-
|
|
7132
|
+
Z.regexp_eatAtomEscape = function(e) {
|
|
7126
7133
|
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
7127
|
-
},
|
|
7134
|
+
}, Z.regexp_eatBackReference = function(e) {
|
|
7128
7135
|
var t = e.pos;
|
|
7129
7136
|
if (this.regexp_eatDecimalEscape(e)) {
|
|
7130
7137
|
var n = e.lastIntValue;
|
|
@@ -7133,34 +7140,34 @@ X.regexp_eatAtomEscape = function(e) {
|
|
|
7133
7140
|
e.pos = t;
|
|
7134
7141
|
}
|
|
7135
7142
|
return !1;
|
|
7136
|
-
},
|
|
7143
|
+
}, Z.regexp_eatKGroupName = function(e) {
|
|
7137
7144
|
if (e.eat(107)) {
|
|
7138
7145
|
if (this.regexp_eatGroupName(e)) return e.backReferenceNames.push(e.lastStringValue), !0;
|
|
7139
7146
|
e.raise("Invalid named reference");
|
|
7140
7147
|
}
|
|
7141
7148
|
return !1;
|
|
7142
|
-
},
|
|
7149
|
+
}, Z.regexp_eatCharacterEscape = function(e) {
|
|
7143
7150
|
return this.regexp_eatControlEscape(e) || this.regexp_eatCControlLetter(e) || this.regexp_eatZero(e) || this.regexp_eatHexEscapeSequence(e) || this.regexp_eatRegExpUnicodeEscapeSequence(e, !1) || !e.switchU && this.regexp_eatLegacyOctalEscapeSequence(e) || this.regexp_eatIdentityEscape(e);
|
|
7144
|
-
},
|
|
7151
|
+
}, Z.regexp_eatCControlLetter = function(e) {
|
|
7145
7152
|
var t = e.pos;
|
|
7146
7153
|
if (e.eat(99)) {
|
|
7147
7154
|
if (this.regexp_eatControlLetter(e)) return !0;
|
|
7148
7155
|
e.pos = t;
|
|
7149
7156
|
}
|
|
7150
7157
|
return !1;
|
|
7151
|
-
},
|
|
7152
|
-
return e.current() === 48 && !
|
|
7153
|
-
},
|
|
7158
|
+
}, Z.regexp_eatZero = function(e) {
|
|
7159
|
+
return e.current() === 48 && !vo(e.lookahead()) && (e.lastIntValue = 0, e.advance(), !0);
|
|
7160
|
+
}, Z.regexp_eatControlEscape = function(e) {
|
|
7154
7161
|
var t = e.current();
|
|
7155
7162
|
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 && (e.lastIntValue = 13, e.advance(), !0);
|
|
7156
|
-
},
|
|
7163
|
+
}, Z.regexp_eatControlLetter = function(e) {
|
|
7157
7164
|
var t = e.current();
|
|
7158
|
-
return
|
|
7165
|
+
return so(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
7159
7166
|
};
|
|
7160
|
-
function
|
|
7167
|
+
function so(e) {
|
|
7161
7168
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
7162
7169
|
}
|
|
7163
|
-
|
|
7170
|
+
Z.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
7164
7171
|
t === void 0 && (t = !1);
|
|
7165
7172
|
var n = e.pos, r = t || e.switchU;
|
|
7166
7173
|
if (e.eat(117)) {
|
|
@@ -7176,19 +7183,19 @@ X.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
7176
7183
|
}
|
|
7177
7184
|
return !0;
|
|
7178
7185
|
}
|
|
7179
|
-
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) &&
|
|
7186
|
+
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && co(e.lastIntValue)) return !0;
|
|
7180
7187
|
r && e.raise("Invalid unicode escape"), e.pos = n;
|
|
7181
7188
|
}
|
|
7182
7189
|
return !1;
|
|
7183
7190
|
};
|
|
7184
|
-
function
|
|
7191
|
+
function co(e) {
|
|
7185
7192
|
return e >= 0 && e <= 1114111;
|
|
7186
7193
|
}
|
|
7187
|
-
|
|
7194
|
+
Z.regexp_eatIdentityEscape = function(e) {
|
|
7188
7195
|
if (e.switchU) return this.regexp_eatSyntaxCharacter(e) ? !0 : e.eat(47) ? (e.lastIntValue = 47, !0) : !1;
|
|
7189
7196
|
var t = e.current();
|
|
7190
7197
|
return t !== 99 && (!e.switchN || t !== 107) && (e.lastIntValue = t, e.advance(), !0);
|
|
7191
|
-
},
|
|
7198
|
+
}, Z.regexp_eatDecimalEscape = function(e) {
|
|
7192
7199
|
e.lastIntValue = 0;
|
|
7193
7200
|
var t = e.current();
|
|
7194
7201
|
if (t >= 49 && t <= 57) {
|
|
@@ -7199,69 +7206,69 @@ X.regexp_eatIdentityEscape = function(e) {
|
|
|
7199
7206
|
}
|
|
7200
7207
|
return !1;
|
|
7201
7208
|
};
|
|
7202
|
-
var
|
|
7203
|
-
|
|
7209
|
+
var lo = 0, uo = 1, Q = 2;
|
|
7210
|
+
Z.regexp_eatCharacterClassEscape = function(e) {
|
|
7204
7211
|
var t = e.current();
|
|
7205
|
-
if (
|
|
7212
|
+
if (fo(t)) return e.lastIntValue = -1, e.advance(), uo;
|
|
7206
7213
|
var n = !1;
|
|
7207
7214
|
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
7208
7215
|
e.lastIntValue = -1, e.advance();
|
|
7209
7216
|
var r;
|
|
7210
|
-
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r ===
|
|
7217
|
+
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === Q && e.raise("Invalid property name"), r;
|
|
7211
7218
|
e.raise("Invalid property name");
|
|
7212
7219
|
}
|
|
7213
|
-
return
|
|
7220
|
+
return lo;
|
|
7214
7221
|
};
|
|
7215
|
-
function
|
|
7222
|
+
function fo(e) {
|
|
7216
7223
|
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
7217
7224
|
}
|
|
7218
|
-
|
|
7225
|
+
Z.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
7219
7226
|
var t = e.pos;
|
|
7220
7227
|
if (this.regexp_eatUnicodePropertyName(e) && e.eat(61)) {
|
|
7221
7228
|
var n = e.lastStringValue;
|
|
7222
7229
|
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
7223
7230
|
var r = e.lastStringValue;
|
|
7224
|
-
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r),
|
|
7231
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), uo;
|
|
7225
7232
|
}
|
|
7226
7233
|
}
|
|
7227
7234
|
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
7228
7235
|
var i = e.lastStringValue;
|
|
7229
7236
|
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
7230
7237
|
}
|
|
7231
|
-
return
|
|
7232
|
-
},
|
|
7233
|
-
|
|
7234
|
-
},
|
|
7235
|
-
if (e.unicodeProperties.binary.test(t)) return
|
|
7236
|
-
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return
|
|
7238
|
+
return lo;
|
|
7239
|
+
}, Z.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
7240
|
+
Ii(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
7241
|
+
}, Z.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
7242
|
+
if (e.unicodeProperties.binary.test(t)) return uo;
|
|
7243
|
+
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return Q;
|
|
7237
7244
|
e.raise("Invalid property name");
|
|
7238
|
-
},
|
|
7245
|
+
}, Z.regexp_eatUnicodePropertyName = function(e) {
|
|
7239
7246
|
var t = 0;
|
|
7240
|
-
for (e.lastStringValue = "";
|
|
7247
|
+
for (e.lastStringValue = ""; po(t = e.current());) e.lastStringValue += Bi(t), e.advance();
|
|
7241
7248
|
return e.lastStringValue !== "";
|
|
7242
7249
|
};
|
|
7243
|
-
function
|
|
7244
|
-
return
|
|
7250
|
+
function po(e) {
|
|
7251
|
+
return so(e) || e === 95;
|
|
7245
7252
|
}
|
|
7246
|
-
|
|
7253
|
+
Z.regexp_eatUnicodePropertyValue = function(e) {
|
|
7247
7254
|
var t = 0;
|
|
7248
|
-
for (e.lastStringValue = "";
|
|
7255
|
+
for (e.lastStringValue = ""; mo(t = e.current());) e.lastStringValue += Bi(t), e.advance();
|
|
7249
7256
|
return e.lastStringValue !== "";
|
|
7250
7257
|
};
|
|
7251
|
-
function
|
|
7252
|
-
return
|
|
7258
|
+
function mo(e) {
|
|
7259
|
+
return po(e) || vo(e);
|
|
7253
7260
|
}
|
|
7254
|
-
|
|
7261
|
+
Z.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
7255
7262
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
7256
|
-
},
|
|
7263
|
+
}, Z.regexp_eatCharacterClass = function(e) {
|
|
7257
7264
|
if (e.eat(91)) {
|
|
7258
7265
|
var t = e.eat(94), n = this.regexp_classContents(e);
|
|
7259
|
-
return e.eat(93) || e.raise("Unterminated character class"), t && n ===
|
|
7266
|
+
return e.eat(93) || e.raise("Unterminated character class"), t && n === Q && e.raise("Negated character class may contain strings"), !0;
|
|
7260
7267
|
}
|
|
7261
7268
|
return !1;
|
|
7262
|
-
},
|
|
7263
|
-
return e.current() === 93 ?
|
|
7264
|
-
},
|
|
7269
|
+
}, Z.regexp_classContents = function(e) {
|
|
7270
|
+
return e.current() === 93 ? uo : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), uo);
|
|
7271
|
+
}, Z.regexp_nonEmptyClassRanges = function(e) {
|
|
7265
7272
|
for (; this.regexp_eatClassAtom(e);) {
|
|
7266
7273
|
var t = e.lastIntValue;
|
|
7267
7274
|
if (e.eat(45) && this.regexp_eatClassAtom(e)) {
|
|
@@ -7269,19 +7276,19 @@ X.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
7269
7276
|
e.switchU && (t === -1 || n === -1) && e.raise("Invalid character class"), t !== -1 && n !== -1 && t > n && e.raise("Range out of order in character class");
|
|
7270
7277
|
}
|
|
7271
7278
|
}
|
|
7272
|
-
},
|
|
7279
|
+
}, Z.regexp_eatClassAtom = function(e) {
|
|
7273
7280
|
var t = e.pos;
|
|
7274
7281
|
if (e.eat(92)) {
|
|
7275
7282
|
if (this.regexp_eatClassEscape(e)) return !0;
|
|
7276
7283
|
if (e.switchU) {
|
|
7277
7284
|
var n = e.current();
|
|
7278
|
-
(n === 99 ||
|
|
7285
|
+
(n === 99 || xo(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
7279
7286
|
}
|
|
7280
7287
|
e.pos = t;
|
|
7281
7288
|
}
|
|
7282
7289
|
var r = e.current();
|
|
7283
7290
|
return r !== 93 && (e.lastIntValue = r, e.advance(), !0);
|
|
7284
|
-
},
|
|
7291
|
+
}, Z.regexp_eatClassEscape = function(e) {
|
|
7285
7292
|
var t = e.pos;
|
|
7286
7293
|
if (e.eat(98)) return e.lastIntValue = 8, !0;
|
|
7287
7294
|
if (e.switchU && e.eat(45)) return e.lastIntValue = 45, !0;
|
|
@@ -7290,14 +7297,14 @@ X.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
7290
7297
|
e.pos = t;
|
|
7291
7298
|
}
|
|
7292
7299
|
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
7293
|
-
},
|
|
7294
|
-
var t =
|
|
7300
|
+
}, Z.regexp_classSetExpression = function(e) {
|
|
7301
|
+
var t = uo, n;
|
|
7295
7302
|
if (!this.regexp_eatClassSetRange(e)) {
|
|
7296
7303
|
if (n = this.regexp_eatClassSetOperand(e)) {
|
|
7297
|
-
n ===
|
|
7304
|
+
n === Q && (t = Q);
|
|
7298
7305
|
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
7299
7306
|
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
7300
|
-
n !==
|
|
7307
|
+
n !== Q && (t = uo);
|
|
7301
7308
|
continue;
|
|
7302
7309
|
}
|
|
7303
7310
|
e.raise("Invalid character in character class");
|
|
@@ -7309,9 +7316,9 @@ X.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
7309
7316
|
}
|
|
7310
7317
|
for (;;) if (!this.regexp_eatClassSetRange(e)) {
|
|
7311
7318
|
if (n = this.regexp_eatClassSetOperand(e), !n) return t;
|
|
7312
|
-
n ===
|
|
7319
|
+
n === Q && (t = Q);
|
|
7313
7320
|
}
|
|
7314
|
-
},
|
|
7321
|
+
}, Z.regexp_eatClassSetRange = function(e) {
|
|
7315
7322
|
var t = e.pos;
|
|
7316
7323
|
if (this.regexp_eatClassSetCharacter(e)) {
|
|
7317
7324
|
var n = e.lastIntValue;
|
|
@@ -7322,13 +7329,13 @@ X.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
7322
7329
|
e.pos = t;
|
|
7323
7330
|
}
|
|
7324
7331
|
return !1;
|
|
7325
|
-
},
|
|
7326
|
-
return this.regexp_eatClassSetCharacter(e) ?
|
|
7327
|
-
},
|
|
7332
|
+
}, Z.regexp_eatClassSetOperand = function(e) {
|
|
7333
|
+
return this.regexp_eatClassSetCharacter(e) ? uo : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
7334
|
+
}, Z.regexp_eatNestedClass = function(e) {
|
|
7328
7335
|
var t = e.pos;
|
|
7329
7336
|
if (e.eat(91)) {
|
|
7330
7337
|
var n = e.eat(94), r = this.regexp_classContents(e);
|
|
7331
|
-
if (e.eat(93)) return n && r ===
|
|
7338
|
+
if (e.eat(93)) return n && r === Q && e.raise("Negated character class may contain strings"), r;
|
|
7332
7339
|
e.pos = t;
|
|
7333
7340
|
}
|
|
7334
7341
|
if (e.eat(92)) {
|
|
@@ -7337,7 +7344,7 @@ X.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
7337
7344
|
e.pos = t;
|
|
7338
7345
|
}
|
|
7339
7346
|
return null;
|
|
7340
|
-
},
|
|
7347
|
+
}, Z.regexp_eatClassStringDisjunction = function(e) {
|
|
7341
7348
|
var t = e.pos;
|
|
7342
7349
|
if (e.eatChars([92, 113])) {
|
|
7343
7350
|
if (e.eat(123)) {
|
|
@@ -7347,61 +7354,61 @@ X.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
7347
7354
|
e.pos = t;
|
|
7348
7355
|
}
|
|
7349
7356
|
return null;
|
|
7350
|
-
},
|
|
7351
|
-
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) ===
|
|
7357
|
+
}, Z.regexp_classStringDisjunctionContents = function(e) {
|
|
7358
|
+
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) === Q && (t = Q);
|
|
7352
7359
|
return t;
|
|
7353
|
-
},
|
|
7360
|
+
}, Z.regexp_classString = function(e) {
|
|
7354
7361
|
for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
|
|
7355
|
-
return t === 1 ?
|
|
7356
|
-
},
|
|
7362
|
+
return t === 1 ? uo : Q;
|
|
7363
|
+
}, Z.regexp_eatClassSetCharacter = function(e) {
|
|
7357
7364
|
var t = e.pos;
|
|
7358
7365
|
if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
7359
7366
|
var n = e.current();
|
|
7360
|
-
return n < 0 || n === e.lookahead() &&
|
|
7367
|
+
return n < 0 || n === e.lookahead() && ho(n) || go(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
|
|
7361
7368
|
};
|
|
7362
|
-
function
|
|
7369
|
+
function ho(e) {
|
|
7363
7370
|
return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
|
|
7364
7371
|
}
|
|
7365
|
-
function
|
|
7372
|
+
function go(e) {
|
|
7366
7373
|
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
7367
7374
|
}
|
|
7368
|
-
|
|
7375
|
+
Z.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
7369
7376
|
var t = e.current();
|
|
7370
|
-
return
|
|
7377
|
+
return _o(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
7371
7378
|
};
|
|
7372
|
-
function
|
|
7379
|
+
function _o(e) {
|
|
7373
7380
|
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
7374
7381
|
}
|
|
7375
|
-
|
|
7382
|
+
Z.regexp_eatClassControlLetter = function(e) {
|
|
7376
7383
|
var t = e.current();
|
|
7377
|
-
return
|
|
7378
|
-
},
|
|
7384
|
+
return vo(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
7385
|
+
}, Z.regexp_eatHexEscapeSequence = function(e) {
|
|
7379
7386
|
var t = e.pos;
|
|
7380
7387
|
if (e.eat(120)) {
|
|
7381
7388
|
if (this.regexp_eatFixedHexDigits(e, 2)) return !0;
|
|
7382
7389
|
e.switchU && e.raise("Invalid escape"), e.pos = t;
|
|
7383
7390
|
}
|
|
7384
7391
|
return !1;
|
|
7385
|
-
},
|
|
7392
|
+
}, Z.regexp_eatDecimalDigits = function(e) {
|
|
7386
7393
|
var t = e.pos, n = 0;
|
|
7387
|
-
for (e.lastIntValue = 0;
|
|
7394
|
+
for (e.lastIntValue = 0; vo(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
7388
7395
|
return e.pos !== t;
|
|
7389
7396
|
};
|
|
7390
|
-
function
|
|
7397
|
+
function vo(e) {
|
|
7391
7398
|
return e >= 48 && e <= 57;
|
|
7392
7399
|
}
|
|
7393
|
-
|
|
7400
|
+
Z.regexp_eatHexDigits = function(e) {
|
|
7394
7401
|
var t = e.pos, n = 0;
|
|
7395
|
-
for (e.lastIntValue = 0;
|
|
7402
|
+
for (e.lastIntValue = 0; yo(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + bo(n), e.advance();
|
|
7396
7403
|
return e.pos !== t;
|
|
7397
7404
|
};
|
|
7398
|
-
function
|
|
7405
|
+
function yo(e) {
|
|
7399
7406
|
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
7400
7407
|
}
|
|
7401
|
-
function
|
|
7408
|
+
function bo(e) {
|
|
7402
7409
|
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
7403
7410
|
}
|
|
7404
|
-
|
|
7411
|
+
Z.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
7405
7412
|
if (this.regexp_eatOctalDigit(e)) {
|
|
7406
7413
|
var t = e.lastIntValue;
|
|
7407
7414
|
if (this.regexp_eatOctalDigit(e)) {
|
|
@@ -7411,61 +7418,61 @@ X.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
7411
7418
|
return !0;
|
|
7412
7419
|
}
|
|
7413
7420
|
return !1;
|
|
7414
|
-
},
|
|
7421
|
+
}, Z.regexp_eatOctalDigit = function(e) {
|
|
7415
7422
|
var t = e.current();
|
|
7416
|
-
return
|
|
7423
|
+
return xo(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
7417
7424
|
};
|
|
7418
|
-
function
|
|
7425
|
+
function xo(e) {
|
|
7419
7426
|
return e >= 48 && e <= 55;
|
|
7420
7427
|
}
|
|
7421
|
-
|
|
7428
|
+
Z.regexp_eatFixedHexDigits = function(e, t) {
|
|
7422
7429
|
var n = e.pos;
|
|
7423
7430
|
e.lastIntValue = 0;
|
|
7424
7431
|
for (var r = 0; r < t; ++r) {
|
|
7425
7432
|
var i = e.current();
|
|
7426
|
-
if (!
|
|
7427
|
-
e.lastIntValue = 16 * e.lastIntValue +
|
|
7433
|
+
if (!yo(i)) return e.pos = n, !1;
|
|
7434
|
+
e.lastIntValue = 16 * e.lastIntValue + bo(i), e.advance();
|
|
7428
7435
|
}
|
|
7429
7436
|
return !0;
|
|
7430
7437
|
};
|
|
7431
|
-
var
|
|
7432
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
7433
|
-
},
|
|
7434
|
-
|
|
7435
|
-
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new
|
|
7436
|
-
},
|
|
7437
|
-
return this.next(), new
|
|
7438
|
-
}, typeof Symbol < "u" && (
|
|
7438
|
+
var So = function(e) {
|
|
7439
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new Ui(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
7440
|
+
}, $ = U.prototype;
|
|
7441
|
+
$.next = function(e) {
|
|
7442
|
+
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new So(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
7443
|
+
}, $.getToken = function() {
|
|
7444
|
+
return this.next(), new So(this);
|
|
7445
|
+
}, typeof Symbol < "u" && ($[Symbol.iterator] = function() {
|
|
7439
7446
|
var e = this;
|
|
7440
7447
|
return { next: function() {
|
|
7441
7448
|
var t = e.getToken();
|
|
7442
7449
|
return {
|
|
7443
|
-
done: t.type ===
|
|
7450
|
+
done: t.type === B.eof,
|
|
7444
7451
|
value: t
|
|
7445
7452
|
};
|
|
7446
7453
|
} };
|
|
7447
|
-
}),
|
|
7454
|
+
}), $.nextToken = function() {
|
|
7448
7455
|
var e = this.curContext();
|
|
7449
|
-
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(
|
|
7456
|
+
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(B.eof);
|
|
7450
7457
|
if (e.override) return e.override(this);
|
|
7451
7458
|
this.readToken(this.fullCharCodeAtPos());
|
|
7452
|
-
},
|
|
7453
|
-
return
|
|
7454
|
-
},
|
|
7459
|
+
}, $.readToken = function(e) {
|
|
7460
|
+
return Ei(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
7461
|
+
}, $.fullCharCodeAt = function(e) {
|
|
7455
7462
|
var t = this.input.charCodeAt(e);
|
|
7456
7463
|
if (t <= 55295 || t >= 56320) return t;
|
|
7457
7464
|
var n = this.input.charCodeAt(e + 1);
|
|
7458
7465
|
return n <= 56319 || n >= 57344 ? t : (t << 10) + n - 56613888;
|
|
7459
|
-
},
|
|
7466
|
+
}, $.fullCharCodeAtPos = function() {
|
|
7460
7467
|
return this.fullCharCodeAt(this.pos);
|
|
7461
|
-
},
|
|
7468
|
+
}, $.skipBlockComment = function() {
|
|
7462
7469
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
7463
|
-
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r =
|
|
7470
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = ji(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
7464
7471
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
7465
|
-
},
|
|
7466
|
-
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !
|
|
7472
|
+
}, $.skipLineComment = function(e) {
|
|
7473
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !Ai(r);) r = this.input.charCodeAt(++this.pos);
|
|
7467
7474
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
7468
|
-
},
|
|
7475
|
+
}, $.skipSpace = function() {
|
|
7469
7476
|
loop: for (; this.pos < this.input.length;) {
|
|
7470
7477
|
var e = this.input.charCodeAt(this.pos);
|
|
7471
7478
|
switch (e) {
|
|
@@ -7490,69 +7497,69 @@ Q.next = function(e) {
|
|
|
7490
7497
|
default: break loop;
|
|
7491
7498
|
}
|
|
7492
7499
|
break;
|
|
7493
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
7500
|
+
default: if (e > 8 && e < 14 || e >= 5760 && Mi.test(String.fromCharCode(e))) ++this.pos;
|
|
7494
7501
|
else break loop;
|
|
7495
7502
|
}
|
|
7496
7503
|
}
|
|
7497
|
-
},
|
|
7504
|
+
}, $.finishToken = function(e, t) {
|
|
7498
7505
|
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
7499
7506
|
var n = this.type;
|
|
7500
7507
|
this.type = e, this.value = t, this.updateContext(n);
|
|
7501
|
-
},
|
|
7508
|
+
}, $.readToken_dot = function() {
|
|
7502
7509
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
7503
7510
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
7504
7511
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
7505
|
-
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(
|
|
7506
|
-
},
|
|
7512
|
+
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(B.ellipsis)) : (++this.pos, this.finishToken(B.dot));
|
|
7513
|
+
}, $.readToken_slash = function() {
|
|
7507
7514
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
7508
|
-
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(
|
|
7509
|
-
},
|
|
7510
|
-
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ?
|
|
7511
|
-
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r =
|
|
7512
|
-
},
|
|
7515
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(B.assign, 2) : this.finishOp(B.slash, 1);
|
|
7516
|
+
}, $.readToken_mult_modulo_exp = function(e) {
|
|
7517
|
+
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? B.star : B.modulo;
|
|
7518
|
+
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = B.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(B.assign, n + 1) : this.finishOp(r, n);
|
|
7519
|
+
}, $.readToken_pipe_amp = function(e) {
|
|
7513
7520
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
7514
|
-
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
7515
|
-
},
|
|
7516
|
-
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(
|
|
7517
|
-
},
|
|
7521
|
+
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(B.assign, 3) : this.finishOp(e === 124 ? B.logicalOR : B.logicalAND, 2) : t === 61 ? this.finishOp(B.assign, 2) : this.finishOp(e === 124 ? B.bitwiseOR : B.bitwiseAND, 1);
|
|
7522
|
+
}, $.readToken_caret = function() {
|
|
7523
|
+
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(B.assign, 2) : this.finishOp(B.bitwiseXOR, 1);
|
|
7524
|
+
}, $.readToken_plus_min = function(e) {
|
|
7518
7525
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
7519
|
-
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 ||
|
|
7520
|
-
},
|
|
7526
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || V.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(B.incDec, 2) : t === 61 ? this.finishOp(B.assign, 2) : this.finishOp(B.plusMin, 1);
|
|
7527
|
+
}, $.readToken_lt_gt = function(e) {
|
|
7521
7528
|
var t = this.input.charCodeAt(this.pos + 1), n = 1;
|
|
7522
|
-
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(
|
|
7523
|
-
},
|
|
7529
|
+
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(B.assign, n + 1) : this.finishOp(B.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(B.relational, n));
|
|
7530
|
+
}, $.readToken_eq_excl = function(e) {
|
|
7524
7531
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
7525
|
-
return t === 61 ? this.finishOp(
|
|
7526
|
-
},
|
|
7532
|
+
return t === 61 ? this.finishOp(B.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(B.arrow)) : this.finishOp(e === 61 ? B.eq : B.prefix, 1);
|
|
7533
|
+
}, $.readToken_question = function() {
|
|
7527
7534
|
var e = this.options.ecmaVersion;
|
|
7528
7535
|
if (e >= 11) {
|
|
7529
7536
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
7530
7537
|
if (t === 46) {
|
|
7531
7538
|
var n = this.input.charCodeAt(this.pos + 2);
|
|
7532
|
-
if (n < 48 || n > 57) return this.finishOp(
|
|
7539
|
+
if (n < 48 || n > 57) return this.finishOp(B.questionDot, 2);
|
|
7533
7540
|
}
|
|
7534
|
-
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
7541
|
+
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(B.assign, 3) : this.finishOp(B.coalesce, 2);
|
|
7535
7542
|
}
|
|
7536
|
-
return this.finishOp(
|
|
7537
|
-
},
|
|
7543
|
+
return this.finishOp(B.question, 1);
|
|
7544
|
+
}, $.readToken_numberSign = function() {
|
|
7538
7545
|
var e = this.options.ecmaVersion, t = 35;
|
|
7539
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(),
|
|
7540
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
7541
|
-
},
|
|
7546
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), Ei(t, !0) || t === 92)) return this.finishToken(B.privateId, this.readWord1());
|
|
7547
|
+
this.raise(this.pos, "Unexpected character '" + Bi(t) + "'");
|
|
7548
|
+
}, $.getTokenFromCode = function(e) {
|
|
7542
7549
|
switch (e) {
|
|
7543
7550
|
case 46: return this.readToken_dot();
|
|
7544
|
-
case 40: return ++this.pos, this.finishToken(
|
|
7545
|
-
case 41: return ++this.pos, this.finishToken(
|
|
7546
|
-
case 59: return ++this.pos, this.finishToken(
|
|
7547
|
-
case 44: return ++this.pos, this.finishToken(
|
|
7548
|
-
case 91: return ++this.pos, this.finishToken(
|
|
7549
|
-
case 93: return ++this.pos, this.finishToken(
|
|
7550
|
-
case 123: return ++this.pos, this.finishToken(
|
|
7551
|
-
case 125: return ++this.pos, this.finishToken(
|
|
7552
|
-
case 58: return ++this.pos, this.finishToken(
|
|
7551
|
+
case 40: return ++this.pos, this.finishToken(B.parenL);
|
|
7552
|
+
case 41: return ++this.pos, this.finishToken(B.parenR);
|
|
7553
|
+
case 59: return ++this.pos, this.finishToken(B.semi);
|
|
7554
|
+
case 44: return ++this.pos, this.finishToken(B.comma);
|
|
7555
|
+
case 91: return ++this.pos, this.finishToken(B.bracketL);
|
|
7556
|
+
case 93: return ++this.pos, this.finishToken(B.bracketR);
|
|
7557
|
+
case 123: return ++this.pos, this.finishToken(B.braceL);
|
|
7558
|
+
case 125: return ++this.pos, this.finishToken(B.braceR);
|
|
7559
|
+
case 58: return ++this.pos, this.finishToken(B.colon);
|
|
7553
7560
|
case 96:
|
|
7554
7561
|
if (this.options.ecmaVersion < 6) break;
|
|
7555
|
-
return ++this.pos, this.finishToken(
|
|
7562
|
+
return ++this.pos, this.finishToken(B.backQuote);
|
|
7556
7563
|
case 48:
|
|
7557
7564
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
7558
7565
|
if (t === 120 || t === 88) return this.readRadixNumber(16);
|
|
@@ -7584,18 +7591,18 @@ Q.next = function(e) {
|
|
|
7584
7591
|
case 61:
|
|
7585
7592
|
case 33: return this.readToken_eq_excl(e);
|
|
7586
7593
|
case 63: return this.readToken_question();
|
|
7587
|
-
case 126: return this.finishOp(
|
|
7594
|
+
case 126: return this.finishOp(B.prefix, 1);
|
|
7588
7595
|
case 35: return this.readToken_numberSign();
|
|
7589
7596
|
}
|
|
7590
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
7591
|
-
},
|
|
7597
|
+
this.raise(this.pos, "Unexpected character '" + Bi(e) + "'");
|
|
7598
|
+
}, $.finishOp = function(e, t) {
|
|
7592
7599
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
7593
7600
|
return this.pos += t, this.finishToken(e, n);
|
|
7594
|
-
},
|
|
7601
|
+
}, $.readRegexp = function() {
|
|
7595
7602
|
for (var e, t, n = this.pos;;) {
|
|
7596
7603
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
7597
7604
|
var r = this.input.charAt(this.pos);
|
|
7598
|
-
if (
|
|
7605
|
+
if (V.test(r) && this.raise(n, "Unterminated regular expression"), e) e = !1;
|
|
7599
7606
|
else {
|
|
7600
7607
|
if (r === "[") t = !0;
|
|
7601
7608
|
else if (r === "]" && t) t = !1;
|
|
@@ -7608,18 +7615,18 @@ Q.next = function(e) {
|
|
|
7608
7615
|
++this.pos;
|
|
7609
7616
|
var a = this.pos, o = this.readWord1();
|
|
7610
7617
|
this.containsEsc && this.unexpected(a);
|
|
7611
|
-
var s = this.regexpState ||= new
|
|
7618
|
+
var s = this.regexpState ||= new to(this);
|
|
7612
7619
|
s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
|
|
7613
7620
|
var c = null;
|
|
7614
7621
|
try {
|
|
7615
7622
|
c = new RegExp(i, o);
|
|
7616
7623
|
} catch {}
|
|
7617
|
-
return this.finishToken(
|
|
7624
|
+
return this.finishToken(B.regexp, {
|
|
7618
7625
|
pattern: i,
|
|
7619
7626
|
flags: o,
|
|
7620
7627
|
value: c
|
|
7621
7628
|
});
|
|
7622
|
-
},
|
|
7629
|
+
}, $.readInt = function(e, t, n) {
|
|
7623
7630
|
for (var r = this.options.ecmaVersion >= 12 && t === void 0, i = n && this.input.charCodeAt(this.pos) === 48, a = this.pos, o = 0, s = 0, c = 0, l = t ?? Infinity; c < l; ++c, ++this.pos) {
|
|
7624
7631
|
var u = this.input.charCodeAt(this.pos), d = void 0;
|
|
7625
7632
|
if (r && u === 95) {
|
|
@@ -7631,31 +7638,31 @@ Q.next = function(e) {
|
|
|
7631
7638
|
}
|
|
7632
7639
|
return r && s === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === a || t != null && this.pos - a !== t ? null : o;
|
|
7633
7640
|
};
|
|
7634
|
-
function
|
|
7641
|
+
function Co(e, t) {
|
|
7635
7642
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
7636
7643
|
}
|
|
7637
|
-
function
|
|
7644
|
+
function wo(e) {
|
|
7638
7645
|
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
7639
7646
|
}
|
|
7640
|
-
|
|
7647
|
+
$.readRadixNumber = function(e) {
|
|
7641
7648
|
var t = this.pos;
|
|
7642
7649
|
this.pos += 2;
|
|
7643
7650
|
var n = this.readInt(e);
|
|
7644
|
-
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n =
|
|
7645
|
-
},
|
|
7651
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = wo(this.input.slice(t, this.pos)), ++this.pos) : Ei(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(B.num, n);
|
|
7652
|
+
}, $.readNumber = function(e) {
|
|
7646
7653
|
var t = this.pos;
|
|
7647
7654
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
7648
7655
|
var n = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
|
|
7649
7656
|
n && this.strict && this.raise(t, "Invalid number");
|
|
7650
7657
|
var r = this.input.charCodeAt(this.pos);
|
|
7651
7658
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
7652
|
-
var i =
|
|
7653
|
-
return ++this.pos,
|
|
7659
|
+
var i = wo(this.input.slice(t, this.pos));
|
|
7660
|
+
return ++this.pos, Ei(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(B.num, i);
|
|
7654
7661
|
}
|
|
7655
|
-
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")),
|
|
7656
|
-
var a =
|
|
7657
|
-
return this.finishToken(
|
|
7658
|
-
},
|
|
7662
|
+
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), Ei(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
7663
|
+
var a = Co(this.input.slice(t, this.pos), n);
|
|
7664
|
+
return this.finishToken(B.num, a);
|
|
7665
|
+
}, $.readCodePoint = function() {
|
|
7659
7666
|
var e = this.input.charCodeAt(this.pos), t;
|
|
7660
7667
|
if (e === 123) {
|
|
7661
7668
|
this.options.ecmaVersion < 6 && this.unexpected();
|
|
@@ -7663,35 +7670,35 @@ Q.readRadixNumber = function(e) {
|
|
|
7663
7670
|
t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(n, "Code point out of bounds");
|
|
7664
7671
|
} else t = this.readHexChar(4);
|
|
7665
7672
|
return t;
|
|
7666
|
-
},
|
|
7673
|
+
}, $.readString = function(e) {
|
|
7667
7674
|
for (var t = "", n = ++this.pos;;) {
|
|
7668
7675
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
7669
7676
|
var r = this.input.charCodeAt(this.pos);
|
|
7670
7677
|
if (r === e) break;
|
|
7671
|
-
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (
|
|
7678
|
+
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (Ai(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
7672
7679
|
}
|
|
7673
|
-
return t += this.input.slice(n, this.pos++), this.finishToken(
|
|
7680
|
+
return t += this.input.slice(n, this.pos++), this.finishToken(B.string, t);
|
|
7674
7681
|
};
|
|
7675
|
-
var
|
|
7676
|
-
|
|
7682
|
+
var To = {};
|
|
7683
|
+
$.tryReadTemplateToken = function() {
|
|
7677
7684
|
this.inTemplateElement = !0;
|
|
7678
7685
|
try {
|
|
7679
7686
|
this.readTmplToken();
|
|
7680
7687
|
} catch (e) {
|
|
7681
|
-
if (e ===
|
|
7688
|
+
if (e === To) this.readInvalidTemplateToken();
|
|
7682
7689
|
else throw e;
|
|
7683
7690
|
}
|
|
7684
7691
|
this.inTemplateElement = !1;
|
|
7685
|
-
},
|
|
7686
|
-
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw
|
|
7692
|
+
}, $.invalidStringToken = function(e, t) {
|
|
7693
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw To;
|
|
7687
7694
|
this.raise(e, t);
|
|
7688
|
-
},
|
|
7695
|
+
}, $.readTmplToken = function() {
|
|
7689
7696
|
for (var e = "", t = this.pos;;) {
|
|
7690
7697
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
7691
7698
|
var n = this.input.charCodeAt(this.pos);
|
|
7692
|
-
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type ===
|
|
7699
|
+
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === B.template || this.type === B.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(B.dollarBraceL)) : (++this.pos, this.finishToken(B.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(B.template, e));
|
|
7693
7700
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
7694
|
-
else if (
|
|
7701
|
+
else if (Ai(n)) {
|
|
7695
7702
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
7696
7703
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
7697
7704
|
case 10:
|
|
@@ -7702,26 +7709,26 @@ Q.tryReadTemplateToken = function() {
|
|
|
7702
7709
|
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
7703
7710
|
} else ++this.pos;
|
|
7704
7711
|
}
|
|
7705
|
-
},
|
|
7712
|
+
}, $.readInvalidTemplateToken = function() {
|
|
7706
7713
|
for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
|
|
7707
7714
|
case "\\":
|
|
7708
7715
|
++this.pos;
|
|
7709
7716
|
break;
|
|
7710
7717
|
case "$": if (this.input[this.pos + 1] !== "{") break;
|
|
7711
|
-
case "`": return this.finishToken(
|
|
7718
|
+
case "`": return this.finishToken(B.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
7712
7719
|
case "\r": this.input[this.pos + 1] === "\n" && ++this.pos;
|
|
7713
7720
|
case "\n":
|
|
7714
7721
|
case "\u2028":
|
|
7715
7722
|
case "\u2029": ++this.curLine, this.lineStart = this.pos + 1;
|
|
7716
7723
|
}
|
|
7717
7724
|
this.raise(this.start, "Unterminated template");
|
|
7718
|
-
},
|
|
7725
|
+
}, $.readEscapedChar = function(e) {
|
|
7719
7726
|
var t = this.input.charCodeAt(++this.pos);
|
|
7720
7727
|
switch (++this.pos, t) {
|
|
7721
7728
|
case 110: return "\n";
|
|
7722
7729
|
case 114: return "\r";
|
|
7723
7730
|
case 120: return String.fromCharCode(this.readHexChar(2));
|
|
7724
|
-
case 117: return
|
|
7731
|
+
case 117: return Bi(this.readCodePoint());
|
|
7725
7732
|
case 116: return " ";
|
|
7726
7733
|
case 98: return "\b";
|
|
7727
7734
|
case 118: return "\v";
|
|
@@ -7738,56 +7745,56 @@ Q.tryReadTemplateToken = function() {
|
|
|
7738
7745
|
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
7739
7746
|
return i > 255 && (r = r.slice(0, -1), i = parseInt(r, 8)), this.pos += r.length - 1, t = this.input.charCodeAt(this.pos), (r !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(this.pos - 1 - r.length, e ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(i);
|
|
7740
7747
|
}
|
|
7741
|
-
return
|
|
7748
|
+
return Ai(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
7742
7749
|
}
|
|
7743
|
-
},
|
|
7750
|
+
}, $.readHexChar = function(e) {
|
|
7744
7751
|
var t = this.pos, n = this.readInt(16, e);
|
|
7745
7752
|
return n === null && this.invalidStringToken(t, "Bad character escape sequence"), n;
|
|
7746
|
-
},
|
|
7753
|
+
}, $.readWord1 = function() {
|
|
7747
7754
|
this.containsEsc = !1;
|
|
7748
7755
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
7749
7756
|
var i = this.fullCharCodeAtPos();
|
|
7750
|
-
if (
|
|
7757
|
+
if (Di(i, r)) this.pos += i <= 65535 ? 1 : 2;
|
|
7751
7758
|
else if (i === 92) {
|
|
7752
7759
|
this.containsEsc = !0, e += this.input.slice(n, this.pos);
|
|
7753
7760
|
var a = this.pos;
|
|
7754
7761
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
7755
7762
|
var o = this.readCodePoint();
|
|
7756
|
-
(t ?
|
|
7763
|
+
(t ? Ei : Di)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += Bi(o), n = this.pos;
|
|
7757
7764
|
} else break;
|
|
7758
7765
|
t = !1;
|
|
7759
7766
|
}
|
|
7760
7767
|
return e + this.input.slice(n, this.pos);
|
|
7761
|
-
},
|
|
7762
|
-
var e = this.readWord1(), t =
|
|
7763
|
-
return this.keywords.test(e) && (t =
|
|
7764
|
-
},
|
|
7765
|
-
Parser:
|
|
7768
|
+
}, $.readWord = function() {
|
|
7769
|
+
var e = this.readWord1(), t = B.name;
|
|
7770
|
+
return this.keywords.test(e) && (t = Oi[e]), this.finishToken(t, e);
|
|
7771
|
+
}, U.acorn = {
|
|
7772
|
+
Parser: U,
|
|
7766
7773
|
version: "8.18.0",
|
|
7767
|
-
defaultOptions:
|
|
7768
|
-
Position:
|
|
7769
|
-
SourceLocation:
|
|
7770
|
-
getLineInfo:
|
|
7771
|
-
Node:
|
|
7772
|
-
TokenType:
|
|
7773
|
-
tokTypes:
|
|
7774
|
-
keywordTypes:
|
|
7775
|
-
TokContext:
|
|
7776
|
-
tokContexts:
|
|
7777
|
-
isIdentifierChar:
|
|
7778
|
-
isIdentifierStart:
|
|
7779
|
-
Token:
|
|
7780
|
-
isNewLine:
|
|
7781
|
-
lineBreak:
|
|
7782
|
-
lineBreakG:
|
|
7783
|
-
nonASCIIwhitespace:
|
|
7774
|
+
defaultOptions: Gi,
|
|
7775
|
+
Position: Hi,
|
|
7776
|
+
SourceLocation: Ui,
|
|
7777
|
+
getLineInfo: Wi,
|
|
7778
|
+
Node: ja,
|
|
7779
|
+
TokenType: F,
|
|
7780
|
+
tokTypes: B,
|
|
7781
|
+
keywordTypes: Oi,
|
|
7782
|
+
TokContext: J,
|
|
7783
|
+
tokContexts: Y,
|
|
7784
|
+
isIdentifierChar: Di,
|
|
7785
|
+
isIdentifierStart: Ei,
|
|
7786
|
+
Token: So,
|
|
7787
|
+
isNewLine: Ai,
|
|
7788
|
+
lineBreak: V,
|
|
7789
|
+
lineBreakG: ki,
|
|
7790
|
+
nonASCIIwhitespace: Mi
|
|
7784
7791
|
};
|
|
7785
|
-
function
|
|
7786
|
-
return
|
|
7792
|
+
function Eo(e, t, n) {
|
|
7793
|
+
return U.parseExpressionAt(e, t, n);
|
|
7787
7794
|
}
|
|
7788
7795
|
//#endregion
|
|
7789
7796
|
//#region src/safe-eval.ts
|
|
7790
|
-
var
|
|
7797
|
+
var Do = process.cwd(), Oo = {
|
|
7791
7798
|
String: (e) => String(e ?? ""),
|
|
7792
7799
|
Number: (e) => Number(e),
|
|
7793
7800
|
Boolean: (e) => !!e,
|
|
@@ -7798,9 +7805,9 @@ var Oo = process.cwd(), ko = {
|
|
|
7798
7805
|
FS: {
|
|
7799
7806
|
readFile: (t) => e.readFileSync(t, "utf8"),
|
|
7800
7807
|
exists: (t) => (console.log("FS.exists [%s] %s", process.cwd(), t), e.existsSync(t)),
|
|
7801
|
-
join: (...e) => a.join(...e.map((e) => e === "CWD" ?
|
|
7808
|
+
join: (...e) => a.join(...e.map((e) => e === "CWD" ? Do : e))
|
|
7802
7809
|
}
|
|
7803
|
-
},
|
|
7810
|
+
}, ko = class {
|
|
7804
7811
|
static async evaluateValue(e, t = {}) {
|
|
7805
7812
|
if (typeof e != "string" || !e.includes("${")) return e;
|
|
7806
7813
|
let n = `\`${e}\``;
|
|
@@ -7818,7 +7825,7 @@ var Oo = process.cwd(), ko = {
|
|
|
7818
7825
|
if (!e || typeof e != "string") return e;
|
|
7819
7826
|
let n = e.trim(), r;
|
|
7820
7827
|
try {
|
|
7821
|
-
r =
|
|
7828
|
+
r = Eo(n, 0, {
|
|
7822
7829
|
ecmaVersion: 2020,
|
|
7823
7830
|
allowAwaitOutsideFunction: !1
|
|
7824
7831
|
});
|
|
@@ -7830,7 +7837,7 @@ var Oo = process.cwd(), ko = {
|
|
|
7830
7837
|
static async evalNodeAsync(e, t) {
|
|
7831
7838
|
switch (e.type) {
|
|
7832
7839
|
case "Literal": return e.value;
|
|
7833
|
-
case "Identifier": return e.name in t ? t[e.name] : e.name in
|
|
7840
|
+
case "Identifier": return e.name in t ? t[e.name] : e.name in Oo ? Oo[e.name] : void 0;
|
|
7834
7841
|
case "MemberExpression": {
|
|
7835
7842
|
let n = await this.evalNodeAsync(e.object, t);
|
|
7836
7843
|
if (n == null) return;
|
|
@@ -7856,7 +7863,7 @@ var Oo = process.cwd(), ko = {
|
|
|
7856
7863
|
else throw Error(`Property '${i}' is not a callable function on target object.`);
|
|
7857
7864
|
} else if (e.callee.type === "Identifier") {
|
|
7858
7865
|
let r = e.callee.name;
|
|
7859
|
-
if (n = t[r] ??
|
|
7866
|
+
if (n = t[r] ?? Oo[r], !n || typeof n != "function") throw Error(`Unknown function helper '${r}'.`);
|
|
7860
7867
|
}
|
|
7861
7868
|
if (!n) throw Error("Invalid function invocation target.");
|
|
7862
7869
|
let i = await Promise.all(e.arguments.map((e) => this.evalNodeAsync(e, t)));
|
|
@@ -7915,14 +7922,14 @@ var Oo = process.cwd(), ko = {
|
|
|
7915
7922
|
};
|
|
7916
7923
|
//#endregion
|
|
7917
7924
|
//#region src/preprocessors/github.ts
|
|
7918
|
-
function
|
|
7925
|
+
function Ao(e, t) {
|
|
7919
7926
|
let n = t.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*");
|
|
7920
7927
|
return RegExp(`^${n}$`).test(e);
|
|
7921
7928
|
}
|
|
7922
|
-
function
|
|
7929
|
+
function jo(e, t) {
|
|
7923
7930
|
return (Array.isArray(t) ? t : [t]).includes(e);
|
|
7924
7931
|
}
|
|
7925
|
-
var
|
|
7932
|
+
var Mo = class {
|
|
7926
7933
|
name = "github";
|
|
7927
7934
|
parse(e, t, n) {
|
|
7928
7935
|
let r = !1, i = null, a = e["x-hub-signature-256"];
|
|
@@ -7957,388 +7964,29 @@ var No = class {
|
|
|
7957
7964
|
}
|
|
7958
7965
|
filter(e, t) {
|
|
7959
7966
|
let n = !0;
|
|
7960
|
-
if (t.events && !t.events.includes(e.event) && (n = !1), t.owner && !
|
|
7967
|
+
if (t.events && !t.events.includes(e.event) && (n = !1), t.owner && !jo(e.owner, t.owner) && (n = !1), t.repo && !jo(e.repo, t.repo) && (n = !1), t.branches && !t.branches.some((t) => Ao(e.branch, t)) && (n = !1), t.tag !== void 0 && !!e.tag !== t.tag && (n = !1), t.tags) try {
|
|
7961
7968
|
t.tags.some((t) => new RegExp(t).test(e.tag)) || (n = !1);
|
|
7962
7969
|
} catch {
|
|
7963
7970
|
n = !1;
|
|
7964
7971
|
}
|
|
7965
|
-
return t.paths && ((Array.isArray(e.changes) ? e.changes : []).some((e) => t.paths?.some((t) =>
|
|
7972
|
+
return t.paths && ((Array.isArray(e.changes) ? e.changes : []).some((e) => t.paths?.some((t) => Ao(e, t))) || (n = !1)), {
|
|
7966
7973
|
isValid: n,
|
|
7967
7974
|
inputs: e
|
|
7968
7975
|
};
|
|
7969
7976
|
}
|
|
7970
|
-
}, Po = function(e, t) {
|
|
7971
|
-
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
7972
|
-
}, $;
|
|
7973
|
-
(function(e) {
|
|
7974
|
-
e[e.EOS = 0] = "EOS", e[e.Text = 1] = "Text", e[e.Incomplete = 2] = "Incomplete", e[e.ESC = 3] = "ESC", e[e.Unknown = 4] = "Unknown", e[e.SGR = 5] = "SGR", e[e.OSCURL = 6] = "OSCURL";
|
|
7975
|
-
})($ ||= {});
|
|
7976
|
-
var Fo = class {
|
|
7977
|
-
constructor() {
|
|
7978
|
-
this.VERSION = "6.0.6", this.setup_palettes(), this._use_classes = !1, this.bold = !1, this.faint = !1, this.italic = !1, this.underline = !1, this.fg = this.bg = null, this._buffer = "", this._url_allowlist = {
|
|
7979
|
-
http: 1,
|
|
7980
|
-
https: 1
|
|
7981
|
-
}, this._escape_html = !0, this.boldStyle = "font-weight:bold", this.faintStyle = "opacity:0.7", this.italicStyle = "font-style:italic", this.underlineStyle = "text-decoration:underline";
|
|
7982
|
-
}
|
|
7983
|
-
set use_classes(e) {
|
|
7984
|
-
this._use_classes = e;
|
|
7985
|
-
}
|
|
7986
|
-
get use_classes() {
|
|
7987
|
-
return this._use_classes;
|
|
7988
|
-
}
|
|
7989
|
-
set url_allowlist(e) {
|
|
7990
|
-
this._url_allowlist = e;
|
|
7991
|
-
}
|
|
7992
|
-
get url_allowlist() {
|
|
7993
|
-
return this._url_allowlist;
|
|
7994
|
-
}
|
|
7995
|
-
set escape_html(e) {
|
|
7996
|
-
this._escape_html = e;
|
|
7997
|
-
}
|
|
7998
|
-
get escape_html() {
|
|
7999
|
-
return this._escape_html;
|
|
8000
|
-
}
|
|
8001
|
-
set boldStyle(e) {
|
|
8002
|
-
this._boldStyle = e;
|
|
8003
|
-
}
|
|
8004
|
-
get boldStyle() {
|
|
8005
|
-
return this._boldStyle;
|
|
8006
|
-
}
|
|
8007
|
-
set faintStyle(e) {
|
|
8008
|
-
this._faintStyle = e;
|
|
8009
|
-
}
|
|
8010
|
-
get faintStyle() {
|
|
8011
|
-
return this._faintStyle;
|
|
8012
|
-
}
|
|
8013
|
-
set italicStyle(e) {
|
|
8014
|
-
this._italicStyle = e;
|
|
8015
|
-
}
|
|
8016
|
-
get italicStyle() {
|
|
8017
|
-
return this._italicStyle;
|
|
8018
|
-
}
|
|
8019
|
-
set underlineStyle(e) {
|
|
8020
|
-
this._underlineStyle = e;
|
|
8021
|
-
}
|
|
8022
|
-
get underlineStyle() {
|
|
8023
|
-
return this._underlineStyle;
|
|
8024
|
-
}
|
|
8025
|
-
setup_palettes() {
|
|
8026
|
-
this.ansi_colors = [[
|
|
8027
|
-
{
|
|
8028
|
-
rgb: [
|
|
8029
|
-
0,
|
|
8030
|
-
0,
|
|
8031
|
-
0
|
|
8032
|
-
],
|
|
8033
|
-
class_name: "ansi-black"
|
|
8034
|
-
},
|
|
8035
|
-
{
|
|
8036
|
-
rgb: [
|
|
8037
|
-
187,
|
|
8038
|
-
0,
|
|
8039
|
-
0
|
|
8040
|
-
],
|
|
8041
|
-
class_name: "ansi-red"
|
|
8042
|
-
},
|
|
8043
|
-
{
|
|
8044
|
-
rgb: [
|
|
8045
|
-
0,
|
|
8046
|
-
187,
|
|
8047
|
-
0
|
|
8048
|
-
],
|
|
8049
|
-
class_name: "ansi-green"
|
|
8050
|
-
},
|
|
8051
|
-
{
|
|
8052
|
-
rgb: [
|
|
8053
|
-
187,
|
|
8054
|
-
187,
|
|
8055
|
-
0
|
|
8056
|
-
],
|
|
8057
|
-
class_name: "ansi-yellow"
|
|
8058
|
-
},
|
|
8059
|
-
{
|
|
8060
|
-
rgb: [
|
|
8061
|
-
0,
|
|
8062
|
-
0,
|
|
8063
|
-
187
|
|
8064
|
-
],
|
|
8065
|
-
class_name: "ansi-blue"
|
|
8066
|
-
},
|
|
8067
|
-
{
|
|
8068
|
-
rgb: [
|
|
8069
|
-
187,
|
|
8070
|
-
0,
|
|
8071
|
-
187
|
|
8072
|
-
],
|
|
8073
|
-
class_name: "ansi-magenta"
|
|
8074
|
-
},
|
|
8075
|
-
{
|
|
8076
|
-
rgb: [
|
|
8077
|
-
0,
|
|
8078
|
-
187,
|
|
8079
|
-
187
|
|
8080
|
-
],
|
|
8081
|
-
class_name: "ansi-cyan"
|
|
8082
|
-
},
|
|
8083
|
-
{
|
|
8084
|
-
rgb: [
|
|
8085
|
-
255,
|
|
8086
|
-
255,
|
|
8087
|
-
255
|
|
8088
|
-
],
|
|
8089
|
-
class_name: "ansi-white"
|
|
8090
|
-
}
|
|
8091
|
-
], [
|
|
8092
|
-
{
|
|
8093
|
-
rgb: [
|
|
8094
|
-
85,
|
|
8095
|
-
85,
|
|
8096
|
-
85
|
|
8097
|
-
],
|
|
8098
|
-
class_name: "ansi-bright-black"
|
|
8099
|
-
},
|
|
8100
|
-
{
|
|
8101
|
-
rgb: [
|
|
8102
|
-
255,
|
|
8103
|
-
85,
|
|
8104
|
-
85
|
|
8105
|
-
],
|
|
8106
|
-
class_name: "ansi-bright-red"
|
|
8107
|
-
},
|
|
8108
|
-
{
|
|
8109
|
-
rgb: [
|
|
8110
|
-
0,
|
|
8111
|
-
255,
|
|
8112
|
-
0
|
|
8113
|
-
],
|
|
8114
|
-
class_name: "ansi-bright-green"
|
|
8115
|
-
},
|
|
8116
|
-
{
|
|
8117
|
-
rgb: [
|
|
8118
|
-
255,
|
|
8119
|
-
255,
|
|
8120
|
-
85
|
|
8121
|
-
],
|
|
8122
|
-
class_name: "ansi-bright-yellow"
|
|
8123
|
-
},
|
|
8124
|
-
{
|
|
8125
|
-
rgb: [
|
|
8126
|
-
85,
|
|
8127
|
-
85,
|
|
8128
|
-
255
|
|
8129
|
-
],
|
|
8130
|
-
class_name: "ansi-bright-blue"
|
|
8131
|
-
},
|
|
8132
|
-
{
|
|
8133
|
-
rgb: [
|
|
8134
|
-
255,
|
|
8135
|
-
85,
|
|
8136
|
-
255
|
|
8137
|
-
],
|
|
8138
|
-
class_name: "ansi-bright-magenta"
|
|
8139
|
-
},
|
|
8140
|
-
{
|
|
8141
|
-
rgb: [
|
|
8142
|
-
85,
|
|
8143
|
-
255,
|
|
8144
|
-
255
|
|
8145
|
-
],
|
|
8146
|
-
class_name: "ansi-bright-cyan"
|
|
8147
|
-
},
|
|
8148
|
-
{
|
|
8149
|
-
rgb: [
|
|
8150
|
-
255,
|
|
8151
|
-
255,
|
|
8152
|
-
255
|
|
8153
|
-
],
|
|
8154
|
-
class_name: "ansi-bright-white"
|
|
8155
|
-
}
|
|
8156
|
-
]], this.palette_256 = [], this.ansi_colors.forEach((e) => {
|
|
8157
|
-
e.forEach((e) => {
|
|
8158
|
-
this.palette_256.push(e);
|
|
8159
|
-
});
|
|
8160
|
-
});
|
|
8161
|
-
let e = [
|
|
8162
|
-
0,
|
|
8163
|
-
95,
|
|
8164
|
-
135,
|
|
8165
|
-
175,
|
|
8166
|
-
215,
|
|
8167
|
-
255
|
|
8168
|
-
];
|
|
8169
|
-
for (let t = 0; t < 6; ++t) for (let n = 0; n < 6; ++n) for (let r = 0; r < 6; ++r) {
|
|
8170
|
-
let i = {
|
|
8171
|
-
rgb: [
|
|
8172
|
-
e[t],
|
|
8173
|
-
e[n],
|
|
8174
|
-
e[r]
|
|
8175
|
-
],
|
|
8176
|
-
class_name: "truecolor"
|
|
8177
|
-
};
|
|
8178
|
-
this.palette_256.push(i);
|
|
8179
|
-
}
|
|
8180
|
-
let t = 8;
|
|
8181
|
-
for (let e = 0; e < 24; ++e, t += 10) {
|
|
8182
|
-
let e = {
|
|
8183
|
-
rgb: [
|
|
8184
|
-
t,
|
|
8185
|
-
t,
|
|
8186
|
-
t
|
|
8187
|
-
],
|
|
8188
|
-
class_name: "truecolor"
|
|
8189
|
-
};
|
|
8190
|
-
this.palette_256.push(e);
|
|
8191
|
-
}
|
|
8192
|
-
}
|
|
8193
|
-
escape_txt_for_html(e) {
|
|
8194
|
-
return this._escape_html ? e.replace(/[&<>"']/gm, (e) => {
|
|
8195
|
-
if (e === "&") return "&";
|
|
8196
|
-
if (e === "<") return "<";
|
|
8197
|
-
if (e === ">") return ">";
|
|
8198
|
-
if (e === "\"") return """;
|
|
8199
|
-
if (e === "'") return "'";
|
|
8200
|
-
}) : e;
|
|
8201
|
-
}
|
|
8202
|
-
append_buffer(e) {
|
|
8203
|
-
var t = this._buffer + e;
|
|
8204
|
-
this._buffer = t;
|
|
8205
|
-
}
|
|
8206
|
-
get_next_packet() {
|
|
8207
|
-
var e = {
|
|
8208
|
-
kind: $.EOS,
|
|
8209
|
-
text: "",
|
|
8210
|
-
url: ""
|
|
8211
|
-
}, t = this._buffer.length;
|
|
8212
|
-
if (t == 0) return e;
|
|
8213
|
-
var n = this._buffer.indexOf("\x1B");
|
|
8214
|
-
if (n == -1) return e.kind = $.Text, e.text = this._buffer, this._buffer = "", e;
|
|
8215
|
-
if (n > 0) return e.kind = $.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
|
|
8216
|
-
if (n == 0) {
|
|
8217
|
-
if (t < 3) return e.kind = $.Incomplete, e;
|
|
8218
|
-
var r = this._buffer.charAt(1);
|
|
8219
|
-
if (r != "[" && r != "]" && r != "(") return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8220
|
-
if (r == "[") {
|
|
8221
|
-
this._csi_regex ||= Io(Ro ||= Po(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \x1B[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \x1B[ # CSI\n [ -~]* # anything legal\n ([\0-:]) # anything illegal\n )\n "], ["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]));
|
|
8222
|
-
let t = this._buffer.match(this._csi_regex);
|
|
8223
|
-
if (t === null) return e.kind = $.Incomplete, e;
|
|
8224
|
-
if (t[4]) return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8225
|
-
e.kind = t[1] != "" || t[3] != "m" ? $.Unknown : $.SGR, e.text = t[2];
|
|
8226
|
-
var i = t[0].length;
|
|
8227
|
-
return this._buffer = this._buffer.slice(i), e;
|
|
8228
|
-
}
|
|
8229
|
-
if (r == "]") {
|
|
8230
|
-
if (t < 4) return e.kind = $.Incomplete, e;
|
|
8231
|
-
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8232
|
-
this._osc_st ||= Lo(zo ||= Po(["\n (?: # legal sequence\n (\x1B\\) # ESC | # alternate\n (\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-] # anything illegal\n | # alternate\n [\b-] # anything illegal\n | # alternate\n [-] # anything illegal\n )\n "], ["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "])), this._osc_st.lastIndex = 0;
|
|
8233
|
-
{
|
|
8234
|
-
let t = this._osc_st.exec(this._buffer);
|
|
8235
|
-
if (t === null) return e.kind = $.Incomplete, e;
|
|
8236
|
-
if (t[3]) return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8237
|
-
}
|
|
8238
|
-
{
|
|
8239
|
-
let t = this._osc_st.exec(this._buffer);
|
|
8240
|
-
if (t === null) return e.kind = $.Incomplete, e;
|
|
8241
|
-
if (t[3]) return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8242
|
-
}
|
|
8243
|
-
this._osc_regex ||= Io(Bo ||= Po(["\n ^ # beginning of line\n #\n \x1B]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\x1B\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n \x1B]8;; # OSC Hyperlink End\n (?: # ST\n (?:\x1B\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n "], ["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]));
|
|
8244
|
-
let n = this._buffer.match(this._osc_regex);
|
|
8245
|
-
if (n === null) return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8246
|
-
e.kind = $.OSCURL, e.url = n[1], e.text = n[2];
|
|
8247
|
-
var i = n[0].length;
|
|
8248
|
-
return this._buffer = this._buffer.slice(i), e;
|
|
8249
|
-
}
|
|
8250
|
-
if (r == "(") return e.kind = $.Unknown, this._buffer = this._buffer.slice(3), e;
|
|
8251
|
-
}
|
|
8252
|
-
}
|
|
8253
|
-
ansi_to_html(e) {
|
|
8254
|
-
this.append_buffer(e);
|
|
8255
|
-
for (var t = [];;) {
|
|
8256
|
-
var n = this.get_next_packet();
|
|
8257
|
-
if (n.kind == $.EOS || n.kind == $.Incomplete) break;
|
|
8258
|
-
n.kind != $.ESC && n.kind != $.Unknown && (n.kind == $.Text ? t.push(this.transform_to_html(this.with_state(n))) : n.kind == $.SGR ? this.process_ansi(n) : n.kind == $.OSCURL && t.push(this.process_hyperlink(n)));
|
|
8259
|
-
}
|
|
8260
|
-
return t.join("");
|
|
8261
|
-
}
|
|
8262
|
-
with_state(e) {
|
|
8263
|
-
return {
|
|
8264
|
-
bold: this.bold,
|
|
8265
|
-
faint: this.faint,
|
|
8266
|
-
italic: this.italic,
|
|
8267
|
-
underline: this.underline,
|
|
8268
|
-
fg: this.fg,
|
|
8269
|
-
bg: this.bg,
|
|
8270
|
-
text: e.text
|
|
8271
|
-
};
|
|
8272
|
-
}
|
|
8273
|
-
process_ansi(e) {
|
|
8274
|
-
let t = e.text.split(";");
|
|
8275
|
-
for (; t.length > 0;) {
|
|
8276
|
-
let e = t.shift(), n = parseInt(e, 10);
|
|
8277
|
-
if (isNaN(n) || n === 0) this.fg = null, this.bg = null, this.bold = !1, this.faint = !1, this.italic = !1, this.underline = !1;
|
|
8278
|
-
else if (n === 1) this.bold = !0;
|
|
8279
|
-
else if (n === 2) this.faint = !0;
|
|
8280
|
-
else if (n === 3) this.italic = !0;
|
|
8281
|
-
else if (n === 4) this.underline = !0;
|
|
8282
|
-
else if (n === 21) this.bold = !1;
|
|
8283
|
-
else if (n === 22) this.faint = !1, this.bold = !1;
|
|
8284
|
-
else if (n === 23) this.italic = !1;
|
|
8285
|
-
else if (n === 24) this.underline = !1;
|
|
8286
|
-
else if (n === 39) this.fg = null;
|
|
8287
|
-
else if (n === 49) this.bg = null;
|
|
8288
|
-
else if (n >= 30 && n < 38) this.fg = this.ansi_colors[0][n - 30];
|
|
8289
|
-
else if (n >= 40 && n < 48) this.bg = this.ansi_colors[0][n - 40];
|
|
8290
|
-
else if (n >= 90 && n < 98) this.fg = this.ansi_colors[1][n - 90];
|
|
8291
|
-
else if (n >= 100 && n < 108) this.bg = this.ansi_colors[1][n - 100];
|
|
8292
|
-
else if ((n === 38 || n === 48) && t.length > 0) {
|
|
8293
|
-
let e = n === 38, r = t.shift();
|
|
8294
|
-
if (r === "5" && t.length > 0) {
|
|
8295
|
-
let n = parseInt(t.shift(), 10);
|
|
8296
|
-
n >= 0 && n <= 255 && (e ? this.fg = this.palette_256[n] : this.bg = this.palette_256[n]);
|
|
8297
|
-
}
|
|
8298
|
-
if (r === "2" && t.length > 2) {
|
|
8299
|
-
let n = parseInt(t.shift(), 10), r = parseInt(t.shift(), 10), i = parseInt(t.shift(), 10);
|
|
8300
|
-
if (n >= 0 && n <= 255 && r >= 0 && r <= 255 && i >= 0 && i <= 255) {
|
|
8301
|
-
let t = {
|
|
8302
|
-
rgb: [
|
|
8303
|
-
n,
|
|
8304
|
-
r,
|
|
8305
|
-
i
|
|
8306
|
-
],
|
|
8307
|
-
class_name: "truecolor"
|
|
8308
|
-
};
|
|
8309
|
-
e ? this.fg = t : this.bg = t;
|
|
8310
|
-
}
|
|
8311
|
-
}
|
|
8312
|
-
}
|
|
8313
|
-
}
|
|
8314
|
-
}
|
|
8315
|
-
transform_to_html(e) {
|
|
8316
|
-
let t = e.text;
|
|
8317
|
-
if (t.length === 0 || (t = this.escape_txt_for_html(t), !e.bold && !e.italic && !e.faint && !e.underline && e.fg === null && e.bg === null)) return t;
|
|
8318
|
-
let n = [], r = [], i = e.fg, a = e.bg;
|
|
8319
|
-
e.bold && n.push(this._boldStyle), e.faint && n.push(this._faintStyle), e.italic && n.push(this._italicStyle), e.underline && n.push(this._underlineStyle), this._use_classes ? (i && (i.class_name === "truecolor" ? n.push(`color:rgb(${i.rgb.join(",")})`) : r.push(`${i.class_name}-fg`)), a && (a.class_name === "truecolor" ? n.push(`background-color:rgb(${a.rgb.join(",")})`) : r.push(`${a.class_name}-bg`))) : (i && n.push(`color:rgb(${i.rgb.join(",")})`), a && n.push(`background-color:rgb(${a.rgb})`));
|
|
8320
|
-
let o = "", s = "";
|
|
8321
|
-
return r.length && (o = ` class="${r.join(" ")}"`), n.length && (s = ` style="${n.join(";")}"`), `<span${s}${o}>${t}</span>`;
|
|
8322
|
-
}
|
|
8323
|
-
process_hyperlink(e) {
|
|
8324
|
-
let t = e.url.split(":");
|
|
8325
|
-
return t.length < 1 || !this._url_allowlist[t[0]] ? "" : `<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`;
|
|
8326
|
-
}
|
|
8327
7977
|
};
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
}
|
|
8332
|
-
function Lo(e, ...t) {
|
|
8333
|
-
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
8334
|
-
return new RegExp(n, "g");
|
|
7978
|
+
//#endregion
|
|
7979
|
+
//#region src/html-state.ts
|
|
7980
|
+
function No(e) {
|
|
7981
|
+
return JSON.stringify(e).replace(/[<>&\u2028\u2029]/g, (e) => `\\u${e.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
8335
7982
|
}
|
|
8336
|
-
|
|
7983
|
+
//#endregion
|
|
7984
|
+
//#region src/reporters/html.reporter.html?raw
|
|
7985
|
+
var Po = "<!DOCTYPE html>\n<html lang=\"en\" class=\"dark\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Workflow Run</title>\n <script type=\"importmap\">\n {\n \"imports\": {\n \"@li3/\": \"https://cdn.li3.dev/@li3/\",\n \"ansi_up\": \"https://esm.sh/ansi_up@6.0.6\"\n }\n }\n <\/script>\n</head>\n<body class=\"bg-gray-950 text-gray-100 min-h-screen p-4 md:p-6 font-sans\">\n <template app>\n <div class=\"max-w-5xl mx-auto space-y-4\">\n <header class=\"flex flex-col md:flex-row md:items-center justify-between border-b border-gray-800 pb-6 gap-4\">\n <div class=\"min-w-0\">\n <a href=\"/runs\" class=\"text-xs text-indigo-400 hover:underline mb-1 inline-block\">Back to Dashboard</a>\n <h1 class=\"text-2xl font-bold text-white flex flex-wrap items-center gap-3\">\n {{ report.workflowName }}\n <span class=\"text-sm font-mono text-gray-500\">#{{ report.jobId }}</span>\n <template if=\"report.parentId\">\n <a attr-href=\"'/runs/' + report.parentId\" class=\"text-sm font-mono text-indigo-400 hover:underline\">\n from #{{ report.parentId }}\n </a>\n </template>\n </h1>\n <p class=\"text-xs text-gray-400 mt-1\">Started {{ report.startedAt }} · {{ timing }}</p>\n </div>\n <div class=\"flex items-center gap-2 shrink-0\">\n <span\n class=\"px-4 py-1.5 rounded-full text-sm font-semibold border\"\n bind-class=\"{\n 'bg-emerald-500/10.text-emerald-400.border-emerald-500/20': report.status === 'success',\n 'bg-rose-500/10.text-rose-400.border-rose-500/20': report.status === 'failed',\n 'bg-indigo-500/10.text-indigo-400.border-indigo-500/20': report.status === 'running',\n 'bg-amber-500/10.text-amber-400.border-amber-500/20': !['success', 'failed', 'running'].includes(report.status)\n }\"\n >\n {{ upper(report.status) }}\n </span>\n <button\n class=\"text-sm text-white px-4 py-1.5 border border-gray-600 hover:border-gray-400 rounded-full\"\n on-click=\"restartJob()\"\n >\n Restart\n </button>\n </div>\n </header>\n\n <section class=\"rounded overflow-hidden border-b border-gray-800\">\n <h2 class=\"sr-only\">Execution Steps</h2>\n <template for=\"[step, index] of report.steps\">\n <details class=\"border border-b-0 border-gray-800 bg-gray-900/50 text-sm\">\n <summary class=\"flex flex-col md:flex-row md:items-center justify-between gap-2 p-3 bg-gray-800/40 border-b border-gray-800 cursor-pointer\">\n <div class=\"flex flex-wrap items-center gap-3 min-w-0\">\n <span class=\"font-mono text-gray-500\">\n #{{ index + 1 }}<template if=\"step.exitCode !== undefined && step.exitCode !== 0\"> ({{ step.exitCode }})</template>\n </span>\n <h3 class=\"font-semibold text-gray-200 break-words\">{{ step.name }}</h3>\n <span\n class=\"px-2.5 py-0.5 rounded-full font-medium\"\n bind-class=\"{\n 'text-emerald-400.bg-emerald-500/10': step.status === 'success',\n 'text-rose-400.bg-rose-500/10': step.status === 'failed',\n 'text-indigo-400.bg-indigo-500/10': step.status === 'running',\n 'text-gray-400.bg-gray-500/10': !['success', 'failed', 'running'].includes(step.status)\n }\"\n >\n {{ upper(step.status) }}\n </span>\n </div>\n <div class=\"font-mono text-gray-400 shrink-0\">{{ step.durationMs }}ms</div>\n </summary>\n <div class=\"p-4 bg-gray-950 font-mono text-gray-300 leading-relaxed overflow-auto w-full\">\n <pre class=\"whitespace-pre-wrap\" bind-innerhtml=\"stepLog(step)\"></pre>\n </div>\n </details>\n </template>\n </section>\n\n <details class=\"bg-gray-900 border border-gray-800 rounded-xl p-4 overflow-auto max-h-[400px]\">\n <summary class=\"cursor-pointer\">\n <h2 class=\"inline text-xs font-semibold text-gray-400 uppercase tracking-wider\">Trigger Inputs</h2>\n </summary>\n <pre class=\"font-mono text-xs text-gray-200 bg-gray-950 p-3 mt-3 rounded-lg overflow-x-auto\">{{ inputsJson }}</pre>\n </details>\n </div>\n\n <script setup>\n import { computed, onInit, ref } from '@li3/web';\n import { AnsiUp } from 'ansi_up';\n\n export default function setup() {\n const report = ref({});\n const ansiUp = new AnsiUp();\n ansiUp.use_classes = false;\n\n const active = computed(() => ['pending', 'running'].includes(report.value.status));\n const inputsJson = computed(() => JSON.stringify(report.value.inputs || {}, null, 2));\n const timing = computed(() => {\n if (report.value.status === 'pending') return 'Waiting for a worker';\n if (report.value.status === 'running') return `Running for ${report.value.durationMs}ms`;\n return `Finished in ${report.value.durationMs}ms`;\n });\n\n const upper = (value) => String(value || '').toUpperCase();\n const stepLog = (step) => {\n if (step.status === 'skipped') return '';\n if (step.status === 'running') return '<span class=\"text-indigo-400\">Step is running. Logs will appear after it finishes.</span>';\n if (step.status === 'pending') return '<span class=\"text-gray-500\">Waiting to run.</span>';\n if (step.logContent) return ansiUp.ansi_to_html(step.logContent);\n return '<span class=\"text-gray-500\">(No terminal log output recorded for this step)</span>';\n };\n const restartJob = async () => {\n const response = await fetch(`/restart/${report.value.jobId}`, { method: 'POST' });\n if (response.ok) {\n const { id } = await response.json();\n location.href = `/runs/${id}`;\n }\n };\n\n onInit(() => {\n document.title = `Run #${report.value.jobId} - ${report.value.workflowName}`;\n if (active.value) setTimeout(() => location.reload(), 3000);\n });\n\n return { report, inputsJson, timing, upper, stepLog, restartJob };\n }\n <\/script>\n <script state>__REPORT_STATE__<\/script>\n </template>\n\n <script type=\"module\">import '@li3/web';<\/script>\n <script src=\"https://cdn.tailwindcss.com\"><\/script>\n</body>\n</html>\n", Fo = "__REPORT_STATE__", Io = class {
|
|
8337
7986
|
name = "html";
|
|
8338
7987
|
outputDir;
|
|
8339
|
-
ansiUp;
|
|
8340
7988
|
constructor(e) {
|
|
8341
|
-
this.outputDir = e.outputDir
|
|
7989
|
+
this.outputDir = e.outputDir;
|
|
8342
7990
|
}
|
|
8343
7991
|
async report(t) {
|
|
8344
7992
|
e.mkdirSync(this.outputDir, { recursive: !0 });
|
|
@@ -8346,91 +7994,18 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8346
7994
|
e.writeFileSync(r, n, "utf-8"), console.log(`📊 HTML Execution Report generated: ${r}`);
|
|
8347
7995
|
}
|
|
8348
7996
|
generateHtml(e) {
|
|
8349
|
-
|
|
8350
|
-
|
|
8351
|
-
|
|
8352
|
-
<summary class="flex items-center justify-between p-2 bg-gray-800/40 border-b border-gray-800 cursor-pointer">
|
|
8353
|
-
<div class="flex items-center gap-3">
|
|
8354
|
-
<span class="font-mono text-gray-500">#${t + 1} ${e.exitCode === 0 ? "" : "(" + e.exitCode + ")"}</span>
|
|
8355
|
-
<h3 class="font-semibold text-gray-200">${e.name}</h3>
|
|
8356
|
-
<span class="px-2.5 py-0.5 rounded-full font-medium ${i}">
|
|
8357
|
-
${e.status.toUpperCase()}
|
|
8358
|
-
</span>
|
|
8359
|
-
</div>
|
|
8360
|
-
<div class="font-mono text-gray-400">${e.durationMs}ms</div>
|
|
8361
|
-
</summary>
|
|
8362
|
-
<div class="p-4 bg-gray-950 font-mono text-gray-300 leading-relaxed overflow-auto w-full">
|
|
8363
|
-
<pre class="whitespace-pre-wrap">${r}</pre>
|
|
8364
|
-
</div>
|
|
8365
|
-
</details>`;
|
|
8366
|
-
}).join("");
|
|
8367
|
-
return `<!DOCTYPE html>
|
|
8368
|
-
<html lang="en" class="dark">
|
|
8369
|
-
<head>
|
|
8370
|
-
<meta charset="UTF-8">
|
|
8371
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8372
|
-
<title>Run #${e.jobId} - ${e.workflowName}</title>
|
|
8373
|
-
<script type="importmap"> {"imports": { "@li3/": "https://cdn.li3.dev/@li3/" }}<\/script>
|
|
8374
|
-
<script>
|
|
8375
|
-
async function restartJob(jobId) {
|
|
8376
|
-
const r = await fetch('/restart/' + jobId, { method:'POST' });
|
|
8377
|
-
if (r.ok) {
|
|
8378
|
-
const { id } = await r.json();
|
|
8379
|
-
location.href = '/runs/' + id
|
|
8380
|
-
}
|
|
8381
|
-
}
|
|
8382
|
-
<\/script>
|
|
8383
|
-
</head>
|
|
8384
|
-
<body class="bg-gray-950 text-gray-100 min-h-screen p-6 font-sans">
|
|
8385
|
-
<div class="max-w-5xl mx-auto space-y-4">
|
|
8386
|
-
|
|
8387
|
-
<div class="flex items-center justify-between border-b border-gray-800 pb-6 gap-2">
|
|
8388
|
-
<div>
|
|
8389
|
-
<a href="/runs" class="text-xs text-indigo-400 hover:underline mb-1 inline-block">← Back to Dashboard</a>
|
|
8390
|
-
<h1 class="text-2xl font-bold text-white flex items-center gap-3">
|
|
8391
|
-
${e.workflowName}
|
|
8392
|
-
<span class="text-sm font-mono text-gray-500">#${e.jobId}
|
|
8393
|
-
${e.parentId ? ` -> <a href="/runs/${e.parentId}">#${e.parentId}</a>` : ""}
|
|
8394
|
-
</span>
|
|
8395
|
-
</h1>
|
|
8396
|
-
<p class="text-xs text-gray-400 mt-1">Started ${e.startedAt} • Finished in ${e.durationMs}ms</p>
|
|
8397
|
-
</div>
|
|
8398
|
-
<div class="flex items-center gap-2">
|
|
8399
|
-
<span class="px-4 py-1.5 rounded-full text-sm font-semibold border ${t}">
|
|
8400
|
-
${e.status.toUpperCase()}
|
|
8401
|
-
</span>
|
|
8402
|
-
<button class="text-sm text-white px-4 py-1.5 border border-gray-400 rounded-full" onclick="restartJob('${e.jobId}')">restart</button>
|
|
8403
|
-
</div>
|
|
8404
|
-
</div>
|
|
8405
|
-
|
|
8406
|
-
<div class="rounded overflow-hidden border-b border-gray-800">
|
|
8407
|
-
<h2 class="sr-only">Execution Steps</h2>
|
|
8408
|
-
${n}
|
|
8409
|
-
</div>
|
|
8410
|
-
|
|
8411
|
-
<details class="bg-gray-900 border border-gray-800 rounded-xl p-4 overflow-auto max-h-[400px]">
|
|
8412
|
-
<summary>
|
|
8413
|
-
<h2 class="text-xs font-semibold text-gray-400 uppercase tracking-wider mb-2">Trigger Inputs</h2>
|
|
8414
|
-
</summary>
|
|
8415
|
-
<pre class="font-mono text-xs text-gray-200 bg-gray-950 p-3 rounded-lg overflow-x-auto">${JSON.stringify(e.inputs, null, 2)}</pre>
|
|
8416
|
-
</details>
|
|
8417
|
-
|
|
8418
|
-
</div>
|
|
8419
|
-
<script type="module">import "@li3/web"<\/script>
|
|
8420
|
-
<script src="https://cdn.tailwindcss.com"><\/script>
|
|
8421
|
-
</body>
|
|
8422
|
-
</html>`;
|
|
8423
|
-
}
|
|
8424
|
-
}, Ho = class e {
|
|
7997
|
+
return Po.replace(Fo, () => No({ report: e }));
|
|
7998
|
+
}
|
|
7999
|
+
}, Lo = class e {
|
|
8425
8000
|
static async from(t) {
|
|
8426
|
-
let n = o(t) ? c("/", t) : s(process.cwd(), c("/", t)), r = (await _(n, { withFileTypes: !0 })).filter((e) => e.isFile() && (e.name.endsWith(".yml") || e.name.endsWith(".yaml"))).map((e) => s(n, e.name)), i = [], a = new
|
|
8001
|
+
let n = o(t) ? c("/", t) : s(process.cwd(), c("/", t)), r = (await _(n, { withFileTypes: !0 })).filter((e) => e.isFile() && (e.name.endsWith(".yml") || e.name.endsWith(".yaml"))).map((e) => s(n, e.name)), i = [], a = new di(t);
|
|
8427
8002
|
for (let t of r) i.push(...await e.loadFile(t, a));
|
|
8428
8003
|
return i;
|
|
8429
8004
|
}
|
|
8430
8005
|
static loadFile(e, t) {
|
|
8431
8006
|
let n = [];
|
|
8432
8007
|
try {
|
|
8433
|
-
let r =
|
|
8008
|
+
let r = fi(t.resolve(e));
|
|
8434
8009
|
for (let t of r) {
|
|
8435
8010
|
if (typeof t.on != "object") {
|
|
8436
8011
|
console.error(`on: not defined in ${e}! Ignoring this workflow.`);
|
|
@@ -8454,7 +8029,25 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8454
8029
|
}
|
|
8455
8030
|
return n;
|
|
8456
8031
|
}
|
|
8457
|
-
},
|
|
8032
|
+
}, Ro = "<!DOCTYPE html>\n<html lang=\"en\" class=\"dark\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Workflow Engine Dashboard</title>\n <script type=\"importmap\">\n { \"imports\": { \"@li3/\": \"https://cdn.li3.dev/@li3/\" } }\n <\/script>\n</head>\n<body class=\"bg-gray-950 text-gray-100 min-h-screen p-4 md:p-6 font-sans\">\n <template app>\n <main class=\"max-w-6xl mx-auto space-y-6\">\n <header class=\"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-gray-800 pb-4\">\n <div>\n <h1 class=\"text-2xl font-bold text-white\">Runner Engine Status</h1>\n <p class=\"text-xs text-gray-400\">Live Job Queue & Execution Traces</p>\n </div>\n <div class=\"flex items-center gap-3 text-xs font-mono\">\n <span class=\"text-gray-500\">Updated {{ lastUpdated }}</span>\n <span\n class=\"px-3 py-1 rounded-full border\"\n bind-class=\"{\n 'bg-emerald-500/10.text-emerald-400.border-emerald-500/20': !refreshError,\n 'bg-rose-500/10.text-rose-400.border-rose-500/20': refreshError\n }\"\n >\n {{ refreshError ? 'Refresh failed' : 'System operational' }}\n </span>\n </div>\n </header>\n\n <section class=\"bg-gray-900 border border-gray-800 rounded-xl overflow-hidden hidden md:block\">\n <table class=\"w-full text-left text-sm\">\n <thead class=\"bg-gray-800/50 text-gray-400 text-xs uppercase font-mono border-b border-gray-800\">\n <tr>\n <th class=\"py-3 px-4\">Job ID</th>\n <th class=\"py-3 px-4\">Workflow</th>\n <th class=\"py-3 px-4\">Status</th>\n <th class=\"py-3 px-4 hidden xl:table-cell\">Worker</th>\n <th class=\"py-3 px-4 hidden lg:table-cell\">Created At</th>\n <th class=\"py-3 px-4 text-right\">Action</th>\n </tr>\n </thead>\n <tbody>\n <template for=\"job of jobs\">\n <tr class=\"border-b border-gray-800 hover:bg-gray-800/40 transition\">\n <td class=\"py-3 px-4 font-mono text-indigo-400\">\n <a attr-href=\"'/runs/' + job.id\" class=\"hover:underline\">#{{ job.id }}</a>\n </td>\n <td class=\"py-3 px-4 font-medium text-white\">{{ job.workflowId }}</td>\n <td class=\"py-3 px-4\">\n <span\n class=\"px-2.5 py-0.5 rounded-full text-xs font-semibold\"\n bind-class=\"{\n 'bg-emerald-500/10.text-emerald-400': job.status === 'success',\n 'bg-rose-500/10.text-rose-400': job.status === 'failed',\n 'bg-indigo-500/10.text-indigo-400.animate-pulse': job.status === 'running',\n 'bg-gray-500/10.text-gray-400': !['success', 'failed', 'running'].includes(job.status)\n }\"\n >\n {{ upper(job.status) }}\n </span>\n </td>\n <td class=\"py-3 px-4 hidden xl:table-cell text-xs font-mono text-gray-400\">{{ job.workerId || '-' }}</td>\n <td class=\"py-3 px-4 hidden lg:table-cell text-xs text-gray-400\">{{ job.createdAt }}</td>\n <td class=\"py-3 px-4 text-right whitespace-nowrap\">\n <a attr-href=\"'/runs/' + job.id\" class=\"text-xs bg-gray-800 hover:bg-gray-700 text-gray-200 px-3 py-1 rounded border border-gray-700\">View Trace</a>\n </td>\n </tr>\n </template>\n </tbody>\n </table>\n <template if=\"!jobs.length\">\n <div class=\"p-8 text-center text-gray-500\">No jobs recorded yet.</div>\n </template>\n </section>\n\n <section class=\"md:hidden bg-gray-900 border border-gray-800 rounded-xl divide-y divide-gray-800 overflow-hidden\">\n <template for=\"job of jobs\">\n <article class=\"p-4 bg-gray-900/60\">\n <div class=\"flex items-start justify-between gap-3\">\n <div class=\"min-w-0\">\n <div class=\"flex items-center gap-2\">\n <span\n class=\"w-2.5 h-2.5 rounded-full shrink-0\"\n bind-class=\"{\n 'bg-emerald-400': job.status === 'success',\n 'bg-rose-400': job.status === 'failed',\n 'bg-indigo-400.animate-pulse': job.status === 'running',\n 'bg-gray-500': !['success', 'failed', 'running'].includes(job.status)\n }\"\n ></span>\n <h2 class=\"font-medium text-white truncate\">{{ job.workflowId }}</h2>\n </div>\n <p class=\"mt-1 pl-[18px] text-xs font-mono text-gray-400\">#{{ job.id }} · {{ upper(job.status) }}</p>\n </div>\n <a attr-href=\"'/runs/' + job.id\" class=\"shrink-0 text-xs bg-gray-800 hover:bg-gray-700 text-gray-300 px-2.5 py-1 rounded border border-gray-700\">Trace</a>\n </div>\n </article>\n </template>\n <template if=\"!jobs.length\">\n <div class=\"p-8 text-center text-gray-500\">No jobs recorded yet.</div>\n </template>\n </section>\n </main>\n\n <script setup>\n import { onDestroy, onInit, ref } from '@li3/web';\n\n export default function setup() {\n const jobs = ref([]);\n const lastUpdated = ref('now');\n const refreshError = ref(false);\n let refreshTimer;\n let refreshing = false;\n\n const upper = (value) => String(value || '').toUpperCase();\n const refreshJobs = async () => {\n if (refreshing) return;\n refreshing = true;\n\n try {\n const response = await fetch('/api/jobs', { headers: { accept: 'application/json' } });\n if (!response.ok) throw new Error(`Dashboard refresh failed: ${response.status}`);\n\n const data = await response.json();\n jobs.value = data.jobs;\n lastUpdated.value = new Date().toLocaleTimeString();\n refreshError.value = false;\n } catch (error) {\n console.error(error);\n refreshError.value = true;\n } finally {\n refreshing = false;\n }\n };\n\n onInit(() => {\n refreshTimer = setInterval(refreshJobs, 5000);\n });\n onDestroy(() => clearInterval(refreshTimer));\n\n return { jobs, lastUpdated, refreshError, upper };\n }\n <\/script>\n <script state>__DASHBOARD_STATE__<\/script>\n </template>\n\n <script type=\"module\">import '@li3/web';<\/script>\n <script src=\"https://cdn.tailwindcss.com\"><\/script>\n</body>\n</html>\n";
|
|
8033
|
+
//#endregion
|
|
8034
|
+
//#region src/dashboard.ts
|
|
8035
|
+
function zo(e) {
|
|
8036
|
+
return e.map((e) => ({
|
|
8037
|
+
id: e.id,
|
|
8038
|
+
workflowId: e.workflow_id,
|
|
8039
|
+
status: e.status,
|
|
8040
|
+
workerId: e.worker_id || null,
|
|
8041
|
+
createdAt: e.created_at,
|
|
8042
|
+
updatedAt: e.updated_at
|
|
8043
|
+
}));
|
|
8044
|
+
}
|
|
8045
|
+
function Bo(e) {
|
|
8046
|
+
return Ro.replace("__DASHBOARD_STATE__", () => No({ jobs: e }));
|
|
8047
|
+
}
|
|
8048
|
+
//#endregion
|
|
8049
|
+
//#region src/server.ts
|
|
8050
|
+
var Vo = class e {
|
|
8458
8051
|
server;
|
|
8459
8052
|
preprocessors = /* @__PURE__ */ new Map();
|
|
8460
8053
|
workflows = [];
|
|
@@ -8466,9 +8059,9 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8466
8059
|
return new e(r).listen(n);
|
|
8467
8060
|
}
|
|
8468
8061
|
constructor(e) {
|
|
8469
|
-
this.queue = e.queue, this.secrets = e.secrets, this.adminToken = e.adminToken,
|
|
8062
|
+
this.queue = e.queue, this.secrets = e.secrets, this.adminToken = e.adminToken, Lo.from(e.config.workflows).then((t) => {
|
|
8470
8063
|
this.workflows = t, console.log(`✅ Loaded ${t.length} workflow(s) from ${e.config.workflows}`);
|
|
8471
|
-
}), this.registerPreprocessor(new
|
|
8064
|
+
}), this.registerPreprocessor(new Mo()), this.server = f.createServer((e, t) => this.handleRequest(e, t));
|
|
8472
8065
|
}
|
|
8473
8066
|
registerPreprocessor(e) {
|
|
8474
8067
|
this.preprocessors.set(e.name, e);
|
|
@@ -8476,6 +8069,7 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8476
8069
|
async handleRequest(e, t) {
|
|
8477
8070
|
let n = new p(e.url || "/", `${e.headers["x-forwarded-proto"] || "http"}://${e.headers["x-forwarded-host"] || e.headers.host}`);
|
|
8478
8071
|
if (e.method === "GET" && (n.pathname === "/runs" || n.pathname === "/")) return this.renderDashboard(t);
|
|
8072
|
+
if (e.method === "GET" && n.pathname === "/api/jobs") return this.renderDashboardJobs(t);
|
|
8479
8073
|
if (e.method === "GET" && n.pathname.startsWith("/runs/")) {
|
|
8480
8074
|
let e = n.pathname.replace("/runs/", "");
|
|
8481
8075
|
return this.renderRunDetails(e, t);
|
|
@@ -8552,7 +8146,7 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8552
8146
|
continue;
|
|
8553
8147
|
}
|
|
8554
8148
|
if (n.on.if) try {
|
|
8555
|
-
if (!await
|
|
8149
|
+
if (!await ko.evaluateConditions(n.on.if, { inputs: t })) {
|
|
8556
8150
|
console.log(`⏩ Skipped ${n.id} based on conditions: ${n.on.if}`, { inputs: t });
|
|
8557
8151
|
continue;
|
|
8558
8152
|
}
|
|
@@ -8561,7 +8155,7 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8561
8155
|
continue;
|
|
8562
8156
|
}
|
|
8563
8157
|
let i = "";
|
|
8564
|
-
n.concurrency?.group && (i = await
|
|
8158
|
+
n.concurrency?.group && (i = await ko.evaluateValue(n.concurrency.group, { inputs: t }));
|
|
8565
8159
|
let a = {
|
|
8566
8160
|
workflowId: n.id,
|
|
8567
8161
|
env: n.env,
|
|
@@ -8576,102 +8170,55 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8576
8170
|
this.secrets.reload(), console.log("🔄 SecretStore reloaded successfully without downtime!"), t.writeHead(200, { "Content-Type": "application/json" }), t.end(JSON.stringify({ message: "Secrets reloaded successfully" }));
|
|
8577
8171
|
}
|
|
8578
8172
|
async renderDashboard(e) {
|
|
8579
|
-
let t = await this.queue.listJobs(500), n =
|
|
8580
|
-
|
|
8581
|
-
|
|
8582
|
-
|
|
8583
|
-
|
|
8584
|
-
|
|
8585
|
-
|
|
8586
|
-
|
|
8587
|
-
|
|
8588
|
-
case "running": return "bg-indigo-400 animate-pulse";
|
|
8589
|
-
default: return "bg-gray-500";
|
|
8590
|
-
}
|
|
8591
|
-
}, i = t.map((e) => `
|
|
8592
|
-
<div class="py-3 px-4 block md:hidden bg-gray-900/60">
|
|
8593
|
-
<div class="flex items-center justify-between gap-2 mb-1">
|
|
8594
|
-
<div class="flex items-center gap-2 min-w-0">
|
|
8595
|
-
<span class="w-2.5 h-2.5 rounded-full ${r(e.status)} flex-shrink-0"></span>
|
|
8596
|
-
<span class="font-medium text-white truncate">${e.workflow_id}</span>
|
|
8597
|
-
</div>
|
|
8598
|
-
<a href="/runs/${e.id}" class="shrink-0 text-xs bg-gray-800 hover:bg-gray-700 text-gray-300 px-2.5 py-1 rounded border border-gray-700 whitespace-nowrap">Trace</a>
|
|
8599
|
-
</div>
|
|
8600
|
-
<div class="flex items-center gap-2 text-xs text-gray-400 pl-[18px]">
|
|
8601
|
-
#${e.id}
|
|
8602
|
-
</div>
|
|
8603
|
-
</div>
|
|
8604
|
-
`).join(""), a = `<!doctype html>
|
|
8605
|
-
<html lang="en" class="dark">
|
|
8606
|
-
<head>
|
|
8607
|
-
<meta charset="utf-8" />
|
|
8608
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
|
8609
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
8610
|
-
<meta http-equiv="refresh" content="10"> <!-- Auto-refreshes every 10s -->
|
|
8611
|
-
<title>Workflow Engine Dashboard</title>
|
|
8612
|
-
<script src="https://cdn.tailwindcss.com"><\/script>
|
|
8613
|
-
</head>
|
|
8614
|
-
<body class="bg-gray-950 text-gray-100 min-h-screen p-6 font-sans">
|
|
8615
|
-
<div class="max-w-6xl mx-auto space-y-6">
|
|
8616
|
-
<div class="flex items-center justify-between border-b border-gray-800 pb-4">
|
|
8617
|
-
<div>
|
|
8618
|
-
<h1 class="text-2xl font-bold text-white">⚙️ Runner Engine Status</h1>
|
|
8619
|
-
<p class="text-xs text-gray-400">Live Job Queue & Execution Traces</p>
|
|
8620
|
-
</div>
|
|
8621
|
-
<span class="text-xs font-mono bg-emerald-500/10 text-emerald-400 px-3 py-1 rounded-full border border-emerald-500/20">
|
|
8622
|
-
● System Operational
|
|
8623
|
-
</span>
|
|
8624
|
-
</div>
|
|
8625
|
-
|
|
8626
|
-
<div class="bg-gray-900 border border-gray-800 rounded-xl overflow-hidden hidden md:block">
|
|
8627
|
-
<table class="w-full text-left text-sm">
|
|
8628
|
-
<thead class="bg-gray-800/50 text-gray-400 text-xs uppercase font-mono border-b border-gray-800">
|
|
8629
|
-
<tr>
|
|
8630
|
-
<th class="py-3 px-4">Job ID</th>
|
|
8631
|
-
<th class="py-3 px-4">Workflow</th>
|
|
8632
|
-
<th class="py-3 px-4">Status</th>
|
|
8633
|
-
<th class="py-3 px-4 hidden xl:table-cell">Worker</th>
|
|
8634
|
-
<th class="py-3 px-4 hidden lg:table-cell">Created At</th>
|
|
8635
|
-
<th class="py-3 px-4 text-right hidden md:table-cell">Action</th>
|
|
8636
|
-
</tr>
|
|
8637
|
-
</thead>
|
|
8638
|
-
<tbody>${t.map((e) => {
|
|
8639
|
-
let t = n[e.status] || n._;
|
|
8640
|
-
return `
|
|
8641
|
-
<tr class="border-b border-gray-800 hover:bg-gray-900/50 transition">
|
|
8642
|
-
<td class="py-3 px-4 font-mono text-indigo-400"><a href="/runs/${e.id}" class="hover:underline">#${e.id}</a></td>
|
|
8643
|
-
<td class="py-3 px-4 font-medium text-white">${e.workflow_id}</td>
|
|
8644
|
-
<td class="py-3 px-4">
|
|
8645
|
-
<span class="px-2.5 py-0.5 rounded-full text-xs font-semibold ${t}">${e.status?.toUpperCase() ?? "?"}</span>
|
|
8646
|
-
</td>
|
|
8647
|
-
<td class="py-3 px-4 hidden xl:table-cell text-xs font-mono text-gray-400">${e.worker_id || "-"}</td>
|
|
8648
|
-
<td class="py-3 px-4 hidden lg:table-cell text-xs text-gray-400">${e.created_at}</td>
|
|
8649
|
-
<td class="py-3 px-4 text-right whitespace-nowrap hidden md:table-cell">
|
|
8650
|
-
<a href="/runs/${e.id}" class="text-xs bg-gray-800 hover:bg-gray-700 text-gray-200 px-3 py-1 rounded border border-gray-700">View Trace →</a>
|
|
8651
|
-
</td>
|
|
8652
|
-
</tr>
|
|
8653
|
-
`;
|
|
8654
|
-
}).join("")}</tbody>
|
|
8655
|
-
</table>
|
|
8656
|
-
</div>
|
|
8657
|
-
|
|
8658
|
-
<div class="md:hidden divide-y divide-gray-800">${i || "<div class=\"p-6 text-center text-gray-500\">No jobs recorded yet.</div>"}</div>
|
|
8659
|
-
</div>
|
|
8660
|
-
</body>
|
|
8661
|
-
</html>`, o = this.secrets.redactText(a);
|
|
8662
|
-
e.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }), e.end(o);
|
|
8173
|
+
let t = zo(await this.queue.listJobs(500)), n = this.secrets.redactText(Bo(t));
|
|
8174
|
+
e.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }), e.end(n);
|
|
8175
|
+
}
|
|
8176
|
+
async renderDashboardJobs(e) {
|
|
8177
|
+
let t = zo(await this.queue.listJobs(500)), n = this.secrets.redactText(JSON.stringify({ jobs: t }));
|
|
8178
|
+
e.writeHead(200, {
|
|
8179
|
+
"Cache-Control": "no-store",
|
|
8180
|
+
"Content-Type": "application/json; charset=utf-8"
|
|
8181
|
+
}), e.end(n);
|
|
8663
8182
|
}
|
|
8664
8183
|
async renderRunDetails(e, t) {
|
|
8665
8184
|
let n = await this.queue.getJob(e);
|
|
8666
|
-
if (!n
|
|
8667
|
-
let r = JSON.parse(n.report)
|
|
8185
|
+
if (!n) return t.writeHead(404, { "Content-Type": "text/html; charset=utf-8" }), t.end("<h1>404 - Report Not Found</h1>");
|
|
8186
|
+
let r = n.report ? JSON.parse(n.report) : this.buildPendingReport(n);
|
|
8187
|
+
r.status = n.status, r.status === "running" && (r.durationMs = Math.max(0, Date.now() - Date.parse(r.startedAt)));
|
|
8188
|
+
let i = await this.queue.getJobLogs(e);
|
|
8668
8189
|
r.steps = (r.steps || []).map((e) => ({
|
|
8669
8190
|
...e,
|
|
8670
|
-
logContent: i[e.id] || ""
|
|
8191
|
+
logContent: e.status === "running" || e.status === "pending" ? "" : i[e.id] || ""
|
|
8671
8192
|
}));
|
|
8672
|
-
let a = new
|
|
8193
|
+
let a = new Io({ outputDir: "" }).generateHtml(r), o = this.secrets.redactText(a);
|
|
8673
8194
|
t.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }), t.end(o);
|
|
8674
8195
|
}
|
|
8196
|
+
buildPendingReport(e) {
|
|
8197
|
+
let t = JSON.parse(e.payload), n = e.started_at || e.created_at;
|
|
8198
|
+
return {
|
|
8199
|
+
jobId: String(e.id),
|
|
8200
|
+
parentId: String(e.parentId || ""),
|
|
8201
|
+
workflowName: e.workflow_id,
|
|
8202
|
+
status: e.status,
|
|
8203
|
+
durationMs: e.status === "running" ? Math.max(0, Date.now() - Date.parse(n)) : 0,
|
|
8204
|
+
startedAt: n,
|
|
8205
|
+
inputs: t.inputs || {},
|
|
8206
|
+
environment: t.env || {},
|
|
8207
|
+
steps: (t.steps || []).map((e, t) => ({
|
|
8208
|
+
id: e.id || `step-${t}`,
|
|
8209
|
+
name: e.name || e.id || `step-${t}`,
|
|
8210
|
+
status: "pending",
|
|
8211
|
+
durationMs: 0,
|
|
8212
|
+
outputs: {},
|
|
8213
|
+
logContent: ""
|
|
8214
|
+
})),
|
|
8215
|
+
artifacts: [],
|
|
8216
|
+
rerunToken: JSON.stringify({
|
|
8217
|
+
jobId: e.id,
|
|
8218
|
+
payload: t
|
|
8219
|
+
})
|
|
8220
|
+
};
|
|
8221
|
+
}
|
|
8675
8222
|
async handleRestartJob(e, t) {
|
|
8676
8223
|
let n = await this.queue.restartJob(e);
|
|
8677
8224
|
if (n) {
|
|
@@ -8694,7 +8241,7 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8694
8241
|
});
|
|
8695
8242
|
});
|
|
8696
8243
|
}
|
|
8697
|
-
},
|
|
8244
|
+
}, Ho = d(v), Uo = class {
|
|
8698
8245
|
name = "systemd";
|
|
8699
8246
|
async isSupported() {
|
|
8700
8247
|
try {
|
|
@@ -8817,7 +8364,7 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8817
8364
|
cancel: async () => {
|
|
8818
8365
|
d = !0;
|
|
8819
8366
|
try {
|
|
8820
|
-
t.image && await
|
|
8367
|
+
t.image && await Ho(`docker stop -t 2 ${o}`).catch(() => {}), await Ho(`systemctl stop ${o}.service`).catch(() => {});
|
|
8821
8368
|
} catch {}
|
|
8822
8369
|
},
|
|
8823
8370
|
logFilePath: i
|
|
@@ -8827,7 +8374,7 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8827
8374
|
let t = await g(e, "utf-8"), n = t.includes("Running as unit: ") ? t.indexOf("\n") + 1 : 0, r = t.includes("Finished with result: ") ? t.lastIndexOf("Finished with result: ") : t.length;
|
|
8828
8375
|
return t.slice(n, r);
|
|
8829
8376
|
}
|
|
8830
|
-
},
|
|
8377
|
+
}, Wo = class {
|
|
8831
8378
|
name = "standard-process";
|
|
8832
8379
|
async isSupported() {
|
|
8833
8380
|
return !0;
|
|
@@ -8942,13 +8489,13 @@ var Ro, zo, Bo, Vo = class {
|
|
|
8942
8489
|
};
|
|
8943
8490
|
//#endregion
|
|
8944
8491
|
//#region src/drivers/index.ts
|
|
8945
|
-
async function
|
|
8946
|
-
let e = new
|
|
8947
|
-
return await e.isSupported() ? (console.log("⚡ Selected Execution Driver: Systemd (cgroups enabled)"), e) : (console.log("📦 Selected Execution Driver: Standard Process (Fallback)"), new
|
|
8492
|
+
async function Go() {
|
|
8493
|
+
let e = new Uo();
|
|
8494
|
+
return await e.isSupported() ? (console.log("⚡ Selected Execution Driver: Systemd (cgroups enabled)"), e) : (console.log("📦 Selected Execution Driver: Standard Process (Fallback)"), new Wo());
|
|
8948
8495
|
}
|
|
8949
8496
|
//#endregion
|
|
8950
8497
|
//#region src/signals.ts
|
|
8951
|
-
async function
|
|
8498
|
+
async function Ko(e) {
|
|
8952
8499
|
let t = !1;
|
|
8953
8500
|
async function n(n) {
|
|
8954
8501
|
if (!t) {
|
|
@@ -8956,7 +8503,7 @@ async function Jo(e) {
|
|
|
8956
8503
|
console.error("⚠️ Graceful shutdown timed out after 10s. Forcing exit!"), process.exit(1);
|
|
8957
8504
|
}, 1e4).unref();
|
|
8958
8505
|
try {
|
|
8959
|
-
|
|
8506
|
+
Jo.isStopping = !0, e.length > 0 && (console.log("⚙️ Waiting for active worker jobs to drain..."), await Promise.allSettled(e)), console.log("✨ Engine stopped cleanly. Goodbye!"), process.exit(0);
|
|
8960
8507
|
} catch (e) {
|
|
8961
8508
|
console.error("❌ Error during graceful shutdown:", e.message), process.exit(1);
|
|
8962
8509
|
}
|
|
@@ -8966,21 +8513,21 @@ async function Jo(e) {
|
|
|
8966
8513
|
}
|
|
8967
8514
|
//#endregion
|
|
8968
8515
|
//#region src/worker.ts
|
|
8969
|
-
var
|
|
8970
|
-
function
|
|
8971
|
-
|
|
8972
|
-
let i = Array.from({ length: e }, (e, i) =>
|
|
8973
|
-
return
|
|
8974
|
-
}
|
|
8975
|
-
async function
|
|
8976
|
-
let i = await
|
|
8977
|
-
for (console.log(`[${e}] 🚀 Worker started. Driver: ${i.name}`); !
|
|
8516
|
+
var qo = !!process.env.DEBUG, Jo = { isStopping: !1 };
|
|
8517
|
+
function Yo(e, t, n, r) {
|
|
8518
|
+
Jo.isStopping = !1;
|
|
8519
|
+
let i = Array.from({ length: e }, (e, i) => Xo(`worker-${i + 1}`, t, n, r));
|
|
8520
|
+
return Ko(i), i;
|
|
8521
|
+
}
|
|
8522
|
+
async function Xo(e, t, n, r) {
|
|
8523
|
+
let i = await Go();
|
|
8524
|
+
for (console.log(`[${e}] 🚀 Worker started. Driver: ${i.name}`); !Jo.isStopping;) try {
|
|
8978
8525
|
let a = await t.claimNextJob();
|
|
8979
8526
|
if (!a) {
|
|
8980
8527
|
await new Promise((e) => setTimeout(e, 2e3));
|
|
8981
8528
|
continue;
|
|
8982
8529
|
}
|
|
8983
|
-
await
|
|
8530
|
+
await Zo({
|
|
8984
8531
|
workerId: e,
|
|
8985
8532
|
job: a,
|
|
8986
8533
|
queue: t,
|
|
@@ -8993,7 +8540,7 @@ async function Qo(e, t, n, r) {
|
|
|
8993
8540
|
}
|
|
8994
8541
|
console.log(`[${e}] 🛑 Worker loop stopped cleanly.`);
|
|
8995
8542
|
}
|
|
8996
|
-
async function
|
|
8543
|
+
async function Zo(e) {
|
|
8997
8544
|
let { workerId: t, job: n, config: r, secrets: i, queue: o } = e;
|
|
8998
8545
|
console.log(`\n[${t}] 📦 Claimed Job #${n.id} (Workflow: ${n.workflow_id})`);
|
|
8999
8546
|
let s = typeof n.payload == "string" ? JSON.parse(n.payload) : n.payload, c = s.steps || [], l = s.inputs || {}, u = Date.now(), d = a.join(r.storagePath, `job-${n.id}`), f = a.join(d, "logs"), p = a.join(d, "wd"), m = {
|
|
@@ -9003,60 +8550,96 @@ async function $o(e) {
|
|
|
9003
8550
|
steps: {},
|
|
9004
8551
|
logsDir: f,
|
|
9005
8552
|
workingDir: p
|
|
9006
|
-
},
|
|
8553
|
+
}, h = c.map((e, t) => (e.id ||= `step-${t}`, e.name ||= e.id, {
|
|
8554
|
+
id: e.id,
|
|
8555
|
+
name: e.name,
|
|
8556
|
+
status: "pending",
|
|
8557
|
+
durationMs: 0,
|
|
8558
|
+
outputs: {},
|
|
8559
|
+
logContent: ""
|
|
8560
|
+
})), g = is(n, "running", u, l, m.env, h, s);
|
|
8561
|
+
await o.saveReport(n.id, g);
|
|
8562
|
+
let { cancelled: _, failed: v } = await Qo({
|
|
9007
8563
|
payload: s,
|
|
9008
8564
|
steps: c,
|
|
9009
8565
|
executionContext: m,
|
|
9010
8566
|
...e
|
|
9011
|
-
}),
|
|
9012
|
-
await o.
|
|
9013
|
-
let y = os(n, v, u, l, m.env, _, s);
|
|
9014
|
-
await o.saveReport(n.id, y), await ss(t, r.reporters, y);
|
|
8567
|
+
}, g), y = _ ? "cancelled" : v ? "failed" : "success";
|
|
8568
|
+
g.status = y, g.durationMs = Date.now() - u, g.finishedAt = (/* @__PURE__ */ new Date()).toISOString(), await o.completeJob(n.id, y, g), console.log(`[${t}] ✅ Job #${n.id} completed as: ${y}`), await as(t, r.reporters, g);
|
|
9015
8569
|
}
|
|
9016
|
-
async function
|
|
9017
|
-
let { driver:
|
|
8570
|
+
async function Qo(e, t) {
|
|
8571
|
+
let { driver: n, workerId: r, queue: i, config: a, job: o, payload: s, steps: c, executionContext: l } = e, u = t.steps, d = !1, f = !1, p = 0;
|
|
9018
8572
|
try {
|
|
9019
|
-
|
|
9020
|
-
for (let e = 0; e <
|
|
9021
|
-
let
|
|
9022
|
-
|
|
9023
|
-
|
|
9024
|
-
|
|
8573
|
+
s.env && Object.assign(l.env, await ts(s.env, l));
|
|
8574
|
+
for (let e = 0; e < c.length; e++) {
|
|
8575
|
+
let s = c[e], m = (/* @__PURE__ */ new Date()).toISOString();
|
|
8576
|
+
u[e] = {
|
|
8577
|
+
...u[e],
|
|
8578
|
+
status: "running",
|
|
8579
|
+
durationMs: 0,
|
|
8580
|
+
exitCode: void 0,
|
|
8581
|
+
error: void 0,
|
|
8582
|
+
outputs: {},
|
|
8583
|
+
logContent: "",
|
|
8584
|
+
startedAt: m,
|
|
8585
|
+
finishedAt: void 0
|
|
8586
|
+
}, t.durationMs = Date.now() - Date.parse(t.startedAt), await i.saveReport(o.id, t);
|
|
8587
|
+
let h = await $o({
|
|
8588
|
+
workerId: r,
|
|
8589
|
+
jobId: o.id,
|
|
8590
|
+
step: s,
|
|
9025
8591
|
stepIndex: e,
|
|
9026
|
-
executionContext:
|
|
9027
|
-
driver:
|
|
9028
|
-
queue:
|
|
9029
|
-
config:
|
|
8592
|
+
executionContext: l,
|
|
8593
|
+
driver: n,
|
|
8594
|
+
queue: i,
|
|
8595
|
+
config: a
|
|
9030
8596
|
});
|
|
9031
|
-
if (
|
|
9032
|
-
|
|
9033
|
-
|
|
8597
|
+
if (h.report ? u[e] = {
|
|
8598
|
+
...h.report,
|
|
8599
|
+
startedAt: m,
|
|
8600
|
+
finishedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8601
|
+
} : h.skipped ? u[e] = {
|
|
8602
|
+
...u[e],
|
|
8603
|
+
status: "skipped",
|
|
8604
|
+
durationMs: 0,
|
|
8605
|
+
exitCode: 0,
|
|
8606
|
+
finishedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8607
|
+
} : u[e] = {
|
|
8608
|
+
...u[e],
|
|
8609
|
+
status: "failed",
|
|
8610
|
+
durationMs: 0,
|
|
8611
|
+
exitCode: 1,
|
|
8612
|
+
error: "Step failed before execution started",
|
|
8613
|
+
finishedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
8614
|
+
}, p = e + 1, t.durationMs = Date.now() - Date.parse(t.startedAt), await i.saveReport(o.id, t), h.skipped) break;
|
|
8615
|
+
if (h.cancelled) {
|
|
8616
|
+
f = !0, d = !0;
|
|
9034
8617
|
break;
|
|
9035
8618
|
}
|
|
9036
|
-
if (
|
|
9037
|
-
|
|
8619
|
+
if (h.failed) {
|
|
8620
|
+
d = !0;
|
|
9038
8621
|
break;
|
|
9039
8622
|
}
|
|
9040
8623
|
}
|
|
9041
8624
|
} catch (e) {
|
|
9042
|
-
console.log("🛑 Step failed", e),
|
|
8625
|
+
console.log("🛑 Step failed", e), d = !0;
|
|
9043
8626
|
}
|
|
9044
|
-
return
|
|
9045
|
-
failed:
|
|
9046
|
-
cancelled:
|
|
9047
|
-
stepReports:
|
|
8627
|
+
return p < c.length && (rs(c, p, u), t.durationMs = Date.now() - Date.parse(t.startedAt), await i.saveReport(o.id, t)), {
|
|
8628
|
+
failed: d,
|
|
8629
|
+
cancelled: f,
|
|
8630
|
+
stepReports: u
|
|
9048
8631
|
};
|
|
9049
8632
|
}
|
|
9050
|
-
async function
|
|
8633
|
+
async function $o(e) {
|
|
9051
8634
|
let { step: t, stepIndex: n, executionContext: r } = e;
|
|
9052
|
-
if (t.id ||= `step-${n}`, t.name ||= t.id, t.if && !await
|
|
8635
|
+
if (t.id ||= `step-${n}`, t.name ||= t.id, t.if && !await ko.evaluateConditions(t.if, r)) return qo && console.log(`⏩ Skipped step ${t.id} based on condition: ${t.if}`, r), {
|
|
9053
8636
|
failed: !1,
|
|
9054
8637
|
cancelled: !1,
|
|
9055
8638
|
skipped: !0,
|
|
9056
8639
|
report: null
|
|
9057
8640
|
};
|
|
9058
8641
|
try {
|
|
9059
|
-
let n = await
|
|
8642
|
+
let n = await ts(t.env, r), i = {
|
|
9060
8643
|
jobId: String(e.jobId),
|
|
9061
8644
|
step: t,
|
|
9062
8645
|
command: t.run,
|
|
@@ -9070,15 +8653,15 @@ async function ts(e) {
|
|
|
9070
8653
|
WORKING_DIR: r.workingDir
|
|
9071
8654
|
}
|
|
9072
8655
|
};
|
|
9073
|
-
return t.eval ?
|
|
8656
|
+
return t.eval ? es({
|
|
9074
8657
|
...e,
|
|
9075
8658
|
stepContext: i
|
|
9076
|
-
}) :
|
|
8659
|
+
}) : ns({
|
|
9077
8660
|
...e,
|
|
9078
8661
|
stepContext: i
|
|
9079
8662
|
});
|
|
9080
8663
|
} catch (e) {
|
|
9081
|
-
return
|
|
8664
|
+
return qo && console.error(`⏩ Failed to run step ${t.id}`, r, e), {
|
|
9082
8665
|
failed: !0,
|
|
9083
8666
|
cancelled: !1,
|
|
9084
8667
|
skipped: !1,
|
|
@@ -9086,10 +8669,10 @@ async function ts(e) {
|
|
|
9086
8669
|
};
|
|
9087
8670
|
}
|
|
9088
8671
|
}
|
|
9089
|
-
async function
|
|
8672
|
+
async function es(e) {
|
|
9090
8673
|
let { queue: t, stepContext: n, executionContext: r } = e, { jobId: i, step: a } = n, o = Date.now(), s = a.id, c = a.name;
|
|
9091
8674
|
try {
|
|
9092
|
-
let e = await
|
|
8675
|
+
let e = await ko.evaluateExpression(a.eval, r);
|
|
9093
8676
|
r.steps[s] = {
|
|
9094
8677
|
status: "success",
|
|
9095
8678
|
exitCode: 0,
|
|
@@ -9132,12 +8715,12 @@ async function ns(e) {
|
|
|
9132
8715
|
};
|
|
9133
8716
|
}
|
|
9134
8717
|
}
|
|
9135
|
-
async function
|
|
8718
|
+
async function ts(e, t) {
|
|
9136
8719
|
let n = {};
|
|
9137
|
-
if (e) for (let [r, i] of Object.entries(e)) n[r] = String(await
|
|
8720
|
+
if (e) for (let [r, i] of Object.entries(e)) n[r] = String(await ko.evaluateValue(i, t));
|
|
9138
8721
|
return n;
|
|
9139
8722
|
}
|
|
9140
|
-
async function
|
|
8723
|
+
async function ns(t) {
|
|
9141
8724
|
let { workerId: n, jobId: r, stepContext: i, executionContext: a, driver: o, queue: s } = t, { step: c } = i, l = c.id, u = c.name, d;
|
|
9142
8725
|
try {
|
|
9143
8726
|
d = o.execute(i);
|
|
@@ -9161,7 +8744,7 @@ async function is(t) {
|
|
|
9161
8744
|
} catch (e) {
|
|
9162
8745
|
console.error(`[${n}] ⚠️ Failed to read step log file:`, e.message);
|
|
9163
8746
|
}
|
|
9164
|
-
let h = m.exitCode !== 0 || f, g = m.exitCode === 0 ? "success" :
|
|
8747
|
+
let h = m.exitCode !== 0 || f, g = f ? "cancelled" : m.exitCode === 0 ? "success" : "failed";
|
|
9165
8748
|
return a.steps[l] = {
|
|
9166
8749
|
status: g,
|
|
9167
8750
|
exitCode: m.exitCode,
|
|
@@ -9182,10 +8765,10 @@ async function is(t) {
|
|
|
9182
8765
|
}
|
|
9183
8766
|
};
|
|
9184
8767
|
}
|
|
9185
|
-
function
|
|
8768
|
+
function rs(e, t, n) {
|
|
9186
8769
|
for (let r = t; r < e.length; r++) {
|
|
9187
8770
|
let t = e[r], i = t.id || `step-${r}`;
|
|
9188
|
-
n
|
|
8771
|
+
n[r] = {
|
|
9189
8772
|
id: i,
|
|
9190
8773
|
name: t.name || i,
|
|
9191
8774
|
status: "skipped",
|
|
@@ -9193,10 +8776,10 @@ function as(e, t, n) {
|
|
|
9193
8776
|
exitCode: 0,
|
|
9194
8777
|
outputs: {},
|
|
9195
8778
|
logContent: ""
|
|
9196
|
-
}
|
|
8779
|
+
};
|
|
9197
8780
|
}
|
|
9198
8781
|
}
|
|
9199
|
-
function
|
|
8782
|
+
function is(e, t, n, r, i, a, o) {
|
|
9200
8783
|
return {
|
|
9201
8784
|
jobId: String(e.id),
|
|
9202
8785
|
parentId: String(e.parentId || ""),
|
|
@@ -9204,7 +8787,7 @@ function os(e, t, n, r, i, a, o) {
|
|
|
9204
8787
|
status: t,
|
|
9205
8788
|
durationMs: Date.now() - n,
|
|
9206
8789
|
startedAt: new Date(n).toISOString(),
|
|
9207
|
-
finishedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
8790
|
+
finishedAt: t === "running" ? void 0 : (/* @__PURE__ */ new Date()).toISOString(),
|
|
9208
8791
|
inputs: r,
|
|
9209
8792
|
environment: i,
|
|
9210
8793
|
steps: a,
|
|
@@ -9215,7 +8798,7 @@ function os(e, t, n, r, i, a, o) {
|
|
|
9215
8798
|
})
|
|
9216
8799
|
};
|
|
9217
8800
|
}
|
|
9218
|
-
async function
|
|
8801
|
+
async function as(e, t = [], n) {
|
|
9219
8802
|
!Array.isArray(t) || t.length === 0 || (console.log(`[${e}] 📢 Dispatching execution report to ${t.length} reporter(s)...`), await Promise.allSettled(t.map(async (t) => {
|
|
9220
8803
|
try {
|
|
9221
8804
|
await t.report(n);
|
|
@@ -9226,7 +8809,7 @@ async function ss(e, t = [], n) {
|
|
|
9226
8809
|
}
|
|
9227
8810
|
//#endregion
|
|
9228
8811
|
//#region src/reporters/json-file.reporter.ts
|
|
9229
|
-
var
|
|
8812
|
+
var os = class {
|
|
9230
8813
|
name = "json-file";
|
|
9231
8814
|
outputDir;
|
|
9232
8815
|
constructor(e) {
|
|
@@ -9237,7 +8820,7 @@ var cs = class {
|
|
|
9237
8820
|
let n = a.join(this.outputDir, `run-${t.jobId}.json`);
|
|
9238
8821
|
e.writeFileSync(n, JSON.stringify(t, null, 2), "utf-8"), console.log(`📊 Execution report saved to: ${n}`);
|
|
9239
8822
|
}
|
|
9240
|
-
},
|
|
8823
|
+
}, ss = class {
|
|
9241
8824
|
name = "slack";
|
|
9242
8825
|
webhookUrl = "";
|
|
9243
8826
|
token = "";
|
|
@@ -9264,21 +8847,21 @@ var cs = class {
|
|
|
9264
8847
|
};
|
|
9265
8848
|
//#endregion
|
|
9266
8849
|
//#region src/index.ts
|
|
9267
|
-
function
|
|
8850
|
+
function cs(e) {
|
|
9268
8851
|
console.log("🔍 Validating Workflows in:", e.workflows);
|
|
9269
|
-
let t = new
|
|
8852
|
+
let t = new di(e.workflows), n = r(e.workflows).filter((e) => e.endsWith(".yml") || e.endsWith(".yaml"));
|
|
9270
8853
|
for (let e of n) {
|
|
9271
|
-
let n =
|
|
8854
|
+
let n = fi(t.resolve(e));
|
|
9272
8855
|
console.log(` ✅ ${e} -> Valid! (${n.length} job matrix variant(s) generated)`);
|
|
9273
8856
|
}
|
|
9274
8857
|
}
|
|
9275
|
-
async function
|
|
8858
|
+
async function ls() {
|
|
9276
8859
|
let { config: e, command: t } = await fe();
|
|
9277
|
-
if (e || process.exit(1), t === "validate") return
|
|
9278
|
-
let n = new
|
|
8860
|
+
if (e || process.exit(1), t === "validate") return cs(e);
|
|
8861
|
+
let n = new mi("./.env"), r = new pi(process.env.WORKER_NAME || "cli");
|
|
9279
8862
|
switch (t) {
|
|
9280
8863
|
case "start-server":
|
|
9281
|
-
console.log("🌐 Starting Ingress Gateway..."), await r.init(), await
|
|
8864
|
+
console.log("🌐 Starting Ingress Gateway..."), await r.init(), await Vo.withPort({
|
|
9282
8865
|
config: e,
|
|
9283
8866
|
queue: r,
|
|
9284
8867
|
secrets: n,
|
|
@@ -9287,11 +8870,11 @@ async function ds() {
|
|
|
9287
8870
|
});
|
|
9288
8871
|
break;
|
|
9289
8872
|
case "start-workers":
|
|
9290
|
-
console.log(`⚙️ Starting ${e.workers} Worker Loop(s)...`), await r.init(),
|
|
8873
|
+
console.log(`⚙️ Starting ${e.workers} Worker Loop(s)...`), await r.init(), Yo(e.workers, r, n, e);
|
|
9291
8874
|
break;
|
|
9292
8875
|
default: console.error(`❌ Unknown command: '${t}'`), de(), process.exit(1);
|
|
9293
8876
|
}
|
|
9294
8877
|
}
|
|
9295
|
-
|
|
8878
|
+
ls().catch(console.error);
|
|
9296
8879
|
//#endregion
|
|
9297
|
-
export {
|
|
8880
|
+
export { Io as HtmlReporter, os as JsonFileReporter, ss as SlackReporter };
|