@oomol-lab/open-flow 0.1.0-alpha.0 → 0.1.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/addNodeOptions-BwrMvPQC.js +5230 -0
- package/dist/browser/assets/typeScriptWorker-CaA4llbX.js +59850 -0
- package/dist/browser/carbon-DMCVsjHo.js +53 -0
- package/dist/browser/{project-change.js → change-Cu6pQIit.js} +15 -45
- package/dist/browser/createLucideIcon-COMgwa_u.js +5317 -0
- package/dist/browser/createResourceDialog-YgMLylQz.js +467 -0
- package/dist/browser/{dist-o4dBuwiG.js → dist-3Mj8q8Pr.js} +28 -28
- package/dist/browser/{dist-CIq6ue3I.js → dist-BKuSVKCC.js} +1115 -1103
- package/dist/browser/{dist-DL0SDskM.js → dist-BMqL-qR5.js} +473 -906
- package/dist/browser/{dist-CLZJNoWB.js → dist-BN4ZCyOB.js} +10 -10
- package/dist/browser/{dist-zyY--HOV.js → dist-BpopSHwP.js} +3 -3
- package/dist/browser/dist-C46JByB-.js +252 -0
- package/dist/browser/{dist-BbyiRq3c.js → dist-CJpzJrLM.js} +294 -284
- package/dist/browser/{dist-Djd02JSy.js → dist-CPuF50D9.js} +198 -198
- package/dist/browser/{dist-CvcmLAMW.js → dist-CUSrALSX.js} +115 -115
- package/dist/browser/dist-CeSZ2xSM.js +444 -0
- package/dist/browser/{dist-7oZK9QXZ.js → dist-DMi8_lU3.js} +5 -5
- package/dist/browser/{dist-B9OV3YTx.js → dist-DUzA0Ukh.js} +22 -22
- package/dist/browser/{dist-aWSZx4q1.js → dist-DWADUsVB.js} +75 -75
- package/dist/browser/{dist-BLk5M0uK.js → dist-Mecbzdl2.js} +3 -3
- package/dist/browser/{esm-DXw7EADW.js → esm-CvAs_mAS.js} +14 -24
- package/dist/browser/field-BrEG-7ap.js +312 -0
- package/dist/browser/flow-authoring-edge.d.ts +3 -0
- package/dist/browser/flow-authoring-module.d.ts +4 -0
- package/dist/browser/flow-authoring-node.d.ts +84 -0
- package/dist/browser/flow-authoring.d.ts +4 -0
- package/dist/browser/flow-authoring.js +522 -0
- package/dist/browser/{project-change.d.ts → flow-change.d.ts} +27 -36
- package/dist/browser/flow-change.js +231 -0
- package/dist/browser/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/browser/flowRunInputEditorStore-DXOyyY7o.js +8219 -0
- package/dist/browser/flowWorkspace-X_T_DcQf.js +46003 -0
- package/dist/browser/{lib-S4ccuMeT.js → lib-GrGxYjsJ.js} +3 -5
- package/dist/browser/licenses.md +620 -12
- package/dist/browser/{markdownContent-ZZFfSRqO.js → markdownContent-BI-2PmDX.js} +4071 -4035
- package/dist/browser/typeScriptSession-Dagu_tRs.js +2549 -0
- package/dist/browser/workbench-contract.d.ts +4 -5
- package/dist/browser/workbench.css +1 -1
- package/dist/browser/workbench.d.ts +2 -1
- package/dist/browser/workbench.js +3920 -2138
- package/dist/common/connector-action.d.ts +6 -0
- package/dist/common/connector-action.js +38 -30
- package/dist/common/control-api-conformance.js +223 -359
- package/dist/common/control-api-errors.d.ts +20 -24
- package/dist/common/control-api.d.ts +44 -73
- package/dist/common/control-api.js +150 -203
- package/dist/common/cron-trigger.d.ts +1 -1
- package/dist/common/cron-trigger.js +1 -1
- package/dist/common/flow-encoding.d.ts +11 -0
- package/dist/common/{project-encoding.js → flow-encoding.js} +14 -13
- package/dist/common/{project-notifications.d.ts → flow-notifications.d.ts} +6 -3
- package/dist/common/{project-semantics.d.ts → flow-semantics.d.ts} +9 -12
- package/dist/common/{project-semantics.js → flow-semantics.js} +594 -597
- package/dist/common/integration-trigger.d.ts +2 -1
- package/dist/common/integration-trigger.js +1 -1
- package/dist/common/poll-trigger.d.ts +1 -1
- package/dist/common/provider-triggers.js +1057 -948
- package/dist/common/run-lifecycle.js +1 -1
- package/dist/common/runtime-contract.d.ts +1 -1
- package/dist/common/runtime-contract.js +1 -1
- package/dist/common/scheduler.d.ts +7 -7
- package/dist/common/scheduler.js +237 -232
- package/dist/common/webhook-trigger.d.ts +1 -1
- package/dist/common/webhook-trigger.js +35 -1
- package/package.json +20 -10
- package/dist/browser/addNodeOptions-DqoIueCR.js +0 -33746
- package/dist/browser/carbon-nMY84Amv.js +0 -53
- package/dist/browser/composite-7VwgfnXx.js +0 -6088
- package/dist/browser/createResourceDialog-ByuJWdSL.js +0 -439
- package/dist/browser/dist-n-z5HtaO.js +0 -4
- package/dist/browser/flowWorkspace-DwVMpcar.js +0 -22092
- package/dist/common/project-encoding.d.ts +0 -11
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/@babel/parser/lib/index.js
|
|
1
|
+
//#region ../../node_modules/.bun/@babel+parser@8.0.4/node_modules/@babel/parser/lib/index.js
|
|
2
2
|
var e = class {
|
|
3
3
|
constructor(e, t, n) {
|
|
4
4
|
this.line = void 0, this.column = void 0, n !== void 0 && (this.index = void 0), this.line = e, this.column = t, n !== void 0 && (this.index = n);
|
|
@@ -838,18 +838,18 @@ function Oe(e) {
|
|
|
838
838
|
function ke(e) {
|
|
839
839
|
return se[e];
|
|
840
840
|
}
|
|
841
|
-
var
|
|
841
|
+
var Ae = class {
|
|
842
842
|
constructor(e, t) {
|
|
843
843
|
this.token = e, this.preserveSpace = !!t;
|
|
844
844
|
}
|
|
845
845
|
token;
|
|
846
846
|
preserveSpace;
|
|
847
|
-
},
|
|
848
|
-
brace: new
|
|
849
|
-
j_oTag: new
|
|
850
|
-
j_cTag: new
|
|
851
|
-
j_expr: new
|
|
852
|
-
},
|
|
847
|
+
}, j = {
|
|
848
|
+
brace: new Ae("{"),
|
|
849
|
+
j_oTag: new Ae("<tag"),
|
|
850
|
+
j_cTag: new Ae("</tag"),
|
|
851
|
+
j_expr: new Ae("<tag>...</tag>", !0)
|
|
852
|
+
}, je = /[\p{ID_Start}\u088f\u0c5c\u0cdc\ua7ce\ua7cf\ua7d2\ua7d4\ua7f1]/u, Me = /[\p{ID_Continue}\u088f\u0c5c\u0cdc\ua7ce\ua7cf\ua7d2\ua7d4\ua7f1\u1acf-\u1add\u1ae0-\u1aeb]/u, Ne = [
|
|
853
853
|
2368,
|
|
854
854
|
25,
|
|
855
855
|
1388,
|
|
@@ -886,7 +886,7 @@ var j = class {
|
|
|
886
886
|
11,
|
|
887
887
|
21763,
|
|
888
888
|
4297
|
|
889
|
-
],
|
|
889
|
+
], Pe = [
|
|
890
890
|
3834,
|
|
891
891
|
1,
|
|
892
892
|
3173,
|
|
@@ -902,7 +902,7 @@ var j = class {
|
|
|
902
902
|
6,
|
|
903
903
|
0
|
|
904
904
|
];
|
|
905
|
-
function
|
|
905
|
+
function Fe(e, t) {
|
|
906
906
|
let n = 65536;
|
|
907
907
|
for (let r = 0, i = t.length; r < i; r += 2) {
|
|
908
908
|
if (n += t[r], n > e) return !1;
|
|
@@ -910,13 +910,13 @@ function Pe(e, t) {
|
|
|
910
910
|
}
|
|
911
911
|
return !1;
|
|
912
912
|
}
|
|
913
|
-
function
|
|
914
|
-
return e < 65 ? e === 36 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 &&
|
|
913
|
+
function M(e) {
|
|
914
|
+
return e < 65 ? e === 36 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 && je.test(String.fromCharCode(e)) : !isNaN(e) && e <= 1114111 && (je.test(String.fromCodePoint(e)) || Fe(e, Ne));
|
|
915
915
|
}
|
|
916
|
-
function
|
|
917
|
-
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 &&
|
|
916
|
+
function N(e) {
|
|
917
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e <= 90 ? !0 : e < 97 ? e === 95 : e <= 122 ? !0 : e <= 65535 ? e >= 170 && Me.test(String.fromCharCode(e)) : !isNaN(e) && e <= 1114111 && (Me.test(String.fromCodePoint(e)) || Fe(e, Ne) || Fe(e, Pe));
|
|
918
918
|
}
|
|
919
|
-
var
|
|
919
|
+
var Ie = {
|
|
920
920
|
keyword: /* @__PURE__ */ "break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete".split("."),
|
|
921
921
|
strict: [
|
|
922
922
|
"implements",
|
|
@@ -930,37 +930,37 @@ var Fe = {
|
|
|
930
930
|
"yield"
|
|
931
931
|
],
|
|
932
932
|
strictBind: ["eval", "arguments"]
|
|
933
|
-
},
|
|
934
|
-
function
|
|
933
|
+
}, Le = new Set(Ie.keyword), Re = new Set(Ie.strict), ze = new Set(Ie.strictBind);
|
|
934
|
+
function Be(e, t) {
|
|
935
935
|
return t && e === "await" || e === "enum";
|
|
936
936
|
}
|
|
937
|
-
function
|
|
938
|
-
return
|
|
937
|
+
function Ve(e, t) {
|
|
938
|
+
return Be(e, t) || Re.has(e);
|
|
939
939
|
}
|
|
940
|
-
function
|
|
941
|
-
return
|
|
940
|
+
function He(e) {
|
|
941
|
+
return ze.has(e);
|
|
942
942
|
}
|
|
943
|
-
function
|
|
944
|
-
return
|
|
943
|
+
function Ue(e, t) {
|
|
944
|
+
return Ve(e, t) || He(e);
|
|
945
945
|
}
|
|
946
|
-
function
|
|
947
|
-
return
|
|
946
|
+
function We(e) {
|
|
947
|
+
return Le.has(e);
|
|
948
948
|
}
|
|
949
|
-
function
|
|
950
|
-
return e === 64 && t === 64 &&
|
|
949
|
+
function Ge(e, t, n) {
|
|
950
|
+
return e === 64 && t === 64 && M(n);
|
|
951
951
|
}
|
|
952
|
-
var
|
|
953
|
-
function
|
|
954
|
-
return
|
|
952
|
+
var Ke = /* @__PURE__ */ new Set(/* @__PURE__ */ "break.case.catch.continue.debugger.default.do.else.finally.for.function.if.return.switch.throw.try.var.const.while.with.new.this.super.class.extends.export.import.null.true.false.in.instanceof.typeof.void.delete.implements.interface.let.package.private.protected.public.static.yield.eval.arguments.enum.await".split("."));
|
|
953
|
+
function qe(e) {
|
|
954
|
+
return Ke.has(e);
|
|
955
955
|
}
|
|
956
|
-
var
|
|
956
|
+
var Je = class {
|
|
957
957
|
flags = 0;
|
|
958
958
|
names = /* @__PURE__ */ new Map();
|
|
959
959
|
firstLexicalName = "";
|
|
960
960
|
constructor(e) {
|
|
961
961
|
this.flags = e;
|
|
962
962
|
}
|
|
963
|
-
},
|
|
963
|
+
}, Ye = class {
|
|
964
964
|
parser;
|
|
965
965
|
scopeStack = [];
|
|
966
966
|
inModule;
|
|
@@ -1007,7 +1007,7 @@ var qe = class {
|
|
|
1007
1007
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1008
1008
|
}
|
|
1009
1009
|
createScope(e) {
|
|
1010
|
-
return new
|
|
1010
|
+
return new Je(e);
|
|
1011
1011
|
}
|
|
1012
1012
|
enter(e) {
|
|
1013
1013
|
this.scopeStack.push(this.createScope(e));
|
|
@@ -1058,11 +1058,11 @@ var qe = class {
|
|
|
1058
1058
|
if (t & 3779 && !(t & 4)) return t;
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
}, Ye = class extends qe {
|
|
1062
|
-
declareFunctions = /* @__PURE__ */ new Set();
|
|
1063
1061
|
}, Xe = class extends Je {
|
|
1062
|
+
declareFunctions = /* @__PURE__ */ new Set();
|
|
1063
|
+
}, Ze = class extends Ye {
|
|
1064
1064
|
createScope(e) {
|
|
1065
|
-
return new
|
|
1065
|
+
return new Xe(e);
|
|
1066
1066
|
}
|
|
1067
1067
|
declareName(e, t, n) {
|
|
1068
1068
|
let r = this.currentScope();
|
|
@@ -1083,7 +1083,7 @@ var qe = class {
|
|
|
1083
1083
|
checkLocalExport(e) {
|
|
1084
1084
|
this.scopeStack[0].declareFunctions.has(e.name) || super.checkLocalExport(e);
|
|
1085
1085
|
}
|
|
1086
|
-
},
|
|
1086
|
+
}, Qe = /* @__PURE__ */ new Set([
|
|
1087
1087
|
"_",
|
|
1088
1088
|
"any",
|
|
1089
1089
|
"bool",
|
|
@@ -1100,7 +1100,7 @@ var qe = class {
|
|
|
1100
1100
|
"true",
|
|
1101
1101
|
"typeof",
|
|
1102
1102
|
"void"
|
|
1103
|
-
]),
|
|
1103
|
+
]), P = h`flow`({
|
|
1104
1104
|
AmbiguousConditionalArrow: "Ambiguous expression: wrap the arrow functions in parentheses to disambiguate.",
|
|
1105
1105
|
AmbiguousDeclareModuleKind: "Found both `declare module.exports` and `declare export` in the same module. Modules can only have 1 since they are either an ES module or they are a CommonJS module.",
|
|
1106
1106
|
AssignReservedType: ({ reservedType: e }) => `Cannot overwrite reserved type ${e}.`,
|
|
@@ -1149,27 +1149,27 @@ var qe = class {
|
|
|
1149
1149
|
UnsupportedStatementInDeclareModule: "Only declares and type imports are allowed inside declare module.",
|
|
1150
1150
|
UnterminatedFlowComment: "Unterminated flow-comment."
|
|
1151
1151
|
});
|
|
1152
|
-
function
|
|
1152
|
+
function $e(e) {
|
|
1153
1153
|
return e.type === "DeclareExportAllDeclaration" || e.type === "DeclareExportDeclaration" && (!e.declaration || e.declaration.type !== "TypeAlias" && e.declaration.type !== "InterfaceDeclaration");
|
|
1154
1154
|
}
|
|
1155
|
-
function
|
|
1155
|
+
function et(e) {
|
|
1156
1156
|
return e.importKind === "type" || e.importKind === "typeof";
|
|
1157
1157
|
}
|
|
1158
|
-
var
|
|
1158
|
+
var tt = {
|
|
1159
1159
|
const: "declare export var",
|
|
1160
1160
|
let: "declare export var",
|
|
1161
1161
|
type: "export type",
|
|
1162
1162
|
interface: "export interface"
|
|
1163
1163
|
};
|
|
1164
|
-
function
|
|
1164
|
+
function nt(e, t) {
|
|
1165
1165
|
let n = [], r = [];
|
|
1166
1166
|
for (let i = 0; i < e.length; i++) (t(e[i], i, e) ? n : r).push(e[i]);
|
|
1167
1167
|
return [n, r];
|
|
1168
1168
|
}
|
|
1169
|
-
var
|
|
1169
|
+
var rt = /\*?\s*@((?:no)?flow)\b/, it = (e) => class extends e {
|
|
1170
1170
|
flowPragma = void 0;
|
|
1171
1171
|
getScopeHandler() {
|
|
1172
|
-
return
|
|
1172
|
+
return Ze;
|
|
1173
1173
|
}
|
|
1174
1174
|
shouldParseTypes() {
|
|
1175
1175
|
return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
|
|
@@ -1179,7 +1179,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
addComment(e) {
|
|
1181
1181
|
if (this.flowPragma === void 0) {
|
|
1182
|
-
let t =
|
|
1182
|
+
let t = rt.exec(e.value);
|
|
1183
1183
|
if (t) {
|
|
1184
1184
|
if (t[1] === "flow") this.flowPragma = "flow";
|
|
1185
1185
|
else if (t[1] === "noflow") this.flowPragma = "noflow";
|
|
@@ -1196,7 +1196,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1196
1196
|
}
|
|
1197
1197
|
flowParsePredicate() {
|
|
1198
1198
|
let e = this.startNode(), t = this.state.startLoc;
|
|
1199
|
-
return this.next(), this.expectContextual(106), this.state.lastTokStartLoc.index > t.index + 1 && this.raise(
|
|
1199
|
+
return this.next(), this.expectContextual(106), this.state.lastTokStartLoc.index > t.index + 1 && this.raise(P.UnexpectedSpaceBetweenModuloChecks, t), this.eat(6) ? (e.value = super.parseExpression(), this.expect(7), this.finishNode(e, "DeclaredPredicate")) : this.finishNode(e, "InferredPredicate");
|
|
1200
1200
|
}
|
|
1201
1201
|
flowParseTypeAndPredicateInitialiser(e) {
|
|
1202
1202
|
let t = this.state.inType;
|
|
@@ -1218,7 +1218,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1218
1218
|
if (this.match(76)) return this.flowParseDeclareClass(e);
|
|
1219
1219
|
if (this.match(64)) return this.flowParseDeclareFunction(e);
|
|
1220
1220
|
if (this.match(70)) return this.flowParseDeclareVariable(e);
|
|
1221
|
-
if (this.eatContextual(123)) return this.match(12) ? this.flowParseDeclareModuleExports(e) : (t && this.raise(
|
|
1221
|
+
if (this.eatContextual(123)) return this.match(12) ? this.flowParseDeclareModuleExports(e) : (t && this.raise(P.NestedDeclareModule, this.state.lastTokStartLoc), this.flowParseDeclareModule(e));
|
|
1222
1222
|
if (this.isContextual(126)) return this.flowParseDeclareTypeAlias(e);
|
|
1223
1223
|
if (this.isContextual(127)) return this.flowParseDeclareOpaqueType(e);
|
|
1224
1224
|
if (this.isContextual(125)) return this.flowParseDeclareInterface(e);
|
|
@@ -1233,21 +1233,21 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1233
1233
|
let t = this.startNode(), n = t.body = [];
|
|
1234
1234
|
for (this.expect(2); !this.match(4);) {
|
|
1235
1235
|
let e = this.startNode();
|
|
1236
|
-
this.match(79) ? (this.next(), !this.isContextual(126) && !this.match(83) && this.raise(
|
|
1236
|
+
this.match(79) ? (this.next(), !this.isContextual(126) && !this.match(83) && this.raise(P.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc), n.push(super.parseImport(e))) : (this.expectContextual(121, P.UnsupportedStatementInDeclareModule), n.push(this.flowParseDeclare(e, !0)));
|
|
1237
1237
|
}
|
|
1238
1238
|
this.scope.exit(), this.expect(4), e.body = this.finishNode(t, "BlockStatement");
|
|
1239
1239
|
let r = null, i = !1;
|
|
1240
1240
|
return n.forEach((e) => {
|
|
1241
|
-
|
|
1241
|
+
$e(e) ? (r === "CommonJS" && this.raise(P.AmbiguousDeclareModuleKind, e), r = "ES") : e.type === "DeclareModuleExports" && (i && this.raise(P.DuplicateDeclareModuleExports, e), r === "ES" && this.raise(P.AmbiguousDeclareModuleKind, e), r = "CommonJS", i = !0);
|
|
1242
1242
|
}), e.kind = r || "CommonJS", this.finishNode(e, "DeclareModule");
|
|
1243
1243
|
}
|
|
1244
1244
|
flowParseDeclareExportDeclaration(e, t) {
|
|
1245
1245
|
if (this.expect(78), this.eat(61)) return this.match(64) || this.match(76) ? e.declaration = this.flowParseDeclare(this.startNode()) : (e.declaration = this.flowParseType(), this.semicolon()), e.default = !0, this.finishNode(e, "DeclareExportDeclaration");
|
|
1246
1246
|
if (this.match(71) || this.isLet() || (this.isContextual(126) || this.isContextual(125)) && !t) {
|
|
1247
1247
|
let e = this.state.value;
|
|
1248
|
-
throw this.raise(
|
|
1248
|
+
throw this.raise(P.UnsupportedDeclareExportKind, this.state.startLoc, {
|
|
1249
1249
|
unsupportedExportKind: e,
|
|
1250
|
-
suggestion:
|
|
1250
|
+
suggestion: tt[e]
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
if (this.match(70) || this.match(64) || this.match(76) || this.isContextual(127)) return e.declaration = this.flowParseDeclare(this.startNode()), e.default = !1, this.finishNode(e, "DeclareExportDeclaration");
|
|
@@ -1301,10 +1301,10 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1301
1301
|
return this.flowParseInterfaceish(e, !1), this.finishNode(e, "InterfaceDeclaration");
|
|
1302
1302
|
}
|
|
1303
1303
|
checkNotUnderscore(e) {
|
|
1304
|
-
e === "_" && this.raise(
|
|
1304
|
+
e === "_" && this.raise(P.UnexpectedReservedUnderscore, this.state.startLoc);
|
|
1305
1305
|
}
|
|
1306
1306
|
checkReservedType(e, t, n) {
|
|
1307
|
-
|
|
1307
|
+
Qe.has(e) && this.raise(n ? P.AssignReservedType : P.UnexpectedReservedType, t, { reservedType: e });
|
|
1308
1308
|
}
|
|
1309
1309
|
flowParseRestrictedIdentifierName(e, t) {
|
|
1310
1310
|
return this.checkReservedType(this.state.value, this.state.startLoc, t), this.parseIdentifierName(e);
|
|
@@ -1327,7 +1327,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1327
1327
|
}
|
|
1328
1328
|
flowParseTypeParameter(e = !1) {
|
|
1329
1329
|
let t = this.state.startLoc, n = this.startNode(), r = this.flowParseVariance();
|
|
1330
|
-
return n.name = this.flowParseRestrictedIdentifierName(), n.variance = r, n.bound = this.flowParseTypeParameterBound(), this.match(25) ? (this.eat(25), n.default = this.flowParseType()) : e && this.raise(
|
|
1330
|
+
return n.name = this.flowParseRestrictedIdentifierName(), n.variance = r, n.bound = this.flowParseTypeParameterBound(), this.match(25) ? (this.eat(25), n.default = this.flowParseType()) : e && this.raise(P.MissingTypeParamDefault, t), this.finishNode(n, "TypeParameter");
|
|
1331
1331
|
}
|
|
1332
1332
|
flowParseTypeParameterDeclaration() {
|
|
1333
1333
|
let e = this.state.inType, t = this.startNode();
|
|
@@ -1340,7 +1340,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1340
1340
|
return this.expect(44), this.state.inType = e, this.finishNode(t, "TypeParameterDeclaration");
|
|
1341
1341
|
}
|
|
1342
1342
|
flowInTopLevelContext(e) {
|
|
1343
|
-
if (this.curContext() !==
|
|
1343
|
+
if (this.curContext() !== j.brace) {
|
|
1344
1344
|
let t = this.state.context;
|
|
1345
1345
|
this.state.context = [t[0]];
|
|
1346
1346
|
try {
|
|
@@ -1348,8 +1348,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1348
1348
|
} finally {
|
|
1349
1349
|
this.state.context = t;
|
|
1350
1350
|
}
|
|
1351
|
-
}
|
|
1352
|
-
return e();
|
|
1351
|
+
} else return e();
|
|
1353
1352
|
}
|
|
1354
1353
|
flowParseTypeParameterInstantiationInExpression() {
|
|
1355
1354
|
if (this.reScan_lt() === 43) return this.flowParseTypeParameterInstantiation();
|
|
@@ -1361,7 +1360,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1361
1360
|
let t = this.state.noAnonFunctionType;
|
|
1362
1361
|
for (this.state.noAnonFunctionType = !1; !this.match(44);) e.params.push(this.flowParseType()), this.match(44) || this.expect(8);
|
|
1363
1362
|
this.state.noAnonFunctionType = t;
|
|
1364
|
-
}), this.state.inType = t, !this.state.inType && this.curContext() ===
|
|
1363
|
+
}), this.state.inType = t, !this.state.inType && this.curContext() === j.brace && this.reScan_lt_gt(), this.expect(44), this.finishNode(e, "TypeParameterInstantiation");
|
|
1365
1364
|
}
|
|
1366
1365
|
flowParseTypeParameterInstantiationCallOrNew() {
|
|
1367
1366
|
if (this.reScan_lt() !== 43) return null;
|
|
@@ -1424,23 +1423,23 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1424
1423
|
let r = this.flowParseObjectTypeProperty(u, t, a, d, e, n, i ?? !c);
|
|
1425
1424
|
r === null ? (l = !0, s = this.state.lastTokStartLoc) : o.properties.push(r);
|
|
1426
1425
|
}
|
|
1427
|
-
this.flowObjectTypeSemicolon(), s && !this.match(4) && !this.match(5) && this.raise(
|
|
1426
|
+
this.flowObjectTypeSemicolon(), s && !this.match(4) && !this.match(5) && this.raise(P.UnexpectedExplicitInexactInObject, s);
|
|
1428
1427
|
}
|
|
1429
1428
|
this.expect(s), n && (o.inexact = l);
|
|
1430
1429
|
let u = this.finishNode(o, "ObjectTypeAnnotation");
|
|
1431
1430
|
return this.state.inType = a, u;
|
|
1432
1431
|
}
|
|
1433
1432
|
flowParseObjectTypeProperty(e, t, n, r, i, a, o) {
|
|
1434
|
-
if (this.eat(17)) return this.match(8) || this.match(9) || this.match(4) || this.match(5) ? (a ? o || this.raise(
|
|
1433
|
+
if (this.eat(17)) return this.match(8) || this.match(9) || this.match(4) || this.match(5) ? (a ? o || this.raise(P.InexactInsideExact, this.state.lastTokStartLoc) : this.raise(P.InexactInsideNonObject, this.state.lastTokStartLoc), r && this.raise(P.InexactVariance, r), null) : (a || this.raise(P.UnexpectedSpreadType, this.state.lastTokStartLoc), n != null && this.unexpected(n), r && this.raise(P.SpreadVariance, r), e.argument = this.flowParseType(), this.finishNode(e, "ObjectTypeSpreadProperty"));
|
|
1435
1434
|
{
|
|
1436
1435
|
e.key = this.flowParseObjectPropertyKey(), e.static = t, e.proto = n != null, e.kind = i;
|
|
1437
1436
|
let o = !1;
|
|
1438
|
-
return this.match(43) || this.match(6) ? (e.method = !0, n != null && this.unexpected(n), r && this.unexpected(r.start), e.value = this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)), i === "get" || i === "set" ? this.flowCheckGetterSetterParams(e) : !t && !a && e.key.name === "constructor" && e.value.this && this.raise(
|
|
1437
|
+
return this.match(43) || this.match(6) ? (e.method = !0, n != null && this.unexpected(n), r && this.unexpected(r.start), e.value = this.flowParseObjectTypeMethodish(this.startNodeAtNode(e)), i === "get" || i === "set" ? this.flowCheckGetterSetterParams(e) : !t && !a && e.key.name === "constructor" && e.value.this && this.raise(P.ThisParamBannedInConstructor, e.value.this)) : (i !== "init" && this.unexpected(), e.method = !1, this.eat(13) && (o = !0), e.value = this.flowParseTypeInitialiser(), e.variance = r), e.optional = o, this.finishNode(e, "ObjectTypeProperty");
|
|
1439
1438
|
}
|
|
1440
1439
|
}
|
|
1441
1440
|
flowCheckGetterSetterParams(e) {
|
|
1442
1441
|
let t = e.kind === "get" ? 0 : 1, n = e.value, r = n.params.length + +!!n.rest;
|
|
1443
|
-
n.this && this.raise(e.kind === "get" ?
|
|
1442
|
+
n.this && this.raise(e.kind === "get" ? P.GetterMayNotHaveThisParam : P.SetterMayNotHaveThisParam, n.this), r !== t && this.raise(e.kind === "get" ? g.BadGetterArity : g.BadSetterArity, e), e.kind === "set" && n.rest && this.raise(g.BadSetterRestParameter, e);
|
|
1444
1443
|
}
|
|
1445
1444
|
flowObjectTypeSemicolon() {
|
|
1446
1445
|
!this.eat(9) && !this.eat(8) && !this.match(4) && !this.match(5) && this.unexpected();
|
|
@@ -1469,7 +1468,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1469
1468
|
}
|
|
1470
1469
|
flowParseFunctionTypeParam(e) {
|
|
1471
1470
|
let t = null, n = !1, r, i = this.startNode(), a = this.lookahead(), o = this.state.type === 74;
|
|
1472
|
-
return a.type === 10 || a.type === 13 ? (o && !e && this.raise(
|
|
1471
|
+
return a.type === 10 || a.type === 13 ? (o && !e && this.raise(P.ThisParamMustBeFirst, i), t = this.parseIdentifier(o), this.eat(13) && (n = !0, o && this.raise(P.ThisParamMayNotBeOptional, i)), r = this.flowParseTypeInitialiser()) : r = this.flowParseType(), i.name = t, i.optional = n, i.typeAnnotation = r, this.finishNode(i, "FunctionTypeParam");
|
|
1473
1472
|
}
|
|
1474
1473
|
reinterpretTypeAsFunctionTypeParam(e) {
|
|
1475
1474
|
let t = this.startNodeAtNode(e);
|
|
@@ -1540,7 +1539,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1540
1539
|
if (this.state.value === "-") {
|
|
1541
1540
|
if (this.next(), this.match(131)) return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", t);
|
|
1542
1541
|
if (this.match(132)) return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", t);
|
|
1543
|
-
throw this.raise(
|
|
1542
|
+
throw this.raise(P.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
1544
1543
|
}
|
|
1545
1544
|
throw this.unexpected();
|
|
1546
1545
|
case 131: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
|
@@ -1690,7 +1689,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1690
1689
|
for (let t = 0; t < u.length; t++) e.push(u[t].start);
|
|
1691
1690
|
({consequent: o, failed: s} = this.tryParseConditionalConsequent()), [l] = this.getArrowLikeExpressions(o);
|
|
1692
1691
|
}
|
|
1693
|
-
s && l.length > 1 && this.raise(
|
|
1692
|
+
s && l.length > 1 && this.raise(P.AmbiguousConditionalArrow, r.startLoc), s && l.length === 1 && (this.state = r, e.push(l[0].start), this.state.noArrowAt = e, {consequent: o} = this.tryParseConditionalConsequent());
|
|
1694
1693
|
}
|
|
1695
1694
|
return this.getArrowLikeExpressions(o, !0), this.state.noArrowAt = i, this.expect(10), a.test = e, a.consequent = o, a.alternate = this.forwardNoArrowParamsConversionAt(a, () => this.parseMaybeAssign(void 0, void 0)), this.finishNode(a, "ConditionalExpression");
|
|
1696
1695
|
}
|
|
@@ -1708,7 +1707,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1708
1707
|
let e = n.pop();
|
|
1709
1708
|
e.type === "ArrowFunctionExpression" && e.body.type !== "BlockStatement" ? (e.typeParameters || !e.returnType ? this.finishArrowValidation(e) : r.push(e), n.push(e.body)) : e.type === "ConditionalExpression" && (n.push(e.consequent), n.push(e.alternate));
|
|
1710
1709
|
}
|
|
1711
|
-
return t ? (r.forEach((e) => this.finishArrowValidation(e)), [r, []]) :
|
|
1710
|
+
return t ? (r.forEach((e) => this.finishArrowValidation(e)), [r, []]) : nt(r, (e) => e.params.every((e) => this.isAssignable(e, !0)));
|
|
1712
1711
|
}
|
|
1713
1712
|
finishArrowValidation(e) {
|
|
1714
1713
|
this.toAssignableList(e.params, e.extra?.trailingCommaLoc, !1), this.scope.enter(518), super.checkParams(e, !1, !0), this.scope.exit();
|
|
@@ -1771,7 +1770,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1771
1770
|
if (super.parseClassMemberFromModifier(e, t)) return;
|
|
1772
1771
|
t.declare = !0;
|
|
1773
1772
|
}
|
|
1774
|
-
super.parseClassMember(e, t, n), t.declare && (t.type !== "ClassProperty" && t.type !== "ClassPrivateProperty" && t.type !== "PropertyDefinition" ? this.raise(
|
|
1773
|
+
super.parseClassMember(e, t, n), t.declare && (t.type !== "ClassProperty" && t.type !== "ClassPrivateProperty" && t.type !== "PropertyDefinition" ? this.raise(P.DeclareClassElement, r) : t.value && this.raise(P.DeclareClassFieldInitializer, t.value));
|
|
1775
1774
|
}
|
|
1776
1775
|
isIterator(e) {
|
|
1777
1776
|
return e === "iterator" || e === "asyncIterator";
|
|
@@ -1782,7 +1781,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1782
1781
|
}
|
|
1783
1782
|
getTokenFromCode(e) {
|
|
1784
1783
|
let t = this.input.charCodeAt(this.state.pos + 1);
|
|
1785
|
-
e === 123 && t === 124 ? this.finishOp(3, 2) : this.state.inType && (e === 62 || e === 60) ? this.finishOp(e === 62 ? 44 : 43, 1) : this.state.inType && e === 63 ? t === 46 ? this.finishOp(14, 2) : this.finishOp(13, 1) :
|
|
1784
|
+
e === 123 && t === 124 ? this.finishOp(3, 2) : this.state.inType && (e === 62 || e === 60) ? this.finishOp(e === 62 ? 44 : 43, 1) : this.state.inType && e === 63 ? t === 46 ? this.finishOp(14, 2) : this.finishOp(13, 1) : Ge(e, t, this.input.charCodeAt(this.state.pos + 2)) ? (this.state.pos += 2, this.readIterator()) : super.getTokenFromCode(e);
|
|
1786
1785
|
}
|
|
1787
1786
|
isAssignable(e, t) {
|
|
1788
1787
|
return e.type === "TypeCastExpression" ? this.isAssignable(e.expression, t) : super.isAssignable(e, t);
|
|
@@ -1797,7 +1796,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1797
1796
|
toReferencedList(e, t) {
|
|
1798
1797
|
for (let n = 0; n < e.length; n++) {
|
|
1799
1798
|
let r = e[n];
|
|
1800
|
-
r?.type === "TypeCastExpression" && !r.extra?.parenthesized && (e.length > 1 || !t) && this.raise(
|
|
1799
|
+
r?.type === "TypeCastExpression" && !r.extra?.parenthesized && (e.length > 1 || !t) && this.raise(P.TypeCastInPattern, r.typeAnnotation);
|
|
1801
1800
|
}
|
|
1802
1801
|
return e;
|
|
1803
1802
|
}
|
|
@@ -1826,10 +1825,10 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1826
1825
|
pushClassMethod(e, t, n, r, i, a) {
|
|
1827
1826
|
if (t.variance && this.unexpected(t.variance.start), delete t.variance, this.match(43) && (t.typeParameters = this.flowParseTypeParameterDeclaration()), super.pushClassMethod(e, t, n, r, i, a), t.params && i) {
|
|
1828
1827
|
let e = t.params;
|
|
1829
|
-
e.length > 0 && this.isThisParam(e[0]) && this.raise(
|
|
1828
|
+
e.length > 0 && this.isThisParam(e[0]) && this.raise(P.ThisParamBannedInConstructor, t);
|
|
1830
1829
|
} else if (t.type === "MethodDefinition" && i && t.value.params) {
|
|
1831
1830
|
let e = t.value.params;
|
|
1832
|
-
e.length > 0 && this.isThisParam(e[0]) && this.raise(
|
|
1831
|
+
e.length > 0 && this.isThisParam(e[0]) && this.raise(P.ThisParamBannedInConstructor, t);
|
|
1833
1832
|
}
|
|
1834
1833
|
}
|
|
1835
1834
|
pushClassPrivateMethod(e, t, n, r) {
|
|
@@ -1852,7 +1851,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1852
1851
|
let t = this.getObjectOrClassMethodParams(e);
|
|
1853
1852
|
if (t.length > 0) {
|
|
1854
1853
|
let n = t[0];
|
|
1855
|
-
this.isThisParam(n) && e.kind === "get" ? this.raise(
|
|
1854
|
+
this.isThisParam(n) && e.kind === "get" ? this.raise(P.GetterMayNotHaveThisParam, n) : this.isThisParam(n) && this.raise(P.SetterMayNotHaveThisParam, n);
|
|
1856
1855
|
}
|
|
1857
1856
|
}
|
|
1858
1857
|
parsePropertyNamePrefixOperator(e) {
|
|
@@ -1866,14 +1865,14 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1866
1865
|
return s && ((c.value || c).typeParameters = s), c;
|
|
1867
1866
|
}
|
|
1868
1867
|
parseFunctionParamType(e) {
|
|
1869
|
-
return this.eat(13) && (e.type !== "Identifier" && this.raise(
|
|
1868
|
+
return this.eat(13) && (e.type !== "Identifier" && this.raise(P.PatternIsOptional, e), this.isThisParam(e) && this.raise(P.ThisParamMayNotBeOptional, e), e.optional = !0), this.match(10) ? e.typeAnnotation = this.flowParseTypeAnnotation() : this.isThisParam(e) && this.raise(P.ThisParamAnnotationRequired, e), this.match(25) && this.isThisParam(e) && this.raise(P.ThisParamNoDefault, e), this.resetEndLocation(e), e;
|
|
1870
1869
|
}
|
|
1871
1870
|
parseMaybeDefault(e, t) {
|
|
1872
1871
|
let n = super.parseMaybeDefault(e, t);
|
|
1873
|
-
return n.type === "AssignmentPattern" && n.typeAnnotation && n.right.start < n.typeAnnotation.start && this.raise(
|
|
1872
|
+
return n.type === "AssignmentPattern" && n.typeAnnotation && n.right.start < n.typeAnnotation.start && this.raise(P.TypeBeforeInitializer, n.typeAnnotation), n;
|
|
1874
1873
|
}
|
|
1875
1874
|
parseImportSpecifierLocal(e, t, n) {
|
|
1876
|
-
t.local =
|
|
1875
|
+
t.local = et(e) ? this.flowParseRestrictedIdentifier(!0, !0) : this.parseIdentifier(), e.specifiers.push(this.finishImportSpecifier(t, n));
|
|
1877
1876
|
}
|
|
1878
1877
|
isPotentialImportPhase(e) {
|
|
1879
1878
|
if (super.isPotentialImportPhase(e)) return !0;
|
|
@@ -1905,8 +1904,8 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1905
1904
|
}
|
|
1906
1905
|
this.eatContextual(89) ? e.local = this.parseIdentifier() : (s = !0, e.local = this.cloneIdentifier(e.imported));
|
|
1907
1906
|
}
|
|
1908
|
-
let c =
|
|
1909
|
-
return n && c && this.raise(
|
|
1907
|
+
let c = et(e);
|
|
1908
|
+
return n && c && this.raise(P.ImportTypeShorthandOnlyInPureImport, e), (n || c) && this.checkReservedType(e.local.name, e.local.start, !0), s && !n && !c && this.checkReservedWord(e.local.name, e.start, !0, !0), this.finishImportSpecifier(e, "ImportSpecifier");
|
|
1910
1909
|
}
|
|
1911
1910
|
parseBindingAtom() {
|
|
1912
1911
|
switch (this.state.type) {
|
|
@@ -1936,7 +1935,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1936
1935
|
if (this.hasPlugin("jsx") && (this.match(138) || this.match(43))) {
|
|
1937
1936
|
if (n = this.state.clone(), r = this.tryParse(() => super.parseMaybeAssign(e, t), n), !r.error) return r.node;
|
|
1938
1937
|
let { context: i } = this.state, a = i[i.length - 1];
|
|
1939
|
-
(a ===
|
|
1938
|
+
(a === j.j_oTag || a === j.j_expr) && i.pop();
|
|
1940
1939
|
}
|
|
1941
1940
|
if (r?.error || this.match(43)) {
|
|
1942
1941
|
n ||= this.state.clone();
|
|
@@ -1951,12 +1950,12 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1951
1950
|
return a.type !== "ArrowFunctionExpression" && n(), a.typeParameters = i, this.resetStartLocationFromNode(a, i), r;
|
|
1952
1951
|
}, n), o = null;
|
|
1953
1952
|
if (a.node && this.maybeUnwrapTypeCastExpression(a.node).type === "ArrowFunctionExpression") {
|
|
1954
|
-
if (!a.error && !a.aborted) return a.node.async && this.raise(
|
|
1953
|
+
if (!a.error && !a.aborted) return a.node.async && this.raise(P.UnexpectedTypeParameterBeforeAsyncArrowFunction, i), a.node;
|
|
1955
1954
|
o = a.node;
|
|
1956
1955
|
}
|
|
1957
1956
|
if (r?.node) return this.state = r.failState, r.node;
|
|
1958
1957
|
if (o) return this.state = a.failState, o;
|
|
1959
|
-
throw r?.thrown ? r.error : a.thrown ? a.error : this.raise(
|
|
1958
|
+
throw r?.thrown ? r.error : a.thrown ? a.error : this.raise(P.UnexpectedTokenAfterTypeParameter, i);
|
|
1960
1959
|
}
|
|
1961
1960
|
return super.parseMaybeAssign(e, t);
|
|
1962
1961
|
}
|
|
@@ -1981,7 +1980,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
1981
1980
|
}
|
|
1982
1981
|
checkParams(e, t, n, r = !0) {
|
|
1983
1982
|
if (!(n && this.state.noArrowParamsConversionAt.includes(this.offsetToSourcePos(e.start)))) {
|
|
1984
|
-
for (let t = 0; t < e.params.length; t++) this.isThisParam(e.params[t]) && t > 0 && this.raise(
|
|
1983
|
+
for (let t = 0; t < e.params.length; t++) this.isThisParam(e.params[t]) && t > 0 && this.raise(P.ThisParamMustBeFirst, e.params[t]);
|
|
1985
1984
|
super.checkParams(e, t, n, r);
|
|
1986
1985
|
}
|
|
1987
1986
|
}
|
|
@@ -2046,11 +2045,11 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2046
2045
|
}
|
|
2047
2046
|
parseTopLevel(e, t) {
|
|
2048
2047
|
let n = super.parseTopLevel(e, t);
|
|
2049
|
-
return this.state.hasFlowComment && this.raise(
|
|
2048
|
+
return this.state.hasFlowComment && this.raise(P.UnterminatedFlowComment, this.state.curPosition()), n;
|
|
2050
2049
|
}
|
|
2051
2050
|
skipBlockComment() {
|
|
2052
2051
|
if (this.hasPlugin("flowComments") && this.skipFlowComment()) {
|
|
2053
|
-
if (this.state.hasFlowComment) throw this.raise(
|
|
2052
|
+
if (this.state.hasFlowComment) throw this.raise(P.NestedFlowComment, this.state.startLoc);
|
|
2054
2053
|
this.hasFlowCommentCompletion();
|
|
2055
2054
|
let e = this.skipFlowComment();
|
|
2056
2055
|
e && (this.state.pos += e, this.state.hasFlowComment = !0);
|
|
@@ -2068,16 +2067,16 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2068
2067
|
if (this.input.indexOf("*/", this.state.pos) === -1) throw this.raise(g.UnterminatedComment, this.state.curPosition());
|
|
2069
2068
|
}
|
|
2070
2069
|
flowEnumErrorBooleanMemberNotInitialized(e, t) {
|
|
2071
|
-
this.raise(
|
|
2070
|
+
this.raise(P.EnumBooleanMemberNotInitialized, e, t);
|
|
2072
2071
|
}
|
|
2073
2072
|
flowEnumErrorInvalidMemberInitializer(e, t) {
|
|
2074
|
-
return this.raise(t.explicitType ? t.explicitType === "symbol" ?
|
|
2073
|
+
return this.raise(t.explicitType ? t.explicitType === "symbol" ? P.EnumInvalidMemberInitializerSymbolType : P.EnumInvalidMemberInitializerPrimaryType : P.EnumInvalidMemberInitializerUnknownType, e, t);
|
|
2075
2074
|
}
|
|
2076
2075
|
flowEnumErrorNumberMemberNotInitialized(e, t) {
|
|
2077
|
-
this.raise(
|
|
2076
|
+
this.raise(P.EnumNumberMemberNotInitialized, e, t);
|
|
2078
2077
|
}
|
|
2079
2078
|
flowEnumErrorStringMemberInconsistentlyInitialized(e, t) {
|
|
2080
|
-
this.raise(
|
|
2079
|
+
this.raise(P.EnumStringMemberInconsistentlyInitialized, e, t);
|
|
2081
2080
|
}
|
|
2082
2081
|
flowEnumMemberInit() {
|
|
2083
2082
|
let e = this.state.startLoc, t = () => this.match(8) || this.match(4);
|
|
@@ -2143,11 +2142,11 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2143
2142
|
}
|
|
2144
2143
|
let a = this.startNode(), { id: o, init: s } = this.flowEnumMemberRaw(), c = o.name;
|
|
2145
2144
|
if (c === "") continue;
|
|
2146
|
-
/^[a-z]/.test(c) && this.raise(
|
|
2145
|
+
/^[a-z]/.test(c) && this.raise(P.EnumInvalidMemberName, o, {
|
|
2147
2146
|
memberName: c,
|
|
2148
2147
|
suggestion: c[0].toUpperCase() + c.slice(1),
|
|
2149
2148
|
enumName: e
|
|
2150
|
-
}), n.has(c) && this.raise(
|
|
2149
|
+
}), n.has(c) && this.raise(P.EnumDuplicateMemberName, o, {
|
|
2151
2150
|
memberName: c,
|
|
2152
2151
|
enumName: e
|
|
2153
2152
|
}), n.add(c);
|
|
@@ -2196,9 +2195,9 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2196
2195
|
}
|
|
2197
2196
|
flowEnumParseExplicitType({ enumName: e }) {
|
|
2198
2197
|
if (!this.eatContextual(98)) return null;
|
|
2199
|
-
if (!D(this.state.type)) throw this.raise(
|
|
2198
|
+
if (!D(this.state.type)) throw this.raise(P.EnumInvalidExplicitTypeUnknownSupplied, this.state.startLoc, { enumName: e });
|
|
2200
2199
|
let { value: t } = this.state;
|
|
2201
|
-
return this.next(), t !== "boolean" && t !== "number" && t !== "string" && t !== "symbol" && this.raise(
|
|
2200
|
+
return this.next(), t !== "boolean" && t !== "number" && t !== "string" && t !== "symbol" && this.raise(P.EnumInvalidExplicitType, this.state.startLoc, {
|
|
2202
2201
|
enumName: e,
|
|
2203
2202
|
invalidEnumType: t
|
|
2204
2203
|
}), t;
|
|
@@ -2235,7 +2234,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2235
2234
|
});
|
|
2236
2235
|
return e.members = a.numberMembers, this.expect(4), this.finishNode(e, "EnumNumberBody");
|
|
2237
2236
|
}
|
|
2238
|
-
return this.raise(
|
|
2237
|
+
return this.raise(P.EnumInconsistentMemberValues, r, { enumName: n }), t();
|
|
2239
2238
|
}
|
|
2240
2239
|
}
|
|
2241
2240
|
}
|
|
@@ -2265,7 +2264,7 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2265
2264
|
maybeUnwrapTypeCastExpression(e) {
|
|
2266
2265
|
return e.type === "TypeCastExpression" ? e.expression : e;
|
|
2267
2266
|
}
|
|
2268
|
-
},
|
|
2267
|
+
}, at = {
|
|
2269
2268
|
__proto__: null,
|
|
2270
2269
|
quot: "\"",
|
|
2271
2270
|
amp: "&",
|
|
@@ -2520,8 +2519,8 @@ var nt = /\*?\s*@((?:no)?flow)\b/, rt = (e) => class extends e {
|
|
|
2520
2519
|
clubs: "♣",
|
|
2521
2520
|
hearts: "♥",
|
|
2522
2521
|
diams: "♦"
|
|
2523
|
-
},
|
|
2524
|
-
function
|
|
2522
|
+
}, ot = /* @__PURE__ */ RegExp("\\r\\n|[\\r\\n\\u2028\\u2029]", "g");
|
|
2523
|
+
function F(e) {
|
|
2525
2524
|
switch (e) {
|
|
2526
2525
|
case 10:
|
|
2527
2526
|
case 13:
|
|
@@ -2530,12 +2529,12 @@ function I(e) {
|
|
|
2530
2529
|
default: return !1;
|
|
2531
2530
|
}
|
|
2532
2531
|
}
|
|
2533
|
-
function
|
|
2534
|
-
for (let r = t; r < n; r++) if (
|
|
2532
|
+
function st(e, t, n) {
|
|
2533
|
+
for (let r = t; r < n; r++) if (F(e.charCodeAt(r))) return !0;
|
|
2535
2534
|
return !1;
|
|
2536
2535
|
}
|
|
2537
|
-
var
|
|
2538
|
-
function
|
|
2536
|
+
var ct = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, lt = /(?:[^\S\n\r\u2028\u2029]|\/\/.*|\/\*.*?\*\/)*/g;
|
|
2537
|
+
function ut(e) {
|
|
2539
2538
|
switch (e) {
|
|
2540
2539
|
case 9:
|
|
2541
2540
|
case 11:
|
|
@@ -2561,7 +2560,7 @@ function lt(e) {
|
|
|
2561
2560
|
default: return !1;
|
|
2562
2561
|
}
|
|
2563
2562
|
}
|
|
2564
|
-
var
|
|
2563
|
+
var I = h`jsx`({
|
|
2565
2564
|
AttributeIsEmpty: "JSX attributes must only be assigned a non-empty expression.",
|
|
2566
2565
|
MissingClosingTagElement: ({ openingTagName: e }) => `Expected corresponding JSX closing tag for <${e}>.`,
|
|
2567
2566
|
MissingClosingTagFragment: "Expected corresponding JSX closing tag for <>.",
|
|
@@ -2571,20 +2570,20 @@ var L = h`jsx`({
|
|
|
2571
2570
|
UnterminatedJsxContent: "Unterminated JSX contents.",
|
|
2572
2571
|
UnwrappedAdjacentJSXElements: "Adjacent JSX elements must be wrapped in an enclosing tag. Did you want a JSX fragment <>...</>?"
|
|
2573
2572
|
});
|
|
2574
|
-
function
|
|
2573
|
+
function L(e) {
|
|
2575
2574
|
return e ? e.type === "JSXOpeningFragment" || e.type === "JSXClosingFragment" : !1;
|
|
2576
2575
|
}
|
|
2577
|
-
function
|
|
2576
|
+
function R(e) {
|
|
2578
2577
|
if (e.type === "JSXIdentifier") return e.name;
|
|
2579
2578
|
if (e.type === "JSXNamespacedName") return e.namespace.name + ":" + e.name.name;
|
|
2580
|
-
if (e.type === "JSXMemberExpression") return
|
|
2579
|
+
if (e.type === "JSXMemberExpression") return R(e.object) + "." + R(e.property);
|
|
2581
2580
|
throw Error("Node had unexpected type: " + e.type);
|
|
2582
2581
|
}
|
|
2583
|
-
var
|
|
2582
|
+
var dt = (e) => class extends e {
|
|
2584
2583
|
jsxReadToken() {
|
|
2585
2584
|
let e = "", t = this.state.pos;
|
|
2586
2585
|
for (;;) {
|
|
2587
|
-
if (this.state.pos >= this.length) throw this.raise(
|
|
2586
|
+
if (this.state.pos >= this.length) throw this.raise(I.UnterminatedJsxContent, this.state.startLoc);
|
|
2588
2587
|
let n = this.input.charCodeAt(this.state.pos);
|
|
2589
2588
|
switch (n) {
|
|
2590
2589
|
case 60:
|
|
@@ -2599,11 +2598,11 @@ var ut = (e) => class extends e {
|
|
|
2599
2598
|
e += this.input.slice(t, this.state.pos), e += this.jsxReadEntity(), t = this.state.pos;
|
|
2600
2599
|
break;
|
|
2601
2600
|
case 62:
|
|
2602
|
-
case 125: this.raise(
|
|
2601
|
+
case 125: this.raise(I.UnexpectedToken, this.state.curPosition(), {
|
|
2603
2602
|
unexpected: this.input[this.state.pos],
|
|
2604
2603
|
HTMLEntity: n === 125 ? "}" : ">"
|
|
2605
2604
|
});
|
|
2606
|
-
default:
|
|
2605
|
+
default: F(n) ? (e += this.input.slice(t, this.state.pos), e += this.jsxReadNewLine(!0), t = this.state.pos) : ++this.state.pos;
|
|
2607
2606
|
}
|
|
2608
2607
|
}
|
|
2609
2608
|
}
|
|
@@ -2617,7 +2616,7 @@ var ut = (e) => class extends e {
|
|
|
2617
2616
|
if (this.state.pos >= this.length) throw this.raise(g.UnterminatedString, this.state.startLoc);
|
|
2618
2617
|
let r = this.input.charCodeAt(this.state.pos);
|
|
2619
2618
|
if (r === e) break;
|
|
2620
|
-
r === 38 ? (t += this.input.slice(n, this.state.pos), t += this.jsxReadEntity(), n = this.state.pos) :
|
|
2619
|
+
r === 38 ? (t += this.input.slice(n, this.state.pos), t += this.jsxReadEntity(), n = this.state.pos) : F(r) ? (t += this.input.slice(n, this.state.pos), t += this.jsxReadNewLine(!1), n = this.state.pos) : ++this.state.pos;
|
|
2621
2620
|
}
|
|
2622
2621
|
t += this.input.slice(n, this.state.pos++), this.finishToken(130, t);
|
|
2623
2622
|
}
|
|
@@ -2633,7 +2632,7 @@ var ut = (e) => class extends e {
|
|
|
2633
2632
|
let t = 0, n = !1;
|
|
2634
2633
|
for (; t++ < 10 && this.state.pos < this.length && !(n = this.codePointAtPos(this.state.pos) === 59);) ++this.state.pos;
|
|
2635
2634
|
if (n) {
|
|
2636
|
-
let t =
|
|
2635
|
+
let t = at[this.input.slice(e, this.state.pos)];
|
|
2637
2636
|
if (++this.state.pos, t) return t;
|
|
2638
2637
|
}
|
|
2639
2638
|
}
|
|
@@ -2643,7 +2642,7 @@ var ut = (e) => class extends e {
|
|
|
2643
2642
|
let e, t = this.state.pos;
|
|
2644
2643
|
do
|
|
2645
2644
|
e = this.input.charCodeAt(++this.state.pos);
|
|
2646
|
-
while (
|
|
2645
|
+
while (N(e) || e === 45);
|
|
2647
2646
|
this.finishToken(136, this.input.slice(t, this.state.pos));
|
|
2648
2647
|
}
|
|
2649
2648
|
jsxParseIdentifier() {
|
|
@@ -2668,10 +2667,10 @@ var ut = (e) => class extends e {
|
|
|
2668
2667
|
jsxParseAttributeValue() {
|
|
2669
2668
|
let e;
|
|
2670
2669
|
switch (this.state.type) {
|
|
2671
|
-
case 2: return e = this.startNode(), this.setContext(
|
|
2670
|
+
case 2: return e = this.startNode(), this.setContext(j.brace), this.next(), e = this.jsxParseExpressionContainer(e, j.j_oTag), e.expression.type === "JSXEmptyExpression" && this.raise(I.AttributeIsEmpty, e), e;
|
|
2672
2671
|
case 138:
|
|
2673
2672
|
case 130: return this.parseExprAtom();
|
|
2674
|
-
default: throw this.raise(
|
|
2673
|
+
default: throw this.raise(I.UnsupportedJsxValue, this.state.startLoc);
|
|
2675
2674
|
}
|
|
2676
2675
|
}
|
|
2677
2676
|
jsxParseEmptyExpression() {
|
|
@@ -2679,20 +2678,20 @@ var ut = (e) => class extends e {
|
|
|
2679
2678
|
return this.finishNodeAt(e, "JSXEmptyExpression", this.state.startLoc);
|
|
2680
2679
|
}
|
|
2681
2680
|
jsxParseSpreadChild(e) {
|
|
2682
|
-
return this.next(), e.expression = this.parseExpression(), this.setContext(
|
|
2681
|
+
return this.next(), e.expression = this.parseExpression(), this.setContext(j.j_expr), this.state.canStartJSXElement = !0, this.expect(4), this.finishNode(e, "JSXSpreadChild");
|
|
2683
2682
|
}
|
|
2684
2683
|
jsxParseExpressionContainer(e, t) {
|
|
2685
2684
|
if (this.match(4)) e.expression = this.jsxParseEmptyExpression();
|
|
2686
2685
|
else {
|
|
2687
2686
|
let t = this.parseExpression();
|
|
2688
|
-
t.type === "SequenceExpression" && !t.extra?.parenthesized && this.raise(
|
|
2687
|
+
t.type === "SequenceExpression" && !t.extra?.parenthesized && this.raise(I.UnexpectedSequenceExpression, t.expressions[1]), e.expression = t;
|
|
2689
2688
|
}
|
|
2690
2689
|
return this.setContext(t), this.state.canStartJSXElement = !0, this.expect(4), this.finishNode(e, "JSXExpressionContainer");
|
|
2691
2690
|
}
|
|
2692
2691
|
jsxParseAttribute() {
|
|
2693
2692
|
if (this.match(2)) {
|
|
2694
2693
|
let e = this.startNode();
|
|
2695
|
-
return this.setContext(
|
|
2694
|
+
return this.setContext(j.brace), this.next(), this.expect(17), e.argument = this.parseMaybeAssignAllowIn(), this.setContext(j.j_oTag), this.state.canStartJSXElement = !0, this.expect(4), this.finishNode(e, "JSXSpreadAttribute");
|
|
2696
2695
|
}
|
|
2697
2696
|
let e = this.startNode();
|
|
2698
2697
|
return e.name = this.jsxParseNamespacedName(), e.value = this.eat(25) ? this.jsxParseAttributeValue() : null, this.finishNode(e, "JSXAttribute");
|
|
@@ -2734,15 +2733,15 @@ var ut = (e) => class extends e {
|
|
|
2734
2733
|
break;
|
|
2735
2734
|
case 2: {
|
|
2736
2735
|
let e = this.startNode();
|
|
2737
|
-
this.setContext(
|
|
2736
|
+
this.setContext(j.brace), this.next(), this.match(17) ? n.push(this.jsxParseSpreadChild(e)) : n.push(this.jsxParseExpressionContainer(e, j.j_expr));
|
|
2738
2737
|
break;
|
|
2739
2738
|
}
|
|
2740
2739
|
default: this.unexpected();
|
|
2741
2740
|
}
|
|
2742
|
-
|
|
2741
|
+
L(r) && !L(i) && i !== null ? this.raise(I.MissingClosingTagFragment, i) : (!L(r) && L(i) || !L(r) && !L(i) && R(i.name) !== R(r.name)) && this.raise(I.MissingClosingTagElement, i, { openingTagName: R(r.name) });
|
|
2743
2742
|
}
|
|
2744
|
-
if (
|
|
2745
|
-
return
|
|
2743
|
+
if (L(r) ? (t.openingFragment = r, t.closingFragment = i) : (t.openingElement = r, t.closingElement = i), t.children = n, this.match(43)) throw this.raise(I.UnwrappedAdjacentJSXElements, this.state.startLoc);
|
|
2744
|
+
return L(r) ? this.finishNode(t, "JSXFragment") : this.finishNode(t, "JSXElement");
|
|
2746
2745
|
}
|
|
2747
2746
|
jsxParseElement() {
|
|
2748
2747
|
let e = this.state.startLoc;
|
|
@@ -2760,12 +2759,12 @@ var ut = (e) => class extends e {
|
|
|
2760
2759
|
}
|
|
2761
2760
|
getTokenFromCode(e) {
|
|
2762
2761
|
let t = this.curContext();
|
|
2763
|
-
if (t ===
|
|
2762
|
+
if (t === j.j_expr) {
|
|
2764
2763
|
this.jsxReadToken();
|
|
2765
2764
|
return;
|
|
2766
2765
|
}
|
|
2767
|
-
if (t ===
|
|
2768
|
-
if (
|
|
2766
|
+
if (t === j.j_oTag || t === j.j_cTag) {
|
|
2767
|
+
if (M(e)) {
|
|
2769
2768
|
this.jsxReadWord();
|
|
2770
2769
|
return;
|
|
2771
2770
|
}
|
|
@@ -2773,7 +2772,7 @@ var ut = (e) => class extends e {
|
|
|
2773
2772
|
++this.state.pos, this.finishToken(139);
|
|
2774
2773
|
return;
|
|
2775
2774
|
}
|
|
2776
|
-
if ((e === 34 || e === 39) && t ===
|
|
2775
|
+
if ((e === 34 || e === 39) && t === j.j_oTag) {
|
|
2777
2776
|
this.jsxReadString(e);
|
|
2778
2777
|
return;
|
|
2779
2778
|
}
|
|
@@ -2786,23 +2785,23 @@ var ut = (e) => class extends e {
|
|
|
2786
2785
|
}
|
|
2787
2786
|
updateContext(e) {
|
|
2788
2787
|
let { context: t, type: n } = this.state;
|
|
2789
|
-
if (n === 52 && e === 138) t.splice(-2, 2,
|
|
2790
|
-
else if (n === 138) t.push(
|
|
2788
|
+
if (n === 52 && e === 138) t.splice(-2, 2, j.j_cTag), this.state.canStartJSXElement = !1;
|
|
2789
|
+
else if (n === 138) t.push(j.j_oTag);
|
|
2791
2790
|
else if (n === 139) {
|
|
2792
2791
|
let n = t[t.length - 1];
|
|
2793
|
-
n ===
|
|
2792
|
+
n === j.j_oTag && e === 52 || n === j.j_cTag ? (t.pop(), this.state.canStartJSXElement = t[t.length - 1] === j.j_expr) : (this.setContext(j.j_expr), this.state.canStartJSXElement = !0);
|
|
2794
2793
|
} else this.state.canStartJSXElement = ge(n);
|
|
2795
2794
|
}
|
|
2796
|
-
}, dt = class extends qe {
|
|
2797
|
-
tsNames = /* @__PURE__ */ new Map();
|
|
2798
2795
|
}, ft = class extends Je {
|
|
2796
|
+
tsNames = /* @__PURE__ */ new Map();
|
|
2797
|
+
}, pt = class extends Ye {
|
|
2799
2798
|
get inTSNamespace() {
|
|
2800
2799
|
let e = this.scopeStack;
|
|
2801
2800
|
return e.length >= 2 && e[e.length - 1].flags === 0 && (e[e.length - 2].flags & 2048) > 0;
|
|
2802
2801
|
}
|
|
2803
2802
|
importsStack = [];
|
|
2804
2803
|
createScope(e) {
|
|
2805
|
-
return this.importsStack.push(/* @__PURE__ */ new Set()), new
|
|
2804
|
+
return this.importsStack.push(/* @__PURE__ */ new Set()), new ft(e);
|
|
2806
2805
|
}
|
|
2807
2806
|
enter(e) {
|
|
2808
2807
|
e & 3072 && this.importsStack.push(/* @__PURE__ */ new Set()), super.enter(e);
|
|
@@ -2845,7 +2844,7 @@ var ut = (e) => class extends e {
|
|
|
2845
2844
|
}
|
|
2846
2845
|
super.checkLocalExport(e);
|
|
2847
2846
|
}
|
|
2848
|
-
},
|
|
2847
|
+
}, mt = class {
|
|
2849
2848
|
sawUnambiguousESM = !1;
|
|
2850
2849
|
ambiguousScriptDifferentAst = !1;
|
|
2851
2850
|
sourceToOffsetPos(e) {
|
|
@@ -2868,21 +2867,21 @@ var ut = (e) => class extends e {
|
|
|
2868
2867
|
return this.plugins.get(e)?.[t];
|
|
2869
2868
|
}
|
|
2870
2869
|
};
|
|
2871
|
-
function
|
|
2870
|
+
function ht(e, t) {
|
|
2872
2871
|
e.trailingComments === void 0 ? e.trailingComments = t : e.trailingComments.unshift(...t);
|
|
2873
2872
|
}
|
|
2874
|
-
function
|
|
2873
|
+
function gt(e, t) {
|
|
2875
2874
|
e.leadingComments === void 0 ? e.leadingComments = t : e.leadingComments.unshift(...t);
|
|
2876
2875
|
}
|
|
2877
|
-
function
|
|
2876
|
+
function z(e, t) {
|
|
2878
2877
|
e.innerComments === void 0 ? e.innerComments = t : e.innerComments.unshift(...t);
|
|
2879
2878
|
}
|
|
2880
|
-
function
|
|
2879
|
+
function B(e, t, n) {
|
|
2881
2880
|
let r = null, i = t.length;
|
|
2882
2881
|
for (; r === null && i > 0;) r = t[--i];
|
|
2883
|
-
r === null || r.start > n.start ?
|
|
2882
|
+
r === null || r.start > n.start ? z(e, n.comments) : ht(r, n.comments);
|
|
2884
2883
|
}
|
|
2885
|
-
var
|
|
2884
|
+
var _t = class extends mt {
|
|
2886
2885
|
addComment(e) {
|
|
2887
2886
|
this.filename && (e.loc.filename = this.filename);
|
|
2888
2887
|
let { commentsLen: t } = this.state;
|
|
@@ -2905,21 +2904,21 @@ var gt = class extends pt {
|
|
|
2905
2904
|
}
|
|
2906
2905
|
finalizeComment(e) {
|
|
2907
2906
|
let { comments: t } = e;
|
|
2908
|
-
if (e.leadingNode !== null || e.trailingNode !== null) e.leadingNode !== null &&
|
|
2907
|
+
if (e.leadingNode !== null || e.trailingNode !== null) e.leadingNode !== null && ht(e.leadingNode, t), e.trailingNode !== null && gt(e.trailingNode, t);
|
|
2909
2908
|
else {
|
|
2910
2909
|
let n = e.containingNode, r = e.start;
|
|
2911
2910
|
if (this.input.charCodeAt(this.offsetToSourcePos(r) - 1) === 44) switch (n.type) {
|
|
2912
2911
|
case "ObjectExpression":
|
|
2913
2912
|
case "ObjectPattern":
|
|
2914
|
-
|
|
2913
|
+
B(n, n.properties, e);
|
|
2915
2914
|
break;
|
|
2916
2915
|
case "CallExpression":
|
|
2917
2916
|
case "NewExpression":
|
|
2918
2917
|
case "OptionalCallExpression":
|
|
2919
|
-
|
|
2918
|
+
B(n, n.arguments, e);
|
|
2920
2919
|
break;
|
|
2921
2920
|
case "ImportExpression":
|
|
2922
|
-
|
|
2921
|
+
B(n, [n.source, n.options ?? null], e);
|
|
2923
2922
|
break;
|
|
2924
2923
|
case "FunctionDeclaration":
|
|
2925
2924
|
case "FunctionExpression":
|
|
@@ -2928,25 +2927,25 @@ var gt = class extends pt {
|
|
|
2928
2927
|
case "ClassMethod":
|
|
2929
2928
|
case "ClassPrivateMethod":
|
|
2930
2929
|
case "TSTypeParameterDeclaration":
|
|
2931
|
-
|
|
2930
|
+
B(n, n.params, e);
|
|
2932
2931
|
break;
|
|
2933
2932
|
case "ArrayExpression":
|
|
2934
2933
|
case "ArrayPattern":
|
|
2935
|
-
|
|
2934
|
+
B(n, n.elements, e);
|
|
2936
2935
|
break;
|
|
2937
2936
|
case "ExportNamedDeclaration":
|
|
2938
2937
|
case "ImportDeclaration":
|
|
2939
|
-
|
|
2938
|
+
B(n, n.specifiers, e);
|
|
2940
2939
|
break;
|
|
2941
2940
|
case "TSEnumBody":
|
|
2942
|
-
|
|
2941
|
+
B(n, n.members, e);
|
|
2943
2942
|
break;
|
|
2944
2943
|
case "TSInterfaceBody":
|
|
2945
|
-
|
|
2944
|
+
B(n, n.body, e);
|
|
2946
2945
|
break;
|
|
2947
|
-
default:
|
|
2946
|
+
default: z(n, t);
|
|
2948
2947
|
}
|
|
2949
|
-
else
|
|
2948
|
+
else z(n, t);
|
|
2950
2949
|
}
|
|
2951
2950
|
}
|
|
2952
2951
|
finalizeRemainingComments() {
|
|
@@ -2971,7 +2970,7 @@ var gt = class extends pt {
|
|
|
2971
2970
|
else if (o < t) break;
|
|
2972
2971
|
}
|
|
2973
2972
|
}
|
|
2974
|
-
},
|
|
2973
|
+
}, vt = class t {
|
|
2975
2974
|
flags = 2048;
|
|
2976
2975
|
get strict() {
|
|
2977
2976
|
return (this.flags & 1) > 0;
|
|
@@ -3060,7 +3059,7 @@ var gt = class extends pt {
|
|
|
3060
3059
|
end = 0;
|
|
3061
3060
|
lastTokEndLoc = null;
|
|
3062
3061
|
lastTokStartLoc = null;
|
|
3063
|
-
context = [
|
|
3062
|
+
context = [j.brace];
|
|
3064
3063
|
get canStartJSXElement() {
|
|
3065
3064
|
return (this.flags & 2048) > 0;
|
|
3066
3065
|
}
|
|
@@ -3089,9 +3088,9 @@ var gt = class extends pt {
|
|
|
3089
3088
|
let e = new t();
|
|
3090
3089
|
return e.flags = this.flags, e.startIndex = this.startIndex, e.curLine = this.curLine, e.lineStart = this.lineStart, e.startLoc = this.startLoc, e.endLoc = this.endLoc, e.errors = this.errors.slice(), e.noArrowAt = this.noArrowAt.slice(), e.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice(), e.labels = this.labels.slice(), e.commentsLen = this.commentsLen, e.commentStack = this.commentStack.slice(), e.pos = this.pos, e.type = this.type, e.value = this.value, e.start = this.start, e.end = this.end, e.lastTokEndLoc = this.lastTokEndLoc, e.lastTokStartLoc = this.lastTokStartLoc, e.context = this.context.slice(), e.firstInvalidTemplateEscapePos = this.firstInvalidTemplateEscapePos, e.strictErrors = this.strictErrors, e.tokensLength = this.tokensLength, e;
|
|
3091
3090
|
}
|
|
3092
|
-
},
|
|
3091
|
+
}, yt = function(e) {
|
|
3093
3092
|
return e >= 48 && e <= 57;
|
|
3094
|
-
},
|
|
3093
|
+
}, bt = {
|
|
3095
3094
|
decBinOct: /* @__PURE__ */ new Set([
|
|
3096
3095
|
46,
|
|
3097
3096
|
66,
|
|
@@ -3108,13 +3107,13 @@ var gt = class extends pt {
|
|
|
3108
3107
|
95,
|
|
3109
3108
|
120
|
|
3110
3109
|
])
|
|
3111
|
-
},
|
|
3110
|
+
}, xt = {
|
|
3112
3111
|
bin: (e) => e === 48 || e === 49,
|
|
3113
3112
|
oct: (e) => e >= 48 && e <= 55,
|
|
3114
3113
|
dec: (e) => e >= 48 && e <= 57,
|
|
3115
3114
|
hex: (e) => e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102
|
|
3116
3115
|
};
|
|
3117
|
-
function
|
|
3116
|
+
function St(e, t, n, r, i, a) {
|
|
3118
3117
|
let o = n, s = r, c = i, l = "", u = null, d = n, { length: f } = t;
|
|
3119
3118
|
for (;;) {
|
|
3120
3119
|
if (n >= f) {
|
|
@@ -3122,13 +3121,13 @@ function xt(e, t, n, r, i, a) {
|
|
|
3122
3121
|
break;
|
|
3123
3122
|
}
|
|
3124
3123
|
let p = t.charCodeAt(n);
|
|
3125
|
-
if (
|
|
3124
|
+
if (Ct(e, p, t, n)) {
|
|
3126
3125
|
l += t.slice(d, n);
|
|
3127
3126
|
break;
|
|
3128
3127
|
}
|
|
3129
3128
|
if (p === 92) {
|
|
3130
3129
|
l += t.slice(d, n);
|
|
3131
|
-
let o =
|
|
3130
|
+
let o = wt(t, n, r, i, e === "template", a);
|
|
3132
3131
|
o.ch === null && !u ? u = {
|
|
3133
3132
|
pos: n,
|
|
3134
3133
|
lineStart: r,
|
|
@@ -3144,10 +3143,10 @@ function xt(e, t, n, r, i, a) {
|
|
|
3144
3143
|
curLine: i
|
|
3145
3144
|
};
|
|
3146
3145
|
}
|
|
3147
|
-
function
|
|
3146
|
+
function Ct(e, t, n, r) {
|
|
3148
3147
|
return e === "template" ? t === 96 || t === 36 && n.charCodeAt(r + 1) === 123 : t === (e === "double" ? 34 : 39);
|
|
3149
3148
|
}
|
|
3150
|
-
function
|
|
3149
|
+
function wt(e, t, n, r, i, a) {
|
|
3151
3150
|
let o = !i;
|
|
3152
3151
|
t++;
|
|
3153
3152
|
let s = (e) => ({
|
|
@@ -3161,11 +3160,11 @@ function Ct(e, t, n, r, i, a) {
|
|
|
3161
3160
|
case 114: return s("\r");
|
|
3162
3161
|
case 120: {
|
|
3163
3162
|
let i;
|
|
3164
|
-
return {code: i, pos: t} =
|
|
3163
|
+
return {code: i, pos: t} = Tt(e, t, n, r, 2, !1, o, a), s(i === null ? null : String.fromCharCode(i));
|
|
3165
3164
|
}
|
|
3166
3165
|
case 117: {
|
|
3167
3166
|
let i;
|
|
3168
|
-
return {code: i, pos: t} =
|
|
3167
|
+
return {code: i, pos: t} = Dt(e, t, n, r, o, a), s(i === null ? null : String.fromCodePoint(i));
|
|
3169
3168
|
}
|
|
3170
3169
|
case 116: return s(" ");
|
|
3171
3170
|
case 98: return s("\b");
|
|
@@ -3193,15 +3192,15 @@ function Ct(e, t, n, r, i, a) {
|
|
|
3193
3192
|
return s(String.fromCharCode(c));
|
|
3194
3193
|
}
|
|
3195
3194
|
}
|
|
3196
|
-
function
|
|
3195
|
+
function Tt(e, t, n, r, i, a, o, s) {
|
|
3197
3196
|
let c = t, l;
|
|
3198
|
-
return {n: l, pos: t} =
|
|
3197
|
+
return {n: l, pos: t} = Et(e, t, n, r, 16, i, a, !1, s, !o), l === null && (o ? s.invalidEscapeSequence(c, n, r) : t = c - 1), {
|
|
3199
3198
|
code: l,
|
|
3200
3199
|
pos: t
|
|
3201
3200
|
};
|
|
3202
3201
|
}
|
|
3203
|
-
function
|
|
3204
|
-
let u = t, d = i === 16 ?
|
|
3202
|
+
function Et(e, t, n, r, i, a, o, s, c, l) {
|
|
3203
|
+
let u = t, d = i === 16 ? bt.hex : bt.decBinOct, f = i === 16 ? xt.hex : i === 10 ? xt.dec : i === 8 ? xt.oct : xt.bin, p = !1, m = 0;
|
|
3205
3204
|
for (let u = 0, h = a ?? Infinity; u < h; ++u) {
|
|
3206
3205
|
let a = e.charCodeAt(t), u;
|
|
3207
3206
|
if (a === 95 && s !== "bail") {
|
|
@@ -3222,7 +3221,7 @@ function Tt(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3222
3221
|
++t;
|
|
3223
3222
|
continue;
|
|
3224
3223
|
}
|
|
3225
|
-
if (u = a >= 97 ? a - 97 + 10 : a >= 65 ? a - 65 + 10 :
|
|
3224
|
+
if (u = a >= 97 ? a - 97 + 10 : a >= 65 ? a - 65 + 10 : yt(a) ? a - 48 : Infinity, u >= i) {
|
|
3226
3225
|
if (u <= 9 && l) return {
|
|
3227
3226
|
n: null,
|
|
3228
3227
|
pos: t
|
|
@@ -3241,26 +3240,26 @@ function Tt(e, t, n, r, i, a, o, s, c, l) {
|
|
|
3241
3240
|
pos: t
|
|
3242
3241
|
};
|
|
3243
3242
|
}
|
|
3244
|
-
function
|
|
3243
|
+
function Dt(e, t, n, r, i, a) {
|
|
3245
3244
|
let o = e.charCodeAt(t), s;
|
|
3246
3245
|
if (o === 123) {
|
|
3247
|
-
if (++t, {code: s, pos: t} =
|
|
3246
|
+
if (++t, {code: s, pos: t} = Tt(e, t, n, r, e.indexOf("}", t) - t, !0, i, a), ++t, s !== null && s > 1114111) {
|
|
3248
3247
|
if (i) a.invalidCodePoint(t, n, r);
|
|
3249
3248
|
else return {
|
|
3250
3249
|
code: null,
|
|
3251
3250
|
pos: t
|
|
3252
3251
|
};
|
|
3253
3252
|
}
|
|
3254
|
-
} else ({code: s, pos: t} =
|
|
3253
|
+
} else ({code: s, pos: t} = Tt(e, t, n, r, 4, !1, i, a));
|
|
3255
3254
|
return {
|
|
3256
3255
|
code: s,
|
|
3257
3256
|
pos: t
|
|
3258
3257
|
};
|
|
3259
3258
|
}
|
|
3260
|
-
function
|
|
3259
|
+
function V(t, n, r) {
|
|
3261
3260
|
return new e(r, t - n, t);
|
|
3262
3261
|
}
|
|
3263
|
-
var
|
|
3262
|
+
var Ot = /* @__PURE__ */ new Set([
|
|
3264
3263
|
103,
|
|
3265
3264
|
109,
|
|
3266
3265
|
115,
|
|
@@ -3269,16 +3268,16 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3269
3268
|
117,
|
|
3270
3269
|
100,
|
|
3271
3270
|
118
|
|
3272
|
-
]),
|
|
3271
|
+
]), kt = class {
|
|
3273
3272
|
constructor(e) {
|
|
3274
3273
|
let n = e.startIndex || 0;
|
|
3275
3274
|
this.type = e.type, this.value = e.value, this.start = n + e.start, this.end = n + e.end, this.loc = new t(e.startLoc, e.endLoc);
|
|
3276
3275
|
}
|
|
3277
|
-
},
|
|
3276
|
+
}, At, jt = class extends _t {
|
|
3278
3277
|
isLookahead;
|
|
3279
3278
|
tokens = [];
|
|
3280
3279
|
constructor(e, t) {
|
|
3281
|
-
super(), this.state = new
|
|
3280
|
+
super(), this.state = new vt(), this.state.init(e), this.input = t, this.length = t.length, this.comments = [], this.isLookahead = !1, (!At || At.length < (this.length + 1) * 2) && (At = new Uint32Array((this.length + 1) * 2)), this.locData = At;
|
|
3282
3281
|
}
|
|
3283
3282
|
setLoc(e) {
|
|
3284
3283
|
let t = this.offsetToSourcePos(e.index);
|
|
@@ -3292,7 +3291,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3292
3291
|
this.tokens.length = this.state.tokensLength, this.tokens.push(e), ++this.state.tokensLength;
|
|
3293
3292
|
}
|
|
3294
3293
|
next() {
|
|
3295
|
-
this.checkKeywordEscapes(), this.optionFlags & 512 && this.pushToken(new
|
|
3294
|
+
this.checkKeywordEscapes(), this.optionFlags & 512 && this.pushToken(new kt(this.state)), this.state.lastTokEndLoc = this.state.endLoc, this.state.lastTokStartLoc = this.state.startLoc, this.nextToken();
|
|
3296
3295
|
}
|
|
3297
3296
|
eat(e) {
|
|
3298
3297
|
return this.match(e) ? (this.next(), !0) : !1;
|
|
@@ -3326,7 +3325,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3326
3325
|
return this.nextTokenStartSince(this.state.pos);
|
|
3327
3326
|
}
|
|
3328
3327
|
nextTokenStartSince(e) {
|
|
3329
|
-
return
|
|
3328
|
+
return ct.lastIndex = e, ct.test(this.input) ? ct.lastIndex : e;
|
|
3330
3329
|
}
|
|
3331
3330
|
lookaheadCharCode() {
|
|
3332
3331
|
return this.lookaheadCharCodeSince(this.state.pos);
|
|
@@ -3338,7 +3337,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3338
3337
|
return this.nextTokenInLineStartSince(this.state.pos);
|
|
3339
3338
|
}
|
|
3340
3339
|
nextTokenInLineStartSince(e) {
|
|
3341
|
-
return
|
|
3340
|
+
return lt.lastIndex = e, lt.test(this.input) ? lt.lastIndex : e;
|
|
3342
3341
|
}
|
|
3343
3342
|
lookaheadInLineCharCode() {
|
|
3344
3343
|
return this.input.charCodeAt(this.nextTokenInLineStart());
|
|
@@ -3369,7 +3368,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3369
3368
|
this.isLookahead || (n = this.state.curPosition());
|
|
3370
3369
|
let r = this.state.pos, i = this.input.indexOf(e, r + 2);
|
|
3371
3370
|
if (i === -1) throw this.raise(g.UnterminatedComment, this.state.curPosition());
|
|
3372
|
-
for (this.state.pos = i + e.length,
|
|
3371
|
+
for (this.state.pos = i + e.length, ot.lastIndex = r + 2; ot.test(this.input) && ot.lastIndex <= i;) ++this.state.curLine, this.state.lineStart = ot.lastIndex;
|
|
3373
3372
|
if (this.isLookahead) return;
|
|
3374
3373
|
let a = {
|
|
3375
3374
|
type: "CommentBlock",
|
|
@@ -3384,7 +3383,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3384
3383
|
let n = this.state.pos, r;
|
|
3385
3384
|
this.isLookahead || (r = this.state.curPosition());
|
|
3386
3385
|
let i = this.input.charCodeAt(this.state.pos += e);
|
|
3387
|
-
if (this.state.pos < this.length) for (; !
|
|
3386
|
+
if (this.state.pos < this.length) for (; !F(i) && ++this.state.pos < this.length;) i = this.input.charCodeAt(this.state.pos);
|
|
3388
3387
|
if (this.isLookahead) return;
|
|
3389
3388
|
let a = this.state.pos, o = {
|
|
3390
3389
|
type: "CommentLine",
|
|
@@ -3426,7 +3425,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3426
3425
|
default: break loop;
|
|
3427
3426
|
}
|
|
3428
3427
|
break;
|
|
3429
|
-
default: if (
|
|
3428
|
+
default: if (ut(n)) ++this.state.pos;
|
|
3430
3429
|
else if (n === 45 && !this.inModule && this.optionFlags & 16384) {
|
|
3431
3430
|
let n = this.state.pos;
|
|
3432
3431
|
if (this.input.charCodeAt(n + 1) === 45 && this.input.charCodeAt(n + 2) === 62 && (e === 0 || this.state.lineStart > e)) {
|
|
@@ -3466,7 +3465,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3466
3465
|
if (this.state.pos === 0 && this.readToken_interpreter()) return;
|
|
3467
3466
|
let e = this.state.pos + 1, t = this.codePointAtPos(e);
|
|
3468
3467
|
if (t >= 48 && t <= 57) throw this.raise(g.UnexpectedDigitAfterHash, this.state.curPosition());
|
|
3469
|
-
|
|
3468
|
+
M(t) ? (++this.state.pos, this.finishToken(134, this.readWord1(t))) : t === 92 ? (++this.state.pos, this.finishToken(134, this.readWord1())) : this.finishOp(23, 1);
|
|
3470
3469
|
}
|
|
3471
3470
|
readToken_dot() {
|
|
3472
3471
|
let e = this.input.charCodeAt(this.state.pos + 1);
|
|
@@ -3484,7 +3483,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3484
3483
|
let e = this.input.charCodeAt(this.state.pos + 1);
|
|
3485
3484
|
if (e !== 33) return !1;
|
|
3486
3485
|
let t = this.state.pos;
|
|
3487
|
-
for (this.state.pos += 1; !
|
|
3486
|
+
for (this.state.pos += 1; !F(e) && ++this.state.pos < this.length;) e = this.input.charCodeAt(this.state.pos);
|
|
3488
3487
|
let n = this.input.slice(t + 2, this.state.pos);
|
|
3489
3488
|
return this.finishToken(24, n), !0;
|
|
3490
3489
|
}
|
|
@@ -3686,7 +3685,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3686
3685
|
case 92:
|
|
3687
3686
|
this.readWord();
|
|
3688
3687
|
return;
|
|
3689
|
-
default: if (
|
|
3688
|
+
default: if (M(e)) {
|
|
3690
3689
|
this.readWord(e);
|
|
3691
3690
|
return;
|
|
3692
3691
|
}
|
|
@@ -3702,7 +3701,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3702
3701
|
for (;; ++a) {
|
|
3703
3702
|
if (a >= this.length) throw this.raise(g.UnterminatedRegExp, n(e, 1));
|
|
3704
3703
|
let t = this.input.charCodeAt(a);
|
|
3705
|
-
if (
|
|
3704
|
+
if (F(t)) throw this.raise(g.UnterminatedRegExp, n(e, 1));
|
|
3706
3705
|
if (r) r = !1;
|
|
3707
3706
|
else {
|
|
3708
3707
|
if (t === 91) i = !0;
|
|
@@ -3716,8 +3715,8 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3716
3715
|
let s = "", c = () => n(e, a + 2 - t);
|
|
3717
3716
|
for (; a < this.length;) {
|
|
3718
3717
|
let e = this.codePointAtPos(a), t = String.fromCharCode(e);
|
|
3719
|
-
if (
|
|
3720
|
-
else if (
|
|
3718
|
+
if (Ot.has(e)) e === 118 ? s.includes("u") && this.raise(g.IncompatibleRegExpUVFlags, c()) : e === 117 && s.includes("v") && this.raise(g.IncompatibleRegExpUVFlags, c()), s.includes(t) && this.raise(g.DuplicateRegExpFlags, c());
|
|
3719
|
+
else if (N(e) || e === 92) this.raise(g.MalformedRegExpFlags, c());
|
|
3721
3720
|
else break;
|
|
3722
3721
|
++a, s += t;
|
|
3723
3722
|
}
|
|
@@ -3727,14 +3726,14 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3727
3726
|
});
|
|
3728
3727
|
}
|
|
3729
3728
|
readInt(e, t, n = !1, r = !0) {
|
|
3730
|
-
let { n: i, pos: a } =
|
|
3729
|
+
let { n: i, pos: a } = Et(this.input, this.state.pos, this.state.lineStart, this.state.curLine, e, t, n, r, this.errorHandlers_readInt, !1);
|
|
3731
3730
|
return this.state.pos = a, i;
|
|
3732
3731
|
}
|
|
3733
3732
|
readRadixNumber(e) {
|
|
3734
3733
|
let t = this.state.pos, r = this.state.curPosition(), i = !1;
|
|
3735
3734
|
this.state.pos += 2;
|
|
3736
3735
|
let a = this.readInt(e);
|
|
3737
|
-
if (a ?? this.raise(g.InvalidDigit, n(r, 2), { radix: e }), this.input.charCodeAt(this.state.pos) === 110 && (++this.state.pos, i = !0),
|
|
3736
|
+
if (a ?? this.raise(g.InvalidDigit, n(r, 2), { radix: e }), this.input.charCodeAt(this.state.pos) === 110 && (++this.state.pos, i = !0), M(this.codePointAtPos(this.state.pos))) throw this.raise(g.NumberIdentifier, this.state.curPosition());
|
|
3738
3737
|
if (i) {
|
|
3739
3738
|
let e = this.input.slice(t, this.state.pos).replace(/[_n]/g, "");
|
|
3740
3739
|
this.finishToken(132, e);
|
|
@@ -3757,7 +3756,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3757
3756
|
let c = this.input.charCodeAt(this.state.pos);
|
|
3758
3757
|
c === 46 && !o && (++this.state.pos, this.readInt(10), i = !0, c = this.input.charCodeAt(this.state.pos)), (c === 69 || c === 101) && !o && (c = this.input.charCodeAt(++this.state.pos), (c === 43 || c === 45) && ++this.state.pos, this.readInt(10) === null && this.raise(g.InvalidOrMissingExponent, r), i = !0, c = this.input.charCodeAt(this.state.pos));
|
|
3759
3758
|
let l = this.input.slice(t, this.state.pos).replaceAll("_", "");
|
|
3760
|
-
if (c === 110 && ((i || s) && this.raise(g.InvalidBigIntLiteral, r), ++this.state.pos, a = !0),
|
|
3759
|
+
if (c === 110 && ((i || s) && this.raise(g.InvalidBigIntLiteral, r), ++this.state.pos, a = !0), M(this.codePointAtPos(this.state.pos))) throw this.raise(g.NumberIdentifier, this.state.curPosition());
|
|
3761
3760
|
if (a) {
|
|
3762
3761
|
this.finishToken(132, l);
|
|
3763
3762
|
return;
|
|
@@ -3766,18 +3765,18 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3766
3765
|
this.finishToken(131, u);
|
|
3767
3766
|
}
|
|
3768
3767
|
readCodePoint(e) {
|
|
3769
|
-
let { code: t, pos: n } =
|
|
3768
|
+
let { code: t, pos: n } = Dt(this.input, this.state.pos, this.state.lineStart, this.state.curLine, e, this.errorHandlers_readCodePoint);
|
|
3770
3769
|
return this.state.pos = n, t;
|
|
3771
3770
|
}
|
|
3772
3771
|
readString(e) {
|
|
3773
|
-
let { str: t, pos: n, curLine: r, lineStart: i } =
|
|
3772
|
+
let { str: t, pos: n, curLine: r, lineStart: i } = St(e === 34 ? "double" : "single", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_string);
|
|
3774
3773
|
this.state.pos = n + 1, this.state.lineStart = i, this.state.curLine = r, this.finishToken(130, t);
|
|
3775
3774
|
}
|
|
3776
3775
|
readTemplateContinuation() {
|
|
3777
3776
|
this.match(4) || this.unexpected(null, 4), this.state.pos--, this.readTemplateToken();
|
|
3778
3777
|
}
|
|
3779
3778
|
readTemplateToken() {
|
|
3780
|
-
let t = this.input[this.state.pos], { str: n, firstInvalidLoc: r, pos: i, curLine: a, lineStart: o } =
|
|
3779
|
+
let t = this.input[this.state.pos], { str: n, firstInvalidLoc: r, pos: i, curLine: a, lineStart: o } = St("template", this.input, this.state.pos + 1, this.state.lineStart, this.state.curLine, this.errorHandlers_readStringContents_template);
|
|
3781
3780
|
this.state.pos = i + 1, this.state.lineStart = o, this.state.curLine = a, r && (this.state.firstInvalidTemplateEscapePos = new e(r.curLine, r.pos - r.lineStart, this.sourceToOffsetPos(r.pos))), this.input.codePointAt(i) === 96 ? this.finishToken(20, r ? null : t + n + "`") : (this.state.pos++, this.finishToken(21, r ? null : t + n + "${"));
|
|
3782
3781
|
}
|
|
3783
3782
|
recordStrictModeErrors(e, t) {
|
|
@@ -3789,10 +3788,10 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3789
3788
|
let t = "", n = this.state.pos, r = this.state.pos;
|
|
3790
3789
|
for (e !== void 0 && (this.state.pos += e <= 65535 ? 1 : 2); this.state.pos < this.length;) {
|
|
3791
3790
|
let e = this.codePointAtPos(this.state.pos);
|
|
3792
|
-
if (
|
|
3791
|
+
if (N(e)) this.state.pos += e <= 65535 ? 1 : 2;
|
|
3793
3792
|
else if (e === 92) {
|
|
3794
3793
|
this.state.containsEsc = !0, t += this.input.slice(r, this.state.pos);
|
|
3795
|
-
let e = this.state.curPosition(), i = this.state.pos === n ?
|
|
3794
|
+
let e = this.state.curPosition(), i = this.state.pos === n ? M : N;
|
|
3796
3795
|
if (this.input.charCodeAt(++this.state.pos) !== 117) {
|
|
3797
3796
|
this.raise(g.MissingUnicodeEscape, this.state.curPosition()), r = this.state.pos - 1;
|
|
3798
3797
|
continue;
|
|
@@ -3839,11 +3838,11 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3839
3838
|
}
|
|
3840
3839
|
errorBuilder(e) {
|
|
3841
3840
|
return (t, n, r) => {
|
|
3842
|
-
this.raise(e,
|
|
3841
|
+
this.raise(e, V(t, n, r));
|
|
3843
3842
|
};
|
|
3844
3843
|
}
|
|
3845
3844
|
errorHandlers_readInt = {
|
|
3846
|
-
invalidDigit: (e, t, n, r) => this.optionFlags & 4096 ? (this.raise(g.InvalidDigit,
|
|
3845
|
+
invalidDigit: (e, t, n, r) => this.optionFlags & 4096 ? (this.raise(g.InvalidDigit, V(e, t, n), { radix: r }), !0) : !1,
|
|
3847
3846
|
numericSeparatorInEscapeSequence: this.errorBuilder(g.NumericSeparatorInEscapeSequence),
|
|
3848
3847
|
unexpectedNumericSeparator: this.errorBuilder(g.UnexpectedNumericSeparator)
|
|
3849
3848
|
};
|
|
@@ -3855,24 +3854,24 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3855
3854
|
errorHandlers_readStringContents_string = {
|
|
3856
3855
|
...this.errorHandlers_readCodePoint,
|
|
3857
3856
|
strictNumericEscape: (e, t, n) => {
|
|
3858
|
-
this.recordStrictModeErrors(g.StrictNumericEscape,
|
|
3857
|
+
this.recordStrictModeErrors(g.StrictNumericEscape, V(e, t, n));
|
|
3859
3858
|
},
|
|
3860
3859
|
unterminated: (e, t, n) => {
|
|
3861
|
-
throw this.raise(g.UnterminatedString,
|
|
3860
|
+
throw this.raise(g.UnterminatedString, V(e - 1, t, n));
|
|
3862
3861
|
}
|
|
3863
3862
|
};
|
|
3864
3863
|
errorHandlers_readStringContents_template = {
|
|
3865
3864
|
...this.errorHandlers_readCodePoint,
|
|
3866
3865
|
strictNumericEscape: this.errorBuilder(g.StrictNumericEscape),
|
|
3867
3866
|
unterminated: (e, t, n) => {
|
|
3868
|
-
throw this.raise(g.UnterminatedTemplate,
|
|
3867
|
+
throw this.raise(g.UnterminatedTemplate, V(e, t, n));
|
|
3869
3868
|
}
|
|
3870
3869
|
};
|
|
3871
|
-
},
|
|
3870
|
+
}, Mt = class {
|
|
3872
3871
|
privateNames = /* @__PURE__ */ new Set();
|
|
3873
3872
|
loneAccessors = /* @__PURE__ */ new Map();
|
|
3874
3873
|
undefinedPrivateNames = /* @__PURE__ */ new Map();
|
|
3875
|
-
},
|
|
3874
|
+
}, Nt = class {
|
|
3876
3875
|
parser;
|
|
3877
3876
|
stack = [];
|
|
3878
3877
|
constructor(e) {
|
|
@@ -3882,7 +3881,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3882
3881
|
return this.stack[this.stack.length - 1];
|
|
3883
3882
|
}
|
|
3884
3883
|
enter() {
|
|
3885
|
-
this.stack.push(new
|
|
3884
|
+
this.stack.push(new Mt());
|
|
3886
3885
|
}
|
|
3887
3886
|
exit() {
|
|
3888
3887
|
let e = this.stack.pop(), t = this.current();
|
|
@@ -3904,7 +3903,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3904
3903
|
for (n of this.stack) if (n.privateNames.has(e)) return;
|
|
3905
3904
|
n ? n.undefinedPrivateNames.set(e, t) : this.parser.raise(g.InvalidPrivateFieldResolution, t, { identifierName: e });
|
|
3906
3905
|
}
|
|
3907
|
-
},
|
|
3906
|
+
}, Pt = class {
|
|
3908
3907
|
constructor(e = 0) {
|
|
3909
3908
|
this.type = e;
|
|
3910
3909
|
}
|
|
@@ -3914,7 +3913,7 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3914
3913
|
isCertainlyParameterDeclaration() {
|
|
3915
3914
|
return this.type === 3;
|
|
3916
3915
|
}
|
|
3917
|
-
},
|
|
3916
|
+
}, Ft = class extends Pt {
|
|
3918
3917
|
declarationErrors = /* @__PURE__ */ new Map();
|
|
3919
3918
|
constructor(e) {
|
|
3920
3919
|
super(e);
|
|
@@ -3928,9 +3927,9 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3928
3927
|
iterateErrors(e) {
|
|
3929
3928
|
this.declarationErrors.forEach(e);
|
|
3930
3929
|
}
|
|
3931
|
-
},
|
|
3930
|
+
}, It = class {
|
|
3932
3931
|
parser;
|
|
3933
|
-
stack = [new
|
|
3932
|
+
stack = [new Pt()];
|
|
3934
3933
|
constructor(e) {
|
|
3935
3934
|
this.parser = e;
|
|
3936
3935
|
}
|
|
@@ -3968,19 +3967,19 @@ var Dt = /* @__PURE__ */ new Set([
|
|
|
3968
3967
|
});
|
|
3969
3968
|
}
|
|
3970
3969
|
};
|
|
3971
|
-
function It() {
|
|
3972
|
-
return new Nt(3);
|
|
3973
|
-
}
|
|
3974
3970
|
function Lt() {
|
|
3975
|
-
return new Pt(
|
|
3971
|
+
return new Pt(3);
|
|
3976
3972
|
}
|
|
3977
3973
|
function Rt() {
|
|
3978
|
-
return new
|
|
3974
|
+
return new Ft(1);
|
|
3979
3975
|
}
|
|
3980
3976
|
function zt() {
|
|
3981
|
-
return new
|
|
3977
|
+
return new Ft(2);
|
|
3978
|
+
}
|
|
3979
|
+
function Bt() {
|
|
3980
|
+
return new Pt();
|
|
3982
3981
|
}
|
|
3983
|
-
var
|
|
3982
|
+
var Vt = class {
|
|
3984
3983
|
stacks = [];
|
|
3985
3984
|
enter(e) {
|
|
3986
3985
|
this.stacks.push(e);
|
|
@@ -4007,10 +4006,10 @@ var Bt = class {
|
|
|
4007
4006
|
return !(this.currentFlags() & 16);
|
|
4008
4007
|
}
|
|
4009
4008
|
};
|
|
4010
|
-
function
|
|
4009
|
+
function Ht(e, t) {
|
|
4011
4010
|
return (e ? 2 : 0) | !!t;
|
|
4012
4011
|
}
|
|
4013
|
-
var
|
|
4012
|
+
var Ut = class extends jt {
|
|
4014
4013
|
addExtra(e, t, n, r = !0) {
|
|
4015
4014
|
if (!e) return;
|
|
4016
4015
|
let { extra: i } = e;
|
|
@@ -4025,7 +4024,7 @@ var Ht = class extends At {
|
|
|
4025
4024
|
isUnparsedContextual(e, t) {
|
|
4026
4025
|
if (this.input.startsWith(t, e)) {
|
|
4027
4026
|
let n = this.input.charCodeAt(e + t.length);
|
|
4028
|
-
return !(
|
|
4027
|
+
return !(N(n) || (n & 64512) == 55296);
|
|
4029
4028
|
}
|
|
4030
4029
|
return !1;
|
|
4031
4030
|
}
|
|
@@ -4046,10 +4045,10 @@ var Ht = class extends At {
|
|
|
4046
4045
|
return this.match(135) || this.match(4) || this.hasPrecedingLineBreak();
|
|
4047
4046
|
}
|
|
4048
4047
|
hasPrecedingLineBreak() {
|
|
4049
|
-
return
|
|
4048
|
+
return st(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
|
|
4050
4049
|
}
|
|
4051
4050
|
hasFollowingLineBreak() {
|
|
4052
|
-
return
|
|
4051
|
+
return st(this.input, this.state.end, this.nextTokenStart());
|
|
4053
4052
|
}
|
|
4054
4053
|
isLineTerminator() {
|
|
4055
4054
|
return this.eat(9) || this.canInsertSemicolon();
|
|
@@ -4136,11 +4135,11 @@ var Ht = class extends At {
|
|
|
4136
4135
|
let i = this.scope, a = this.getScopeHandler();
|
|
4137
4136
|
this.scope = new a(this, e);
|
|
4138
4137
|
let o = this.prodParam;
|
|
4139
|
-
this.prodParam = new
|
|
4138
|
+
this.prodParam = new Vt();
|
|
4140
4139
|
let s = this.classScope;
|
|
4141
|
-
this.classScope = new
|
|
4140
|
+
this.classScope = new Nt(this);
|
|
4142
4141
|
let c = this.expressionScope;
|
|
4143
|
-
return this.expressionScope = new
|
|
4142
|
+
return this.expressionScope = new It(this), () => {
|
|
4144
4143
|
this.state.labels = t, this.exportedIdentifiers = n, this.inModule = r, this.scope = i, this.prodParam = o, this.classScope = s, this.expressionScope = c;
|
|
4145
4144
|
};
|
|
4146
4145
|
}
|
|
@@ -4156,18 +4155,18 @@ var Ht = class extends At {
|
|
|
4156
4155
|
let { privateKeyLoc: t } = e;
|
|
4157
4156
|
t !== null && this.expectPlugin("destructuringPrivate", t);
|
|
4158
4157
|
}
|
|
4159
|
-
},
|
|
4158
|
+
}, Wt = class {
|
|
4160
4159
|
shorthandAssignLoc = null;
|
|
4161
4160
|
doubleProtoLoc = null;
|
|
4162
4161
|
privateKeyLoc = null;
|
|
4163
4162
|
optionalParametersLoc = null;
|
|
4164
4163
|
voidPatternLoc = null;
|
|
4165
|
-
},
|
|
4164
|
+
}, H = class {
|
|
4166
4165
|
constructor(e, n, r, i) {
|
|
4167
4166
|
this.start = r, this.end = 0, i !== void 0 && (this.loc = new t(i)), e & 128 && (this.range = [r, 0]), i !== void 0 && n && (this.loc.filename = n);
|
|
4168
4167
|
}
|
|
4169
4168
|
type = "";
|
|
4170
|
-
},
|
|
4169
|
+
}, Gt = H.prototype, Kt = class extends Ut {
|
|
4171
4170
|
createPosition(e) {
|
|
4172
4171
|
return e;
|
|
4173
4172
|
}
|
|
@@ -4177,11 +4176,11 @@ var Ht = class extends At {
|
|
|
4177
4176
|
}
|
|
4178
4177
|
startNodeAt(e) {
|
|
4179
4178
|
let { optionFlags: t, filename: n } = this;
|
|
4180
|
-
return t & 256 ? new
|
|
4179
|
+
return t & 256 ? new H(t, n, e.index, this.createPosition(e)) : new H(t, n, e.index);
|
|
4181
4180
|
}
|
|
4182
4181
|
startNodeAtNode(e) {
|
|
4183
4182
|
let { optionFlags: t, filename: n } = this;
|
|
4184
|
-
return t & 256 ? new
|
|
4183
|
+
return t & 256 ? new H(t, n, e.start, e.loc.start) : new H(t, n, e.start);
|
|
4185
4184
|
}
|
|
4186
4185
|
finishNode(e, t) {
|
|
4187
4186
|
return this.finishNodeAt(e, t, this.state.lastTokEndLoc);
|
|
@@ -4220,17 +4219,17 @@ var Ht = class extends At {
|
|
|
4220
4219
|
return e.type = t, e;
|
|
4221
4220
|
}
|
|
4222
4221
|
cloneIdentifier(e) {
|
|
4223
|
-
let { type: t, start: n, end: r, loc: i, range: a, name: o } = e, s = Object.create(
|
|
4222
|
+
let { type: t, start: n, end: r, loc: i, range: a, name: o } = e, s = Object.create(Gt);
|
|
4224
4223
|
return s.type = t, s.start = n, s.end = r, s.loc = i, s.range = a, s.name = o, e.extra && (s.extra = e.extra), s;
|
|
4225
4224
|
}
|
|
4226
4225
|
cloneStringLiteral(e) {
|
|
4227
|
-
let { type: t, start: n, end: r, loc: i, range: a, extra: o } = e, s = Object.create(
|
|
4226
|
+
let { type: t, start: n, end: r, loc: i, range: a, extra: o } = e, s = Object.create(Gt);
|
|
4228
4227
|
return s.type = t, s.start = n, s.end = r, s.loc = i, s.range = a, s.extra = o, s.value = e.value, s;
|
|
4229
4228
|
}
|
|
4230
|
-
},
|
|
4229
|
+
}, qt = (e) => e.type === "ParenthesizedExpression" ? qt(e.expression) : e, Jt = class extends Kt {
|
|
4231
4230
|
toAssignable(e, t = !1) {
|
|
4232
4231
|
let n;
|
|
4233
|
-
switch ((e.type === "ParenthesizedExpression" || e.extra?.parenthesized) && (n =
|
|
4232
|
+
switch ((e.type === "ParenthesizedExpression" || e.extra?.parenthesized) && (n = qt(e), t ? n.type === "Identifier" ? this.expressionScope.recordArrowParameterBindingError(g.InvalidParenthesizedAssignment, e) : n.type !== "CallExpression" && n.type !== "MemberExpression" && !this.isOptionalMemberExpression(n) && this.raise(g.InvalidParenthesizedAssignment, e) : this.raise(g.InvalidParenthesizedAssignment, e)), e.type) {
|
|
4234
4233
|
case "Identifier":
|
|
4235
4234
|
case "ObjectPattern":
|
|
4236
4235
|
case "ArrayPattern":
|
|
@@ -4397,7 +4396,7 @@ var Ht = class extends At {
|
|
|
4397
4396
|
return;
|
|
4398
4397
|
}
|
|
4399
4398
|
s === "VoidPattern" && t.type === "CatchClause" && this.raise(g.VoidPatternCatchClauseParam, e);
|
|
4400
|
-
let l =
|
|
4399
|
+
let l = qt(e);
|
|
4401
4400
|
o ||= l.type === "CallExpression" && (l.callee.type === "Import" || l.callee.type === "Super");
|
|
4402
4401
|
let u = this.isValidLVal(s, o, !(a || e.extra?.parenthesized) && t.type === "AssignmentExpression", n);
|
|
4403
4402
|
if (u === !0) return;
|
|
@@ -4413,7 +4412,7 @@ var Ht = class extends At {
|
|
|
4413
4412
|
else m && this.checkLVal(m, p, n, r, i, f, o);
|
|
4414
4413
|
}
|
|
4415
4414
|
checkIdentifier(e, t, n = !1) {
|
|
4416
|
-
this.state.strict && (n ?
|
|
4415
|
+
this.state.strict && (n ? Ue(e.name, this.inModule) : He(e.name)) && (t === 64 ? this.raise(g.StrictEvalArguments, e, { referenceName: e.name }) : this.raise(g.StrictEvalArgumentsBinding, e, { bindingName: e.name })), t & 8192 && e.name === "let" && this.raise(g.LetInLexicalBinding, e), t & 64 || this.declareNameFromIdentifier(e, t);
|
|
4417
4416
|
}
|
|
4418
4417
|
declareNameFromIdentifier(e, t) {
|
|
4419
4418
|
this.scope.declareName(e.name, t, e.start);
|
|
@@ -4433,7 +4432,7 @@ var Ht = class extends At {
|
|
|
4433
4432
|
checkCommaAfterRest(e) {
|
|
4434
4433
|
return this.match(8) ? (this.raise(this.lookaheadCharCode() === e ? g.RestTrailingComma : g.ElementAfterRest, this.state.startLoc), !0) : !1;
|
|
4435
4434
|
}
|
|
4436
|
-
},
|
|
4435
|
+
}, Yt = class extends Jt {
|
|
4437
4436
|
checkProto(e, t, n) {
|
|
4438
4437
|
if (e.type === "SpreadElement" || this.isObjectMethod(e) || e.computed || e.shorthand) return t;
|
|
4439
4438
|
let r = e.key;
|
|
@@ -4446,7 +4445,7 @@ var Ht = class extends At {
|
|
|
4446
4445
|
if (this.enterInitialScopes(), this.nextToken(), this.match(135)) throw this.raise(g.ParseExpressionEmptyInput, this.state.startLoc);
|
|
4447
4446
|
let e = this.parseExpression();
|
|
4448
4447
|
if (!this.match(135)) throw this.raise(g.ParseExpressionExpectsEOF, this.state.startLoc, { unexpected: this.input.codePointAt(this.state.start) });
|
|
4449
|
-
return this.finalizeRemainingComments(), e.comments = this.comments, e.errors = this.state.errors, this.optionFlags & 512 && (e.tokens =
|
|
4448
|
+
return this.finalizeRemainingComments(), e.comments = this.comments, e.errors = this.state.errors, this.optionFlags & 512 && (e.tokens = en(this.tokens)), e;
|
|
4450
4449
|
}
|
|
4451
4450
|
parseExpression(e, t) {
|
|
4452
4451
|
return e ? this.disallowInAnd(() => this.parseExpressionBase(t)) : this.allowInAnd(() => this.parseExpressionBase(t));
|
|
@@ -4477,7 +4476,7 @@ var Ht = class extends At {
|
|
|
4477
4476
|
return t && (e = t.call(this, e, n)), e;
|
|
4478
4477
|
}
|
|
4479
4478
|
let i;
|
|
4480
|
-
e ? i = !1 : (e = new
|
|
4479
|
+
e ? i = !1 : (e = new Wt(), i = !0), this.state.canStartArrow = !0;
|
|
4481
4480
|
let a = this.parseMaybeConditional(e);
|
|
4482
4481
|
if (t && (a = t.call(this, a, n)), _e(this.state.type)) {
|
|
4483
4482
|
let t = this.startNodeAt(n), r = this.state.value;
|
|
@@ -4642,7 +4641,7 @@ var Ht = class extends At {
|
|
|
4642
4641
|
let a = this.startNodeAt(t);
|
|
4643
4642
|
a.callee = e;
|
|
4644
4643
|
let { maybeAsyncArrow: o, optionalChainMember: s } = n;
|
|
4645
|
-
o && (this.expressionScope.enter(
|
|
4644
|
+
o && (this.expressionScope.enter(zt()), i = new Wt()), s && (a.optional = r), a.arguments = r ? this.parseCallExpressionArguments() : this.parseCallExpressionArguments(e.type !== "Super", a, i);
|
|
4646
4645
|
let c = this.finishCallExpression(a, s);
|
|
4647
4646
|
return o && this.shouldParseAsyncArrow() && !r ? (n.stop = !0, this.checkDestructuringPrivate(i), this.expressionScope.validateAsPattern(), this.expressionScope.exit(), c = this.parseAsyncArrowFromCallExpression(this.startNodeAt(t), c)) : (o && (this.checkExpressionErrors(i, !0), this.expressionScope.exit()), this.toReferencedList(a.arguments)), c;
|
|
4648
4647
|
}
|
|
@@ -4676,7 +4675,7 @@ var Ht = class extends At {
|
|
|
4676
4675
|
return this.match(15) && !this.canInsertSemicolon();
|
|
4677
4676
|
}
|
|
4678
4677
|
parseAsyncArrowFromCallExpression(e, t) {
|
|
4679
|
-
return this.resetPreviousNodeTrailingComments(t), this.expect(15), this.parseArrowExpression(e, t.arguments, !0, t.extra?.trailingCommaLoc), t.innerComments &&
|
|
4678
|
+
return this.resetPreviousNodeTrailingComments(t), this.expect(15), this.parseArrowExpression(e, t.arguments, !0, t.extra?.trailingCommaLoc), t.innerComments && z(e, t.innerComments), t.callee.trailingComments && z(e, t.callee.trailingComments), e;
|
|
4680
4679
|
}
|
|
4681
4680
|
parseNoCallExpr() {
|
|
4682
4681
|
let e = this.state.startLoc;
|
|
@@ -4726,7 +4725,7 @@ var Ht = class extends At {
|
|
|
4726
4725
|
}
|
|
4727
4726
|
case 43: {
|
|
4728
4727
|
let e = this.input.codePointAt(this.nextTokenStart());
|
|
4729
|
-
throw
|
|
4728
|
+
throw M(e) || e === 62 ? this.expectOnePlugin([
|
|
4730
4729
|
"jsx",
|
|
4731
4730
|
"flow",
|
|
4732
4731
|
"typescript"
|
|
@@ -4767,7 +4766,7 @@ var Ht = class extends At {
|
|
|
4767
4766
|
}
|
|
4768
4767
|
}
|
|
4769
4768
|
parseAsyncArrowUnaryFunction(e) {
|
|
4770
|
-
this.prodParam.enter(
|
|
4769
|
+
this.prodParam.enter(Ht(!0, this.prodParam.hasYield));
|
|
4771
4770
|
let t = [this.parseIdentifier()];
|
|
4772
4771
|
return this.prodParam.exit(), this.hasPrecedingLineBreak() && this.raise(g.LineTerminatorBeforeArrow, this.state.curPosition()), this.expect(15), this.parseArrowExpression(e, t, !0);
|
|
4773
4772
|
}
|
|
@@ -4846,8 +4845,8 @@ var Ht = class extends At {
|
|
|
4846
4845
|
}
|
|
4847
4846
|
parseParenAndDistinguishExpression(e) {
|
|
4848
4847
|
let t = this.state.startLoc, n;
|
|
4849
|
-
this.next(), this.expressionScope.enter(
|
|
4850
|
-
let r = this.state.startLoc, i = [], a = new
|
|
4848
|
+
this.next(), this.expressionScope.enter(Rt());
|
|
4849
|
+
let r = this.state.startLoc, i = [], a = new Wt(), o = !0, s, c;
|
|
4851
4850
|
for (; !this.match(7);) {
|
|
4852
4851
|
if (o) o = !1;
|
|
4853
4852
|
else if (this.expect(8, a.optionalParametersLoc === null ? null : a.optionalParametersLoc), this.match(7)) {
|
|
@@ -5018,7 +5017,7 @@ var Ht = class extends At {
|
|
|
5018
5017
|
e.id = null, e.generator = !1, e.async = t;
|
|
5019
5018
|
}
|
|
5020
5019
|
parseMethod(e, t, n, r, i, a, o = !1) {
|
|
5021
|
-
this.initFunction(e, n), e.generator = t, this.scope.enter(530 | (o ? 576 : 0) | (i ? 32 : 0)), this.prodParam.enter(
|
|
5020
|
+
this.initFunction(e, n), e.generator = t, this.scope.enter(530 | (o ? 576 : 0) | (i ? 32 : 0)), this.prodParam.enter(Ht(n, e.generator)), this.parseFunctionParams(e, r);
|
|
5022
5021
|
let s = this.parseFunctionBodyAndFinish(e, a, !0);
|
|
5023
5022
|
return this.prodParam.exit(), this.scope.exit(), s;
|
|
5024
5023
|
}
|
|
@@ -5028,7 +5027,7 @@ var Ht = class extends At {
|
|
|
5028
5027
|
}
|
|
5029
5028
|
parseArrowExpression(e, t, n, r) {
|
|
5030
5029
|
this.scope.enter(518);
|
|
5031
|
-
let i =
|
|
5030
|
+
let i = Ht(n, !1);
|
|
5032
5031
|
return this.match(2) || (i |= this.prodParam.currentFlags() & 24), this.prodParam.enter(i), this.initFunction(e, n), t && this.setArrowFunctionParameters(e, t, r), this.parseFunctionBody(e, !0), this.prodParam.exit(), this.scope.exit(), this.finishNode(e, "ArrowFunctionExpression");
|
|
5033
5032
|
}
|
|
5034
5033
|
setArrowFunctionParameters(e, t, n) {
|
|
@@ -5039,7 +5038,7 @@ var Ht = class extends At {
|
|
|
5039
5038
|
}
|
|
5040
5039
|
parseFunctionBody(e, t, n = !1) {
|
|
5041
5040
|
let r = t && !this.match(2);
|
|
5042
|
-
if (this.expressionScope.enter(
|
|
5041
|
+
if (this.expressionScope.enter(Bt()), r) e.body = this.parseMaybeAssign(), this.checkParams(e, !1, t, !1);
|
|
5043
5042
|
else {
|
|
5044
5043
|
let r = this.state.strict, i = this.state.labels;
|
|
5045
5044
|
this.state.labels = [], this.prodParam.enter(this.prodParam.currentFlags() | 4), e.body = this.parseBlock(!0, !1, (i) => {
|
|
@@ -5104,12 +5103,12 @@ var Ht = class extends At {
|
|
|
5104
5103
|
return e ? i && this.replaceToken(128) : this.checkReservedWord(t, this.sourceToOffsetPos(n), i, !1), this.next(), t;
|
|
5105
5104
|
}
|
|
5106
5105
|
checkReservedWord(e, t, n, r) {
|
|
5107
|
-
if (!(e.length > 10) &&
|
|
5108
|
-
if (n &&
|
|
5106
|
+
if (!(e.length > 10) && qe(e)) {
|
|
5107
|
+
if (n && We(e)) {
|
|
5109
5108
|
this.raise(g.UnexpectedKeyword, t, { keyword: e });
|
|
5110
5109
|
return;
|
|
5111
5110
|
}
|
|
5112
|
-
if ((this.state.strict ? r ?
|
|
5111
|
+
if ((this.state.strict ? r ? Ue : Ve : Be)(e, this.inModule)) {
|
|
5113
5112
|
this.raise(g.UnexpectedReservedWord, t, { reservedWord: e });
|
|
5114
5113
|
return;
|
|
5115
5114
|
}
|
|
@@ -5257,17 +5256,17 @@ var Ht = class extends At {
|
|
|
5257
5256
|
return this.parseMaybeAssignAllowIn(t, n);
|
|
5258
5257
|
}
|
|
5259
5258
|
parsePropertyNamePrefixOperator(e) {}
|
|
5260
|
-
},
|
|
5261
|
-
function
|
|
5259
|
+
}, Xt = { kind: 1 }, Zt = { kind: 2 }, Qt = /[\uD800-\uDFFF]/u, $t = /in(?:stanceof)?/y;
|
|
5260
|
+
function en(e) {
|
|
5262
5261
|
for (let t = 0; t < e.length; t++) {
|
|
5263
5262
|
let n = e[t], { type: r } = n;
|
|
5264
5263
|
typeof r == "number" && (n.type = ke(r));
|
|
5265
5264
|
}
|
|
5266
5265
|
return e;
|
|
5267
5266
|
}
|
|
5268
|
-
var
|
|
5267
|
+
var tn = class extends Yt {
|
|
5269
5268
|
parseTopLevel(e, t) {
|
|
5270
|
-
return e.program = this.parseProgram(t, 135, this.options.sourceType === "module" ? "module" : "script"), e.comments = this.comments, this.optionFlags & 512 && (e.tokens =
|
|
5269
|
+
return e.program = this.parseProgram(t, 135, this.options.sourceType === "module" ? "module" : "script"), e.comments = this.comments, this.optionFlags & 512 && (e.tokens = en(this.tokens)), this.finishNode(e, "File");
|
|
5271
5270
|
}
|
|
5272
5271
|
parseProgram(e, t, r) {
|
|
5273
5272
|
if (e.sourceType = r, e.interpreter = this.parseInterpreterDirective(), this.parseBlockBody(e, !0, !0, t), this.inModule) {
|
|
@@ -5316,10 +5315,10 @@ var en = class extends Jt {
|
|
|
5316
5315
|
return !1;
|
|
5317
5316
|
}
|
|
5318
5317
|
chStartsBindingIdentifier(e, t) {
|
|
5319
|
-
if (
|
|
5320
|
-
if (
|
|
5321
|
-
let e = this.codePointAtPos(
|
|
5322
|
-
if (!
|
|
5318
|
+
if (M(e)) {
|
|
5319
|
+
if ($t.lastIndex = t, $t.test(this.input)) {
|
|
5320
|
+
let e = this.codePointAtPos($t.lastIndex);
|
|
5321
|
+
if (!N(e) && e !== 92) return !1;
|
|
5323
5322
|
}
|
|
5324
5323
|
return !0;
|
|
5325
5324
|
}
|
|
@@ -5475,10 +5474,10 @@ var en = class extends Jt {
|
|
|
5475
5474
|
return this.expect(7), e;
|
|
5476
5475
|
}
|
|
5477
5476
|
parseDoWhileStatement(e) {
|
|
5478
|
-
return this.next(), this.state.labels.push(
|
|
5477
|
+
return this.next(), this.state.labels.push(Xt), e.body = this.parseStatement(), this.state.labels.pop(), this.expect(88), e.test = this.parseHeaderExpression(), this.eat(9), this.finishNode(e, "DoWhileStatement");
|
|
5479
5478
|
}
|
|
5480
5479
|
parseForStatement(e) {
|
|
5481
|
-
this.next(), this.state.labels.push(
|
|
5480
|
+
this.next(), this.state.labels.push(Xt);
|
|
5482
5481
|
let t = null;
|
|
5483
5482
|
if (this.isContextual(92) && this.recordAwaitIfAllowed() && (t = this.state.startLoc, this.next()), this.scope.enter(0), this.expect(6), this.match(9)) return t !== null && this.unexpected(t), this.parseFor(e, null);
|
|
5484
5483
|
let n = this.isContextual(96);
|
|
@@ -5491,7 +5490,7 @@ var en = class extends Jt {
|
|
|
5491
5490
|
return s && i && this.raise(g.ForInUsing, o), (s || this.isContextual(98)) && o.declarations.length === 1 ? this.parseForIn(e, o, t) : (t !== null && this.unexpected(t), this.parseFor(e, o));
|
|
5492
5491
|
}
|
|
5493
5492
|
}
|
|
5494
|
-
let r = this.isContextual(91), i = new
|
|
5493
|
+
let r = this.isContextual(91), i = new Wt(), a = this.parseExpression(!0, i), o = this.isContextual(98);
|
|
5495
5494
|
if (o && (n && this.raise(g.ForOfLet, a), t === null && r && a.type === "Identifier" && this.raise(g.ForOfAsync, a)), o || this.match(54)) {
|
|
5496
5495
|
this.checkDestructuringPrivate(i), this.toAssignable(a, !0);
|
|
5497
5496
|
let n = o ? "ForOfStatement" : "ForInStatement";
|
|
@@ -5511,7 +5510,7 @@ var en = class extends Jt {
|
|
|
5511
5510
|
parseSwitchStatement(e) {
|
|
5512
5511
|
this.next(), e.discriminant = this.parseHeaderExpression();
|
|
5513
5512
|
let t = e.cases = [];
|
|
5514
|
-
this.expect(2), this.state.labels.push(
|
|
5513
|
+
this.expect(2), this.state.labels.push(Zt), this.scope.enter(256);
|
|
5515
5514
|
let n;
|
|
5516
5515
|
for (let e; !this.match(4);) if (this.match(57) || this.match(61)) {
|
|
5517
5516
|
let r = this.match(57);
|
|
@@ -5537,7 +5536,7 @@ var en = class extends Jt {
|
|
|
5537
5536
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
5538
5537
|
}
|
|
5539
5538
|
parseWhileStatement(e) {
|
|
5540
|
-
return this.next(), e.test = this.parseHeaderExpression(), this.state.labels.push(
|
|
5539
|
+
return this.next(), e.test = this.parseHeaderExpression(), this.state.labels.push(Xt), e.body = this.parseStatement(), this.state.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
5541
5540
|
}
|
|
5542
5541
|
parseWithStatement(e) {
|
|
5543
5542
|
return this.state.strict && this.raise(g.StrictWith, this.state.startLoc), this.next(), e.object = this.parseHeaderExpression(), e.body = this.parseStatement(), this.finishNode(e, "WithStatement");
|
|
@@ -5613,13 +5612,13 @@ var en = class extends Jt {
|
|
|
5613
5612
|
}
|
|
5614
5613
|
parseFunction(e, t = 0) {
|
|
5615
5614
|
let n = t & 2, r = !!(t & 1), i = r && !(t & 4), a = !!(t & 8);
|
|
5616
|
-
return this.initFunction(e, a), this.match(51) && (n && this.raise(g.GeneratorInSingleStatementContext, this.state.startLoc), this.next(), e.generator = !0), r && (e.id = this.parseFunctionId(i)), this.scope.enter(514), this.prodParam.enter(
|
|
5615
|
+
return this.initFunction(e, a), this.match(51) && (n && this.raise(g.GeneratorInSingleStatementContext, this.state.startLoc), this.next(), e.generator = !0), r && (e.id = this.parseFunctionId(i)), this.scope.enter(514), this.prodParam.enter(Ht(a, e.generator)), r || (e.id = this.parseFunctionId()), this.parseFunctionParams(e, !1), this.parseFunctionBodyAndFinish(e, r ? "FunctionDeclaration" : "FunctionExpression"), this.prodParam.exit(), this.scope.exit(), r && !n && this.registerFunctionStatementId(e), e;
|
|
5617
5616
|
}
|
|
5618
5617
|
parseFunctionId(e) {
|
|
5619
5618
|
return e || D(this.state.type) ? this.parseIdentifier() : null;
|
|
5620
5619
|
}
|
|
5621
5620
|
parseFunctionParams(e, t) {
|
|
5622
|
-
this.expect(6), this.expressionScope.enter(
|
|
5621
|
+
this.expect(6), this.expressionScope.enter(Lt()), e.params = this.parseBindingList(7, 41, 2 | (t ? 4 : 0)), this.expressionScope.exit();
|
|
5623
5622
|
}
|
|
5624
5623
|
registerFunctionStatementId(e) {
|
|
5625
5624
|
e.id && this.scope.declareName(e.id.name, !this.options.annexB || this.state.strict || e.generator || e.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, e.id.start);
|
|
@@ -5773,7 +5772,7 @@ var en = class extends Jt {
|
|
|
5773
5772
|
return this.parseInitializer(e), this.semicolon(), this.finishNode(e, "ClassAccessorProperty");
|
|
5774
5773
|
}
|
|
5775
5774
|
parseInitializer(e) {
|
|
5776
|
-
this.scope.enter(592), this.expressionScope.enter(
|
|
5775
|
+
this.scope.enter(592), this.expressionScope.enter(Bt()), this.prodParam.enter(0), e.value = this.eat(25) ? this.parseMaybeAssignAllowIn() : null, this.expressionScope.exit(), this.prodParam.exit(), this.scope.exit();
|
|
5777
5776
|
}
|
|
5778
5777
|
parseClassId(e, t, n, r = 8331) {
|
|
5779
5778
|
if (D(this.state.type)) e.id = this.parseIdentifier(), t && this.declareNameFromIdentifier(e.id, r);
|
|
@@ -5934,7 +5933,7 @@ var en = class extends Jt {
|
|
|
5934
5933
|
}
|
|
5935
5934
|
parseModuleExportName() {
|
|
5936
5935
|
if (this.match(130)) {
|
|
5937
|
-
let e = this.parseStringLiteral(this.state.value), t =
|
|
5936
|
+
let e = this.parseStringLiteral(this.state.value), t = Qt.exec(e.value);
|
|
5938
5937
|
return t && this.raise(g.ModuleExportNameHasLoneSurrogate, e, { surrogateCharCode: t[0].charCodeAt(0) }), e;
|
|
5939
5938
|
}
|
|
5940
5939
|
return this.parseIdentifier(!0);
|
|
@@ -6037,15 +6036,15 @@ var en = class extends Jt {
|
|
|
6037
6036
|
isThisParam(e) {
|
|
6038
6037
|
return e.type === "Identifier" && e.name === "this";
|
|
6039
6038
|
}
|
|
6040
|
-
},
|
|
6041
|
-
function
|
|
6039
|
+
}, nn = /in(?:stanceof)?|as|satisfies/y;
|
|
6040
|
+
function rn(e) {
|
|
6042
6041
|
if (e == null) throw Error(`Unexpected ${e} value.`);
|
|
6043
6042
|
return e;
|
|
6044
6043
|
}
|
|
6045
|
-
function
|
|
6044
|
+
function an(e) {
|
|
6046
6045
|
if (!e) throw Error("Assert fail");
|
|
6047
6046
|
}
|
|
6048
|
-
var
|
|
6047
|
+
var U = h`typescript`({
|
|
6049
6048
|
AbstractMethodHasImplementation: ({ methodName: e }) => `Method '${e}' cannot have an implementation because it is marked abstract.`,
|
|
6050
6049
|
AbstractPropertyHasInitializer: ({ propertyName: e }) => `Property '${e}' cannot have an initializer because it is marked abstract.`,
|
|
6051
6050
|
AccessorCannotBeOptional: "An 'accessor' property cannot be declared optional.",
|
|
@@ -6123,7 +6122,7 @@ var W = h`typescript`({
|
|
|
6123
6122
|
UnsupportedSignatureParameterKind: ({ type: e }) => `Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got ${e}.`,
|
|
6124
6123
|
UsingDeclarationInAmbientContext: (e) => `'${e}' declarations are not allowed in ambient contexts.`
|
|
6125
6124
|
});
|
|
6126
|
-
function
|
|
6125
|
+
function on(e) {
|
|
6127
6126
|
switch (e) {
|
|
6128
6127
|
case "any": return "TSAnyKeyword";
|
|
6129
6128
|
case "boolean": return "TSBooleanKeyword";
|
|
@@ -6138,24 +6137,24 @@ function an(e) {
|
|
|
6138
6137
|
default: return;
|
|
6139
6138
|
}
|
|
6140
6139
|
}
|
|
6141
|
-
function
|
|
6140
|
+
function sn(e) {
|
|
6142
6141
|
return e === "private" || e === "public" || e === "protected";
|
|
6143
6142
|
}
|
|
6144
|
-
function
|
|
6143
|
+
function cn(e) {
|
|
6145
6144
|
return e === "in" || e === "out";
|
|
6146
6145
|
}
|
|
6147
|
-
function
|
|
6146
|
+
function ln(e) {
|
|
6148
6147
|
if (e.extra?.parenthesized) return !1;
|
|
6149
6148
|
switch (e.type) {
|
|
6150
6149
|
case "Identifier": return !0;
|
|
6151
|
-
case "MemberExpression": return !e.computed &&
|
|
6152
|
-
case "TSInstantiationExpression": return
|
|
6150
|
+
case "MemberExpression": return !e.computed && ln(e.object);
|
|
6151
|
+
case "TSInstantiationExpression": return ln(e.expression);
|
|
6153
6152
|
default: return !1;
|
|
6154
6153
|
}
|
|
6155
6154
|
}
|
|
6156
|
-
var
|
|
6155
|
+
var un = (e) => class extends e {
|
|
6157
6156
|
getScopeHandler() {
|
|
6158
|
-
return
|
|
6157
|
+
return pt;
|
|
6159
6158
|
}
|
|
6160
6159
|
tsIsIdentifier() {
|
|
6161
6160
|
return D(this.state.type);
|
|
@@ -6177,16 +6176,16 @@ var ln = (e) => class extends e {
|
|
|
6177
6176
|
if (this.tsTryParse(this.tsNextTokenCanFollowModifier.bind(this))) return r;
|
|
6178
6177
|
}
|
|
6179
6178
|
}
|
|
6180
|
-
tsParseModifiers({ allowedModifiers: e, disallowedModifiers: t, stopOnStartOfClassStaticBlock: n, errorTemplate: r =
|
|
6179
|
+
tsParseModifiers({ allowedModifiers: e, disallowedModifiers: t, stopOnStartOfClassStaticBlock: n, errorTemplate: r = U.InvalidModifierOnTypeMember }, i) {
|
|
6181
6180
|
let a = (e, t, n, r) => {
|
|
6182
|
-
t === n && i[r] && this.raise(
|
|
6181
|
+
t === n && i[r] && this.raise(U.InvalidModifiersOrder, e, { orderedModifiers: [n, r] });
|
|
6183
6182
|
}, o = (e, t, n, r) => {
|
|
6184
|
-
(i[n] && t === r || i[r] && t === n) && this.raise(
|
|
6183
|
+
(i[n] && t === r || i[r] && t === n) && this.raise(U.IncompatibleModifiers, e, { modifiers: [n, r] });
|
|
6185
6184
|
};
|
|
6186
6185
|
for (;;) {
|
|
6187
6186
|
let { startLoc: s } = this.state, c = this.tsParseModifier(e.concat(t ?? []), n, i.static);
|
|
6188
6187
|
if (!c) break;
|
|
6189
|
-
|
|
6188
|
+
sn(c) ? i.accessibility ? this.raise(U.DuplicateAccessibilityModifier, s, { modifier: c }) : (a(s, c, c, "override"), a(s, c, c, "static"), a(s, c, c, "readonly"), i.accessibility = c) : cn(c) ? (i[c] && this.raise(U.DuplicateModifier, s, { modifier: c }), i[c] = !0, a(s, c, "in", "out")) : (Object.hasOwn(i, c) ? this.raise(U.DuplicateModifier, s, { modifier: c }) : (a(s, c, "static", "readonly"), a(s, c, "static", "override"), a(s, c, "override", "readonly"), a(s, c, "abstract", "override"), o(s, c, "declare", "override"), o(s, c, "static", "abstract")), i[c] = !0), t?.includes(c) && this.raise(r, s, { modifier: c });
|
|
6190
6189
|
}
|
|
6191
6190
|
}
|
|
6192
6191
|
tsIsListTerminator(e) {
|
|
@@ -6204,7 +6203,7 @@ var ln = (e) => class extends e {
|
|
|
6204
6203
|
return n;
|
|
6205
6204
|
}
|
|
6206
6205
|
tsParseDelimitedList(e, t, n) {
|
|
6207
|
-
return
|
|
6206
|
+
return rn(this.tsParseDelimitedListWorker(e, t, !0, n));
|
|
6208
6207
|
}
|
|
6209
6208
|
tsParseDelimitedListWorker(e, t, n, r) {
|
|
6210
6209
|
let i = [], a = -1;
|
|
@@ -6229,7 +6228,7 @@ var ln = (e) => class extends e {
|
|
|
6229
6228
|
}
|
|
6230
6229
|
tsParseImportType() {
|
|
6231
6230
|
let e = this.startNode();
|
|
6232
|
-
return this.expect(79), this.expect(6), this.match(130) ? e.source = this.parseStringLiteral(this.state.value) : (this.raise(
|
|
6231
|
+
return this.expect(79), this.expect(6), this.match(130) ? e.source = this.parseStringLiteral(this.state.value) : (this.raise(U.UnsupportedImportTypeArgument, this.state.startLoc), e.source = this.tsParseNonConditionalType()), e.options = this.eat(8) ? this.tsParseImportTypeOptions() : null, this.expect(7), this.eat(12) && (e.qualifier = this.tsParseEntityName(3)), this.match(43) && (e.typeArguments = this.tsParseTypeArguments()), this.finishNode(e, "TSImportType");
|
|
6233
6232
|
}
|
|
6234
6233
|
tsParseImportTypeOptions() {
|
|
6235
6234
|
let e = this.startNode();
|
|
@@ -6289,12 +6288,12 @@ var ln = (e) => class extends e {
|
|
|
6289
6288
|
"abstract",
|
|
6290
6289
|
"override"
|
|
6291
6290
|
],
|
|
6292
|
-
errorTemplate:
|
|
6291
|
+
errorTemplate: U.InvalidModifierOnTypeParameter
|
|
6293
6292
|
});
|
|
6294
6293
|
tsParseConstModifier = this.tsParseModifiers.bind(this, {
|
|
6295
6294
|
allowedModifiers: ["const"],
|
|
6296
6295
|
disallowedModifiers: ["in", "out"],
|
|
6297
|
-
errorTemplate:
|
|
6296
|
+
errorTemplate: U.InvalidModifierOnTypeParameterPositions
|
|
6298
6297
|
});
|
|
6299
6298
|
tsParseInOutConstModifiers = this.tsParseModifiers.bind(this, {
|
|
6300
6299
|
allowedModifiers: [
|
|
@@ -6311,7 +6310,7 @@ var ln = (e) => class extends e {
|
|
|
6311
6310
|
"abstract",
|
|
6312
6311
|
"override"
|
|
6313
6312
|
],
|
|
6314
|
-
errorTemplate:
|
|
6313
|
+
errorTemplate: U.InvalidModifierOnTypeParameter
|
|
6315
6314
|
});
|
|
6316
6315
|
tsParseTypeParameter(e) {
|
|
6317
6316
|
let t = this.startNode();
|
|
@@ -6324,7 +6323,7 @@ var ln = (e) => class extends e {
|
|
|
6324
6323
|
let t = this.startNode();
|
|
6325
6324
|
this.match(43) || this.match(138) ? this.next() : this.unexpected();
|
|
6326
6325
|
let n = { value: -1 };
|
|
6327
|
-
return t.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, e), !1, !0, n), t.params.length === 0 && this.raise(
|
|
6326
|
+
return t.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, e), !1, !0, n), t.params.length === 0 && this.raise(U.EmptyTypeParameters, t), n.value !== -1 && this.addExtra(t, "trailingComma", n.value), this.finishNode(t, "TSTypeParameterDeclaration");
|
|
6328
6327
|
}
|
|
6329
6328
|
tsFillSignature(e, t) {
|
|
6330
6329
|
let n = e === 15;
|
|
@@ -6334,7 +6333,7 @@ var ln = (e) => class extends e {
|
|
|
6334
6333
|
let e = super.parseBindingList(7, 41, 2);
|
|
6335
6334
|
for (let t of e) {
|
|
6336
6335
|
let { type: e } = t;
|
|
6337
|
-
(e === "AssignmentPattern" || e === "TSParameterProperty") && this.raise(
|
|
6336
|
+
(e === "AssignmentPattern" || e === "TSParameterProperty") && this.raise(U.UnsupportedSignatureParameterKind, t, { type: e });
|
|
6338
6337
|
}
|
|
6339
6338
|
return e;
|
|
6340
6339
|
}
|
|
@@ -6357,16 +6356,16 @@ var ln = (e) => class extends e {
|
|
|
6357
6356
|
}
|
|
6358
6357
|
tsParsePropertyOrMethodSignature(e, t) {
|
|
6359
6358
|
if (this.eat(13) && (e.optional = !0), this.match(6) || this.match(43)) {
|
|
6360
|
-
t && this.raise(
|
|
6359
|
+
t && this.raise(U.ReadonlyForMethodSignature, e);
|
|
6361
6360
|
let n = e;
|
|
6362
|
-
if (n.kind && this.match(43) && this.raise(
|
|
6361
|
+
if (n.kind && this.match(43) && this.raise(U.AccessorCannotHaveTypeParameters, this.state.curPosition()), this.tsFillSignature(10, n), this.tsParseTypeMemberSemicolon(), n.kind === "get") n.params.length > 0 && (this.raise(g.BadGetterArity, this.state.curPosition()), this.isThisParam(n.params[0]) && this.raise(U.AccessorCannotDeclareThisParameter, this.state.curPosition()));
|
|
6363
6362
|
else if (n.kind === "set") {
|
|
6364
6363
|
if (n.params.length !== 1) this.raise(g.BadSetterArity, this.state.curPosition());
|
|
6365
6364
|
else {
|
|
6366
6365
|
let e = n.params[0];
|
|
6367
|
-
this.isThisParam(e) && this.raise(
|
|
6366
|
+
this.isThisParam(e) && this.raise(U.AccessorCannotDeclareThisParameter, this.state.curPosition()), e.type === "Identifier" && e.optional && this.raise(U.SetAccessorCannotHaveOptionalParameter, this.state.curPosition()), e.type === "RestElement" && this.raise(U.SetAccessorCannotHaveRestParameter, this.state.curPosition());
|
|
6368
6367
|
}
|
|
6369
|
-
n.returnType && this.raise(
|
|
6368
|
+
n.returnType && this.raise(U.SetAccessorCannotHaveReturnType, n.returnType);
|
|
6370
6369
|
} else n.kind = "method";
|
|
6371
6370
|
return this.finishNode(n, "TSMethodSignature");
|
|
6372
6371
|
}
|
|
@@ -6419,7 +6418,7 @@ var ln = (e) => class extends e {
|
|
|
6419
6418
|
let t = !1;
|
|
6420
6419
|
return e.elementTypes.forEach((e) => {
|
|
6421
6420
|
let { type: n } = e;
|
|
6422
|
-
t && n !== "TSRestType" && n !== "TSOptionalType" && !(n === "TSNamedTupleMember" && e.optional) && this.raise(
|
|
6421
|
+
t && n !== "TSRestType" && n !== "TSOptionalType" && !(n === "TSNamedTupleMember" && e.optional) && this.raise(U.OptionalTypeBeforeRequired, e), t ||= n === "TSNamedTupleMember" && e.optional || n === "TSOptionalType";
|
|
6423
6422
|
}), this.finishNode(e, "TSTupleType");
|
|
6424
6423
|
}
|
|
6425
6424
|
tsParseTupleElementType() {
|
|
@@ -6432,7 +6431,7 @@ var ln = (e) => class extends e {
|
|
|
6432
6431
|
} else o = this.tsParseType(), a = this.eat(13), r = this.eat(10);
|
|
6433
6432
|
if (r) {
|
|
6434
6433
|
let e;
|
|
6435
|
-
i ? (e = this.startNodeAt(n), e.optional = a, e.label = i, e.elementType = o, this.eat(13) && (e.optional = !0, this.raise(
|
|
6434
|
+
i ? (e = this.startNodeAt(n), e.optional = a, e.label = i, e.elementType = o, this.eat(13) && (e.optional = !0, this.raise(U.TupleOptionalAfterType, this.state.lastTokStartLoc))) : (e = this.startNodeAt(n), e.optional = a, this.raise(U.InvalidTupleMemberLabel, o), e.label = o, e.elementType = this.tsParseType()), o = this.finishNode(e, "TSNamedTupleMember");
|
|
6436
6435
|
} else if (a) {
|
|
6437
6436
|
let e = this.startNodeAt(n);
|
|
6438
6437
|
e.typeAnnotation = o, o = this.finishNode(e, "TSOptionalType");
|
|
@@ -6516,7 +6515,7 @@ var ln = (e) => class extends e {
|
|
|
6516
6515
|
default: {
|
|
6517
6516
|
let { type: e } = this.state;
|
|
6518
6517
|
if (D(e) || e === 84 || e === 80) {
|
|
6519
|
-
let t = e === 84 ? "TSVoidKeyword" : e === 80 ? "TSNullKeyword" :
|
|
6518
|
+
let t = e === 84 ? "TSVoidKeyword" : e === 80 ? "TSNullKeyword" : on(this.state.value);
|
|
6520
6519
|
if (t !== void 0 && this.lookaheadCharCode() !== 46) {
|
|
6521
6520
|
let e = this.startNode();
|
|
6522
6521
|
return this.next(), this.finishNode(e, t);
|
|
@@ -6546,7 +6545,7 @@ var ln = (e) => class extends e {
|
|
|
6546
6545
|
switch (e.typeAnnotation.type) {
|
|
6547
6546
|
case "TSTupleType":
|
|
6548
6547
|
case "TSArrayType": return;
|
|
6549
|
-
default: this.raise(
|
|
6548
|
+
default: this.raise(U.UnexpectedReadonly, e);
|
|
6550
6549
|
}
|
|
6551
6550
|
}
|
|
6552
6551
|
tsParseInferType() {
|
|
@@ -6643,7 +6642,7 @@ var ln = (e) => class extends e {
|
|
|
6643
6642
|
}), this.finishNode(t, "TSTypeAnnotation");
|
|
6644
6643
|
}
|
|
6645
6644
|
tsParseType() {
|
|
6646
|
-
|
|
6645
|
+
an(this.state.inType);
|
|
6647
6646
|
let e = this.tsParseNonConditionalType();
|
|
6648
6647
|
if (this.state.inDisallowConditionalTypesContext || this.hasPrecedingLineBreak() || !this.eat(77)) return e;
|
|
6649
6648
|
let t = this.startNodeAtNode(e);
|
|
@@ -6656,24 +6655,24 @@ var ln = (e) => class extends e {
|
|
|
6656
6655
|
return this.tsIsStartOfFunctionType() ? this.tsParseFunctionOrConstructorType("TSFunctionType") : this.match(73) ? this.tsParseFunctionOrConstructorType("TSConstructorType") : this.isAbstractConstructorSignature() ? this.tsParseFunctionOrConstructorType("TSConstructorType", !0) : this.tsParseUnionTypeOrHigher();
|
|
6657
6656
|
}
|
|
6658
6657
|
tsParseTypeAssertion() {
|
|
6659
|
-
this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(
|
|
6658
|
+
this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(U.ReservedTypeAssertion, this.state.startLoc);
|
|
6660
6659
|
let e = this.startNode();
|
|
6661
6660
|
return e.typeAnnotation = this.tsInType(() => (this.next(), this.match(71) ? this.tsParseTypeReference() : this.tsParseType())), this.expect(44), e.expression = this.parseMaybeUnary(), this.finishNode(e, "TSTypeAssertion");
|
|
6662
6661
|
}
|
|
6663
6662
|
tsParseHeritageClause(e) {
|
|
6664
6663
|
let t = this.state.startLoc, n = this.tsParseDelimitedList("HeritageClauseElement", () => {
|
|
6665
6664
|
let t = (this.state.canStartArrow = !1, super.parseExprSubscripts());
|
|
6666
|
-
|
|
6665
|
+
ln(t) || this.raise(U.InvalidHeritageClauseType, t.start, { token: e });
|
|
6667
6666
|
let n = e === "extends" ? "TSInterfaceHeritage" : "TSClassImplements";
|
|
6668
6667
|
if (t.type === "TSInstantiationExpression") return t.type = n, t;
|
|
6669
6668
|
let r = this.startNodeAtNode(t);
|
|
6670
6669
|
return r.expression = t, (this.match(43) || this.match(47)) && (r.typeArguments = this.tsParseTypeArgumentsInExpression()), this.finishNode(r, n);
|
|
6671
6670
|
});
|
|
6672
|
-
return n.length || this.raise(
|
|
6671
|
+
return n.length || this.raise(U.EmptyHeritageClauseType, t, { token: e }), n;
|
|
6673
6672
|
}
|
|
6674
6673
|
tsParseInterfaceDeclaration(e, t = {}) {
|
|
6675
6674
|
if (this.hasFollowingLineBreak()) return null;
|
|
6676
|
-
this.expectContextual(125), t.declare && (e.declare = !0), D(this.state.type) ? (e.id = this.parseIdentifier(), this.checkIdentifier(e.id, 130)) : (e.id = null, this.raise(
|
|
6675
|
+
this.expectContextual(125), t.declare && (e.declare = !0), D(this.state.type) ? (e.id = this.parseIdentifier(), this.checkIdentifier(e.id, 130)) : (e.id = null, this.raise(U.MissingInterfaceName, this.state.startLoc)), e.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutConstModifiers), this.eat(77) && (e.extends = this.tsParseHeritageClause("extends"));
|
|
6677
6676
|
let n = this.startNode();
|
|
6678
6677
|
return n.body = this.tsInType(this.tsParseObjectTypeMembers.bind(this)), e.body = this.finishNode(n, "TSInterfaceBody"), this.finishNode(e, "TSInterfaceDeclaration");
|
|
6679
6678
|
}
|
|
@@ -6687,7 +6686,7 @@ var ln = (e) => class extends e {
|
|
|
6687
6686
|
}), this.semicolon(), this.finishNode(e, "TSTypeAliasDeclaration");
|
|
6688
6687
|
}
|
|
6689
6688
|
tsInTopLevelContext(e) {
|
|
6690
|
-
if (this.curContext() !==
|
|
6689
|
+
if (this.curContext() !== j.brace) {
|
|
6691
6690
|
let t = this.state.context;
|
|
6692
6691
|
this.state.context = [t[0]];
|
|
6693
6692
|
try {
|
|
@@ -6695,8 +6694,7 @@ var ln = (e) => class extends e {
|
|
|
6695
6694
|
} finally {
|
|
6696
6695
|
this.state.context = t;
|
|
6697
6696
|
}
|
|
6698
|
-
}
|
|
6699
|
-
return e();
|
|
6697
|
+
} else return e();
|
|
6700
6698
|
}
|
|
6701
6699
|
tsInType(e) {
|
|
6702
6700
|
let t = this.state.inType;
|
|
@@ -6758,14 +6756,14 @@ var ln = (e) => class extends e {
|
|
|
6758
6756
|
else {
|
|
6759
6757
|
e.kind = "module";
|
|
6760
6758
|
let { type: t, value: n } = this.state;
|
|
6761
|
-
t === 130 ? e.id = super.parseStringLiteral(n) : D(t) ? (this.raise(
|
|
6759
|
+
t === 130 ? e.id = super.parseStringLiteral(n) : D(t) ? (this.raise(U.InlineModuleDeclarationMustUseString, this.state.startLoc), e.id = this.tsParseEntityName(0)) : t === 2 ? this.raise(U.EmptyNamespaceName, this.state.startLoc) : (this.raise(U.InvalidNamespaceName, this.state.startLoc, n), e.id = super.parseExprAtom());
|
|
6762
6760
|
}
|
|
6763
6761
|
return this.match(2) ? (t || this.scope.enter(1024), this.prodParam.enter(0), e.body = this.tsParseModuleBlock(t), this.prodParam.exit(), t || this.scope.exit()) : this.semicolon(), this.finishNode(e, "TSModuleDeclaration");
|
|
6764
6762
|
}
|
|
6765
6763
|
tsParseImportEqualsDeclaration(e, t) {
|
|
6766
6764
|
e.id = t || this.parseIdentifier(), this.checkIdentifier(e.id, 4096), this.expect(25);
|
|
6767
6765
|
let n = this.tsParseModuleReference();
|
|
6768
|
-
return e.importKind === "type" && n.type !== "TSExternalModuleReference" && this.raise(
|
|
6766
|
+
return e.importKind === "type" && n.type !== "TSExternalModuleReference" && this.raise(U.ImportAliasHasImportType, n), e.moduleReference = n, this.semicolon(), this.finishNode(e, "TSImportEqualsDeclaration");
|
|
6769
6767
|
}
|
|
6770
6768
|
tsIsExternalModuleReference() {
|
|
6771
6769
|
return this.isContextual(115) && this.lookaheadCharCode() === 40;
|
|
@@ -6806,10 +6804,10 @@ var ln = (e) => class extends e {
|
|
|
6806
6804
|
declare: !0
|
|
6807
6805
|
}));
|
|
6808
6806
|
case 103:
|
|
6809
|
-
if (this.isUsing()) return this.raise(
|
|
6807
|
+
if (this.isUsing()) return this.raise(U.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare"), e.declare = !0, this.parseVarStatement(e, "using", !0);
|
|
6810
6808
|
break;
|
|
6811
6809
|
case 92:
|
|
6812
|
-
if (this.isAwaitUsing()) return this.raise(
|
|
6810
|
+
if (this.isAwaitUsing()) return this.raise(U.InvalidModifierOnAwaitUsingDeclaration, this.state.startLoc, "declare"), e.declare = !0, this.next(), this.parseVarStatement(e, "await using", !0);
|
|
6813
6811
|
break;
|
|
6814
6812
|
case 125: {
|
|
6815
6813
|
let t = this.tsParseInterfaceDeclaration(e, { declare: !0 });
|
|
@@ -6852,7 +6850,7 @@ var ln = (e) => class extends e {
|
|
|
6852
6850
|
}
|
|
6853
6851
|
tsParseTypeArguments() {
|
|
6854
6852
|
let e = this.startNode();
|
|
6855
|
-
return e.params = this.tsInType(() => this.tsInTopLevelContext(() => (this.expect(43), this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this))))), e.params.length === 0 ? this.raise(
|
|
6853
|
+
return e.params = this.tsInType(() => this.tsInTopLevelContext(() => (this.expect(43), this.tsParseDelimitedList("TypeParametersOrArguments", this.tsParseType.bind(this))))), e.params.length === 0 ? this.raise(U.EmptyTypeArguments, e) : !this.state.inType && this.curContext() === j.brace && this.reScan_lt_gt(), this.expect(44), this.finishNode(e, "TSTypeParameterInstantiation");
|
|
6856
6854
|
}
|
|
6857
6855
|
tsIsDeclarationStart() {
|
|
6858
6856
|
return Te(this.state.type);
|
|
@@ -6870,13 +6868,13 @@ var ln = (e) => class extends e {
|
|
|
6870
6868
|
"readonly"
|
|
6871
6869
|
] }, r);
|
|
6872
6870
|
let i = r.accessibility, a = r.override, o = r.readonly;
|
|
6873
|
-
!(e & 4) && (i || o || a) && this.raise(
|
|
6871
|
+
!(e & 4) && (i || o || a) && this.raise(U.UnexpectedParameterModifier, n || t[0]);
|
|
6874
6872
|
let s = this.state.startLoc, c = this.parseMaybeDefault(s);
|
|
6875
6873
|
e & 2 && this.parseFunctionParamType(c);
|
|
6876
6874
|
let l = this.parseMaybeDefault(s, c);
|
|
6877
6875
|
if (i || o || a) {
|
|
6878
6876
|
let e = n ? this.startNodeAt(n) : this.startNodeAtNode(t[0]);
|
|
6879
|
-
return t.length ? e.decorators = t : this.setLoc(n), i && (e.accessibility = i), o && (e.readonly = o), a && (e.override = a), l.type !== "Identifier" && l.type !== "AssignmentPattern" && this.raise(
|
|
6877
|
+
return t.length ? e.decorators = t : this.setLoc(n), i && (e.accessibility = i), o && (e.readonly = o), a && (e.override = a), l.type !== "Identifier" && l.type !== "AssignmentPattern" && this.raise(U.UnsupportedParameterPropertyKind, n || t[0]), e.parameter = l, this.finishNode(e, "TSParameterProperty");
|
|
6880
6878
|
}
|
|
6881
6879
|
return t.length && (c.decorators = t), l;
|
|
6882
6880
|
}
|
|
@@ -6884,7 +6882,7 @@ var ln = (e) => class extends e {
|
|
|
6884
6882
|
return e.type === "TSParameterProperty" && super.isSimpleParameter(e.parameter) || super.isSimpleParameter(e);
|
|
6885
6883
|
}
|
|
6886
6884
|
tsDisallowOptionalPattern(e) {
|
|
6887
|
-
for (let t of e.params) t.type !== "Identifier" && t.optional && !this.state.isAmbientContext && this.raise(
|
|
6885
|
+
for (let t of e.params) t.type !== "Identifier" && t.optional && !this.state.isAmbientContext && this.raise(U.PatternIsOptional, t);
|
|
6888
6886
|
}
|
|
6889
6887
|
setArrowFunctionParameters(e, t, n) {
|
|
6890
6888
|
super.setArrowFunctionParameters(e, t, n), this.tsDisallowOptionalPattern(e);
|
|
@@ -6893,18 +6891,18 @@ var ln = (e) => class extends e {
|
|
|
6893
6891
|
this.match(10) && (e.returnType = this.tsParseTypeOrTypePredicateAnnotation(10));
|
|
6894
6892
|
let r = t === "FunctionDeclaration" ? "TSDeclareFunction" : t === "ClassMethod" || t === "ClassPrivateMethod" ? "TSDeclareMethod" : void 0;
|
|
6895
6893
|
if (r && !this.match(2) && this.isLineTerminator()) {
|
|
6896
|
-
if (r === "TSDeclareMethod" && e.kind === "constructor") for (let t of e.params) t.type === "TSParameterProperty" ? this.raise(
|
|
6897
|
-
else for (let t of e.params) t.type === "AssignmentPattern" && this.raise(
|
|
6894
|
+
if (r === "TSDeclareMethod" && e.kind === "constructor") for (let t of e.params) t.type === "TSParameterProperty" ? this.raise(U.UnexpectedParameterModifier, t) : t.type === "AssignmentPattern" && this.raise(U.UnexpectedParameterInitializer, t);
|
|
6895
|
+
else for (let t of e.params) t.type === "AssignmentPattern" && this.raise(U.UnexpectedParameterInitializer, t);
|
|
6898
6896
|
return this.finishNode(e, r);
|
|
6899
6897
|
}
|
|
6900
|
-
return r && this.state.isAmbientContext && (this.raise(
|
|
6898
|
+
return r && this.state.isAmbientContext && (this.raise(U.DeclareFunctionHasImplementation, this.state.startLoc), r === "TSDeclareFunction" && e.declare) ? super.parseFunctionBodyAndFinish(e, r, n) : (this.tsDisallowOptionalPattern(e), super.parseFunctionBodyAndFinish(e, t, n));
|
|
6901
6899
|
}
|
|
6902
6900
|
registerFunctionStatementId(e) {
|
|
6903
6901
|
!e.body && e.id ? this.checkIdentifier(e.id, 1024) : super.registerFunctionStatementId(e);
|
|
6904
6902
|
}
|
|
6905
6903
|
tsCheckForInvalidTypeCasts(e) {
|
|
6906
6904
|
e.forEach((e) => {
|
|
6907
|
-
e?.type === "TSTypeCastExpression" && this.raise(
|
|
6905
|
+
e?.type === "TSTypeCastExpression" && this.raise(U.UnexpectedTypeAnnotation, e.typeAnnotation);
|
|
6908
6906
|
});
|
|
6909
6907
|
}
|
|
6910
6908
|
toReferencedList(e, t) {
|
|
@@ -6950,7 +6948,7 @@ var ln = (e) => class extends e {
|
|
|
6950
6948
|
let c = this.startNodeAt(t);
|
|
6951
6949
|
return c.expression = e, c.typeArguments = o, this.finishNode(c, "TSInstantiationExpression");
|
|
6952
6950
|
});
|
|
6953
|
-
if (a && this.unexpected(a, 6), o) return o.type === "TSInstantiationExpression" && ((this.match(12) || this.match(14) && this.lookaheadCharCode() !== 40) && this.raise(
|
|
6951
|
+
if (a && this.unexpected(a, 6), o) return o.type === "TSInstantiationExpression" && ((this.match(12) || this.match(14) && this.lookaheadCharCode() !== 40) && this.raise(U.InvalidPropertyAccessAfterInstantiationExpression, this.state.startLoc), !this.match(12) && !this.match(14) && (o.expression = super.stopParseSubscript(e, r))), o;
|
|
6954
6952
|
}
|
|
6955
6953
|
return super.parseSubscript(e, t, n, r);
|
|
6956
6954
|
}
|
|
@@ -6985,19 +6983,19 @@ var ln = (e) => class extends e {
|
|
|
6985
6983
|
super.applyImportPhase(e, t, n, r), t ? e.exportKind = n === "type" ? "type" : "value" : e.importKind = n === "type" || n === "typeof" ? n : "value";
|
|
6986
6984
|
}
|
|
6987
6985
|
parseImport(e) {
|
|
6988
|
-
if (this.match(130)) return e.importKind = "value", this.scope.inTSNamespace && this.raise(
|
|
6986
|
+
if (this.match(130)) return e.importKind = "value", this.scope.inTSNamespace && this.raise(U.ImportInTSNamespace, e), super.parseImport(e);
|
|
6989
6987
|
let t;
|
|
6990
6988
|
if (D(this.state.type) && this.lookaheadCharCode() === 61) {
|
|
6991
6989
|
e.importKind = "value";
|
|
6992
6990
|
let t = this.tsParseImportEqualsDeclaration(e);
|
|
6993
|
-
return this.scope.inTSNamespace && t.moduleReference.type === "TSExternalModuleReference" && this.raise(
|
|
6991
|
+
return this.scope.inTSNamespace && t.moduleReference.type === "TSExternalModuleReference" && this.raise(U.ImportInTSNamespace, e), t;
|
|
6994
6992
|
}
|
|
6995
6993
|
if (this.isContextual(126)) {
|
|
6996
6994
|
let n = this.parseMaybeImportPhase(e, !1);
|
|
6997
|
-
if (this.lookaheadCharCode() === 61) return this.scope.inTSNamespace && this.raise(
|
|
6995
|
+
if (this.lookaheadCharCode() === 61) return this.scope.inTSNamespace && this.raise(U.ImportInTSNamespace, e), this.tsParseImportEqualsDeclaration(e, n);
|
|
6998
6996
|
t = super.parseImportSpecifiersAndAfter(e, n);
|
|
6999
6997
|
} else t = super.parseImport(e);
|
|
7000
|
-
return t.importKind === "type" && t.specifiers.length > 1 && t.specifiers[0].type === "ImportDefaultSpecifier" ? this.raise(
|
|
6998
|
+
return t.importKind === "type" && t.specifiers.length > 1 && t.specifiers[0].type === "ImportDefaultSpecifier" ? this.raise(U.TypeImportCannotSpecifyDefaultAndNamed, t) : this.scope.inTSNamespace && this.raise(U.ImportInTSNamespace, t), t;
|
|
7001
6999
|
}
|
|
7002
7000
|
parseExport(e, t) {
|
|
7003
7001
|
if (this.match(79)) {
|
|
@@ -7010,15 +7008,15 @@ var ln = (e) => class extends e {
|
|
|
7010
7008
|
}
|
|
7011
7009
|
if (this.eat(25)) {
|
|
7012
7010
|
let t = e;
|
|
7013
|
-
return t.expression = super.parseExpression(), this.semicolon(), this.sawUnambiguousESM = !0, this.scope.inTSNamespace && this.raise(
|
|
7011
|
+
return t.expression = super.parseExpression(), this.semicolon(), this.sawUnambiguousESM = !0, this.scope.inTSNamespace && this.raise(U.ExportAssignmentInTSNamespace, t), this.finishNode(t, "TSExportAssignment");
|
|
7014
7012
|
}
|
|
7015
7013
|
if (this.eatContextual(89)) {
|
|
7016
7014
|
let t = e;
|
|
7017
|
-
return this.expectContextual(124), t.id = this.parseIdentifier(), this.checkIdentifier(t.id, 8201), this.semicolon(), this.scope.inTSNamespace && this.raise(
|
|
7015
|
+
return this.expectContextual(124), t.id = this.parseIdentifier(), this.checkIdentifier(t.id, 8201), this.semicolon(), this.scope.inTSNamespace && this.raise(U.NamespaceExportInTSNamespace, t), this.finishNode(t, "TSNamespaceExportDeclaration");
|
|
7018
7016
|
}
|
|
7019
7017
|
{
|
|
7020
7018
|
let n = super.parseExport(e, t);
|
|
7021
|
-
return this.scope.inTSNamespace && (n.type !== "ExportNamedDeclaration" || n.source || !n.declaration && !this.state.isAmbientContext) && this.raise(
|
|
7019
|
+
return this.scope.inTSNamespace && (n.type !== "ExportNamedDeclaration" || n.source || !n.declaration && !this.state.isAmbientContext) && this.raise(U.ExportInTSNamespace, n), n;
|
|
7022
7020
|
}
|
|
7023
7021
|
}
|
|
7024
7022
|
isAbstractClass() {
|
|
@@ -7037,10 +7035,10 @@ var ln = (e) => class extends e {
|
|
|
7037
7035
|
}
|
|
7038
7036
|
parseVarStatement(e, t, n = !1) {
|
|
7039
7037
|
let { isAmbientContext: r } = this.state, i = super.parseVarStatement(e, t, n || r);
|
|
7040
|
-
if (r && !e.declare && (t === "using" || t === "await using")) return this.raiseOverwrite(
|
|
7038
|
+
if (r && !e.declare && (t === "using" || t === "await using")) return this.raiseOverwrite(U.UsingDeclarationInAmbientContext, e, t), i;
|
|
7041
7039
|
for (let e of i.declarations) {
|
|
7042
7040
|
let { id: n, init: i, definite: a } = e;
|
|
7043
|
-
a && (i ? this.raise(
|
|
7041
|
+
a && (i ? this.raise(U.DeclaratorDefiniteAssertionWithInitializer, n) : n.typeAnnotation || this.raise(U.DeclaratorDefiniteAssertionRequiresTypeAnnotation, n)), r && i && (t === "var" || t === "let" || n.typeAnnotation ? this.raise(U.InitializerNotAllowedInAmbientContext, i) : fn(i, this.hasPlugin("estree")) || this.raise(U.ConstInitializerMustBeStringOrNumericLiteralOrLiteralEnumReference, i));
|
|
7044
7042
|
}
|
|
7045
7043
|
return i;
|
|
7046
7044
|
}
|
|
@@ -7071,7 +7069,7 @@ var ln = (e) => class extends e {
|
|
|
7071
7069
|
break;
|
|
7072
7070
|
case 125: {
|
|
7073
7071
|
let e = this.tsParseInterfaceDeclaration(this.startNode());
|
|
7074
|
-
if (e) return n || this.raise(
|
|
7072
|
+
if (e) return n || this.raise(U.UnexpectedTypeDeclaration, e, "interface"), e;
|
|
7075
7073
|
break;
|
|
7076
7074
|
}
|
|
7077
7075
|
case 123:
|
|
@@ -7080,7 +7078,7 @@ var ln = (e) => class extends e {
|
|
|
7080
7078
|
return this.next(), this.tsParseDeclaration(e, 123, !1, t);
|
|
7081
7079
|
}
|
|
7082
7080
|
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
7083
|
-
this.raise(
|
|
7081
|
+
this.raise(U.InlineModuleDeclarationMustUseString, this.state.startLoc);
|
|
7084
7082
|
let e = this.startNode();
|
|
7085
7083
|
return this.next(), this.tsParseDeclaration(e, 124, !1, t);
|
|
7086
7084
|
}
|
|
@@ -7093,7 +7091,7 @@ var ln = (e) => class extends e {
|
|
|
7093
7091
|
break;
|
|
7094
7092
|
case 126: if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
7095
7093
|
let e = this.startNode();
|
|
7096
|
-
return n || this.raise(
|
|
7094
|
+
return n || this.raise(U.UnexpectedTypeDeclaration, e, "type"), this.next(), this.tsParseTypeAliasDeclaration(e);
|
|
7097
7095
|
}
|
|
7098
7096
|
}
|
|
7099
7097
|
return super.parseStatementContent(e, t);
|
|
@@ -7106,7 +7104,7 @@ var ln = (e) => class extends e {
|
|
|
7106
7104
|
]);
|
|
7107
7105
|
}
|
|
7108
7106
|
tsHasSomeModifiers(e, t) {
|
|
7109
|
-
return t.some((t) =>
|
|
7107
|
+
return t.some((t) => sn(t) ? e.accessibility === t : !!e[t]);
|
|
7110
7108
|
}
|
|
7111
7109
|
tsIsStartOfStaticBlocks() {
|
|
7112
7110
|
return this.isContextual(102) && this.lookaheadCharCode() === 123;
|
|
@@ -7126,23 +7124,23 @@ var ln = (e) => class extends e {
|
|
|
7126
7124
|
allowedModifiers: r,
|
|
7127
7125
|
disallowedModifiers: ["in", "out"],
|
|
7128
7126
|
stopOnStartOfClassStaticBlock: !0,
|
|
7129
|
-
errorTemplate:
|
|
7127
|
+
errorTemplate: U.InvalidModifierOnTypeParameterPositions
|
|
7130
7128
|
}, t);
|
|
7131
7129
|
let i = () => {
|
|
7132
|
-
this.tsIsStartOfStaticBlocks() ? (this.next(), this.next(), this.tsHasSomeModifiers(t, r) && this.raise(
|
|
7130
|
+
this.tsIsStartOfStaticBlocks() ? (this.next(), this.next(), this.tsHasSomeModifiers(t, r) && this.raise(U.StaticBlockCannotHaveModifier, this.state.curPosition()), super.parseClassStaticBlock(e, t)) : this.parseClassMemberWithIsStatic(e, t, n, !!t.static);
|
|
7133
7131
|
};
|
|
7134
|
-
t.declare ? this.tsInAmbientContext(i) : i(), t.decorators && t.decorators.length > 0 && !this.hasPlugin("decorators-legacy") && (t.type === "TSAbstractMethodDefinition" || t.type === "TSDeclareMethod" ? this.raise(
|
|
7132
|
+
t.declare ? this.tsInAmbientContext(i) : i(), t.decorators && t.decorators.length > 0 && !this.hasPlugin("decorators-legacy") && (t.type === "TSAbstractMethodDefinition" || t.type === "TSDeclareMethod" ? this.raise(U.DecoratorAbstractMethod, t, { kind: "abstract method" }) : (t.type === "ClassProperty" && t.abstract || t.type === "ClassProperty" && t.declare || t.type === "TSAbstractPropertyDefinition" || t.type === "PropertyDefinition" && t.declare) && this.raise(U.DecoratorAbstractMethod, t, { kind: t.declare ? "declare field" : "abstract field" }));
|
|
7135
7133
|
}
|
|
7136
7134
|
parseClassMemberWithIsStatic(e, t, n, r) {
|
|
7137
7135
|
let i = this.tsTryParseIndexSignature(t);
|
|
7138
7136
|
if (i) {
|
|
7139
|
-
e.body.push(i), t.abstract && this.raise(
|
|
7137
|
+
e.body.push(i), t.abstract && this.raise(U.IndexSignatureHasAbstract, t), t.accessibility && this.raise(U.IndexSignatureHasAccessibility, t, { modifier: t.accessibility }), t.declare && this.raise(U.IndexSignatureHasDeclare, t), t.override && this.raise(U.IndexSignatureHasOverride, t);
|
|
7140
7138
|
return;
|
|
7141
7139
|
}
|
|
7142
|
-
!this.state.inAbstractClass && t.abstract && this.raise(
|
|
7140
|
+
!this.state.inAbstractClass && t.abstract && this.raise(U.NonAbstractClassHasAbstractMethod, t), t.override && (n.hadSuperClass || this.raise(U.OverrideNotInSubClass, t)), super.parseClassMemberWithIsStatic(e, t, n, r);
|
|
7143
7141
|
}
|
|
7144
7142
|
parsePostMemberNameModifiers(e) {
|
|
7145
|
-
this.eat(13) && (e.optional = !0), e.readonly && this.match(6) && this.raise(
|
|
7143
|
+
this.eat(13) && (e.optional = !0), e.readonly && this.match(6) && this.raise(U.ClassMethodHasReadonly, e), e.declare && this.match(6) && this.raise(U.ClassMethodHasDeclare, e);
|
|
7146
7144
|
}
|
|
7147
7145
|
shouldParseExportDeclaration() {
|
|
7148
7146
|
return this.tsIsDeclarationStart() ? !0 : super.shouldParseExportDeclaration();
|
|
@@ -7170,7 +7168,7 @@ var ln = (e) => class extends e {
|
|
|
7170
7168
|
parseExportDeclaration(e) {
|
|
7171
7169
|
if (!this.state.isAmbientContext && this.isContextual(121)) return this.tsInAmbientContext(() => this.parseExportDeclaration(e));
|
|
7172
7170
|
let t = this.state.startLoc, n = this.eatContextual(121);
|
|
7173
|
-
if (n && (this.isContextual(121) || !this.shouldParseExportDeclaration())) throw this.raise(
|
|
7171
|
+
if (n && (this.isContextual(121) || !this.shouldParseExportDeclaration())) throw this.raise(U.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
|
|
7174
7172
|
let r = D(this.state.type) && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(e);
|
|
7175
7173
|
return r ? ((r.type === "TSInterfaceDeclaration" || r.type === "TSTypeAliasDeclaration" || n) && (e.exportKind = "type"), n && r.type !== "TSImportEqualsDeclaration" && (this.resetStartLocation(r, t), r.declare = !0), r) : null;
|
|
7176
7174
|
}
|
|
@@ -7186,26 +7184,26 @@ var ln = (e) => class extends e {
|
|
|
7186
7184
|
parseClassPropertyAnnotation(e) {
|
|
7187
7185
|
e.optional || (this.eat(31) ? e.definite = !0 : this.eat(13) && (e.optional = !0));
|
|
7188
7186
|
let t = this.tsTryParseTypeAnnotation();
|
|
7189
|
-
t && (e.typeAnnotation = t), e.definite && (this.match(25) ? this.raise(
|
|
7187
|
+
t && (e.typeAnnotation = t), e.definite && (this.match(25) ? this.raise(U.DeclaratorDefiniteAssertionWithInitializer, e) : t || this.raise(U.DeclaratorDefiniteAssertionRequiresTypeAnnotation, e));
|
|
7190
7188
|
}
|
|
7191
7189
|
parseClassProperty(e) {
|
|
7192
|
-
if (this.parseClassPropertyAnnotation(e), this.state.isAmbientContext && !(e.readonly && !e.typeAnnotation) && this.match(25) && this.raise(
|
|
7190
|
+
if (this.parseClassPropertyAnnotation(e), this.state.isAmbientContext && !(e.readonly && !e.typeAnnotation) && this.match(25) && this.raise(U.DeclareClassFieldHasInitializer, this.state.startLoc), e.abstract && this.match(25)) {
|
|
7193
7191
|
let { key: t } = e;
|
|
7194
|
-
this.raise(
|
|
7192
|
+
this.raise(U.AbstractPropertyHasInitializer, this.state.startLoc, { propertyName: t.type === "Identifier" && !e.computed ? t.name : `[${this.input.slice(this.offsetToSourcePos(t.start), this.offsetToSourcePos(t.end))}]` });
|
|
7195
7193
|
}
|
|
7196
7194
|
return super.parseClassProperty(e);
|
|
7197
7195
|
}
|
|
7198
7196
|
parseClassPrivateProperty(e) {
|
|
7199
|
-
return e.abstract && this.raise(
|
|
7197
|
+
return e.abstract && this.raise(U.PrivateElementHasAbstract, e), e.accessibility && this.raise(U.PrivateElementHasAccessibility, e, { modifier: e.accessibility }), this.parseClassPropertyAnnotation(e), super.parseClassPrivateProperty(e);
|
|
7200
7198
|
}
|
|
7201
7199
|
parseClassAccessorProperty(e) {
|
|
7202
|
-
return this.parseClassPropertyAnnotation(e), e.optional && this.raise(
|
|
7200
|
+
return this.parseClassPropertyAnnotation(e), e.optional && this.raise(U.AccessorCannotBeOptional, e), super.parseClassAccessorProperty(e);
|
|
7203
7201
|
}
|
|
7204
7202
|
pushClassMethod(e, t, n, r, i, a) {
|
|
7205
7203
|
let o = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
7206
|
-
o && i && this.raise(
|
|
7204
|
+
o && i && this.raise(U.ConstructorHasTypeParameters, o);
|
|
7207
7205
|
let { declare: s = !1, kind: c } = t;
|
|
7208
|
-
s && (c === "get" || c === "set") && this.raise(
|
|
7206
|
+
s && (c === "get" || c === "set") && this.raise(U.DeclareAccessor, t, { kind: c }), o && (t.typeParameters = o), super.pushClassMethod(e, t, n, r, i, a);
|
|
7209
7207
|
}
|
|
7210
7208
|
pushClassPrivateMethod(e, t, n, r) {
|
|
7211
7209
|
let i = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
@@ -7246,7 +7244,7 @@ var ln = (e) => class extends e {
|
|
|
7246
7244
|
if (this.hasPlugin("jsx") && (this.match(138) || this.match(43))) {
|
|
7247
7245
|
if (r = this.state.clone(), i = this.tryParse(() => super.parseMaybeAssign(e, t), r), !i.error) return i.node;
|
|
7248
7246
|
let { context: n } = this.state, a = n[n.length - 1];
|
|
7249
|
-
(a ===
|
|
7247
|
+
(a === j.j_oTag || a === j.j_expr) && n.pop();
|
|
7250
7248
|
}
|
|
7251
7249
|
if (!i?.error && !this.match(43)) return super.parseMaybeAssign(e, t);
|
|
7252
7250
|
(!r || r === this.state) && (r = this.state.clone());
|
|
@@ -7255,19 +7253,19 @@ var ln = (e) => class extends e {
|
|
|
7255
7253
|
let i = super.parseMaybeAssign(e, t);
|
|
7256
7254
|
if ((i.type !== "ArrowFunctionExpression" || i.extra?.parenthesized) && r(), o?.params.length !== 0 && this.resetStartLocationFromNode(i, o), i.typeParameters = o, this.hasPlugin("jsx") && i.typeParameters.params.length === 1 && !i.typeParameters.extra?.trailingComma) {
|
|
7257
7255
|
let e = i.typeParameters.params[0];
|
|
7258
|
-
e.constraint || this.raise(
|
|
7256
|
+
e.constraint || this.raise(U.SingleTypeParameterWithoutTrailingComma, this.optionFlags & 256 ? n(e.loc.end, 1) : e, { typeParameterName: e.name.name });
|
|
7259
7257
|
}
|
|
7260
7258
|
return i;
|
|
7261
7259
|
}, r);
|
|
7262
7260
|
if (!s.error && !s.aborted) return o && this.reportReservedArrowTypeParam(o), s.node;
|
|
7263
|
-
if (!i && (
|
|
7261
|
+
if (!i && (an(!this.hasPlugin("jsx")), a = this.tryParse(() => super.parseMaybeAssign(e, t), r), !a.error)) return a.node;
|
|
7264
7262
|
if (i?.node) return this.state = i.failState, i.node;
|
|
7265
7263
|
if (s.node) return this.state = s.failState, o && this.reportReservedArrowTypeParam(o), s.node;
|
|
7266
7264
|
if (a?.node) return this.state = a.failState, a.node;
|
|
7267
7265
|
throw i?.error || s.error || a?.error;
|
|
7268
7266
|
}
|
|
7269
7267
|
reportReservedArrowTypeParam(e) {
|
|
7270
|
-
e.params.length === 1 && !e.params[0].constraint && !e.extra?.trailingComma && this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(
|
|
7268
|
+
e.params.length === 1 && !e.params[0].constraint && !e.extra?.trailingComma && this.getPluginOption("typescript", "disallowAmbiguousJSXLike") && this.raise(U.ReservedArrowTypeParam, e);
|
|
7271
7269
|
}
|
|
7272
7270
|
parseMaybeUnary(e, t) {
|
|
7273
7271
|
return !this.hasPlugin("jsx") && this.match(43) ? this.tsParseTypeAssertion() : super.parseMaybeUnary(e, t);
|
|
@@ -7304,7 +7302,7 @@ var ln = (e) => class extends e {
|
|
|
7304
7302
|
case "TSSatisfiesExpression":
|
|
7305
7303
|
case "TSNonNullExpression":
|
|
7306
7304
|
case "TSTypeAssertion":
|
|
7307
|
-
t ? this.expressionScope.recordArrowParameterBindingError(
|
|
7305
|
+
t ? this.expressionScope.recordArrowParameterBindingError(U.UnexpectedTypeCastInParameter, e) : this.raise(U.UnexpectedTypeCastInParameter, e), this.toAssignable(e.expression, t);
|
|
7308
7306
|
break;
|
|
7309
7307
|
case "AssignmentExpression": !t && e.left.type === "TSTypeCastExpression" && (e.left = this.typeCastToParameter(e.left));
|
|
7310
7308
|
default: super.toAssignable(e, t);
|
|
@@ -7369,7 +7367,7 @@ var ln = (e) => class extends e {
|
|
|
7369
7367
|
}
|
|
7370
7368
|
parseMaybeDefault(e, t) {
|
|
7371
7369
|
let n = super.parseMaybeDefault(e, t);
|
|
7372
|
-
return n.type === "AssignmentPattern" && n.typeAnnotation && n.right.start < n.typeAnnotation.start && this.raise(
|
|
7370
|
+
return n.type === "AssignmentPattern" && n.typeAnnotation && n.right.start < n.typeAnnotation.start && this.raise(U.TypeAnnotationAfterAssign, n.typeAnnotation), n;
|
|
7373
7371
|
}
|
|
7374
7372
|
getTokenFromCode(e) {
|
|
7375
7373
|
if (this.state.inType) {
|
|
@@ -7449,14 +7447,14 @@ var ln = (e) => class extends e {
|
|
|
7449
7447
|
}
|
|
7450
7448
|
tsParseAbstractDeclaration(e, t) {
|
|
7451
7449
|
if (this.match(76)) return e.abstract = !0, this.maybeTakeDecorators(t, this.parseClass(e, !0, !1));
|
|
7452
|
-
if (this.isContextual(125)) return this.hasFollowingLineBreak() ? null : (e.abstract = !0, this.raise(
|
|
7450
|
+
if (this.isContextual(125)) return this.hasFollowingLineBreak() ? null : (e.abstract = !0, this.raise(U.NonClassMethodPropertyHasAbstractModifier, e), this.tsParseInterfaceDeclaration(e));
|
|
7453
7451
|
throw this.unexpected(null, 76);
|
|
7454
7452
|
}
|
|
7455
7453
|
parseMethod(e, t, n, r, i, a, o) {
|
|
7456
7454
|
let s = super.parseMethod(e, t, n, r, i, a, o);
|
|
7457
7455
|
if ((s.abstract || s.type === "TSAbstractMethodDefinition") && (this.hasPlugin("estree") ? s.value : s).body) {
|
|
7458
7456
|
let { key: e } = s;
|
|
7459
|
-
this.raise(
|
|
7457
|
+
this.raise(U.AbstractMethodHasImplementation, s, { methodName: e.type === "Identifier" && !s.computed ? e.name : `[${this.input.slice(this.offsetToSourcePos(e.start), this.offsetToSourcePos(e.end))}]` });
|
|
7460
7458
|
}
|
|
7461
7459
|
return s;
|
|
7462
7460
|
}
|
|
@@ -7487,7 +7485,7 @@ var ln = (e) => class extends e {
|
|
|
7487
7485
|
O(this.state.type) ? (s = !0, a = e, o = t ? this.parseIdentifier() : this.parseModuleExportName(), c = !1) : (o = n, c = !1);
|
|
7488
7486
|
} else O(this.state.type) ? (c = !1, o = t ? this.parseIdentifier() : this.parseModuleExportName()) : (s = !0, a = e);
|
|
7489
7487
|
} else O(this.state.type) && (s = !0, t ? (a = this.parseIdentifier(!0), this.isContextual(89) || this.checkReservedWord(a.name, a.start, !0, !0)) : a = this.parseModuleExportName());
|
|
7490
|
-
s && n && this.raise(t ?
|
|
7488
|
+
s && n && this.raise(t ? U.TypeModifierIsUsedInTypeImports : U.TypeModifierIsUsedInTypeExports, l), e[r] = a, e[i] = o;
|
|
7491
7489
|
let u = t ? "importKind" : "exportKind";
|
|
7492
7490
|
e[u] = s ? "type" : "value", c && this.eatContextual(89) && (e[i] = t ? this.parseIdentifier() : this.parseModuleExportName()), e[i] || (e[i] = this.cloneIdentifier(e[r])), t && this.checkIdentifier(e[i], s ? 4098 : 4096);
|
|
7493
7491
|
}
|
|
@@ -7565,10 +7563,10 @@ var ln = (e) => class extends e {
|
|
|
7565
7563
|
}
|
|
7566
7564
|
}
|
|
7567
7565
|
chStartsBindingIdentifierAndNotRelationalOperator(e, t) {
|
|
7568
|
-
if (
|
|
7569
|
-
if (
|
|
7570
|
-
let e = this.codePointAtPos(
|
|
7571
|
-
if (!
|
|
7566
|
+
if (M(e)) {
|
|
7567
|
+
if (nn.lastIndex = t, nn.test(this.input)) {
|
|
7568
|
+
let e = this.codePointAtPos(nn.lastIndex);
|
|
7569
|
+
if (!N(e) && e !== 92) return !1;
|
|
7572
7570
|
}
|
|
7573
7571
|
return !0;
|
|
7574
7572
|
}
|
|
@@ -7583,12 +7581,12 @@ var ln = (e) => class extends e {
|
|
|
7583
7581
|
return t === 34 || t === 39;
|
|
7584
7582
|
}
|
|
7585
7583
|
};
|
|
7586
|
-
function
|
|
7584
|
+
function dn(e) {
|
|
7587
7585
|
if (e.type !== "MemberExpression") return !1;
|
|
7588
7586
|
let { computed: t, property: n } = e;
|
|
7589
|
-
return t && n.type !== "StringLiteral" && (n.type !== "TemplateLiteral" || n.expressions.length > 0) ? !1 :
|
|
7587
|
+
return t && n.type !== "StringLiteral" && (n.type !== "TemplateLiteral" || n.expressions.length > 0) ? !1 : hn(e.object);
|
|
7590
7588
|
}
|
|
7591
|
-
function
|
|
7589
|
+
function fn(e, t) {
|
|
7592
7590
|
let { type: n } = e;
|
|
7593
7591
|
if (e.extra?.parenthesized) return !1;
|
|
7594
7592
|
if (t) {
|
|
@@ -7597,25 +7595,25 @@ function dn(e, t) {
|
|
|
7597
7595
|
if (typeof t == "string" || typeof t == "boolean") return !0;
|
|
7598
7596
|
}
|
|
7599
7597
|
} else if (n === "StringLiteral" || n === "BooleanLiteral") return !0;
|
|
7600
|
-
return !!(
|
|
7598
|
+
return !!(pn(e, t) || mn(e, t) || n === "TemplateLiteral" && e.expressions.length === 0 || dn(e));
|
|
7601
7599
|
}
|
|
7602
|
-
function
|
|
7600
|
+
function pn(e, t) {
|
|
7603
7601
|
return t ? e.type === "Literal" && (typeof e.value == "number" || "bigint" in e) : e.type === "NumericLiteral" || e.type === "BigIntLiteral";
|
|
7604
7602
|
}
|
|
7605
|
-
function
|
|
7603
|
+
function mn(e, t) {
|
|
7606
7604
|
if (e.type === "UnaryExpression") {
|
|
7607
7605
|
let { operator: n, argument: r } = e;
|
|
7608
|
-
if (n === "-" &&
|
|
7606
|
+
if (n === "-" && pn(r, t)) return !0;
|
|
7609
7607
|
}
|
|
7610
7608
|
return !1;
|
|
7611
7609
|
}
|
|
7612
|
-
function
|
|
7613
|
-
return e.type === "Identifier" ? !0 : e.type !== "MemberExpression" || e.computed ? !1 :
|
|
7610
|
+
function hn(e) {
|
|
7611
|
+
return e.type === "Identifier" ? !0 : e.type !== "MemberExpression" || e.computed ? !1 : hn(e.object);
|
|
7614
7612
|
}
|
|
7615
|
-
var
|
|
7613
|
+
var gn = h`placeholders`({
|
|
7616
7614
|
ClassNameIsRequired: "A class name is required.",
|
|
7617
7615
|
UnexpectedSpace: "Unexpected space in placeholder."
|
|
7618
|
-
}),
|
|
7616
|
+
}), _n = (e) => class extends e {
|
|
7619
7617
|
parsePlaceholder(e) {
|
|
7620
7618
|
if (this.match(129)) {
|
|
7621
7619
|
let t = this.startNode();
|
|
@@ -7685,7 +7683,7 @@ var hn = h`placeholders`({
|
|
|
7685
7683
|
if (a) {
|
|
7686
7684
|
if (this.match(77) || this.match(129) || this.match(2)) e.id = a;
|
|
7687
7685
|
else if (n || !t) return e.id = null, e.body = this.finishPlaceholder(a, "ClassBody"), this.finishNode(e, r);
|
|
7688
|
-
else throw this.raise(
|
|
7686
|
+
else throw this.raise(gn.ClassNameIsRequired, this.state.startLoc);
|
|
7689
7687
|
} else this.parseClassId(e, t, n);
|
|
7690
7688
|
return super.parseClassSuper(e), e.body = this.parsePlaceholder("ClassBody") || super.parseClassBody(!!e.superClass, i), this.finishNode(e, r);
|
|
7691
7689
|
}
|
|
@@ -7723,9 +7721,9 @@ var hn = h`placeholders`({
|
|
|
7723
7721
|
return this.parsePlaceholder("StringLiteral") || super.parseImportSource();
|
|
7724
7722
|
}
|
|
7725
7723
|
assertNoSpace() {
|
|
7726
|
-
this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index) && this.raise(
|
|
7724
|
+
this.state.start > this.offsetToSourcePos(this.state.lastTokEndLoc.index) && this.raise(gn.UnexpectedSpace, this.state.lastTokEndLoc);
|
|
7727
7725
|
}
|
|
7728
|
-
},
|
|
7726
|
+
}, vn = (e) => class extends e {
|
|
7729
7727
|
parseV8Intrinsic() {
|
|
7730
7728
|
if (this.match(50)) {
|
|
7731
7729
|
let e = this.state.startLoc, t = this.startNode();
|
|
@@ -7739,29 +7737,29 @@ var hn = h`placeholders`({
|
|
|
7739
7737
|
parseExprAtom(e) {
|
|
7740
7738
|
return this.parseV8Intrinsic() || super.parseExprAtom(e);
|
|
7741
7739
|
}
|
|
7742
|
-
},
|
|
7740
|
+
}, yn = ["fsharp", "hack"], bn = [
|
|
7743
7741
|
"^^",
|
|
7744
7742
|
"@@",
|
|
7745
7743
|
"^",
|
|
7746
7744
|
"%",
|
|
7747
7745
|
"#"
|
|
7748
7746
|
];
|
|
7749
|
-
function
|
|
7747
|
+
function xn(e) {
|
|
7750
7748
|
if (e.has("decorators") && e.has("decorators-legacy")) throw Error("Cannot use the decorators and decorators-legacy plugin together");
|
|
7751
7749
|
if (e.has("flow") && e.has("typescript")) throw Error("Cannot combine flow and typescript plugins.");
|
|
7752
7750
|
if (e.has("placeholders") && e.has("v8intrinsic")) throw Error("Cannot combine placeholders and v8intrinsic plugins.");
|
|
7753
7751
|
if (e.has("pipelineOperator")) {
|
|
7754
7752
|
let t = e.get("pipelineOperator").proposal;
|
|
7755
|
-
if (!
|
|
7756
|
-
let e =
|
|
7753
|
+
if (!yn.includes(t)) {
|
|
7754
|
+
let e = yn.map((e) => `"${e}"`).join(", ");
|
|
7757
7755
|
throw Error(`"pipelineOperator" requires "proposal" option whose value must be one of: ${e}.`);
|
|
7758
7756
|
}
|
|
7759
7757
|
if (t === "hack") {
|
|
7760
7758
|
if (e.has("placeholders")) throw Error("Cannot combine placeholders plugin and Hack-style pipes.");
|
|
7761
7759
|
if (e.has("v8intrinsic")) throw Error("Cannot combine v8intrinsic plugin and Hack-style pipes.");
|
|
7762
7760
|
let t = e.get("pipelineOperator").topicToken;
|
|
7763
|
-
if (!
|
|
7764
|
-
let e =
|
|
7761
|
+
if (!bn.includes(t)) {
|
|
7762
|
+
let e = bn.map((e) => `"${e}"`).join(", ");
|
|
7765
7763
|
throw Error(`"pipelineOperator" in "proposal": "hack" mode also requires a "topicToken" option whose value must be one of: ${e}.`);
|
|
7766
7764
|
}
|
|
7767
7765
|
}
|
|
@@ -7778,14 +7776,14 @@ function bn(e) {
|
|
|
7778
7776
|
if (e.has("decimal")) throw Error("The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.");
|
|
7779
7777
|
if (e.has("importReflection")) throw Error("The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.");
|
|
7780
7778
|
}
|
|
7781
|
-
var
|
|
7779
|
+
var Sn = {
|
|
7782
7780
|
estree: ne,
|
|
7783
|
-
jsx:
|
|
7784
|
-
flow:
|
|
7785
|
-
typescript:
|
|
7786
|
-
v8intrinsic:
|
|
7787
|
-
placeholders:
|
|
7788
|
-
},
|
|
7781
|
+
jsx: dt,
|
|
7782
|
+
flow: it,
|
|
7783
|
+
typescript: un,
|
|
7784
|
+
v8intrinsic: vn,
|
|
7785
|
+
placeholders: _n
|
|
7786
|
+
}, Cn = Object.keys(Sn), wn = class extends tn {
|
|
7789
7787
|
constructor(e, t, n) {
|
|
7790
7788
|
let r = te(e);
|
|
7791
7789
|
super(r, t), this.options = r, this.initializeScopes(), this.plugins = n, this.filename = r.sourceFilename, this.startIndex = r.startIndex;
|
|
@@ -7793,7 +7791,7 @@ var xn = {
|
|
|
7793
7791
|
r.allowAwaitOutsideFunction && (i |= 1), r.allowReturnOutsideFunction && (i |= 2), r.allowImportExportEverywhere && (i |= 8), r.allowSuperOutsideMethod && (i |= 16), r.allowUndeclaredExports && (i |= 64), r.allowNewTargetOutsideFunction && (i |= 4), r.allowYieldOutsideFunction && (i |= 32), r.ranges && (i |= 128), r.locations === !0 && (i |= 256), r.tokens && (i |= 512), r.createImportExpressions && (i |= 1024), r.createParenthesizedExpressions && (i |= 2048), r.errorRecovery && (i |= 4096), r.attachComment && (i |= 8192), r.annexB && (i |= 16384), this.optionFlags = i;
|
|
7794
7792
|
}
|
|
7795
7793
|
getScopeHandler() {
|
|
7796
|
-
return
|
|
7794
|
+
return Ye;
|
|
7797
7795
|
}
|
|
7798
7796
|
parse() {
|
|
7799
7797
|
this.enterInitialScopes();
|
|
@@ -7803,97 +7801,103 @@ var xn = {
|
|
|
7803
7801
|
return n.errors = this.state.errors, n.comments.length = this.state.commentsLen, n;
|
|
7804
7802
|
}
|
|
7805
7803
|
};
|
|
7806
|
-
function
|
|
7804
|
+
function Tn(e, t) {
|
|
7807
7805
|
if (t?.sourceType === "unambiguous") {
|
|
7808
7806
|
t = { ...t };
|
|
7809
7807
|
try {
|
|
7810
7808
|
t.sourceType = "module";
|
|
7811
|
-
let n =
|
|
7809
|
+
let n = Dn(t, e), r = n.parse();
|
|
7812
7810
|
if (n.sawUnambiguousESM) return r;
|
|
7813
7811
|
if (n.ambiguousScriptDifferentAst) try {
|
|
7814
|
-
return t.sourceType = "script",
|
|
7812
|
+
return t.sourceType = "script", Dn(t, e).parse();
|
|
7815
7813
|
} catch {}
|
|
7816
7814
|
else r.program.sourceType = "script";
|
|
7817
7815
|
return r;
|
|
7818
7816
|
} catch (n) {
|
|
7819
7817
|
try {
|
|
7820
|
-
return t.sourceType = "script",
|
|
7818
|
+
return t.sourceType = "script", Dn(t, e).parse();
|
|
7821
7819
|
} catch {}
|
|
7822
7820
|
throw n;
|
|
7823
7821
|
}
|
|
7824
7822
|
}
|
|
7825
|
-
return
|
|
7823
|
+
return Dn(t, e).parse();
|
|
7826
7824
|
}
|
|
7827
|
-
function
|
|
7825
|
+
function En(e) {
|
|
7828
7826
|
let t = {};
|
|
7829
7827
|
for (let n of Object.keys(e)) t[n] = ke(e[n]);
|
|
7830
7828
|
return t;
|
|
7831
7829
|
}
|
|
7832
|
-
|
|
7833
|
-
function
|
|
7834
|
-
let n =
|
|
7830
|
+
En(pe);
|
|
7831
|
+
function Dn(e, t) {
|
|
7832
|
+
let n = wn, r = /* @__PURE__ */ new Map();
|
|
7835
7833
|
if (e?.plugins) {
|
|
7836
7834
|
for (let t of e.plugins) {
|
|
7837
7835
|
let e, n;
|
|
7838
7836
|
typeof t == "string" ? e = t : [e, n] = t, r.has(e) || r.set(e, n || {});
|
|
7839
7837
|
}
|
|
7840
|
-
|
|
7838
|
+
xn(r), n = kn(r);
|
|
7841
7839
|
}
|
|
7842
7840
|
return new n(e, t, r);
|
|
7843
7841
|
}
|
|
7844
|
-
var
|
|
7845
|
-
function
|
|
7842
|
+
var On = /* @__PURE__ */ new Map();
|
|
7843
|
+
function kn(e) {
|
|
7846
7844
|
let t = [];
|
|
7847
|
-
for (let n of
|
|
7848
|
-
let n = t.join("|"), r =
|
|
7845
|
+
for (let n of Cn) e.has(n) && t.push(n);
|
|
7846
|
+
let n = t.join("|"), r = On.get(n);
|
|
7849
7847
|
if (!r) {
|
|
7850
|
-
r =
|
|
7851
|
-
for (let e of t) r =
|
|
7852
|
-
|
|
7848
|
+
r = wn;
|
|
7849
|
+
for (let e of t) r = Sn[e](r);
|
|
7850
|
+
On.set(n, r);
|
|
7853
7851
|
}
|
|
7854
7852
|
return r;
|
|
7855
7853
|
}
|
|
7856
|
-
var
|
|
7854
|
+
var An = {
|
|
7857
7855
|
platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
|
|
7858
7856
|
platformModule: "open-flow:platform",
|
|
7859
7857
|
platformSource: `export const engineContract = ${JSON.stringify("open-flow-engine/v1")}
|
|
7860
7858
|
export function identity(value) { return value }
|
|
7861
7859
|
`
|
|
7862
7860
|
};
|
|
7863
|
-
function
|
|
7864
|
-
return e == "open-flow-engine/v1" ?
|
|
7861
|
+
function jn(e) {
|
|
7862
|
+
return e == "open-flow-engine/v1" ? An : void 0;
|
|
7865
7863
|
}
|
|
7866
7864
|
//#endregion
|
|
7867
|
-
//#region src/
|
|
7868
|
-
|
|
7869
|
-
|
|
7865
|
+
//#region src/flow/common/change.ts
|
|
7866
|
+
function W(e) {
|
|
7867
|
+
return Object.fromEntries(e.map((e) => [e.handle, e]));
|
|
7868
|
+
}
|
|
7869
|
+
//#endregion
|
|
7870
|
+
//#region src/flow/common/encoding.ts
|
|
7871
|
+
var Mn = new TextEncoder();
|
|
7872
|
+
function Nn(e) {
|
|
7870
7873
|
if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number") return JSON.stringify(e);
|
|
7871
|
-
if (Array.isArray(e)) return `[${e.map(
|
|
7874
|
+
if (Array.isArray(e)) return `[${e.map(Nn).join(",")}]`;
|
|
7872
7875
|
let t = e;
|
|
7873
|
-
return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${
|
|
7876
|
+
return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${Nn(t[e])}`).join(",")}}`;
|
|
7874
7877
|
}
|
|
7875
|
-
function
|
|
7876
|
-
return
|
|
7878
|
+
function Pn(e) {
|
|
7879
|
+
return Mn.encode(Nn(e));
|
|
7877
7880
|
}
|
|
7878
|
-
async function
|
|
7881
|
+
async function Fn(e) {
|
|
7879
7882
|
let t = new Uint8Array(e.byteLength);
|
|
7880
7883
|
return t.set(e), `sha256:${[...new Uint8Array(await crypto.subtle.digest("SHA-256", t))].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
|
|
7881
7884
|
}
|
|
7882
|
-
function
|
|
7885
|
+
function In(e) {
|
|
7883
7886
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
7884
7887
|
}
|
|
7885
|
-
function
|
|
7888
|
+
function Ln(e) {
|
|
7886
7889
|
return {
|
|
7887
7890
|
...e.description == null ? {} : { description: e.description },
|
|
7891
|
+
handle: e.handle,
|
|
7888
7892
|
jsonSchema: e.jsonSchema,
|
|
7889
7893
|
nullable: e.nullable,
|
|
7890
7894
|
...Object.hasOwn(e, "value") ? { value: e.value } : {}
|
|
7891
7895
|
};
|
|
7892
7896
|
}
|
|
7893
7897
|
function G(e) {
|
|
7894
|
-
return
|
|
7898
|
+
return e.map(Ln);
|
|
7895
7899
|
}
|
|
7896
|
-
function
|
|
7900
|
+
function Rn(e) {
|
|
7897
7901
|
switch (e.kind) {
|
|
7898
7902
|
case "sources": return {
|
|
7899
7903
|
kind: e.kind,
|
|
@@ -7905,23 +7909,25 @@ function Ln(e) {
|
|
|
7905
7909
|
};
|
|
7906
7910
|
}
|
|
7907
7911
|
}
|
|
7908
|
-
function Rn(e) {
|
|
7909
|
-
return Object.fromEntries(Fn(e).map(([e, t]) => [e, Ln(t)]));
|
|
7910
|
-
}
|
|
7911
7912
|
function zn(e) {
|
|
7912
|
-
return Object.fromEntries(
|
|
7913
|
-
...t.description == null ? {} : { description: t.description },
|
|
7914
|
-
jsonSchema: t.jsonSchema,
|
|
7915
|
-
nullable: t.nullable,
|
|
7916
|
-
sources: t.sources.map((e) => ({ ...e }))
|
|
7917
|
-
}]));
|
|
7913
|
+
return Object.fromEntries(In(e).map(([e, t]) => [e, Rn(t)]));
|
|
7918
7914
|
}
|
|
7919
7915
|
function Bn(e) {
|
|
7920
|
-
|
|
7916
|
+
return e.map((e) => ({
|
|
7917
|
+
...e.description == null ? {} : { description: e.description },
|
|
7918
|
+
handle: e.handle,
|
|
7919
|
+
jsonSchema: e.jsonSchema,
|
|
7920
|
+
nullable: e.nullable,
|
|
7921
|
+
sources: e.sources.map((e) => ({ ...e }))
|
|
7922
|
+
}));
|
|
7923
|
+
}
|
|
7924
|
+
function Vn(e) {
|
|
7925
|
+
if (!("inputs" in e)) return Jn(e);
|
|
7921
7926
|
let t = {
|
|
7922
7927
|
concurrency: e.concurrency,
|
|
7923
7928
|
...e.description == null ? {} : { description: e.description },
|
|
7924
|
-
|
|
7929
|
+
...e.icon == null ? {} : { icon: e.icon },
|
|
7930
|
+
inputs: zn(e.inputs),
|
|
7925
7931
|
...e.name == null ? {} : { name: e.name },
|
|
7926
7932
|
...e.timeoutMs == null ? {} : { timeoutMs: e.timeoutMs }
|
|
7927
7933
|
};
|
|
@@ -7940,7 +7946,7 @@ function Bn(e) {
|
|
|
7940
7946
|
...e.defaultOutput == null ? {} : { defaultOutput: e.defaultOutput },
|
|
7941
7947
|
input: {
|
|
7942
7948
|
handle: e.input.handle,
|
|
7943
|
-
...
|
|
7949
|
+
...Ln(e.input)
|
|
7944
7950
|
},
|
|
7945
7951
|
kind: e.kind
|
|
7946
7952
|
};
|
|
@@ -7956,7 +7962,7 @@ function Bn(e) {
|
|
|
7956
7962
|
} : {
|
|
7957
7963
|
...t,
|
|
7958
7964
|
kind: e.kind,
|
|
7959
|
-
task:
|
|
7965
|
+
task: Wn(e.task)
|
|
7960
7966
|
};
|
|
7961
7967
|
case "value": return {
|
|
7962
7968
|
...t,
|
|
@@ -7965,10 +7971,10 @@ function Bn(e) {
|
|
|
7965
7971
|
};
|
|
7966
7972
|
}
|
|
7967
7973
|
}
|
|
7968
|
-
function Vn(e) {
|
|
7969
|
-
return { nodes: Object.fromEntries(Fn(e.nodes).map(([e, t]) => [e, Bn(t)])) };
|
|
7970
|
-
}
|
|
7971
7974
|
function Hn(e) {
|
|
7975
|
+
return { nodes: Object.fromEntries(In(e.nodes).map(([e, t]) => [e, Vn(t)])) };
|
|
7976
|
+
}
|
|
7977
|
+
function Un(e) {
|
|
7972
7978
|
return {
|
|
7973
7979
|
executor: e.executor,
|
|
7974
7980
|
inputs: G(e.inputs),
|
|
@@ -7976,7 +7982,7 @@ function Hn(e) {
|
|
|
7976
7982
|
outputs: G(e.outputs)
|
|
7977
7983
|
};
|
|
7978
7984
|
}
|
|
7979
|
-
function
|
|
7985
|
+
function Wn(e) {
|
|
7980
7986
|
return {
|
|
7981
7987
|
...e.capabilities == null ? {} : { capabilities: e.capabilities.map(({ action: e, connectionId: t, kind: n }) => ({
|
|
7982
7988
|
action: e,
|
|
@@ -7989,7 +7995,7 @@ function Un(e) {
|
|
|
7989
7995
|
outputs: G(e.outputs)
|
|
7990
7996
|
};
|
|
7991
7997
|
}
|
|
7992
|
-
function
|
|
7998
|
+
function Gn(e) {
|
|
7993
7999
|
return {
|
|
7994
8000
|
configSchema: e.configSchema,
|
|
7995
8001
|
definitionVersion: e.definitionVersion,
|
|
@@ -8011,7 +8017,7 @@ function Wn(e) {
|
|
|
8011
8017
|
type: e.type
|
|
8012
8018
|
};
|
|
8013
8019
|
}
|
|
8014
|
-
function
|
|
8020
|
+
function Kn(e) {
|
|
8015
8021
|
return {
|
|
8016
8022
|
...e.allowedMethods == null ? {} : { allowedMethods: e.allowedMethods },
|
|
8017
8023
|
...e.allowedOrigins == null ? {} : { allowedOrigins: e.allowedOrigins },
|
|
@@ -8021,7 +8027,7 @@ function Gn(e) {
|
|
|
8021
8027
|
...e.responseStatusCode == null ? {} : { responseStatusCode: e.responseStatusCode }
|
|
8022
8028
|
};
|
|
8023
8029
|
}
|
|
8024
|
-
function
|
|
8030
|
+
function qn(e) {
|
|
8025
8031
|
switch (e.type) {
|
|
8026
8032
|
case "cron": return {
|
|
8027
8033
|
expression: e.expression,
|
|
@@ -8035,9 +8041,10 @@ function Kn(e) {
|
|
|
8035
8041
|
};
|
|
8036
8042
|
}
|
|
8037
8043
|
}
|
|
8038
|
-
function
|
|
8044
|
+
function Jn(e) {
|
|
8039
8045
|
let t = (t) => ({
|
|
8040
8046
|
...e.description == null ? {} : { description: e.description },
|
|
8047
|
+
...e.icon == null ? {} : { icon: e.icon },
|
|
8041
8048
|
kind: t,
|
|
8042
8049
|
name: e.name
|
|
8043
8050
|
});
|
|
@@ -8046,30 +8053,30 @@ function qn(e) {
|
|
|
8046
8053
|
...t(e.kind),
|
|
8047
8054
|
inputsDef: e.inputsDef.map((e) => ({
|
|
8048
8055
|
handle: e.handle,
|
|
8049
|
-
...
|
|
8056
|
+
...Ln(e)
|
|
8050
8057
|
})),
|
|
8051
|
-
...e.options == null ? {} : { options:
|
|
8058
|
+
...e.options == null ? {} : { options: Kn(e.options) }
|
|
8052
8059
|
};
|
|
8053
8060
|
case "cron": return {
|
|
8054
8061
|
...t(e.kind),
|
|
8055
|
-
cronTimes: e.cronTimes.map(
|
|
8062
|
+
cronTimes: e.cronTimes.map(qn)
|
|
8056
8063
|
};
|
|
8057
8064
|
case "poll": return {
|
|
8058
8065
|
...t(e.kind),
|
|
8059
8066
|
bindingId: e.bindingId,
|
|
8060
8067
|
config: e.config,
|
|
8061
|
-
definition:
|
|
8062
|
-
pollTimes: e.pollTimes.map(
|
|
8068
|
+
definition: Gn(e.definition),
|
|
8069
|
+
pollTimes: e.pollTimes.map(qn)
|
|
8063
8070
|
};
|
|
8064
8071
|
case "integration": return {
|
|
8065
8072
|
...t(e.kind),
|
|
8066
8073
|
bindingId: e.bindingId,
|
|
8067
8074
|
config: e.config,
|
|
8068
|
-
definition:
|
|
8075
|
+
definition: Gn(e.definition)
|
|
8069
8076
|
};
|
|
8070
8077
|
}
|
|
8071
8078
|
}
|
|
8072
|
-
function
|
|
8079
|
+
function Yn(e) {
|
|
8073
8080
|
return {
|
|
8074
8081
|
imports: e.imports.toSorted(),
|
|
8075
8082
|
name: e.name,
|
|
@@ -8077,81 +8084,75 @@ function Jn(e) {
|
|
|
8077
8084
|
};
|
|
8078
8085
|
}
|
|
8079
8086
|
//#endregion
|
|
8080
|
-
//#region src/
|
|
8081
|
-
function
|
|
8087
|
+
//#region src/flow/common/semantics.ts
|
|
8088
|
+
function Xn(e) {
|
|
8082
8089
|
return Object.keys(e).toSorted().map((t) => [t, e[t]]);
|
|
8083
8090
|
}
|
|
8084
|
-
async function
|
|
8085
|
-
let n =
|
|
8086
|
-
|
|
8087
|
-
|
|
8088
|
-
function c(e) {
|
|
8089
|
-
r.add(e);
|
|
8091
|
+
async function Zn(e) {
|
|
8092
|
+
let t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
|
|
8093
|
+
function o(e) {
|
|
8094
|
+
t.add(e);
|
|
8090
8095
|
}
|
|
8091
|
-
function
|
|
8092
|
-
if (
|
|
8093
|
-
|
|
8096
|
+
function s(t) {
|
|
8097
|
+
if (r.has(t)) return;
|
|
8098
|
+
r.add(t);
|
|
8094
8099
|
let n = e.modules[t];
|
|
8095
|
-
if (n != null) for (let e of n.imports.toSorted())
|
|
8100
|
+
if (n != null) for (let e of n.imports.toSorted()) s(e);
|
|
8096
8101
|
}
|
|
8097
|
-
function
|
|
8098
|
-
for (let t of Object.values(e)) if (t.kind == "sources") for (let e of t.sources) e.kind == "binding" && (
|
|
8102
|
+
function c(e) {
|
|
8103
|
+
for (let t of Object.values(e)) if (t.kind == "sources") for (let e of t.sources) e.kind == "binding" && (n.add(e.bindingId), o(e.bindingId));
|
|
8099
8104
|
}
|
|
8100
|
-
function
|
|
8101
|
-
for (let [, t] of
|
|
8105
|
+
function l(e) {
|
|
8106
|
+
for (let [, t] of Xn(e.nodes)) switch ("inputs" in t && c(t.inputs), t.kind) {
|
|
8102
8107
|
case "condition": break;
|
|
8103
8108
|
case "subflow":
|
|
8104
|
-
|
|
8109
|
+
u(t.subflowId);
|
|
8105
8110
|
break;
|
|
8106
8111
|
case "task":
|
|
8107
|
-
t.task == null ?
|
|
8112
|
+
t.task == null ? a.add(t.taskId) : s(t.task.moduleId);
|
|
8108
8113
|
break;
|
|
8109
8114
|
case "value": break;
|
|
8110
8115
|
case "poll":
|
|
8111
|
-
case "integration":
|
|
8116
|
+
case "integration": o(t.bindingId);
|
|
8112
8117
|
}
|
|
8113
8118
|
}
|
|
8114
|
-
function
|
|
8115
|
-
if (
|
|
8116
|
-
|
|
8119
|
+
function u(t) {
|
|
8120
|
+
if (i.has(t)) return;
|
|
8121
|
+
i.add(t);
|
|
8117
8122
|
let n = e.document.subflows[t];
|
|
8118
|
-
n != null &&
|
|
8123
|
+
n != null && l(n.graph);
|
|
8119
8124
|
}
|
|
8120
|
-
|
|
8121
|
-
let
|
|
8122
|
-
bindings: Object.fromEntries([...
|
|
8123
|
-
|
|
8124
|
-
graph: Vn(n.graph),
|
|
8125
|
-
id: t,
|
|
8126
|
-
name: n.name
|
|
8127
|
-
},
|
|
8125
|
+
l(e.document.graph);
|
|
8126
|
+
let d = Pn({
|
|
8127
|
+
bindings: Object.fromEntries([...t].toSorted().map((t) => [t, e.document.bindings[t] ?? null])),
|
|
8128
|
+
graph: Hn(e.document.graph),
|
|
8128
8129
|
kind: "open-flow-semantic-closure",
|
|
8129
8130
|
modelVersion: e.modelVersion,
|
|
8130
|
-
modules: Object.fromEntries([...
|
|
8131
|
-
tasks: Object.fromEntries([...
|
|
8132
|
-
subflows: Object.fromEntries([...
|
|
8131
|
+
modules: Object.fromEntries([...r].toSorted().map((t) => [t, e.modules[t] == null ? null : Yn(e.modules[t])])),
|
|
8132
|
+
tasks: Object.fromEntries([...a].toSorted().map((t) => [t, e.document.tasks[t] == null ? null : Un(e.document.tasks[t])])),
|
|
8133
|
+
subflows: Object.fromEntries([...i].toSorted().map((t) => {
|
|
8133
8134
|
let n = e.document.subflows[t];
|
|
8134
8135
|
return n == null ? [t, null] : [t, {
|
|
8135
|
-
graph:
|
|
8136
|
+
graph: Hn(n.graph),
|
|
8136
8137
|
inputs: G(n.inputs),
|
|
8137
8138
|
name: n.name,
|
|
8138
|
-
outputs:
|
|
8139
|
+
outputs: Bn(n.outputs)
|
|
8139
8140
|
}];
|
|
8140
8141
|
})),
|
|
8141
8142
|
version: 1
|
|
8142
8143
|
});
|
|
8143
8144
|
return {
|
|
8144
8145
|
dependencies: {
|
|
8145
|
-
bindings:
|
|
8146
|
-
inputBindings:
|
|
8147
|
-
modules:
|
|
8148
|
-
subflows:
|
|
8149
|
-
tasks:
|
|
8146
|
+
bindings: t,
|
|
8147
|
+
inputBindings: n,
|
|
8148
|
+
modules: r,
|
|
8149
|
+
subflows: i,
|
|
8150
|
+
tasks: a
|
|
8150
8151
|
},
|
|
8151
|
-
digest: await
|
|
8152
|
+
digest: await Fn(d)
|
|
8152
8153
|
};
|
|
8153
8154
|
}
|
|
8154
|
-
function
|
|
8155
|
+
function Qn(e) {
|
|
8155
8156
|
return e.kind == "poll" || e.kind == "integration" ? e.definition.payloadSchema : e.kind == "cron" ? {
|
|
8156
8157
|
additionalProperties: !1,
|
|
8157
8158
|
type: "object"
|
|
@@ -8183,16 +8184,16 @@ function J(e, t) {
|
|
|
8183
8184
|
J(n.type == "RestElement" ? n.argument : n.value, t);
|
|
8184
8185
|
}
|
|
8185
8186
|
}
|
|
8186
|
-
function
|
|
8187
|
+
function $n(e) {
|
|
8187
8188
|
if (typeof e != "object" || !e) return;
|
|
8188
8189
|
let t = e;
|
|
8189
8190
|
if (t.type == "Identifier" && typeof t.name == "string") return t.name;
|
|
8190
8191
|
if (t.type == "StringLiteral" && typeof t.value == "string") return t.value;
|
|
8191
8192
|
}
|
|
8192
|
-
function
|
|
8193
|
+
function er(e, t, n) {
|
|
8193
8194
|
let r;
|
|
8194
8195
|
try {
|
|
8195
|
-
r =
|
|
8196
|
+
r = Tn(t, {
|
|
8196
8197
|
createImportExpressions: !0,
|
|
8197
8198
|
sourceFilename: q(e),
|
|
8198
8199
|
sourceType: "module"
|
|
@@ -8214,7 +8215,7 @@ function $n(e, t, n) {
|
|
|
8214
8215
|
let e = t.specifiers.flatMap((e) => {
|
|
8215
8216
|
if (e.type == "ImportNamespaceSpecifier") return [];
|
|
8216
8217
|
if (e.type == "ImportDefaultSpecifier") return ["default"];
|
|
8217
|
-
let t =
|
|
8218
|
+
let t = $n(e.imported);
|
|
8218
8219
|
return t == null ? [] : [t];
|
|
8219
8220
|
});
|
|
8220
8221
|
a.push({
|
|
@@ -8241,7 +8242,7 @@ function $n(e, t, n) {
|
|
|
8241
8242
|
if (t.declaration?.type == "VariableDeclaration") for (let e of t.declaration.declarations) J(e.id, i);
|
|
8242
8243
|
else (t.declaration?.type == "FunctionDeclaration" || t.declaration?.type == "ClassDeclaration") && t.declaration.id != null && i.add(t.declaration.id.name);
|
|
8243
8244
|
for (let e of t.specifiers) {
|
|
8244
|
-
let t =
|
|
8245
|
+
let t = $n(e.exported);
|
|
8245
8246
|
t != null && i.add(t);
|
|
8246
8247
|
}
|
|
8247
8248
|
}
|
|
@@ -8276,14 +8277,14 @@ function $n(e, t, n) {
|
|
|
8276
8277
|
imports: a
|
|
8277
8278
|
};
|
|
8278
8279
|
}
|
|
8279
|
-
function
|
|
8280
|
+
function tr(e) {
|
|
8280
8281
|
return /^\.\/(.+)\.mjs$/.exec(e)?.[1];
|
|
8281
8282
|
}
|
|
8282
|
-
function
|
|
8283
|
+
function nr(e, t) {
|
|
8283
8284
|
return e < t ? -1 : +(e > t);
|
|
8284
8285
|
}
|
|
8285
|
-
function
|
|
8286
|
-
return
|
|
8286
|
+
function rr(e, t) {
|
|
8287
|
+
return nr(e.path, t.path) || e.line - t.line || e.column - t.column || nr(e.code, t.code) || nr(e.message, t.message);
|
|
8287
8288
|
}
|
|
8288
8289
|
function Y(e, t, n) {
|
|
8289
8290
|
return {
|
|
@@ -8307,8 +8308,8 @@ function Z(e) {
|
|
|
8307
8308
|
function Q(e) {
|
|
8308
8309
|
return Array.isArray(e) ? e : void 0;
|
|
8309
8310
|
}
|
|
8310
|
-
function
|
|
8311
|
-
if (Array.isArray(e)) return e.some((e) =>
|
|
8311
|
+
function ir(e, t) {
|
|
8312
|
+
if (Array.isArray(e)) return e.some((e) => ir(e, t));
|
|
8312
8313
|
switch (e) {
|
|
8313
8314
|
case void 0: return !0;
|
|
8314
8315
|
case "null": return t == null;
|
|
@@ -8332,7 +8333,7 @@ function $(e, t) {
|
|
|
8332
8333
|
let a = Q(n.oneOf);
|
|
8333
8334
|
if (a != null && a.filter((t) => $(e, t)).length != 1 || n.not != null && $(e, n.not) || n.const != null && !X(e, n.const)) return !1;
|
|
8334
8335
|
let o = Q(n.enum);
|
|
8335
|
-
if (o != null && !o.some((t) => X(e, t)) || !
|
|
8336
|
+
if (o != null && !o.some((t) => X(e, t)) || !ir(n.type, e)) return !1;
|
|
8336
8337
|
if (typeof e == "string") {
|
|
8337
8338
|
if (typeof n.minLength == "number" && e.length < n.minLength || typeof n.maxLength == "number" && e.length > n.maxLength) return !1;
|
|
8338
8339
|
if (typeof n.pattern == "string") try {
|
|
@@ -8357,7 +8358,7 @@ function $(e, t) {
|
|
|
8357
8358
|
}
|
|
8358
8359
|
return !0;
|
|
8359
8360
|
}
|
|
8360
|
-
function
|
|
8361
|
+
function ar(e, t) {
|
|
8361
8362
|
if (e === !0 || t === !0 || X(e, {}) || X(t, {})) return !0;
|
|
8362
8363
|
if (e === !1 || t === !1) return !1;
|
|
8363
8364
|
if (X(e, t)) return !0;
|
|
@@ -8368,13 +8369,13 @@ function ir(e, t) {
|
|
|
8368
8369
|
for (let [e, t] of Object.entries(i)) {
|
|
8369
8370
|
let n = a[e];
|
|
8370
8371
|
if (n != null) {
|
|
8371
|
-
if (!
|
|
8372
|
+
if (!ar(t, n)) return !1;
|
|
8372
8373
|
} else if (r.additionalProperties === !1) return !1;
|
|
8373
|
-
else if (r.additionalProperties != null && r.additionalProperties !== !0 && !
|
|
8374
|
+
else if (r.additionalProperties != null && r.additionalProperties !== !0 && !ar(t, r.additionalProperties)) return !1;
|
|
8374
8375
|
}
|
|
8375
8376
|
return n.additionalProperties === !1 || r.additionalProperties !== !1;
|
|
8376
8377
|
}
|
|
8377
|
-
function
|
|
8378
|
+
function or(e, t, n, r, i) {
|
|
8378
8379
|
if (t.kind == "webhook") {
|
|
8379
8380
|
let e = /* @__PURE__ */ new Set();
|
|
8380
8381
|
for (let [n, a] of t.inputsDef.entries()) e.has(a.handle) && i.push(Y("trigger.input-duplicate", `Webhook Trigger input "${a.handle}" is declared more than once.`, `${r}/inputsDef/${n}/handle`)), e.add(a.handle);
|
|
@@ -8386,37 +8387,37 @@ function ar(e, t, n, r, i) {
|
|
|
8386
8387
|
let o = Q(Z(t.definition.configSchema)?.required)?.filter((e) => typeof e == "string" && !Object.hasOwn(t.config, e)) ?? [];
|
|
8387
8388
|
o.length > 0 ? i.push(Y("trigger.config-incomplete", `Complete the required Trigger config fields: ${o.join(", ")}.`, `${r}/config`)) : $(t.config, t.definition.configSchema) || i.push(Y("trigger.config-invalid", `Trigger "${e}" config does not match its fixed definition.`, `${r}/config`));
|
|
8388
8389
|
}
|
|
8389
|
-
function
|
|
8390
|
+
function sr(e, t) {
|
|
8390
8391
|
switch (t.kind) {
|
|
8391
8392
|
case "condition": return { [t.input.handle]: t.input };
|
|
8392
8393
|
case "value": return {};
|
|
8393
|
-
case "subflow": return e.subflows[t.subflowId]?.inputs ??
|
|
8394
|
-
case "task": return t.task == null ? e.tasks[t.taskId]?.inputs ??
|
|
8394
|
+
case "subflow": return W(e.subflows[t.subflowId]?.inputs ?? []);
|
|
8395
|
+
case "task": return W(t.task == null ? e.tasks[t.taskId]?.inputs ?? [] : t.task.inputs);
|
|
8395
8396
|
case "cron":
|
|
8396
8397
|
case "integration":
|
|
8397
8398
|
case "poll":
|
|
8398
8399
|
case "webhook": return {};
|
|
8399
8400
|
}
|
|
8400
8401
|
}
|
|
8401
|
-
function
|
|
8402
|
+
function cr(e, t) {
|
|
8402
8403
|
switch (t.kind) {
|
|
8403
8404
|
case "condition": {
|
|
8404
8405
|
let e = [...t.cases.map((e) => e.output), ...t.defaultOutput == null ? [] : [t.defaultOutput]];
|
|
8405
8406
|
return Object.fromEntries(e.map((e) => [e, t.input]));
|
|
8406
8407
|
}
|
|
8407
|
-
case "value": return t.values;
|
|
8408
|
-
case "subflow": return e.subflows[t.subflowId]?.outputs ??
|
|
8409
|
-
case "task": return t.task == null ? e.tasks[t.taskId]?.outputs ??
|
|
8408
|
+
case "value": return W(t.values);
|
|
8409
|
+
case "subflow": return W(e.subflows[t.subflowId]?.outputs ?? []);
|
|
8410
|
+
case "task": return W(t.task == null ? e.tasks[t.taskId]?.outputs ?? [] : t.task.outputs);
|
|
8410
8411
|
case "cron":
|
|
8411
8412
|
case "integration":
|
|
8412
8413
|
case "poll":
|
|
8413
8414
|
case "webhook": return { payload: {
|
|
8414
|
-
jsonSchema:
|
|
8415
|
+
jsonSchema: Qn(t),
|
|
8415
8416
|
nullable: !1
|
|
8416
8417
|
} };
|
|
8417
8418
|
}
|
|
8418
8419
|
}
|
|
8419
|
-
function
|
|
8420
|
+
function lr(e, t, n, r, i, a, o) {
|
|
8420
8421
|
switch (e.kind) {
|
|
8421
8422
|
case "binding":
|
|
8422
8423
|
n.bindings[e.bindingId] ?? o.push(Y("graph.binding-missing", `Binding "${e.bindingId}" does not exist.`, a));
|
|
@@ -8430,19 +8431,19 @@ function cr(e, t, n, r, i, a, o) {
|
|
|
8430
8431
|
o.push(Y("graph.source-missing", `Upstream node "${e.nodeId}" does not exist.`, a));
|
|
8431
8432
|
return;
|
|
8432
8433
|
}
|
|
8433
|
-
let s =
|
|
8434
|
-
s == null ? o.push(Y("graph.source-missing", `Upstream node "${e.nodeId}" does not expose output "${e.output}".`, a)) : i != null && (!X(s.jsonSchema, {}) && s.jsonSchema !== !0 && s.nullable && !i.nullable || !
|
|
8434
|
+
let s = cr(n, r)[e.output];
|
|
8435
|
+
s == null ? o.push(Y("graph.source-missing", `Upstream node "${e.nodeId}" does not expose output "${e.output}".`, a)) : i != null && (!X(s.jsonSchema, {}) && s.jsonSchema !== !0 && s.nullable && !i.nullable || !ar(s.jsonSchema, i.jsonSchema)) && o.push(Y("graph.node-output-incompatible", `Upstream node "${e.nodeId}" output "${e.output}" is not compatible with this input.`, a));
|
|
8435
8436
|
}
|
|
8436
8437
|
}
|
|
8437
8438
|
}
|
|
8438
|
-
function
|
|
8439
|
+
function ur(e, t) {
|
|
8439
8440
|
let n = /* @__PURE__ */ new Set();
|
|
8440
8441
|
if (!("inputs" in t)) return n;
|
|
8441
8442
|
for (let r of Object.values(t.inputs)) if (r.kind == "sources") for (let t of r.sources) t.kind == "node" && e.nodes[t.nodeId] != null && n.add(t.nodeId);
|
|
8442
8443
|
return n;
|
|
8443
8444
|
}
|
|
8444
|
-
function
|
|
8445
|
-
let r = new Map(Object.entries(e.nodes).map(([t, n]) => [t,
|
|
8445
|
+
function dr(e, t, n) {
|
|
8446
|
+
let r = new Map(Object.entries(e.nodes).map(([t, n]) => [t, ur(e, n)]));
|
|
8446
8447
|
for (; r.size > 0;) {
|
|
8447
8448
|
let e = [...r].filter(([, e]) => e.size == 0).map(([e]) => e);
|
|
8448
8449
|
if (e.length == 0) {
|
|
@@ -8453,18 +8454,18 @@ function ur(e, t, n) {
|
|
|
8453
8454
|
for (let t of r.values()) for (let n of e) t.delete(n);
|
|
8454
8455
|
}
|
|
8455
8456
|
}
|
|
8456
|
-
function
|
|
8457
|
+
function fr(e, t, n, r, i, a) {
|
|
8457
8458
|
for (let [o, s] of Object.entries(e.nodes)) {
|
|
8458
8459
|
let c = `${i}/nodes/${o}`;
|
|
8459
8460
|
if (!("inputs" in s)) {
|
|
8460
|
-
r ?
|
|
8461
|
+
r ? or(o, s, t, c, a) : a.push(Y("graph.trigger-not-allowed", "Trigger nodes are only allowed in Flows.", c));
|
|
8461
8462
|
continue;
|
|
8462
8463
|
}
|
|
8463
8464
|
s.kind == "task" && s.task == null && t.tasks[s.taskId] == null ? a.push(Y("graph.target-missing", `Task "${s.taskId}" does not exist.`, `${c}/taskId`)) : s.kind == "subflow" && t.subflows[s.subflowId] == null && a.push(Y("graph.target-missing", `Subflow "${s.subflowId}" does not exist.`, `${c}/subflowId`));
|
|
8464
|
-
let l =
|
|
8465
|
+
let l = sr(t, s), u = new Set(Object.keys(l));
|
|
8465
8466
|
for (let [r, i] of Object.entries(s.inputs)) {
|
|
8466
8467
|
let s = `${c}/inputs/${r}`;
|
|
8467
|
-
if (u.has(r) || a.push(Y("graph.input-missing", `Node "${o}" does not expose input "${r}".`, s)), i.kind == "sources") for (let o of i.sources)
|
|
8468
|
+
if (u.has(r) || a.push(Y("graph.input-missing", `Node "${o}" does not expose input "${r}".`, s)), i.kind == "sources") for (let o of i.sources) lr(o, e, t, n, l[r], s, a);
|
|
8468
8469
|
}
|
|
8469
8470
|
if (s.kind != "condition") continue;
|
|
8470
8471
|
let d = /* @__PURE__ */ new Set();
|
|
@@ -8473,56 +8474,55 @@ function dr(e, t, n, r, i, a) {
|
|
|
8473
8474
|
for (let [n, r] of t.expressions.entries()) r.input != s.input.handle && a.push(Y("condition.input-missing", `Condition expression references unknown input "${r.input}".`, `${c}/cases/${e}/expressions/${n}/input`));
|
|
8474
8475
|
}
|
|
8475
8476
|
}
|
|
8476
|
-
|
|
8477
|
+
dr(e, i, a);
|
|
8477
8478
|
}
|
|
8478
|
-
function
|
|
8479
|
-
let
|
|
8480
|
-
function a
|
|
8481
|
-
for (let [s, c] of Object.entries(
|
|
8479
|
+
function pr(e, t) {
|
|
8480
|
+
let n = /* @__PURE__ */ new Set(), r = [];
|
|
8481
|
+
function i(a, o) {
|
|
8482
|
+
for (let [s, c] of Object.entries(a.nodes)) {
|
|
8482
8483
|
if (c.kind != "subflow" || e.subflows[c.subflowId] == null) continue;
|
|
8483
|
-
let
|
|
8484
|
-
if (
|
|
8485
|
-
|
|
8484
|
+
let a = r.indexOf(c.subflowId);
|
|
8485
|
+
if (a >= 0) {
|
|
8486
|
+
t.push(Y("subflow.cycle", `Subflow cycle is not executable: ${[...r.slice(a), c.subflowId].join(" -> ")}.`, `${o}/nodes/${s}/subflowId`));
|
|
8486
8487
|
continue;
|
|
8487
8488
|
}
|
|
8488
|
-
|
|
8489
|
+
n.has(c.subflowId) || (n.add(c.subflowId), r.push(c.subflowId), i(e.subflows[c.subflowId].graph, `/document/subflows/${c.subflowId}/graph`), r.pop());
|
|
8489
8490
|
}
|
|
8490
8491
|
}
|
|
8491
|
-
|
|
8492
|
+
i(e.graph, "/document/graph");
|
|
8492
8493
|
}
|
|
8493
|
-
function
|
|
8494
|
-
let
|
|
8495
|
-
|
|
8496
|
-
for (let
|
|
8497
|
-
let
|
|
8498
|
-
if (
|
|
8499
|
-
let i = `/document/subflows/${
|
|
8500
|
-
|
|
8501
|
-
for (let
|
|
8502
|
-
}
|
|
8503
|
-
return
|
|
8504
|
-
}
|
|
8505
|
-
function
|
|
8506
|
-
if (typeof
|
|
8507
|
-
let
|
|
8508
|
-
|
|
8509
|
-
|
|
8510
|
-
|
|
8511
|
-
|
|
8512
|
-
let a = or(e.document, n);
|
|
8494
|
+
function mr(e, t) {
|
|
8495
|
+
let n = [];
|
|
8496
|
+
fr(e.document.graph, e.document, void 0, !0, "/document/graph", n);
|
|
8497
|
+
for (let r of [...t.dependencies.subflows].toSorted()) {
|
|
8498
|
+
let t = e.document.subflows[r];
|
|
8499
|
+
if (t == null) continue;
|
|
8500
|
+
let i = `/document/subflows/${r}`, a = new Set(t.inputs.map((e) => e.handle));
|
|
8501
|
+
fr(t.graph, e.document, a, !1, `${i}/graph`, n);
|
|
8502
|
+
for (let r of t.outputs) for (let o of r.sources) lr(o, t.graph, e.document, a, void 0, `${i}/outputs/${r.handle}/sources`, n);
|
|
8503
|
+
}
|
|
8504
|
+
return pr(e.document, n), n;
|
|
8505
|
+
}
|
|
8506
|
+
function hr(e, t) {
|
|
8507
|
+
if (typeof t != "object" || !t || Array.isArray(t)) return "invalid";
|
|
8508
|
+
let n = e.document.graph;
|
|
8509
|
+
for (let [r, i] of Object.entries(t)) {
|
|
8510
|
+
let t = n.nodes[r];
|
|
8511
|
+
if (t == null || !("inputs" in t) || typeof i != "object" || !i || Array.isArray(i)) return "invalid";
|
|
8512
|
+
let a = sr(e.document, t);
|
|
8513
8513
|
for (let e of Object.keys(i)) {
|
|
8514
|
-
let
|
|
8515
|
-
if (
|
|
8514
|
+
let n = a[e];
|
|
8515
|
+
if (n == null || t.inputs[e] != null || Object.hasOwn(n, "value")) return "invalid";
|
|
8516
8516
|
}
|
|
8517
8517
|
}
|
|
8518
8518
|
return "valid";
|
|
8519
8519
|
}
|
|
8520
|
-
function
|
|
8520
|
+
function gr(e, t, n) {
|
|
8521
8521
|
let r = [], i = /* @__PURE__ */ new Map();
|
|
8522
8522
|
for (let n of t.toSorted()) {
|
|
8523
8523
|
let t = e.modules[n];
|
|
8524
8524
|
if (t == null) continue;
|
|
8525
|
-
let a =
|
|
8525
|
+
let a = er(n, t.source, r);
|
|
8526
8526
|
a != null && i.set(n, a);
|
|
8527
8527
|
}
|
|
8528
8528
|
for (let a of t.toSorted()) {
|
|
@@ -8542,7 +8542,7 @@ function hr(e, t, n) {
|
|
|
8542
8542
|
});
|
|
8543
8543
|
continue;
|
|
8544
8544
|
}
|
|
8545
|
-
let o =
|
|
8545
|
+
let o = tr(c.specifier);
|
|
8546
8546
|
if (o == null) {
|
|
8547
8547
|
r.push({
|
|
8548
8548
|
code: "module.unsupported-import",
|
|
@@ -8595,48 +8595,47 @@ function hr(e, t, n) {
|
|
|
8595
8595
|
diagnostics: r
|
|
8596
8596
|
};
|
|
8597
8597
|
}
|
|
8598
|
-
function
|
|
8599
|
-
return
|
|
8598
|
+
function _r(e, t, n) {
|
|
8599
|
+
return gr(e, t, n).diagnostics.toSorted(rr);
|
|
8600
8600
|
}
|
|
8601
|
-
async function
|
|
8602
|
-
|
|
8603
|
-
|
|
8604
|
-
i.
|
|
8605
|
-
let a = [[`/document/flows/${t}/graph`, e.document.flows[t].graph], ...[...r.dependencies.subflows].toSorted().flatMap((t) => {
|
|
8601
|
+
async function vr(e, t) {
|
|
8602
|
+
let n = await Zn(e), r = gr(e, [...n.dependencies.modules], t);
|
|
8603
|
+
r.diagnostics.push(...mr(e, n));
|
|
8604
|
+
let i = [["/document/graph", e.document.graph], ...[...n.dependencies.subflows].toSorted().flatMap((t) => {
|
|
8606
8605
|
let n = e.document.subflows[t];
|
|
8607
8606
|
return n == null ? [] : [[`/document/subflows/${t}/graph`, n.graph]];
|
|
8608
|
-
})],
|
|
8609
|
-
for (let [t, n] of
|
|
8610
|
-
e.modules[
|
|
8607
|
+
})], a = /* @__PURE__ */ new Set();
|
|
8608
|
+
for (let [t, n] of i) for (let [i, o] of Object.entries(n.nodes)) if (o.kind == "task" && o.task != null) {
|
|
8609
|
+
e.modules[o.task.moduleId] == null ? r.diagnostics.push({
|
|
8611
8610
|
code: "task.module-missing",
|
|
8612
8611
|
column: 0,
|
|
8613
8612
|
line: 1,
|
|
8614
|
-
message: `Inline Task "${
|
|
8615
|
-
path: `${t}/nodes/${
|
|
8616
|
-
}) : !
|
|
8613
|
+
message: `Inline Task "${i}" references missing CodeModule "${o.task.moduleId}".`,
|
|
8614
|
+
path: `${t}/nodes/${i}/task/moduleId`
|
|
8615
|
+
}) : !r.analysis.get(o.task.moduleId)?.exports.has("default") && !a.has(o.task.moduleId) && (a.add(o.task.moduleId), r.diagnostics.push({
|
|
8617
8616
|
code: "task.missing-entry",
|
|
8618
8617
|
column: 0,
|
|
8619
8618
|
line: 1,
|
|
8620
|
-
message: `CodeModule "${
|
|
8621
|
-
path: `/modules/${
|
|
8619
|
+
message: `CodeModule "${o.task.moduleId}" used by an Inline Task must export a default function.`,
|
|
8620
|
+
path: `/modules/${o.task.moduleId}/source`
|
|
8622
8621
|
}));
|
|
8623
|
-
for (let [e, n] of (
|
|
8622
|
+
for (let [e, n] of (o.task.capabilities ?? []).entries()) n.action.length > 0 && n.connectionId.length > 0 || r.diagnostics.push({
|
|
8624
8623
|
code: "task.capability-incomplete",
|
|
8625
8624
|
column: 0,
|
|
8626
8625
|
line: 1,
|
|
8627
|
-
message: `Inline Task "${
|
|
8628
|
-
path: `${t}/nodes/${
|
|
8626
|
+
message: `Inline Task "${i}" has an incomplete Connector Capability.`,
|
|
8627
|
+
path: `${t}/nodes/${i}/task/capabilities/${e}`
|
|
8629
8628
|
});
|
|
8630
8629
|
}
|
|
8631
|
-
for (let t of [...
|
|
8630
|
+
for (let t of [...n.dependencies.tasks].toSorted()) {
|
|
8632
8631
|
let n = e.document.tasks[t];
|
|
8633
|
-
n != null && (n.executor.kind == "connector" && n.executor.action.length == 0 &&
|
|
8632
|
+
n != null && (n.executor.kind == "connector" && n.executor.action.length == 0 && r.diagnostics.push({
|
|
8634
8633
|
code: "task.connector-incomplete",
|
|
8635
8634
|
column: 0,
|
|
8636
8635
|
line: 1,
|
|
8637
8636
|
message: `Connector Task "${t}" requires an action.`,
|
|
8638
8637
|
path: `/document/tasks/${t}/executor`
|
|
8639
|
-
}), n.executor.kind == "connector" && n.executor.connectionId == null &&
|
|
8638
|
+
}), n.executor.kind == "connector" && n.executor.connectionId == null && r.diagnostics.push({
|
|
8640
8639
|
code: "task.connector-connection-required",
|
|
8641
8640
|
column: 0,
|
|
8642
8641
|
line: 1,
|
|
@@ -8644,38 +8643,36 @@ async function _r(e, t, n) {
|
|
|
8644
8643
|
path: `/document/tasks/${t}/executor/connectionId`
|
|
8645
8644
|
}));
|
|
8646
8645
|
}
|
|
8647
|
-
let
|
|
8646
|
+
let o = r.diagnostics.toSorted(rr);
|
|
8648
8647
|
return {
|
|
8649
|
-
closure:
|
|
8650
|
-
diagnostics:
|
|
8651
|
-
valid:
|
|
8648
|
+
closure: n,
|
|
8649
|
+
diagnostics: o,
|
|
8650
|
+
valid: o.length == 0
|
|
8652
8651
|
};
|
|
8653
8652
|
}
|
|
8654
|
-
async function
|
|
8655
|
-
let
|
|
8656
|
-
if (
|
|
8657
|
-
let
|
|
8658
|
-
if (
|
|
8659
|
-
if (!i.valid) return {
|
|
8653
|
+
async function yr(e, t) {
|
|
8654
|
+
let n = jn(t);
|
|
8655
|
+
if (n == null) return { kind: "engine-unsupported" };
|
|
8656
|
+
let r = await vr(e, n);
|
|
8657
|
+
if (!r.valid) return {
|
|
8660
8658
|
kind: "flow-invalid",
|
|
8661
|
-
validation:
|
|
8659
|
+
validation: r
|
|
8662
8660
|
};
|
|
8663
|
-
let { closure:
|
|
8661
|
+
let { closure: i } = r;
|
|
8664
8662
|
return {
|
|
8665
8663
|
flow: {
|
|
8666
|
-
closureDigest:
|
|
8667
|
-
engineContract:
|
|
8668
|
-
|
|
8669
|
-
|
|
8670
|
-
|
|
8671
|
-
|
|
8672
|
-
tasks: Object.fromEntries([...a.dependencies.tasks].toSorted().map((t) => [t, e.document.tasks[t]]))
|
|
8664
|
+
closureDigest: i.digest,
|
|
8665
|
+
engineContract: t,
|
|
8666
|
+
graph: e.document.graph,
|
|
8667
|
+
modules: Object.fromEntries([...i.dependencies.modules].toSorted().map((t) => [t, e.modules[t]])),
|
|
8668
|
+
subflows: Object.fromEntries([...i.dependencies.subflows].toSorted().map((t) => [t, e.document.subflows[t]])),
|
|
8669
|
+
tasks: Object.fromEntries([...i.dependencies.tasks].toSorted().map((t) => [t, e.document.tasks[t]]))
|
|
8673
8670
|
},
|
|
8674
8671
|
kind: "prepared",
|
|
8675
|
-
validation:
|
|
8672
|
+
validation: r
|
|
8676
8673
|
};
|
|
8677
8674
|
}
|
|
8678
|
-
function
|
|
8675
|
+
function br(e, t, n) {
|
|
8679
8676
|
if (Object.hasOwn(e.modules, t)) return {
|
|
8680
8677
|
engineContract: e.engineContract,
|
|
8681
8678
|
engineDigest: n,
|
|
@@ -8684,4 +8681,4 @@ function yr(e, t, n) {
|
|
|
8684
8681
|
};
|
|
8685
8682
|
}
|
|
8686
8683
|
//#endregion
|
|
8687
|
-
export {
|
|
8684
|
+
export { br as createRuntimeProgram, Zn as flowClosure, $ as matchesSchema, yr as prepareFlow, Qn as triggerPayloadSchema, vr as validateFlow, hr as validateFlowInputs, _r as validateModules };
|