@datapos/datapos-development 0.3.396 → 0.3.397
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.
|
@@ -306,14 +306,14 @@ Defaulting to 2020, but this will stop working in the future.`)), e.ecmaVersion
|
|
|
306
306
|
return $e(e.onComment) && (e.onComment = xs(e, e.onComment)), e;
|
|
307
307
|
}
|
|
308
308
|
function xs(t, e) {
|
|
309
|
-
return function(s, a, o,
|
|
309
|
+
return function(s, a, o, f, d, v) {
|
|
310
310
|
var g = {
|
|
311
311
|
type: s ? "Block" : "Line",
|
|
312
312
|
value: a,
|
|
313
313
|
start: o,
|
|
314
|
-
end:
|
|
314
|
+
end: f
|
|
315
315
|
};
|
|
316
|
-
t.locations && (g.loc = new Gt(this, d, v)), t.ranges && (g.range = [o,
|
|
316
|
+
t.locations && (g.loc = new Gt(this, d, v)), t.ranges && (g.range = [o, f]), e.push(g);
|
|
317
317
|
};
|
|
318
318
|
}
|
|
319
319
|
var Ht = 1, Mt = 2, Ne = 4, ci = 8, Le = 16, pi = 32, he = 64, li = 128, It = 256, Kt = 512, ue = Ht | Mt | It;
|
|
@@ -324,8 +324,8 @@ var ie = 0, Re = 1, Tt = 2, fi = 3, di = 4, mi = 5, H = function(e, s, a) {
|
|
|
324
324
|
this.options = e = ys(e), this.sourceFile = e.sourceFile, this.keywords = kt(us[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
325
325
|
var o = "";
|
|
326
326
|
e.allowReserved !== !0 && (o = ve[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (o += " await")), this.reservedWords = kt(o);
|
|
327
|
-
var
|
|
328
|
-
this.reservedWordsStrict = kt(
|
|
327
|
+
var f = (o ? o + " " : "") + ve.strict;
|
|
328
|
+
this.reservedWordsStrict = kt(f), this.reservedWordsStrictBind = kt(f + " " + ve.strictBind), this.input = String(s), this.containsEsc = !1, a ? (this.pos = a, this.lineStart = this.input.lastIndexOf(`
|
|
329
329
|
`, a - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(Q).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = u.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 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(Ht), this.regexpState = null, this.privateNameStack = [];
|
|
330
330
|
}, mt = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
|
|
331
331
|
H.prototype.parse = function() {
|
|
@@ -471,8 +471,8 @@ w.parseTopLevel = function(t) {
|
|
|
471
471
|
}
|
|
472
472
|
if (this.inModule)
|
|
473
473
|
for (var a = 0, o = Object.keys(this.undefinedExports); a < o.length; a += 1) {
|
|
474
|
-
var
|
|
475
|
-
this.raiseRecoverable(this.undefinedExports[
|
|
474
|
+
var f = o[a];
|
|
475
|
+
this.raiseRecoverable(this.undefinedExports[f].start, "Export '" + f + "' is not defined");
|
|
476
476
|
}
|
|
477
477
|
return this.adaptDirectivePrologue(t.body), this.next(), t.sourceType = this.options.sourceType, this.finishNode(t, "Program");
|
|
478
478
|
};
|
|
@@ -493,8 +493,8 @@ w.isLet = function(t) {
|
|
|
493
493
|
++o;
|
|
494
494
|
if (a === 92 || a > 55295 && a < 56320)
|
|
495
495
|
return !0;
|
|
496
|
-
var
|
|
497
|
-
if (!cs.test(
|
|
496
|
+
var f = this.input.slice(s, o);
|
|
497
|
+
if (!cs.test(f))
|
|
498
498
|
return !0;
|
|
499
499
|
}
|
|
500
500
|
return !1;
|
|
@@ -514,8 +514,8 @@ w.isUsingKeyword = function(t, e) {
|
|
|
514
514
|
if (Q.test(this.input.slice(this.pos, a)))
|
|
515
515
|
return !1;
|
|
516
516
|
if (t) {
|
|
517
|
-
var o = a + 5,
|
|
518
|
-
if (this.input.slice(a, o) !== "using" || o === this.input.length || vt(
|
|
517
|
+
var o = a + 5, f;
|
|
518
|
+
if (this.input.slice(a, o) !== "using" || o === this.input.length || vt(f = this.input.charCodeAt(o)) || f > 55295 && f < 56320)
|
|
519
519
|
return !1;
|
|
520
520
|
W.lastIndex = o;
|
|
521
521
|
var d = W.exec(this.input);
|
|
@@ -537,8 +537,8 @@ w.isUsing = function(t) {
|
|
|
537
537
|
return this.isUsingKeyword(!1, t);
|
|
538
538
|
};
|
|
539
539
|
w.parseStatement = function(t, e, s) {
|
|
540
|
-
var a = this.type, o = this.startNode(),
|
|
541
|
-
switch (this.isLet(t) && (a = u._var,
|
|
540
|
+
var a = this.type, o = this.startNode(), f;
|
|
541
|
+
switch (this.isLet(t) && (a = u._var, f = "let"), a) {
|
|
542
542
|
case u._break:
|
|
543
543
|
case u._continue:
|
|
544
544
|
return this.parseBreakContinueStatement(o, a.keyword);
|
|
@@ -564,7 +564,7 @@ w.parseStatement = function(t, e, s) {
|
|
|
564
564
|
return this.parseTryStatement(o);
|
|
565
565
|
case u._const:
|
|
566
566
|
case u._var:
|
|
567
|
-
return
|
|
567
|
+
return f = f || this.value, t && f !== "var" && this.unexpected(), this.parseVarStatement(o, f);
|
|
568
568
|
case u._while:
|
|
569
569
|
return this.parseWhileStatement(o);
|
|
570
570
|
case u._with:
|
|
@@ -623,13 +623,13 @@ w.parseForStatement = function(t) {
|
|
|
623
623
|
var a = this.startNode(), o = s ? "let" : this.value;
|
|
624
624
|
return this.next(), this.parseVar(a, !0, o), this.finishNode(a, "VariableDeclaration"), this.parseForAfterInit(t, a, e);
|
|
625
625
|
}
|
|
626
|
-
var
|
|
626
|
+
var f = this.isContextual("let"), d = !1, v = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
627
627
|
if (v) {
|
|
628
628
|
var g = this.startNode();
|
|
629
629
|
return this.next(), v === "await using" && this.next(), this.parseVar(g, !0, v), this.finishNode(g, "VariableDeclaration"), this.parseForAfterInit(t, g, e);
|
|
630
630
|
}
|
|
631
631
|
var h = this.containsEsc, P = new ce(), N = this.start, B = e > -1 ? this.parseExprSubscripts(P, "await") : this.parseExpression(!0, P);
|
|
632
|
-
return this.type === u._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === u._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (B.start === N && !h && B.type === "Identifier" && B.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (t.await = !1)),
|
|
632
|
+
return this.type === u._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === u._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (B.start === N && !h && B.type === "Identifier" && B.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (t.await = !1)), f && d && this.raise(B.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(B, !1, P), this.checkLValPattern(B), this.parseForIn(t, B)) : (this.checkExpressionErrors(P, !0), e > -1 && this.unexpected(e), this.parseFor(t, B));
|
|
633
633
|
};
|
|
634
634
|
w.parseForAfterInit = function(t, e, s) {
|
|
635
635
|
return (this.type === u._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && e.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === u._in ? s > -1 && this.unexpected(s) : t.await = s > -1), this.parseForIn(t, e)) : (s > -1 && this.unexpected(s), this.parseFor(t, e));
|
|
@@ -681,8 +681,8 @@ w.parseEmptyStatement = function(t) {
|
|
|
681
681
|
return this.next(), this.finishNode(t, "EmptyStatement");
|
|
682
682
|
};
|
|
683
683
|
w.parseLabeledStatement = function(t, e, s, a) {
|
|
684
|
-
for (var o = 0,
|
|
685
|
-
var d =
|
|
684
|
+
for (var o = 0, f = this.labels; o < f.length; o += 1) {
|
|
685
|
+
var d = f[o];
|
|
686
686
|
d.name === e && this.raise(s.start, "Label '" + e + "' is already declared");
|
|
687
687
|
}
|
|
688
688
|
for (var v = this.type.isLoop ? "loop" : this.type === u._switch ? "switch" : null, g = this.labels.length - 1; g >= 0; g--) {
|
|
@@ -728,8 +728,8 @@ w.parseVarId = function(t, e) {
|
|
|
728
728
|
var Ut = 1, Ce = 2, yi = 4;
|
|
729
729
|
w.parseFunction = function(t, e, s, a, o) {
|
|
730
730
|
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === u.star && e & Ce && this.unexpected(), t.generator = this.eat(u.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e & Ut && (t.id = e & yi && this.type !== u.name ? null : this.parseIdent(), t.id && !(e & Ce) && this.checkLValSimple(t.id, this.strict || t.generator || t.async ? this.treatFunctionsAsVar ? Re : Tt : fi));
|
|
731
|
-
var
|
|
732
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(t.async, t.generator)), e & Ut || (t.id = this.type === u.name ? this.parseIdent() : null), this.parseFunctionParams(t), this.parseFunctionBody(t, s, !1, o), this.yieldPos =
|
|
731
|
+
var f = this.yieldPos, d = this.awaitPos, v = this.awaitIdentPos;
|
|
732
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(t.async, t.generator)), e & Ut || (t.id = this.type === u.name ? this.parseIdent() : null), this.parseFunctionParams(t), this.parseFunctionBody(t, s, !1, o), this.yieldPos = f, this.awaitPos = d, this.awaitIdentPos = v, this.finishNode(t, e & Ut ? "FunctionDeclaration" : "FunctionExpression");
|
|
733
733
|
};
|
|
734
734
|
w.parseFunctionParams = function(t) {
|
|
735
735
|
this.expect(u.parenL), t.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
@@ -738,29 +738,29 @@ w.parseClass = function(t, e) {
|
|
|
738
738
|
this.next();
|
|
739
739
|
var s = this.strict;
|
|
740
740
|
this.strict = !0, this.parseClassId(t, e), this.parseClassSuper(t);
|
|
741
|
-
var a = this.enterClassBody(), o = this.startNode(),
|
|
741
|
+
var a = this.enterClassBody(), o = this.startNode(), f = !1;
|
|
742
742
|
for (o.body = [], this.expect(u.braceL); this.type !== u.braceR; ) {
|
|
743
743
|
var d = this.parseClassElement(t.superClass !== null);
|
|
744
|
-
d && (o.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (
|
|
744
|
+
d && (o.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (f && this.raiseRecoverable(d.start, "Duplicate constructor in the same class"), f = !0) : d.key && d.key.type === "PrivateIdentifier" && Ts(a, d) && this.raiseRecoverable(d.key.start, "Identifier '#" + d.key.name + "' has already been declared"));
|
|
745
745
|
}
|
|
746
746
|
return this.strict = s, this.next(), t.body = this.finishNode(o, "ClassBody"), this.exitClassBody(), this.finishNode(t, e ? "ClassDeclaration" : "ClassExpression");
|
|
747
747
|
};
|
|
748
748
|
w.parseClassElement = function(t) {
|
|
749
749
|
if (this.eat(u.semi))
|
|
750
750
|
return null;
|
|
751
|
-
var e = this.options.ecmaVersion, s = this.startNode(), a = "", o = !1,
|
|
751
|
+
var e = this.options.ecmaVersion, s = this.startNode(), a = "", o = !1, f = !1, d = "method", v = !1;
|
|
752
752
|
if (this.eatContextual("static")) {
|
|
753
753
|
if (e >= 13 && this.eat(u.braceL))
|
|
754
754
|
return this.parseClassStaticBlock(s), s;
|
|
755
755
|
this.isClassElementNameStart() || this.type === u.star ? v = !0 : a = "static";
|
|
756
756
|
}
|
|
757
|
-
if (s.static = v, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === u.star) && !this.canInsertSemicolon() ?
|
|
757
|
+
if (s.static = v, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === u.star) && !this.canInsertSemicolon() ? f = !0 : a = "async"), !a && (e >= 9 || !f) && this.eat(u.star) && (o = !0), !a && !f && !o) {
|
|
758
758
|
var g = this.value;
|
|
759
759
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? d = g : a = g);
|
|
760
760
|
}
|
|
761
|
-
if (a ? (s.computed = !1, s.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), s.key.name = a, this.finishNode(s.key, "Identifier")) : this.parseClassElementName(s), e < 13 || this.type === u.parenL || d !== "method" || o ||
|
|
761
|
+
if (a ? (s.computed = !1, s.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), s.key.name = a, this.finishNode(s.key, "Identifier")) : this.parseClassElementName(s), e < 13 || this.type === u.parenL || d !== "method" || o || f) {
|
|
762
762
|
var h = !s.static && se(s, "constructor"), P = h && t;
|
|
763
|
-
h && d !== "method" && this.raise(s.key.start, "Constructor can't have get/set modifier"), s.kind = h ? "constructor" : d, this.parseClassMethod(s, o,
|
|
763
|
+
h && d !== "method" && this.raise(s.key.start, "Constructor can't have get/set modifier"), s.kind = h ? "constructor" : d, this.parseClassMethod(s, o, f, P);
|
|
764
764
|
} else
|
|
765
765
|
this.parseClassField(s);
|
|
766
766
|
return s;
|
|
@@ -774,8 +774,8 @@ w.parseClassElementName = function(t) {
|
|
|
774
774
|
w.parseClassMethod = function(t, e, s, a) {
|
|
775
775
|
var o = t.key;
|
|
776
776
|
t.kind === "constructor" ? (e && this.raise(o.start, "Constructor can't be a generator"), s && this.raise(o.start, "Constructor can't be an async method")) : t.static && se(t, "prototype") && this.raise(o.start, "Classes may not have a static property named prototype");
|
|
777
|
-
var
|
|
778
|
-
return t.kind === "get" &&
|
|
777
|
+
var f = t.value = this.parseMethod(e, s, a);
|
|
778
|
+
return t.kind === "get" && f.params.length !== 0 && this.raiseRecoverable(f.start, "getter should have no params"), t.kind === "set" && f.params.length !== 1 && this.raiseRecoverable(f.start, "setter should have exactly one param"), t.kind === "set" && f.params[0].type === "RestElement" && this.raiseRecoverable(f.params[0].start, "Setter cannot use rest params"), this.finishNode(t, "MethodDefinition");
|
|
779
779
|
};
|
|
780
780
|
w.parseClassField = function(t) {
|
|
781
781
|
return se(t, "constructor") ? this.raise(t.key.start, "Classes can't have a field named 'constructor'") : t.static && se(t, "prototype") && this.raise(t.key.start, "Classes can't have a static field named 'prototype'"), this.eat(u.eq) ? (this.enterScope(Kt | he), t.value = this.parseMaybeAssign(), this.exitScope()) : t.value = null, this.semicolon(), this.finishNode(t, "PropertyDefinition");
|
|
@@ -802,8 +802,8 @@ w.enterClassBody = function() {
|
|
|
802
802
|
w.exitClassBody = function() {
|
|
803
803
|
var t = this.privateNameStack.pop(), e = t.declared, s = t.used;
|
|
804
804
|
if (this.options.checkPrivateFields)
|
|
805
|
-
for (var a = this.privateNameStack.length, o = a === 0 ? null : this.privateNameStack[a - 1],
|
|
806
|
-
var d = s[
|
|
805
|
+
for (var a = this.privateNameStack.length, o = a === 0 ? null : this.privateNameStack[a - 1], f = 0; f < s.length; ++f) {
|
|
806
|
+
var d = s[f];
|
|
807
807
|
Rt(e, d.name) || (o ? o.used.push(d) : this.raiseRecoverable(d.start, "Private field '#" + d.name + "' must be declared in an enclosing class"));
|
|
808
808
|
}
|
|
809
809
|
};
|
|
@@ -864,8 +864,8 @@ w.checkPatternExport = function(t, e) {
|
|
|
864
864
|
this.checkExport(t, e, e.start);
|
|
865
865
|
else if (s === "ObjectPattern")
|
|
866
866
|
for (var a = 0, o = e.properties; a < o.length; a += 1) {
|
|
867
|
-
var
|
|
868
|
-
this.checkPatternExport(t,
|
|
867
|
+
var f = o[a];
|
|
868
|
+
this.checkPatternExport(t, f);
|
|
869
869
|
}
|
|
870
870
|
else if (s === "ArrayPattern")
|
|
871
871
|
for (var d = 0, v = e.elements; d < v.length; d += 1) {
|
|
@@ -982,8 +982,8 @@ pt.toAssignable = function(t, e, s) {
|
|
|
982
982
|
case "ObjectExpression":
|
|
983
983
|
t.type = "ObjectPattern", s && this.checkPatternErrors(s, !0);
|
|
984
984
|
for (var a = 0, o = t.properties; a < o.length; a += 1) {
|
|
985
|
-
var
|
|
986
|
-
this.toAssignable(
|
|
985
|
+
var f = o[a];
|
|
986
|
+
this.toAssignable(f, e), f.type === "RestElement" && (f.argument.type === "ArrayPattern" || f.argument.type === "ObjectPattern") && this.raise(f.argument.start, "Unexpected token");
|
|
987
987
|
}
|
|
988
988
|
break;
|
|
989
989
|
case "Property":
|
|
@@ -1019,8 +1019,8 @@ pt.toAssignableList = function(t, e) {
|
|
|
1019
1019
|
o && this.toAssignable(o, e);
|
|
1020
1020
|
}
|
|
1021
1021
|
if (s) {
|
|
1022
|
-
var
|
|
1023
|
-
this.options.ecmaVersion === 6 && e &&
|
|
1022
|
+
var f = t[s - 1];
|
|
1023
|
+
this.options.ecmaVersion === 6 && e && f && f.type === "RestElement" && f.argument.type !== "Identifier" && this.unexpected(f.argument.start);
|
|
1024
1024
|
}
|
|
1025
1025
|
return t;
|
|
1026
1026
|
};
|
|
@@ -1044,8 +1044,8 @@ pt.parseBindingAtom = function() {
|
|
|
1044
1044
|
return this.parseIdent();
|
|
1045
1045
|
};
|
|
1046
1046
|
pt.parseBindingList = function(t, e, s, a) {
|
|
1047
|
-
for (var o = [],
|
|
1048
|
-
if (
|
|
1047
|
+
for (var o = [], f = !0; !this.eat(t); )
|
|
1048
|
+
if (f ? f = !1 : this.expect(u.comma), e && this.type === u.comma)
|
|
1049
1049
|
o.push(null);
|
|
1050
1050
|
else {
|
|
1051
1051
|
if (s && this.afterTrailingComma(t))
|
|
@@ -1095,8 +1095,8 @@ pt.checkLValPattern = function(t, e, s) {
|
|
|
1095
1095
|
switch (e === void 0 && (e = ie), t.type) {
|
|
1096
1096
|
case "ObjectPattern":
|
|
1097
1097
|
for (var a = 0, o = t.properties; a < o.length; a += 1) {
|
|
1098
|
-
var
|
|
1099
|
-
this.checkLValInnerPattern(
|
|
1098
|
+
var f = o[a];
|
|
1099
|
+
this.checkLValInnerPattern(f, e, s);
|
|
1100
1100
|
}
|
|
1101
1101
|
break;
|
|
1102
1102
|
case "ArrayPattern":
|
|
@@ -1124,8 +1124,8 @@ pt.checkLValInnerPattern = function(t, e, s) {
|
|
|
1124
1124
|
this.checkLValPattern(t, e, s);
|
|
1125
1125
|
}
|
|
1126
1126
|
};
|
|
1127
|
-
var X = function(e, s, a, o,
|
|
1128
|
-
this.token = e, this.isExpr = !!s, this.preserveSpace = !!a, this.override = o, this.generator = !!
|
|
1127
|
+
var X = function(e, s, a, o, f) {
|
|
1128
|
+
this.token = e, this.isExpr = !!s, this.preserveSpace = !!a, this.override = o, this.generator = !!f;
|
|
1129
1129
|
}, F = {
|
|
1130
1130
|
b_stat: new X("{", !1),
|
|
1131
1131
|
b_expr: new X("{", !0),
|
|
@@ -1219,32 +1219,32 @@ _.checkPropClash = function(t, e, s) {
|
|
|
1219
1219
|
default:
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
|
-
var
|
|
1222
|
+
var f = t.kind;
|
|
1223
1223
|
if (this.options.ecmaVersion >= 6) {
|
|
1224
|
-
o === "__proto__" &&
|
|
1224
|
+
o === "__proto__" && f === "init" && (e.proto && (s ? s.doubleProto < 0 && (s.doubleProto = a.start) : this.raiseRecoverable(a.start, "Redefinition of __proto__ property")), e.proto = !0);
|
|
1225
1225
|
return;
|
|
1226
1226
|
}
|
|
1227
1227
|
o = "$" + o;
|
|
1228
1228
|
var d = e[o];
|
|
1229
1229
|
if (d) {
|
|
1230
1230
|
var v;
|
|
1231
|
-
|
|
1231
|
+
f === "init" ? v = this.strict && d.init || d.get || d.set : v = d.init || d[f], v && this.raiseRecoverable(a.start, "Redefinition of property");
|
|
1232
1232
|
} else
|
|
1233
1233
|
d = e[o] = {
|
|
1234
1234
|
init: !1,
|
|
1235
1235
|
get: !1,
|
|
1236
1236
|
set: !1
|
|
1237
1237
|
};
|
|
1238
|
-
d[
|
|
1238
|
+
d[f] = !0;
|
|
1239
1239
|
}
|
|
1240
1240
|
};
|
|
1241
1241
|
_.parseExpression = function(t, e) {
|
|
1242
1242
|
var s = this.start, a = this.startLoc, o = this.parseMaybeAssign(t, e);
|
|
1243
1243
|
if (this.type === u.comma) {
|
|
1244
|
-
var
|
|
1245
|
-
for (
|
|
1246
|
-
|
|
1247
|
-
return this.finishNode(
|
|
1244
|
+
var f = this.startNodeAt(s, a);
|
|
1245
|
+
for (f.expressions = [o]; this.eat(u.comma); )
|
|
1246
|
+
f.expressions.push(this.parseMaybeAssign(t, e));
|
|
1247
|
+
return this.finishNode(f, "SequenceExpression");
|
|
1248
1248
|
}
|
|
1249
1249
|
return o;
|
|
1250
1250
|
};
|
|
@@ -1254,8 +1254,8 @@ _.parseMaybeAssign = function(t, e, s) {
|
|
|
1254
1254
|
return this.parseYield(t);
|
|
1255
1255
|
this.exprAllowed = !1;
|
|
1256
1256
|
}
|
|
1257
|
-
var a = !1, o = -1,
|
|
1258
|
-
e ? (o = e.parenthesizedAssign,
|
|
1257
|
+
var a = !1, o = -1, f = -1, d = -1;
|
|
1258
|
+
e ? (o = e.parenthesizedAssign, f = e.trailingComma, d = e.doubleProto, e.parenthesizedAssign = e.trailingComma = -1) : (e = new ce(), a = !0);
|
|
1259
1259
|
var v = this.start, g = this.startLoc;
|
|
1260
1260
|
(this.type === u.parenL || this.type === u.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = t === "await");
|
|
1261
1261
|
var h = this.parseMaybeConditional(t, e);
|
|
@@ -1264,15 +1264,15 @@ _.parseMaybeAssign = function(t, e, s) {
|
|
|
1264
1264
|
return P.operator = this.value, this.type === u.eq && (h = this.toAssignable(h, !1, e)), a || (e.parenthesizedAssign = e.trailingComma = e.doubleProto = -1), e.shorthandAssign >= h.start && (e.shorthandAssign = -1), this.type === u.eq ? this.checkLValPattern(h) : this.checkLValSimple(h), P.left = h, this.next(), P.right = this.parseMaybeAssign(t), d > -1 && (e.doubleProto = d), this.finishNode(P, "AssignmentExpression");
|
|
1265
1265
|
} else
|
|
1266
1266
|
a && this.checkExpressionErrors(e, !0);
|
|
1267
|
-
return o > -1 && (e.parenthesizedAssign = o),
|
|
1267
|
+
return o > -1 && (e.parenthesizedAssign = o), f > -1 && (e.trailingComma = f), h;
|
|
1268
1268
|
};
|
|
1269
1269
|
_.parseMaybeConditional = function(t, e) {
|
|
1270
1270
|
var s = this.start, a = this.startLoc, o = this.parseExprOps(t, e);
|
|
1271
1271
|
if (this.checkExpressionErrors(e))
|
|
1272
1272
|
return o;
|
|
1273
1273
|
if (this.eat(u.question)) {
|
|
1274
|
-
var
|
|
1275
|
-
return
|
|
1274
|
+
var f = this.startNodeAt(s, a);
|
|
1275
|
+
return f.test = o, f.consequent = this.parseMaybeAssign(), this.expect(u.colon), f.alternate = this.parseMaybeAssign(t), this.finishNode(f, "ConditionalExpression");
|
|
1276
1276
|
}
|
|
1277
1277
|
return o;
|
|
1278
1278
|
};
|
|
@@ -1281,24 +1281,24 @@ _.parseExprOps = function(t, e) {
|
|
|
1281
1281
|
return this.checkExpressionErrors(e) || o.start === s && o.type === "ArrowFunctionExpression" ? o : this.parseExprOp(o, s, a, -1, t);
|
|
1282
1282
|
};
|
|
1283
1283
|
_.parseExprOp = function(t, e, s, a, o) {
|
|
1284
|
-
var
|
|
1285
|
-
if (
|
|
1284
|
+
var f = this.type.binop;
|
|
1285
|
+
if (f != null && (!o || this.type !== u._in) && f > a) {
|
|
1286
1286
|
var d = this.type === u.logicalOR || this.type === u.logicalAND, v = this.type === u.coalesce;
|
|
1287
|
-
v && (
|
|
1287
|
+
v && (f = u.logicalAND.binop);
|
|
1288
1288
|
var g = this.value;
|
|
1289
1289
|
this.next();
|
|
1290
|
-
var h = this.start, P = this.startLoc, N = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, o), h, P,
|
|
1290
|
+
var h = this.start, P = this.startLoc, N = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, o), h, P, f, o), B = this.buildBinary(e, s, t, N, g, d || v);
|
|
1291
1291
|
return (d && this.type === u.coalesce || v && (this.type === u.logicalOR || this.type === u.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(B, e, s, a, o);
|
|
1292
1292
|
}
|
|
1293
1293
|
return t;
|
|
1294
1294
|
};
|
|
1295
|
-
_.buildBinary = function(t, e, s, a, o,
|
|
1295
|
+
_.buildBinary = function(t, e, s, a, o, f) {
|
|
1296
1296
|
a.type === "PrivateIdentifier" && this.raise(a.start, "Private identifier can only be left side of binary expression");
|
|
1297
1297
|
var d = this.startNodeAt(t, e);
|
|
1298
|
-
return d.left = s, d.operator = o, d.right = a, this.finishNode(d,
|
|
1298
|
+
return d.left = s, d.operator = o, d.right = a, this.finishNode(d, f ? "LogicalExpression" : "BinaryExpression");
|
|
1299
1299
|
};
|
|
1300
1300
|
_.parseMaybeUnary = function(t, e, s, a) {
|
|
1301
|
-
var o = this.start,
|
|
1301
|
+
var o = this.start, f = this.startLoc, d;
|
|
1302
1302
|
if (this.isContextual("await") && this.canAwait)
|
|
1303
1303
|
d = this.parseAwait(a), e = !0;
|
|
1304
1304
|
else if (this.type.prefix) {
|
|
@@ -1310,7 +1310,7 @@ _.parseMaybeUnary = function(t, e, s, a) {
|
|
|
1310
1310
|
if (d = this.parseExprSubscripts(t, a), this.checkExpressionErrors(t))
|
|
1311
1311
|
return d;
|
|
1312
1312
|
for (; this.type.postfix && !this.canInsertSemicolon(); ) {
|
|
1313
|
-
var h = this.startNodeAt(o,
|
|
1313
|
+
var h = this.startNodeAt(o, f);
|
|
1314
1314
|
h.operator = this.value, h.prefix = !1, h.argument = d, this.checkLValSimple(d), this.next(), d = this.finishNode(h, "UpdateExpression");
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
@@ -1318,7 +1318,7 @@ _.parseMaybeUnary = function(t, e, s, a) {
|
|
|
1318
1318
|
if (e)
|
|
1319
1319
|
this.unexpected(this.lastTokStart);
|
|
1320
1320
|
else
|
|
1321
|
-
return this.buildBinary(o,
|
|
1321
|
+
return this.buildBinary(o, f, d, this.parseMaybeUnary(null, !1, !1, a), "**", !1);
|
|
1322
1322
|
else
|
|
1323
1323
|
return d;
|
|
1324
1324
|
};
|
|
@@ -1332,12 +1332,12 @@ _.parseExprSubscripts = function(t, e) {
|
|
|
1332
1332
|
var s = this.start, a = this.startLoc, o = this.parseExprAtom(t, e);
|
|
1333
1333
|
if (o.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
|
|
1334
1334
|
return o;
|
|
1335
|
-
var
|
|
1336
|
-
return t &&
|
|
1335
|
+
var f = this.parseSubscripts(o, s, a, !1, e);
|
|
1336
|
+
return t && f.type === "MemberExpression" && (t.parenthesizedAssign >= f.start && (t.parenthesizedAssign = -1), t.parenthesizedBind >= f.start && (t.parenthesizedBind = -1), t.trailingComma >= f.start && (t.trailingComma = -1)), f;
|
|
1337
1337
|
};
|
|
1338
1338
|
_.parseSubscripts = function(t, e, s, a, o) {
|
|
1339
|
-
for (var
|
|
1340
|
-
var v = this.parseSubscript(t, e, s, a,
|
|
1339
|
+
for (var f = this.options.ecmaVersion >= 8 && t.type === "Identifier" && t.name === "async" && this.lastTokEnd === t.end && !this.canInsertSemicolon() && t.end - t.start === 5 && this.potentialArrowAt === t.start, d = !1; ; ) {
|
|
1340
|
+
var v = this.parseSubscript(t, e, s, a, f, d, o);
|
|
1341
1341
|
if (v.optional && (d = !0), v === t || v.type === "ArrowFunctionExpression") {
|
|
1342
1342
|
if (d) {
|
|
1343
1343
|
var g = this.startNodeAt(e, s);
|
|
@@ -1354,7 +1354,7 @@ _.shouldParseAsyncArrow = function() {
|
|
|
1354
1354
|
_.parseSubscriptAsyncArrow = function(t, e, s, a) {
|
|
1355
1355
|
return this.parseArrowExpression(this.startNodeAt(t, e), s, !0, a);
|
|
1356
1356
|
};
|
|
1357
|
-
_.parseSubscript = function(t, e, s, a, o,
|
|
1357
|
+
_.parseSubscript = function(t, e, s, a, o, f, d) {
|
|
1358
1358
|
var v = this.options.ecmaVersion >= 11, g = v && this.eat(u.questionDot);
|
|
1359
1359
|
a && g && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
1360
1360
|
var h = this.eat(u.bracketL);
|
|
@@ -1371,7 +1371,7 @@ _.parseSubscript = function(t, e, s, a, o, l, d) {
|
|
|
1371
1371
|
var I = this.startNodeAt(e, s);
|
|
1372
1372
|
I.callee = t, I.arguments = _t, v && (I.optional = g), t = this.finishNode(I, "CallExpression");
|
|
1373
1373
|
} else if (this.type === u.backQuote) {
|
|
1374
|
-
(g ||
|
|
1374
|
+
(g || f) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
1375
1375
|
var Y = this.startNodeAt(e, s);
|
|
1376
1376
|
Y.tag = t, Y.quasi = this.parseTemplate({ isTagged: !0 }), t = this.finishNode(Y, "TaggedTemplateExpression");
|
|
1377
1377
|
}
|
|
@@ -1386,14 +1386,14 @@ _.parseExprAtom = function(t, e, s) {
|
|
|
1386
1386
|
case u._this:
|
|
1387
1387
|
return a = this.startNode(), this.next(), this.finishNode(a, "ThisExpression");
|
|
1388
1388
|
case u.name:
|
|
1389
|
-
var
|
|
1389
|
+
var f = this.start, d = this.startLoc, v = this.containsEsc, g = this.parseIdent(!1);
|
|
1390
1390
|
if (this.options.ecmaVersion >= 8 && !v && g.name === "async" && !this.canInsertSemicolon() && this.eat(u._function))
|
|
1391
|
-
return this.overrideContext(F.f_expr), this.parseFunction(this.startNodeAt(
|
|
1391
|
+
return this.overrideContext(F.f_expr), this.parseFunction(this.startNodeAt(f, d), 0, !1, !0, e);
|
|
1392
1392
|
if (o && !this.canInsertSemicolon()) {
|
|
1393
1393
|
if (this.eat(u.arrow))
|
|
1394
|
-
return this.parseArrowExpression(this.startNodeAt(
|
|
1394
|
+
return this.parseArrowExpression(this.startNodeAt(f, d), [g], !1, e);
|
|
1395
1395
|
if (this.options.ecmaVersion >= 8 && g.name === "async" && this.type === u.name && !v && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
|
|
1396
|
-
return g = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(u.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(
|
|
1396
|
+
return g = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(u.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(f, d), [g], !0, e);
|
|
1397
1397
|
}
|
|
1398
1398
|
return g;
|
|
1399
1399
|
case u.regexp:
|
|
@@ -1467,12 +1467,12 @@ _.shouldParseArrow = function(t) {
|
|
|
1467
1467
|
return !this.canInsertSemicolon();
|
|
1468
1468
|
};
|
|
1469
1469
|
_.parseParenAndDistinguishExpression = function(t, e) {
|
|
1470
|
-
var s = this.start, a = this.startLoc, o,
|
|
1470
|
+
var s = this.start, a = this.startLoc, o, f = this.options.ecmaVersion >= 8;
|
|
1471
1471
|
if (this.options.ecmaVersion >= 6) {
|
|
1472
1472
|
this.next();
|
|
1473
1473
|
var d = this.start, v = this.startLoc, g = [], h = !0, P = !1, N = new ce(), B = this.yieldPos, nt = this.awaitPos, lt;
|
|
1474
1474
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== u.parenR; )
|
|
1475
|
-
if (h ? h = !1 : this.expect(u.comma),
|
|
1475
|
+
if (h ? h = !1 : this.expect(u.comma), f && this.afterTrailingComma(u.parenR, !0)) {
|
|
1476
1476
|
P = !0;
|
|
1477
1477
|
break;
|
|
1478
1478
|
} else if (this.type === u.ellipsis) {
|
|
@@ -1547,18 +1547,18 @@ _.parseObj = function(t, e) {
|
|
|
1547
1547
|
a = !1;
|
|
1548
1548
|
else if (this.expect(u.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(u.braceR))
|
|
1549
1549
|
break;
|
|
1550
|
-
var
|
|
1551
|
-
t || this.checkPropClash(
|
|
1550
|
+
var f = this.parseProperty(t, e);
|
|
1551
|
+
t || this.checkPropClash(f, o, e), s.properties.push(f);
|
|
1552
1552
|
}
|
|
1553
1553
|
return this.finishNode(s, t ? "ObjectPattern" : "ObjectExpression");
|
|
1554
1554
|
};
|
|
1555
1555
|
_.parseProperty = function(t, e) {
|
|
1556
|
-
var s = this.startNode(), a, o,
|
|
1556
|
+
var s = this.startNode(), a, o, f, d;
|
|
1557
1557
|
if (this.options.ecmaVersion >= 9 && this.eat(u.ellipsis))
|
|
1558
1558
|
return t ? (s.argument = this.parseIdent(!1), this.type === u.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(s, "RestElement")) : (s.argument = this.parseMaybeAssign(!1, e), this.type === u.comma && e && e.trailingComma < 0 && (e.trailingComma = this.start), this.finishNode(s, "SpreadElement"));
|
|
1559
|
-
this.options.ecmaVersion >= 6 && (s.method = !1, s.shorthand = !1, (t || e) && (
|
|
1559
|
+
this.options.ecmaVersion >= 6 && (s.method = !1, s.shorthand = !1, (t || e) && (f = this.start, d = this.startLoc), t || (a = this.eat(u.star)));
|
|
1560
1560
|
var v = this.containsEsc;
|
|
1561
|
-
return this.parsePropertyName(s), !t && !v && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(s) ? (o = !0, a = this.options.ecmaVersion >= 9 && this.eat(u.star), this.parsePropertyName(s)) : o = !1, this.parsePropertyValue(s, t, a, o,
|
|
1561
|
+
return this.parsePropertyName(s), !t && !v && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(s) ? (o = !0, a = this.options.ecmaVersion >= 9 && this.eat(u.star), this.parsePropertyName(s)) : o = !1, this.parsePropertyValue(s, t, a, o, f, d, e, v), this.finishNode(s, "Property");
|
|
1562
1562
|
};
|
|
1563
1563
|
_.parseGetterSetter = function(t) {
|
|
1564
1564
|
var e = t.key.name;
|
|
@@ -1570,8 +1570,8 @@ _.parseGetterSetter = function(t) {
|
|
|
1570
1570
|
} else
|
|
1571
1571
|
t.kind === "set" && t.value.params[0].type === "RestElement" && this.raiseRecoverable(t.value.params[0].start, "Setter cannot use rest params");
|
|
1572
1572
|
};
|
|
1573
|
-
_.parsePropertyValue = function(t, e, s, a, o,
|
|
1574
|
-
(s || a) && this.type === u.colon && this.unexpected(), this.eat(u.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === u.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(s, a), t.kind = "init") : !e && !v && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== u.comma && this.type !== u.braceR && this.type !== u.eq ? ((s || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((s || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = o), e ? t.value = this.parseMaybeDefault(o,
|
|
1573
|
+
_.parsePropertyValue = function(t, e, s, a, o, f, d, v) {
|
|
1574
|
+
(s || a) && this.type === u.colon && this.unexpected(), this.eat(u.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === u.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(s, a), t.kind = "init") : !e && !v && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== u.comma && this.type !== u.braceR && this.type !== u.eq ? ((s || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((s || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = o), e ? t.value = this.parseMaybeDefault(o, f, this.copyNode(t.key)) : this.type === u.eq && d ? (d.shorthandAssign < 0 && (d.shorthandAssign = this.start), t.value = this.parseMaybeDefault(o, f, this.copyNode(t.key))) : t.value = this.copyNode(t.key), t.kind = "init", t.shorthand = !0) : this.unexpected();
|
|
1575
1575
|
};
|
|
1576
1576
|
_.parsePropertyName = function(t) {
|
|
1577
1577
|
if (this.options.ecmaVersion >= 6) {
|
|
@@ -1585,22 +1585,22 @@ _.initFunction = function(t) {
|
|
|
1585
1585
|
t.id = null, this.options.ecmaVersion >= 6 && (t.generator = t.expression = !1), this.options.ecmaVersion >= 8 && (t.async = !1);
|
|
1586
1586
|
};
|
|
1587
1587
|
_.parseMethod = function(t, e, s) {
|
|
1588
|
-
var a = this.startNode(), o = this.yieldPos,
|
|
1589
|
-
return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = t), this.options.ecmaVersion >= 8 && (a.async = !!e), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(e, a.generator) | he | (s ? li : 0)), this.expect(u.parenL), a.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1), this.yieldPos = o, this.awaitPos =
|
|
1588
|
+
var a = this.startNode(), o = this.yieldPos, f = this.awaitPos, d = this.awaitIdentPos;
|
|
1589
|
+
return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = t), this.options.ecmaVersion >= 8 && (a.async = !!e), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Oe(e, a.generator) | he | (s ? li : 0)), this.expect(u.parenL), a.params = this.parseBindingList(u.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1), this.yieldPos = o, this.awaitPos = f, this.awaitIdentPos = d, this.finishNode(a, "FunctionExpression");
|
|
1590
1590
|
};
|
|
1591
1591
|
_.parseArrowExpression = function(t, e, s, a) {
|
|
1592
|
-
var o = this.yieldPos,
|
|
1593
|
-
return this.enterScope(Oe(s, !1) | Le), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos = o, this.awaitPos =
|
|
1592
|
+
var o = this.yieldPos, f = this.awaitPos, d = this.awaitIdentPos;
|
|
1593
|
+
return this.enterScope(Oe(s, !1) | Le), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos = o, this.awaitPos = f, this.awaitIdentPos = d, this.finishNode(t, "ArrowFunctionExpression");
|
|
1594
1594
|
};
|
|
1595
1595
|
_.parseFunctionBody = function(t, e, s, a) {
|
|
1596
|
-
var o = e && this.type !== u.braceL,
|
|
1596
|
+
var o = e && this.type !== u.braceL, f = this.strict, d = !1;
|
|
1597
1597
|
if (o)
|
|
1598
1598
|
t.body = this.parseMaybeAssign(a), t.expression = !0, this.checkParams(t, !1);
|
|
1599
1599
|
else {
|
|
1600
1600
|
var v = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(t.params);
|
|
1601
|
-
(!
|
|
1601
|
+
(!f || v) && (d = this.strictDirective(this.end), d && v && this.raiseRecoverable(t.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
1602
1602
|
var g = this.labels;
|
|
1603
|
-
this.labels = [], d && (this.strict = !0), this.checkParams(t, !
|
|
1603
|
+
this.labels = [], d && (this.strict = !0), this.checkParams(t, !f && !d && !e && !s && this.isSimpleParamList(t.params)), this.strict && t.id && this.checkLValSimple(t.id, mi), t.body = this.parseBlock(!1, void 0, d && !f), t.expression = !1, this.adaptDirectivePrologue(t.body.body), this.labels = g;
|
|
1604
1604
|
}
|
|
1605
1605
|
this.exitScope();
|
|
1606
1606
|
};
|
|
@@ -1614,14 +1614,14 @@ _.isSimpleParamList = function(t) {
|
|
|
1614
1614
|
};
|
|
1615
1615
|
_.checkParams = function(t, e) {
|
|
1616
1616
|
for (var s = /* @__PURE__ */ Object.create(null), a = 0, o = t.params; a < o.length; a += 1) {
|
|
1617
|
-
var
|
|
1618
|
-
this.checkLValInnerPattern(
|
|
1617
|
+
var f = o[a];
|
|
1618
|
+
this.checkLValInnerPattern(f, Re, e ? null : s);
|
|
1619
1619
|
}
|
|
1620
1620
|
};
|
|
1621
1621
|
_.parseExprList = function(t, e, s, a) {
|
|
1622
|
-
for (var o = [],
|
|
1623
|
-
if (
|
|
1624
|
-
|
|
1622
|
+
for (var o = [], f = !0; !this.eat(t); ) {
|
|
1623
|
+
if (f)
|
|
1624
|
+
f = !1;
|
|
1625
1625
|
else if (this.expect(u.comma), e && this.afterTrailingComma(t))
|
|
1626
1626
|
break;
|
|
1627
1627
|
var d = void 0;
|
|
@@ -1688,8 +1688,8 @@ wt.declareName = function(t, e, s) {
|
|
|
1688
1688
|
var o = this.currentScope();
|
|
1689
1689
|
a = o.lexical.indexOf(t) > -1 || o.functions.indexOf(t) > -1 || o.var.indexOf(t) > -1, o.lexical.push(t), this.inModule && o.flags & Ht && delete this.undefinedExports[t];
|
|
1690
1690
|
} else if (e === di) {
|
|
1691
|
-
var
|
|
1692
|
-
|
|
1691
|
+
var f = this.currentScope();
|
|
1692
|
+
f.lexical.push(t);
|
|
1693
1693
|
} else if (e === fi) {
|
|
1694
1694
|
var d = this.currentScope();
|
|
1695
1695
|
this.treatFunctionsAsVar ? a = d.lexical.indexOf(t) > -1 : a = d.lexical.indexOf(t) > -1 || d.var.indexOf(t) > -1, d.functions.push(t);
|
|
@@ -1803,8 +1803,8 @@ var yt = function(e) {
|
|
|
1803
1803
|
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = Ii[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
1804
1804
|
};
|
|
1805
1805
|
yt.prototype.reset = function(e, s, a) {
|
|
1806
|
-
var o = a.indexOf("v") !== -1,
|
|
1807
|
-
this.start = e | 0, this.source = s + "", this.flags = a, o && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU =
|
|
1806
|
+
var o = a.indexOf("v") !== -1, f = a.indexOf("u") !== -1;
|
|
1807
|
+
this.start = e | 0, this.source = s + "", this.flags = a, o && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = f && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = f && this.parser.options.ecmaVersion >= 9);
|
|
1808
1808
|
};
|
|
1809
1809
|
yt.prototype.raise = function(e) {
|
|
1810
1810
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
@@ -1814,19 +1814,19 @@ yt.prototype.at = function(e, s) {
|
|
|
1814
1814
|
var a = this.source, o = a.length;
|
|
1815
1815
|
if (e >= o)
|
|
1816
1816
|
return -1;
|
|
1817
|
-
var
|
|
1818
|
-
if (!(s || this.switchU) ||
|
|
1819
|
-
return
|
|
1817
|
+
var f = a.charCodeAt(e);
|
|
1818
|
+
if (!(s || this.switchU) || f <= 55295 || f >= 57344 || e + 1 >= o)
|
|
1819
|
+
return f;
|
|
1820
1820
|
var d = a.charCodeAt(e + 1);
|
|
1821
|
-
return d >= 56320 && d <= 57343 ? (
|
|
1821
|
+
return d >= 56320 && d <= 57343 ? (f << 10) + d - 56613888 : f;
|
|
1822
1822
|
};
|
|
1823
1823
|
yt.prototype.nextIndex = function(e, s) {
|
|
1824
1824
|
s === void 0 && (s = !1);
|
|
1825
1825
|
var a = this.source, o = a.length;
|
|
1826
1826
|
if (e >= o)
|
|
1827
1827
|
return o;
|
|
1828
|
-
var
|
|
1829
|
-
return !(s || this.switchU) ||
|
|
1828
|
+
var f = a.charCodeAt(e), d;
|
|
1829
|
+
return !(s || this.switchU) || f <= 55295 || f >= 57344 || e + 1 >= o || (d = a.charCodeAt(e + 1)) < 56320 || d > 57343 ? e + 1 : e + 2;
|
|
1830
1830
|
};
|
|
1831
1831
|
yt.prototype.current = function(e) {
|
|
1832
1832
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
@@ -1842,8 +1842,8 @@ yt.prototype.eat = function(e, s) {
|
|
|
1842
1842
|
};
|
|
1843
1843
|
yt.prototype.eatChars = function(e, s) {
|
|
1844
1844
|
s === void 0 && (s = !1);
|
|
1845
|
-
for (var a = this.pos, o = 0,
|
|
1846
|
-
var d =
|
|
1845
|
+
for (var a = this.pos, o = 0, f = e; o < f.length; o += 1) {
|
|
1846
|
+
var d = f[o], v = this.at(a, s);
|
|
1847
1847
|
if (v === -1 || v !== d)
|
|
1848
1848
|
return !1;
|
|
1849
1849
|
a = this.nextIndex(a, s);
|
|
@@ -1851,9 +1851,9 @@ yt.prototype.eatChars = function(e, s) {
|
|
|
1851
1851
|
return this.pos = a, !0;
|
|
1852
1852
|
};
|
|
1853
1853
|
C.validateRegExpFlags = function(t) {
|
|
1854
|
-
for (var e = t.validFlags, s = t.flags, a = !1, o = !1,
|
|
1855
|
-
var d = s.charAt(
|
|
1856
|
-
e.indexOf(d) === -1 && this.raise(t.start, "Invalid regular expression flag"), s.indexOf(d,
|
|
1854
|
+
for (var e = t.validFlags, s = t.flags, a = !1, o = !1, f = 0; f < s.length; f++) {
|
|
1855
|
+
var d = s.charAt(f);
|
|
1856
|
+
e.indexOf(d) === -1 && this.raise(t.start, "Invalid regular expression flag"), s.indexOf(d, f + 1) > -1 && this.raise(t.start, "Duplicate regular expression flag"), d === "u" && (a = !0), d === "v" && (o = !0);
|
|
1857
1857
|
}
|
|
1858
1858
|
this.options.ecmaVersion >= 15 && a && o && this.raise(t.start, "Invalid regular expression flag");
|
|
1859
1859
|
};
|
|
@@ -2021,8 +2021,8 @@ C.regexp_eatUncapturingGroup = function(t) {
|
|
|
2021
2021
|
);
|
|
2022
2022
|
if (s || a) {
|
|
2023
2023
|
for (var o = 0; o < s.length; o++) {
|
|
2024
|
-
var
|
|
2025
|
-
s.indexOf(
|
|
2024
|
+
var f = s.charAt(o);
|
|
2025
|
+
s.indexOf(f, o + 1) > -1 && t.raise("Duplicate regular expression modifiers");
|
|
2026
2026
|
}
|
|
2027
2027
|
if (a) {
|
|
2028
2028
|
var d = this.regexp_eatModifiers(t);
|
|
@@ -2107,8 +2107,8 @@ C.regexp_groupSpecifier = function(t) {
|
|
|
2107
2107
|
if (s)
|
|
2108
2108
|
if (e)
|
|
2109
2109
|
for (var a = 0, o = s; a < o.length; a += 1) {
|
|
2110
|
-
var
|
|
2111
|
-
|
|
2110
|
+
var f = o[a];
|
|
2111
|
+
f.separatedFrom(t.branchID) || t.raise("Duplicate capture group name");
|
|
2112
2112
|
}
|
|
2113
2113
|
else
|
|
2114
2114
|
t.raise("Duplicate capture group name");
|
|
@@ -2216,7 +2216,7 @@ C.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2216
2216
|
if (this.regexp_eatFixedHexDigits(t, 4)) {
|
|
2217
2217
|
var o = t.lastIntValue;
|
|
2218
2218
|
if (a && o >= 55296 && o <= 56319) {
|
|
2219
|
-
var
|
|
2219
|
+
var f = t.pos;
|
|
2220
2220
|
if (t.eat(
|
|
2221
2221
|
92
|
|
2222
2222
|
/* \ */
|
|
@@ -2228,7 +2228,7 @@ C.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2228
2228
|
if (d >= 56320 && d <= 57343)
|
|
2229
2229
|
return t.lastIntValue = (o - 55296) * 1024 + (d - 56320) + 65536, !0;
|
|
2230
2230
|
}
|
|
2231
|
-
t.pos =
|
|
2231
|
+
t.pos = f, t.lastIntValue = o;
|
|
2232
2232
|
}
|
|
2233
2233
|
return !0;
|
|
2234
2234
|
}
|
|
@@ -2900,8 +2900,8 @@ R.readRegexp = function() {
|
|
|
2900
2900
|
}
|
|
2901
2901
|
var o = this.input.slice(s, this.pos);
|
|
2902
2902
|
++this.pos;
|
|
2903
|
-
var
|
|
2904
|
-
this.containsEsc && this.unexpected(
|
|
2903
|
+
var f = this.pos, d = this.readWord1();
|
|
2904
|
+
this.containsEsc && this.unexpected(f);
|
|
2905
2905
|
var v = this.regexpState || (this.regexpState = new yt(this));
|
|
2906
2906
|
v.reset(s, o, d), this.validateRegExpFlags(v), this.validateRegExpPattern(v);
|
|
2907
2907
|
var g = null;
|
|
@@ -2912,7 +2912,7 @@ R.readRegexp = function() {
|
|
|
2912
2912
|
return this.finishToken(u.regexp, { pattern: o, flags: d, value: g });
|
|
2913
2913
|
};
|
|
2914
2914
|
R.readInt = function(t, e, s) {
|
|
2915
|
-
for (var a = this.options.ecmaVersion >= 12 && e === void 0, o = s && this.input.charCodeAt(this.pos) === 48,
|
|
2915
|
+
for (var a = this.options.ecmaVersion >= 12 && e === void 0, o = s && this.input.charCodeAt(this.pos) === 48, f = this.pos, d = 0, v = 0, g = 0, h = e ?? 1 / 0; g < h; ++g, ++this.pos) {
|
|
2916
2916
|
var P = this.input.charCodeAt(this.pos), N = void 0;
|
|
2917
2917
|
if (a && P === 95) {
|
|
2918
2918
|
o && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), v === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), g === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), v = P;
|
|
@@ -2922,7 +2922,7 @@ R.readInt = function(t, e, s) {
|
|
|
2922
2922
|
break;
|
|
2923
2923
|
v = P, d = d * t + N;
|
|
2924
2924
|
}
|
|
2925
|
-
return a && v === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos ===
|
|
2925
|
+
return a && v === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === f || e != null && this.pos - f !== e ? null : d;
|
|
2926
2926
|
};
|
|
2927
2927
|
function Hs(t, e) {
|
|
2928
2928
|
return e ? parseInt(t, 8) : parseFloat(t.replace(/_/g, ""));
|
|
@@ -2947,8 +2947,8 @@ R.readNumber = function(t) {
|
|
|
2947
2947
|
return ++this.pos, ft(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(u.num, o);
|
|
2948
2948
|
}
|
|
2949
2949
|
s && /[89]/.test(this.input.slice(e, this.pos)) && (s = !1), a === 46 && !s && (++this.pos, this.readInt(10), a = this.input.charCodeAt(this.pos)), (a === 69 || a === 101) && !s && (a = this.input.charCodeAt(++this.pos), (a === 43 || a === 45) && ++this.pos, this.readInt(10) === null && this.raise(e, "Invalid number")), ft(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
2950
|
-
var
|
|
2951
|
-
return this.finishToken(u.num,
|
|
2950
|
+
var f = Hs(this.input.slice(e, this.pos), s);
|
|
2951
|
+
return this.finishToken(u.num, f);
|
|
2952
2952
|
};
|
|
2953
2953
|
R.readCodePoint = function() {
|
|
2954
2954
|
var t = this.input.charCodeAt(this.pos), e;
|
|
@@ -3106,10 +3106,10 @@ R.readWord1 = function() {
|
|
|
3106
3106
|
this.pos += o <= 65535 ? 1 : 2;
|
|
3107
3107
|
else if (o === 92) {
|
|
3108
3108
|
this.containsEsc = !0, t += this.input.slice(s, this.pos);
|
|
3109
|
-
var
|
|
3109
|
+
var f = this.pos;
|
|
3110
3110
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3111
3111
|
var d = this.readCodePoint();
|
|
3112
|
-
(e ? ft : vt)(d, a) || this.invalidStringToken(
|
|
3112
|
+
(e ? ft : vt)(d, a) || this.invalidStringToken(f, "Invalid Unicode escape"), t += gt(d), s = this.pos;
|
|
3113
3113
|
} else
|
|
3114
3114
|
break;
|
|
3115
3115
|
e = !1;
|
|
@@ -3179,15 +3179,15 @@ const Ws = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3179
3179
|
function Xe(t, e) {
|
|
3180
3180
|
for (var s = 0; s < e.length; s++) {
|
|
3181
3181
|
var a = e[s];
|
|
3182
|
-
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (o = (function(
|
|
3183
|
-
if (typeof
|
|
3184
|
-
var v =
|
|
3182
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (o = (function(f, d) {
|
|
3183
|
+
if (typeof f != "object" || f === null) return f;
|
|
3184
|
+
var v = f[Symbol.toPrimitive];
|
|
3185
3185
|
if (v !== void 0) {
|
|
3186
|
-
var g = v.call(
|
|
3186
|
+
var g = v.call(f, "string");
|
|
3187
3187
|
if (typeof g != "object") return g;
|
|
3188
3188
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3189
3189
|
}
|
|
3190
|
-
return String(
|
|
3190
|
+
return String(f);
|
|
3191
3191
|
})(a.key)) == "symbol" ? o : String(o), a);
|
|
3192
3192
|
}
|
|
3193
3193
|
var o;
|
|
@@ -3217,11 +3217,11 @@ function Qe(t, e) {
|
|
|
3217
3217
|
function Je(t, e) {
|
|
3218
3218
|
var s = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
3219
3219
|
if (s) return (s = s.call(t)).next.bind(s);
|
|
3220
|
-
if (Array.isArray(t) || (s = (function(o,
|
|
3220
|
+
if (Array.isArray(t) || (s = (function(o, f) {
|
|
3221
3221
|
if (o) {
|
|
3222
|
-
if (typeof o == "string") return Qe(o,
|
|
3222
|
+
if (typeof o == "string") return Qe(o, f);
|
|
3223
3223
|
var d = Object.prototype.toString.call(o).slice(8, -1);
|
|
3224
|
-
return d === "Object" && o.constructor && (d = o.constructor.name), d === "Map" || d === "Set" ? Array.from(o) : d === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d) ? Qe(o,
|
|
3224
|
+
return d === "Object" && o.constructor && (d = o.constructor.name), d === "Map" || d === "Set" ? Array.from(o) : d === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d) ? Qe(o, f) : void 0;
|
|
3225
3225
|
}
|
|
3226
3226
|
})(t)) || e) {
|
|
3227
3227
|
s && (t = s);
|
|
@@ -3241,13 +3241,13 @@ var zs = /* @__PURE__ */ new WeakMap();
|
|
|
3241
3241
|
function Xs(t) {
|
|
3242
3242
|
var e = zs.get(t.Parser.acorn || t);
|
|
3243
3243
|
if (!e) {
|
|
3244
|
-
var s = { assert: rt(0, { startsExpr: st }), asserts: rt(0, { startsExpr: st }), global: rt(0, { startsExpr: st }), keyof: rt(0, { startsExpr: st }), readonly: rt(0, { startsExpr: st }), unique: rt(0, { startsExpr: st }), abstract: rt(0, { startsExpr: st }), declare: rt(0, { startsExpr: st }), enum: rt(0, { startsExpr: st }), module: rt(0, { startsExpr: st }), namespace: rt(0, { startsExpr: st }), interface: rt(0, { startsExpr: st }), type: rt(0, { startsExpr: st }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, o = { tc_oTag: new X("<tag", !1, !1), tc_cTag: new X("</tag", !1, !1), tc_expr: new X("<tag>...</tag>", !0, !0) },
|
|
3244
|
+
var s = { assert: rt(0, { startsExpr: st }), asserts: rt(0, { startsExpr: st }), global: rt(0, { startsExpr: st }), keyof: rt(0, { startsExpr: st }), readonly: rt(0, { startsExpr: st }), unique: rt(0, { startsExpr: st }), abstract: rt(0, { startsExpr: st }), declare: rt(0, { startsExpr: st }), enum: rt(0, { startsExpr: st }), module: rt(0, { startsExpr: st }), namespace: rt(0, { startsExpr: st }), interface: rt(0, { startsExpr: st }), type: rt(0, { startsExpr: st }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, o = { tc_oTag: new X("<tag", !1, !1), tc_cTag: new X("</tag", !1, !1), tc_expr: new X("<tag>...</tag>", !0, !0) }, f = new RegExp("^(?:" + Object.keys(s).join("|") + ")$");
|
|
3245
3245
|
a.jsxTagStart.updateContext = function() {
|
|
3246
3246
|
this.context.push(o.tc_expr), this.context.push(o.tc_oTag), this.exprAllowed = !1;
|
|
3247
3247
|
}, a.jsxTagEnd.updateContext = function(d) {
|
|
3248
3248
|
var v = this.context.pop();
|
|
3249
3249
|
v === o.tc_oTag && d === u.slash || v === o.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === o.tc_expr) : this.exprAllowed = !0;
|
|
3250
|
-
}, e = { tokTypes: ne({}, s, a), tokContexts: ne({}, o), keywordsRegExp:
|
|
3250
|
+
}, e = { tokTypes: ne({}, s, a), tokContexts: ne({}, o), keywordsRegExp: f, tokenIsLiteralPropertyName: function(d) {
|
|
3251
3251
|
return [u.name, u.string, u.num].concat(Object.values(Lt), Object.values(s)).includes(d);
|
|
3252
3252
|
}, tokenIsKeywordOrIdentifier: function(d) {
|
|
3253
3253
|
return [u.name].concat(Object.values(Lt), Object.values(s)).includes(d);
|
|
@@ -3340,7 +3340,7 @@ function ei(t) {
|
|
|
3340
3340
|
return t === "private" || t === "public" || t === "protected";
|
|
3341
3341
|
}
|
|
3342
3342
|
function rr(t) {
|
|
3343
|
-
var e = {}, s = e.dts, a = s !== void 0 && s, o = e.allowSatisfies,
|
|
3343
|
+
var e = {}, s = e.dts, a = s !== void 0 && s, o = e.allowSatisfies, f = o !== void 0 && o;
|
|
3344
3344
|
return function(d) {
|
|
3345
3345
|
var v = d.acorn || Ws, g = Xs(v), h = v.tokTypes, P = v.keywordTypes, N = v.isIdentifierStart, B = v.lineBreak, nt = v.isNewLine, lt = v.tokContexts, _t = v.isIdentifierChar, I = g.tokTypes, Y = g.tokContexts, fe = g.keywordsRegExp, Hi = g.tokenIsLiteralPropertyName, $i = g.tokenIsTemplate, Gi = g.tokenIsTSDeclarationStart, V = g.tokenIsIdentifier, Xt = g.tokenIsKeywordOrIdentifier, Ki = g.tokenIsTSTypeOperator;
|
|
3346
3346
|
function Wi(S, Z, z) {
|
|
@@ -3364,14 +3364,14 @@ function rr(t) {
|
|
|
3364
3364
|
c.length && (n.decorators = c, this.resetStartLocationFromNode(n, c[0]), this.decoratorStack[this.decoratorStack.length - 1] = []);
|
|
3365
3365
|
}, r.parseDecorators = function(n) {
|
|
3366
3366
|
for (var c = this.decoratorStack[this.decoratorStack.length - 1]; this.match(D.at); ) {
|
|
3367
|
-
var
|
|
3368
|
-
c.push(
|
|
3367
|
+
var l = this.parseDecorator();
|
|
3368
|
+
c.push(l);
|
|
3369
3369
|
}
|
|
3370
3370
|
this.match($._export) ? n || this.unexpected() : this.canHaveLeadingDecorator() || this.raise(this.start, "Leading decorators must be attached to a class declaration.");
|
|
3371
3371
|
}, r.parseDecorator = function() {
|
|
3372
3372
|
var n = this.startNode();
|
|
3373
3373
|
this.next(), this.decoratorStack.push([]);
|
|
3374
|
-
var c,
|
|
3374
|
+
var c, l = this.start, m = this.startLoc;
|
|
3375
3375
|
if (this.match($.parenL)) {
|
|
3376
3376
|
var y = this.start, x = this.startLoc;
|
|
3377
3377
|
if (this.next(), c = this.parseExpression(), this.expect($.parenR), this.options.preserveParens) {
|
|
@@ -3379,7 +3379,7 @@ function rr(t) {
|
|
|
3379
3379
|
b.expression = c, c = this.finishNode(b, "ParenthesizedExpression");
|
|
3380
3380
|
}
|
|
3381
3381
|
} else for (c = this.parseIdent(!1); this.eat($.dot); ) {
|
|
3382
|
-
var T = this.startNodeAt(
|
|
3382
|
+
var T = this.startNodeAt(l, m);
|
|
3383
3383
|
T.object = c, T.property = this.parseIdent(!0), T.computed = !1, c = this.finishNode(T, "MemberExpression");
|
|
3384
3384
|
}
|
|
3385
3385
|
return n.expression = this.parseMaybeDecoratorArguments(c), this.decoratorStack.pop(), this.finishNode(n, "Decorator");
|
|
@@ -3394,11 +3394,11 @@ function rr(t) {
|
|
|
3394
3394
|
})(d, g, v), d = (function(S, Z, z, $) {
|
|
3395
3395
|
var D = S.tokTypes, p = Z.tokTypes, i = S.isNewLine, r = S.isIdentifierChar, n = Object.assign({ allowNamespaces: !0, allowNamespacedObjects: !0 }, {});
|
|
3396
3396
|
return (function(c) {
|
|
3397
|
-
function
|
|
3397
|
+
function l() {
|
|
3398
3398
|
return c.apply(this, arguments) || this;
|
|
3399
3399
|
}
|
|
3400
|
-
Yt(
|
|
3401
|
-
var m =
|
|
3400
|
+
Yt(l, c);
|
|
3401
|
+
var m = l.prototype;
|
|
3402
3402
|
return m.jsx_readToken = function() {
|
|
3403
3403
|
for (var y = "", x = this.pos; ; ) {
|
|
3404
3404
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated JSX contents");
|
|
@@ -3522,7 +3522,7 @@ function rr(t) {
|
|
|
3522
3522
|
}, m.jsx_parseElement = function() {
|
|
3523
3523
|
var y = this.start, x = this.startLoc;
|
|
3524
3524
|
return this.next(), this.jsx_parseElementAt(y, x);
|
|
3525
|
-
},
|
|
3525
|
+
}, l;
|
|
3526
3526
|
})(z);
|
|
3527
3527
|
})(v, g, d), d = (function(S, Z, z) {
|
|
3528
3528
|
var $ = Z.tokTypes, D = z.tokTypes;
|
|
@@ -3546,8 +3546,8 @@ function rr(t) {
|
|
|
3546
3546
|
var n = [], c = /* @__PURE__ */ new Set();
|
|
3547
3547
|
do {
|
|
3548
3548
|
if (this.type === D.braceR) break;
|
|
3549
|
-
var
|
|
3550
|
-
|
|
3549
|
+
var l, m = this.startNode();
|
|
3550
|
+
l = this.type === D.string ? this.parseLiteral(this.value) : this.parseIdent(!0), this.next(), m.key = l, c.has(m.key.name) && this.raise(this.pos, "Duplicated key in attributes"), c.add(m.key.name), this.type !== D.string && this.raise(this.pos, "Only string is supported as an attribute value"), m.value = this.parseLiteral(this.value), n.push(this.finishNode(m, "ImportAttribute"));
|
|
3551
3551
|
} while (this.eat(D.comma));
|
|
3552
3552
|
return n;
|
|
3553
3553
|
}, i;
|
|
@@ -3556,9 +3556,9 @@ function rr(t) {
|
|
|
3556
3556
|
var zi = /* @__PURE__ */ (function(S) {
|
|
3557
3557
|
function Z(i, r, n) {
|
|
3558
3558
|
var c;
|
|
3559
|
-
return (c = S.call(this, i, r, n) || this).preValue = null, c.preToken = null, c.isLookahead = !1, c.isAmbientContext = !1, c.inAbstractClass = !1, c.inType = !1, c.inDisallowConditionalTypesContext = !1, c.maybeInArrowParameters = !1, c.shouldParseArrowReturnType = void 0, c.shouldParseAsyncArrowReturnType = void 0, c.decoratorStack = [[]], c.importsStack = [[]], c.importOrExportOuterKind = void 0, c.tsParseConstModifier = c.tsParseModifiers.bind((function(
|
|
3560
|
-
if (
|
|
3561
|
-
return
|
|
3559
|
+
return (c = S.call(this, i, r, n) || this).preValue = null, c.preToken = null, c.isLookahead = !1, c.isAmbientContext = !1, c.inAbstractClass = !1, c.inType = !1, c.inDisallowConditionalTypesContext = !1, c.maybeInArrowParameters = !1, c.shouldParseArrowReturnType = void 0, c.shouldParseAsyncArrowReturnType = void 0, c.decoratorStack = [[]], c.importsStack = [[]], c.importOrExportOuterKind = void 0, c.tsParseConstModifier = c.tsParseModifiers.bind((function(l) {
|
|
3560
|
+
if (l === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3561
|
+
return l;
|
|
3562
3562
|
})(c), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: A.InvalidModifierOnTypeParameterPositions }), c;
|
|
3563
3563
|
}
|
|
3564
3564
|
Yt(Z, S);
|
|
@@ -3587,14 +3587,14 @@ function rr(t) {
|
|
|
3587
3587
|
r === void 0 && (r = this.cloneCurLookaheadState());
|
|
3588
3588
|
var n = { node: null };
|
|
3589
3589
|
try {
|
|
3590
|
-
return { node: i(function(
|
|
3591
|
-
throw
|
|
3590
|
+
return { node: i(function(l) {
|
|
3591
|
+
throw l === void 0 && (l = null), n.node = l, n;
|
|
3592
3592
|
}), error: null, thrown: !1, aborted: !1, failState: null };
|
|
3593
|
-
} catch (
|
|
3593
|
+
} catch (l) {
|
|
3594
3594
|
var c = this.getCurLookaheadState();
|
|
3595
|
-
if (this.setLookaheadState(r),
|
|
3596
|
-
if (
|
|
3597
|
-
throw
|
|
3595
|
+
if (this.setLookaheadState(r), l instanceof SyntaxError) return { node: null, error: l, thrown: !0, aborted: !1, failState: c };
|
|
3596
|
+
if (l === n) return { node: n.node, error: null, thrown: !1, aborted: !0, failState: c };
|
|
3597
|
+
throw l;
|
|
3598
3598
|
}
|
|
3599
3599
|
}, p.setOptionalParametersError = function(i, r) {
|
|
3600
3600
|
var n;
|
|
@@ -3630,13 +3630,13 @@ function rr(t) {
|
|
|
3630
3630
|
}, p.tsTryParseGenericAsyncArrowFunction = function(i, r, n) {
|
|
3631
3631
|
var c = this;
|
|
3632
3632
|
if (this.tsMatchLeftRelational()) {
|
|
3633
|
-
var
|
|
3633
|
+
var l = this.maybeInArrowParameters;
|
|
3634
3634
|
this.maybeInArrowParameters = !0;
|
|
3635
3635
|
var m = this.tsTryParseAndCatch(function() {
|
|
3636
3636
|
var y = c.startNodeAt(i, r);
|
|
3637
3637
|
return y.typeParameters = c.tsParseTypeParameters(), S.prototype.parseFunctionParams.call(c, y), y.returnType = c.tsTryParseTypeOrTypePredicateAnnotation(), c.expect(h.arrow), y;
|
|
3638
3638
|
});
|
|
3639
|
-
if (this.maybeInArrowParameters =
|
|
3639
|
+
if (this.maybeInArrowParameters = l, m) return S.prototype.parseArrowExpression.call(this, m, null, !0, n);
|
|
3640
3640
|
}
|
|
3641
3641
|
}, p.tsParseTypeArgumentsInExpression = function() {
|
|
3642
3642
|
if (this.reScan_lt() === h.relational) return this.tsParseTypeArguments();
|
|
@@ -3665,8 +3665,8 @@ function rr(t) {
|
|
|
3665
3665
|
return this.input.charCodeAt(this.nextTokenStart());
|
|
3666
3666
|
}, p.compareLookaheadState = function(i, r) {
|
|
3667
3667
|
for (var n = 0, c = Object.keys(i); n < c.length; n++) {
|
|
3668
|
-
var
|
|
3669
|
-
if (i[
|
|
3668
|
+
var l = c[n];
|
|
3669
|
+
if (i[l] !== r[l]) return !1;
|
|
3670
3670
|
}
|
|
3671
3671
|
return !0;
|
|
3672
3672
|
}, p.createLookaheadState = function() {
|
|
@@ -3694,7 +3694,7 @@ function rr(t) {
|
|
|
3694
3694
|
var i;
|
|
3695
3695
|
this.isLookahead || (i = this.options.onComment && this.curPosition());
|
|
3696
3696
|
var r = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
3697
|
-
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var c,
|
|
3697
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var c, l = r; (c = Wi(this.input, l, this.pos)) > -1; ) ++this.curLine, l = this.lineStart = c;
|
|
3698
3698
|
this.isLookahead || this.options.onComment && this.options.onComment(!0, this.input.slice(r + 2, n), r, this.pos, i, this.curPosition());
|
|
3699
3699
|
}, p.skipLineComment = function(i) {
|
|
3700
3700
|
var r, n = this.pos;
|
|
@@ -3713,8 +3713,8 @@ function rr(t) {
|
|
|
3713
3713
|
return Ye.lastIndex = this.end, Ye.test(this.input);
|
|
3714
3714
|
}, p.addExtra = function(i, r, n, c) {
|
|
3715
3715
|
if (c === void 0 && (c = !0), i) {
|
|
3716
|
-
var
|
|
3717
|
-
c ?
|
|
3716
|
+
var l = i.extra = i.extra || {};
|
|
3717
|
+
c ? l[r] = n : Object.defineProperty(l, r, { enumerable: c, value: n });
|
|
3718
3718
|
}
|
|
3719
3719
|
}, p.isLiteralPropertyName = function() {
|
|
3720
3720
|
return Hi(this.type);
|
|
@@ -3768,7 +3768,7 @@ function rr(t) {
|
|
|
3768
3768
|
return !1;
|
|
3769
3769
|
}
|
|
3770
3770
|
if (!this.isContextualWithState(i, n)) return !1;
|
|
3771
|
-
for (var
|
|
3771
|
+
for (var l = 0; l < r; l++) this.next();
|
|
3772
3772
|
return !0;
|
|
3773
3773
|
}, p.canHaveLeadingDecorator = function() {
|
|
3774
3774
|
return this.match(h._class);
|
|
@@ -3811,8 +3811,8 @@ function rr(t) {
|
|
|
3811
3811
|
if (c === I.global) return r.tsParseAmbientExternalModuleDeclaration(i);
|
|
3812
3812
|
if (c === h._const || c === h._var) return r.match(h._const) && r.isLookaheadContextual("enum") ? (r.expect(h._const), r.tsParseEnumDeclaration(i, { const: !0, declare: !0 })) : (i.declare = !0, r.parseVarStatement(i, n || r.value, !0));
|
|
3813
3813
|
if (c === I.interface) {
|
|
3814
|
-
var
|
|
3815
|
-
if (
|
|
3814
|
+
var l = r.tsParseInterfaceDeclaration(i, { declare: !0 });
|
|
3815
|
+
if (l) return l;
|
|
3816
3816
|
}
|
|
3817
3817
|
return V(c) ? r.tsParseDeclaration(i, r.value, !0) : void 0;
|
|
3818
3818
|
});
|
|
@@ -3830,25 +3830,25 @@ function rr(t) {
|
|
|
3830
3830
|
return this.tsMatchRightRelational();
|
|
3831
3831
|
}
|
|
3832
3832
|
}, p.tsParseDelimitedListWorker = function(i, r, n, c) {
|
|
3833
|
-
for (var
|
|
3833
|
+
for (var l = [], m = -1; !this.tsIsListTerminator(i); ) {
|
|
3834
3834
|
m = -1;
|
|
3835
3835
|
var y = r();
|
|
3836
3836
|
if (y == null) return;
|
|
3837
|
-
if (
|
|
3837
|
+
if (l.push(y), !this.eat(h.comma)) {
|
|
3838
3838
|
if (this.tsIsListTerminator(i)) break;
|
|
3839
3839
|
return void (n && this.expect(h.comma));
|
|
3840
3840
|
}
|
|
3841
3841
|
m = this.lastTokStart;
|
|
3842
3842
|
}
|
|
3843
|
-
return c && (c.value = m),
|
|
3843
|
+
return c && (c.value = m), l;
|
|
3844
3844
|
}, p.tsParseDelimitedList = function(i, r, n) {
|
|
3845
3845
|
return (function(c) {
|
|
3846
3846
|
if (c == null) throw new Error("Unexpected " + c + " value.");
|
|
3847
3847
|
return c;
|
|
3848
3848
|
})(this.tsParseDelimitedListWorker(i, r, !0, n));
|
|
3849
|
-
}, p.tsParseBracketedList = function(i, r, n, c,
|
|
3849
|
+
}, p.tsParseBracketedList = function(i, r, n, c, l) {
|
|
3850
3850
|
c || this.expect(n ? h.bracketL : h.relational);
|
|
3851
|
-
var m = this.tsParseDelimitedList(i, r,
|
|
3851
|
+
var m = this.tsParseDelimitedList(i, r, l);
|
|
3852
3852
|
return this.expect(n ? h.bracketR : h.relational), m;
|
|
3853
3853
|
}, p.tsParseTypeParameterName = function() {
|
|
3854
3854
|
return this.parseIdent().name;
|
|
@@ -3929,15 +3929,15 @@ function rr(t) {
|
|
|
3929
3929
|
return this.tsInType(function() {
|
|
3930
3930
|
var n = r.startNode();
|
|
3931
3931
|
r.expect(i);
|
|
3932
|
-
var c = r.startNode(),
|
|
3933
|
-
if (
|
|
3932
|
+
var c = r.startNode(), l = !!r.tsTryParse(r.tsParseTypePredicateAsserts.bind(r));
|
|
3933
|
+
if (l && r.match(h._this)) {
|
|
3934
3934
|
var m = r.tsParseThisTypeOrThisTypePredicate();
|
|
3935
3935
|
return m.type === "TSThisType" ? (c.parameterName = m, c.asserts = !0, c.typeAnnotation = null, m = r.finishNode(c, "TSTypePredicate")) : (r.resetStartLocationFromNode(m, c), m.asserts = !0), n.typeAnnotation = m, r.finishNode(n, "TSTypeAnnotation");
|
|
3936
3936
|
}
|
|
3937
3937
|
var y = r.tsIsIdentifier() && r.tsTryParse(r.tsParseTypePredicatePrefix.bind(r));
|
|
3938
|
-
if (!y) return
|
|
3938
|
+
if (!y) return l ? (c.parameterName = r.parseIdent(), c.asserts = l, c.typeAnnotation = null, n.typeAnnotation = r.finishNode(c, "TSTypePredicate"), r.finishNode(n, "TSTypeAnnotation")) : r.tsParseTypeAnnotation(!1, n);
|
|
3939
3939
|
var x = r.tsParseTypeAnnotation(!1);
|
|
3940
|
-
return c.parameterName = y, c.typeAnnotation = x, c.asserts =
|
|
3940
|
+
return c.parameterName = y, c.typeAnnotation = x, c.asserts = l, n.typeAnnotation = r.finishNode(c, "TSTypePredicate"), r.finishNode(n, "TSTypeAnnotation");
|
|
3941
3941
|
});
|
|
3942
3942
|
}, p.tsFillSignature = function(i, r) {
|
|
3943
3943
|
var n = i === h.arrow;
|
|
@@ -3953,11 +3953,11 @@ function rr(t) {
|
|
|
3953
3953
|
return n.tsFillSignature(h.arrow, c);
|
|
3954
3954
|
}), this.finishNode(c, i);
|
|
3955
3955
|
}, p.tsParseUnionOrIntersectionType = function(i, r, n) {
|
|
3956
|
-
var c = this.startNode(),
|
|
3956
|
+
var c = this.startNode(), l = this.eat(n), m = [];
|
|
3957
3957
|
do
|
|
3958
3958
|
m.push(r());
|
|
3959
3959
|
while (this.eat(n));
|
|
3960
|
-
return m.length !== 1 ||
|
|
3960
|
+
return m.length !== 1 || l ? (c.types = m, this.finishNode(c, i)) : m[0];
|
|
3961
3961
|
}, p.tsCheckTypeAnnotationForReadOnly = function(i) {
|
|
3962
3962
|
switch (i.typeAnnotation.type) {
|
|
3963
3963
|
case "TSTupleType":
|
|
@@ -4013,11 +4013,11 @@ function rr(t) {
|
|
|
4013
4013
|
var i = this.startNode();
|
|
4014
4014
|
return i.members = this.tsParseObjectTypeMembers(), this.finishNode(i, "TSTypeLiteral");
|
|
4015
4015
|
}, p.tsParseTupleElementType = function() {
|
|
4016
|
-
var i = this.startLoc, r = this.start, n = this.eat(h.ellipsis), c = this.tsParseType(),
|
|
4016
|
+
var i = this.startLoc, r = this.start, n = this.eat(h.ellipsis), c = this.tsParseType(), l = this.eat(h.question);
|
|
4017
4017
|
if (this.eat(h.colon)) {
|
|
4018
4018
|
var m = this.startNodeAtNode(c);
|
|
4019
|
-
m.optional =
|
|
4020
|
-
} else if (
|
|
4019
|
+
m.optional = l, c.type !== "TSTypeReference" || c.typeParameters || c.typeName.type !== "Identifier" ? (this.raise(c.start, A.InvalidTupleMemberLabel), m.label = c) : m.label = c.typeName, m.elementType = this.tsParseType(), c = this.finishNode(m, "TSNamedTupleMember");
|
|
4020
|
+
} else if (l) {
|
|
4021
4021
|
var y = this.startNodeAtNode(c);
|
|
4022
4022
|
y.typeAnnotation = c, c = this.finishNode(y, "TSOptionalType");
|
|
4023
4023
|
}
|
|
@@ -4030,13 +4030,13 @@ function rr(t) {
|
|
|
4030
4030
|
var i = this, r = this.startNode();
|
|
4031
4031
|
r.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), !0, !1);
|
|
4032
4032
|
var n = !1, c = null;
|
|
4033
|
-
return r.elementTypes.forEach(function(
|
|
4034
|
-
var m =
|
|
4035
|
-
!n || m === "TSRestType" || m === "TSOptionalType" || m === "TSNamedTupleMember" &&
|
|
4033
|
+
return r.elementTypes.forEach(function(l) {
|
|
4034
|
+
var m = l.type;
|
|
4035
|
+
!n || m === "TSRestType" || m === "TSOptionalType" || m === "TSNamedTupleMember" && l.optional || i.raise(l.start, A.OptionalTypeBeforeRequired), n || (n = m === "TSNamedTupleMember" && l.optional || m === "TSOptionalType");
|
|
4036
4036
|
var y = m;
|
|
4037
|
-
m === "TSRestType" && (y = (
|
|
4037
|
+
m === "TSRestType" && (y = (l = l.typeAnnotation).type);
|
|
4038
4038
|
var x = y === "TSNamedTupleMember";
|
|
4039
|
-
c != null || (c = x), c !== x && i.raise(
|
|
4039
|
+
c != null || (c = x), c !== x && i.raise(l.start, A.MixedLabeledAndUnlabeledElements);
|
|
4040
4040
|
}), this.finishNode(r, "TSTupleType");
|
|
4041
4041
|
}, p.tsParseTemplateLiteralType = function() {
|
|
4042
4042
|
var i = this.startNode();
|
|
@@ -4082,8 +4082,8 @@ function rr(t) {
|
|
|
4082
4082
|
default:
|
|
4083
4083
|
var r = this.type;
|
|
4084
4084
|
if (V(r) || r === h._void || r === h._null) {
|
|
4085
|
-
var n = r === h._void ? "TSVoidKeyword" : r === h._null ? "TSNullKeyword" : (function(
|
|
4086
|
-
switch (
|
|
4085
|
+
var n = r === h._void ? "TSVoidKeyword" : r === h._null ? "TSNullKeyword" : (function(l) {
|
|
4086
|
+
switch (l) {
|
|
4087
4087
|
case "any":
|
|
4088
4088
|
return "TSAnyKeyword";
|
|
4089
4089
|
case "boolean":
|
|
@@ -4196,19 +4196,19 @@ function rr(t) {
|
|
|
4196
4196
|
}
|
|
4197
4197
|
}
|
|
4198
4198
|
}, p.tsParseModifiersByMap = function(i) {
|
|
4199
|
-
for (var r = i.modified, n = i.map, c = 0,
|
|
4200
|
-
var m =
|
|
4199
|
+
for (var r = i.modified, n = i.map, c = 0, l = Object.keys(n); c < l.length; c++) {
|
|
4200
|
+
var m = l[c];
|
|
4201
4201
|
r[m] = n[m];
|
|
4202
4202
|
}
|
|
4203
4203
|
}, p.tsParseModifiers = function(i) {
|
|
4204
|
-
for (var r = this, n = i.modified, c = i.allowedModifiers,
|
|
4204
|
+
for (var r = this, n = i.modified, c = i.allowedModifiers, l = i.disallowedModifiers, m = i.stopOnStartOfClassStaticBlock, y = i.errorTemplate, x = y === void 0 ? A.InvalidModifierOnTypeMember : y, b = {}, T = function(U, j, q, G) {
|
|
4205
4205
|
j === q && n[G] && r.raise(U.column, A.InvalidModifiersOrder({ orderedModifiers: [q, G] }));
|
|
4206
4206
|
}, E = function(U, j, q, G) {
|
|
4207
4207
|
(n[q] && j === G || n[G] && j === q) && r.raise(U.column, A.IncompatibleModifiers({ modifiers: [q, G] }));
|
|
4208
4208
|
}; ; ) {
|
|
4209
|
-
var L = this.startLoc, k = this.tsParseModifier(c.concat(
|
|
4209
|
+
var L = this.startLoc, k = this.tsParseModifier(c.concat(l ?? []), m);
|
|
4210
4210
|
if (!k) break;
|
|
4211
|
-
ei(k) ? n.accessibility ? this.raise(this.start, A.DuplicateAccessibilityModifier()) : (T(L, k, k, "override"), T(L, k, k, "static"), T(L, k, k, "readonly"), T(L, k, k, "accessor"), b.accessibility = k, n.accessibility = k) : ir(k) ? n[k] ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (T(L, k, "in", "out"), b[k] = k, n[k] = !0) : er(k) ? n[k] ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (E(L, k, "accessor", "readonly"), E(L, k, "accessor", "static"), E(L, k, "accessor", "override"), b[k] = k, n[k] = !0) : Object.hasOwnProperty.call(n, k) ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (T(L, k, "static", "readonly"), T(L, k, "static", "override"), T(L, k, "override", "readonly"), T(L, k, "abstract", "override"), E(L, k, "declare", "override"), E(L, k, "static", "abstract"), b[k] = k, n[k] = !0),
|
|
4211
|
+
ei(k) ? n.accessibility ? this.raise(this.start, A.DuplicateAccessibilityModifier()) : (T(L, k, k, "override"), T(L, k, k, "static"), T(L, k, k, "readonly"), T(L, k, k, "accessor"), b.accessibility = k, n.accessibility = k) : ir(k) ? n[k] ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (T(L, k, "in", "out"), b[k] = k, n[k] = !0) : er(k) ? n[k] ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (E(L, k, "accessor", "readonly"), E(L, k, "accessor", "static"), E(L, k, "accessor", "override"), b[k] = k, n[k] = !0) : Object.hasOwnProperty.call(n, k) ? this.raise(this.start, A.DuplicateModifier({ modifier: k })) : (T(L, k, "static", "readonly"), T(L, k, "static", "override"), T(L, k, "override", "readonly"), T(L, k, "abstract", "override"), E(L, k, "declare", "override"), E(L, k, "static", "abstract"), b[k] = k, n[k] = !0), l != null && l.includes(k) && this.raise(this.start, x);
|
|
4212
4212
|
}
|
|
4213
4213
|
return b;
|
|
4214
4214
|
}, p.tsParseInOutModifiers = function(i) {
|
|
@@ -4222,8 +4222,8 @@ function rr(t) {
|
|
|
4222
4222
|
}), r.params.length === 0 && this.raise(this.start, A.EmptyTypeArguments), this.exprAllowed = !1, this.expect(h.relational), this.finishNode(r, "TSTypeParameterInstantiation");
|
|
4223
4223
|
}, p.tsParseHeritageClause = function(i) {
|
|
4224
4224
|
var r = this, n = this.start, c = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
4225
|
-
var
|
|
4226
|
-
return
|
|
4225
|
+
var l = r.startNode();
|
|
4226
|
+
return l.expression = r.tsParseEntityName(), r.tsMatchLeftRelational() && (l.typeParameters = r.tsParseTypeArguments()), r.finishNode(l, "TSExpressionWithTypeArguments");
|
|
4227
4227
|
});
|
|
4228
4228
|
return c.length || this.raise(n, A.EmptyHeritageClauseType({ token: i })), c;
|
|
4229
4229
|
}, p.tsParseTypeMemberSemicolon = function() {
|
|
@@ -4242,12 +4242,12 @@ function rr(t) {
|
|
|
4242
4242
|
r && this.raise(i.start, A.ReadonlyForMethodSignature);
|
|
4243
4243
|
var c = n;
|
|
4244
4244
|
c.kind && this.tsMatchLeftRelational() && this.raise(this.start, A.AccesorCannotHaveTypeParameters), this.tsFillSignature(h.colon, c), this.tsParseTypeMemberSemicolon();
|
|
4245
|
-
var
|
|
4246
|
-
if (c.kind === "get") c[
|
|
4245
|
+
var l = "parameters", m = "typeAnnotation";
|
|
4246
|
+
if (c.kind === "get") c[l].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(c[l][0]) && this.raise(this.start, A.AccesorCannotDeclareThisParameter));
|
|
4247
4247
|
else if (c.kind === "set") {
|
|
4248
|
-
if (c[
|
|
4248
|
+
if (c[l].length !== 1) this.raise(this.start, "A 'get' accesor must not have any formal parameters.");
|
|
4249
4249
|
else {
|
|
4250
|
-
var y = c[
|
|
4250
|
+
var y = c[l][0];
|
|
4251
4251
|
this.isThisParam(y) && this.raise(this.start, A.AccesorCannotDeclareThisParameter), y.type === "Identifier" && y.optional && this.raise(this.start, A.SetAccesorCannotHaveOptionalParameter), y.type === "RestElement" && this.raise(this.start, A.SetAccesorCannotHaveRestParameter);
|
|
4252
4252
|
}
|
|
4253
4253
|
c[m] && this.raise(c[m].start, A.SetAccesorCannotHaveReturnType);
|
|
@@ -4312,10 +4312,10 @@ function rr(t) {
|
|
|
4312
4312
|
if (V(c.type) && !this.isContextualWithState("from", c) || c.type === h.braceL) return !1;
|
|
4313
4313
|
}
|
|
4314
4314
|
} else if (!this.match(h._default)) return !1;
|
|
4315
|
-
var
|
|
4316
|
-
if (this.input.charCodeAt(
|
|
4315
|
+
var l = this.nextTokenStart(), m = this.isUnparsedContextual(l, "from");
|
|
4316
|
+
if (this.input.charCodeAt(l) === 44 || V(this.type) && m) return !0;
|
|
4317
4317
|
if (this.match(h._default) && m) {
|
|
4318
|
-
var y = this.input.charCodeAt(this.nextTokenStartSince(
|
|
4318
|
+
var y = this.input.charCodeAt(this.nextTokenStartSince(l + 4));
|
|
4319
4319
|
return y === 34 || y === 39;
|
|
4320
4320
|
}
|
|
4321
4321
|
return !1;
|
|
@@ -4382,25 +4382,25 @@ function rr(t) {
|
|
|
4382
4382
|
var n = this.nextTokenStart(), c = this.isUnparsedContextual(n, "from");
|
|
4383
4383
|
if (this.input.charCodeAt(n) === 44 || V(this.type) && c) return !0;
|
|
4384
4384
|
if (this.match(h._default) && c) {
|
|
4385
|
-
var
|
|
4386
|
-
return
|
|
4385
|
+
var l = this.input.charCodeAt(this.nextTokenStartSince(n + 4));
|
|
4386
|
+
return l === 34 || l === 39;
|
|
4387
4387
|
}
|
|
4388
4388
|
return !1;
|
|
4389
4389
|
}, p.parseTemplate = function(i) {
|
|
4390
4390
|
var r = (i === void 0 ? {} : i).isTagged, n = r !== void 0 && r, c = this.startNode();
|
|
4391
4391
|
this.next(), c.expressions = [];
|
|
4392
|
-
var
|
|
4393
|
-
for (c.quasis = [
|
|
4392
|
+
var l = this.parseTemplateElement({ isTagged: n });
|
|
4393
|
+
for (c.quasis = [l]; !l.tail; ) this.type === h.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(h.dollarBraceL), c.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()), this.expect(h.braceR), c.quasis.push(l = this.parseTemplateElement({ isTagged: n }));
|
|
4394
4394
|
return this.next(), this.finishNode(c, "TemplateLiteral");
|
|
4395
|
-
}, p.parseFunction = function(i, r, n, c,
|
|
4395
|
+
}, p.parseFunction = function(i, r, n, c, l) {
|
|
4396
4396
|
this.initFunction(i), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !c) && (this.type === h.star && 2 & r && this.unexpected(), i.generator = this.eat(h.star)), this.options.ecmaVersion >= 8 && (i.async = !!c), 1 & r && (i.id = 4 & r && this.type !== h.name ? null : this.parseIdent());
|
|
4397
4397
|
var m = this.yieldPos, y = this.awaitPos, x = this.awaitIdentPos, b = this.maybeInArrowParameters;
|
|
4398
4398
|
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(i.async, i.generator)), 1 & r || (i.id = this.type === h.name ? this.parseIdent() : null), this.parseFunctionParams(i);
|
|
4399
4399
|
var T = 1 & r;
|
|
4400
|
-
return this.parseFunctionBody(i, n, !1,
|
|
4401
|
-
}, p.parseFunctionBody = function(i, r, n, c,
|
|
4400
|
+
return this.parseFunctionBody(i, n, !1, l, { isFunctionDeclaration: T }), this.yieldPos = m, this.awaitPos = y, this.awaitIdentPos = x, 1 & r && i.id && !(2 & r) && this.checkLValSimple(i.id, i.body ? this.strict || i.generator || i.async ? this.treatFunctionsAsVar ? 1 : 2 : 3 : 0), this.maybeInArrowParameters = b, this.finishNode(i, T ? "FunctionDeclaration" : "FunctionExpression");
|
|
4401
|
+
}, p.parseFunctionBody = function(i, r, n, c, l) {
|
|
4402
4402
|
r === void 0 && (r = !1), n === void 0 && (n = !1), c === void 0 && (c = !1), this.match(h.colon) && (i.returnType = this.tsParseTypeOrTypePredicateAnnotation(h.colon));
|
|
4403
|
-
var m =
|
|
4403
|
+
var m = l != null && l.isFunctionDeclaration ? "TSDeclareFunction" : l != null && l.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
4404
4404
|
return m && !this.match(h.braceL) && this.isLineTerminator() ? this.finishNode(i, m) : m === "TSDeclareFunction" && this.isAmbientContext && (this.raise(i.start, A.DeclareFunctionHasImplementation), i.declare) ? (S.prototype.parseFunctionBody.call(this, i, r, n, !1), this.finishNode(i, m)) : (S.prototype.parseFunctionBody.call(this, i, r, n, c), i);
|
|
4405
4405
|
}, p.parseNew = function() {
|
|
4406
4406
|
var i;
|
|
@@ -4411,19 +4411,19 @@ function rr(t) {
|
|
|
4411
4411
|
var c = this.containsEsc;
|
|
4412
4412
|
return r.property = this.parseIdent(!0), r.property.name !== "target" && this.raiseRecoverable(r.property.start, "The only valid meta property for new is 'new.target'"), c && this.raiseRecoverable(r.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(r.start, "'new.target' can only be used in functions and class static block"), this.finishNode(r, "MetaProperty");
|
|
4413
4413
|
}
|
|
4414
|
-
var
|
|
4415
|
-
r.callee = this.parseSubscripts(this.parseExprAtom(),
|
|
4414
|
+
var l = this.start, m = this.startLoc, y = this.type === h._import;
|
|
4415
|
+
r.callee = this.parseSubscripts(this.parseExprAtom(), l, m, !0, !1), y && r.callee.type === "ImportExpression" && this.raise(l, "Cannot use new with import()");
|
|
4416
4416
|
var x = r.callee;
|
|
4417
4417
|
return x.type !== "TSInstantiationExpression" || (i = x.extra) != null && i.parenthesized || (r.typeParameters = x.typeParameters, r.callee = x.expression), r.arguments = this.eat(h.parenL) ? this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1) : [], this.finishNode(r, "NewExpression");
|
|
4418
|
-
}, p.parseExprOp = function(i, r, n, c,
|
|
4418
|
+
}, p.parseExprOp = function(i, r, n, c, l) {
|
|
4419
4419
|
var m;
|
|
4420
|
-
if (h._in.binop > c && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (m = "TSAsExpression"),
|
|
4420
|
+
if (h._in.binop > c && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (m = "TSAsExpression"), f && this.isContextual("satisfies") && (m = "TSSatisfiesExpression"), m)) {
|
|
4421
4421
|
var y = this.startNodeAt(r, n);
|
|
4422
4422
|
y.expression = i;
|
|
4423
4423
|
var x = this.tsTryNextParseConstantContext();
|
|
4424
|
-
return y.typeAnnotation = x || this.tsNextThenParseType(), this.finishNode(y, m), this.reScan_lt_gt(), this.parseExprOp(y, r, n, c,
|
|
4424
|
+
return y.typeAnnotation = x || this.tsNextThenParseType(), this.finishNode(y, m), this.reScan_lt_gt(), this.parseExprOp(y, r, n, c, l);
|
|
4425
4425
|
}
|
|
4426
|
-
return S.prototype.parseExprOp.call(this, i, r, n, c,
|
|
4426
|
+
return S.prototype.parseExprOp.call(this, i, r, n, c, l);
|
|
4427
4427
|
}, p.parseImportSpecifiers = function() {
|
|
4428
4428
|
var i = [], r = !0;
|
|
4429
4429
|
if (g.tokenIsIdentifier(this.type) && (i.push(this.parseImportDefaultSpecifier()), !this.eat(h.comma))) return i;
|
|
@@ -4475,8 +4475,8 @@ function rr(t) {
|
|
|
4475
4475
|
return this.importOrExportOuterKind = void 0, c;
|
|
4476
4476
|
}
|
|
4477
4477
|
if (this.ts_eatWithState(h.eq, 2, n)) {
|
|
4478
|
-
var
|
|
4479
|
-
return
|
|
4478
|
+
var l = i;
|
|
4479
|
+
return l.expression = this.parseExpression(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(l, "TSExportAssignment");
|
|
4480
4480
|
}
|
|
4481
4481
|
if (this.ts_eatContextualWithState("as", 2, n)) {
|
|
4482
4482
|
var m = i;
|
|
@@ -4516,11 +4516,11 @@ function rr(t) {
|
|
|
4516
4516
|
if (this.type === I.jsxTagStart) return this.jsx_parseElement();
|
|
4517
4517
|
if (this.type === I.at) return this.parseDecorators(), this.parseExprAtom();
|
|
4518
4518
|
if (V(this.type)) {
|
|
4519
|
-
var c = this.potentialArrowAt === this.start,
|
|
4520
|
-
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(h._function)) return this.overrideContext(lt.f_expr), this.parseFunction(this.startNodeAt(
|
|
4519
|
+
var c = this.potentialArrowAt === this.start, l = this.start, m = this.startLoc, y = this.containsEsc, x = this.parseIdent(!1);
|
|
4520
|
+
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(h._function)) return this.overrideContext(lt.f_expr), this.parseFunction(this.startNodeAt(l, m), 0, !1, !0, r);
|
|
4521
4521
|
if (c && !this.canInsertSemicolon()) {
|
|
4522
|
-
if (this.eat(h.arrow)) return this.parseArrowExpression(this.startNodeAt(
|
|
4523
|
-
if (this.options.ecmaVersion >= 8 && x.name === "async" && this.type === h.name && !y && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return x = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(h.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(
|
|
4522
|
+
if (this.eat(h.arrow)) return this.parseArrowExpression(this.startNodeAt(l, m), [x], !1, r);
|
|
4523
|
+
if (this.options.ecmaVersion >= 8 && x.name === "async" && this.type === h.name && !y && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return x = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(h.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(l, m), [x], !0, r);
|
|
4524
4524
|
}
|
|
4525
4525
|
return x;
|
|
4526
4526
|
}
|
|
@@ -4533,8 +4533,8 @@ function rr(t) {
|
|
|
4533
4533
|
if (c === h._function) return this.next(), this.parseFunction(this.startNodeAtNode(n), void 0, !0, !0);
|
|
4534
4534
|
if (V(c)) {
|
|
4535
4535
|
if (this.lookaheadCharCode() === 61) {
|
|
4536
|
-
var
|
|
4537
|
-
return !this.canInsertSemicolon() && this.eat(h.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(n), [
|
|
4536
|
+
var l = this.parseIdent(!1);
|
|
4537
|
+
return !this.canInsertSemicolon() && this.eat(h.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(n), [l], !0);
|
|
4538
4538
|
}
|
|
4539
4539
|
return n;
|
|
4540
4540
|
}
|
|
@@ -4549,13 +4549,13 @@ function rr(t) {
|
|
|
4549
4549
|
n === void 0 && (n = !1);
|
|
4550
4550
|
var c = this.isAmbientContext;
|
|
4551
4551
|
this.next(), S.prototype.parseVar.call(this, i, !1, r, n || c), this.semicolon();
|
|
4552
|
-
var
|
|
4553
|
-
if (!c) return
|
|
4554
|
-
for (var m, y = Je(
|
|
4552
|
+
var l = this.finishNode(i, "VariableDeclaration");
|
|
4553
|
+
if (!c) return l;
|
|
4554
|
+
for (var m, y = Je(l.declarations); !(m = y()).done; ) {
|
|
4555
4555
|
var x = m.value, b = x.init;
|
|
4556
4556
|
b && (r !== "const" || x.id.typeAnnotation ? this.raise(b.start, A.InitializerNotAllowedInAmbientContext) : b.type !== "StringLiteral" && b.type !== "BooleanLiteral" && b.type !== "NumericLiteral" && b.type !== "BigIntLiteral" && (b.type !== "TemplateLiteral" || b.expressions.length > 0) && !sr(b) && this.raise(b.start, A.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));
|
|
4557
4557
|
}
|
|
4558
|
-
return
|
|
4558
|
+
return l;
|
|
4559
4559
|
}, p.parseStatement = function(i, r, n) {
|
|
4560
4560
|
if (this.match(I.at) && this.parseDecorators(!0), this.match(h._const) && this.isLookaheadContextual("enum")) {
|
|
4561
4561
|
var c = this.startNode();
|
|
@@ -4563,8 +4563,8 @@ function rr(t) {
|
|
|
4563
4563
|
}
|
|
4564
4564
|
if (this.ts_isContextual(I.enum)) return this.tsParseEnumDeclaration(this.startNode());
|
|
4565
4565
|
if (this.ts_isContextual(I.interface)) {
|
|
4566
|
-
var
|
|
4567
|
-
if (
|
|
4566
|
+
var l = this.tsParseInterfaceDeclaration(this.startNode());
|
|
4567
|
+
if (l) return l;
|
|
4568
4568
|
}
|
|
4569
4569
|
return S.prototype.parseStatement.call(this, i, r, n);
|
|
4570
4570
|
}, p.parseAccessModifier = function() {
|
|
@@ -4575,18 +4575,18 @@ function rr(t) {
|
|
|
4575
4575
|
return (r.type === "Identifier" ? this.tsParseExpressionStatement(i, r) : void 0) || S.prototype.parseExpressionStatement.call(this, i, r);
|
|
4576
4576
|
}, p.shouldParseExportStatement = function() {
|
|
4577
4577
|
return !!this.tsIsDeclarationStart() || !!this.match(I.at) || S.prototype.shouldParseExportStatement.call(this);
|
|
4578
|
-
}, p.parseConditional = function(i, r, n, c,
|
|
4578
|
+
}, p.parseConditional = function(i, r, n, c, l) {
|
|
4579
4579
|
if (this.eat(h.question)) {
|
|
4580
4580
|
var m = this.startNodeAt(r, n);
|
|
4581
4581
|
return m.test = i, m.consequent = this.parseMaybeAssign(), this.expect(h.colon), m.alternate = this.parseMaybeAssign(c), this.finishNode(m, "ConditionalExpression");
|
|
4582
4582
|
}
|
|
4583
4583
|
return i;
|
|
4584
4584
|
}, p.parseMaybeConditional = function(i, r) {
|
|
4585
|
-
var n = this, c = this.start,
|
|
4585
|
+
var n = this, c = this.start, l = this.startLoc, m = this.parseExprOps(i, r);
|
|
4586
4586
|
if (this.checkExpressionErrors(r)) return m;
|
|
4587
|
-
if (!this.maybeInArrowParameters || !this.match(h.question)) return this.parseConditional(m, c,
|
|
4587
|
+
if (!this.maybeInArrowParameters || !this.match(h.question)) return this.parseConditional(m, c, l, i, r);
|
|
4588
4588
|
var y = this.tryParse(function() {
|
|
4589
|
-
return n.parseConditional(m, c,
|
|
4589
|
+
return n.parseConditional(m, c, l, i, r);
|
|
4590
4590
|
});
|
|
4591
4591
|
return y.node ? (y.error && this.setLookaheadState(y.failState), y.node) : (y.error && this.setOptionalParametersError(r, y.error), m);
|
|
4592
4592
|
}, p.parseParenItem = function(i) {
|
|
@@ -4601,10 +4601,10 @@ function rr(t) {
|
|
|
4601
4601
|
if (!this.isAmbientContext && this.ts_isContextual(I.declare)) return this.tsInAmbientContext(function() {
|
|
4602
4602
|
return r.parseExportDeclaration(i);
|
|
4603
4603
|
});
|
|
4604
|
-
var n = this.start, c = this.startLoc,
|
|
4605
|
-
!
|
|
4604
|
+
var n = this.start, c = this.startLoc, l = this.eatContextual("declare");
|
|
4605
|
+
!l || !this.ts_isContextual(I.declare) && this.shouldParseExportStatement() || this.raise(this.start, A.ExpectedAmbientAfterExportDeclare);
|
|
4606
4606
|
var m = V(this.type) && this.tsTryParseExportDeclaration() || this.parseStatement(null);
|
|
4607
|
-
return m ? ((m.type === "TSInterfaceDeclaration" || m.type === "TSTypeAliasDeclaration" ||
|
|
4607
|
+
return m ? ((m.type === "TSInterfaceDeclaration" || m.type === "TSTypeAliasDeclaration" || l) && (i.exportKind = "type"), l && (this.resetStartLocation(m, n, c), m.declare = !0), m) : null;
|
|
4608
4608
|
}, p.parseClassId = function(i, r) {
|
|
4609
4609
|
if (r || !this.isContextual("implements")) {
|
|
4610
4610
|
S.prototype.parseClassId.call(this, i, r);
|
|
@@ -4623,8 +4623,8 @@ function rr(t) {
|
|
|
4623
4623
|
}
|
|
4624
4624
|
return S.prototype.parseClassField.call(this, i);
|
|
4625
4625
|
}, p.parseClassMethod = function(i, r, n, c) {
|
|
4626
|
-
var
|
|
4627
|
-
m ? (y && (i.typeParameters = y), i.accessibility && this.raise(i.start, A.PrivateMethodsHasAccessibility({ modifier: i.accessibility }))) : y &&
|
|
4626
|
+
var l = i.kind === "constructor", m = i.key.type === "PrivateIdentifier", y = this.tsTryParseTypeParameters();
|
|
4627
|
+
m ? (y && (i.typeParameters = y), i.accessibility && this.raise(i.start, A.PrivateMethodsHasAccessibility({ modifier: i.accessibility }))) : y && l && this.raise(y.start, A.ConstructorHasTypeParameters);
|
|
4628
4628
|
var x = i.declare, b = i.kind;
|
|
4629
4629
|
!(x !== void 0 && x) || b !== "get" && b !== "set" || this.raise(i.start, A.DeclareAccessor({ kind: b })), y && (i.typeParameters = y);
|
|
4630
4630
|
var T = i.key;
|
|
@@ -4636,25 +4636,25 @@ function rr(t) {
|
|
|
4636
4636
|
}, p.parseClassElement = function(i) {
|
|
4637
4637
|
var r = this;
|
|
4638
4638
|
if (this.eat(h.semi)) return null;
|
|
4639
|
-
var n, c = this.options.ecmaVersion,
|
|
4639
|
+
var n, c = this.options.ecmaVersion, l = this.startNode(), m = "", y = !1, x = !1, b = "method", T = ["declare", "private", "public", "protected", "accessor", "override", "abstract", "readonly", "static"], E = this.tsParseModifiers({ modified: l, allowedModifiers: T, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: !0, errorTemplate: A.InvalidModifierOnTypeParameterPositions });
|
|
4640
4640
|
n = !!E.static;
|
|
4641
4641
|
var L = function() {
|
|
4642
4642
|
if (!r.tsIsStartOfStaticBlocks()) {
|
|
4643
|
-
var k = r.tsTryParseIndexSignature(
|
|
4644
|
-
if (k) return
|
|
4645
|
-
if (!r.inAbstractClass &&
|
|
4643
|
+
var k = r.tsTryParseIndexSignature(l);
|
|
4644
|
+
if (k) return l.abstract && r.raise(l.start, A.IndexSignatureHasAbstract), l.accessibility && r.raise(l.start, A.IndexSignatureHasAccessibility({ modifier: l.accessibility })), l.declare && r.raise(l.start, A.IndexSignatureHasDeclare), l.override && r.raise(l.start, A.IndexSignatureHasOverride), k;
|
|
4645
|
+
if (!r.inAbstractClass && l.abstract && r.raise(l.start, A.NonAbstractClassHasAbstractMethod), l.override && i && r.raise(l.start, A.OverrideNotInSubClass), l.static = n, n && (r.isClassElementNameStart() || r.type === h.star || (m = "static")), !m && c >= 8 && r.eatContextual("async") && (!r.isClassElementNameStart() && r.type !== h.star || r.canInsertSemicolon() ? m = "async" : x = !0), !m && (c >= 9 || !x) && r.eat(h.star) && (y = !0), !m && !x && !y) {
|
|
4646
4646
|
var U = r.value;
|
|
4647
4647
|
(r.eatContextual("get") || r.eatContextual("set")) && (r.isClassElementNameStart() ? b = U : m = U);
|
|
4648
4648
|
}
|
|
4649
|
-
if (m ? (
|
|
4650
|
-
var j = !
|
|
4651
|
-
j && b !== "method" && r.raise(
|
|
4652
|
-
} else r.parseClassField(
|
|
4653
|
-
return
|
|
4649
|
+
if (m ? (l.computed = !1, l.key = r.startNodeAt(r.lastTokStart, r.lastTokStartLoc), l.key.name = m, r.finishNode(l.key, "Identifier")) : r.parseClassElementName(l), r.parsePostMemberNameModifiers(l), r.isClassMethod() || c < 13 || r.type === h.parenL || b !== "method" || y || x) {
|
|
4650
|
+
var j = !l.static && Ze(l, "constructor"), q = j && i;
|
|
4651
|
+
j && b !== "method" && r.raise(l.key.start, "Constructor can't have get/set modifier"), l.kind = j ? "constructor" : b, r.parseClassMethod(l, y, x, q);
|
|
4652
|
+
} else r.parseClassField(l);
|
|
4653
|
+
return l;
|
|
4654
4654
|
}
|
|
4655
|
-
if (r.next(), r.next(), r.tsHasSomeModifiers(
|
|
4655
|
+
if (r.next(), r.next(), r.tsHasSomeModifiers(l, T) && r.raise(r.start, A.StaticBlockCannotHaveModifier), c >= 13) return S.prototype.parseClassStaticBlock.call(r, l), l;
|
|
4656
4656
|
};
|
|
4657
|
-
return
|
|
4657
|
+
return l.declare ? this.tsInAmbientContext(L) : L(), l;
|
|
4658
4658
|
}, p.isClassElementNameStart = function() {
|
|
4659
4659
|
return !!this.tsIsIdentifier() || S.prototype.isClassElementNameStart.call(this);
|
|
4660
4660
|
}, p.parseClassSuper = function(i) {
|
|
@@ -4668,17 +4668,17 @@ function rr(t) {
|
|
|
4668
4668
|
n && (i.id.typeAnnotation = n, this.resetEndLocation(i.id));
|
|
4669
4669
|
}, p.parseArrowExpression = function(i, r, n, c) {
|
|
4670
4670
|
this.match(h.colon) && (i.returnType = this.tsParseTypeAnnotation());
|
|
4671
|
-
var
|
|
4671
|
+
var l = this.yieldPos, m = this.awaitPos, y = this.awaitIdentPos;
|
|
4672
4672
|
this.enterScope(16 | Se(n, !1)), this.initFunction(i);
|
|
4673
4673
|
var x = this.maybeInArrowParameters;
|
|
4674
|
-
return this.options.ecmaVersion >= 8 && (i.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, i.params = this.toAssignableList(r, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(i, !0, !1, c), this.yieldPos =
|
|
4674
|
+
return this.options.ecmaVersion >= 8 && (i.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, i.params = this.toAssignableList(r, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(i, !0, !1, c), this.yieldPos = l, this.awaitPos = m, this.awaitIdentPos = y, this.maybeInArrowParameters = x, this.finishNode(i, "ArrowFunctionExpression");
|
|
4675
4675
|
}, p.parseMaybeAssignOrigin = function(i, r, n) {
|
|
4676
4676
|
if (this.isContextual("yield")) {
|
|
4677
4677
|
if (this.inGenerator) return this.parseYield(i);
|
|
4678
4678
|
this.exprAllowed = !1;
|
|
4679
4679
|
}
|
|
4680
|
-
var c = !1,
|
|
4681
|
-
r ? (
|
|
4680
|
+
var c = !1, l = -1, m = -1, y = -1;
|
|
4681
|
+
r ? (l = r.parenthesizedAssign, m = r.trailingComma, y = r.doubleProto, r.parenthesizedAssign = r.trailingComma = -1) : (r = new jt(), c = !0);
|
|
4682
4682
|
var x = this.start, b = this.startLoc;
|
|
4683
4683
|
(this.type === h.parenL || V(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = i === "await");
|
|
4684
4684
|
var T = this.parseMaybeConditional(i, r);
|
|
@@ -4686,9 +4686,9 @@ function rr(t) {
|
|
|
4686
4686
|
var E = this.startNodeAt(x, b);
|
|
4687
4687
|
return E.operator = this.value, this.type === h.eq && (T = this.toAssignable(T, !0, r)), c || (r.parenthesizedAssign = r.trailingComma = r.doubleProto = -1), r.shorthandAssign >= T.start && (r.shorthandAssign = -1), this.type === h.eq ? this.checkLValPattern(T) : this.checkLValSimple(T), E.left = T, this.next(), E.right = this.parseMaybeAssign(i), y > -1 && (r.doubleProto = y), this.finishNode(E, "AssignmentExpression");
|
|
4688
4688
|
}
|
|
4689
|
-
return c && this.checkExpressionErrors(r, !0),
|
|
4689
|
+
return c && this.checkExpressionErrors(r, !0), l > -1 && (r.parenthesizedAssign = l), m > -1 && (r.trailingComma = m), T;
|
|
4690
4690
|
}, p.parseMaybeAssign = function(i, r, n) {
|
|
4691
|
-
var c,
|
|
4691
|
+
var c, l, m, y, x, b, T, E, L, k, U, j = this;
|
|
4692
4692
|
if (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational()) {
|
|
4693
4693
|
if (E = this.cloneCurLookaheadState(), !(L = this.tryParse(function() {
|
|
4694
4694
|
return j.parseMaybeAssignOrigin(i, r, n);
|
|
@@ -4708,22 +4708,22 @@ function rr(t) {
|
|
|
4708
4708
|
if (!L && (ti(!0), !(k = this.tryParse(function() {
|
|
4709
4709
|
return j.parseMaybeAssignOrigin(i, r, n);
|
|
4710
4710
|
}, E)).error)) return k.node;
|
|
4711
|
-
if ((
|
|
4711
|
+
if ((l = L) != null && l.node) return this.setLookaheadState(L.failState), L.node;
|
|
4712
4712
|
if (it.node) return this.setLookaheadState(it.failState), U && this.reportReservedArrowTypeParam(U), it.node;
|
|
4713
4713
|
if ((m = k) != null && m.node) return this.setLookaheadState(k.failState), k.node;
|
|
4714
4714
|
throw (y = L) != null && y.thrown ? L.error : it.thrown ? it.error : (x = k) != null && x.thrown ? k.error : ((b = L) == null ? void 0 : b.error) || it.error || ((T = k) == null ? void 0 : T.error);
|
|
4715
4715
|
}, p.parseAssignableListItem = function(i) {
|
|
4716
4716
|
for (var r = []; this.match(I.at); ) r.push(this.parseDecorator());
|
|
4717
|
-
var n, c = this.start,
|
|
4717
|
+
var n, c = this.start, l = this.startLoc, m = !1, y = !1;
|
|
4718
4718
|
if (i !== void 0) {
|
|
4719
4719
|
var x = {};
|
|
4720
|
-
this.tsParseModifiers({ modified: x, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), n = x.accessibility, y = x.override, m = x.readonly, i === !1 && (n || m || y) && this.raise(
|
|
4720
|
+
this.tsParseModifiers({ modified: x, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), n = x.accessibility, y = x.override, m = x.readonly, i === !1 && (n || m || y) && this.raise(l.start, A.UnexpectedParameterModifier);
|
|
4721
4721
|
}
|
|
4722
|
-
var b = this.parseMaybeDefault(c,
|
|
4722
|
+
var b = this.parseMaybeDefault(c, l);
|
|
4723
4723
|
this.parseBindingListItem(b);
|
|
4724
4724
|
var T = this.parseMaybeDefault(b.start, b.loc, b);
|
|
4725
4725
|
if (r.length && (T.decorators = r), n || m || y) {
|
|
4726
|
-
var E = this.startNodeAt(c,
|
|
4726
|
+
var E = this.startNodeAt(c, l);
|
|
4727
4727
|
return n && (E.accessibility = n), m && (E.readonly = m), y && (E.override = y), T.type !== "Identifier" && T.type !== "AssignmentPattern" && this.raise(E.start, A.UnsupportedParameterPropertyKind), E.parameter = T, this.finishNode(E, "TSParameterProperty");
|
|
4728
4728
|
}
|
|
4729
4729
|
return T;
|
|
@@ -4747,8 +4747,8 @@ function rr(t) {
|
|
|
4747
4747
|
return !0;
|
|
4748
4748
|
case "ObjectExpression":
|
|
4749
4749
|
var c = i.properties.length - 1;
|
|
4750
|
-
return i.properties.every(function(
|
|
4751
|
-
return
|
|
4750
|
+
return i.properties.every(function(l, m) {
|
|
4751
|
+
return l.type !== "ObjectMethod" && (m === c || l.type !== "SpreadElement") && n.isAssignable(l);
|
|
4752
4752
|
});
|
|
4753
4753
|
case "Property":
|
|
4754
4754
|
case "ObjectProperty":
|
|
@@ -4756,8 +4756,8 @@ function rr(t) {
|
|
|
4756
4756
|
case "SpreadElement":
|
|
4757
4757
|
return this.isAssignable(i.argument);
|
|
4758
4758
|
case "ArrayExpression":
|
|
4759
|
-
return i.elements.every(function(
|
|
4760
|
-
return
|
|
4759
|
+
return i.elements.every(function(l) {
|
|
4760
|
+
return l === null || n.isAssignable(l);
|
|
4761
4761
|
});
|
|
4762
4762
|
case "AssignmentExpression":
|
|
4763
4763
|
return i.operator === "=";
|
|
@@ -4813,13 +4813,13 @@ function rr(t) {
|
|
|
4813
4813
|
return this.type === h._this ? this.parseIdent(!0) : S.prototype.parseBindingAtom.call(this);
|
|
4814
4814
|
}, p.shouldParseArrow = function(i) {
|
|
4815
4815
|
var r, n = this;
|
|
4816
|
-
if (r = this.match(h.colon) ? i.every(function(
|
|
4817
|
-
return n.isAssignable(
|
|
4816
|
+
if (r = this.match(h.colon) ? i.every(function(l) {
|
|
4817
|
+
return n.isAssignable(l, !0);
|
|
4818
4818
|
}) : !this.canInsertSemicolon()) {
|
|
4819
4819
|
if (this.match(h.colon)) {
|
|
4820
|
-
var c = this.tryParse(function(
|
|
4820
|
+
var c = this.tryParse(function(l) {
|
|
4821
4821
|
var m = n.tsParseTypeOrTypePredicateAnnotation(h.colon);
|
|
4822
|
-
return !n.canInsertSemicolon() && n.match(h.arrow) ||
|
|
4822
|
+
return !n.canInsertSemicolon() && n.match(h.arrow) || l(), m;
|
|
4823
4823
|
});
|
|
4824
4824
|
if (c.aborted) return this.shouldParseArrowReturnType = void 0, !1;
|
|
4825
4825
|
c.thrown || (c.error && this.setLookaheadState(c.failState), this.shouldParseArrowReturnType = c.node);
|
|
@@ -4828,10 +4828,10 @@ function rr(t) {
|
|
|
4828
4828
|
}
|
|
4829
4829
|
return this.shouldParseArrowReturnType = void 0, r;
|
|
4830
4830
|
}, p.parseParenArrowList = function(i, r, n, c) {
|
|
4831
|
-
var
|
|
4832
|
-
return
|
|
4831
|
+
var l = this.startNodeAt(i, r);
|
|
4832
|
+
return l.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(l, n, !1, c);
|
|
4833
4833
|
}, p.parseParenAndDistinguishExpression = function(i, r) {
|
|
4834
|
-
var n, c = this.start,
|
|
4834
|
+
var n, c = this.start, l = this.startLoc, m = this.options.ecmaVersion >= 8;
|
|
4835
4835
|
if (this.options.ecmaVersion >= 6) {
|
|
4836
4836
|
var y = this.maybeInArrowParameters;
|
|
4837
4837
|
this.maybeInArrowParameters = !0, this.next();
|
|
@@ -4848,17 +4848,17 @@ function rr(t) {
|
|
|
4848
4848
|
E.push(this.parseMaybeAssign(r, U, this.parseParenItem));
|
|
4849
4849
|
}
|
|
4850
4850
|
var G = this.lastTokEnd, it = this.lastTokEndLoc;
|
|
4851
|
-
if (this.expect(h.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(h.arrow)) return this.checkPatternErrors(U, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = j, this.awaitPos = q, this.parseParenArrowList(c,
|
|
4851
|
+
if (this.expect(h.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(h.arrow)) return this.checkPatternErrors(U, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = j, this.awaitPos = q, this.parseParenArrowList(c, l, E, r);
|
|
4852
4852
|
E.length && !k || this.unexpected(this.lastTokStart), x && this.unexpected(x), this.checkExpressionErrors(U, !0), this.yieldPos = j || this.yieldPos, this.awaitPos = q || this.awaitPos, E.length > 1 ? ((n = this.startNodeAt(b, T)).expressions = E, this.finishNodeAt(n, "SequenceExpression", G, it)) : n = E[0];
|
|
4853
4853
|
} else n = this.parseParenExpression();
|
|
4854
4854
|
if (this.options.preserveParens) {
|
|
4855
|
-
var Pt = this.startNodeAt(c,
|
|
4855
|
+
var Pt = this.startNodeAt(c, l);
|
|
4856
4856
|
return Pt.expression = n, this.finishNode(Pt, "ParenthesizedExpression");
|
|
4857
4857
|
}
|
|
4858
4858
|
return n;
|
|
4859
4859
|
}, p.parseTaggedTemplateExpression = function(i, r, n, c) {
|
|
4860
|
-
var
|
|
4861
|
-
return
|
|
4860
|
+
var l = this.startNodeAt(r, n);
|
|
4861
|
+
return l.tag = i, l.quasi = this.parseTemplate({ isTagged: !0 }), c && this.raise(r, "Tagged Template Literals are not allowed in optionalChain."), this.finishNode(l, "TaggedTemplateExpression");
|
|
4862
4862
|
}, p.shouldParseAsyncArrow = function() {
|
|
4863
4863
|
var i = this;
|
|
4864
4864
|
if (!this.match(h.colon)) return !this.canInsertSemicolon() && this.eat(h.arrow);
|
|
@@ -4868,17 +4868,17 @@ function rr(t) {
|
|
|
4868
4868
|
});
|
|
4869
4869
|
return r.aborted ? (this.shouldParseAsyncArrowReturnType = void 0, !1) : r.thrown ? void 0 : (r.error && this.setLookaheadState(r.failState), this.shouldParseAsyncArrowReturnType = r.node, !this.canInsertSemicolon() && this.eat(h.arrow));
|
|
4870
4870
|
}, p.parseSubscriptAsyncArrow = function(i, r, n, c) {
|
|
4871
|
-
var
|
|
4872
|
-
return
|
|
4871
|
+
var l = this.startNodeAt(i, r);
|
|
4872
|
+
return l.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(l, n, !0, c);
|
|
4873
4873
|
}, p.parseExprList = function(i, r, n, c) {
|
|
4874
|
-
for (var
|
|
4874
|
+
for (var l = [], m = !0; !this.eat(i); ) {
|
|
4875
4875
|
if (m) m = !1;
|
|
4876
4876
|
else if (this.expect(h.comma), r && this.afterTrailingComma(i)) break;
|
|
4877
4877
|
var y = void 0;
|
|
4878
|
-
n && this.type === h.comma ? y = null : this.type === h.ellipsis ? (y = this.parseSpread(c), c && this.type === h.comma && c.trailingComma < 0 && (c.trailingComma = this.start)) : y = this.parseMaybeAssign(!1, c, this.parseParenItem),
|
|
4878
|
+
n && this.type === h.comma ? y = null : this.type === h.ellipsis ? (y = this.parseSpread(c), c && this.type === h.comma && c.trailingComma < 0 && (c.trailingComma = this.start)) : y = this.parseMaybeAssign(!1, c, this.parseParenItem), l.push(y);
|
|
4879
4879
|
}
|
|
4880
|
-
return
|
|
4881
|
-
}, p.parseSubscript = function(i, r, n, c,
|
|
4880
|
+
return l;
|
|
4881
|
+
}, p.parseSubscript = function(i, r, n, c, l, m, y) {
|
|
4882
4882
|
var x = this, b = m;
|
|
4883
4883
|
if (!this.hasPrecedingLineBreak() && this.value === "!" && this.match(h.prefix)) {
|
|
4884
4884
|
this.exprAllowed = !1, this.next();
|
|
@@ -4927,7 +4927,7 @@ function rr(t) {
|
|
|
4927
4927
|
var Pt = new jt(), Vt = this.yieldPos, Ft = this.awaitPos, Ct = this.awaitIdentPos;
|
|
4928
4928
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
4929
4929
|
var Be = this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1, Pt);
|
|
4930
|
-
if (
|
|
4930
|
+
if (l && !j && this.shouldParseAsyncArrow()) this.checkPatternErrors(Pt, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = Vt, this.awaitPos = Ft, this.awaitIdentPos = Ct, i = this.parseSubscriptAsyncArrow(r, n, Be, y);
|
|
4931
4931
|
else {
|
|
4932
4932
|
this.checkExpressionErrors(Pt, !0), this.yieldPos = Vt || this.yieldPos, this.awaitPos = Ft || this.awaitPos, this.awaitIdentPos = Ct || this.awaitIdentPos;
|
|
4933
4933
|
var Qt = this.startNodeAt(r, n);
|
|
@@ -4964,13 +4964,13 @@ function rr(t) {
|
|
|
4964
4964
|
this.next(), this.takeDecorators(i);
|
|
4965
4965
|
var c = this.strict;
|
|
4966
4966
|
this.strict = !0, this.parseClassId(i, r), this.parseClassSuper(i);
|
|
4967
|
-
var
|
|
4967
|
+
var l = this.enterClassBody(), m = this.startNode(), y = !1;
|
|
4968
4968
|
m.body = [];
|
|
4969
4969
|
var x = [];
|
|
4970
4970
|
for (this.expect(h.braceL); this.type !== h.braceR; ) if (this.match(I.at)) x.push(this.parseDecorator());
|
|
4971
4971
|
else {
|
|
4972
4972
|
var b = this.parseClassElement(i.superClass !== null);
|
|
4973
|
-
x.length && (b.decorators = x, this.resetStartLocationFromNode(b, x[0]), x = []), b && (m.body.push(b), b.type === "MethodDefinition" && b.kind === "constructor" && b.value.type === "FunctionExpression" ? (y && this.raiseRecoverable(b.start, "Duplicate constructor in the same class"), y = !0, b.decorators && b.decorators.length > 0 && this.raise(b.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : b.key && b.key.type === "PrivateIdentifier" && Js(
|
|
4973
|
+
x.length && (b.decorators = x, this.resetStartLocationFromNode(b, x[0]), x = []), b && (m.body.push(b), b.type === "MethodDefinition" && b.kind === "constructor" && b.value.type === "FunctionExpression" ? (y && this.raiseRecoverable(b.start, "Duplicate constructor in the same class"), y = !0, b.decorators && b.decorators.length > 0 && this.raise(b.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : b.key && b.key.type === "PrivateIdentifier" && Js(l, b) && this.raiseRecoverable(b.key.start, "Identifier '#" + b.key.name + "' has already been declared"));
|
|
4974
4974
|
}
|
|
4975
4975
|
return this.strict = c, this.next(), x.length && this.raise(this.start, "Decorators must be attached to a class element."), i.body = this.finishNode(m, "ClassBody"), this.exitClassBody(), this.finishNode(i, r ? "ClassDeclaration" : "ClassExpression");
|
|
4976
4976
|
} finally {
|
|
@@ -4979,11 +4979,11 @@ function rr(t) {
|
|
|
4979
4979
|
}, p.parseClassFunctionParams = function() {
|
|
4980
4980
|
var i = this.tsTryParseTypeParameters(this.tsParseConstModifier), r = this.parseBindingList(h.parenR, !1, this.options.ecmaVersion >= 8, !0);
|
|
4981
4981
|
return i && (r.typeParameters = i), r;
|
|
4982
|
-
}, p.parseMethod = function(i, r, n, c,
|
|
4982
|
+
}, p.parseMethod = function(i, r, n, c, l) {
|
|
4983
4983
|
var m = this.startNode(), y = this.yieldPos, x = this.awaitPos, b = this.awaitIdentPos;
|
|
4984
|
-
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | Se(r, m.generator) | (n ? 128 : 0)), this.expect(h.parenL), m.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(m, !1, !0, !1, { isClassMethod: c }), this.yieldPos = y, this.awaitPos = x, this.awaitIdentPos = b,
|
|
4985
|
-
var T =
|
|
4986
|
-
this.raise(
|
|
4984
|
+
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | Se(r, m.generator) | (n ? 128 : 0)), this.expect(h.parenL), m.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(m, !1, !0, !1, { isClassMethod: c }), this.yieldPos = y, this.awaitPos = x, this.awaitIdentPos = b, l && l.abstract && m.body) {
|
|
4985
|
+
var T = l.key;
|
|
4986
|
+
this.raise(l.start, A.AbstractMethodHasImplementation({ methodName: T.type !== "Identifier" || l.computed ? "[" + this.input.slice(T.start, T.end) + "]" : T.name }));
|
|
4987
4987
|
}
|
|
4988
4988
|
return this.finishNode(m, "FunctionExpression");
|
|
4989
4989
|
}, Z.parse = function(i, r) {
|
|
@@ -5012,7 +5012,7 @@ function rr(t) {
|
|
|
5012
5012
|
var c = S.prototype.parseExportSpecifier.call(this, i);
|
|
5013
5013
|
return c.exportKind = "value", c;
|
|
5014
5014
|
}, p.parseTypeOnlyImportExportSpecifier = function(i, r, n) {
|
|
5015
|
-
var c,
|
|
5015
|
+
var c, l = r ? "imported" : "local", m = r ? "local" : "exported", y = i[l], x = !1, b = !0, T = y.start;
|
|
5016
5016
|
if (this.isContextual("as")) {
|
|
5017
5017
|
var E = this.parseIdent();
|
|
5018
5018
|
if (this.isContextual("as")) {
|
|
@@ -5020,7 +5020,7 @@ function rr(t) {
|
|
|
5020
5020
|
Xt(this.type) ? (x = !0, y = E, c = r ? this.parseIdent() : this.parseModuleExportName(), b = !1) : (c = L, b = !1);
|
|
5021
5021
|
} else Xt(this.type) ? (b = !1, c = r ? this.parseIdent() : this.parseModuleExportName()) : (x = !0, y = E);
|
|
5022
5022
|
} else Xt(this.type) && (x = !0, r ? (y = S.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(y)) : y = this.parseModuleExportName());
|
|
5023
|
-
x && n && this.raise(T, r ? A.TypeModifierIsUsedInTypeImports : A.TypeModifierIsUsedInTypeExports), i[
|
|
5023
|
+
x && n && this.raise(T, r ? A.TypeModifierIsUsedInTypeImports : A.TypeModifierIsUsedInTypeExports), i[l] = y, i[m] = c, i[r ? "importKind" : "exportKind"] = x ? "type" : "value", b && this.eatContextual("as") && (i[m] = r ? this.parseIdent() : this.parseModuleExportName()), i[m] || (i[m] = this.copyNode(i[l])), r && this.checkLValSimple(i[m], 2);
|
|
5024
5024
|
}, p.raiseCommonCheck = function(i, r, n) {
|
|
5025
5025
|
return r === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(h.comma) && this.lookaheadCharCode() === 41 ? void this.next() : S.prototype.raise.call(this, i, r) : n ? S.prototype.raiseRecoverable.call(this, i, r) : S.prototype.raise.call(this, i, r);
|
|
5026
5026
|
}, p.raiseRecoverable = function(i, r) {
|
|
@@ -5037,15 +5037,15 @@ function rr(t) {
|
|
|
5037
5037
|
this.context.length -= 2, this.context.push(Y.tc_cTag), this.exprAllowed = !1;
|
|
5038
5038
|
}
|
|
5039
5039
|
}, p.jsx_parseOpeningElementAt = function(i, r) {
|
|
5040
|
-
var n = this, c = this.startNodeAt(i, r),
|
|
5041
|
-
if (
|
|
5040
|
+
var n = this, c = this.startNodeAt(i, r), l = this.jsx_parseElementName();
|
|
5041
|
+
if (l && (c.name = l), this.match(h.relational) || this.match(h.bitShift)) {
|
|
5042
5042
|
var m = this.tsTryParseAndCatch(function() {
|
|
5043
5043
|
return n.tsParseTypeArgumentsInExpression();
|
|
5044
5044
|
});
|
|
5045
5045
|
m && (c.typeParameters = m);
|
|
5046
5046
|
}
|
|
5047
5047
|
for (c.attributes = []; this.type !== h.slash && this.type !== I.jsxTagEnd; ) c.attributes.push(this.jsx_parseAttribute());
|
|
5048
|
-
return c.selfClosing = this.eat(h.slash), this.expect(I.jsxTagEnd), this.finishNode(c,
|
|
5048
|
+
return c.selfClosing = this.eat(h.slash), this.expect(I.jsxTagEnd), this.finishNode(c, l ? "JSXOpeningElement" : "JSXOpeningFragment");
|
|
5049
5049
|
}, p.enterScope = function(i) {
|
|
5050
5050
|
i === Bt && this.importsStack.push([]), S.prototype.enterScope.call(this, i);
|
|
5051
5051
|
var r = S.prototype.currentScope.call(this);
|
|
@@ -5116,17 +5116,17 @@ function De(t) {
|
|
|
5116
5116
|
}), a = [];
|
|
5117
5117
|
return Ae(s, (o) => {
|
|
5118
5118
|
if (o.type !== "MethodDefinition") return;
|
|
5119
|
-
const
|
|
5119
|
+
const f = o, d = f.key;
|
|
5120
5120
|
if (d.type !== "Identifier") return;
|
|
5121
5121
|
const v = d.name;
|
|
5122
|
-
|
|
5122
|
+
v && v !== "constructor" && f.accessibility !== "private" && a.push(v);
|
|
5123
5123
|
}), a;
|
|
5124
5124
|
}
|
|
5125
5125
|
async function ct(t, e, s = [], a) {
|
|
5126
5126
|
const o = `${e} ${s.join(" ")}`;
|
|
5127
5127
|
t !== void 0 && K(`${t} - exec(${o})`);
|
|
5128
|
-
const { stdout:
|
|
5129
|
-
a === void 0 ?
|
|
5128
|
+
const { stdout: f, stderr: d } = await ar(o);
|
|
5129
|
+
a === void 0 ? f.trim() && console.log(f.trim()) : await at.writeFile(a, f.trim(), "utf8"), d.trim() && console.error(d.trim());
|
|
5130
5130
|
}
|
|
5131
5131
|
async function or(t, e) {
|
|
5132
5132
|
return at.readdir(t, e);
|
|
@@ -5162,18 +5162,18 @@ async function hr(t) {
|
|
|
5162
5162
|
}
|
|
5163
5163
|
}
|
|
5164
5164
|
async function dt(t, e, s = [], a = !1) {
|
|
5165
|
-
return K(`${t} - spawn(${e} ${s.join(" ")})`), new Promise((o,
|
|
5165
|
+
return K(`${t} - spawn(${e} ${s.join(" ")})`), new Promise((o, f) => {
|
|
5166
5166
|
rs(e, s, { stdio: "inherit" }).on("close", (v) => {
|
|
5167
|
-
v === 0 || a ? o() :
|
|
5167
|
+
v === 0 || a ? o() : f(new Error(`${e} exited with code ${v}`));
|
|
5168
5168
|
});
|
|
5169
5169
|
});
|
|
5170
5170
|
}
|
|
5171
5171
|
function Ui(t, e, s, a) {
|
|
5172
|
-
const o = t.indexOf(s),
|
|
5173
|
-
if (o === -1 ||
|
|
5172
|
+
const o = t.indexOf(s), f = t.indexOf(a);
|
|
5173
|
+
if (o === -1 || f === -1) throw new Error(`Markers ${s}-${a} not found in content.`);
|
|
5174
5174
|
return `${t.slice(0, Math.max(0, o + s.length))}
|
|
5175
5175
|
${e}
|
|
5176
|
-
${t.slice(Math.max(0,
|
|
5176
|
+
${t.slice(Math.max(0, f))}`;
|
|
5177
5177
|
}
|
|
5178
5178
|
async function oe(t, e) {
|
|
5179
5179
|
await at.writeFile(t, JSON.stringify(e, void 0, 4), "utf8");
|
|
@@ -5187,8 +5187,8 @@ function Ae(t, e) {
|
|
|
5187
5187
|
if (["loc", "range", "start", "end", "comments"].includes(s)) continue;
|
|
5188
5188
|
const o = a;
|
|
5189
5189
|
if (Array.isArray(o))
|
|
5190
|
-
for (const
|
|
5191
|
-
const d =
|
|
5190
|
+
for (const f of o) {
|
|
5191
|
+
const d = f;
|
|
5192
5192
|
d && typeof d.type == "string" && Ae(d, e);
|
|
5193
5193
|
}
|
|
5194
5194
|
else o && typeof o == "object" && typeof o.type == "string" && Ae(o, e);
|
|
@@ -5212,10 +5212,10 @@ async function ii(t) {
|
|
|
5212
5212
|
}
|
|
5213
5213
|
async function si(t, e) {
|
|
5214
5214
|
const s = `v${t.version}`;
|
|
5215
|
-
async function a(o,
|
|
5215
|
+
async function a(o, f = "") {
|
|
5216
5216
|
const d = await or(o, { withFileTypes: !0 });
|
|
5217
5217
|
for (const v of d) {
|
|
5218
|
-
const g = `${o}/${v.name}`, h =
|
|
5218
|
+
const g = `${o}/${v.name}`, h = f ? `${f}/${v.name}` : v.name;
|
|
5219
5219
|
if (v.isDirectory()) continue;
|
|
5220
5220
|
const P = `${e}_${s}/${h}`.replaceAll("\\", "/"), N = v.name.endsWith(".css") ? "text/css" : "application/octet-stream", B = v.name.endsWith(".js") ? "application/javascript" : N;
|
|
5221
5221
|
console.info(`⚙️ Uploading '${h}' → '${P}'...`), await ct(void 0, `wrangler r2 object put "${P}" --file="${g}" --content-type ${B} --jurisdiction=eu --remote`);
|
|
@@ -5317,8 +5317,8 @@ async function lr(t, e) {
|
|
|
5317
5317
|
const [s, a] = await Promise.all([et("config.json"), At("src/index.ts")]), o = /* @__PURE__ */ Ee(Yi, s);
|
|
5318
5318
|
if (!o.success)
|
|
5319
5319
|
throw console.error("❌ Configuration is invalid:"), console.table(o.issues), new Error("Configuration is invalid.");
|
|
5320
|
-
const
|
|
5321
|
-
return await Fe(e, s,
|
|
5320
|
+
const f = De(a), d = mr(f);
|
|
5321
|
+
return await Fe(e, s, f, d);
|
|
5322
5322
|
}
|
|
5323
5323
|
async function Fe(t, e, s, a) {
|
|
5324
5324
|
return s.length > 0 ? (console.info(`ℹ️ Implements ${s.length} operations:`), console.table(s)) : console.warn("⚠️ Implements no operations."), a === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports '${a}' usage.`), t.name != null && (e.id = t.name.replace("@datapos/", "").replace("@data-positioning/", "")), t.version != null && (e.version = t.version), e.operations = s, e.usageId = a, await oe("config.json", e), e;
|
|
@@ -5328,16 +5328,16 @@ async function fr(t, e) {
|
|
|
5328
5328
|
const [s, a] = await Promise.all([et("config.json"), At("src/index.ts")]), o = /* @__PURE__ */ Ee(Ji, s);
|
|
5329
5329
|
if (!o.success)
|
|
5330
5330
|
throw console.error("❌ Configuration is invalid:"), console.table(o.issues), new Error("Configuration is invalid.");
|
|
5331
|
-
const
|
|
5332
|
-
return await Fe(e, s,
|
|
5331
|
+
const f = De(a);
|
|
5332
|
+
return await Fe(e, s, f);
|
|
5333
5333
|
}
|
|
5334
5334
|
async function dr(t, e) {
|
|
5335
5335
|
K(`${t} Build presenter project configuration`);
|
|
5336
5336
|
const [s, a] = await Promise.all([et("config.json"), At("src/index.ts")]), o = /* @__PURE__ */ Ee(es, s);
|
|
5337
5337
|
if (!o.success)
|
|
5338
5338
|
throw console.error("❌ Configuration is invalid:"), console.table(o.issues), new Error("Configuration is invalid.");
|
|
5339
|
-
const
|
|
5340
|
-
return await Fe(e, s,
|
|
5339
|
+
const f = De(a);
|
|
5340
|
+
return await Fe(e, s, f);
|
|
5341
5341
|
}
|
|
5342
5342
|
async function qi(t, e, s = "./") {
|
|
5343
5343
|
if (K(`${t} Bump project version`), e.version == null)
|
|
@@ -5388,18 +5388,18 @@ async function gr(t) {
|
|
|
5388
5388
|
const g = v.severity?.toLowerCase() ?? "unknown";
|
|
5389
5389
|
g in s ? s[g]++ : s.unknown++;
|
|
5390
5390
|
}
|
|
5391
|
-
const a = await br(s), o = await At("./README.md"),
|
|
5392
|
-
await $t("README.md",
|
|
5391
|
+
const a = await br(s), o = await At("./README.md"), f = Ui(o, a.join(" "), xr, vr);
|
|
5392
|
+
await $t("README.md", f), console.info("OWASP audit badge(s) inserted into 'README.md'");
|
|
5393
5393
|
}
|
|
5394
5394
|
async function br(t) {
|
|
5395
5395
|
const e = await et("config.json"), s = [];
|
|
5396
|
-
if (Object.values(t).reduce((o,
|
|
5396
|
+
if (Object.values(t).reduce((o, f) => o + f, 0) === 0)
|
|
5397
5397
|
console.info("No vulnerabilities found."), s.push(`[](https://data-positioning.github.io/${e.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5398
5398
|
else
|
|
5399
|
-
for (const [o,
|
|
5399
|
+
for (const [o, f] of Object.entries(t)) {
|
|
5400
5400
|
const d = yr[o];
|
|
5401
|
-
if (console.warn(`⚠️ ${
|
|
5402
|
-
const v = `https://img.shields.io/badge/OWASP-${
|
|
5401
|
+
if (console.warn(`⚠️ ${f} ${d.label} vulnerability(ies) found.`), f === 0) continue;
|
|
5402
|
+
const v = `https://img.shields.io/badge/OWASP-${f}%20${d.label}-${d.color}`;
|
|
5403
5403
|
s.push(`[](https://data-positioning.github.io/${e.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5404
5404
|
}
|
|
5405
5405
|
return s;
|
|
@@ -5444,7 +5444,7 @@ async function Pr(t, e) {
|
|
|
5444
5444
|
const s = await et("licenses/licenses.json"), a = await et("licenses/downloads/licenses.ext.json");
|
|
5445
5445
|
let o = [];
|
|
5446
5446
|
e && (o = await et("licenses/licenseTree.json"));
|
|
5447
|
-
const
|
|
5447
|
+
const f = [
|
|
5448
5448
|
...(() => {
|
|
5449
5449
|
const h = /* @__PURE__ */ new Map();
|
|
5450
5450
|
for (const P of s)
|
|
@@ -5463,7 +5463,7 @@ async function Pr(t, e) {
|
|
|
5463
5463
|
let d = `|Name|Type|Installed|Latest|Latest Released|Deps|Document|
|
|
5464
5464
|
|:-|:-|:-:|:-:|:-|-:|:-|
|
|
5465
5465
|
`;
|
|
5466
|
-
for (const h of
|
|
5466
|
+
for (const h of f) {
|
|
5467
5467
|
const P = h.installedVersion === h.remoteVersion ? h.installedVersion : `${h.installedVersion} ⚠️`, N = h.latestRemoteModified ? Cr(h.latestRemoteModified.split("T")[0]) : "n/a", B = h.dependencyCount != null && h.dependencyCount >= 0 ? h.dependencyCount : "n/a";
|
|
5468
5468
|
let nt;
|
|
5469
5469
|
h.licenseFileLink == null || h.licenseFileLink == "" ? nt = "⚠️ No license file" : nt = `[${h.licenseFileLink.slice(Math.max(0, h.licenseFileLink.lastIndexOf("/") + 1))}](${h.licenseFileLink})`, d += `|${h.name}|${h.licenseType}|${P}|${h.remoteVersion}|${N}|${B}|${nt}|
|
|
@@ -5514,10 +5514,10 @@ async function wr(t) {
|
|
|
5514
5514
|
await Zt(e, "../", ".editorconfig"), await Zt(e, "../", ".gitattributes"), await Zt(e, "../", ".markdownlint.json"), await Zt(e, "../", "LICENSE");
|
|
5515
5515
|
}
|
|
5516
5516
|
async function Zt(t, e, s) {
|
|
5517
|
-
const a = te.resolve(t, `${e}${s}`), o = await At(a),
|
|
5517
|
+
const a = te.resolve(t, `${e}${s}`), o = await At(a), f = te.resolve(process.cwd(), s);
|
|
5518
5518
|
let d;
|
|
5519
5519
|
try {
|
|
5520
|
-
d = await At(
|
|
5520
|
+
d = await At(f);
|
|
5521
5521
|
} catch (v) {
|
|
5522
5522
|
if (v.code !== "ENOENT") throw v;
|
|
5523
5523
|
}
|
|
@@ -5525,17 +5525,17 @@ async function Zt(t, e, s) {
|
|
|
5525
5525
|
console.info(`ℹ️ File '${s}' is already up to date.`);
|
|
5526
5526
|
return;
|
|
5527
5527
|
}
|
|
5528
|
-
await $t(
|
|
5528
|
+
await $t(f, o), console.info(`ℹ️ File '${s}' synchronised.`);
|
|
5529
5529
|
}
|
|
5530
5530
|
async function $r(t) {
|
|
5531
5531
|
try {
|
|
5532
5532
|
console.info(`🚀 Building public directory index for identifier '${t}'...`);
|
|
5533
5533
|
const e = {};
|
|
5534
|
-
async function s(o,
|
|
5534
|
+
async function s(o, f) {
|
|
5535
5535
|
console.info(`⚙️ Processing directory '${o}'...`);
|
|
5536
5536
|
const d = [], v = o.slice(`public/${t}`.length);
|
|
5537
5537
|
e[v === "" ? "/" : v] = d;
|
|
5538
|
-
for (const g of
|
|
5538
|
+
for (const g of f) {
|
|
5539
5539
|
const h = `${o}/${g}`;
|
|
5540
5540
|
try {
|
|
5541
5541
|
const P = await at.stat(h);
|