@cloud-cli/on 1.7.9 → 1.7.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -2
- package/dist/on.js +786 -759
- package/dist/parser/yaml-loader.d.ts.map +1 -1
- package/dist/preprocessors/github.d.ts +2 -1
- package/dist/preprocessors/github.d.ts.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/types.d.ts +13 -4
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -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 Wr(e) {
|
|
3289
3289
|
switch (e) {
|
|
3290
3290
|
case void 0:
|
|
3291
3291
|
case " ":
|
|
@@ -3295,7 +3295,7 @@ function P(e) {
|
|
|
3295
3295
|
default: return !1;
|
|
3296
3296
|
}
|
|
3297
3297
|
}
|
|
3298
|
-
var
|
|
3298
|
+
var Gr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Kr = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), qr = /* @__PURE__ */ new Set(",[]{}"), Jr = /* @__PURE__ */ new Set(" ,[]{}\n\r "), Yr = (e) => !e || Jr.has(e), Xr = 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 Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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 === "...") && Wr(this.buffer[e + 3])) return -1;
|
|
3333
3333
|
}
|
|
3334
3334
|
return e;
|
|
3335
3335
|
}
|
|
@@ -3391,14 +3391,14 @@ var Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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 === "...") && Wr(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 && !Wr(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 === ":") && Wr(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 Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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(Yr), "doc";
|
|
3420
3420
|
case "\"":
|
|
3421
3421
|
case "'": return yield* this.parseQuotedScalar();
|
|
3422
3422
|
case "|":
|
|
@@ -3431,7 +3431,7 @@ var Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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("...")) && Wr(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 Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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(Yr), "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 || Wr(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 Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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) => Wr(e) || e === "#");
|
|
3488
3488
|
}
|
|
3489
3489
|
*parseBlockScalar() {
|
|
3490
3490
|
let e = this.pos - 1, t = 0, n;
|
|
@@ -3534,18 +3534,18 @@ var Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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 (Wr(r) || e && qr.has(r)) break;
|
|
3538
3538
|
t = n;
|
|
3539
|
-
} else if (
|
|
3539
|
+
} else if (Wr(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 && qr.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 && qr.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 Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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(Yr), 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 (Wr(n) || t && qr.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 Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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 (; !Wr(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 (Kr.has(t)) t = this.buffer[++e];
|
|
3593
|
+
else if (t === "%" && Gr.has(this.buffer[e + 1]) && Gr.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 Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__PURE__ */
|
|
|
3612
3612
|
for (; !e(n);) n = this.buffer[++t];
|
|
3613
3613
|
return yield* this.pushToIndex(t, !1);
|
|
3614
3614
|
}
|
|
3615
|
-
},
|
|
3615
|
+
}, Zr = 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 Wr = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Gr = /* @__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 Qr(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 $r(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 Qr(e) {
|
|
|
3651
3651
|
}
|
|
3652
3652
|
return -1;
|
|
3653
3653
|
}
|
|
3654
|
-
function
|
|
3654
|
+
function ei(e) {
|
|
3655
3655
|
switch (e?.type) {
|
|
3656
3656
|
case "alias":
|
|
3657
3657
|
case "scalar":
|
|
@@ -3661,7 +3661,7 @@ function $r(e) {
|
|
|
3661
3661
|
default: return !1;
|
|
3662
3662
|
}
|
|
3663
3663
|
}
|
|
3664
|
-
function
|
|
3664
|
+
function ti(e) {
|
|
3665
3665
|
switch (e.type) {
|
|
3666
3666
|
case "document": return e.start;
|
|
3667
3667
|
case "block-map": {
|
|
@@ -3673,7 +3673,7 @@ function ei(e) {
|
|
|
3673
3673
|
default: return [];
|
|
3674
3674
|
}
|
|
3675
3675
|
}
|
|
3676
|
-
function
|
|
3676
|
+
function ni(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 ti(e) {
|
|
|
3686
3686
|
for (; e[++t]?.type === "space";);
|
|
3687
3687
|
return e.splice(t, e.length);
|
|
3688
3688
|
}
|
|
3689
|
-
function
|
|
3689
|
+
function ri(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 ii(e) {
|
|
3694
|
+
if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !Qr(t.start, "explicit-key-ind") && !Qr(t.sep, "map-value-ind") && (t.key && (t.value = t.key), delete t.key, ei(t.value) ? t.value.end ? ri(t.value.end, t.sep) : t.value.end = t.sep : ri(t.start, t.sep), delete t.sep);
|
|
3695
3695
|
}
|
|
3696
|
-
var
|
|
3696
|
+
var ai = 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 Xr(), 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 ii = 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" && ii(t), e.type) {
|
|
3794
3794
|
case "document":
|
|
3795
3795
|
e.value = t;
|
|
3796
3796
|
break;
|
|
@@ -3842,7 +3842,7 @@ var ii = 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 && $r(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 ii = class {
|
|
|
3883
3883
|
if (e.value) return yield* this.lineEnd(e);
|
|
3884
3884
|
switch (this.type) {
|
|
3885
3885
|
case "doc-start":
|
|
3886
|
-
|
|
3886
|
+
$r(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 ii = class {
|
|
|
3903
3903
|
}
|
|
3904
3904
|
*scalar(e) {
|
|
3905
3905
|
if (this.type === "map-value-ind") {
|
|
3906
|
-
let t = ti(
|
|
3906
|
+
let t = ni(ti(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 ii = 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
|
+
ri(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
3957
3957
|
return;
|
|
3958
3958
|
}
|
|
3959
3959
|
}
|
|
@@ -4002,12 +4002,12 @@ var ii = class {
|
|
|
4002
4002
|
case "map-value-ind":
|
|
4003
4003
|
if (t.explicitKey) {
|
|
4004
4004
|
if (!t.sep) {
|
|
4005
|
-
if (
|
|
4005
|
+
if (Qr(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 = ni(t.start);
|
|
4011
4011
|
this.stack.push({
|
|
4012
4012
|
type: "block-map",
|
|
4013
4013
|
offset: this.offset,
|
|
@@ -4024,7 +4024,7 @@ var ii = class {
|
|
|
4024
4024
|
key: null,
|
|
4025
4025
|
sep: [this.sourceToken]
|
|
4026
4026
|
});
|
|
4027
|
-
else if (
|
|
4027
|
+
else if (Qr(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 ii = class {
|
|
|
4034
4034
|
sep: [this.sourceToken]
|
|
4035
4035
|
}]
|
|
4036
4036
|
});
|
|
4037
|
-
else if (
|
|
4038
|
-
let e =
|
|
4037
|
+
else if (ei(t.key) && !Qr(t.sep, "newline")) {
|
|
4038
|
+
let e = ni(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 ii = class {
|
|
|
4051
4051
|
start: i,
|
|
4052
4052
|
key: null,
|
|
4053
4053
|
sep: [this.sourceToken]
|
|
4054
|
-
}) :
|
|
4054
|
+
}) : Qr(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 ii = 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 && !Qr(t.sep, "newline")) {
|
|
4089
4089
|
yield* this.pop({
|
|
4090
4090
|
type: "error",
|
|
4091
4091
|
offset: this.offset,
|
|
@@ -4119,7 +4119,7 @@ var ii = 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
|
+
ri(n, t.start), n.push(this.sourceToken), e.items.pop();
|
|
4123
4123
|
return;
|
|
4124
4124
|
}
|
|
4125
4125
|
}
|
|
@@ -4133,7 +4133,7 @@ var ii = class {
|
|
|
4133
4133
|
return;
|
|
4134
4134
|
case "seq-item-ind":
|
|
4135
4135
|
if (this.indent !== e.indent) break;
|
|
4136
|
-
t.value ||
|
|
4136
|
+
t.value || Qr(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 ii = 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 = ti(
|
|
4206
|
-
|
|
4205
|
+
let n = ni(ti(t));
|
|
4206
|
+
ii(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 ii = class {
|
|
|
4262
4262
|
};
|
|
4263
4263
|
case "explicit-key-ind": {
|
|
4264
4264
|
this.onKeyLine = !0;
|
|
4265
|
-
let t = ti(
|
|
4265
|
+
let t = ni(ti(e));
|
|
4266
4266
|
return t.push(this.sourceToken), {
|
|
4267
4267
|
type: "block-map",
|
|
4268
4268
|
offset: this.offset,
|
|
@@ -4275,7 +4275,7 @@ var ii = class {
|
|
|
4275
4275
|
}
|
|
4276
4276
|
case "map-value-ind": {
|
|
4277
4277
|
this.onKeyLine = !0;
|
|
4278
|
-
let t = ti(
|
|
4278
|
+
let t = ni(ti(e));
|
|
4279
4279
|
return {
|
|
4280
4280
|
type: "block-map",
|
|
4281
4281
|
offset: this.offset,
|
|
@@ -4313,20 +4313,20 @@ var ii = 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 oi(e) {
|
|
4317
4317
|
let t = e.prettyErrors !== !1;
|
|
4318
4318
|
return {
|
|
4319
|
-
lineCounter: e.lineCounter || t && new
|
|
4319
|
+
lineCounter: e.lineCounter || t && new Zr() || null,
|
|
4320
4320
|
prettyErrors: t
|
|
4321
4321
|
};
|
|
4322
4322
|
}
|
|
4323
|
-
function
|
|
4324
|
-
let { lineCounter: n, prettyErrors: r } =
|
|
4323
|
+
function si(e, t = {}) {
|
|
4324
|
+
let { lineCounter: n, prettyErrors: r } = oi(t), i = new ai(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 ci(e, t = {}) {
|
|
4329
|
+
let { lineCounter: n, prettyErrors: r } = oi(t), i = new ai(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 si(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 li(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 = ci(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 ci(e, t, n) {
|
|
|
4345
4345
|
}
|
|
4346
4346
|
return i.toJS(Object.assign({ reviver: r }, n));
|
|
4347
4347
|
}
|
|
4348
|
-
function
|
|
4348
|
+
function ui(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 li(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 di = /* @__PURE__ */ b({
|
|
4363
4363
|
Alias: () => He,
|
|
4364
4364
|
CST: () => zr,
|
|
4365
4365
|
Composer: () => wr,
|
|
4366
4366
|
Document: () => Ln,
|
|
4367
|
-
Lexer: () =>
|
|
4368
|
-
LineCounter: () =>
|
|
4367
|
+
Lexer: () => Xr,
|
|
4368
|
+
LineCounter: () => Zr,
|
|
4369
4369
|
Pair: () => j,
|
|
4370
|
-
Parser: () =>
|
|
4370
|
+
Parser: () => ai,
|
|
4371
4371
|
Scalar: () => A,
|
|
4372
4372
|
Schema: () => Fn,
|
|
4373
4373
|
YAMLError: () => zn,
|
|
@@ -4383,13 +4383,13 @@ var ui = /* @__PURE__ */ b({
|
|
|
4383
4383
|
isPair: () => w,
|
|
4384
4384
|
isScalar: () => T,
|
|
4385
4385
|
isSeq: () => Se,
|
|
4386
|
-
parse: () =>
|
|
4387
|
-
parseAllDocuments: () =>
|
|
4388
|
-
parseDocument: () =>
|
|
4389
|
-
stringify: () =>
|
|
4386
|
+
parse: () => li,
|
|
4387
|
+
parseAllDocuments: () => si,
|
|
4388
|
+
parseDocument: () => ci,
|
|
4389
|
+
stringify: () => ui,
|
|
4390
4390
|
visit: () => Ee,
|
|
4391
4391
|
visitAsync: () => Oe
|
|
4392
|
-
}),
|
|
4392
|
+
}), fi = class {
|
|
4393
4393
|
baseDir;
|
|
4394
4394
|
maxDepth;
|
|
4395
4395
|
constructor(e, t = 5) {
|
|
@@ -4404,7 +4404,7 @@ var ui = /* @__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 = di.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 ui = /* @__PURE__ */ b({
|
|
|
4420
4420
|
};
|
|
4421
4421
|
//#endregion
|
|
4422
4422
|
//#region src/parser/matrix-expander.ts
|
|
4423
|
-
function
|
|
4423
|
+
function pi(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 fi(e) {
|
|
|
4447
4447
|
}
|
|
4448
4448
|
//#endregion
|
|
4449
4449
|
//#region src/queue.ts
|
|
4450
|
-
var
|
|
4450
|
+
var mi = class {
|
|
4451
4451
|
workerId;
|
|
4452
4452
|
constructor(e) {
|
|
4453
4453
|
this.workerId = e;
|
|
@@ -4502,7 +4502,7 @@ var pi = class {
|
|
|
4502
4502
|
for (let e of t) n[e.step_id] = e.log_content;
|
|
4503
4503
|
return n;
|
|
4504
4504
|
}
|
|
4505
|
-
},
|
|
4505
|
+
}, hi = class {
|
|
4506
4506
|
envFilePath;
|
|
4507
4507
|
secrets = /* @__PURE__ */ new Map();
|
|
4508
4508
|
constructor(e) {
|
|
@@ -4527,7 +4527,7 @@ var pi = class {
|
|
|
4527
4527
|
for (let n of t) e = e.replaceAll(n, "****");
|
|
4528
4528
|
return e;
|
|
4529
4529
|
}
|
|
4530
|
-
},
|
|
4530
|
+
}, gi = [
|
|
4531
4531
|
509,
|
|
4532
4532
|
0,
|
|
4533
4533
|
227,
|
|
@@ -4858,7 +4858,7 @@ var pi = class {
|
|
|
4858
4858
|
9,
|
|
4859
4859
|
787719,
|
|
4860
4860
|
239
|
|
4861
|
-
],
|
|
4861
|
+
], _i = [
|
|
4862
4862
|
0,
|
|
4863
4863
|
11,
|
|
4864
4864
|
2,
|
|
@@ -5477,216 +5477,216 @@ var pi = class {
|
|
|
5477
5477
|
4938,
|
|
5478
5478
|
6,
|
|
5479
5479
|
8489
|
|
5480
|
-
],
|
|
5480
|
+
], vi = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", yi = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", bi = {
|
|
5481
5481
|
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
5482
|
5: "class enum extends super const export import",
|
|
5483
5483
|
6: "enum",
|
|
5484
5484
|
strict: "implements interface let package private protected public static yield",
|
|
5485
5485
|
strictBind: "eval arguments"
|
|
5486
|
-
},
|
|
5487
|
-
5:
|
|
5488
|
-
"5module":
|
|
5489
|
-
6:
|
|
5490
|
-
},
|
|
5491
|
-
function
|
|
5486
|
+
}, xi = "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", Si = {
|
|
5487
|
+
5: xi,
|
|
5488
|
+
"5module": xi + " export import",
|
|
5489
|
+
6: xi + " const class extends export import super"
|
|
5490
|
+
}, Ci = /^in(stanceof)?$/, wi = RegExp("[" + yi + "]"), Ti = RegExp("[" + yi + vi + "]");
|
|
5491
|
+
function Ei(e, t) {
|
|
5492
5492
|
for (var n = 65536, r = 0; r < t.length; r += 2) {
|
|
5493
5493
|
if (n += t[r], n > e) return !1;
|
|
5494
5494
|
if (n += t[r + 1], n >= e) return !0;
|
|
5495
5495
|
}
|
|
5496
5496
|
return !1;
|
|
5497
5497
|
}
|
|
5498
|
-
function Ei(e, t) {
|
|
5499
|
-
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
|
-
}
|
|
5501
5498
|
function Di(e, t) {
|
|
5502
|
-
return e <
|
|
5499
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && wi.test(String.fromCharCode(e)) : t !== !1 && Ei(e, _i);
|
|
5503
5500
|
}
|
|
5504
|
-
|
|
5501
|
+
function Oi(e, t) {
|
|
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 && Ti.test(String.fromCharCode(e)) : t === !1 ? !1 : Ei(e, _i) || Ei(e, gi);
|
|
5503
|
+
}
|
|
5504
|
+
var P = function(e, t) {
|
|
5505
5505
|
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
5506
|
};
|
|
5507
|
-
function
|
|
5508
|
-
return new
|
|
5507
|
+
function F(e, t) {
|
|
5508
|
+
return new P(e, {
|
|
5509
5509
|
beforeExpr: !0,
|
|
5510
5510
|
binop: t
|
|
5511
5511
|
});
|
|
5512
5512
|
}
|
|
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
|
|
5513
|
+
var I = { beforeExpr: !0 }, L = { startsExpr: !0 }, ki = {};
|
|
5514
|
+
function R(e, t) {
|
|
5515
|
+
return t === void 0 && (t = {}), t.keyword = e, ki[e] = new P(e, t);
|
|
5516
|
+
}
|
|
5517
|
+
var z = {
|
|
5518
|
+
num: new P("num", L),
|
|
5519
|
+
regexp: new P("regexp", L),
|
|
5520
|
+
string: new P("string", L),
|
|
5521
|
+
name: new P("name", L),
|
|
5522
|
+
privateId: new P("privateId", L),
|
|
5523
|
+
eof: new P("eof"),
|
|
5524
|
+
bracketL: new P("[", {
|
|
5525
5525
|
beforeExpr: !0,
|
|
5526
5526
|
startsExpr: !0
|
|
5527
5527
|
}),
|
|
5528
|
-
bracketR: new
|
|
5529
|
-
braceL: new
|
|
5528
|
+
bracketR: new P("]"),
|
|
5529
|
+
braceL: new P("{", {
|
|
5530
5530
|
beforeExpr: !0,
|
|
5531
5531
|
startsExpr: !0
|
|
5532
5532
|
}),
|
|
5533
|
-
braceR: new
|
|
5534
|
-
parenL: new
|
|
5533
|
+
braceR: new P("}"),
|
|
5534
|
+
parenL: new P("(", {
|
|
5535
5535
|
beforeExpr: !0,
|
|
5536
5536
|
startsExpr: !0
|
|
5537
5537
|
}),
|
|
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
|
|
5538
|
+
parenR: new P(")"),
|
|
5539
|
+
comma: new P(",", I),
|
|
5540
|
+
semi: new P(";", I),
|
|
5541
|
+
colon: new P(":", I),
|
|
5542
|
+
dot: new P("."),
|
|
5543
|
+
question: new P("?", I),
|
|
5544
|
+
questionDot: new P("?."),
|
|
5545
|
+
arrow: new P("=>", I),
|
|
5546
|
+
template: new P("template"),
|
|
5547
|
+
invalidTemplate: new P("invalidTemplate"),
|
|
5548
|
+
ellipsis: new P("...", I),
|
|
5549
|
+
backQuote: new P("`", L),
|
|
5550
|
+
dollarBraceL: new P("${", {
|
|
5551
5551
|
beforeExpr: !0,
|
|
5552
5552
|
startsExpr: !0
|
|
5553
5553
|
}),
|
|
5554
|
-
eq: new
|
|
5554
|
+
eq: new P("=", {
|
|
5555
5555
|
beforeExpr: !0,
|
|
5556
5556
|
isAssign: !0
|
|
5557
5557
|
}),
|
|
5558
|
-
assign: new
|
|
5558
|
+
assign: new P("_=", {
|
|
5559
5559
|
beforeExpr: !0,
|
|
5560
5560
|
isAssign: !0
|
|
5561
5561
|
}),
|
|
5562
|
-
incDec: new
|
|
5562
|
+
incDec: new P("++/--", {
|
|
5563
5563
|
prefix: !0,
|
|
5564
5564
|
postfix: !0,
|
|
5565
5565
|
startsExpr: !0
|
|
5566
5566
|
}),
|
|
5567
|
-
prefix: new
|
|
5567
|
+
prefix: new P("!/~", {
|
|
5568
5568
|
beforeExpr: !0,
|
|
5569
5569
|
prefix: !0,
|
|
5570
5570
|
startsExpr: !0
|
|
5571
5571
|
}),
|
|
5572
|
-
logicalOR:
|
|
5573
|
-
logicalAND:
|
|
5574
|
-
bitwiseOR:
|
|
5575
|
-
bitwiseXOR:
|
|
5576
|
-
bitwiseAND:
|
|
5577
|
-
equality:
|
|
5578
|
-
relational:
|
|
5579
|
-
bitShift:
|
|
5580
|
-
plusMin: new
|
|
5572
|
+
logicalOR: F("||", 1),
|
|
5573
|
+
logicalAND: F("&&", 2),
|
|
5574
|
+
bitwiseOR: F("|", 3),
|
|
5575
|
+
bitwiseXOR: F("^", 4),
|
|
5576
|
+
bitwiseAND: F("&", 5),
|
|
5577
|
+
equality: F("==/!=/===/!==", 6),
|
|
5578
|
+
relational: F("</>/<=/>=", 7),
|
|
5579
|
+
bitShift: F("<</>>/>>>", 8),
|
|
5580
|
+
plusMin: new P("+/-", {
|
|
5581
5581
|
beforeExpr: !0,
|
|
5582
5582
|
binop: 9,
|
|
5583
5583
|
prefix: !0,
|
|
5584
5584
|
startsExpr: !0
|
|
5585
5585
|
}),
|
|
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:
|
|
5586
|
+
modulo: F("%", 10),
|
|
5587
|
+
star: F("*", 10),
|
|
5588
|
+
slash: F("/", 10),
|
|
5589
|
+
starstar: new P("**", { beforeExpr: !0 }),
|
|
5590
|
+
coalesce: F("??", 1),
|
|
5591
|
+
_break: R("break"),
|
|
5592
|
+
_case: R("case", I),
|
|
5593
|
+
_catch: R("catch"),
|
|
5594
|
+
_continue: R("continue"),
|
|
5595
|
+
_debugger: R("debugger"),
|
|
5596
|
+
_default: R("default", I),
|
|
5597
|
+
_do: R("do", {
|
|
5598
5598
|
isLoop: !0,
|
|
5599
5599
|
beforeExpr: !0
|
|
5600
5600
|
}),
|
|
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:
|
|
5601
|
+
_else: R("else", I),
|
|
5602
|
+
_finally: R("finally"),
|
|
5603
|
+
_for: R("for", { isLoop: !0 }),
|
|
5604
|
+
_function: R("function", L),
|
|
5605
|
+
_if: R("if"),
|
|
5606
|
+
_return: R("return", I),
|
|
5607
|
+
_switch: R("switch"),
|
|
5608
|
+
_throw: R("throw", I),
|
|
5609
|
+
_try: R("try"),
|
|
5610
|
+
_var: R("var"),
|
|
5611
|
+
_const: R("const"),
|
|
5612
|
+
_while: R("while", { isLoop: !0 }),
|
|
5613
|
+
_with: R("with"),
|
|
5614
|
+
_new: R("new", {
|
|
5615
5615
|
beforeExpr: !0,
|
|
5616
5616
|
startsExpr: !0
|
|
5617
5617
|
}),
|
|
5618
|
-
_this:
|
|
5619
|
-
_super:
|
|
5620
|
-
_class:
|
|
5621
|
-
_extends:
|
|
5622
|
-
_export:
|
|
5623
|
-
_import:
|
|
5624
|
-
_null:
|
|
5625
|
-
_true:
|
|
5626
|
-
_false:
|
|
5627
|
-
_in:
|
|
5618
|
+
_this: R("this", L),
|
|
5619
|
+
_super: R("super", L),
|
|
5620
|
+
_class: R("class", L),
|
|
5621
|
+
_extends: R("extends", I),
|
|
5622
|
+
_export: R("export"),
|
|
5623
|
+
_import: R("import", L),
|
|
5624
|
+
_null: R("null", L),
|
|
5625
|
+
_true: R("true", L),
|
|
5626
|
+
_false: R("false", L),
|
|
5627
|
+
_in: R("in", {
|
|
5628
5628
|
beforeExpr: !0,
|
|
5629
5629
|
binop: 7
|
|
5630
5630
|
}),
|
|
5631
|
-
_instanceof:
|
|
5631
|
+
_instanceof: R("instanceof", {
|
|
5632
5632
|
beforeExpr: !0,
|
|
5633
5633
|
binop: 7
|
|
5634
5634
|
}),
|
|
5635
|
-
_typeof:
|
|
5635
|
+
_typeof: R("typeof", {
|
|
5636
5636
|
beforeExpr: !0,
|
|
5637
5637
|
prefix: !0,
|
|
5638
5638
|
startsExpr: !0
|
|
5639
5639
|
}),
|
|
5640
|
-
_void:
|
|
5640
|
+
_void: R("void", {
|
|
5641
5641
|
beforeExpr: !0,
|
|
5642
5642
|
prefix: !0,
|
|
5643
5643
|
startsExpr: !0
|
|
5644
5644
|
}),
|
|
5645
|
-
_delete:
|
|
5645
|
+
_delete: R("delete", {
|
|
5646
5646
|
beforeExpr: !0,
|
|
5647
5647
|
prefix: !0,
|
|
5648
5648
|
startsExpr: !0
|
|
5649
5649
|
})
|
|
5650
|
-
},
|
|
5651
|
-
function
|
|
5650
|
+
}, B = /\r\n?|\n|\u2028|\u2029/, Ai = new RegExp(B.source, "g");
|
|
5651
|
+
function ji(e) {
|
|
5652
5652
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
5653
5653
|
}
|
|
5654
|
-
function
|
|
5654
|
+
function Mi(e, t, n) {
|
|
5655
5655
|
n === void 0 && (n = e.length);
|
|
5656
5656
|
for (var r = t; r < n; r++) {
|
|
5657
5657
|
var i = e.charCodeAt(r);
|
|
5658
|
-
if (
|
|
5658
|
+
if (ji(i)) return r < n - 1 && i === 13 && e.charCodeAt(r + 1) === 10 ? r + 2 : r + 1;
|
|
5659
5659
|
}
|
|
5660
5660
|
return -1;
|
|
5661
5661
|
}
|
|
5662
|
-
var
|
|
5663
|
-
return
|
|
5664
|
-
}),
|
|
5665
|
-
return
|
|
5666
|
-
}),
|
|
5667
|
-
function zi(e) {
|
|
5668
|
-
return Ri[e] || (Ri[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
5669
|
-
}
|
|
5662
|
+
var Ni = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, V = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, Pi = Object.prototype, Fi = Pi.hasOwnProperty, Ii = Pi.toString, Li = Object.hasOwn || (function(e, t) {
|
|
5663
|
+
return Fi.call(e, t);
|
|
5664
|
+
}), Ri = Array.isArray || (function(e) {
|
|
5665
|
+
return Ii.call(e) === "[object Array]";
|
|
5666
|
+
}), zi = Object.create(null);
|
|
5670
5667
|
function Bi(e) {
|
|
5668
|
+
return zi[e] || (zi[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
5669
|
+
}
|
|
5670
|
+
function Vi(e) {
|
|
5671
5671
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
5672
5672
|
}
|
|
5673
|
-
var
|
|
5673
|
+
var Hi = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, Ui = function(e, t) {
|
|
5674
5674
|
this.line = e, this.column = t;
|
|
5675
5675
|
};
|
|
5676
|
-
|
|
5677
|
-
return new
|
|
5676
|
+
Ui.prototype.offset = function(e) {
|
|
5677
|
+
return new Ui(this.line, this.column + e);
|
|
5678
5678
|
};
|
|
5679
|
-
var
|
|
5679
|
+
var Wi = function(e, t, n) {
|
|
5680
5680
|
this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
5681
5681
|
};
|
|
5682
|
-
function
|
|
5682
|
+
function Gi(e, t) {
|
|
5683
5683
|
for (var n = 1, r = 0;;) {
|
|
5684
|
-
var i =
|
|
5685
|
-
if (i < 0) return new
|
|
5684
|
+
var i = Mi(e, r, t);
|
|
5685
|
+
if (i < 0) return new Ui(n, t - r);
|
|
5686
5686
|
++n, r = i;
|
|
5687
5687
|
}
|
|
5688
5688
|
}
|
|
5689
|
-
var
|
|
5689
|
+
var Ki = {
|
|
5690
5690
|
ecmaVersion: null,
|
|
5691
5691
|
sourceType: "script",
|
|
5692
5692
|
strict: !1,
|
|
@@ -5708,20 +5708,20 @@ var Gi = {
|
|
|
5708
5708
|
sourceFile: null,
|
|
5709
5709
|
directSourceFile: null,
|
|
5710
5710
|
preserveParens: !1
|
|
5711
|
-
},
|
|
5712
|
-
function
|
|
5711
|
+
}, qi = !1;
|
|
5712
|
+
function Ji(e) {
|
|
5713
5713
|
var t = {};
|
|
5714
|
-
for (var n in
|
|
5715
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
5714
|
+
for (var n in Ki) t[n] = e && Li(e, n) ? e[n] : Ki[n];
|
|
5715
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!qi && typeof console == "object" && console.warn && (qi = !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), Ri(t.onToken)) {
|
|
5716
5716
|
var r = t.onToken;
|
|
5717
5717
|
t.onToken = function(e) {
|
|
5718
5718
|
return r.push(e);
|
|
5719
5719
|
};
|
|
5720
5720
|
}
|
|
5721
|
-
if (
|
|
5721
|
+
if (Ri(t.onComment) && (t.onComment = Yi(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
5722
5722
|
return t;
|
|
5723
5723
|
}
|
|
5724
|
-
function
|
|
5724
|
+
function Yi(e, t) {
|
|
5725
5725
|
return function(n, r, i, a, o, s) {
|
|
5726
5726
|
var c = {
|
|
5727
5727
|
type: n ? "Block" : "Line",
|
|
@@ -5729,20 +5729,20 @@ function Ji(e, t) {
|
|
|
5729
5729
|
start: i,
|
|
5730
5730
|
end: a
|
|
5731
5731
|
};
|
|
5732
|
-
e.locations && (c.loc = new
|
|
5732
|
+
e.locations && (c.loc = new Wi(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
5733
5733
|
};
|
|
5734
5734
|
}
|
|
5735
|
-
var
|
|
5736
|
-
function
|
|
5737
|
-
return
|
|
5735
|
+
var Xi = 1, Zi = 2, Qi = 4, $i = 8, ea = 16, ta = 32, na = 64, ra = 128, ia = 256, aa = 512, oa = 1024, sa = Xi | Zi | ia;
|
|
5736
|
+
function ca(e, t) {
|
|
5737
|
+
return Zi | (e ? Qi : 0) | (t ? $i : 0);
|
|
5738
5738
|
}
|
|
5739
|
-
var
|
|
5740
|
-
this.options = e =
|
|
5739
|
+
var la = 0, ua = 1, da = 2, fa = 3, pa = 4, ma = 5, H = function(e, t, n) {
|
|
5740
|
+
this.options = e = Ji(e), this.sourceFile = e.sourceFile, this.keywords = Bi(Si[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
5741
5741
|
var r = "";
|
|
5742
|
-
e.allowReserved !== !0 && (r =
|
|
5743
|
-
var i = (r ? r + " " : "") +
|
|
5744
|
-
this.reservedWordsStrict =
|
|
5745
|
-
},
|
|
5742
|
+
e.allowReserved !== !0 && (r = bi[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = Bi(r);
|
|
5743
|
+
var i = (r ? r + " " : "") + bi.strict;
|
|
5744
|
+
this.reservedWordsStrict = Bi(i), this.reservedWordsStrictBind = Bi(i + " " + bi.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(B).length)) : this.lineStart = 0, this.type = z.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" ? Zi : Xi), this.regexpState = null, this.privateNameStack = [];
|
|
5745
|
+
}, U = {
|
|
5746
5746
|
inFunction: { configurable: !0 },
|
|
5747
5747
|
inGenerator: { configurable: !0 },
|
|
5748
5748
|
inAsync: { configurable: !0 },
|
|
@@ -5755,120 +5755,120 @@ var ca = 0, la = 1, ua = 2, da = 3, fa = 4, pa = 5, U = function(e, t, n) {
|
|
|
5755
5755
|
allowUsing: { configurable: !0 },
|
|
5756
5756
|
inClassStaticBlock: { configurable: !0 }
|
|
5757
5757
|
};
|
|
5758
|
-
|
|
5758
|
+
H.prototype.parse = function() {
|
|
5759
5759
|
var e = this, t = this.options.program || this.startNode();
|
|
5760
5760
|
return this.nextToken(), this.catchStackOverflow(function() {
|
|
5761
5761
|
return e.parseTopLevel(t);
|
|
5762
5762
|
});
|
|
5763
|
-
},
|
|
5764
|
-
return (this.currentVarScope().flags & Xi) > 0;
|
|
5765
|
-
}, W.inGenerator.get = function() {
|
|
5766
|
-
return (this.currentVarScope().flags & Qi) > 0;
|
|
5767
|
-
}, W.inAsync.get = function() {
|
|
5763
|
+
}, U.inFunction.get = function() {
|
|
5768
5764
|
return (this.currentVarScope().flags & Zi) > 0;
|
|
5769
|
-
},
|
|
5765
|
+
}, U.inGenerator.get = function() {
|
|
5766
|
+
return (this.currentVarScope().flags & $i) > 0;
|
|
5767
|
+
}, U.inAsync.get = function() {
|
|
5768
|
+
return (this.currentVarScope().flags & Qi) > 0;
|
|
5769
|
+
}, U.canAwait.get = function() {
|
|
5770
5770
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
5771
5771
|
var t = this.scopeStack[e].flags;
|
|
5772
|
-
if (t & (
|
|
5773
|
-
if (t &
|
|
5772
|
+
if (t & (ia | aa)) return !1;
|
|
5773
|
+
if (t & Zi) return (t & Qi) > 0;
|
|
5774
5774
|
}
|
|
5775
5775
|
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
|
-
},
|
|
5776
|
+
}, U.allowReturn.get = function() {
|
|
5777
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & Xi);
|
|
5778
|
+
}, U.allowSuper.get = function() {
|
|
5779
|
+
return (this.currentThisScope().flags & na) > 0 || this.options.allowSuperOutsideMethod;
|
|
5780
|
+
}, U.allowDirectSuper.get = function() {
|
|
5781
|
+
return (this.currentThisScope().flags & ra) > 0;
|
|
5782
|
+
}, U.treatFunctionsAsVar.get = function() {
|
|
5783
5783
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
5784
|
-
},
|
|
5784
|
+
}, U.allowNewDotTarget.get = function() {
|
|
5785
5785
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
5786
5786
|
var t = this.scopeStack[e].flags;
|
|
5787
|
-
if (t & (
|
|
5787
|
+
if (t & (ia | aa) || t & Zi && !(t & ea)) return !0;
|
|
5788
5788
|
}
|
|
5789
5789
|
return !1;
|
|
5790
|
-
},
|
|
5790
|
+
}, U.allowUsing.get = function() {
|
|
5791
5791
|
var e = this.currentScope().flags;
|
|
5792
|
-
return !(e &
|
|
5793
|
-
},
|
|
5794
|
-
return (this.currentVarScope().flags &
|
|
5795
|
-
},
|
|
5792
|
+
return !(e & oa || !this.inModule && e & Xi);
|
|
5793
|
+
}, U.inClassStaticBlock.get = function() {
|
|
5794
|
+
return (this.currentVarScope().flags & ia) > 0;
|
|
5795
|
+
}, H.extend = function() {
|
|
5796
5796
|
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
5797
5797
|
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
5798
5798
|
return n;
|
|
5799
|
-
},
|
|
5799
|
+
}, H.parse = function(e, t) {
|
|
5800
5800
|
return new this(t, e).parse();
|
|
5801
|
-
},
|
|
5801
|
+
}, H.parseExpressionAt = function(e, t, n) {
|
|
5802
5802
|
var r = new this(n, e, t);
|
|
5803
5803
|
return r.nextToken(), r.parseExpression();
|
|
5804
|
-
},
|
|
5804
|
+
}, H.tokenizer = function(e, t) {
|
|
5805
5805
|
return new this(t, e);
|
|
5806
|
-
}, Object.defineProperties(
|
|
5807
|
-
var
|
|
5808
|
-
|
|
5806
|
+
}, Object.defineProperties(H.prototype, U);
|
|
5807
|
+
var W = H.prototype, ha = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
5808
|
+
W.strictDirective = function(e) {
|
|
5809
5809
|
if (this.options.ecmaVersion < 5) return !1;
|
|
5810
5810
|
for (;;) {
|
|
5811
|
-
|
|
5812
|
-
var t =
|
|
5811
|
+
V.lastIndex = e, e += V.exec(this.input)[0].length;
|
|
5812
|
+
var t = ha.exec(this.input.slice(e));
|
|
5813
5813
|
if (!t) return !1;
|
|
5814
5814
|
if ((t[1] || t[2]) === "use strict") {
|
|
5815
|
-
|
|
5816
|
-
var n =
|
|
5817
|
-
return i === ";" || i === "}" ||
|
|
5815
|
+
V.lastIndex = e + t[0].length;
|
|
5816
|
+
var n = V.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
|
|
5817
|
+
return i === ";" || i === "}" || B.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
|
|
5818
5818
|
}
|
|
5819
|
-
e += t[0].length,
|
|
5819
|
+
e += t[0].length, V.lastIndex = e, e += V.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
5820
5820
|
}
|
|
5821
|
-
},
|
|
5821
|
+
}, W.eat = function(e) {
|
|
5822
5822
|
return this.type === e && (this.next(), !0);
|
|
5823
|
-
},
|
|
5824
|
-
return this.type ===
|
|
5825
|
-
},
|
|
5823
|
+
}, W.isContextual = function(e) {
|
|
5824
|
+
return this.type === z.name && this.value === e && !this.containsEsc;
|
|
5825
|
+
}, W.eatContextual = function(e) {
|
|
5826
5826
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
5827
|
-
},
|
|
5827
|
+
}, W.catchStackOverflow = function(e) {
|
|
5828
5828
|
try {
|
|
5829
5829
|
return e();
|
|
5830
5830
|
} catch (e) {
|
|
5831
5831
|
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
5832
|
else throw e;
|
|
5833
5833
|
}
|
|
5834
|
-
},
|
|
5834
|
+
}, W.expectContextual = function(e) {
|
|
5835
5835
|
this.eatContextual(e) || this.unexpected();
|
|
5836
|
-
},
|
|
5837
|
-
return this.type ===
|
|
5838
|
-
},
|
|
5836
|
+
}, W.canInsertSemicolon = function() {
|
|
5837
|
+
return this.type === z.eof || this.type === z.braceR || B.test(this.input.slice(this.lastTokEnd, this.start));
|
|
5838
|
+
}, W.insertSemicolon = function() {
|
|
5839
5839
|
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
5840
|
-
},
|
|
5841
|
-
!this.eat(
|
|
5842
|
-
},
|
|
5840
|
+
}, W.semicolon = function() {
|
|
5841
|
+
!this.eat(z.semi) && !this.insertSemicolon() && this.unexpected();
|
|
5842
|
+
}, W.afterTrailingComma = function(e, t) {
|
|
5843
5843
|
if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
5844
|
-
},
|
|
5844
|
+
}, W.expect = function(e) {
|
|
5845
5845
|
this.eat(e) || this.unexpected();
|
|
5846
|
-
},
|
|
5846
|
+
}, W.unexpected = function(e) {
|
|
5847
5847
|
this.raise(e ?? this.start, "Unexpected token");
|
|
5848
5848
|
};
|
|
5849
|
-
var
|
|
5849
|
+
var ga = function() {
|
|
5850
5850
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
5851
5851
|
};
|
|
5852
|
-
|
|
5852
|
+
W.checkPatternErrors = function(e, t) {
|
|
5853
5853
|
if (e) {
|
|
5854
5854
|
e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
|
|
5855
5855
|
var n = t ? e.parenthesizedAssign : e.parenthesizedBind;
|
|
5856
5856
|
n > -1 && this.raiseRecoverable(n, t ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
5857
5857
|
}
|
|
5858
|
-
},
|
|
5858
|
+
}, W.checkExpressionErrors = function(e, t) {
|
|
5859
5859
|
if (!e) return !1;
|
|
5860
5860
|
var n = e.shorthandAssign, r = e.doubleProto;
|
|
5861
5861
|
if (!t) return n >= 0 || r >= 0;
|
|
5862
5862
|
n >= 0 && this.raise(n, "Shorthand property assignments are valid only in destructuring patterns"), r >= 0 && this.raiseRecoverable(r, "Redefinition of __proto__ property");
|
|
5863
|
-
},
|
|
5863
|
+
}, W.checkYieldAwaitInDefaultParams = function() {
|
|
5864
5864
|
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
|
-
},
|
|
5865
|
+
}, W.isSimpleAssignTarget = function(e) {
|
|
5866
5866
|
return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
|
|
5867
5867
|
};
|
|
5868
|
-
var
|
|
5869
|
-
|
|
5868
|
+
var G = H.prototype;
|
|
5869
|
+
G.parseTopLevel = function(e) {
|
|
5870
5870
|
var t = Object.create(null);
|
|
5871
|
-
for (e.body ||= []; this.type !==
|
|
5871
|
+
for (e.body ||= []; this.type !== z.eof;) {
|
|
5872
5872
|
var n = this.parseStatement(null, !0, t);
|
|
5873
5873
|
e.body.push(n);
|
|
5874
5874
|
}
|
|
@@ -5878,114 +5878,114 @@ K.parseTopLevel = function(e) {
|
|
|
5878
5878
|
}
|
|
5879
5879
|
return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType, this.finishNode(e, "Program");
|
|
5880
5880
|
};
|
|
5881
|
-
var
|
|
5882
|
-
|
|
5881
|
+
var _a = { kind: "loop" }, va = { kind: "switch" };
|
|
5882
|
+
G.isLet = function(e) {
|
|
5883
5883
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
5884
|
-
|
|
5885
|
-
var t =
|
|
5884
|
+
V.lastIndex = this.pos;
|
|
5885
|
+
var t = V.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
5886
5886
|
if (r === 91 || r === 92) return !0;
|
|
5887
5887
|
if (e) return !1;
|
|
5888
5888
|
if (r === 123) return !0;
|
|
5889
|
-
if (
|
|
5889
|
+
if (Di(r)) {
|
|
5890
5890
|
var i = n;
|
|
5891
5891
|
do
|
|
5892
5892
|
n += r <= 65535 ? 1 : 2;
|
|
5893
|
-
while (
|
|
5893
|
+
while (Oi(r = this.fullCharCodeAt(n)));
|
|
5894
5894
|
if (r === 92) return !0;
|
|
5895
5895
|
var a = this.input.slice(i, n);
|
|
5896
|
-
if (!
|
|
5896
|
+
if (!Ci.test(a)) return !0;
|
|
5897
5897
|
}
|
|
5898
5898
|
return !1;
|
|
5899
|
-
},
|
|
5899
|
+
}, G.isAsyncFunction = function() {
|
|
5900
5900
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
5901
|
-
|
|
5902
|
-
var e =
|
|
5903
|
-
return !
|
|
5904
|
-
},
|
|
5901
|
+
V.lastIndex = this.pos;
|
|
5902
|
+
var e = V.exec(this.input), t = this.pos + e[0].length, n;
|
|
5903
|
+
return !B.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(Oi(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
5904
|
+
}, G.isUsingKeyword = function(e, t) {
|
|
5905
5905
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
5906
|
-
|
|
5907
|
-
var n =
|
|
5908
|
-
if (
|
|
5906
|
+
V.lastIndex = this.pos;
|
|
5907
|
+
var n = V.exec(this.input), r = this.pos + n[0].length;
|
|
5908
|
+
if (B.test(this.input.slice(this.pos, r))) return !1;
|
|
5909
5909
|
if (e) {
|
|
5910
5910
|
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 &&
|
|
5911
|
+
if (this.input.slice(r, i) !== "using" || i === this.input.length || Oi(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
5912
|
+
V.lastIndex = i;
|
|
5913
|
+
var o = V.exec(this.input);
|
|
5914
|
+
if (r = i + o[0].length, o && B.test(this.input.slice(i, r))) return !1;
|
|
5915
5915
|
}
|
|
5916
5916
|
var s = this.fullCharCodeAt(r);
|
|
5917
|
-
if (!
|
|
5917
|
+
if (!Di(s) && s !== 92) return !1;
|
|
5918
5918
|
var c = r;
|
|
5919
5919
|
do
|
|
5920
5920
|
r += s <= 65535 ? 1 : 2;
|
|
5921
|
-
while (
|
|
5921
|
+
while (Oi(s = this.fullCharCodeAt(r)));
|
|
5922
5922
|
if (s === 92) return !0;
|
|
5923
5923
|
var l = this.input.slice(c, r);
|
|
5924
|
-
if (
|
|
5924
|
+
if (Ci.test(l)) return !1;
|
|
5925
5925
|
if (t && !e && l === "of") {
|
|
5926
|
-
|
|
5927
|
-
var u =
|
|
5926
|
+
V.lastIndex = r;
|
|
5927
|
+
var u = V.exec(this.input);
|
|
5928
5928
|
if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
5929
5929
|
}
|
|
5930
5930
|
return !0;
|
|
5931
|
-
},
|
|
5931
|
+
}, G.isAwaitUsing = function(e) {
|
|
5932
5932
|
return this.isUsingKeyword(!0, e);
|
|
5933
|
-
},
|
|
5933
|
+
}, G.isUsing = function(e) {
|
|
5934
5934
|
return this.isUsingKeyword(!1, e);
|
|
5935
|
-
},
|
|
5935
|
+
}, G.parseStatement = function(e, t, n) {
|
|
5936
5936
|
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 =
|
|
5937
|
+
switch (this.isLet(e) && (r = z._var, a = "let"), r) {
|
|
5938
|
+
case z._break:
|
|
5939
|
+
case z._continue: return this.parseBreakContinueStatement(i, r.keyword);
|
|
5940
|
+
case z._debugger: return this.parseDebuggerStatement(i);
|
|
5941
|
+
case z._do: return this.parseDoStatement(i);
|
|
5942
|
+
case z._for: return this.parseForStatement(i);
|
|
5943
|
+
case z._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(i, !1, !e);
|
|
5944
|
+
case z._class: return e && this.unexpected(), this.parseClass(i, !0);
|
|
5945
|
+
case z._if: return this.parseIfStatement(i);
|
|
5946
|
+
case z._return: return this.parseReturnStatement(i);
|
|
5947
|
+
case z._switch: return this.parseSwitchStatement(i);
|
|
5948
|
+
case z._throw: return this.parseThrowStatement(i);
|
|
5949
|
+
case z._try: return this.parseTryStatement(i);
|
|
5950
|
+
case z._const:
|
|
5951
|
+
case z._var: return a ||= this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(i, a);
|
|
5952
|
+
case z._while: return this.parseWhileStatement(i);
|
|
5953
|
+
case z._with: return this.parseWithStatement(i);
|
|
5954
|
+
case z.braceL: return this.parseBlock(!0, i);
|
|
5955
|
+
case z.semi: return this.parseEmptyStatement(i);
|
|
5956
|
+
case z._export:
|
|
5957
|
+
case z._import:
|
|
5958
|
+
if (this.options.ecmaVersion > 10 && r === z._import) {
|
|
5959
|
+
V.lastIndex = this.pos;
|
|
5960
|
+
var o = V.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
|
|
5961
5961
|
if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
|
|
5962
5962
|
}
|
|
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 ===
|
|
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 === z._import ? this.parseImport(i) : this.parseExport(i, n);
|
|
5964
5964
|
default:
|
|
5965
5965
|
if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
|
|
5966
5966
|
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
5967
5967
|
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
5968
|
var u = this.value, d = this.parseExpression();
|
|
5969
|
-
return r ===
|
|
5969
|
+
return r === z.name && d.type === "Identifier" && this.eat(z.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
5970
5970
|
}
|
|
5971
|
-
},
|
|
5971
|
+
}, G.parseBreakContinueStatement = function(e, t) {
|
|
5972
5972
|
var n = t === "break";
|
|
5973
|
-
this.next(), this.eat(
|
|
5973
|
+
this.next(), this.eat(z.semi) || this.insertSemicolon() ? e.label = null : this.type === z.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
|
|
5974
5974
|
for (var r = 0; r < this.labels.length; ++r) {
|
|
5975
5975
|
var i = this.labels[r];
|
|
5976
5976
|
if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
|
|
5977
5977
|
}
|
|
5978
5978
|
return r === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, n ? "BreakStatement" : "ContinueStatement");
|
|
5979
|
-
},
|
|
5979
|
+
}, G.parseDebuggerStatement = function(e) {
|
|
5980
5980
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
5981
|
-
},
|
|
5982
|
-
return this.next(), this.labels.push(
|
|
5983
|
-
},
|
|
5981
|
+
}, G.parseDoStatement = function(e) {
|
|
5982
|
+
return this.next(), this.labels.push(_a), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(z._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(z.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
5983
|
+
}, G.parseForStatement = function(e) {
|
|
5984
5984
|
this.next();
|
|
5985
5985
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
5986
|
-
if (this.labels.push(
|
|
5986
|
+
if (this.labels.push(_a), this.enterScope(0), this.expect(z.parenL), this.type === z.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
5987
5987
|
var n = this.isLet();
|
|
5988
|
-
if (this.type ===
|
|
5988
|
+
if (this.type === z._var || this.type === z._const || n) {
|
|
5989
5989
|
var r = this.startNode(), i = n ? "let" : this.value;
|
|
5990
5990
|
return this.next(), this.parseVar(r, !0, i), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
5991
5991
|
}
|
|
@@ -5994,47 +5994,47 @@ K.isLet = function(e) {
|
|
|
5994
5994
|
var c = this.startNode();
|
|
5995
5995
|
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
5996
|
}
|
|
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(
|
|
5997
|
+
var l = this.containsEsc, u = new ga(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
5998
|
+
return this.type === z._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === z._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));
|
|
5999
|
+
}, G.parseForAfterInit = function(e, t, n) {
|
|
6000
|
+
return (this.type === z._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === z._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));
|
|
6001
|
+
}, G.parseFunctionStatement = function(e, t, n) {
|
|
6002
|
+
return this.next(), this.parseFunction(e, ba | (n ? 0 : xa), !1, t);
|
|
6003
|
+
}, G.parseIfStatement = function(e) {
|
|
6004
|
+
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(z._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
6005
|
+
}, G.parseReturnStatement = function(e) {
|
|
6006
|
+
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(z.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
6007
|
+
}, G.parseSwitchStatement = function(e) {
|
|
6008
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(z.braceL), this.labels.push(va), this.enterScope(oa);
|
|
6009
|
+
for (var t, n = !1; this.type !== z.braceR;) if (this.type === z._case || this.type === z._default) {
|
|
6010
|
+
var r = this.type === z._case;
|
|
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(z.colon);
|
|
6012
6012
|
} else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
6013
6013
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
6014
|
-
},
|
|
6015
|
-
return this.next(),
|
|
6014
|
+
}, G.parseThrowStatement = function(e) {
|
|
6015
|
+
return this.next(), B.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
6016
|
};
|
|
6017
|
-
var
|
|
6018
|
-
|
|
6017
|
+
var ya = [];
|
|
6018
|
+
G.parseCatchClauseParam = function() {
|
|
6019
6019
|
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 ===
|
|
6020
|
+
return this.enterScope(t ? ta : 0), this.checkLValPattern(e, t ? pa : da), this.expect(z.parenR), e;
|
|
6021
|
+
}, G.parseTryStatement = function(e) {
|
|
6022
|
+
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === z._catch) {
|
|
6023
6023
|
var t = this.startNode();
|
|
6024
|
-
this.next(), this.eat(
|
|
6024
|
+
this.next(), this.eat(z.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
6025
|
}
|
|
6026
|
-
return e.finalizer = this.eat(
|
|
6027
|
-
},
|
|
6026
|
+
return e.finalizer = this.eat(z._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
6027
|
+
}, G.parseVarStatement = function(e, t, n) {
|
|
6028
6028
|
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
|
-
},
|
|
6029
|
+
}, G.parseWhileStatement = function(e) {
|
|
6030
|
+
return this.next(), e.test = this.parseParenExpression(), this.labels.push(_a), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
6031
|
+
}, G.parseWithStatement = function(e) {
|
|
6032
6032
|
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
|
-
},
|
|
6033
|
+
}, G.parseEmptyStatement = function(e) {
|
|
6034
6034
|
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
6035
|
-
},
|
|
6035
|
+
}, G.parseLabeledStatement = function(e, t, n, r) {
|
|
6036
6036
|
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 ===
|
|
6037
|
+
for (var o = this.type.isLoop ? "loop" : this.type === z._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
|
|
6038
6038
|
var c = this.labels[s];
|
|
6039
6039
|
if (c.statementStart === e.start) c.statementStart = this.start, c.kind = o;
|
|
6040
6040
|
else break;
|
|
@@ -6044,113 +6044,113 @@ K.parseCatchClauseParam = function() {
|
|
|
6044
6044
|
kind: o,
|
|
6045
6045
|
statementStart: this.start
|
|
6046
6046
|
}), e.body = this.parseStatement(r ? r.indexOf("label") === -1 ? r + "label" : r : "label"), this.labels.pop(), e.label = n, this.finishNode(e, "LabeledStatement");
|
|
6047
|
-
},
|
|
6047
|
+
}, G.parseExpressionStatement = function(e, t) {
|
|
6048
6048
|
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(
|
|
6049
|
+
}, G.parseBlock = function(e, t, n) {
|
|
6050
|
+
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(z.braceL), e && this.enterScope(0); this.type !== z.braceR;) {
|
|
6051
6051
|
var r = this.parseStatement(null);
|
|
6052
6052
|
t.body.push(r);
|
|
6053
6053
|
}
|
|
6054
6054
|
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
|
-
},
|
|
6055
|
+
}, G.parseFor = function(e, t) {
|
|
6056
|
+
return e.init = t, this.expect(z.semi), e.test = this.type === z.semi ? null : this.parseExpression(), this.expect(z.semi), e.update = this.type === z.parenR ? null : this.parseExpression(), this.expect(z.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
6057
|
+
}, G.parseForIn = function(e, t) {
|
|
6058
|
+
var n = this.type === z._in;
|
|
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(z.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
|
|
6060
|
+
}, G.parseVar = function(e, t, n, r) {
|
|
6061
6061
|
for (e.declarations = [], e.kind = n;;) {
|
|
6062
6062
|
var i = this.startNode();
|
|
6063
|
-
if (this.parseVarId(i, n), this.eat(
|
|
6063
|
+
if (this.parseVarId(i, n), this.eat(z.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === z._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== z._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && !(t && (this.type === z._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(z.comma)) break;
|
|
6064
6064
|
}
|
|
6065
6065
|
return e;
|
|
6066
|
-
},
|
|
6067
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ?
|
|
6066
|
+
}, G.parseVarId = function(e, t) {
|
|
6067
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? ua : da, !1);
|
|
6068
6068
|
};
|
|
6069
|
-
var
|
|
6070
|
-
|
|
6071
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type ===
|
|
6069
|
+
var ba = 1, xa = 2, Sa = 4;
|
|
6070
|
+
G.parseFunction = function(e, t, n, r, i) {
|
|
6071
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === z.star && t & xa && this.unexpected(), e.generator = this.eat(z.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & ba && (e.id = t & Sa && this.type !== z.name ? null : this.parseIdent(), e.id && !(t & xa) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? ua : da : fa));
|
|
6072
6072
|
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
|
-
},
|
|
6073
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(ca(e.async, e.generator)), t & ba || (e.id = this.type === z.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 & ba ? "FunctionDeclaration" : "FunctionExpression");
|
|
6074
|
+
}, G.parseFunctionParams = function(e) {
|
|
6075
|
+
this.expect(z.parenL), e.params = this.parseBindingList(z.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
6076
|
+
}, G.parseClass = function(e, t) {
|
|
6077
6077
|
this.next();
|
|
6078
6078
|
var n = this.strict;
|
|
6079
6079
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
6080
6080
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
6081
|
-
for (i.body = [], this.expect(
|
|
6081
|
+
for (i.body = [], this.expect(z.braceL); this.type !== z.braceR;) {
|
|
6082
6082
|
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" &&
|
|
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" && Ca(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
6084
6084
|
}
|
|
6085
6085
|
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(
|
|
6086
|
+
}, G.parseClassElement = function(e) {
|
|
6087
|
+
if (this.eat(z.semi)) return null;
|
|
6088
6088
|
var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
|
|
6089
6089
|
if (this.eatContextual("static")) {
|
|
6090
|
-
if (t >= 13 && this.eat(
|
|
6091
|
-
this.isClassElementNameStart() || this.type ===
|
|
6090
|
+
if (t >= 13 && this.eat(z.braceL)) return this.parseClassStaticBlock(n), n;
|
|
6091
|
+
this.isClassElementNameStart() || this.type === z.star ? s = !0 : r = "static";
|
|
6092
6092
|
}
|
|
6093
|
-
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type ===
|
|
6093
|
+
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === z.star) && !this.canInsertSemicolon() ? a = !0 : r = "async"), !r && (t >= 9 || !a) && this.eat(z.star) && (i = !0), !r && !a && !i) {
|
|
6094
6094
|
var c = this.value;
|
|
6095
6095
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
6096
6096
|
}
|
|
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 &&
|
|
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 === z.parenL || o !== "method" || i || a) {
|
|
6098
|
+
var l = !n.static && wa(n, "constructor"), u = l && e;
|
|
6099
6099
|
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
6100
|
} else this.parseClassField(n);
|
|
6101
6101
|
return n;
|
|
6102
|
-
},
|
|
6103
|
-
return this.type ===
|
|
6104
|
-
},
|
|
6105
|
-
this.type ===
|
|
6106
|
-
},
|
|
6102
|
+
}, G.isClassElementNameStart = function() {
|
|
6103
|
+
return this.type === z.name || this.type === z.privateId || this.type === z.num || this.type === z.string || this.type === z.bracketL || this.type.keyword;
|
|
6104
|
+
}, G.parseClassElementName = function(e) {
|
|
6105
|
+
this.type === z.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);
|
|
6106
|
+
}, G.parseClassMethod = function(e, t, n, r) {
|
|
6107
6107
|
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 &&
|
|
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 && wa(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
6109
6109
|
var a = e.value = this.parseMethod(t, n, r);
|
|
6110
6110
|
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
|
-
},
|
|
6111
|
+
}, G.parseClassField = function(e) {
|
|
6112
|
+
return wa(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && wa(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(z.eq) ? (this.enterScope(aa | na), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
6113
|
+
}, G.parseClassStaticBlock = function(e) {
|
|
6114
6114
|
e.body = [];
|
|
6115
6115
|
var t = this.labels;
|
|
6116
|
-
for (this.labels = [], this.enterScope(
|
|
6116
|
+
for (this.labels = [], this.enterScope(ia | na); this.type !== z.braceR;) {
|
|
6117
6117
|
var n = this.parseStatement(null);
|
|
6118
6118
|
e.body.push(n);
|
|
6119
6119
|
}
|
|
6120
6120
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
6121
|
-
},
|
|
6122
|
-
this.type ===
|
|
6123
|
-
},
|
|
6124
|
-
e.superClass = this.eat(
|
|
6125
|
-
},
|
|
6121
|
+
}, G.parseClassId = function(e, t) {
|
|
6122
|
+
this.type === z.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, da, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
6123
|
+
}, G.parseClassSuper = function(e) {
|
|
6124
|
+
e.superClass = this.eat(z._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
6125
|
+
}, G.enterClassBody = function() {
|
|
6126
6126
|
var e = {
|
|
6127
6127
|
declared: Object.create(null),
|
|
6128
6128
|
used: []
|
|
6129
6129
|
};
|
|
6130
6130
|
return this.privateNameStack.push(e), e.declared;
|
|
6131
|
-
},
|
|
6131
|
+
}, G.exitClassBody = function() {
|
|
6132
6132
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
6133
6133
|
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
6134
|
var o = n[a];
|
|
6135
|
-
|
|
6135
|
+
Li(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
6136
6136
|
}
|
|
6137
6137
|
};
|
|
6138
|
-
function
|
|
6138
|
+
function Ca(e, t) {
|
|
6139
6139
|
var n = t.key.name, r = e[n], i = "true";
|
|
6140
6140
|
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
6141
|
}
|
|
6142
|
-
function
|
|
6142
|
+
function wa(e, t) {
|
|
6143
6143
|
var n = e.computed, r = e.key;
|
|
6144
6144
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
6145
6145
|
}
|
|
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(
|
|
6146
|
+
G.parseExportAllDeclaration = function(e, t) {
|
|
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 !== z.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
6148
|
+
}, G.parseExport = function(e, t) {
|
|
6149
|
+
if (this.next(), this.eat(z.star)) return this.parseExportAllDeclaration(e, t);
|
|
6150
|
+
if (this.eat(z._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
6151
6151
|
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
6152
|
else {
|
|
6153
|
-
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !==
|
|
6153
|
+
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== z.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
6154
6154
|
else {
|
|
6155
6155
|
for (var n = 0, r = e.specifiers; n < r.length; n += 1) {
|
|
6156
6156
|
var i = r[n];
|
|
@@ -6161,23 +6161,23 @@ K.parseExportAllDeclaration = function(e, t) {
|
|
|
6161
6161
|
this.semicolon();
|
|
6162
6162
|
}
|
|
6163
6163
|
return this.finishNode(e, "ExportNamedDeclaration");
|
|
6164
|
-
},
|
|
6164
|
+
}, G.parseExportDeclaration = function(e) {
|
|
6165
6165
|
return this.parseStatement(null);
|
|
6166
|
-
},
|
|
6166
|
+
}, G.parseExportDefaultDeclaration = function() {
|
|
6167
6167
|
var e;
|
|
6168
|
-
if (this.type ===
|
|
6168
|
+
if (this.type === z._function || (e = this.isAsyncFunction())) {
|
|
6169
6169
|
var t = this.startNode();
|
|
6170
|
-
return this.next(), e && this.next(), this.parseFunction(t,
|
|
6170
|
+
return this.next(), e && this.next(), this.parseFunction(t, ba | Sa, !1, e);
|
|
6171
6171
|
}
|
|
6172
|
-
if (this.type ===
|
|
6172
|
+
if (this.type === z._class) {
|
|
6173
6173
|
var n = this.startNode();
|
|
6174
6174
|
return this.parseClass(n, "nullableID");
|
|
6175
6175
|
}
|
|
6176
6176
|
var r = this.parseMaybeAssign();
|
|
6177
6177
|
return this.semicolon(), r;
|
|
6178
|
-
},
|
|
6179
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
6180
|
-
},
|
|
6178
|
+
}, G.checkExport = function(e, t, n) {
|
|
6179
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), Li(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
6180
|
+
}, G.checkPatternExport = function(e, t) {
|
|
6181
6181
|
var n = t.type;
|
|
6182
6182
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
6183
6183
|
else if (n === "ObjectPattern") for (var r = 0, i = t.properties; r < i.length; r += 1) {
|
|
@@ -6189,72 +6189,72 @@ K.parseExportAllDeclaration = function(e, t) {
|
|
|
6189
6189
|
c && this.checkPatternExport(e, c);
|
|
6190
6190
|
}
|
|
6191
6191
|
else n === "Property" ? this.checkPatternExport(e, t.value) : n === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : n === "RestElement" && this.checkPatternExport(e, t.argument);
|
|
6192
|
-
},
|
|
6192
|
+
}, G.checkVariableExport = function(e, t) {
|
|
6193
6193
|
if (e) for (var n = 0, r = t; n < r.length; n += 1) {
|
|
6194
6194
|
var i = r[n];
|
|
6195
6195
|
this.checkPatternExport(e, i.id);
|
|
6196
6196
|
}
|
|
6197
|
-
},
|
|
6197
|
+
}, G.shouldParseExportStatement = function() {
|
|
6198
6198
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
6199
|
-
},
|
|
6199
|
+
}, G.parseExportSpecifier = function(e) {
|
|
6200
6200
|
var t = this.startNode();
|
|
6201
6201
|
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
|
-
},
|
|
6202
|
+
}, G.parseExportSpecifiers = function(e) {
|
|
6203
6203
|
var t = [], n = !0;
|
|
6204
|
-
for (this.expect(
|
|
6204
|
+
for (this.expect(z.braceL); !this.eat(z.braceR);) {
|
|
6205
6205
|
if (n) n = !1;
|
|
6206
|
-
else if (this.expect(
|
|
6206
|
+
else if (this.expect(z.comma), this.afterTrailingComma(z.braceR)) break;
|
|
6207
6207
|
t.push(this.parseExportSpecifier(e));
|
|
6208
6208
|
}
|
|
6209
6209
|
return t;
|
|
6210
|
-
},
|
|
6211
|
-
return this.next(), this.type ===
|
|
6212
|
-
},
|
|
6210
|
+
}, G.parseImport = function(e) {
|
|
6211
|
+
return this.next(), this.type === z.string ? (e.specifiers = ya, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === z.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
6212
|
+
}, G.parseImportSpecifier = function() {
|
|
6213
6213
|
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
|
-
},
|
|
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, da), this.finishNode(e, "ImportSpecifier");
|
|
6215
|
+
}, G.parseImportDefaultSpecifier = function() {
|
|
6216
6216
|
var e = this.startNode();
|
|
6217
|
-
return e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
6218
|
-
},
|
|
6217
|
+
return e.local = this.parseIdent(), this.checkLValSimple(e.local, da), this.finishNode(e, "ImportDefaultSpecifier");
|
|
6218
|
+
}, G.parseImportNamespaceSpecifier = function() {
|
|
6219
6219
|
var e = this.startNode();
|
|
6220
|
-
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
6221
|
-
},
|
|
6220
|
+
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, da), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
6221
|
+
}, G.parseImportSpecifiers = function() {
|
|
6222
6222
|
var e = [], t = !0;
|
|
6223
|
-
if (this.type ===
|
|
6224
|
-
if (this.type ===
|
|
6225
|
-
for (this.expect(
|
|
6223
|
+
if (this.type === z.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(z.comma))) return e;
|
|
6224
|
+
if (this.type === z.star) return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
6225
|
+
for (this.expect(z.braceL); !this.eat(z.braceR);) {
|
|
6226
6226
|
if (t) t = !1;
|
|
6227
|
-
else if (this.expect(
|
|
6227
|
+
else if (this.expect(z.comma), this.afterTrailingComma(z.braceR)) break;
|
|
6228
6228
|
e.push(this.parseImportSpecifier());
|
|
6229
6229
|
}
|
|
6230
6230
|
return e;
|
|
6231
|
-
},
|
|
6231
|
+
}, G.parseWithClause = function() {
|
|
6232
6232
|
var e = [];
|
|
6233
|
-
if (!this.eat(
|
|
6234
|
-
this.expect(
|
|
6235
|
-
for (var t = {}, n = !0; !this.eat(
|
|
6233
|
+
if (!this.eat(z._with)) return e;
|
|
6234
|
+
this.expect(z.braceL);
|
|
6235
|
+
for (var t = {}, n = !0; !this.eat(z.braceR);) {
|
|
6236
6236
|
if (n) n = !1;
|
|
6237
|
-
else if (this.expect(
|
|
6237
|
+
else if (this.expect(z.comma), this.afterTrailingComma(z.braceR)) break;
|
|
6238
6238
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
6239
|
-
|
|
6239
|
+
Li(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
6240
6240
|
}
|
|
6241
6241
|
return e;
|
|
6242
|
-
},
|
|
6242
|
+
}, G.parseImportAttribute = function() {
|
|
6243
6243
|
var e = this.startNode();
|
|
6244
|
-
return e.key = this.type ===
|
|
6245
|
-
},
|
|
6246
|
-
if (this.options.ecmaVersion >= 13 && this.type ===
|
|
6244
|
+
return e.key = this.type === z.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(z.colon), this.type !== z.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
6245
|
+
}, G.parseModuleExportName = function() {
|
|
6246
|
+
if (this.options.ecmaVersion >= 13 && this.type === z.string) {
|
|
6247
6247
|
var e = this.parseLiteral(this.value);
|
|
6248
|
-
return
|
|
6248
|
+
return Hi.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
6249
6249
|
}
|
|
6250
6250
|
return this.parseIdent(!0);
|
|
6251
|
-
},
|
|
6251
|
+
}, G.adaptDirectivePrologue = function(e) {
|
|
6252
6252
|
for (var t = 0; t < e.length && this.isDirectiveCandidate(e[t]); ++t) e[t].directive = e[t].expression.raw.slice(1, -1);
|
|
6253
|
-
},
|
|
6253
|
+
}, G.isDirectiveCandidate = function(e) {
|
|
6254
6254
|
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
6255
|
};
|
|
6256
|
-
var
|
|
6257
|
-
|
|
6256
|
+
var K = H.prototype;
|
|
6257
|
+
K.toAssignable = function(e, t, n) {
|
|
6258
6258
|
if (this.options.ecmaVersion >= 6 && e) switch (e.type) {
|
|
6259
6259
|
case "Identifier":
|
|
6260
6260
|
this.inAsync && e.name === "await" && this.raise(e.start, "Cannot use 'await' as identifier inside an async function");
|
|
@@ -6293,7 +6293,7 @@ q.toAssignable = function(e, t, n) {
|
|
|
6293
6293
|
}
|
|
6294
6294
|
else n && this.checkPatternErrors(n, !0);
|
|
6295
6295
|
return e;
|
|
6296
|
-
},
|
|
6296
|
+
}, K.toAssignableList = function(e, t) {
|
|
6297
6297
|
for (var n = e.length, r = 0; r < n; r++) {
|
|
6298
6298
|
var i = e[r];
|
|
6299
6299
|
i && this.toAssignable(i, t);
|
|
@@ -6303,44 +6303,44 @@ q.toAssignable = function(e, t, n) {
|
|
|
6303
6303
|
this.options.ecmaVersion === 6 && t && a && a.type === "RestElement" && a.argument.type !== "Identifier" && this.unexpected(a.argument.start);
|
|
6304
6304
|
}
|
|
6305
6305
|
return e;
|
|
6306
|
-
},
|
|
6306
|
+
}, K.parseSpread = function(e) {
|
|
6307
6307
|
var t = this.startNode();
|
|
6308
6308
|
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
6309
|
-
},
|
|
6309
|
+
}, K.parseRestBinding = function() {
|
|
6310
6310
|
var e = this.startNode();
|
|
6311
|
-
return this.next(), this.options.ecmaVersion === 6 && this.type !==
|
|
6312
|
-
},
|
|
6311
|
+
return this.next(), this.options.ecmaVersion === 6 && this.type !== z.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
6312
|
+
}, K.parseBindingAtom = function() {
|
|
6313
6313
|
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
6314
|
-
case
|
|
6314
|
+
case z.bracketL:
|
|
6315
6315
|
var e = this.startNode();
|
|
6316
|
-
return this.next(), e.elements = this.parseBindingList(
|
|
6317
|
-
case
|
|
6316
|
+
return this.next(), e.elements = this.parseBindingList(z.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
6317
|
+
case z.braceL: return this.parseObj(!0);
|
|
6318
6318
|
}
|
|
6319
6319
|
return this.parseIdent();
|
|
6320
|
-
},
|
|
6321
|
-
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(
|
|
6320
|
+
}, K.parseBindingList = function(e, t, n, r) {
|
|
6321
|
+
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(z.comma), t && this.type === z.comma) i.push(null);
|
|
6322
6322
|
else if (n && this.afterTrailingComma(e)) break;
|
|
6323
|
-
else if (this.type ===
|
|
6323
|
+
else if (this.type === z.ellipsis) {
|
|
6324
6324
|
var o = this.parseRestBinding();
|
|
6325
|
-
this.parseBindingListItem(o), i.push(o), this.type ===
|
|
6325
|
+
this.parseBindingListItem(o), i.push(o), this.type === z.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
6326
6326
|
break;
|
|
6327
6327
|
} else i.push(this.parseAssignableListItem(r));
|
|
6328
6328
|
return i;
|
|
6329
|
-
},
|
|
6329
|
+
}, K.parseAssignableListItem = function(e) {
|
|
6330
6330
|
var t = this.parseMaybeDefault(this.start, this.startLoc);
|
|
6331
6331
|
return this.parseBindingListItem(t), t;
|
|
6332
|
-
},
|
|
6332
|
+
}, K.parseBindingListItem = function(e) {
|
|
6333
6333
|
return e;
|
|
6334
|
-
},
|
|
6335
|
-
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(
|
|
6334
|
+
}, K.parseMaybeDefault = function(e, t, n) {
|
|
6335
|
+
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(z.eq)) return n;
|
|
6336
6336
|
var r = this.startNodeAt(e, t);
|
|
6337
6337
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
6338
|
-
},
|
|
6339
|
-
t === void 0 && (t =
|
|
6340
|
-
var r = t !==
|
|
6338
|
+
}, K.checkLValSimple = function(e, t, n) {
|
|
6339
|
+
t === void 0 && (t = la);
|
|
6340
|
+
var r = t !== la;
|
|
6341
6341
|
switch (e.type) {
|
|
6342
6342
|
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 ===
|
|
6343
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === da && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (Li(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== ma && this.declareName(e.name, t, e.start));
|
|
6344
6344
|
break;
|
|
6345
6345
|
case "ChainExpression":
|
|
6346
6346
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -6351,8 +6351,8 @@ q.toAssignable = function(e, t, n) {
|
|
|
6351
6351
|
case "ParenthesizedExpression": return r && this.raiseRecoverable(e.start, "Binding parenthesized expression"), this.checkLValSimple(e.expression, t, n);
|
|
6352
6352
|
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
6353
6353
|
}
|
|
6354
|
-
},
|
|
6355
|
-
switch (t === void 0 && (t =
|
|
6354
|
+
}, K.checkLValPattern = function(e, t, n) {
|
|
6355
|
+
switch (t === void 0 && (t = la), e.type) {
|
|
6356
6356
|
case "ObjectPattern":
|
|
6357
6357
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
6358
6358
|
var a = i[r];
|
|
@@ -6367,8 +6367,8 @@ q.toAssignable = function(e, t, n) {
|
|
|
6367
6367
|
break;
|
|
6368
6368
|
default: this.checkLValSimple(e, t, n);
|
|
6369
6369
|
}
|
|
6370
|
-
},
|
|
6371
|
-
switch (t === void 0 && (t =
|
|
6370
|
+
}, K.checkLValInnerPattern = function(e, t, n) {
|
|
6371
|
+
switch (t === void 0 && (t = la), e.type) {
|
|
6372
6372
|
case "Property":
|
|
6373
6373
|
this.checkLValInnerPattern(e.value, t, n);
|
|
6374
6374
|
break;
|
|
@@ -6381,29 +6381,29 @@ q.toAssignable = function(e, t, n) {
|
|
|
6381
6381
|
default: this.checkLValPattern(e, t, n);
|
|
6382
6382
|
}
|
|
6383
6383
|
};
|
|
6384
|
-
var
|
|
6384
|
+
var q = function(e, t, n, r, i) {
|
|
6385
6385
|
this.token = e, this.isExpr = !!t, this.preserveSpace = !!n, this.override = r, this.generator = !!i;
|
|
6386
6386
|
}, J = {
|
|
6387
|
-
b_stat: new
|
|
6388
|
-
b_expr: new
|
|
6389
|
-
b_tmpl: new
|
|
6390
|
-
p_stat: new
|
|
6391
|
-
p_expr: new
|
|
6392
|
-
q_tmpl: new
|
|
6387
|
+
b_stat: new q("{", !1),
|
|
6388
|
+
b_expr: new q("{", !0),
|
|
6389
|
+
b_tmpl: new q("${", !1),
|
|
6390
|
+
p_stat: new q("(", !1),
|
|
6391
|
+
p_expr: new q("(", !0),
|
|
6392
|
+
q_tmpl: new q("`", !0, !0, function(e) {
|
|
6393
6393
|
return e.tryReadTemplateToken();
|
|
6394
6394
|
}),
|
|
6395
|
-
f_stat: new
|
|
6396
|
-
f_expr: new
|
|
6397
|
-
f_expr_gen: new
|
|
6398
|
-
f_gen: new
|
|
6399
|
-
}, Ta =
|
|
6395
|
+
f_stat: new q("function", !1),
|
|
6396
|
+
f_expr: new q("function", !0),
|
|
6397
|
+
f_expr_gen: new q("function", !0, !1, null, !0),
|
|
6398
|
+
f_gen: new q("function", !1, !1, null, !0)
|
|
6399
|
+
}, Ta = H.prototype;
|
|
6400
6400
|
Ta.initialContext = function() {
|
|
6401
6401
|
return [J.b_stat];
|
|
6402
6402
|
}, Ta.curContext = function() {
|
|
6403
6403
|
return this.context[this.context.length - 1];
|
|
6404
6404
|
}, Ta.braceIsBlock = function(e) {
|
|
6405
6405
|
var t = this.curContext();
|
|
6406
|
-
return t === J.f_expr || t === J.f_stat ? !0 : e ===
|
|
6406
|
+
return t === J.f_expr || t === J.f_stat ? !0 : e === z.colon && (t === J.b_stat || t === J.b_expr) ? !t.isExpr : e === z._return || e === z.name && this.exprAllowed ? B.test(this.input.slice(this.lastTokEnd, this.start)) : e === z._else || e === z.semi || e === z.eof || e === z.parenR || e === z.arrow ? !0 : e === z.braceL ? t === J.b_stat : e === z._var || e === z._const || e === z.name ? !1 : !this.exprAllowed;
|
|
6407
6407
|
}, Ta.inGeneratorContext = function() {
|
|
6408
6408
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
6409
6409
|
var t = this.context[e];
|
|
@@ -6412,40 +6412,40 @@ Ta.initialContext = function() {
|
|
|
6412
6412
|
return !1;
|
|
6413
6413
|
}, Ta.updateContext = function(e) {
|
|
6414
6414
|
var t, n = this.type;
|
|
6415
|
-
n.keyword && e ===
|
|
6415
|
+
n.keyword && e === z.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
6416
6416
|
}, Ta.overrideContext = function(e) {
|
|
6417
6417
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
6418
|
-
},
|
|
6418
|
+
}, z.parenR.updateContext = z.braceR.updateContext = function() {
|
|
6419
6419
|
if (this.context.length === 1) {
|
|
6420
6420
|
this.exprAllowed = !0;
|
|
6421
6421
|
return;
|
|
6422
6422
|
}
|
|
6423
6423
|
var e = this.context.pop();
|
|
6424
6424
|
e === J.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
6425
|
-
},
|
|
6425
|
+
}, z.braceL.updateContext = function(e) {
|
|
6426
6426
|
this.context.push(this.braceIsBlock(e) ? J.b_stat : J.b_expr), this.exprAllowed = !0;
|
|
6427
|
-
},
|
|
6427
|
+
}, z.dollarBraceL.updateContext = function() {
|
|
6428
6428
|
this.context.push(J.b_tmpl), this.exprAllowed = !0;
|
|
6429
|
-
},
|
|
6430
|
-
var t = e ===
|
|
6429
|
+
}, z.parenL.updateContext = function(e) {
|
|
6430
|
+
var t = e === z._if || e === z._for || e === z._with || e === z._while;
|
|
6431
6431
|
this.context.push(t ? J.p_stat : J.p_expr), this.exprAllowed = !0;
|
|
6432
|
-
},
|
|
6433
|
-
e.beforeExpr && e !==
|
|
6434
|
-
},
|
|
6432
|
+
}, z.incDec.updateContext = function() {}, z._function.updateContext = z._class.updateContext = function(e) {
|
|
6433
|
+
e.beforeExpr && e !== z._else && (e !== z.semi || this.curContext() === J.p_stat) && !(e === z._return && B.test(this.input.slice(this.lastTokEnd, this.start))) && (e !== z.colon && e !== z.braceL || this.curContext() !== J.b_stat) ? this.context.push(J.f_expr) : this.context.push(J.f_stat), this.exprAllowed = !1;
|
|
6434
|
+
}, z.colon.updateContext = function() {
|
|
6435
6435
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
6436
|
-
},
|
|
6436
|
+
}, z.backQuote.updateContext = function() {
|
|
6437
6437
|
this.curContext() === J.q_tmpl ? this.context.pop() : this.context.push(J.q_tmpl), this.exprAllowed = !1;
|
|
6438
|
-
},
|
|
6439
|
-
if (e ===
|
|
6438
|
+
}, z.star.updateContext = function(e) {
|
|
6439
|
+
if (e === z._function) {
|
|
6440
6440
|
var t = this.context.length - 1;
|
|
6441
6441
|
this.context[t] === J.f_expr ? this.context[t] = J.f_expr_gen : this.context[t] = J.f_gen;
|
|
6442
6442
|
}
|
|
6443
6443
|
this.exprAllowed = !0;
|
|
6444
|
-
},
|
|
6444
|
+
}, z.name.updateContext = function(e) {
|
|
6445
6445
|
var t = !1;
|
|
6446
|
-
this.options.ecmaVersion >= 6 && e !==
|
|
6446
|
+
this.options.ecmaVersion >= 6 && e !== z.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
6447
6447
|
};
|
|
6448
|
-
var Y =
|
|
6448
|
+
var Y = H.prototype;
|
|
6449
6449
|
Y.checkPropClash = function(e, t, n) {
|
|
6450
6450
|
if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
|
|
6451
6451
|
var r = e.key, i;
|
|
@@ -6475,9 +6475,9 @@ Y.checkPropClash = function(e, t, n) {
|
|
|
6475
6475
|
var n = this;
|
|
6476
6476
|
return this.catchStackOverflow(function() {
|
|
6477
6477
|
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
6478
|
-
if (n.type ===
|
|
6478
|
+
if (n.type === z.comma) {
|
|
6479
6479
|
var o = n.startNodeAt(r, i);
|
|
6480
|
-
for (o.expressions = [a]; n.eat(
|
|
6480
|
+
for (o.expressions = [a]; n.eat(z.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
|
|
6481
6481
|
return n.finishNode(o, "SequenceExpression");
|
|
6482
6482
|
}
|
|
6483
6483
|
return a;
|
|
@@ -6488,21 +6488,21 @@ Y.checkPropClash = function(e, t, n) {
|
|
|
6488
6488
|
this.exprAllowed = !1;
|
|
6489
6489
|
}
|
|
6490
6490
|
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
|
|
6491
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new ga(), r = !0);
|
|
6492
6492
|
var s = this.start, c = this.startLoc;
|
|
6493
|
-
(this.type ===
|
|
6493
|
+
(this.type === z.parenL || this.type === z.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
6494
6494
|
var l = this.parseMaybeConditional(e, t);
|
|
6495
6495
|
if (n && (l = n.call(this, l, s, c)), this.type.isAssign) {
|
|
6496
6496
|
var u = this.startNodeAt(s, c);
|
|
6497
|
-
return u.operator = this.value, this.type ===
|
|
6497
|
+
return u.operator = this.value, this.type === z.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === z.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
6498
|
}
|
|
6499
6499
|
return r && this.checkExpressionErrors(t, !0), i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
6500
6500
|
}, Y.parseMaybeConditional = function(e, t) {
|
|
6501
6501
|
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
6502
6502
|
if (this.checkExpressionErrors(t)) return i;
|
|
6503
|
-
if ((i.type !== "ArrowFunctionExpression" || i.start !== n) && this.eat(
|
|
6503
|
+
if ((i.type !== "ArrowFunctionExpression" || i.start !== n) && this.eat(z.question)) {
|
|
6504
6504
|
var a = this.startNodeAt(n, r);
|
|
6505
|
-
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(
|
|
6505
|
+
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(z.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
6506
6506
|
}
|
|
6507
6507
|
return i;
|
|
6508
6508
|
}, Y.parseExprOps = function(e, t) {
|
|
@@ -6510,13 +6510,13 @@ Y.checkPropClash = function(e, t, n) {
|
|
|
6510
6510
|
return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
|
|
6511
6511
|
}, Y.parseExprOp = function(e, t, n, r, i) {
|
|
6512
6512
|
var a = this.type.binop;
|
|
6513
|
-
if (a != null && (!i || this.type !==
|
|
6514
|
-
var o = this.type ===
|
|
6515
|
-
s && (a =
|
|
6513
|
+
if (a != null && (!i || this.type !== z._in) && a > r) {
|
|
6514
|
+
var o = this.type === z.logicalOR || this.type === z.logicalAND, s = this.type === z.coalesce;
|
|
6515
|
+
s && (a = z.logicalAND.binop);
|
|
6516
6516
|
var c = this.value;
|
|
6517
6517
|
this.next();
|
|
6518
6518
|
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 ===
|
|
6519
|
+
return (o && this.type === z.coalesce || s && (this.type === z.logicalOR || this.type === z.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
6520
|
}
|
|
6521
6521
|
return e;
|
|
6522
6522
|
}, Y.buildBinary = function(e, t, n, r, i, a) {
|
|
@@ -6527,9 +6527,9 @@ Y.checkPropClash = function(e, t, n) {
|
|
|
6527
6527
|
var i = this.start, a = this.startLoc, o;
|
|
6528
6528
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
6529
6529
|
else if (this.type.prefix) {
|
|
6530
|
-
var s = this.startNode(), c = this.type ===
|
|
6530
|
+
var s = this.startNode(), c = this.type === z.incDec;
|
|
6531
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" && Ea(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && Da(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
|
|
6532
|
-
} else if (!t && this.type ===
|
|
6532
|
+
} else if (!t && this.type === z.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== z._in && this.unexpected();
|
|
6533
6533
|
else {
|
|
6534
6534
|
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
6535
6535
|
for (; this.type.postfix && !this.canInsertSemicolon();) {
|
|
@@ -6537,7 +6537,7 @@ Y.checkPropClash = function(e, t, n) {
|
|
|
6537
6537
|
l.operator = this.value, l.prefix = !1, l.argument = o, this.checkLValSimple(o), this.next(), o = this.finishNode(l, "UpdateExpression");
|
|
6538
6538
|
}
|
|
6539
6539
|
}
|
|
6540
|
-
if (!n && (o.type !== "ArrowFunctionExpression" || o.start !== i) && this.eat(
|
|
6540
|
+
if (!n && (o.type !== "ArrowFunctionExpression" || o.start !== i) && this.eat(z.starstar)) {
|
|
6541
6541
|
if (t) this.unexpected(this.lastTokStart);
|
|
6542
6542
|
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
6543
6543
|
} else return o;
|
|
@@ -6566,82 +6566,82 @@ Y.parseExprSubscripts = function(e, t) {
|
|
|
6566
6566
|
e = s;
|
|
6567
6567
|
}
|
|
6568
6568
|
}, Y.shouldParseAsyncArrow = function() {
|
|
6569
|
-
return !this.canInsertSemicolon() && this.eat(
|
|
6569
|
+
return !this.canInsertSemicolon() && this.eat(z.arrow);
|
|
6570
6570
|
}, Y.parseSubscriptAsyncArrow = function(e, t, n, r) {
|
|
6571
6571
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
|
|
6572
6572
|
}, Y.parseSubscript = function(e, t, n, r, i, a, o) {
|
|
6573
|
-
var s = this.options.ecmaVersion >= 11, c = s && this.eat(
|
|
6573
|
+
var s = this.options.ecmaVersion >= 11, c = s && this.eat(z.questionDot);
|
|
6574
6574
|
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 !==
|
|
6575
|
+
var l = this.eat(z.bracketL);
|
|
6576
|
+
if (l || c && this.type !== z.parenL && this.type !== z.backQuote || this.eat(z.dot)) {
|
|
6577
6577
|
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
|
|
6578
|
+
u.object = e, l ? (u.property = this.parseExpression(), this.expect(z.bracketR)) : u.property = this.type === z.privateId && e.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
6579
|
+
} else if (!r && this.eat(z.parenL)) {
|
|
6580
|
+
var d = new ga(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
6581
6581
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
6582
|
-
var h = this.parseExprList(
|
|
6582
|
+
var h = this.parseExprList(z.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
6583
6583
|
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
6584
|
this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
|
|
6585
6585
|
var g = this.startNodeAt(t, n);
|
|
6586
6586
|
g.callee = e, g.arguments = h, s && (g.optional = c), e = this.finishNode(g, "CallExpression");
|
|
6587
|
-
} else if (this.type ===
|
|
6587
|
+
} else if (this.type === z.backQuote) {
|
|
6588
6588
|
(c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
6589
6589
|
var _ = this.startNodeAt(t, n);
|
|
6590
6590
|
_.tag = e, _.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(_, "TaggedTemplateExpression");
|
|
6591
6591
|
}
|
|
6592
6592
|
return e;
|
|
6593
6593
|
}, Y.parseExprAtom = function(e, t, n) {
|
|
6594
|
-
this.type ===
|
|
6594
|
+
this.type === z.slash && this.readRegexp();
|
|
6595
6595
|
var r, i = this.potentialArrowAt === this.start;
|
|
6596
6596
|
switch (this.type) {
|
|
6597
|
-
case
|
|
6598
|
-
case
|
|
6599
|
-
case
|
|
6597
|
+
case z._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === z.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== z.dot && this.type !== z.bracketL && this.type !== z.parenL && this.unexpected(), this.finishNode(r, "Super");
|
|
6598
|
+
case z._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
6599
|
+
case z.name:
|
|
6600
6600
|
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(
|
|
6601
|
+
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(z._function)) return this.overrideContext(J.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
|
|
6602
6602
|
if (i && !this.canInsertSemicolon()) {
|
|
6603
|
-
if (this.eat(
|
|
6604
|
-
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type ===
|
|
6603
|
+
if (this.eat(z.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
|
|
6604
|
+
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === z.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(z.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
|
|
6605
6605
|
}
|
|
6606
6606
|
return c;
|
|
6607
|
-
case
|
|
6607
|
+
case z.regexp:
|
|
6608
6608
|
var l = this.value;
|
|
6609
6609
|
return r = this.parseLiteral(l.value), r.regex = {
|
|
6610
6610
|
pattern: l.pattern,
|
|
6611
6611
|
flags: l.flags
|
|
6612
6612
|
}, r;
|
|
6613
|
-
case
|
|
6614
|
-
case
|
|
6615
|
-
case
|
|
6616
|
-
case
|
|
6617
|
-
case
|
|
6618
|
-
case
|
|
6613
|
+
case z.num:
|
|
6614
|
+
case z.string: return this.parseLiteral(this.value);
|
|
6615
|
+
case z._null:
|
|
6616
|
+
case z._true:
|
|
6617
|
+
case z._false: return r = this.startNode(), r.value = this.type === z._null ? null : this.type === z._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
|
|
6618
|
+
case z.parenL:
|
|
6619
6619
|
var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
|
|
6620
6620
|
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
|
|
6621
|
+
case z.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(z.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
6622
|
+
case z.braceL: return this.overrideContext(J.b_expr), this.parseObj(!1, e);
|
|
6623
|
+
case z._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
6624
|
+
case z._class: return this.parseClass(this.startNode(), !1);
|
|
6625
|
+
case z._new: return this.parseNew();
|
|
6626
|
+
case z.backQuote: return this.parseTemplate();
|
|
6627
|
+
case z._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
|
|
6628
6628
|
default: return this.parseExprAtomDefault();
|
|
6629
6629
|
}
|
|
6630
6630
|
}, Y.parseExprAtomDefault = function() {
|
|
6631
6631
|
this.unexpected();
|
|
6632
6632
|
}, Y.parseExprImport = function(e) {
|
|
6633
6633
|
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 ===
|
|
6634
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === z.parenL && !e) return this.parseDynamicImport(t);
|
|
6635
|
+
if (this.type === z.dot) {
|
|
6636
6636
|
var n = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
6637
6637
|
return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
|
|
6638
6638
|
}
|
|
6639
6639
|
this.unexpected();
|
|
6640
6640
|
}, Y.parseDynamicImport = function(e) {
|
|
6641
|
-
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(
|
|
6642
|
-
else if (!this.eat(
|
|
6641
|
+
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(z.parenR) ? e.options = null : (this.expect(z.comma), this.afterTrailingComma(z.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(z.parenR) || (this.expect(z.comma), this.afterTrailingComma(z.parenR) || this.unexpected())));
|
|
6642
|
+
else if (!this.eat(z.parenR)) {
|
|
6643
6643
|
var t = this.start;
|
|
6644
|
-
this.eat(
|
|
6644
|
+
this.eat(z.comma) && this.eat(z.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
6645
6645
|
}
|
|
6646
6646
|
return this.finishNode(e, "ImportExpression");
|
|
6647
6647
|
}, Y.parseImportMeta = function(e) {
|
|
@@ -6652,29 +6652,29 @@ Y.parseExprSubscripts = function(e, t) {
|
|
|
6652
6652
|
var t = this.startNode();
|
|
6653
6653
|
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
6654
|
}, Y.parseParenExpression = function() {
|
|
6655
|
-
this.expect(
|
|
6655
|
+
this.expect(z.parenL);
|
|
6656
6656
|
var e = this.parseExpression();
|
|
6657
|
-
return this.expect(
|
|
6657
|
+
return this.expect(z.parenR), e;
|
|
6658
6658
|
}, Y.shouldParseArrow = function(e) {
|
|
6659
6659
|
return !this.canInsertSemicolon();
|
|
6660
6660
|
}, Y.parseParenAndDistinguishExpression = function(e, t) {
|
|
6661
6661
|
var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
|
|
6662
6662
|
if (this.options.ecmaVersion >= 6) {
|
|
6663
6663
|
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(
|
|
6664
|
+
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new ga(), f = this.yieldPos, p = this.awaitPos, m;
|
|
6665
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== z.parenR;) {
|
|
6666
|
+
if (l ? l = !1 : this.expect(z.comma), a && this.afterTrailingComma(z.parenR, !0)) {
|
|
6667
6667
|
u = !0;
|
|
6668
6668
|
break;
|
|
6669
6669
|
}
|
|
6670
|
-
if (this.type ===
|
|
6671
|
-
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type ===
|
|
6670
|
+
if (this.type === z.ellipsis) {
|
|
6671
|
+
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type === z.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
6672
6672
|
break;
|
|
6673
6673
|
}
|
|
6674
6674
|
c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
|
|
6675
6675
|
}
|
|
6676
6676
|
var h = this.lastTokEnd, g = this.lastTokEndLoc;
|
|
6677
|
-
if (this.expect(
|
|
6677
|
+
if (this.expect(z.parenR), e && this.shouldParseArrow(c) && this.eat(z.arrow)) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = f, this.awaitPos = p, this.parseParenArrowList(n, r, c, t);
|
|
6678
6678
|
(!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
6679
|
} else i = this.parseParenExpression();
|
|
6680
6680
|
if (this.options.preserveParens) {
|
|
@@ -6691,23 +6691,23 @@ var Oa = [];
|
|
|
6691
6691
|
Y.parseNew = function() {
|
|
6692
6692
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
6693
6693
|
var e = this.startNode();
|
|
6694
|
-
if (this.next(), this.options.ecmaVersion >= 6 && this.type ===
|
|
6694
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === z.dot) {
|
|
6695
6695
|
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
6696
6696
|
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
6697
6697
|
var n = this.containsEsc;
|
|
6698
6698
|
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
6699
|
}
|
|
6700
6700
|
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(
|
|
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(z.parenL) ? this.parseExprList(z.parenR, this.options.ecmaVersion >= 8, !1) : Oa, this.finishNode(e, "NewExpression");
|
|
6702
6702
|
}, Y.parseTemplateElement = function(e) {
|
|
6703
6703
|
var t = e.isTagged, n = this.startNode();
|
|
6704
|
-
return this.type ===
|
|
6704
|
+
return this.type === z.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
6705
6705
|
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
6706
6706
|
cooked: null
|
|
6707
6707
|
}) : n.value = {
|
|
6708
6708
|
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
|
|
6709
6709
|
cooked: this.value
|
|
6710
|
-
}, this.next(), n.tail = this.type ===
|
|
6710
|
+
}, this.next(), n.tail = this.type === z.backQuote, this.finishNode(n, "TemplateElement");
|
|
6711
6711
|
}, Y.parseTemplate = function(e) {
|
|
6712
6712
|
e === void 0 && (e = {});
|
|
6713
6713
|
var t = e.isTagged;
|
|
@@ -6715,25 +6715,25 @@ Y.parseNew = function() {
|
|
|
6715
6715
|
var n = this.startNode();
|
|
6716
6716
|
this.next(), n.expressions = [];
|
|
6717
6717
|
var r = this.parseTemplateElement({ isTagged: t });
|
|
6718
|
-
for (n.quasis = [r]; !r.tail;) this.type ===
|
|
6718
|
+
for (n.quasis = [r]; !r.tail;) this.type === z.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(z.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(z.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
6719
6719
|
return this.next(), this.finishNode(n, "TemplateLiteral");
|
|
6720
6720
|
}, Y.isAsyncProp = function(e) {
|
|
6721
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type ===
|
|
6721
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === z.name || this.type === z.num || this.type === z.string || this.type === z.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === z.star) && !B.test(this.input.slice(this.lastTokEnd, this.start));
|
|
6722
6722
|
}, Y.parseObj = function(e, t) {
|
|
6723
6723
|
var n = this.startNode(), r = !0, i = {};
|
|
6724
|
-
for (n.properties = [], this.next(); !this.eat(
|
|
6724
|
+
for (n.properties = [], this.next(); !this.eat(z.braceR);) {
|
|
6725
6725
|
if (r) r = !1;
|
|
6726
|
-
else if (this.expect(
|
|
6726
|
+
else if (this.expect(z.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(z.braceR)) break;
|
|
6727
6727
|
var a = this.parseProperty(e, t);
|
|
6728
6728
|
e || this.checkPropClash(a, i, t), n.properties.push(a);
|
|
6729
6729
|
}
|
|
6730
6730
|
return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
|
|
6731
6731
|
}, Y.parseProperty = function(e, t) {
|
|
6732
6732
|
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(
|
|
6733
|
+
if (this.options.ecmaVersion >= 9 && this.eat(z.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === z.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 === z.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
|
|
6734
|
+
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(z.star)));
|
|
6735
6735
|
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(
|
|
6736
|
+
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(z.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
|
|
6737
6737
|
}, Y.parseGetterSetter = function(e) {
|
|
6738
6738
|
var t = e.key.name;
|
|
6739
6739
|
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
@@ -6743,29 +6743,29 @@ Y.parseNew = function() {
|
|
|
6743
6743
|
e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
|
|
6744
6744
|
} else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
6745
6745
|
}, Y.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
|
|
6746
|
-
(n || r) && this.type ===
|
|
6746
|
+
(n || r) && this.type === z.colon && this.unexpected(), this.eat(z.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === z.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 !== z.comma && this.type !== z.braceR && this.type !== z.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 === z.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();
|
|
6747
6747
|
}, Y.parsePropertyName = function(e) {
|
|
6748
6748
|
if (this.options.ecmaVersion >= 6) {
|
|
6749
|
-
if (this.eat(
|
|
6749
|
+
if (this.eat(z.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(z.bracketR), e.key;
|
|
6750
6750
|
e.computed = !1;
|
|
6751
6751
|
}
|
|
6752
|
-
return e.key = this.type ===
|
|
6752
|
+
return e.key = this.type === z.num || this.type === z.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
6753
6753
|
}, Y.initFunction = function(e) {
|
|
6754
6754
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
6755
6755
|
}, Y.parseMethod = function(e, t, n) {
|
|
6756
6756
|
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(
|
|
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(ca(t, r.generator) | na | (n ? ra : 0)), this.expect(z.parenL), r.params = this.parseBindingList(z.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");
|
|
6758
6758
|
}, Y.parseArrowExpression = function(e, t, n, r) {
|
|
6759
6759
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
6760
|
-
return this.enterScope(
|
|
6760
|
+
return this.enterScope(ca(n, !1) | ea), 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");
|
|
6761
6761
|
}, Y.parseFunctionBody = function(e, t, n, r) {
|
|
6762
|
-
var i = t && this.type !==
|
|
6762
|
+
var i = t && this.type !== z.braceL, a = this.strict, o = !1;
|
|
6763
6763
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
6764
6764
|
else {
|
|
6765
6765
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
6766
6766
|
(!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
6767
|
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,
|
|
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, ma), e.body = this.parseBlock(!1, void 0, o && !a), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = c;
|
|
6769
6769
|
}
|
|
6770
6770
|
this.exitScope();
|
|
6771
6771
|
}, Y.isSimpleParamList = function(e) {
|
|
@@ -6774,47 +6774,47 @@ Y.parseNew = function() {
|
|
|
6774
6774
|
}, Y.checkParams = function(e, t) {
|
|
6775
6775
|
for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
|
|
6776
6776
|
var a = i[r];
|
|
6777
|
-
this.checkLValInnerPattern(a,
|
|
6777
|
+
this.checkLValInnerPattern(a, ua, t ? null : n);
|
|
6778
6778
|
}
|
|
6779
6779
|
}, Y.parseExprList = function(e, t, n, r) {
|
|
6780
6780
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
6781
6781
|
if (a) a = !1;
|
|
6782
|
-
else if (this.expect(
|
|
6782
|
+
else if (this.expect(z.comma), t && this.afterTrailingComma(e)) break;
|
|
6783
6783
|
var o = void 0;
|
|
6784
|
-
n && this.type ===
|
|
6784
|
+
n && this.type === z.comma ? o = null : this.type === z.ellipsis ? (o = this.parseSpread(r), r && this.type === z.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
|
|
6785
6785
|
}
|
|
6786
6786
|
return i;
|
|
6787
6787
|
}, Y.checkUnreserved = function(e) {
|
|
6788
6788
|
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 &
|
|
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 & sa) && 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"));
|
|
6790
6790
|
}, Y.parseIdent = function(e) {
|
|
6791
6791
|
var t = this.parseIdentNode();
|
|
6792
6792
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
6793
6793
|
}, Y.parseIdentNode = function() {
|
|
6794
6794
|
var e = this.startNode();
|
|
6795
|
-
return this.type ===
|
|
6795
|
+
return this.type === z.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 = z.name) : this.unexpected(), e;
|
|
6796
6796
|
}, Y.parsePrivateIdent = function() {
|
|
6797
6797
|
var e = this.startNode();
|
|
6798
|
-
return this.type ===
|
|
6798
|
+
return this.type === z.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;
|
|
6799
6799
|
}, Y.parseYield = function(e) {
|
|
6800
6800
|
this.yieldPos ||= this.start;
|
|
6801
6801
|
var t = this.startNode();
|
|
6802
|
-
return this.next(), this.type ===
|
|
6802
|
+
return this.next(), this.type === z.semi || this.canInsertSemicolon() || this.type !== z.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(z.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
6803
6803
|
}, Y.parseAwait = function(e) {
|
|
6804
6804
|
this.awaitPos ||= this.start;
|
|
6805
6805
|
var t = this.startNode();
|
|
6806
6806
|
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
6807
6807
|
};
|
|
6808
|
-
var ka =
|
|
6808
|
+
var ka = H.prototype;
|
|
6809
6809
|
ka.raise = function(e, t) {
|
|
6810
|
-
var n =
|
|
6810
|
+
var n = Gi(this.input, e);
|
|
6811
6811
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
6812
6812
|
var r = SyntaxError(t);
|
|
6813
6813
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
6814
6814
|
}, ka.raiseRecoverable = ka.raise, ka.curPosition = function() {
|
|
6815
|
-
if (this.options.locations) return new
|
|
6815
|
+
if (this.options.locations) return new Ui(this.curLine, this.pos - this.lineStart);
|
|
6816
6816
|
};
|
|
6817
|
-
var Aa =
|
|
6817
|
+
var Aa = H.prototype, ja = function(e) {
|
|
6818
6818
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
6819
6819
|
};
|
|
6820
6820
|
Aa.enterScope = function(e) {
|
|
@@ -6822,23 +6822,23 @@ Aa.enterScope = function(e) {
|
|
|
6822
6822
|
}, Aa.exitScope = function() {
|
|
6823
6823
|
this.scopeStack.pop();
|
|
6824
6824
|
}, Aa.treatFunctionsAsVarInScope = function(e) {
|
|
6825
|
-
return e.flags &
|
|
6825
|
+
return e.flags & Zi || !this.inModule && e.flags & Xi;
|
|
6826
6826
|
}, Aa.declareName = function(e, t, n) {
|
|
6827
6827
|
var r = !1;
|
|
6828
|
-
if (t ===
|
|
6828
|
+
if (t === da) {
|
|
6829
6829
|
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 ===
|
|
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 & Xi && delete this.undefinedExports[e];
|
|
6831
|
+
} else if (t === pa) this.currentScope().lexical.push(e);
|
|
6832
|
+
else if (t === fa) {
|
|
6833
6833
|
var a = this.currentScope();
|
|
6834
6834
|
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
6835
6835
|
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
6836
6836
|
var s = this.scopeStack[o];
|
|
6837
|
-
if (s.lexical.indexOf(e) > -1 && !(s.flags &
|
|
6837
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & ta && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
6838
6838
|
r = !0;
|
|
6839
6839
|
break;
|
|
6840
6840
|
}
|
|
6841
|
-
if (s.var.push(e), this.inModule && s.flags &
|
|
6841
|
+
if (s.var.push(e), this.inModule && s.flags & Xi && delete this.undefinedExports[e], s.flags & sa) break;
|
|
6842
6842
|
}
|
|
6843
6843
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
6844
6844
|
}, Aa.checkLocalExport = function(e) {
|
|
@@ -6848,17 +6848,17 @@ Aa.enterScope = function(e) {
|
|
|
6848
6848
|
}, Aa.currentVarScope = function() {
|
|
6849
6849
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
6850
6850
|
var t = this.scopeStack[e];
|
|
6851
|
-
if (t.flags & (
|
|
6851
|
+
if (t.flags & (sa | aa | ia)) return t;
|
|
6852
6852
|
}
|
|
6853
6853
|
}, Aa.currentThisScope = function() {
|
|
6854
6854
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
6855
6855
|
var t = this.scopeStack[e];
|
|
6856
|
-
if (t.flags & (
|
|
6856
|
+
if (t.flags & (sa | aa | ia) && !(t.flags & ea)) return t;
|
|
6857
6857
|
}
|
|
6858
6858
|
};
|
|
6859
6859
|
var Ma = function(e, t, n) {
|
|
6860
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
6861
|
-
}, Na =
|
|
6860
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new Wi(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
6861
|
+
}, Na = H.prototype;
|
|
6862
6862
|
Na.startNode = function() {
|
|
6863
6863
|
return new Ma(this, this.start, this.startLoc);
|
|
6864
6864
|
}, Na.startNodeAt = function(e, t) {
|
|
@@ -6900,11 +6900,11 @@ var Fa = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana
|
|
|
6900
6900
|
}, Xa = {};
|
|
6901
6901
|
function Za(e) {
|
|
6902
6902
|
var t = Xa[e] = {
|
|
6903
|
-
binary:
|
|
6904
|
-
binaryOfStrings:
|
|
6903
|
+
binary: Bi(Va[e] + " " + Ua),
|
|
6904
|
+
binaryOfStrings: Bi(Ha[e]),
|
|
6905
6905
|
nonBinary: {
|
|
6906
|
-
General_Category:
|
|
6907
|
-
Script:
|
|
6906
|
+
General_Category: Bi(Ua),
|
|
6907
|
+
Script: Bi(Ya[e])
|
|
6908
6908
|
}
|
|
6909
6909
|
};
|
|
6910
6910
|
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;
|
|
@@ -6920,7 +6920,7 @@ for (var Qa = 0, $a = [
|
|
|
6920
6920
|
var eo = $a[Qa];
|
|
6921
6921
|
Za(eo);
|
|
6922
6922
|
}
|
|
6923
|
-
var X =
|
|
6923
|
+
var X = H.prototype, to = function(e, t) {
|
|
6924
6924
|
this.parent = e, this.base = t || this;
|
|
6925
6925
|
};
|
|
6926
6926
|
to.prototype.separatedFrom = function(e) {
|
|
@@ -7063,7 +7063,7 @@ X.validateRegExpPattern = function(e) {
|
|
|
7063
7063
|
}
|
|
7064
7064
|
return !1;
|
|
7065
7065
|
}, X.regexp_eatModifiers = function(e) {
|
|
7066
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 && io(n);) t +=
|
|
7066
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && io(n);) t += Vi(n), e.advance();
|
|
7067
7067
|
return t;
|
|
7068
7068
|
};
|
|
7069
7069
|
function io(e) {
|
|
@@ -7104,7 +7104,7 @@ X.regexp_eatPatternCharacters = function(e) {
|
|
|
7104
7104
|
return !1;
|
|
7105
7105
|
}, X.regexp_eatRegExpIdentifierName = function(e) {
|
|
7106
7106
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
7107
|
-
for (e.lastStringValue +=
|
|
7107
|
+
for (e.lastStringValue += Vi(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += Vi(e.lastIntValue);
|
|
7108
7108
|
return !0;
|
|
7109
7109
|
}
|
|
7110
7110
|
return !1;
|
|
@@ -7113,14 +7113,14 @@ X.regexp_eatPatternCharacters = function(e) {
|
|
|
7113
7113
|
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), oo(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
7114
7114
|
};
|
|
7115
7115
|
function oo(e) {
|
|
7116
|
-
return
|
|
7116
|
+
return Di(e, !0) || e === 36 || e === 95;
|
|
7117
7117
|
}
|
|
7118
7118
|
X.regexp_eatRegExpIdentifierPart = function(e) {
|
|
7119
7119
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
7120
7120
|
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), so(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
7121
7121
|
};
|
|
7122
7122
|
function so(e) {
|
|
7123
|
-
return
|
|
7123
|
+
return Oi(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
7124
7124
|
}
|
|
7125
7125
|
X.regexp_eatAtomEscape = function(e) {
|
|
7126
7126
|
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);
|
|
@@ -7230,14 +7230,14 @@ X.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
7230
7230
|
}
|
|
7231
7231
|
return uo;
|
|
7232
7232
|
}, X.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
7233
|
-
|
|
7233
|
+
Li(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
7234
7234
|
}, X.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
7235
7235
|
if (e.unicodeProperties.binary.test(t)) return fo;
|
|
7236
7236
|
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return Z;
|
|
7237
7237
|
e.raise("Invalid property name");
|
|
7238
7238
|
}, X.regexp_eatUnicodePropertyName = function(e) {
|
|
7239
7239
|
var t = 0;
|
|
7240
|
-
for (e.lastStringValue = ""; mo(t = e.current());) e.lastStringValue +=
|
|
7240
|
+
for (e.lastStringValue = ""; mo(t = e.current());) e.lastStringValue += Vi(t), e.advance();
|
|
7241
7241
|
return e.lastStringValue !== "";
|
|
7242
7242
|
};
|
|
7243
7243
|
function mo(e) {
|
|
@@ -7245,7 +7245,7 @@ function mo(e) {
|
|
|
7245
7245
|
}
|
|
7246
7246
|
X.regexp_eatUnicodePropertyValue = function(e) {
|
|
7247
7247
|
var t = 0;
|
|
7248
|
-
for (e.lastStringValue = ""; ho(t = e.current());) e.lastStringValue +=
|
|
7248
|
+
for (e.lastStringValue = ""; ho(t = e.current());) e.lastStringValue += Vi(t), e.advance();
|
|
7249
7249
|
return e.lastStringValue !== "";
|
|
7250
7250
|
};
|
|
7251
7251
|
function ho(e) {
|
|
@@ -7429,8 +7429,8 @@ X.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
7429
7429
|
return !0;
|
|
7430
7430
|
};
|
|
7431
7431
|
var Co = function(e) {
|
|
7432
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
7433
|
-
}, Q =
|
|
7432
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new Wi(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
7433
|
+
}, Q = H.prototype;
|
|
7434
7434
|
Q.next = function(e) {
|
|
7435
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 Co(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
7436
7436
|
}, Q.getToken = function() {
|
|
@@ -7440,17 +7440,17 @@ Q.next = function(e) {
|
|
|
7440
7440
|
return { next: function() {
|
|
7441
7441
|
var t = e.getToken();
|
|
7442
7442
|
return {
|
|
7443
|
-
done: t.type ===
|
|
7443
|
+
done: t.type === z.eof,
|
|
7444
7444
|
value: t
|
|
7445
7445
|
};
|
|
7446
7446
|
} };
|
|
7447
7447
|
}), Q.nextToken = function() {
|
|
7448
7448
|
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(
|
|
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(z.eof);
|
|
7450
7450
|
if (e.override) return e.override(this);
|
|
7451
7451
|
this.readToken(this.fullCharCodeAtPos());
|
|
7452
7452
|
}, Q.readToken = function(e) {
|
|
7453
|
-
return
|
|
7453
|
+
return Di(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
7454
7454
|
}, Q.fullCharCodeAt = function(e) {
|
|
7455
7455
|
var t = this.input.charCodeAt(e);
|
|
7456
7456
|
if (t <= 55295 || t >= 56320) return t;
|
|
@@ -7460,10 +7460,10 @@ Q.next = function(e) {
|
|
|
7460
7460
|
return this.fullCharCodeAt(this.pos);
|
|
7461
7461
|
}, Q.skipBlockComment = function() {
|
|
7462
7462
|
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 =
|
|
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 = Mi(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
7464
7464
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
7465
7465
|
}, Q.skipLineComment = function(e) {
|
|
7466
|
-
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !
|
|
7466
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !ji(r);) r = this.input.charCodeAt(++this.pos);
|
|
7467
7467
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
7468
7468
|
}, Q.skipSpace = function() {
|
|
7469
7469
|
loop: for (; this.pos < this.input.length;) {
|
|
@@ -7490,7 +7490,7 @@ Q.next = function(e) {
|
|
|
7490
7490
|
default: break loop;
|
|
7491
7491
|
}
|
|
7492
7492
|
break;
|
|
7493
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
7493
|
+
default: if (e > 8 && e < 14 || e >= 5760 && Ni.test(String.fromCharCode(e))) ++this.pos;
|
|
7494
7494
|
else break loop;
|
|
7495
7495
|
}
|
|
7496
7496
|
}
|
|
@@ -7502,57 +7502,57 @@ Q.next = function(e) {
|
|
|
7502
7502
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
7503
7503
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
7504
7504
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
7505
|
-
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(
|
|
7505
|
+
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(z.ellipsis)) : (++this.pos, this.finishToken(z.dot));
|
|
7506
7506
|
}, Q.readToken_slash = function() {
|
|
7507
7507
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
7508
|
-
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(
|
|
7508
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(z.assign, 2) : this.finishOp(z.slash, 1);
|
|
7509
7509
|
}, Q.readToken_mult_modulo_exp = function(e) {
|
|
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 =
|
|
7510
|
+
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? z.star : z.modulo;
|
|
7511
|
+
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = z.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(z.assign, n + 1) : this.finishOp(r, n);
|
|
7512
7512
|
}, Q.readToken_pipe_amp = function(e) {
|
|
7513
7513
|
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(
|
|
7514
|
+
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(z.assign, 3) : this.finishOp(e === 124 ? z.logicalOR : z.logicalAND, 2) : t === 61 ? this.finishOp(z.assign, 2) : this.finishOp(e === 124 ? z.bitwiseOR : z.bitwiseAND, 1);
|
|
7515
7515
|
}, Q.readToken_caret = function() {
|
|
7516
|
-
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(
|
|
7516
|
+
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(z.assign, 2) : this.finishOp(z.bitwiseXOR, 1);
|
|
7517
7517
|
}, Q.readToken_plus_min = function(e) {
|
|
7518
7518
|
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 ||
|
|
7519
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || B.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(z.incDec, 2) : t === 61 ? this.finishOp(z.assign, 2) : this.finishOp(z.plusMin, 1);
|
|
7520
7520
|
}, Q.readToken_lt_gt = function(e) {
|
|
7521
7521
|
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(
|
|
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(z.assign, n + 1) : this.finishOp(z.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(z.relational, n));
|
|
7523
7523
|
}, Q.readToken_eq_excl = function(e) {
|
|
7524
7524
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
7525
|
-
return t === 61 ? this.finishOp(
|
|
7525
|
+
return t === 61 ? this.finishOp(z.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(z.arrow)) : this.finishOp(e === 61 ? z.eq : z.prefix, 1);
|
|
7526
7526
|
}, Q.readToken_question = function() {
|
|
7527
7527
|
var e = this.options.ecmaVersion;
|
|
7528
7528
|
if (e >= 11) {
|
|
7529
7529
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
7530
7530
|
if (t === 46) {
|
|
7531
7531
|
var n = this.input.charCodeAt(this.pos + 2);
|
|
7532
|
-
if (n < 48 || n > 57) return this.finishOp(
|
|
7532
|
+
if (n < 48 || n > 57) return this.finishOp(z.questionDot, 2);
|
|
7533
7533
|
}
|
|
7534
|
-
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
7534
|
+
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(z.assign, 3) : this.finishOp(z.coalesce, 2);
|
|
7535
7535
|
}
|
|
7536
|
-
return this.finishOp(
|
|
7536
|
+
return this.finishOp(z.question, 1);
|
|
7537
7537
|
}, Q.readToken_numberSign = function() {
|
|
7538
7538
|
var e = this.options.ecmaVersion, t = 35;
|
|
7539
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(),
|
|
7540
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
7539
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), Di(t, !0) || t === 92)) return this.finishToken(z.privateId, this.readWord1());
|
|
7540
|
+
this.raise(this.pos, "Unexpected character '" + Vi(t) + "'");
|
|
7541
7541
|
}, Q.getTokenFromCode = function(e) {
|
|
7542
7542
|
switch (e) {
|
|
7543
7543
|
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(
|
|
7544
|
+
case 40: return ++this.pos, this.finishToken(z.parenL);
|
|
7545
|
+
case 41: return ++this.pos, this.finishToken(z.parenR);
|
|
7546
|
+
case 59: return ++this.pos, this.finishToken(z.semi);
|
|
7547
|
+
case 44: return ++this.pos, this.finishToken(z.comma);
|
|
7548
|
+
case 91: return ++this.pos, this.finishToken(z.bracketL);
|
|
7549
|
+
case 93: return ++this.pos, this.finishToken(z.bracketR);
|
|
7550
|
+
case 123: return ++this.pos, this.finishToken(z.braceL);
|
|
7551
|
+
case 125: return ++this.pos, this.finishToken(z.braceR);
|
|
7552
|
+
case 58: return ++this.pos, this.finishToken(z.colon);
|
|
7553
7553
|
case 96:
|
|
7554
7554
|
if (this.options.ecmaVersion < 6) break;
|
|
7555
|
-
return ++this.pos, this.finishToken(
|
|
7555
|
+
return ++this.pos, this.finishToken(z.backQuote);
|
|
7556
7556
|
case 48:
|
|
7557
7557
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
7558
7558
|
if (t === 120 || t === 88) return this.readRadixNumber(16);
|
|
@@ -7584,10 +7584,10 @@ Q.next = function(e) {
|
|
|
7584
7584
|
case 61:
|
|
7585
7585
|
case 33: return this.readToken_eq_excl(e);
|
|
7586
7586
|
case 63: return this.readToken_question();
|
|
7587
|
-
case 126: return this.finishOp(
|
|
7587
|
+
case 126: return this.finishOp(z.prefix, 1);
|
|
7588
7588
|
case 35: return this.readToken_numberSign();
|
|
7589
7589
|
}
|
|
7590
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
7590
|
+
this.raise(this.pos, "Unexpected character '" + Vi(e) + "'");
|
|
7591
7591
|
}, Q.finishOp = function(e, t) {
|
|
7592
7592
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
7593
7593
|
return this.pos += t, this.finishToken(e, n);
|
|
@@ -7595,7 +7595,7 @@ Q.next = function(e) {
|
|
|
7595
7595
|
for (var e, t, n = this.pos;;) {
|
|
7596
7596
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
7597
7597
|
var r = this.input.charAt(this.pos);
|
|
7598
|
-
if (
|
|
7598
|
+
if (B.test(r) && this.raise(n, "Unterminated regular expression"), e) e = !1;
|
|
7599
7599
|
else {
|
|
7600
7600
|
if (r === "[") t = !0;
|
|
7601
7601
|
else if (r === "]" && t) t = !1;
|
|
@@ -7614,7 +7614,7 @@ Q.next = function(e) {
|
|
|
7614
7614
|
try {
|
|
7615
7615
|
c = new RegExp(i, o);
|
|
7616
7616
|
} catch {}
|
|
7617
|
-
return this.finishToken(
|
|
7617
|
+
return this.finishToken(z.regexp, {
|
|
7618
7618
|
pattern: i,
|
|
7619
7619
|
flags: o,
|
|
7620
7620
|
value: c
|
|
@@ -7641,7 +7641,7 @@ Q.readRadixNumber = function(e) {
|
|
|
7641
7641
|
var t = this.pos;
|
|
7642
7642
|
this.pos += 2;
|
|
7643
7643
|
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 = To(this.input.slice(t, this.pos)), ++this.pos) :
|
|
7644
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = To(this.input.slice(t, this.pos)), ++this.pos) : Di(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(z.num, n);
|
|
7645
7645
|
}, Q.readNumber = function(e) {
|
|
7646
7646
|
var t = this.pos;
|
|
7647
7647
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
@@ -7650,11 +7650,11 @@ Q.readRadixNumber = function(e) {
|
|
|
7650
7650
|
var r = this.input.charCodeAt(this.pos);
|
|
7651
7651
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
7652
7652
|
var i = To(this.input.slice(t, this.pos));
|
|
7653
|
-
return ++this.pos,
|
|
7653
|
+
return ++this.pos, Di(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(z.num, i);
|
|
7654
7654
|
}
|
|
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")),
|
|
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")), Di(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
7656
7656
|
var a = wo(this.input.slice(t, this.pos), n);
|
|
7657
|
-
return this.finishToken(
|
|
7657
|
+
return this.finishToken(z.num, a);
|
|
7658
7658
|
}, Q.readCodePoint = function() {
|
|
7659
7659
|
var e = this.input.charCodeAt(this.pos), t;
|
|
7660
7660
|
if (e === 123) {
|
|
@@ -7668,9 +7668,9 @@ Q.readRadixNumber = function(e) {
|
|
|
7668
7668
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
7669
7669
|
var r = this.input.charCodeAt(this.pos);
|
|
7670
7670
|
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)) : (
|
|
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)) : (ji(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
7672
7672
|
}
|
|
7673
|
-
return t += this.input.slice(n, this.pos++), this.finishToken(
|
|
7673
|
+
return t += this.input.slice(n, this.pos++), this.finishToken(z.string, t);
|
|
7674
7674
|
};
|
|
7675
7675
|
var Eo = {};
|
|
7676
7676
|
Q.tryReadTemplateToken = function() {
|
|
@@ -7689,9 +7689,9 @@ Q.tryReadTemplateToken = function() {
|
|
|
7689
7689
|
for (var e = "", t = this.pos;;) {
|
|
7690
7690
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
7691
7691
|
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 ===
|
|
7692
|
+
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === z.template || this.type === z.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(z.dollarBraceL)) : (++this.pos, this.finishToken(z.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(z.template, e));
|
|
7693
7693
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
7694
|
-
else if (
|
|
7694
|
+
else if (ji(n)) {
|
|
7695
7695
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
7696
7696
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
7697
7697
|
case 10:
|
|
@@ -7708,7 +7708,7 @@ Q.tryReadTemplateToken = function() {
|
|
|
7708
7708
|
++this.pos;
|
|
7709
7709
|
break;
|
|
7710
7710
|
case "$": if (this.input[this.pos + 1] !== "{") break;
|
|
7711
|
-
case "`": return this.finishToken(
|
|
7711
|
+
case "`": return this.finishToken(z.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
7712
7712
|
case "\r": this.input[this.pos + 1] === "\n" && ++this.pos;
|
|
7713
7713
|
case "\n":
|
|
7714
7714
|
case "\u2028":
|
|
@@ -7721,7 +7721,7 @@ Q.tryReadTemplateToken = function() {
|
|
|
7721
7721
|
case 110: return "\n";
|
|
7722
7722
|
case 114: return "\r";
|
|
7723
7723
|
case 120: return String.fromCharCode(this.readHexChar(2));
|
|
7724
|
-
case 117: return
|
|
7724
|
+
case 117: return Vi(this.readCodePoint());
|
|
7725
7725
|
case 116: return " ";
|
|
7726
7726
|
case 98: return "\b";
|
|
7727
7727
|
case 118: return "\v";
|
|
@@ -7738,7 +7738,7 @@ Q.tryReadTemplateToken = function() {
|
|
|
7738
7738
|
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
7739
7739
|
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
7740
|
}
|
|
7741
|
-
return
|
|
7741
|
+
return ji(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
7742
7742
|
}
|
|
7743
7743
|
}, Q.readHexChar = function(e) {
|
|
7744
7744
|
var t = this.pos, n = this.readInt(16, e);
|
|
@@ -7747,43 +7747,43 @@ Q.tryReadTemplateToken = function() {
|
|
|
7747
7747
|
this.containsEsc = !1;
|
|
7748
7748
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
7749
7749
|
var i = this.fullCharCodeAtPos();
|
|
7750
|
-
if (
|
|
7750
|
+
if (Oi(i, r)) this.pos += i <= 65535 ? 1 : 2;
|
|
7751
7751
|
else if (i === 92) {
|
|
7752
7752
|
this.containsEsc = !0, e += this.input.slice(n, this.pos);
|
|
7753
7753
|
var a = this.pos;
|
|
7754
7754
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
7755
7755
|
var o = this.readCodePoint();
|
|
7756
|
-
(t ?
|
|
7756
|
+
(t ? Di : Oi)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += Vi(o), n = this.pos;
|
|
7757
7757
|
} else break;
|
|
7758
7758
|
t = !1;
|
|
7759
7759
|
}
|
|
7760
7760
|
return e + this.input.slice(n, this.pos);
|
|
7761
7761
|
}, Q.readWord = function() {
|
|
7762
|
-
var e = this.readWord1(), t =
|
|
7763
|
-
return this.keywords.test(e) && (t =
|
|
7764
|
-
},
|
|
7765
|
-
Parser:
|
|
7762
|
+
var e = this.readWord1(), t = z.name;
|
|
7763
|
+
return this.keywords.test(e) && (t = ki[e]), this.finishToken(t, e);
|
|
7764
|
+
}, H.acorn = {
|
|
7765
|
+
Parser: H,
|
|
7766
7766
|
version: "8.18.0",
|
|
7767
|
-
defaultOptions:
|
|
7768
|
-
Position:
|
|
7769
|
-
SourceLocation:
|
|
7770
|
-
getLineInfo:
|
|
7767
|
+
defaultOptions: Ki,
|
|
7768
|
+
Position: Ui,
|
|
7769
|
+
SourceLocation: Wi,
|
|
7770
|
+
getLineInfo: Gi,
|
|
7771
7771
|
Node: Ma,
|
|
7772
|
-
TokenType:
|
|
7773
|
-
tokTypes:
|
|
7774
|
-
keywordTypes:
|
|
7775
|
-
TokContext:
|
|
7772
|
+
TokenType: P,
|
|
7773
|
+
tokTypes: z,
|
|
7774
|
+
keywordTypes: ki,
|
|
7775
|
+
TokContext: q,
|
|
7776
7776
|
tokContexts: J,
|
|
7777
|
-
isIdentifierChar:
|
|
7778
|
-
isIdentifierStart:
|
|
7777
|
+
isIdentifierChar: Oi,
|
|
7778
|
+
isIdentifierStart: Di,
|
|
7779
7779
|
Token: Co,
|
|
7780
|
-
isNewLine:
|
|
7781
|
-
lineBreak:
|
|
7782
|
-
lineBreakG:
|
|
7783
|
-
nonASCIIwhitespace:
|
|
7780
|
+
isNewLine: ji,
|
|
7781
|
+
lineBreak: B,
|
|
7782
|
+
lineBreakG: Ai,
|
|
7783
|
+
nonASCIIwhitespace: Ni
|
|
7784
7784
|
};
|
|
7785
7785
|
function Do(e, t, n) {
|
|
7786
|
-
return
|
|
7786
|
+
return H.parseExpressionAt(e, t, n);
|
|
7787
7787
|
}
|
|
7788
7788
|
//#endregion
|
|
7789
7789
|
//#region src/safe-eval.ts
|
|
@@ -7912,13 +7912,23 @@ var Oo = process.cwd(), ko = {
|
|
|
7912
7912
|
default: throw Error(`Security Guard Violation: AST Node type '${e.type}' is disallowed.`);
|
|
7913
7913
|
}
|
|
7914
7914
|
}
|
|
7915
|
-
}
|
|
7915
|
+
};
|
|
7916
|
+
//#endregion
|
|
7917
|
+
//#region src/preprocessors/github.ts
|
|
7918
|
+
function jo(e, t) {
|
|
7919
|
+
let n = t.replace(/[|\\{}()[\]^$+?.]/g, "\\$&").replace(/\*/g, ".*");
|
|
7920
|
+
return RegExp(`^${n}$`).test(e);
|
|
7921
|
+
}
|
|
7922
|
+
function Mo(e, t) {
|
|
7923
|
+
return (Array.isArray(t) ? t : [t]).includes(e);
|
|
7924
|
+
}
|
|
7925
|
+
var No = class {
|
|
7916
7926
|
name = "github";
|
|
7917
7927
|
parse(e, t, n) {
|
|
7918
|
-
let r = !
|
|
7919
|
-
if (n
|
|
7920
|
-
let e = "sha256=" + m.createHmac("sha256", n).update(t).digest("hex");
|
|
7921
|
-
r = m.timingSafeEqual(
|
|
7928
|
+
let r = !1, i = null, a = e["x-hub-signature-256"];
|
|
7929
|
+
if (n && a) {
|
|
7930
|
+
let e = "sha256=" + m.createHmac("sha256", n).update(t).digest("hex"), i = Buffer.from(a), o = Buffer.from(e);
|
|
7931
|
+
r = i.length === o.length && m.timingSafeEqual(i, o);
|
|
7922
7932
|
}
|
|
7923
7933
|
if (r) {
|
|
7924
7934
|
let n = JSON.parse(t.toString("utf-8")), r = e["x-github-event"] || "unknown", a = n.ref || "", o = a.includes("refs/heads") ? a.replace("refs/heads/", "") : "", s = a.includes("refs/tags") ? a.replace("refs/tags/", "") : "", [c, l] = (n.repository?.full_name || "").split("/");
|
|
@@ -7934,9 +7944,9 @@ var Oo = process.cwd(), ko = {
|
|
|
7934
7944
|
action: n.action,
|
|
7935
7945
|
raw: n,
|
|
7936
7946
|
changes: n.commits ? Array.from(new Set(n.commits.flatMap((e) => [
|
|
7937
|
-
...e.added,
|
|
7938
|
-
...e.removed,
|
|
7939
|
-
...e.modified
|
|
7947
|
+
...e.added || [],
|
|
7948
|
+
...e.removed || [],
|
|
7949
|
+
...e.modified || []
|
|
7940
7950
|
]))) : []
|
|
7941
7951
|
};
|
|
7942
7952
|
}
|
|
@@ -7945,13 +7955,25 @@ var Oo = process.cwd(), ko = {
|
|
|
7945
7955
|
inputs: i
|
|
7946
7956
|
};
|
|
7947
7957
|
}
|
|
7948
|
-
|
|
7958
|
+
filter(e, t) {
|
|
7959
|
+
let n = !0;
|
|
7960
|
+
if (t.events && !t.events.includes(e.event) && (n = !1), t.owner && !Mo(e.owner, t.owner) && (n = !1), t.repo && !Mo(e.repo, t.repo) && (n = !1), t.branches && !t.branches.some((t) => jo(e.branch, t)) && (n = !1), t.tag !== void 0 && !!e.tag !== t.tag && (n = !1), t.tags) try {
|
|
7961
|
+
t.tags.some((t) => new RegExp(t).test(e.tag)) || (n = !1);
|
|
7962
|
+
} catch {
|
|
7963
|
+
n = !1;
|
|
7964
|
+
}
|
|
7965
|
+
return t.paths && ((Array.isArray(e.changes) ? e.changes : []).some((e) => t.paths?.some((t) => jo(e, t))) || (n = !1)), {
|
|
7966
|
+
isValid: n,
|
|
7967
|
+
inputs: e
|
|
7968
|
+
};
|
|
7969
|
+
}
|
|
7970
|
+
}, Po = function(e, t) {
|
|
7949
7971
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
7950
7972
|
}, $;
|
|
7951
7973
|
(function(e) {
|
|
7952
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";
|
|
7953
7975
|
})($ ||= {});
|
|
7954
|
-
var
|
|
7976
|
+
var Fo = class {
|
|
7955
7977
|
constructor() {
|
|
7956
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 = {
|
|
7957
7979
|
http: 1,
|
|
@@ -8196,7 +8218,7 @@ var No = class {
|
|
|
8196
8218
|
var r = this._buffer.charAt(1);
|
|
8197
8219
|
if (r != "[" && r != "]" && r != "(") return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8198
8220
|
if (r == "[") {
|
|
8199
|
-
this._csi_regex ||=
|
|
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 "]));
|
|
8200
8222
|
let t = this._buffer.match(this._csi_regex);
|
|
8201
8223
|
if (t === null) return e.kind = $.Incomplete, e;
|
|
8202
8224
|
if (t[4]) return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
@@ -8207,7 +8229,7 @@ var No = class {
|
|
|
8207
8229
|
if (r == "]") {
|
|
8208
8230
|
if (t < 4) return e.kind = $.Incomplete, e;
|
|
8209
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;
|
|
8210
|
-
this._osc_st ||=
|
|
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;
|
|
8211
8233
|
{
|
|
8212
8234
|
let t = this._osc_st.exec(this._buffer);
|
|
8213
8235
|
if (t === null) return e.kind = $.Incomplete, e;
|
|
@@ -8218,7 +8240,7 @@ var No = class {
|
|
|
8218
8240
|
if (t === null) return e.kind = $.Incomplete, e;
|
|
8219
8241
|
if (t[3]) return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8220
8242
|
}
|
|
8221
|
-
this._osc_regex ||=
|
|
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 "]));
|
|
8222
8244
|
let n = this._buffer.match(this._osc_regex);
|
|
8223
8245
|
if (n === null) return e.kind = $.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
8224
8246
|
e.kind = $.OSCURL, e.url = n[1], e.text = n[2];
|
|
@@ -8303,20 +8325,20 @@ var No = class {
|
|
|
8303
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>`;
|
|
8304
8326
|
}
|
|
8305
8327
|
};
|
|
8306
|
-
function
|
|
8328
|
+
function Io(e, ...t) {
|
|
8307
8329
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
8308
8330
|
return new RegExp(n);
|
|
8309
8331
|
}
|
|
8310
|
-
function
|
|
8332
|
+
function Lo(e, ...t) {
|
|
8311
8333
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
8312
8334
|
return new RegExp(n, "g");
|
|
8313
8335
|
}
|
|
8314
|
-
var
|
|
8336
|
+
var Ro, zo, Bo, Vo = class {
|
|
8315
8337
|
name = "html";
|
|
8316
8338
|
outputDir;
|
|
8317
8339
|
ansiUp;
|
|
8318
8340
|
constructor(e) {
|
|
8319
|
-
this.outputDir = e.outputDir, this.ansiUp = new
|
|
8341
|
+
this.outputDir = e.outputDir, this.ansiUp = new Fo(), this.ansiUp.use_classes = !1;
|
|
8320
8342
|
}
|
|
8321
8343
|
async report(t) {
|
|
8322
8344
|
e.mkdirSync(this.outputDir, { recursive: !0 });
|
|
@@ -8399,28 +8421,28 @@ var Io, Lo, Ro, zo = class {
|
|
|
8399
8421
|
</body>
|
|
8400
8422
|
</html>`;
|
|
8401
8423
|
}
|
|
8402
|
-
},
|
|
8424
|
+
}, Ho = class e {
|
|
8403
8425
|
static async from(t) {
|
|
8404
|
-
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
|
|
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 fi(t);
|
|
8405
8427
|
for (let t of r) i.push(...await e.loadFile(t, a));
|
|
8406
8428
|
return i;
|
|
8407
8429
|
}
|
|
8408
8430
|
static loadFile(e, t) {
|
|
8409
8431
|
let n = [];
|
|
8410
8432
|
try {
|
|
8411
|
-
let r =
|
|
8433
|
+
let r = pi(t.resolve(e));
|
|
8412
8434
|
for (let t of r) {
|
|
8413
8435
|
if (typeof t.on != "object") {
|
|
8414
8436
|
console.error(`on: not defined in ${e}! Ignoring this workflow.`);
|
|
8415
8437
|
continue;
|
|
8416
8438
|
}
|
|
8417
|
-
let r = Object.keys(t.on)[0] || "generic";
|
|
8439
|
+
let r = Object.keys(t.on)[0] || "generic", i = t.on[r] || {};
|
|
8418
8440
|
n.push({
|
|
8419
8441
|
id: (t.id || t.name)?.toLowerCase().replace(/[^a-z0-9]/g, "-") ?? h(),
|
|
8420
8442
|
name: t.name,
|
|
8421
8443
|
on: {
|
|
8422
|
-
|
|
8423
|
-
|
|
8444
|
+
...i,
|
|
8445
|
+
provider: r
|
|
8424
8446
|
},
|
|
8425
8447
|
concurrency: t.concurrency,
|
|
8426
8448
|
steps: t.steps,
|
|
@@ -8432,7 +8454,7 @@ var Io, Lo, Ro, zo = class {
|
|
|
8432
8454
|
}
|
|
8433
8455
|
return n;
|
|
8434
8456
|
}
|
|
8435
|
-
},
|
|
8457
|
+
}, Uo = class e {
|
|
8436
8458
|
server;
|
|
8437
8459
|
preprocessors = /* @__PURE__ */ new Map();
|
|
8438
8460
|
workflows = [];
|
|
@@ -8444,9 +8466,9 @@ var Io, Lo, Ro, zo = class {
|
|
|
8444
8466
|
return new e(r).listen(n);
|
|
8445
8467
|
}
|
|
8446
8468
|
constructor(e) {
|
|
8447
|
-
this.queue = e.queue, this.secrets = e.secrets, this.adminToken = e.adminToken,
|
|
8469
|
+
this.queue = e.queue, this.secrets = e.secrets, this.adminToken = e.adminToken, Ho.from(e.config.workflows).then((t) => {
|
|
8448
8470
|
this.workflows = t, console.log(`✅ Loaded ${t.length} workflow(s) from ${e.config.workflows}`);
|
|
8449
|
-
}), this.registerPreprocessor(new
|
|
8471
|
+
}), this.registerPreprocessor(new No()), this.server = f.createServer((e, t) => this.handleRequest(e, t));
|
|
8450
8472
|
}
|
|
8451
8473
|
registerPreprocessor(e) {
|
|
8452
8474
|
this.preprocessors.set(e.name, e);
|
|
@@ -8524,6 +8546,11 @@ var Io, Lo, Ro, zo = class {
|
|
|
8524
8546
|
async matchWorkflows(e, t) {
|
|
8525
8547
|
for (let n of this.workflows) {
|
|
8526
8548
|
if (n.on.provider !== e) continue;
|
|
8549
|
+
let r = this.preprocessors.get(e);
|
|
8550
|
+
if (r?.filter && !r.filter(t, n.on).isValid) {
|
|
8551
|
+
console.log(`⏩ Skipped ${n.id} based on ${e} webhook filters`, { inputs: t });
|
|
8552
|
+
continue;
|
|
8553
|
+
}
|
|
8527
8554
|
if (n.on.if) try {
|
|
8528
8555
|
if (!await Ao.evaluateConditions(n.on.if, { inputs: t })) {
|
|
8529
8556
|
console.log(`⏩ Skipped ${n.id} based on conditions: ${n.on.if}`, { inputs: t });
|
|
@@ -8533,15 +8560,15 @@ var Io, Lo, Ro, zo = class {
|
|
|
8533
8560
|
console.error(`⚠️ Condition evaluation error in workflow [${n.id}]:`, e.message);
|
|
8534
8561
|
continue;
|
|
8535
8562
|
}
|
|
8536
|
-
let
|
|
8537
|
-
n.concurrency?.group && (
|
|
8538
|
-
let
|
|
8563
|
+
let i = "";
|
|
8564
|
+
n.concurrency?.group && (i = await Ao.evaluateValue(n.concurrency.group, { inputs: t }));
|
|
8565
|
+
let a = {
|
|
8539
8566
|
workflowId: n.id,
|
|
8540
8567
|
env: n.env,
|
|
8541
8568
|
steps: n.steps,
|
|
8542
8569
|
inputs: t
|
|
8543
8570
|
};
|
|
8544
|
-
await this.queue.enqueue(n.id,
|
|
8571
|
+
await this.queue.enqueue(n.id, a, i);
|
|
8545
8572
|
}
|
|
8546
8573
|
}
|
|
8547
8574
|
async handleSecretReload(e, t) {
|
|
@@ -8642,7 +8669,7 @@ var Io, Lo, Ro, zo = class {
|
|
|
8642
8669
|
...e,
|
|
8643
8670
|
logContent: i[e.id] || ""
|
|
8644
8671
|
}));
|
|
8645
|
-
let a = new
|
|
8672
|
+
let a = new Vo({ outputDir: "" }).generateHtml(r), o = this.secrets.redactText(a);
|
|
8646
8673
|
t.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }), t.end(o);
|
|
8647
8674
|
}
|
|
8648
8675
|
async handleRestartJob(e, t) {
|
|
@@ -8667,7 +8694,7 @@ var Io, Lo, Ro, zo = class {
|
|
|
8667
8694
|
});
|
|
8668
8695
|
});
|
|
8669
8696
|
}
|
|
8670
|
-
},
|
|
8697
|
+
}, Wo = d(v), Go = class {
|
|
8671
8698
|
name = "systemd";
|
|
8672
8699
|
async isSupported() {
|
|
8673
8700
|
try {
|
|
@@ -8790,7 +8817,7 @@ var Io, Lo, Ro, zo = class {
|
|
|
8790
8817
|
cancel: async () => {
|
|
8791
8818
|
d = !0;
|
|
8792
8819
|
try {
|
|
8793
|
-
t.image && await
|
|
8820
|
+
t.image && await Wo(`docker stop -t 2 ${o}`).catch(() => {}), await Wo(`systemctl stop ${o}.service`).catch(() => {});
|
|
8794
8821
|
} catch {}
|
|
8795
8822
|
},
|
|
8796
8823
|
logFilePath: i
|
|
@@ -8800,7 +8827,7 @@ var Io, Lo, Ro, zo = class {
|
|
|
8800
8827
|
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;
|
|
8801
8828
|
return t.slice(n, r);
|
|
8802
8829
|
}
|
|
8803
|
-
},
|
|
8830
|
+
}, Ko = class {
|
|
8804
8831
|
name = "standard-process";
|
|
8805
8832
|
async isSupported() {
|
|
8806
8833
|
return !0;
|
|
@@ -8915,13 +8942,13 @@ var Io, Lo, Ro, zo = class {
|
|
|
8915
8942
|
};
|
|
8916
8943
|
//#endregion
|
|
8917
8944
|
//#region src/drivers/index.ts
|
|
8918
|
-
async function
|
|
8919
|
-
let e = new
|
|
8920
|
-
return await e.isSupported() ? (console.log("⚡ Selected Execution Driver: Systemd (cgroups enabled)"), e) : (console.log("📦 Selected Execution Driver: Standard Process (Fallback)"), new
|
|
8945
|
+
async function qo() {
|
|
8946
|
+
let e = new Go();
|
|
8947
|
+
return await e.isSupported() ? (console.log("⚡ Selected Execution Driver: Systemd (cgroups enabled)"), e) : (console.log("📦 Selected Execution Driver: Standard Process (Fallback)"), new Ko());
|
|
8921
8948
|
}
|
|
8922
8949
|
//#endregion
|
|
8923
8950
|
//#region src/signals.ts
|
|
8924
|
-
async function
|
|
8951
|
+
async function Jo(e) {
|
|
8925
8952
|
let t = !1;
|
|
8926
8953
|
async function n(n) {
|
|
8927
8954
|
if (!t) {
|
|
@@ -8929,7 +8956,7 @@ async function Ko(e) {
|
|
|
8929
8956
|
console.error("⚠️ Graceful shutdown timed out after 10s. Forcing exit!"), process.exit(1);
|
|
8930
8957
|
}, 1e4).unref();
|
|
8931
8958
|
try {
|
|
8932
|
-
|
|
8959
|
+
Xo.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);
|
|
8933
8960
|
} catch (e) {
|
|
8934
8961
|
console.error("❌ Error during graceful shutdown:", e.message), process.exit(1);
|
|
8935
8962
|
}
|
|
@@ -8939,21 +8966,21 @@ async function Ko(e) {
|
|
|
8939
8966
|
}
|
|
8940
8967
|
//#endregion
|
|
8941
8968
|
//#region src/worker.ts
|
|
8942
|
-
var
|
|
8943
|
-
function
|
|
8944
|
-
|
|
8945
|
-
let i = Array.from({ length: e }, (e, i) =>
|
|
8946
|
-
return
|
|
8947
|
-
}
|
|
8948
|
-
async function
|
|
8949
|
-
let i = await
|
|
8950
|
-
for (console.log(`[${e}] 🚀 Worker started. Driver: ${i.name}`); !
|
|
8969
|
+
var Yo = !!process.env.DEBUG, Xo = { isStopping: !1 };
|
|
8970
|
+
function Zo(e, t, n, r) {
|
|
8971
|
+
Xo.isStopping = !1;
|
|
8972
|
+
let i = Array.from({ length: e }, (e, i) => Qo(`worker-${i + 1}`, t, n, r));
|
|
8973
|
+
return Jo(i), i;
|
|
8974
|
+
}
|
|
8975
|
+
async function Qo(e, t, n, r) {
|
|
8976
|
+
let i = await qo();
|
|
8977
|
+
for (console.log(`[${e}] 🚀 Worker started. Driver: ${i.name}`); !Xo.isStopping;) try {
|
|
8951
8978
|
let a = await t.claimNextJob();
|
|
8952
8979
|
if (!a) {
|
|
8953
8980
|
await new Promise((e) => setTimeout(e, 2e3));
|
|
8954
8981
|
continue;
|
|
8955
8982
|
}
|
|
8956
|
-
await
|
|
8983
|
+
await $o({
|
|
8957
8984
|
workerId: e,
|
|
8958
8985
|
job: a,
|
|
8959
8986
|
queue: t,
|
|
@@ -8966,7 +8993,7 @@ async function Xo(e, t, n, r) {
|
|
|
8966
8993
|
}
|
|
8967
8994
|
console.log(`[${e}] 🛑 Worker loop stopped cleanly.`);
|
|
8968
8995
|
}
|
|
8969
|
-
async function
|
|
8996
|
+
async function $o(e) {
|
|
8970
8997
|
let { workerId: t, job: n, config: r, secrets: i, queue: o } = e;
|
|
8971
8998
|
console.log(`\n[${t}] 📦 Claimed Job #${n.id} (Workflow: ${n.workflow_id})`);
|
|
8972
8999
|
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 = {
|
|
@@ -8976,22 +9003,22 @@ async function Zo(e) {
|
|
|
8976
9003
|
steps: {},
|
|
8977
9004
|
logsDir: f,
|
|
8978
9005
|
workingDir: p
|
|
8979
|
-
}, { cancelled: h, failed: g, stepReports: _ } = await
|
|
9006
|
+
}, { cancelled: h, failed: g, stepReports: _ } = await es({
|
|
8980
9007
|
payload: s,
|
|
8981
9008
|
steps: c,
|
|
8982
9009
|
executionContext: m,
|
|
8983
9010
|
...e
|
|
8984
9011
|
}), v = h ? "cancelled" : g ? "failed" : "success";
|
|
8985
9012
|
await o.finishJob(n.id, v), console.log(`[${t}] ✅ Job #${n.id} completed as: ${v}`);
|
|
8986
|
-
let y =
|
|
8987
|
-
await o.saveReport(n.id, y), await
|
|
9013
|
+
let y = os(n, v, u, l, m.env, _, s);
|
|
9014
|
+
await o.saveReport(n.id, y), await ss(t, r.reporters, y);
|
|
8988
9015
|
}
|
|
8989
|
-
async function
|
|
9016
|
+
async function es(e) {
|
|
8990
9017
|
let { driver: t, workerId: n, queue: r, config: i, job: a, payload: o, steps: s, executionContext: c } = e, l = [], u = !1, d = !1;
|
|
8991
9018
|
try {
|
|
8992
|
-
o.env && Object.assign(c.env, await
|
|
9019
|
+
o.env && Object.assign(c.env, await rs(o.env, c));
|
|
8993
9020
|
for (let e = 0; e < s.length; e++) {
|
|
8994
|
-
let o = s[e], f = await
|
|
9021
|
+
let o = s[e], f = await ts({
|
|
8995
9022
|
workerId: n,
|
|
8996
9023
|
jobId: a.id,
|
|
8997
9024
|
step: o,
|
|
@@ -9014,22 +9041,22 @@ async function Qo(e) {
|
|
|
9014
9041
|
} catch (e) {
|
|
9015
9042
|
console.log("🛑 Step failed", e), u = !0;
|
|
9016
9043
|
}
|
|
9017
|
-
return l.length < s.length &&
|
|
9044
|
+
return l.length < s.length && as(s, l.length, l), {
|
|
9018
9045
|
failed: u,
|
|
9019
9046
|
cancelled: d,
|
|
9020
9047
|
stepReports: l
|
|
9021
9048
|
};
|
|
9022
9049
|
}
|
|
9023
|
-
async function
|
|
9050
|
+
async function ts(e) {
|
|
9024
9051
|
let { step: t, stepIndex: n, executionContext: r } = e;
|
|
9025
|
-
if (t.id ||= `step-${n}`, t.name ||= t.id, t.if && !await Ao.evaluateConditions(t.if, r)) return
|
|
9052
|
+
if (t.id ||= `step-${n}`, t.name ||= t.id, t.if && !await Ao.evaluateConditions(t.if, r)) return Yo && console.log(`⏩ Skipped step ${t.id} based on condition: ${t.if}`, r), {
|
|
9026
9053
|
failed: !1,
|
|
9027
9054
|
cancelled: !1,
|
|
9028
9055
|
skipped: !0,
|
|
9029
9056
|
report: null
|
|
9030
9057
|
};
|
|
9031
9058
|
try {
|
|
9032
|
-
let n = await
|
|
9059
|
+
let n = await rs(t.env, r), i = {
|
|
9033
9060
|
jobId: String(e.jobId),
|
|
9034
9061
|
step: t,
|
|
9035
9062
|
command: t.run,
|
|
@@ -9043,15 +9070,15 @@ async function $o(e) {
|
|
|
9043
9070
|
WORKING_DIR: r.workingDir
|
|
9044
9071
|
}
|
|
9045
9072
|
};
|
|
9046
|
-
return t.eval ?
|
|
9073
|
+
return t.eval ? ns({
|
|
9047
9074
|
...e,
|
|
9048
9075
|
stepContext: i
|
|
9049
|
-
}) :
|
|
9076
|
+
}) : is({
|
|
9050
9077
|
...e,
|
|
9051
9078
|
stepContext: i
|
|
9052
9079
|
});
|
|
9053
9080
|
} catch (e) {
|
|
9054
|
-
return
|
|
9081
|
+
return Yo && console.error(`⏩ Failed to run step ${t.id}`, r, e), {
|
|
9055
9082
|
failed: !0,
|
|
9056
9083
|
cancelled: !1,
|
|
9057
9084
|
skipped: !1,
|
|
@@ -9059,7 +9086,7 @@ async function $o(e) {
|
|
|
9059
9086
|
};
|
|
9060
9087
|
}
|
|
9061
9088
|
}
|
|
9062
|
-
async function
|
|
9089
|
+
async function ns(e) {
|
|
9063
9090
|
let { queue: t, stepContext: n, executionContext: r } = e, { jobId: i, step: a } = n, o = Date.now(), s = a.id, c = a.name;
|
|
9064
9091
|
try {
|
|
9065
9092
|
let e = await Ao.evaluateExpression(a.eval, r);
|
|
@@ -9105,12 +9132,12 @@ async function es(e) {
|
|
|
9105
9132
|
};
|
|
9106
9133
|
}
|
|
9107
9134
|
}
|
|
9108
|
-
async function
|
|
9135
|
+
async function rs(e, t) {
|
|
9109
9136
|
let n = {};
|
|
9110
9137
|
if (e) for (let [r, i] of Object.entries(e)) n[r] = String(await Ao.evaluateValue(i, t));
|
|
9111
9138
|
return n;
|
|
9112
9139
|
}
|
|
9113
|
-
async function
|
|
9140
|
+
async function is(t) {
|
|
9114
9141
|
let { workerId: n, jobId: r, stepContext: i, executionContext: a, driver: o, queue: s } = t, { step: c } = i, l = c.id, u = c.name, d;
|
|
9115
9142
|
try {
|
|
9116
9143
|
d = o.execute(i);
|
|
@@ -9155,7 +9182,7 @@ async function ns(t) {
|
|
|
9155
9182
|
}
|
|
9156
9183
|
};
|
|
9157
9184
|
}
|
|
9158
|
-
function
|
|
9185
|
+
function as(e, t, n) {
|
|
9159
9186
|
for (let r = t; r < e.length; r++) {
|
|
9160
9187
|
let t = e[r], i = t.id || `step-${r}`;
|
|
9161
9188
|
n.push({
|
|
@@ -9169,7 +9196,7 @@ function rs(e, t, n) {
|
|
|
9169
9196
|
});
|
|
9170
9197
|
}
|
|
9171
9198
|
}
|
|
9172
|
-
function
|
|
9199
|
+
function os(e, t, n, r, i, a, o) {
|
|
9173
9200
|
return {
|
|
9174
9201
|
jobId: String(e.id),
|
|
9175
9202
|
parentId: String(e.parentId || ""),
|
|
@@ -9188,7 +9215,7 @@ function is(e, t, n, r, i, a, o) {
|
|
|
9188
9215
|
})
|
|
9189
9216
|
};
|
|
9190
9217
|
}
|
|
9191
|
-
async function
|
|
9218
|
+
async function ss(e, t = [], n) {
|
|
9192
9219
|
!Array.isArray(t) || t.length === 0 || (console.log(`[${e}] 📢 Dispatching execution report to ${t.length} reporter(s)...`), await Promise.allSettled(t.map(async (t) => {
|
|
9193
9220
|
try {
|
|
9194
9221
|
await t.report(n);
|
|
@@ -9199,7 +9226,7 @@ async function as(e, t = [], n) {
|
|
|
9199
9226
|
}
|
|
9200
9227
|
//#endregion
|
|
9201
9228
|
//#region src/reporters/json-file.reporter.ts
|
|
9202
|
-
var
|
|
9229
|
+
var cs = class {
|
|
9203
9230
|
name = "json-file";
|
|
9204
9231
|
outputDir;
|
|
9205
9232
|
constructor(e) {
|
|
@@ -9210,7 +9237,7 @@ var os = class {
|
|
|
9210
9237
|
let n = a.join(this.outputDir, `run-${t.jobId}.json`);
|
|
9211
9238
|
e.writeFileSync(n, JSON.stringify(t, null, 2), "utf-8"), console.log(`📊 Execution report saved to: ${n}`);
|
|
9212
9239
|
}
|
|
9213
|
-
},
|
|
9240
|
+
}, ls = class {
|
|
9214
9241
|
name = "slack";
|
|
9215
9242
|
webhookUrl = "";
|
|
9216
9243
|
token = "";
|
|
@@ -9237,21 +9264,21 @@ var os = class {
|
|
|
9237
9264
|
};
|
|
9238
9265
|
//#endregion
|
|
9239
9266
|
//#region src/index.ts
|
|
9240
|
-
function
|
|
9267
|
+
function us(e) {
|
|
9241
9268
|
console.log("🔍 Validating Workflows in:", e.workflows);
|
|
9242
|
-
let t = new
|
|
9269
|
+
let t = new fi(e.workflows), n = r(e.workflows).filter((e) => e.endsWith(".yml") || e.endsWith(".yaml"));
|
|
9243
9270
|
for (let e of n) {
|
|
9244
|
-
let n =
|
|
9271
|
+
let n = pi(t.resolve(e));
|
|
9245
9272
|
console.log(` ✅ ${e} -> Valid! (${n.length} job matrix variant(s) generated)`);
|
|
9246
9273
|
}
|
|
9247
9274
|
}
|
|
9248
|
-
async function
|
|
9275
|
+
async function ds() {
|
|
9249
9276
|
let { config: e, command: t } = await fe();
|
|
9250
|
-
if (e || process.exit(1), t === "validate") return
|
|
9251
|
-
let n = new
|
|
9277
|
+
if (e || process.exit(1), t === "validate") return us(e);
|
|
9278
|
+
let n = new hi("./.env"), r = new mi(process.env.WORKER_NAME || "cli");
|
|
9252
9279
|
switch (t) {
|
|
9253
9280
|
case "start-server":
|
|
9254
|
-
console.log("🌐 Starting Ingress Gateway..."), await r.init(), await
|
|
9281
|
+
console.log("🌐 Starting Ingress Gateway..."), await r.init(), await Uo.withPort({
|
|
9255
9282
|
config: e,
|
|
9256
9283
|
queue: r,
|
|
9257
9284
|
secrets: n,
|
|
@@ -9260,11 +9287,11 @@ async function ls() {
|
|
|
9260
9287
|
});
|
|
9261
9288
|
break;
|
|
9262
9289
|
case "start-workers":
|
|
9263
|
-
console.log(`⚙️ Starting ${e.workers} Worker Loop(s)...`), await r.init(),
|
|
9290
|
+
console.log(`⚙️ Starting ${e.workers} Worker Loop(s)...`), await r.init(), Zo(e.workers, r, n, e);
|
|
9264
9291
|
break;
|
|
9265
9292
|
default: console.error(`❌ Unknown command: '${t}'`), de(), process.exit(1);
|
|
9266
9293
|
}
|
|
9267
9294
|
}
|
|
9268
|
-
|
|
9295
|
+
ds().catch(console.error);
|
|
9269
9296
|
//#endregion
|
|
9270
|
-
export {
|
|
9297
|
+
export { Vo as HtmlReporter, cs as JsonFileReporter, ls as SlackReporter };
|