@recursive-robot/react-jsx-parser 2.0.0 → 2.0.2
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/react-jsx-parser.js
CHANGED
|
@@ -981,195 +981,195 @@ function ne(e, t) {
|
|
|
981
981
|
function x(e, t) {
|
|
982
982
|
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && b.test(String.fromCharCode(e)) : t === !1 ? !1 : ne(e, m);
|
|
983
983
|
}
|
|
984
|
-
function
|
|
984
|
+
function re(e, t) {
|
|
985
985
|
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && te.test(String.fromCharCode(e)) : t === !1 ? !1 : ne(e, m) || ne(e, p);
|
|
986
986
|
}
|
|
987
|
-
var
|
|
987
|
+
var S = function(e, t) {
|
|
988
988
|
t === void 0 && (t = {}), this.label = e, this.keyword = t.keyword, this.beforeExpr = !!t.beforeExpr, this.startsExpr = !!t.startsExpr, this.isLoop = !!t.isLoop, this.isAssign = !!t.isAssign, this.prefix = !!t.prefix, this.postfix = !!t.postfix, this.binop = t.binop || null, this.updateContext = null;
|
|
989
989
|
};
|
|
990
|
-
function
|
|
991
|
-
return new
|
|
990
|
+
function C(e, t) {
|
|
991
|
+
return new S(e, {
|
|
992
992
|
beforeExpr: !0,
|
|
993
993
|
binop: t
|
|
994
994
|
});
|
|
995
995
|
}
|
|
996
|
-
var
|
|
997
|
-
function
|
|
998
|
-
return t === void 0 && (t = {}), t.keyword = e,
|
|
996
|
+
var w = { beforeExpr: !0 }, T = { startsExpr: !0 }, ie = {};
|
|
997
|
+
function E(e, t) {
|
|
998
|
+
return t === void 0 && (t = {}), t.keyword = e, ie[e] = new S(e, t);
|
|
999
999
|
}
|
|
1000
|
-
var
|
|
1001
|
-
num: new
|
|
1002
|
-
regexp: new
|
|
1003
|
-
string: new
|
|
1004
|
-
name: new
|
|
1005
|
-
privateId: new
|
|
1006
|
-
eof: new
|
|
1007
|
-
bracketL: new
|
|
1000
|
+
var D = {
|
|
1001
|
+
num: new S("num", T),
|
|
1002
|
+
regexp: new S("regexp", T),
|
|
1003
|
+
string: new S("string", T),
|
|
1004
|
+
name: new S("name", T),
|
|
1005
|
+
privateId: new S("privateId", T),
|
|
1006
|
+
eof: new S("eof"),
|
|
1007
|
+
bracketL: new S("[", {
|
|
1008
1008
|
beforeExpr: !0,
|
|
1009
1009
|
startsExpr: !0
|
|
1010
1010
|
}),
|
|
1011
|
-
bracketR: new
|
|
1012
|
-
braceL: new
|
|
1011
|
+
bracketR: new S("]"),
|
|
1012
|
+
braceL: new S("{", {
|
|
1013
1013
|
beforeExpr: !0,
|
|
1014
1014
|
startsExpr: !0
|
|
1015
1015
|
}),
|
|
1016
|
-
braceR: new
|
|
1017
|
-
parenL: new
|
|
1016
|
+
braceR: new S("}"),
|
|
1017
|
+
parenL: new S("(", {
|
|
1018
1018
|
beforeExpr: !0,
|
|
1019
1019
|
startsExpr: !0
|
|
1020
1020
|
}),
|
|
1021
|
-
parenR: new
|
|
1022
|
-
comma: new
|
|
1023
|
-
semi: new
|
|
1024
|
-
colon: new
|
|
1025
|
-
dot: new
|
|
1026
|
-
question: new
|
|
1027
|
-
questionDot: new
|
|
1028
|
-
arrow: new
|
|
1029
|
-
template: new
|
|
1030
|
-
invalidTemplate: new
|
|
1031
|
-
ellipsis: new
|
|
1032
|
-
backQuote: new
|
|
1033
|
-
dollarBraceL: new
|
|
1021
|
+
parenR: new S(")"),
|
|
1022
|
+
comma: new S(",", w),
|
|
1023
|
+
semi: new S(";", w),
|
|
1024
|
+
colon: new S(":", w),
|
|
1025
|
+
dot: new S("."),
|
|
1026
|
+
question: new S("?", w),
|
|
1027
|
+
questionDot: new S("?."),
|
|
1028
|
+
arrow: new S("=>", w),
|
|
1029
|
+
template: new S("template"),
|
|
1030
|
+
invalidTemplate: new S("invalidTemplate"),
|
|
1031
|
+
ellipsis: new S("...", w),
|
|
1032
|
+
backQuote: new S("`", T),
|
|
1033
|
+
dollarBraceL: new S("${", {
|
|
1034
1034
|
beforeExpr: !0,
|
|
1035
1035
|
startsExpr: !0
|
|
1036
1036
|
}),
|
|
1037
|
-
eq: new
|
|
1037
|
+
eq: new S("=", {
|
|
1038
1038
|
beforeExpr: !0,
|
|
1039
1039
|
isAssign: !0
|
|
1040
1040
|
}),
|
|
1041
|
-
assign: new
|
|
1041
|
+
assign: new S("_=", {
|
|
1042
1042
|
beforeExpr: !0,
|
|
1043
1043
|
isAssign: !0
|
|
1044
1044
|
}),
|
|
1045
|
-
incDec: new
|
|
1045
|
+
incDec: new S("++/--", {
|
|
1046
1046
|
prefix: !0,
|
|
1047
1047
|
postfix: !0,
|
|
1048
1048
|
startsExpr: !0
|
|
1049
1049
|
}),
|
|
1050
|
-
prefix: new
|
|
1050
|
+
prefix: new S("!/~", {
|
|
1051
1051
|
beforeExpr: !0,
|
|
1052
1052
|
prefix: !0,
|
|
1053
1053
|
startsExpr: !0
|
|
1054
1054
|
}),
|
|
1055
|
-
logicalOR:
|
|
1056
|
-
logicalAND:
|
|
1057
|
-
bitwiseOR:
|
|
1058
|
-
bitwiseXOR:
|
|
1059
|
-
bitwiseAND:
|
|
1060
|
-
equality:
|
|
1061
|
-
relational:
|
|
1062
|
-
bitShift:
|
|
1063
|
-
plusMin: new
|
|
1055
|
+
logicalOR: C("||", 1),
|
|
1056
|
+
logicalAND: C("&&", 2),
|
|
1057
|
+
bitwiseOR: C("|", 3),
|
|
1058
|
+
bitwiseXOR: C("^", 4),
|
|
1059
|
+
bitwiseAND: C("&", 5),
|
|
1060
|
+
equality: C("==/!=/===/!==", 6),
|
|
1061
|
+
relational: C("</>/<=/>=", 7),
|
|
1062
|
+
bitShift: C("<</>>/>>>", 8),
|
|
1063
|
+
plusMin: new S("+/-", {
|
|
1064
1064
|
beforeExpr: !0,
|
|
1065
1065
|
binop: 9,
|
|
1066
1066
|
prefix: !0,
|
|
1067
1067
|
startsExpr: !0
|
|
1068
1068
|
}),
|
|
1069
|
-
modulo:
|
|
1070
|
-
star:
|
|
1071
|
-
slash:
|
|
1072
|
-
starstar: new
|
|
1073
|
-
coalesce:
|
|
1074
|
-
_break:
|
|
1075
|
-
_case:
|
|
1076
|
-
_catch:
|
|
1077
|
-
_continue:
|
|
1078
|
-
_debugger:
|
|
1079
|
-
_default:
|
|
1080
|
-
_do:
|
|
1069
|
+
modulo: C("%", 10),
|
|
1070
|
+
star: C("*", 10),
|
|
1071
|
+
slash: C("/", 10),
|
|
1072
|
+
starstar: new S("**", { beforeExpr: !0 }),
|
|
1073
|
+
coalesce: C("??", 1),
|
|
1074
|
+
_break: E("break"),
|
|
1075
|
+
_case: E("case", w),
|
|
1076
|
+
_catch: E("catch"),
|
|
1077
|
+
_continue: E("continue"),
|
|
1078
|
+
_debugger: E("debugger"),
|
|
1079
|
+
_default: E("default", w),
|
|
1080
|
+
_do: E("do", {
|
|
1081
1081
|
isLoop: !0,
|
|
1082
1082
|
beforeExpr: !0
|
|
1083
1083
|
}),
|
|
1084
|
-
_else:
|
|
1085
|
-
_finally:
|
|
1086
|
-
_for:
|
|
1087
|
-
_function:
|
|
1088
|
-
_if:
|
|
1089
|
-
_return:
|
|
1090
|
-
_switch:
|
|
1091
|
-
_throw:
|
|
1092
|
-
_try:
|
|
1093
|
-
_var:
|
|
1094
|
-
_const:
|
|
1095
|
-
_while:
|
|
1096
|
-
_with:
|
|
1097
|
-
_new:
|
|
1084
|
+
_else: E("else", w),
|
|
1085
|
+
_finally: E("finally"),
|
|
1086
|
+
_for: E("for", { isLoop: !0 }),
|
|
1087
|
+
_function: E("function", T),
|
|
1088
|
+
_if: E("if"),
|
|
1089
|
+
_return: E("return", w),
|
|
1090
|
+
_switch: E("switch"),
|
|
1091
|
+
_throw: E("throw", w),
|
|
1092
|
+
_try: E("try"),
|
|
1093
|
+
_var: E("var"),
|
|
1094
|
+
_const: E("const"),
|
|
1095
|
+
_while: E("while", { isLoop: !0 }),
|
|
1096
|
+
_with: E("with"),
|
|
1097
|
+
_new: E("new", {
|
|
1098
1098
|
beforeExpr: !0,
|
|
1099
1099
|
startsExpr: !0
|
|
1100
1100
|
}),
|
|
1101
|
-
_this:
|
|
1102
|
-
_super:
|
|
1103
|
-
_class:
|
|
1104
|
-
_extends:
|
|
1105
|
-
_export:
|
|
1106
|
-
_import:
|
|
1107
|
-
_null:
|
|
1108
|
-
_true:
|
|
1109
|
-
_false:
|
|
1110
|
-
_in:
|
|
1101
|
+
_this: E("this", T),
|
|
1102
|
+
_super: E("super", T),
|
|
1103
|
+
_class: E("class", T),
|
|
1104
|
+
_extends: E("extends", w),
|
|
1105
|
+
_export: E("export"),
|
|
1106
|
+
_import: E("import", T),
|
|
1107
|
+
_null: E("null", T),
|
|
1108
|
+
_true: E("true", T),
|
|
1109
|
+
_false: E("false", T),
|
|
1110
|
+
_in: E("in", {
|
|
1111
1111
|
beforeExpr: !0,
|
|
1112
1112
|
binop: 7
|
|
1113
1113
|
}),
|
|
1114
|
-
_instanceof:
|
|
1114
|
+
_instanceof: E("instanceof", {
|
|
1115
1115
|
beforeExpr: !0,
|
|
1116
1116
|
binop: 7
|
|
1117
1117
|
}),
|
|
1118
|
-
_typeof:
|
|
1118
|
+
_typeof: E("typeof", {
|
|
1119
1119
|
beforeExpr: !0,
|
|
1120
1120
|
prefix: !0,
|
|
1121
1121
|
startsExpr: !0
|
|
1122
1122
|
}),
|
|
1123
|
-
_void:
|
|
1123
|
+
_void: E("void", {
|
|
1124
1124
|
beforeExpr: !0,
|
|
1125
1125
|
prefix: !0,
|
|
1126
1126
|
startsExpr: !0
|
|
1127
1127
|
}),
|
|
1128
|
-
_delete:
|
|
1128
|
+
_delete: E("delete", {
|
|
1129
1129
|
beforeExpr: !0,
|
|
1130
1130
|
prefix: !0,
|
|
1131
1131
|
startsExpr: !0
|
|
1132
1132
|
})
|
|
1133
|
-
},
|
|
1134
|
-
function
|
|
1133
|
+
}, O = /\r\n?|\n|\u2028|\u2029/, ae = new RegExp(O.source, "g");
|
|
1134
|
+
function oe(e) {
|
|
1135
1135
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
1136
1136
|
}
|
|
1137
|
-
function
|
|
1137
|
+
function se(e, t, n) {
|
|
1138
1138
|
n === void 0 && (n = e.length);
|
|
1139
1139
|
for (var r = t; r < n; r++) {
|
|
1140
1140
|
var i = e.charCodeAt(r);
|
|
1141
|
-
if (
|
|
1141
|
+
if (oe(i)) return r < n - 1 && i === 13 && e.charCodeAt(r + 1) === 10 ? r + 2 : r + 1;
|
|
1142
1142
|
}
|
|
1143
1143
|
return -1;
|
|
1144
1144
|
}
|
|
1145
|
-
var
|
|
1146
|
-
return
|
|
1147
|
-
}),
|
|
1148
|
-
return
|
|
1149
|
-
}),
|
|
1150
|
-
function
|
|
1151
|
-
return
|
|
1145
|
+
var ce = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, k = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, le = Object.prototype, ue = le.hasOwnProperty, de = le.toString, fe = Object.hasOwn || (function(e, t) {
|
|
1146
|
+
return ue.call(e, t);
|
|
1147
|
+
}), pe = Array.isArray || (function(e) {
|
|
1148
|
+
return de.call(e) === "[object Array]";
|
|
1149
|
+
}), me = Object.create(null);
|
|
1150
|
+
function A(e) {
|
|
1151
|
+
return me[e] || (me[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
1152
1152
|
}
|
|
1153
|
-
function
|
|
1153
|
+
function he(e) {
|
|
1154
1154
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
1155
1155
|
}
|
|
1156
|
-
var
|
|
1156
|
+
var ge = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, _e = function(e, t) {
|
|
1157
1157
|
this.line = e, this.column = t;
|
|
1158
1158
|
};
|
|
1159
|
-
|
|
1160
|
-
return new
|
|
1159
|
+
_e.prototype.offset = function(e) {
|
|
1160
|
+
return new _e(this.line, this.column + e);
|
|
1161
1161
|
};
|
|
1162
|
-
var
|
|
1162
|
+
var ve = function(e, t, n) {
|
|
1163
1163
|
this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
1164
1164
|
};
|
|
1165
|
-
function
|
|
1165
|
+
function ye(e, t) {
|
|
1166
1166
|
for (var n = 1, r = 0;;) {
|
|
1167
|
-
var i =
|
|
1168
|
-
if (i < 0) return new
|
|
1167
|
+
var i = se(e, r, t);
|
|
1168
|
+
if (i < 0) return new _e(n, t - r);
|
|
1169
1169
|
++n, r = i;
|
|
1170
1170
|
}
|
|
1171
1171
|
}
|
|
1172
|
-
var
|
|
1172
|
+
var be = {
|
|
1173
1173
|
ecmaVersion: null,
|
|
1174
1174
|
sourceType: "script",
|
|
1175
1175
|
strict: !1,
|
|
@@ -1190,20 +1190,20 @@ var ye = {
|
|
|
1190
1190
|
sourceFile: null,
|
|
1191
1191
|
directSourceFile: null,
|
|
1192
1192
|
preserveParens: !1
|
|
1193
|
-
},
|
|
1194
|
-
function
|
|
1193
|
+
}, xe = !1;
|
|
1194
|
+
function Se(e) {
|
|
1195
1195
|
var t = {};
|
|
1196
|
-
for (var n in
|
|
1197
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
1196
|
+
for (var n in be) t[n] = e && fe(e, n) ? e[n] : be[n];
|
|
1197
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!xe && typeof console == "object" && console.warn && (xe = !0, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved ??= t.ecmaVersion < 5, (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), pe(t.onToken)) {
|
|
1198
1198
|
var r = t.onToken;
|
|
1199
1199
|
t.onToken = function(e) {
|
|
1200
1200
|
return r.push(e);
|
|
1201
1201
|
};
|
|
1202
1202
|
}
|
|
1203
|
-
if (
|
|
1203
|
+
if (pe(t.onComment) && (t.onComment = Ce(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
1204
1204
|
return t;
|
|
1205
1205
|
}
|
|
1206
|
-
function
|
|
1206
|
+
function Ce(e, t) {
|
|
1207
1207
|
return function(n, r, i, a, o, s) {
|
|
1208
1208
|
var c = {
|
|
1209
1209
|
type: n ? "Block" : "Line",
|
|
@@ -1211,19 +1211,19 @@ function Se(e, t) {
|
|
|
1211
1211
|
start: i,
|
|
1212
1212
|
end: a
|
|
1213
1213
|
};
|
|
1214
|
-
e.locations && (c.loc = new
|
|
1214
|
+
e.locations && (c.loc = new ve(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
1215
1215
|
};
|
|
1216
1216
|
}
|
|
1217
|
-
var
|
|
1217
|
+
var we = 1, Te = 2, Ee = 4, j = 8, De = 16, Oe = 32, ke = 64, M = 128, N = 256, P = 512, Ae = 1024, je = we | Te | N;
|
|
1218
1218
|
function F(e, t) {
|
|
1219
|
-
return
|
|
1219
|
+
return Te | (e ? Ee : 0) | (t ? j : 0);
|
|
1220
1220
|
}
|
|
1221
1221
|
var Me = 0, Ne = 1, Pe = 2, Fe = 3, Ie = 4, Le = 5, I = function(e, t, n) {
|
|
1222
|
-
this.options = e =
|
|
1222
|
+
this.options = e = Se(e), this.sourceFile = e.sourceFile, this.keywords = A(v[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
1223
1223
|
var r = "";
|
|
1224
|
-
e.allowReserved !== !0 && (r = _[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords =
|
|
1224
|
+
e.allowReserved !== !0 && (r = _[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = A(r);
|
|
1225
1225
|
var i = (r ? r + " " : "") + _.strict;
|
|
1226
|
-
this.reservedWordsStrict =
|
|
1226
|
+
this.reservedWordsStrict = A(i), this.reservedWordsStrictBind = A(i + " " + _.strictBind), this.input = String(t), this.containsEsc = !1, n ? (this.pos = n, this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(O).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = D.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? Te : we), this.regexpState = null, this.privateNameStack = [];
|
|
1227
1227
|
}, L = {
|
|
1228
1228
|
inFunction: { configurable: !0 },
|
|
1229
1229
|
inGenerator: { configurable: !0 },
|
|
@@ -1243,20 +1243,20 @@ I.prototype.parse = function() {
|
|
|
1243
1243
|
return e.parseTopLevel(t);
|
|
1244
1244
|
});
|
|
1245
1245
|
}, L.inFunction.get = function() {
|
|
1246
|
-
return (this.currentVarScope().flags &
|
|
1246
|
+
return (this.currentVarScope().flags & Te) > 0;
|
|
1247
1247
|
}, L.inGenerator.get = function() {
|
|
1248
|
-
return (this.currentVarScope().flags &
|
|
1248
|
+
return (this.currentVarScope().flags & j) > 0;
|
|
1249
1249
|
}, L.inAsync.get = function() {
|
|
1250
|
-
return (this.currentVarScope().flags &
|
|
1250
|
+
return (this.currentVarScope().flags & Ee) > 0;
|
|
1251
1251
|
}, L.canAwait.get = function() {
|
|
1252
1252
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1253
1253
|
var t = this.scopeStack[e].flags;
|
|
1254
1254
|
if (t & (N | P)) return !1;
|
|
1255
|
-
if (t &
|
|
1255
|
+
if (t & Te) return (t & Ee) > 0;
|
|
1256
1256
|
}
|
|
1257
1257
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
1258
1258
|
}, L.allowReturn.get = function() {
|
|
1259
|
-
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags &
|
|
1259
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & we);
|
|
1260
1260
|
}, L.allowSuper.get = function() {
|
|
1261
1261
|
return (this.currentThisScope().flags & ke) > 0 || this.options.allowSuperOutsideMethod;
|
|
1262
1262
|
}, L.allowDirectSuper.get = function() {
|
|
@@ -1266,12 +1266,12 @@ I.prototype.parse = function() {
|
|
|
1266
1266
|
}, L.allowNewDotTarget.get = function() {
|
|
1267
1267
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1268
1268
|
var t = this.scopeStack[e].flags;
|
|
1269
|
-
if (t & (N | P) || t &
|
|
1269
|
+
if (t & (N | P) || t & Te && !(t & De)) return !0;
|
|
1270
1270
|
}
|
|
1271
1271
|
return !1;
|
|
1272
1272
|
}, L.allowUsing.get = function() {
|
|
1273
1273
|
var e = this.currentScope().flags;
|
|
1274
|
-
return !(e & Ae || !this.inModule && e &
|
|
1274
|
+
return !(e & Ae || !this.inModule && e & we);
|
|
1275
1275
|
}, L.inClassStaticBlock.get = function() {
|
|
1276
1276
|
return (this.currentVarScope().flags & N) > 0;
|
|
1277
1277
|
}, I.extend = function() {
|
|
@@ -1290,20 +1290,20 @@ var R = I.prototype, z = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
|
1290
1290
|
R.strictDirective = function(e) {
|
|
1291
1291
|
if (this.options.ecmaVersion < 5) return !1;
|
|
1292
1292
|
for (;;) {
|
|
1293
|
-
|
|
1293
|
+
k.lastIndex = e, e += k.exec(this.input)[0].length;
|
|
1294
1294
|
var t = z.exec(this.input.slice(e));
|
|
1295
1295
|
if (!t) return !1;
|
|
1296
1296
|
if ((t[1] || t[2]) === "use strict") {
|
|
1297
|
-
|
|
1298
|
-
var n =
|
|
1299
|
-
return i === ";" || i === "}" ||
|
|
1297
|
+
k.lastIndex = e + t[0].length;
|
|
1298
|
+
var n = k.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
|
|
1299
|
+
return i === ";" || i === "}" || O.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
|
|
1300
1300
|
}
|
|
1301
|
-
e += t[0].length,
|
|
1301
|
+
e += t[0].length, k.lastIndex = e, e += k.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
1302
1302
|
}
|
|
1303
1303
|
}, R.eat = function(e) {
|
|
1304
1304
|
return this.type === e ? (this.next(), !0) : !1;
|
|
1305
1305
|
}, R.isContextual = function(e) {
|
|
1306
|
-
return this.type ===
|
|
1306
|
+
return this.type === D.name && this.value === e && !this.containsEsc;
|
|
1307
1307
|
}, R.eatContextual = function(e) {
|
|
1308
1308
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
1309
1309
|
}, R.catchStackOverflow = function(e) {
|
|
@@ -1316,11 +1316,11 @@ R.strictDirective = function(e) {
|
|
|
1316
1316
|
}, R.expectContextual = function(e) {
|
|
1317
1317
|
this.eatContextual(e) || this.unexpected();
|
|
1318
1318
|
}, R.canInsertSemicolon = function() {
|
|
1319
|
-
return this.type ===
|
|
1319
|
+
return this.type === D.eof || this.type === D.braceR || O.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1320
1320
|
}, R.insertSemicolon = function() {
|
|
1321
1321
|
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
1322
1322
|
}, R.semicolon = function() {
|
|
1323
|
-
!this.eat(
|
|
1323
|
+
!this.eat(D.semi) && !this.insertSemicolon() && this.unexpected();
|
|
1324
1324
|
}, R.afterTrailingComma = function(e, t) {
|
|
1325
1325
|
if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
1326
1326
|
}, R.expect = function(e) {
|
|
@@ -1350,7 +1350,7 @@ R.checkPatternErrors = function(e, t) {
|
|
|
1350
1350
|
var V = I.prototype;
|
|
1351
1351
|
V.parseTopLevel = function(e) {
|
|
1352
1352
|
var t = Object.create(null);
|
|
1353
|
-
for (e.body ||= []; this.type !==
|
|
1353
|
+
for (e.body ||= []; this.type !== D.eof;) {
|
|
1354
1354
|
var n = this.parseStatement(null, !0, t);
|
|
1355
1355
|
e.body.push(n);
|
|
1356
1356
|
}
|
|
@@ -1363,8 +1363,8 @@ V.parseTopLevel = function(e) {
|
|
|
1363
1363
|
var H = { kind: "loop" }, Re = { kind: "switch" };
|
|
1364
1364
|
V.isLet = function(e) {
|
|
1365
1365
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
1366
|
-
|
|
1367
|
-
var t =
|
|
1366
|
+
k.lastIndex = this.pos;
|
|
1367
|
+
var t = k.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
1368
1368
|
if (r === 91 || r === 92) return !0;
|
|
1369
1369
|
if (e) return !1;
|
|
1370
1370
|
if (r === 123) return !0;
|
|
@@ -1372,7 +1372,7 @@ V.isLet = function(e) {
|
|
|
1372
1372
|
var i = n;
|
|
1373
1373
|
do
|
|
1374
1374
|
n += r <= 65535 ? 1 : 2;
|
|
1375
|
-
while (
|
|
1375
|
+
while (re(r = this.fullCharCodeAt(n)));
|
|
1376
1376
|
if (r === 92) return !0;
|
|
1377
1377
|
var a = this.input.slice(i, n);
|
|
1378
1378
|
if (!y.test(a)) return !0;
|
|
@@ -1380,33 +1380,33 @@ V.isLet = function(e) {
|
|
|
1380
1380
|
return !1;
|
|
1381
1381
|
}, V.isAsyncFunction = function() {
|
|
1382
1382
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
1383
|
-
|
|
1384
|
-
var e =
|
|
1385
|
-
return !
|
|
1383
|
+
k.lastIndex = this.pos;
|
|
1384
|
+
var e = k.exec(this.input), t = this.pos + e[0].length, n;
|
|
1385
|
+
return !O.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(re(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
1386
1386
|
}, V.isUsingKeyword = function(e, t) {
|
|
1387
1387
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
1388
|
-
|
|
1389
|
-
var n =
|
|
1390
|
-
if (
|
|
1388
|
+
k.lastIndex = this.pos;
|
|
1389
|
+
var n = k.exec(this.input), r = this.pos + n[0].length;
|
|
1390
|
+
if (O.test(this.input.slice(this.pos, r))) return !1;
|
|
1391
1391
|
if (e) {
|
|
1392
1392
|
var i = r + 5, a;
|
|
1393
|
-
if (this.input.slice(r, i) !== "using" || i === this.input.length ||
|
|
1394
|
-
|
|
1395
|
-
var o =
|
|
1396
|
-
if (r = i + o[0].length, o &&
|
|
1393
|
+
if (this.input.slice(r, i) !== "using" || i === this.input.length || re(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
1394
|
+
k.lastIndex = i;
|
|
1395
|
+
var o = k.exec(this.input);
|
|
1396
|
+
if (r = i + o[0].length, o && O.test(this.input.slice(i, r))) return !1;
|
|
1397
1397
|
}
|
|
1398
1398
|
var s = this.fullCharCodeAt(r);
|
|
1399
1399
|
if (!x(s) && s !== 92) return !1;
|
|
1400
1400
|
var c = r;
|
|
1401
1401
|
do
|
|
1402
1402
|
r += s <= 65535 ? 1 : 2;
|
|
1403
|
-
while (
|
|
1403
|
+
while (re(s = this.fullCharCodeAt(r)));
|
|
1404
1404
|
if (s === 92) return !0;
|
|
1405
1405
|
var l = this.input.slice(c, r);
|
|
1406
1406
|
if (y.test(l)) return !1;
|
|
1407
1407
|
if (t && !e && l === "of") {
|
|
1408
|
-
|
|
1409
|
-
var u =
|
|
1408
|
+
k.lastIndex = r;
|
|
1409
|
+
var u = k.exec(this.input);
|
|
1410
1410
|
if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
1411
1411
|
}
|
|
1412
1412
|
return !0;
|
|
@@ -1416,43 +1416,43 @@ V.isLet = function(e) {
|
|
|
1416
1416
|
return this.isUsingKeyword(!1, e);
|
|
1417
1417
|
}, V.parseStatement = function(e, t, n) {
|
|
1418
1418
|
var r = this.type, i = this.startNode(), a;
|
|
1419
|
-
switch (this.isLet(e) && (r =
|
|
1420
|
-
case
|
|
1421
|
-
case
|
|
1422
|
-
case
|
|
1423
|
-
case
|
|
1424
|
-
case
|
|
1425
|
-
case
|
|
1426
|
-
case
|
|
1427
|
-
case
|
|
1428
|
-
case
|
|
1429
|
-
case
|
|
1430
|
-
case
|
|
1431
|
-
case
|
|
1432
|
-
case
|
|
1433
|
-
case
|
|
1434
|
-
case
|
|
1435
|
-
case
|
|
1436
|
-
case
|
|
1437
|
-
case
|
|
1438
|
-
case
|
|
1439
|
-
case
|
|
1440
|
-
if (this.options.ecmaVersion > 10 && r ===
|
|
1441
|
-
|
|
1442
|
-
var o =
|
|
1419
|
+
switch (this.isLet(e) && (r = D._var, a = "let"), r) {
|
|
1420
|
+
case D._break:
|
|
1421
|
+
case D._continue: return this.parseBreakContinueStatement(i, r.keyword);
|
|
1422
|
+
case D._debugger: return this.parseDebuggerStatement(i);
|
|
1423
|
+
case D._do: return this.parseDoStatement(i);
|
|
1424
|
+
case D._for: return this.parseForStatement(i);
|
|
1425
|
+
case D._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(i, !1, !e);
|
|
1426
|
+
case D._class: return e && this.unexpected(), this.parseClass(i, !0);
|
|
1427
|
+
case D._if: return this.parseIfStatement(i);
|
|
1428
|
+
case D._return: return this.parseReturnStatement(i);
|
|
1429
|
+
case D._switch: return this.parseSwitchStatement(i);
|
|
1430
|
+
case D._throw: return this.parseThrowStatement(i);
|
|
1431
|
+
case D._try: return this.parseTryStatement(i);
|
|
1432
|
+
case D._const:
|
|
1433
|
+
case D._var: return a ||= this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(i, a);
|
|
1434
|
+
case D._while: return this.parseWhileStatement(i);
|
|
1435
|
+
case D._with: return this.parseWithStatement(i);
|
|
1436
|
+
case D.braceL: return this.parseBlock(!0, i);
|
|
1437
|
+
case D.semi: return this.parseEmptyStatement(i);
|
|
1438
|
+
case D._export:
|
|
1439
|
+
case D._import:
|
|
1440
|
+
if (this.options.ecmaVersion > 10 && r === D._import) {
|
|
1441
|
+
k.lastIndex = this.pos;
|
|
1442
|
+
var o = k.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
|
|
1443
1443
|
if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
|
|
1444
1444
|
}
|
|
1445
|
-
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r ===
|
|
1445
|
+
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === D._import ? this.parseImport(i) : this.parseExport(i, n);
|
|
1446
1446
|
default:
|
|
1447
1447
|
if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
|
|
1448
1448
|
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
1449
1449
|
if (l) return this.allowUsing || this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"), e && this.raise(this.start, "Using declaration is not allowed in single-statement positions"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(i, !1, l), this.semicolon(), this.finishNode(i, "VariableDeclaration");
|
|
1450
1450
|
var u = this.value, d = this.parseExpression();
|
|
1451
|
-
return r ===
|
|
1451
|
+
return r === D.name && d.type === "Identifier" && this.eat(D.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
1452
1452
|
}
|
|
1453
1453
|
}, V.parseBreakContinueStatement = function(e, t) {
|
|
1454
1454
|
var n = t === "break";
|
|
1455
|
-
this.next(), this.eat(
|
|
1455
|
+
this.next(), this.eat(D.semi) || this.insertSemicolon() ? e.label = null : this.type === D.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
|
|
1456
1456
|
for (var r = 0; r < this.labels.length; ++r) {
|
|
1457
1457
|
var i = this.labels[r];
|
|
1458
1458
|
if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
|
|
@@ -1461,13 +1461,13 @@ V.isLet = function(e) {
|
|
|
1461
1461
|
}, V.parseDebuggerStatement = function(e) {
|
|
1462
1462
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
1463
1463
|
}, V.parseDoStatement = function(e) {
|
|
1464
|
-
return this.next(), this.labels.push(H), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(
|
|
1464
|
+
return this.next(), this.labels.push(H), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(D._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(D.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
1465
1465
|
}, V.parseForStatement = function(e) {
|
|
1466
1466
|
this.next();
|
|
1467
1467
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
1468
|
-
if (this.labels.push(H), this.enterScope(0), this.expect(
|
|
1468
|
+
if (this.labels.push(H), this.enterScope(0), this.expect(D.parenL), this.type === D.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
1469
1469
|
var n = this.isLet();
|
|
1470
|
-
if (this.type ===
|
|
1470
|
+
if (this.type === D._var || this.type === D._const || n) {
|
|
1471
1471
|
var r = this.startNode(), i = n ? "let" : this.value;
|
|
1472
1472
|
return this.next(), this.parseVar(r, !0, i), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
1473
1473
|
}
|
|
@@ -1477,35 +1477,35 @@ V.isLet = function(e) {
|
|
|
1477
1477
|
return this.next(), s === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.parseVar(c, !0, s), this.finishNode(c, "VariableDeclaration"), this.parseForAfterInit(e, c, t);
|
|
1478
1478
|
}
|
|
1479
1479
|
var l = this.containsEsc, u = new B(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
1480
|
-
return this.type ===
|
|
1480
|
+
return this.type === D._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === D._in && this.unexpected(t), e.await = !0) : o && this.options.ecmaVersion >= 8 && (f.start === d && !l && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && o && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, u), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(u, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
|
|
1481
1481
|
}, V.parseForAfterInit = function(e, t, n) {
|
|
1482
|
-
return (this.type ===
|
|
1482
|
+
return (this.type === D._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === D._in ? ((t.kind === "using" || t.kind === "await using") && !t.declarations[0].init && this.raise(this.start, "Using declaration is not allowed in for-in loops"), this.options.ecmaVersion >= 9 && n > -1 && this.unexpected(n)) : this.options.ecmaVersion >= 9 && (e.await = n > -1), this.parseForIn(e, t)) : (n > -1 && this.unexpected(n), this.parseFor(e, t));
|
|
1483
1483
|
}, V.parseFunctionStatement = function(e, t, n) {
|
|
1484
1484
|
return this.next(), this.parseFunction(e, Be | (n ? 0 : Ve), !1, t);
|
|
1485
1485
|
}, V.parseIfStatement = function(e) {
|
|
1486
|
-
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(
|
|
1486
|
+
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(D._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
1487
1487
|
}, V.parseReturnStatement = function(e) {
|
|
1488
|
-
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(
|
|
1488
|
+
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(D.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
1489
1489
|
}, V.parseSwitchStatement = function(e) {
|
|
1490
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(
|
|
1491
|
-
for (var t, n = !1; this.type !==
|
|
1492
|
-
var r = this.type ===
|
|
1493
|
-
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(
|
|
1490
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(D.braceL), this.labels.push(Re), this.enterScope(Ae);
|
|
1491
|
+
for (var t, n = !1; this.type !== D.braceR;) if (this.type === D._case || this.type === D._default) {
|
|
1492
|
+
var r = this.type === D._case;
|
|
1493
|
+
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(D.colon);
|
|
1494
1494
|
} else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
1495
1495
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
1496
1496
|
}, V.parseThrowStatement = function(e) {
|
|
1497
|
-
return this.next(),
|
|
1497
|
+
return this.next(), O.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
|
|
1498
1498
|
};
|
|
1499
1499
|
var ze = [];
|
|
1500
1500
|
V.parseCatchClauseParam = function() {
|
|
1501
1501
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
1502
|
-
return this.enterScope(t ? Oe : 0), this.checkLValPattern(e, t ? Ie : Pe), this.expect(
|
|
1502
|
+
return this.enterScope(t ? Oe : 0), this.checkLValPattern(e, t ? Ie : Pe), this.expect(D.parenR), e;
|
|
1503
1503
|
}, V.parseTryStatement = function(e) {
|
|
1504
|
-
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type ===
|
|
1504
|
+
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === D._catch) {
|
|
1505
1505
|
var t = this.startNode();
|
|
1506
|
-
this.next(), this.eat(
|
|
1506
|
+
this.next(), this.eat(D.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
1507
1507
|
}
|
|
1508
|
-
return e.finalizer = this.eat(
|
|
1508
|
+
return e.finalizer = this.eat(D._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
1509
1509
|
}, V.parseVarStatement = function(e, t, n) {
|
|
1510
1510
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
1511
1511
|
}, V.parseWhileStatement = function(e) {
|
|
@@ -1516,7 +1516,7 @@ V.parseCatchClauseParam = function() {
|
|
|
1516
1516
|
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
1517
1517
|
}, V.parseLabeledStatement = function(e, t, n, r) {
|
|
1518
1518
|
for (var i = 0, a = this.labels; i < a.length; i += 1) a[i].name === t && this.raise(n.start, "Label '" + t + "' is already declared");
|
|
1519
|
-
for (var o = this.type.isLoop ? "loop" : this.type ===
|
|
1519
|
+
for (var o = this.type.isLoop ? "loop" : this.type === D._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
|
|
1520
1520
|
var c = this.labels[s];
|
|
1521
1521
|
if (c.statementStart === e.start) c.statementStart = this.start, c.kind = o;
|
|
1522
1522
|
else break;
|
|
@@ -1529,20 +1529,20 @@ V.parseCatchClauseParam = function() {
|
|
|
1529
1529
|
}, V.parseExpressionStatement = function(e, t) {
|
|
1530
1530
|
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
1531
1531
|
}, V.parseBlock = function(e, t, n) {
|
|
1532
|
-
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(
|
|
1532
|
+
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(D.braceL), e && this.enterScope(0); this.type !== D.braceR;) {
|
|
1533
1533
|
var r = this.parseStatement(null);
|
|
1534
1534
|
t.body.push(r);
|
|
1535
1535
|
}
|
|
1536
1536
|
return n && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
1537
1537
|
}, V.parseFor = function(e, t) {
|
|
1538
|
-
return e.init = t, this.expect(
|
|
1538
|
+
return e.init = t, this.expect(D.semi), e.test = this.type === D.semi ? null : this.parseExpression(), this.expect(D.semi), e.update = this.type === D.parenR ? null : this.parseExpression(), this.expect(D.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
1539
1539
|
}, V.parseForIn = function(e, t) {
|
|
1540
|
-
var n = this.type ===
|
|
1541
|
-
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(
|
|
1540
|
+
var n = this.type === D._in;
|
|
1541
|
+
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(D.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
|
|
1542
1542
|
}, V.parseVar = function(e, t, n, r) {
|
|
1543
1543
|
for (e.declarations = [], e.kind = n;;) {
|
|
1544
1544
|
var i = this.startNode();
|
|
1545
|
-
if (this.parseVarId(i, n), this.eat(
|
|
1545
|
+
if (this.parseVarId(i, n), this.eat(D.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === D._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== D._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && !(t && (this.type === D._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, e.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(D.comma)) break;
|
|
1546
1546
|
}
|
|
1547
1547
|
return e;
|
|
1548
1548
|
}, V.parseVarId = function(e, t) {
|
|
@@ -1550,60 +1550,60 @@ V.parseCatchClauseParam = function() {
|
|
|
1550
1550
|
};
|
|
1551
1551
|
var Be = 1, Ve = 2, He = 4;
|
|
1552
1552
|
V.parseFunction = function(e, t, n, r, i) {
|
|
1553
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type ===
|
|
1553
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === D.star && t & Ve && this.unexpected(), e.generator = this.eat(D.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & Be && (e.id = t & He && this.type !== D.name ? null : this.parseIdent(), e.id && !(t & Ve) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Ne : Pe : Fe));
|
|
1554
1554
|
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
1555
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(F(e.async, e.generator)), t & Be || (e.id = this.type ===
|
|
1555
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(F(e.async, e.generator)), t & Be || (e.id = this.type === D.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, n, !1, i), this.yieldPos = a, this.awaitPos = o, this.awaitIdentPos = s, this.finishNode(e, t & Be ? "FunctionDeclaration" : "FunctionExpression");
|
|
1556
1556
|
}, V.parseFunctionParams = function(e) {
|
|
1557
|
-
this.expect(
|
|
1557
|
+
this.expect(D.parenL), e.params = this.parseBindingList(D.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
1558
1558
|
}, V.parseClass = function(e, t) {
|
|
1559
1559
|
this.next();
|
|
1560
1560
|
var n = this.strict;
|
|
1561
1561
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
1562
1562
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
1563
|
-
for (i.body = [], this.expect(
|
|
1563
|
+
for (i.body = [], this.expect(D.braceL); this.type !== D.braceR;) {
|
|
1564
1564
|
var o = this.parseClassElement(e.superClass !== null);
|
|
1565
1565
|
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" && Ue(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
1566
1566
|
}
|
|
1567
1567
|
return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
1568
1568
|
}, V.parseClassElement = function(e) {
|
|
1569
|
-
if (this.eat(
|
|
1569
|
+
if (this.eat(D.semi)) return null;
|
|
1570
1570
|
var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
|
|
1571
1571
|
if (this.eatContextual("static")) {
|
|
1572
|
-
if (t >= 13 && this.eat(
|
|
1573
|
-
this.isClassElementNameStart() || this.type ===
|
|
1572
|
+
if (t >= 13 && this.eat(D.braceL)) return this.parseClassStaticBlock(n), n;
|
|
1573
|
+
this.isClassElementNameStart() || this.type === D.star ? s = !0 : r = "static";
|
|
1574
1574
|
}
|
|
1575
|
-
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type ===
|
|
1575
|
+
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === D.star) && !this.canInsertSemicolon() ? a = !0 : r = "async"), !r && (t >= 9 || !a) && this.eat(D.star) && (i = !0), !r && !a && !i) {
|
|
1576
1576
|
var c = this.value;
|
|
1577
1577
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
1578
1578
|
}
|
|
1579
|
-
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type ===
|
|
1579
|
+
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type === D.parenL || o !== "method" || i || a) {
|
|
1580
1580
|
var l = !n.static && We(n, "constructor"), u = l && e;
|
|
1581
1581
|
l && o !== "method" && this.raise(n.key.start, "Constructor can't have get/set modifier"), n.kind = l ? "constructor" : o, this.parseClassMethod(n, i, a, u);
|
|
1582
1582
|
} else this.parseClassField(n);
|
|
1583
1583
|
return n;
|
|
1584
1584
|
}, V.isClassElementNameStart = function() {
|
|
1585
|
-
return this.type ===
|
|
1585
|
+
return this.type === D.name || this.type === D.privateId || this.type === D.num || this.type === D.string || this.type === D.bracketL || this.type.keyword;
|
|
1586
1586
|
}, V.parseClassElementName = function(e) {
|
|
1587
|
-
this.type ===
|
|
1587
|
+
this.type === D.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
|
|
1588
1588
|
}, V.parseClassMethod = function(e, t, n, r) {
|
|
1589
1589
|
var i = e.key;
|
|
1590
1590
|
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static && We(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
1591
1591
|
var a = e.value = this.parseMethod(t, n, r);
|
|
1592
1592
|
return e.kind === "get" && a.params.length !== 0 && this.raiseRecoverable(a.start, "getter should have no params"), e.kind === "set" && a.params.length !== 1 && this.raiseRecoverable(a.start, "setter should have exactly one param"), e.kind === "set" && a.params[0].type === "RestElement" && this.raiseRecoverable(a.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
1593
1593
|
}, V.parseClassField = function(e) {
|
|
1594
|
-
return We(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && We(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(
|
|
1594
|
+
return We(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && We(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(D.eq) ? (this.enterScope(P | ke), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
1595
1595
|
}, V.parseClassStaticBlock = function(e) {
|
|
1596
1596
|
e.body = [];
|
|
1597
1597
|
var t = this.labels;
|
|
1598
|
-
for (this.labels = [], this.enterScope(N | ke); this.type !==
|
|
1598
|
+
for (this.labels = [], this.enterScope(N | ke); this.type !== D.braceR;) {
|
|
1599
1599
|
var n = this.parseStatement(null);
|
|
1600
1600
|
e.body.push(n);
|
|
1601
1601
|
}
|
|
1602
1602
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
1603
1603
|
}, V.parseClassId = function(e, t) {
|
|
1604
|
-
this.type ===
|
|
1604
|
+
this.type === D.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, Pe, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
1605
1605
|
}, V.parseClassSuper = function(e) {
|
|
1606
|
-
e.superClass = this.eat(
|
|
1606
|
+
e.superClass = this.eat(D._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
1607
1607
|
}, V.enterClassBody = function() {
|
|
1608
1608
|
var e = {
|
|
1609
1609
|
declared: Object.create(null),
|
|
@@ -1614,7 +1614,7 @@ V.parseFunction = function(e, t, n, r, i) {
|
|
|
1614
1614
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
1615
1615
|
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
1616
1616
|
var o = n[a];
|
|
1617
|
-
|
|
1617
|
+
fe(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
1618
1618
|
}
|
|
1619
1619
|
};
|
|
1620
1620
|
function Ue(e, t) {
|
|
@@ -1626,13 +1626,13 @@ function We(e, t) {
|
|
|
1626
1626
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
1627
1627
|
}
|
|
1628
1628
|
V.parseExportAllDeclaration = function(e, t) {
|
|
1629
|
-
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !==
|
|
1629
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== D.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
1630
1630
|
}, V.parseExport = function(e, t) {
|
|
1631
|
-
if (this.next(), this.eat(
|
|
1632
|
-
if (this.eat(
|
|
1631
|
+
if (this.next(), this.eat(D.star)) return this.parseExportAllDeclaration(e, t);
|
|
1632
|
+
if (this.eat(D._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
1633
1633
|
if (this.shouldParseExportStatement()) e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
1634
1634
|
else {
|
|
1635
|
-
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !==
|
|
1635
|
+
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== D.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
1636
1636
|
else {
|
|
1637
1637
|
for (var n = 0, r = e.specifiers; n < r.length; n += 1) {
|
|
1638
1638
|
var i = r[n];
|
|
@@ -1647,10 +1647,10 @@ V.parseExportAllDeclaration = function(e, t) {
|
|
|
1647
1647
|
return this.parseStatement(null);
|
|
1648
1648
|
}, V.parseExportDefaultDeclaration = function() {
|
|
1649
1649
|
var e;
|
|
1650
|
-
if (this.type ===
|
|
1650
|
+
if (this.type === D._function || (e = this.isAsyncFunction())) {
|
|
1651
1651
|
var t = this.startNode();
|
|
1652
1652
|
return this.next(), e && this.next(), this.parseFunction(t, Be | He, !1, e);
|
|
1653
|
-
} else if (this.type ===
|
|
1653
|
+
} else if (this.type === D._class) {
|
|
1654
1654
|
var n = this.startNode();
|
|
1655
1655
|
return this.parseClass(n, "nullableID");
|
|
1656
1656
|
} else {
|
|
@@ -1658,7 +1658,7 @@ V.parseExportAllDeclaration = function(e, t) {
|
|
|
1658
1658
|
return this.semicolon(), r;
|
|
1659
1659
|
}
|
|
1660
1660
|
}, V.checkExport = function(e, t, n) {
|
|
1661
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
1661
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), fe(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
1662
1662
|
}, V.checkPatternExport = function(e, t) {
|
|
1663
1663
|
var n = t.type;
|
|
1664
1664
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
@@ -1683,14 +1683,14 @@ V.parseExportAllDeclaration = function(e, t) {
|
|
|
1683
1683
|
return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(e, t.exported, t.exported.start), this.finishNode(t, "ExportSpecifier");
|
|
1684
1684
|
}, V.parseExportSpecifiers = function(e) {
|
|
1685
1685
|
var t = [], n = !0;
|
|
1686
|
-
for (this.expect(
|
|
1686
|
+
for (this.expect(D.braceL); !this.eat(D.braceR);) {
|
|
1687
1687
|
if (n) n = !1;
|
|
1688
|
-
else if (this.expect(
|
|
1688
|
+
else if (this.expect(D.comma), this.afterTrailingComma(D.braceR)) break;
|
|
1689
1689
|
t.push(this.parseExportSpecifier(e));
|
|
1690
1690
|
}
|
|
1691
1691
|
return t;
|
|
1692
1692
|
}, V.parseImport = function(e) {
|
|
1693
|
-
return this.next(), this.type ===
|
|
1693
|
+
return this.next(), this.type === D.string ? (e.specifiers = ze, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === D.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
1694
1694
|
}, V.parseImportSpecifier = function() {
|
|
1695
1695
|
var e = this.startNode();
|
|
1696
1696
|
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, Pe), this.finishNode(e, "ImportSpecifier");
|
|
@@ -1702,32 +1702,32 @@ V.parseExportAllDeclaration = function(e, t) {
|
|
|
1702
1702
|
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, Pe), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
1703
1703
|
}, V.parseImportSpecifiers = function() {
|
|
1704
1704
|
var e = [], t = !0;
|
|
1705
|
-
if (this.type ===
|
|
1706
|
-
if (this.type ===
|
|
1707
|
-
for (this.expect(
|
|
1705
|
+
if (this.type === D.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(D.comma))) return e;
|
|
1706
|
+
if (this.type === D.star) return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
1707
|
+
for (this.expect(D.braceL); !this.eat(D.braceR);) {
|
|
1708
1708
|
if (t) t = !1;
|
|
1709
|
-
else if (this.expect(
|
|
1709
|
+
else if (this.expect(D.comma), this.afterTrailingComma(D.braceR)) break;
|
|
1710
1710
|
e.push(this.parseImportSpecifier());
|
|
1711
1711
|
}
|
|
1712
1712
|
return e;
|
|
1713
1713
|
}, V.parseWithClause = function() {
|
|
1714
1714
|
var e = [];
|
|
1715
|
-
if (!this.eat(
|
|
1716
|
-
this.expect(
|
|
1717
|
-
for (var t = {}, n = !0; !this.eat(
|
|
1715
|
+
if (!this.eat(D._with)) return e;
|
|
1716
|
+
this.expect(D.braceL);
|
|
1717
|
+
for (var t = {}, n = !0; !this.eat(D.braceR);) {
|
|
1718
1718
|
if (n) n = !1;
|
|
1719
|
-
else if (this.expect(
|
|
1719
|
+
else if (this.expect(D.comma), this.afterTrailingComma(D.braceR)) break;
|
|
1720
1720
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
1721
|
-
|
|
1721
|
+
fe(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
1722
1722
|
}
|
|
1723
1723
|
return e;
|
|
1724
1724
|
}, V.parseImportAttribute = function() {
|
|
1725
1725
|
var e = this.startNode();
|
|
1726
|
-
return e.key = this.type ===
|
|
1726
|
+
return e.key = this.type === D.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(D.colon), this.type !== D.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
1727
1727
|
}, V.parseModuleExportName = function() {
|
|
1728
|
-
if (this.options.ecmaVersion >= 13 && this.type ===
|
|
1728
|
+
if (this.options.ecmaVersion >= 13 && this.type === D.string) {
|
|
1729
1729
|
var e = this.parseLiteral(this.value);
|
|
1730
|
-
return
|
|
1730
|
+
return ge.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
1731
1731
|
}
|
|
1732
1732
|
return this.parseIdent(!0);
|
|
1733
1733
|
}, V.adaptDirectivePrologue = function(e) {
|
|
@@ -1790,21 +1790,21 @@ U.toAssignable = function(e, t, n) {
|
|
|
1790
1790
|
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
1791
1791
|
}, U.parseRestBinding = function() {
|
|
1792
1792
|
var e = this.startNode();
|
|
1793
|
-
return this.next(), this.options.ecmaVersion === 6 && this.type !==
|
|
1793
|
+
return this.next(), this.options.ecmaVersion === 6 && this.type !== D.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
1794
1794
|
}, U.parseBindingAtom = function() {
|
|
1795
1795
|
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
1796
|
-
case
|
|
1796
|
+
case D.bracketL:
|
|
1797
1797
|
var e = this.startNode();
|
|
1798
|
-
return this.next(), e.elements = this.parseBindingList(
|
|
1799
|
-
case
|
|
1798
|
+
return this.next(), e.elements = this.parseBindingList(D.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
1799
|
+
case D.braceL: return this.parseObj(!0);
|
|
1800
1800
|
}
|
|
1801
1801
|
return this.parseIdent();
|
|
1802
1802
|
}, U.parseBindingList = function(e, t, n, r) {
|
|
1803
|
-
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(
|
|
1803
|
+
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(D.comma), t && this.type === D.comma) i.push(null);
|
|
1804
1804
|
else if (n && this.afterTrailingComma(e)) break;
|
|
1805
|
-
else if (this.type ===
|
|
1805
|
+
else if (this.type === D.ellipsis) {
|
|
1806
1806
|
var o = this.parseRestBinding();
|
|
1807
|
-
this.parseBindingListItem(o), i.push(o), this.type ===
|
|
1807
|
+
this.parseBindingListItem(o), i.push(o), this.type === D.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
1808
1808
|
break;
|
|
1809
1809
|
} else i.push(this.parseAssignableListItem(r));
|
|
1810
1810
|
return i;
|
|
@@ -1814,7 +1814,7 @@ U.toAssignable = function(e, t, n) {
|
|
|
1814
1814
|
}, U.parseBindingListItem = function(e) {
|
|
1815
1815
|
return e;
|
|
1816
1816
|
}, U.parseMaybeDefault = function(e, t, n) {
|
|
1817
|
-
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(
|
|
1817
|
+
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(D.eq)) return n;
|
|
1818
1818
|
var r = this.startNodeAt(e, t);
|
|
1819
1819
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
1820
1820
|
}, U.checkLValSimple = function(e, t, n) {
|
|
@@ -1822,7 +1822,7 @@ U.toAssignable = function(e, t, n) {
|
|
|
1822
1822
|
var r = t !== Me;
|
|
1823
1823
|
switch (e.type) {
|
|
1824
1824
|
case "Identifier":
|
|
1825
|
-
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === Pe && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (
|
|
1825
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === Pe && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (fe(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== Le && this.declareName(e.name, t, e.start));
|
|
1826
1826
|
break;
|
|
1827
1827
|
case "ChainExpression":
|
|
1828
1828
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -1885,7 +1885,7 @@ Ge.initialContext = function() {
|
|
|
1885
1885
|
return this.context[this.context.length - 1];
|
|
1886
1886
|
}, Ge.braceIsBlock = function(e) {
|
|
1887
1887
|
var t = this.curContext();
|
|
1888
|
-
return t === G.f_expr || t === G.f_stat ? !0 : e ===
|
|
1888
|
+
return t === G.f_expr || t === G.f_stat ? !0 : e === D.colon && (t === G.b_stat || t === G.b_expr) ? !t.isExpr : e === D._return || e === D.name && this.exprAllowed ? O.test(this.input.slice(this.lastTokEnd, this.start)) : e === D._else || e === D.semi || e === D.eof || e === D.parenR || e === D.arrow ? !0 : e === D.braceL ? t === G.b_stat : e === D._var || e === D._const || e === D.name ? !1 : !this.exprAllowed;
|
|
1889
1889
|
}, Ge.inGeneratorContext = function() {
|
|
1890
1890
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
1891
1891
|
var t = this.context[e];
|
|
@@ -1894,38 +1894,38 @@ Ge.initialContext = function() {
|
|
|
1894
1894
|
return !1;
|
|
1895
1895
|
}, Ge.updateContext = function(e) {
|
|
1896
1896
|
var t, n = this.type;
|
|
1897
|
-
n.keyword && e ===
|
|
1897
|
+
n.keyword && e === D.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
1898
1898
|
}, Ge.overrideContext = function(e) {
|
|
1899
1899
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
1900
|
-
},
|
|
1900
|
+
}, D.parenR.updateContext = D.braceR.updateContext = function() {
|
|
1901
1901
|
if (this.context.length === 1) {
|
|
1902
1902
|
this.exprAllowed = !0;
|
|
1903
1903
|
return;
|
|
1904
1904
|
}
|
|
1905
1905
|
var e = this.context.pop();
|
|
1906
1906
|
e === G.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
1907
|
-
},
|
|
1907
|
+
}, D.braceL.updateContext = function(e) {
|
|
1908
1908
|
this.context.push(this.braceIsBlock(e) ? G.b_stat : G.b_expr), this.exprAllowed = !0;
|
|
1909
|
-
},
|
|
1909
|
+
}, D.dollarBraceL.updateContext = function() {
|
|
1910
1910
|
this.context.push(G.b_tmpl), this.exprAllowed = !0;
|
|
1911
|
-
},
|
|
1912
|
-
var t = e ===
|
|
1911
|
+
}, D.parenL.updateContext = function(e) {
|
|
1912
|
+
var t = e === D._if || e === D._for || e === D._with || e === D._while;
|
|
1913
1913
|
this.context.push(t ? G.p_stat : G.p_expr), this.exprAllowed = !0;
|
|
1914
|
-
},
|
|
1915
|
-
e.beforeExpr && e !==
|
|
1916
|
-
},
|
|
1914
|
+
}, D.incDec.updateContext = function() {}, D._function.updateContext = D._class.updateContext = function(e) {
|
|
1915
|
+
e.beforeExpr && e !== D._else && !(e === D.semi && this.curContext() !== G.p_stat) && !(e === D._return && O.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === D.colon || e === D.braceL) && this.curContext() === G.b_stat) ? this.context.push(G.f_expr) : this.context.push(G.f_stat), this.exprAllowed = !1;
|
|
1916
|
+
}, D.colon.updateContext = function() {
|
|
1917
1917
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
1918
|
-
},
|
|
1918
|
+
}, D.backQuote.updateContext = function() {
|
|
1919
1919
|
this.curContext() === G.q_tmpl ? this.context.pop() : this.context.push(G.q_tmpl), this.exprAllowed = !1;
|
|
1920
|
-
},
|
|
1921
|
-
if (e ===
|
|
1920
|
+
}, D.star.updateContext = function(e) {
|
|
1921
|
+
if (e === D._function) {
|
|
1922
1922
|
var t = this.context.length - 1;
|
|
1923
1923
|
this.context[t] === G.f_expr ? this.context[t] = G.f_expr_gen : this.context[t] = G.f_gen;
|
|
1924
1924
|
}
|
|
1925
1925
|
this.exprAllowed = !0;
|
|
1926
|
-
},
|
|
1926
|
+
}, D.name.updateContext = function(e) {
|
|
1927
1927
|
var t = !1;
|
|
1928
|
-
this.options.ecmaVersion >= 6 && e !==
|
|
1928
|
+
this.options.ecmaVersion >= 6 && e !== D.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
1929
1929
|
};
|
|
1930
1930
|
var K = I.prototype;
|
|
1931
1931
|
K.checkPropClash = function(e, t, n) {
|
|
@@ -1957,9 +1957,9 @@ K.checkPropClash = function(e, t, n) {
|
|
|
1957
1957
|
var n = this;
|
|
1958
1958
|
return this.catchStackOverflow(function() {
|
|
1959
1959
|
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
1960
|
-
if (n.type ===
|
|
1960
|
+
if (n.type === D.comma) {
|
|
1961
1961
|
var o = n.startNodeAt(r, i);
|
|
1962
|
-
for (o.expressions = [a]; n.eat(
|
|
1962
|
+
for (o.expressions = [a]; n.eat(D.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
|
|
1963
1963
|
return n.finishNode(o, "SequenceExpression");
|
|
1964
1964
|
}
|
|
1965
1965
|
return a;
|
|
@@ -1972,19 +1972,19 @@ K.checkPropClash = function(e, t, n) {
|
|
|
1972
1972
|
var r = !1, i = -1, a = -1, o = -1;
|
|
1973
1973
|
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new B(), r = !0);
|
|
1974
1974
|
var s = this.start, c = this.startLoc;
|
|
1975
|
-
(this.type ===
|
|
1975
|
+
(this.type === D.parenL || this.type === D.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
1976
1976
|
var l = this.parseMaybeConditional(e, t);
|
|
1977
1977
|
if (n && (l = n.call(this, l, s, c)), this.type.isAssign) {
|
|
1978
1978
|
var u = this.startNodeAt(s, c);
|
|
1979
|
-
return u.operator = this.value, this.type ===
|
|
1979
|
+
return u.operator = this.value, this.type === D.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === D.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), u.left = l, this.next(), u.right = this.parseMaybeAssign(e), o > -1 && (t.doubleProto = o), this.finishNode(u, "AssignmentExpression");
|
|
1980
1980
|
} else r && this.checkExpressionErrors(t, !0);
|
|
1981
1981
|
return i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
1982
1982
|
}, K.parseMaybeConditional = function(e, t) {
|
|
1983
1983
|
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
1984
1984
|
if (this.checkExpressionErrors(t)) return i;
|
|
1985
|
-
if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(
|
|
1985
|
+
if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(D.question)) {
|
|
1986
1986
|
var a = this.startNodeAt(n, r);
|
|
1987
|
-
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(
|
|
1987
|
+
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(D.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
1988
1988
|
}
|
|
1989
1989
|
return i;
|
|
1990
1990
|
}, K.parseExprOps = function(e, t) {
|
|
@@ -1992,13 +1992,13 @@ K.checkPropClash = function(e, t, n) {
|
|
|
1992
1992
|
return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
|
|
1993
1993
|
}, K.parseExprOp = function(e, t, n, r, i) {
|
|
1994
1994
|
var a = this.type.binop;
|
|
1995
|
-
if (a != null && (!i || this.type !==
|
|
1996
|
-
var o = this.type ===
|
|
1997
|
-
s && (a =
|
|
1995
|
+
if (a != null && (!i || this.type !== D._in) && a > r) {
|
|
1996
|
+
var o = this.type === D.logicalOR || this.type === D.logicalAND, s = this.type === D.coalesce;
|
|
1997
|
+
s && (a = D.logicalAND.binop);
|
|
1998
1998
|
var c = this.value;
|
|
1999
1999
|
this.next();
|
|
2000
2000
|
var l = this.start, u = this.startLoc, d = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, i), l, u, a, i), f = this.buildBinary(t, n, e, d, c, o || s);
|
|
2001
|
-
return (o && this.type ===
|
|
2001
|
+
return (o && this.type === D.coalesce || s && (this.type === D.logicalOR || this.type === D.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(f, t, n, r, i);
|
|
2002
2002
|
}
|
|
2003
2003
|
return e;
|
|
2004
2004
|
}, K.buildBinary = function(e, t, n, r, i, a) {
|
|
@@ -2009,9 +2009,9 @@ K.checkPropClash = function(e, t, n) {
|
|
|
2009
2009
|
var i = this.start, a = this.startLoc, o;
|
|
2010
2010
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
2011
2011
|
else if (this.type.prefix) {
|
|
2012
|
-
var s = this.startNode(), c = this.type ===
|
|
2012
|
+
var s = this.startNode(), c = this.type === D.incDec;
|
|
2013
2013
|
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" && Ke(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && qe(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
|
|
2014
|
-
} else if (!t && this.type ===
|
|
2014
|
+
} else if (!t && this.type === D.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== D._in && this.unexpected();
|
|
2015
2015
|
else {
|
|
2016
2016
|
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
2017
2017
|
for (; this.type.postfix && !this.canInsertSemicolon();) {
|
|
@@ -2019,7 +2019,7 @@ K.checkPropClash = function(e, t, n) {
|
|
|
2019
2019
|
l.operator = this.value, l.prefix = !1, l.argument = o, this.checkLValSimple(o), this.next(), o = this.finishNode(l, "UpdateExpression");
|
|
2020
2020
|
}
|
|
2021
2021
|
}
|
|
2022
|
-
if (!n && this.eat(
|
|
2022
|
+
if (!n && this.eat(D.starstar)) if (t) this.unexpected(this.lastTokStart);
|
|
2023
2023
|
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
2024
2024
|
else return o;
|
|
2025
2025
|
};
|
|
@@ -2047,81 +2047,81 @@ K.parseExprSubscripts = function(e, t) {
|
|
|
2047
2047
|
e = s;
|
|
2048
2048
|
}
|
|
2049
2049
|
}, K.shouldParseAsyncArrow = function() {
|
|
2050
|
-
return !this.canInsertSemicolon() && this.eat(
|
|
2050
|
+
return !this.canInsertSemicolon() && this.eat(D.arrow);
|
|
2051
2051
|
}, K.parseSubscriptAsyncArrow = function(e, t, n, r) {
|
|
2052
2052
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
|
|
2053
2053
|
}, K.parseSubscript = function(e, t, n, r, i, a, o) {
|
|
2054
|
-
var s = this.options.ecmaVersion >= 11, c = s && this.eat(
|
|
2054
|
+
var s = this.options.ecmaVersion >= 11, c = s && this.eat(D.questionDot);
|
|
2055
2055
|
r && c && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
2056
|
-
var l = this.eat(
|
|
2057
|
-
if (l || c && this.type !==
|
|
2056
|
+
var l = this.eat(D.bracketL);
|
|
2057
|
+
if (l || c && this.type !== D.parenL && this.type !== D.backQuote || this.eat(D.dot)) {
|
|
2058
2058
|
var u = this.startNodeAt(t, n);
|
|
2059
|
-
u.object = e, l ? (u.property = this.parseExpression(), this.expect(
|
|
2060
|
-
} else if (!r && this.eat(
|
|
2059
|
+
u.object = e, l ? (u.property = this.parseExpression(), this.expect(D.bracketR)) : this.type === D.privateId && e.type !== "Super" ? u.property = this.parsePrivateIdent() : u.property = this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
2060
|
+
} else if (!r && this.eat(D.parenL)) {
|
|
2061
2061
|
var d = new B(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
2062
2062
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
2063
|
-
var h = this.parseExprList(
|
|
2063
|
+
var h = this.parseExprList(D.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
2064
2064
|
if (i && !c && this.shouldParseAsyncArrow()) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = f, this.awaitPos = p, this.awaitIdentPos = m, this.parseSubscriptAsyncArrow(t, n, h, o);
|
|
2065
2065
|
this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
|
|
2066
2066
|
var g = this.startNodeAt(t, n);
|
|
2067
2067
|
g.callee = e, g.arguments = h, s && (g.optional = c), e = this.finishNode(g, "CallExpression");
|
|
2068
|
-
} else if (this.type ===
|
|
2068
|
+
} else if (this.type === D.backQuote) {
|
|
2069
2069
|
(c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
2070
2070
|
var _ = this.startNodeAt(t, n);
|
|
2071
2071
|
_.tag = e, _.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(_, "TaggedTemplateExpression");
|
|
2072
2072
|
}
|
|
2073
2073
|
return e;
|
|
2074
2074
|
}, K.parseExprAtom = function(e, t, n) {
|
|
2075
|
-
this.type ===
|
|
2075
|
+
this.type === D.slash && this.readRegexp();
|
|
2076
2076
|
var r, i = this.potentialArrowAt === this.start;
|
|
2077
2077
|
switch (this.type) {
|
|
2078
|
-
case
|
|
2079
|
-
case
|
|
2080
|
-
case
|
|
2078
|
+
case D._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === D.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== D.dot && this.type !== D.bracketL && this.type !== D.parenL && this.unexpected(), this.finishNode(r, "Super");
|
|
2079
|
+
case D._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
2080
|
+
case D.name:
|
|
2081
2081
|
var a = this.start, o = this.startLoc, s = this.containsEsc, c = this.parseIdent(!1);
|
|
2082
|
-
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(
|
|
2082
|
+
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(D._function)) return this.overrideContext(G.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
|
|
2083
2083
|
if (i && !this.canInsertSemicolon()) {
|
|
2084
|
-
if (this.eat(
|
|
2085
|
-
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type ===
|
|
2084
|
+
if (this.eat(D.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
|
|
2085
|
+
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === D.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(D.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
|
|
2086
2086
|
}
|
|
2087
2087
|
return c;
|
|
2088
|
-
case
|
|
2088
|
+
case D.regexp:
|
|
2089
2089
|
var l = this.value;
|
|
2090
2090
|
return r = this.parseLiteral(l.value), r.regex = {
|
|
2091
2091
|
pattern: l.pattern,
|
|
2092
2092
|
flags: l.flags
|
|
2093
2093
|
}, r;
|
|
2094
|
-
case
|
|
2095
|
-
case
|
|
2096
|
-
case
|
|
2097
|
-
case
|
|
2098
|
-
case
|
|
2099
|
-
case
|
|
2094
|
+
case D.num:
|
|
2095
|
+
case D.string: return this.parseLiteral(this.value);
|
|
2096
|
+
case D._null:
|
|
2097
|
+
case D._true:
|
|
2098
|
+
case D._false: return r = this.startNode(), r.value = this.type === D._null ? null : this.type === D._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
|
|
2099
|
+
case D.parenL:
|
|
2100
2100
|
var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
|
|
2101
2101
|
return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(d) && (e.parenthesizedAssign = u), e.parenthesizedBind < 0 && (e.parenthesizedBind = u)), d;
|
|
2102
|
-
case
|
|
2103
|
-
case
|
|
2104
|
-
case
|
|
2105
|
-
case
|
|
2106
|
-
case
|
|
2107
|
-
case
|
|
2108
|
-
case
|
|
2102
|
+
case D.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(D.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
2103
|
+
case D.braceL: return this.overrideContext(G.b_expr), this.parseObj(!1, e);
|
|
2104
|
+
case D._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
2105
|
+
case D._class: return this.parseClass(this.startNode(), !1);
|
|
2106
|
+
case D._new: return this.parseNew();
|
|
2107
|
+
case D.backQuote: return this.parseTemplate();
|
|
2108
|
+
case D._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
|
|
2109
2109
|
default: return this.parseExprAtomDefault();
|
|
2110
2110
|
}
|
|
2111
2111
|
}, K.parseExprAtomDefault = function() {
|
|
2112
2112
|
this.unexpected();
|
|
2113
2113
|
}, K.parseExprImport = function(e) {
|
|
2114
2114
|
var t = this.startNode();
|
|
2115
|
-
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type ===
|
|
2116
|
-
if (this.type ===
|
|
2115
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === D.parenL && !e) return this.parseDynamicImport(t);
|
|
2116
|
+
if (this.type === D.dot) {
|
|
2117
2117
|
var n = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
2118
2118
|
return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
|
|
2119
2119
|
} else this.unexpected();
|
|
2120
2120
|
}, K.parseDynamicImport = function(e) {
|
|
2121
|
-
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(
|
|
2122
|
-
else if (!this.eat(
|
|
2121
|
+
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(D.parenR) ? e.options = null : (this.expect(D.comma), this.afterTrailingComma(D.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(D.parenR) || (this.expect(D.comma), this.afterTrailingComma(D.parenR) || this.unexpected())));
|
|
2122
|
+
else if (!this.eat(D.parenR)) {
|
|
2123
2123
|
var t = this.start;
|
|
2124
|
-
this.eat(
|
|
2124
|
+
this.eat(D.comma) && this.eat(D.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
2125
2125
|
}
|
|
2126
2126
|
return this.finishNode(e, "ImportExpression");
|
|
2127
2127
|
}, K.parseImportMeta = function(e) {
|
|
@@ -2132,9 +2132,9 @@ K.parseExprSubscripts = function(e, t) {
|
|
|
2132
2132
|
var t = this.startNode();
|
|
2133
2133
|
return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value == null ? t.raw.slice(0, -1).replace(/_/g, "") : t.value.toString()), this.next(), this.finishNode(t, "Literal");
|
|
2134
2134
|
}, K.parseParenExpression = function() {
|
|
2135
|
-
this.expect(
|
|
2135
|
+
this.expect(D.parenL);
|
|
2136
2136
|
var e = this.parseExpression();
|
|
2137
|
-
return this.expect(
|
|
2137
|
+
return this.expect(D.parenR), e;
|
|
2138
2138
|
}, K.shouldParseArrow = function(e) {
|
|
2139
2139
|
return !this.canInsertSemicolon();
|
|
2140
2140
|
}, K.parseParenAndDistinguishExpression = function(e, t) {
|
|
@@ -2142,15 +2142,15 @@ K.parseExprSubscripts = function(e, t) {
|
|
|
2142
2142
|
if (this.options.ecmaVersion >= 6) {
|
|
2143
2143
|
this.next();
|
|
2144
2144
|
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new B(), f = this.yieldPos, p = this.awaitPos, m;
|
|
2145
|
-
for (this.yieldPos = 0, this.awaitPos = 0; this.type !==
|
|
2145
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== D.parenR;) if (l ? l = !1 : this.expect(D.comma), a && this.afterTrailingComma(D.parenR, !0)) {
|
|
2146
2146
|
u = !0;
|
|
2147
2147
|
break;
|
|
2148
|
-
} else if (this.type ===
|
|
2149
|
-
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type ===
|
|
2148
|
+
} else if (this.type === D.ellipsis) {
|
|
2149
|
+
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type === D.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
2150
2150
|
break;
|
|
2151
2151
|
} else c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
|
|
2152
2152
|
var h = this.lastTokEnd, g = this.lastTokEndLoc;
|
|
2153
|
-
if (this.expect(
|
|
2153
|
+
if (this.expect(D.parenR), e && this.shouldParseArrow(c) && this.eat(D.arrow)) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = f, this.awaitPos = p, this.parseParenArrowList(n, r, c, t);
|
|
2154
2154
|
(!c.length || u) && this.unexpected(this.lastTokStart), m && this.unexpected(m), this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, c.length > 1 ? (i = this.startNodeAt(o, s), i.expressions = c, this.finishNodeAt(i, "SequenceExpression", h, g)) : i = c[0];
|
|
2155
2155
|
} else i = this.parseParenExpression();
|
|
2156
2156
|
if (this.options.preserveParens) {
|
|
@@ -2166,23 +2166,23 @@ var Je = [];
|
|
|
2166
2166
|
K.parseNew = function() {
|
|
2167
2167
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
2168
2168
|
var e = this.startNode();
|
|
2169
|
-
if (this.next(), this.options.ecmaVersion >= 6 && this.type ===
|
|
2169
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === D.dot) {
|
|
2170
2170
|
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
2171
2171
|
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
2172
2172
|
var n = this.containsEsc;
|
|
2173
2173
|
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), n && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
2174
2174
|
}
|
|
2175
2175
|
var r = this.start, i = this.startLoc;
|
|
2176
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(
|
|
2176
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(D.parenL) ? e.arguments = this.parseExprList(D.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = Je, this.finishNode(e, "NewExpression");
|
|
2177
2177
|
}, K.parseTemplateElement = function(e) {
|
|
2178
2178
|
var t = e.isTagged, n = this.startNode();
|
|
2179
|
-
return this.type ===
|
|
2179
|
+
return this.type === D.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
2180
2180
|
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
2181
2181
|
cooked: null
|
|
2182
2182
|
}) : n.value = {
|
|
2183
2183
|
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
|
|
2184
2184
|
cooked: this.value
|
|
2185
|
-
}, this.next(), n.tail = this.type ===
|
|
2185
|
+
}, this.next(), n.tail = this.type === D.backQuote, this.finishNode(n, "TemplateElement");
|
|
2186
2186
|
}, K.parseTemplate = function(e) {
|
|
2187
2187
|
e === void 0 && (e = {});
|
|
2188
2188
|
var t = e.isTagged;
|
|
@@ -2190,25 +2190,25 @@ K.parseNew = function() {
|
|
|
2190
2190
|
var n = this.startNode();
|
|
2191
2191
|
this.next(), n.expressions = [];
|
|
2192
2192
|
var r = this.parseTemplateElement({ isTagged: t });
|
|
2193
|
-
for (n.quasis = [r]; !r.tail;) this.type ===
|
|
2193
|
+
for (n.quasis = [r]; !r.tail;) this.type === D.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(D.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(D.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
2194
2194
|
return this.next(), this.finishNode(n, "TemplateLiteral");
|
|
2195
2195
|
}, K.isAsyncProp = function(e) {
|
|
2196
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type ===
|
|
2196
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === D.name || this.type === D.num || this.type === D.string || this.type === D.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === D.star) && !O.test(this.input.slice(this.lastTokEnd, this.start));
|
|
2197
2197
|
}, K.parseObj = function(e, t) {
|
|
2198
2198
|
var n = this.startNode(), r = !0, i = {};
|
|
2199
|
-
for (n.properties = [], this.next(); !this.eat(
|
|
2199
|
+
for (n.properties = [], this.next(); !this.eat(D.braceR);) {
|
|
2200
2200
|
if (r) r = !1;
|
|
2201
|
-
else if (this.expect(
|
|
2201
|
+
else if (this.expect(D.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(D.braceR)) break;
|
|
2202
2202
|
var a = this.parseProperty(e, t);
|
|
2203
2203
|
e || this.checkPropClash(a, i, t), n.properties.push(a);
|
|
2204
2204
|
}
|
|
2205
2205
|
return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
|
|
2206
2206
|
}, K.parseProperty = function(e, t) {
|
|
2207
2207
|
var n = this.startNode(), r, i, a, o;
|
|
2208
|
-
if (this.options.ecmaVersion >= 9 && this.eat(
|
|
2209
|
-
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(
|
|
2208
|
+
if (this.options.ecmaVersion >= 9 && this.eat(D.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === D.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(n, "RestElement")) : (n.argument = this.parseMaybeAssign(!1, t), this.type === D.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
|
|
2209
|
+
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(D.star)));
|
|
2210
2210
|
var s = this.containsEsc;
|
|
2211
|
-
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(
|
|
2211
|
+
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(D.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
|
|
2212
2212
|
}, K.parseGetterSetter = function(e) {
|
|
2213
2213
|
var t = e.key.name;
|
|
2214
2214
|
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
@@ -2218,23 +2218,23 @@ K.parseNew = function() {
|
|
|
2218
2218
|
e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
|
|
2219
2219
|
} else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
2220
2220
|
}, K.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
|
|
2221
|
-
(n || r) && this.type ===
|
|
2221
|
+
(n || r) && this.type === D.colon && this.unexpected(), this.eat(D.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === D.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(n, r), e.kind = "init") : !t && !s && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== D.comma && this.type !== D.braceR && this.type !== D.eq ? ((n || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((n || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = i), t ? e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key)) : this.type === D.eq && o ? (o.shorthandAssign < 0 && (o.shorthandAssign = this.start), e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
2222
2222
|
}, K.parsePropertyName = function(e) {
|
|
2223
2223
|
if (this.options.ecmaVersion >= 6) {
|
|
2224
|
-
if (this.eat(
|
|
2224
|
+
if (this.eat(D.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(D.bracketR), e.key;
|
|
2225
2225
|
e.computed = !1;
|
|
2226
2226
|
}
|
|
2227
|
-
return e.key = this.type ===
|
|
2227
|
+
return e.key = this.type === D.num || this.type === D.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2228
2228
|
}, K.initFunction = function(e) {
|
|
2229
2229
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
2230
2230
|
}, K.parseMethod = function(e, t, n) {
|
|
2231
2231
|
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2232
|
-
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(F(t, r.generator) | ke | (n ? M : 0)), this.expect(
|
|
2232
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(F(t, r.generator) | ke | (n ? M : 0)), this.expect(D.parenL), r.params = this.parseBindingList(D.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(r, "FunctionExpression");
|
|
2233
2233
|
}, K.parseArrowExpression = function(e, t, n, r) {
|
|
2234
2234
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2235
2235
|
return this.enterScope(F(n, !1) | De), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(e, "ArrowFunctionExpression");
|
|
2236
2236
|
}, K.parseFunctionBody = function(e, t, n, r) {
|
|
2237
|
-
var i = t && this.type !==
|
|
2237
|
+
var i = t && this.type !== D.braceL, a = this.strict, o = !1;
|
|
2238
2238
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
2239
2239
|
else {
|
|
2240
2240
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
@@ -2254,9 +2254,9 @@ K.parseNew = function() {
|
|
|
2254
2254
|
}, K.parseExprList = function(e, t, n, r) {
|
|
2255
2255
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
2256
2256
|
if (a) a = !1;
|
|
2257
|
-
else if (this.expect(
|
|
2257
|
+
else if (this.expect(D.comma), t && this.afterTrailingComma(e)) break;
|
|
2258
2258
|
var o = void 0;
|
|
2259
|
-
n && this.type ===
|
|
2259
|
+
n && this.type === D.comma ? o = null : this.type === D.ellipsis ? (o = this.parseSpread(r), r && this.type === D.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
|
|
2260
2260
|
}
|
|
2261
2261
|
return i;
|
|
2262
2262
|
}, K.checkUnreserved = function(e) {
|
|
@@ -2267,14 +2267,14 @@ K.parseNew = function() {
|
|
|
2267
2267
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
2268
2268
|
}, K.parseIdentNode = function() {
|
|
2269
2269
|
var e = this.startNode();
|
|
2270
|
-
return this.type ===
|
|
2270
|
+
return this.type === D.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = D.name) : this.unexpected(), e;
|
|
2271
2271
|
}, K.parsePrivateIdent = function() {
|
|
2272
2272
|
var e = this.startNode();
|
|
2273
|
-
return this.type ===
|
|
2273
|
+
return this.type === D.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
2274
2274
|
}, K.parseYield = function(e) {
|
|
2275
2275
|
this.yieldPos ||= this.start;
|
|
2276
2276
|
var t = this.startNode();
|
|
2277
|
-
return this.next(), this.type ===
|
|
2277
|
+
return this.next(), this.type === D.semi || this.canInsertSemicolon() || this.type !== D.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(D.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
2278
2278
|
}, K.parseAwait = function(e) {
|
|
2279
2279
|
this.awaitPos ||= this.start;
|
|
2280
2280
|
var t = this.startNode();
|
|
@@ -2282,12 +2282,12 @@ K.parseNew = function() {
|
|
|
2282
2282
|
};
|
|
2283
2283
|
var Ye = I.prototype;
|
|
2284
2284
|
Ye.raise = function(e, t) {
|
|
2285
|
-
var n =
|
|
2285
|
+
var n = ye(this.input, e);
|
|
2286
2286
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
2287
2287
|
var r = SyntaxError(t);
|
|
2288
2288
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
2289
2289
|
}, Ye.raiseRecoverable = Ye.raise, Ye.curPosition = function() {
|
|
2290
|
-
if (this.options.locations) return new
|
|
2290
|
+
if (this.options.locations) return new _e(this.curLine, this.pos - this.lineStart);
|
|
2291
2291
|
};
|
|
2292
2292
|
var Xe = I.prototype, Ze = function(e) {
|
|
2293
2293
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
@@ -2297,12 +2297,12 @@ Xe.enterScope = function(e) {
|
|
|
2297
2297
|
}, Xe.exitScope = function() {
|
|
2298
2298
|
this.scopeStack.pop();
|
|
2299
2299
|
}, Xe.treatFunctionsAsVarInScope = function(e) {
|
|
2300
|
-
return e.flags &
|
|
2300
|
+
return e.flags & Te || !this.inModule && e.flags & we;
|
|
2301
2301
|
}, Xe.declareName = function(e, t, n) {
|
|
2302
2302
|
var r = !1;
|
|
2303
2303
|
if (t === Pe) {
|
|
2304
2304
|
var i = this.currentScope();
|
|
2305
|
-
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags &
|
|
2305
|
+
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & we && delete this.undefinedExports[e];
|
|
2306
2306
|
} else if (t === Ie) this.currentScope().lexical.push(e);
|
|
2307
2307
|
else if (t === Fe) {
|
|
2308
2308
|
var a = this.currentScope();
|
|
@@ -2313,7 +2313,7 @@ Xe.enterScope = function(e) {
|
|
|
2313
2313
|
r = !0;
|
|
2314
2314
|
break;
|
|
2315
2315
|
}
|
|
2316
|
-
if (s.var.push(e), this.inModule && s.flags &
|
|
2316
|
+
if (s.var.push(e), this.inModule && s.flags & we && delete this.undefinedExports[e], s.flags & je) break;
|
|
2317
2317
|
}
|
|
2318
2318
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
2319
2319
|
}, Xe.checkLocalExport = function(e) {
|
|
@@ -2332,7 +2332,7 @@ Xe.enterScope = function(e) {
|
|
|
2332
2332
|
}
|
|
2333
2333
|
};
|
|
2334
2334
|
var Qe = function(e, t, n) {
|
|
2335
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
2335
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new ve(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
2336
2336
|
}, $e = I.prototype;
|
|
2337
2337
|
$e.startNode = function() {
|
|
2338
2338
|
return new Qe(this, this.start, this.startLoc);
|
|
@@ -2375,11 +2375,11 @@ var tt = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana
|
|
|
2375
2375
|
}, mt = {};
|
|
2376
2376
|
function ht(e) {
|
|
2377
2377
|
var t = mt[e] = {
|
|
2378
|
-
binary:
|
|
2379
|
-
binaryOfStrings:
|
|
2378
|
+
binary: A(st[e] + " " + q),
|
|
2379
|
+
binaryOfStrings: A(ct[e]),
|
|
2380
2380
|
nonBinary: {
|
|
2381
|
-
General_Category:
|
|
2382
|
-
Script:
|
|
2381
|
+
General_Category: A(q),
|
|
2382
|
+
Script: A(pt[e])
|
|
2383
2383
|
}
|
|
2384
2384
|
};
|
|
2385
2385
|
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
@@ -2538,7 +2538,7 @@ Y.validateRegExpPattern = function(e) {
|
|
|
2538
2538
|
}
|
|
2539
2539
|
return !1;
|
|
2540
2540
|
}, Y.regexp_eatModifiers = function(e) {
|
|
2541
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 && xt(n);) t +=
|
|
2541
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && xt(n);) t += he(n), e.advance();
|
|
2542
2542
|
return t;
|
|
2543
2543
|
};
|
|
2544
2544
|
function xt(e) {
|
|
@@ -2577,7 +2577,7 @@ Y.regexp_eatPatternCharacters = function(e) {
|
|
|
2577
2577
|
return !1;
|
|
2578
2578
|
}, Y.regexp_eatRegExpIdentifierName = function(e) {
|
|
2579
2579
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
2580
|
-
for (e.lastStringValue +=
|
|
2580
|
+
for (e.lastStringValue += he(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += he(e.lastIntValue);
|
|
2581
2581
|
return !0;
|
|
2582
2582
|
}
|
|
2583
2583
|
return !1;
|
|
@@ -2593,7 +2593,7 @@ Y.regexp_eatRegExpIdentifierPart = function(e) {
|
|
|
2593
2593
|
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), wt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2594
2594
|
};
|
|
2595
2595
|
function wt(e) {
|
|
2596
|
-
return
|
|
2596
|
+
return re(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2597
2597
|
}
|
|
2598
2598
|
Y.regexp_eatAtomEscape = function(e) {
|
|
2599
2599
|
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
@@ -2703,14 +2703,14 @@ Y.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
2703
2703
|
}
|
|
2704
2704
|
return Dt;
|
|
2705
2705
|
}, Y.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
2706
|
-
|
|
2706
|
+
fe(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
2707
2707
|
}, Y.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2708
2708
|
if (e.unicodeProperties.binary.test(t)) return Z;
|
|
2709
2709
|
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return Q;
|
|
2710
2710
|
e.raise("Invalid property name");
|
|
2711
2711
|
}, Y.regexp_eatUnicodePropertyName = function(e) {
|
|
2712
2712
|
var t = 0;
|
|
2713
|
-
for (e.lastStringValue = ""; kt(t = e.current());) e.lastStringValue +=
|
|
2713
|
+
for (e.lastStringValue = ""; kt(t = e.current());) e.lastStringValue += he(t), e.advance();
|
|
2714
2714
|
return e.lastStringValue !== "";
|
|
2715
2715
|
};
|
|
2716
2716
|
function kt(e) {
|
|
@@ -2718,7 +2718,7 @@ function kt(e) {
|
|
|
2718
2718
|
}
|
|
2719
2719
|
Y.regexp_eatUnicodePropertyValue = function(e) {
|
|
2720
2720
|
var t = 0;
|
|
2721
|
-
for (e.lastStringValue = ""; At(t = e.current());) e.lastStringValue +=
|
|
2721
|
+
for (e.lastStringValue = ""; At(t = e.current());) e.lastStringValue += he(t), e.advance();
|
|
2722
2722
|
return e.lastStringValue !== "";
|
|
2723
2723
|
};
|
|
2724
2724
|
function At(e) {
|
|
@@ -2900,7 +2900,7 @@ Y.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
2900
2900
|
return !0;
|
|
2901
2901
|
};
|
|
2902
2902
|
var Rt = function(e) {
|
|
2903
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
2903
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new ve(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2904
2904
|
}, $ = I.prototype;
|
|
2905
2905
|
$.next = function(e) {
|
|
2906
2906
|
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Rt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
@@ -2911,13 +2911,13 @@ $.next = function(e) {
|
|
|
2911
2911
|
return { next: function() {
|
|
2912
2912
|
var t = e.getToken();
|
|
2913
2913
|
return {
|
|
2914
|
-
done: t.type ===
|
|
2914
|
+
done: t.type === D.eof,
|
|
2915
2915
|
value: t
|
|
2916
2916
|
};
|
|
2917
2917
|
} };
|
|
2918
2918
|
}), $.nextToken = function() {
|
|
2919
2919
|
var e = this.curContext();
|
|
2920
|
-
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(
|
|
2920
|
+
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(D.eof);
|
|
2921
2921
|
if (e.override) return e.override(this);
|
|
2922
2922
|
this.readToken(this.fullCharCodeAtPos());
|
|
2923
2923
|
}, $.readToken = function(e) {
|
|
@@ -2931,10 +2931,10 @@ $.next = function(e) {
|
|
|
2931
2931
|
return this.fullCharCodeAt(this.pos);
|
|
2932
2932
|
}, $.skipBlockComment = function() {
|
|
2933
2933
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
2934
|
-
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r =
|
|
2934
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = se(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
2935
2935
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
2936
2936
|
}, $.skipLineComment = function(e) {
|
|
2937
|
-
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !
|
|
2937
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !oe(r);) r = this.input.charCodeAt(++this.pos);
|
|
2938
2938
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
2939
2939
|
}, $.skipSpace = function() {
|
|
2940
2940
|
loop: for (; this.pos < this.input.length;) {
|
|
@@ -2961,7 +2961,7 @@ $.next = function(e) {
|
|
|
2961
2961
|
default: break loop;
|
|
2962
2962
|
}
|
|
2963
2963
|
break;
|
|
2964
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
2964
|
+
default: if (e > 8 && e < 14 || e >= 5760 && ce.test(String.fromCharCode(e))) ++this.pos;
|
|
2965
2965
|
else break loop;
|
|
2966
2966
|
}
|
|
2967
2967
|
}
|
|
@@ -2973,57 +2973,57 @@ $.next = function(e) {
|
|
|
2973
2973
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2974
2974
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
2975
2975
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
2976
|
-
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(
|
|
2976
|
+
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(D.ellipsis)) : (++this.pos, this.finishToken(D.dot));
|
|
2977
2977
|
}, $.readToken_slash = function() {
|
|
2978
2978
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2979
|
-
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(
|
|
2979
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(D.assign, 2) : this.finishOp(D.slash, 1);
|
|
2980
2980
|
}, $.readToken_mult_modulo_exp = function(e) {
|
|
2981
|
-
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ?
|
|
2982
|
-
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r =
|
|
2981
|
+
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? D.star : D.modulo;
|
|
2982
|
+
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = D.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(D.assign, n + 1) : this.finishOp(r, n);
|
|
2983
2983
|
}, $.readToken_pipe_amp = function(e) {
|
|
2984
2984
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2985
|
-
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
2985
|
+
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(D.assign, 3) : this.finishOp(e === 124 ? D.logicalOR : D.logicalAND, 2) : t === 61 ? this.finishOp(D.assign, 2) : this.finishOp(e === 124 ? D.bitwiseOR : D.bitwiseAND, 1);
|
|
2986
2986
|
}, $.readToken_caret = function() {
|
|
2987
|
-
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(
|
|
2987
|
+
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(D.assign, 2) : this.finishOp(D.bitwiseXOR, 1);
|
|
2988
2988
|
}, $.readToken_plus_min = function(e) {
|
|
2989
2989
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2990
|
-
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 ||
|
|
2990
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || O.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(D.incDec, 2) : t === 61 ? this.finishOp(D.assign, 2) : this.finishOp(D.plusMin, 1);
|
|
2991
2991
|
}, $.readToken_lt_gt = function(e) {
|
|
2992
2992
|
var t = this.input.charCodeAt(this.pos + 1), n = 1;
|
|
2993
|
-
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(
|
|
2993
|
+
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(D.assign, n + 1) : this.finishOp(D.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(D.relational, n));
|
|
2994
2994
|
}, $.readToken_eq_excl = function(e) {
|
|
2995
2995
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2996
|
-
return t === 61 ? this.finishOp(
|
|
2996
|
+
return t === 61 ? this.finishOp(D.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(D.arrow)) : this.finishOp(e === 61 ? D.eq : D.prefix, 1);
|
|
2997
2997
|
}, $.readToken_question = function() {
|
|
2998
2998
|
var e = this.options.ecmaVersion;
|
|
2999
2999
|
if (e >= 11) {
|
|
3000
3000
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3001
3001
|
if (t === 46) {
|
|
3002
3002
|
var n = this.input.charCodeAt(this.pos + 2);
|
|
3003
|
-
if (n < 48 || n > 57) return this.finishOp(
|
|
3003
|
+
if (n < 48 || n > 57) return this.finishOp(D.questionDot, 2);
|
|
3004
3004
|
}
|
|
3005
|
-
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
3005
|
+
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(D.assign, 3) : this.finishOp(D.coalesce, 2);
|
|
3006
3006
|
}
|
|
3007
|
-
return this.finishOp(
|
|
3007
|
+
return this.finishOp(D.question, 1);
|
|
3008
3008
|
}, $.readToken_numberSign = function() {
|
|
3009
3009
|
var e = this.options.ecmaVersion, t = 35;
|
|
3010
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), x(t, !0) || t === 92)) return this.finishToken(
|
|
3011
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
3010
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), x(t, !0) || t === 92)) return this.finishToken(D.privateId, this.readWord1());
|
|
3011
|
+
this.raise(this.pos, "Unexpected character '" + he(t) + "'");
|
|
3012
3012
|
}, $.getTokenFromCode = function(e) {
|
|
3013
3013
|
switch (e) {
|
|
3014
3014
|
case 46: return this.readToken_dot();
|
|
3015
|
-
case 40: return ++this.pos, this.finishToken(
|
|
3016
|
-
case 41: return ++this.pos, this.finishToken(
|
|
3017
|
-
case 59: return ++this.pos, this.finishToken(
|
|
3018
|
-
case 44: return ++this.pos, this.finishToken(
|
|
3019
|
-
case 91: return ++this.pos, this.finishToken(
|
|
3020
|
-
case 93: return ++this.pos, this.finishToken(
|
|
3021
|
-
case 123: return ++this.pos, this.finishToken(
|
|
3022
|
-
case 125: return ++this.pos, this.finishToken(
|
|
3023
|
-
case 58: return ++this.pos, this.finishToken(
|
|
3015
|
+
case 40: return ++this.pos, this.finishToken(D.parenL);
|
|
3016
|
+
case 41: return ++this.pos, this.finishToken(D.parenR);
|
|
3017
|
+
case 59: return ++this.pos, this.finishToken(D.semi);
|
|
3018
|
+
case 44: return ++this.pos, this.finishToken(D.comma);
|
|
3019
|
+
case 91: return ++this.pos, this.finishToken(D.bracketL);
|
|
3020
|
+
case 93: return ++this.pos, this.finishToken(D.bracketR);
|
|
3021
|
+
case 123: return ++this.pos, this.finishToken(D.braceL);
|
|
3022
|
+
case 125: return ++this.pos, this.finishToken(D.braceR);
|
|
3023
|
+
case 58: return ++this.pos, this.finishToken(D.colon);
|
|
3024
3024
|
case 96:
|
|
3025
3025
|
if (this.options.ecmaVersion < 6) break;
|
|
3026
|
-
return ++this.pos, this.finishToken(
|
|
3026
|
+
return ++this.pos, this.finishToken(D.backQuote);
|
|
3027
3027
|
case 48:
|
|
3028
3028
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3029
3029
|
if (t === 120 || t === 88) return this.readRadixNumber(16);
|
|
@@ -3055,10 +3055,10 @@ $.next = function(e) {
|
|
|
3055
3055
|
case 61:
|
|
3056
3056
|
case 33: return this.readToken_eq_excl(e);
|
|
3057
3057
|
case 63: return this.readToken_question();
|
|
3058
|
-
case 126: return this.finishOp(
|
|
3058
|
+
case 126: return this.finishOp(D.prefix, 1);
|
|
3059
3059
|
case 35: return this.readToken_numberSign();
|
|
3060
3060
|
}
|
|
3061
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
3061
|
+
this.raise(this.pos, "Unexpected character '" + he(e) + "'");
|
|
3062
3062
|
}, $.finishOp = function(e, t) {
|
|
3063
3063
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
3064
3064
|
return this.pos += t, this.finishToken(e, n);
|
|
@@ -3066,7 +3066,7 @@ $.next = function(e) {
|
|
|
3066
3066
|
for (var e, t, n = this.pos;;) {
|
|
3067
3067
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
3068
3068
|
var r = this.input.charAt(this.pos);
|
|
3069
|
-
if (
|
|
3069
|
+
if (O.test(r) && this.raise(n, "Unterminated regular expression"), e) e = !1;
|
|
3070
3070
|
else {
|
|
3071
3071
|
if (r === "[") t = !0;
|
|
3072
3072
|
else if (r === "]" && t) t = !1;
|
|
@@ -3085,7 +3085,7 @@ $.next = function(e) {
|
|
|
3085
3085
|
try {
|
|
3086
3086
|
c = new RegExp(i, o);
|
|
3087
3087
|
} catch {}
|
|
3088
|
-
return this.finishToken(
|
|
3088
|
+
return this.finishToken(D.regexp, {
|
|
3089
3089
|
pattern: i,
|
|
3090
3090
|
flags: o,
|
|
3091
3091
|
value: c
|
|
@@ -3112,7 +3112,7 @@ $.readRadixNumber = function(e) {
|
|
|
3112
3112
|
var t = this.pos;
|
|
3113
3113
|
this.pos += 2;
|
|
3114
3114
|
var n = this.readInt(e);
|
|
3115
|
-
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Bt(this.input.slice(t, this.pos)), ++this.pos) : x(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(
|
|
3115
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Bt(this.input.slice(t, this.pos)), ++this.pos) : x(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(D.num, n);
|
|
3116
3116
|
}, $.readNumber = function(e) {
|
|
3117
3117
|
var t = this.pos;
|
|
3118
3118
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
@@ -3121,11 +3121,11 @@ $.readRadixNumber = function(e) {
|
|
|
3121
3121
|
var r = this.input.charCodeAt(this.pos);
|
|
3122
3122
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3123
3123
|
var i = Bt(this.input.slice(t, this.pos));
|
|
3124
|
-
return ++this.pos, x(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(
|
|
3124
|
+
return ++this.pos, x(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(D.num, i);
|
|
3125
3125
|
}
|
|
3126
3126
|
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), x(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3127
3127
|
var a = zt(this.input.slice(t, this.pos), n);
|
|
3128
|
-
return this.finishToken(
|
|
3128
|
+
return this.finishToken(D.num, a);
|
|
3129
3129
|
}, $.readCodePoint = function() {
|
|
3130
3130
|
var e = this.input.charCodeAt(this.pos), t;
|
|
3131
3131
|
if (e === 123) {
|
|
@@ -3139,9 +3139,9 @@ $.readRadixNumber = function(e) {
|
|
|
3139
3139
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3140
3140
|
var r = this.input.charCodeAt(this.pos);
|
|
3141
3141
|
if (r === e) break;
|
|
3142
|
-
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (
|
|
3142
|
+
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (oe(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
3143
3143
|
}
|
|
3144
|
-
return t += this.input.slice(n, this.pos++), this.finishToken(
|
|
3144
|
+
return t += this.input.slice(n, this.pos++), this.finishToken(D.string, t);
|
|
3145
3145
|
};
|
|
3146
3146
|
var Vt = {};
|
|
3147
3147
|
$.tryReadTemplateToken = function() {
|
|
@@ -3160,9 +3160,9 @@ $.tryReadTemplateToken = function() {
|
|
|
3160
3160
|
for (var e = "", t = this.pos;;) {
|
|
3161
3161
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
3162
3162
|
var n = this.input.charCodeAt(this.pos);
|
|
3163
|
-
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type ===
|
|
3163
|
+
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === D.template || this.type === D.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(D.dollarBraceL)) : (++this.pos, this.finishToken(D.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(D.template, e));
|
|
3164
3164
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
3165
|
-
else if (
|
|
3165
|
+
else if (oe(n)) {
|
|
3166
3166
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
3167
3167
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3168
3168
|
case 10:
|
|
@@ -3181,7 +3181,7 @@ $.tryReadTemplateToken = function() {
|
|
|
3181
3181
|
++this.pos;
|
|
3182
3182
|
break;
|
|
3183
3183
|
case "$": if (this.input[this.pos + 1] !== "{") break;
|
|
3184
|
-
case "`": return this.finishToken(
|
|
3184
|
+
case "`": return this.finishToken(D.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
3185
3185
|
case "\r": this.input[this.pos + 1] === "\n" && ++this.pos;
|
|
3186
3186
|
case "\n":
|
|
3187
3187
|
case "\u2028":
|
|
@@ -3196,7 +3196,7 @@ $.tryReadTemplateToken = function() {
|
|
|
3196
3196
|
case 110: return "\n";
|
|
3197
3197
|
case 114: return "\r";
|
|
3198
3198
|
case 120: return String.fromCharCode(this.readHexChar(2));
|
|
3199
|
-
case 117: return
|
|
3199
|
+
case 117: return he(this.readCodePoint());
|
|
3200
3200
|
case 116: return " ";
|
|
3201
3201
|
case 98: return "\b";
|
|
3202
3202
|
case 118: return "\v";
|
|
@@ -3213,7 +3213,7 @@ $.tryReadTemplateToken = function() {
|
|
|
3213
3213
|
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
3214
3214
|
return i > 255 && (r = r.slice(0, -1), i = parseInt(r, 8)), this.pos += r.length - 1, t = this.input.charCodeAt(this.pos), (r !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(this.pos - 1 - r.length, e ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(i);
|
|
3215
3215
|
}
|
|
3216
|
-
return
|
|
3216
|
+
return oe(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3217
3217
|
}
|
|
3218
3218
|
}, $.readHexChar = function(e) {
|
|
3219
3219
|
var t = this.pos, n = this.readInt(16, e);
|
|
@@ -3222,40 +3222,40 @@ $.tryReadTemplateToken = function() {
|
|
|
3222
3222
|
this.containsEsc = !1;
|
|
3223
3223
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3224
3224
|
var i = this.fullCharCodeAtPos();
|
|
3225
|
-
if (
|
|
3225
|
+
if (re(i, r)) this.pos += i <= 65535 ? 1 : 2;
|
|
3226
3226
|
else if (i === 92) {
|
|
3227
3227
|
this.containsEsc = !0, e += this.input.slice(n, this.pos);
|
|
3228
3228
|
var a = this.pos;
|
|
3229
3229
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3230
3230
|
var o = this.readCodePoint();
|
|
3231
|
-
(t ? x :
|
|
3231
|
+
(t ? x : re)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += he(o), n = this.pos;
|
|
3232
3232
|
} else break;
|
|
3233
3233
|
t = !1;
|
|
3234
3234
|
}
|
|
3235
3235
|
return e + this.input.slice(n, this.pos);
|
|
3236
3236
|
}, $.readWord = function() {
|
|
3237
|
-
var e = this.readWord1(), t =
|
|
3238
|
-
return this.keywords.test(e) && (t =
|
|
3237
|
+
var e = this.readWord1(), t = D.name;
|
|
3238
|
+
return this.keywords.test(e) && (t = ie[e]), this.finishToken(t, e);
|
|
3239
3239
|
}, I.acorn = {
|
|
3240
3240
|
Parser: I,
|
|
3241
3241
|
version: "8.17.0",
|
|
3242
|
-
defaultOptions:
|
|
3243
|
-
Position:
|
|
3244
|
-
SourceLocation:
|
|
3245
|
-
getLineInfo:
|
|
3242
|
+
defaultOptions: be,
|
|
3243
|
+
Position: _e,
|
|
3244
|
+
SourceLocation: ve,
|
|
3245
|
+
getLineInfo: ye,
|
|
3246
3246
|
Node: Qe,
|
|
3247
|
-
TokenType:
|
|
3248
|
-
tokTypes:
|
|
3249
|
-
keywordTypes:
|
|
3247
|
+
TokenType: S,
|
|
3248
|
+
tokTypes: D,
|
|
3249
|
+
keywordTypes: ie,
|
|
3250
3250
|
TokContext: W,
|
|
3251
3251
|
tokContexts: G,
|
|
3252
|
-
isIdentifierChar:
|
|
3252
|
+
isIdentifierChar: re,
|
|
3253
3253
|
isIdentifierStart: x,
|
|
3254
3254
|
Token: Rt,
|
|
3255
|
-
isNewLine:
|
|
3256
|
-
lineBreak:
|
|
3257
|
-
lineBreakG:
|
|
3258
|
-
nonASCIIwhitespace:
|
|
3255
|
+
isNewLine: oe,
|
|
3256
|
+
lineBreak: O,
|
|
3257
|
+
lineBreakG: ae,
|
|
3258
|
+
nonASCIIwhitespace: ce
|
|
3259
3259
|
};
|
|
3260
3260
|
//#endregion
|
|
3261
3261
|
//#region node_modules/acorn-jsx/xhtml.js
|
|
@@ -4651,34 +4651,34 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4651
4651
|
}
|
|
4652
4652
|
return -1;
|
|
4653
4653
|
}
|
|
4654
|
-
var
|
|
4655
|
-
return
|
|
4656
|
-
}),
|
|
4657
|
-
return
|
|
4658
|
-
}),
|
|
4659
|
-
function
|
|
4660
|
-
return
|
|
4654
|
+
var re = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, S = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, C = Object.prototype, w = C.hasOwnProperty, T = C.toString, ie = Object.hasOwn || (function(e, t) {
|
|
4655
|
+
return w.call(e, t);
|
|
4656
|
+
}), E = Array.isArray || (function(e) {
|
|
4657
|
+
return T.call(e) === "[object Array]";
|
|
4658
|
+
}), D = Object.create(null);
|
|
4659
|
+
function O(e) {
|
|
4660
|
+
return D[e] || (D[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
4661
4661
|
}
|
|
4662
|
-
function
|
|
4662
|
+
function ae(e) {
|
|
4663
4663
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
4664
4664
|
}
|
|
4665
|
-
var
|
|
4665
|
+
var oe = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, se = function(e, t) {
|
|
4666
4666
|
this.line = e, this.column = t;
|
|
4667
4667
|
};
|
|
4668
|
-
|
|
4669
|
-
return new
|
|
4668
|
+
se.prototype.offset = function(e) {
|
|
4669
|
+
return new se(this.line, this.column + e);
|
|
4670
4670
|
};
|
|
4671
|
-
var
|
|
4671
|
+
var ce = function(e, t, n) {
|
|
4672
4672
|
this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
4673
4673
|
};
|
|
4674
|
-
function
|
|
4674
|
+
function k(e, t) {
|
|
4675
4675
|
for (var n = 1, r = 0;;) {
|
|
4676
4676
|
var i = x(e, r, t);
|
|
4677
|
-
if (i < 0) return new
|
|
4677
|
+
if (i < 0) return new se(n, t - r);
|
|
4678
4678
|
++n, r = i;
|
|
4679
4679
|
}
|
|
4680
4680
|
}
|
|
4681
|
-
var
|
|
4681
|
+
var le = {
|
|
4682
4682
|
ecmaVersion: null,
|
|
4683
4683
|
sourceType: "script",
|
|
4684
4684
|
strict: !1,
|
|
@@ -4699,20 +4699,20 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4699
4699
|
sourceFile: null,
|
|
4700
4700
|
directSourceFile: null,
|
|
4701
4701
|
preserveParens: !1
|
|
4702
|
-
},
|
|
4703
|
-
function
|
|
4702
|
+
}, ue = !1;
|
|
4703
|
+
function de(e) {
|
|
4704
4704
|
var t = {};
|
|
4705
|
-
for (var n in
|
|
4706
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
4705
|
+
for (var n in le) t[n] = e && ie(e, n) ? e[n] : le[n];
|
|
4706
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!ue && typeof console == "object" && console.warn && (ue = !0, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved ??= t.ecmaVersion < 5, (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), E(t.onToken)) {
|
|
4707
4707
|
var r = t.onToken;
|
|
4708
4708
|
t.onToken = function(e) {
|
|
4709
4709
|
return r.push(e);
|
|
4710
4710
|
};
|
|
4711
4711
|
}
|
|
4712
|
-
if (
|
|
4712
|
+
if (E(t.onComment) && (t.onComment = fe(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
4713
4713
|
return t;
|
|
4714
4714
|
}
|
|
4715
|
-
function
|
|
4715
|
+
function fe(e, t) {
|
|
4716
4716
|
return function(n, r, i, a, o, s) {
|
|
4717
4717
|
var c = {
|
|
4718
4718
|
type: n ? "Block" : "Line",
|
|
@@ -4720,19 +4720,19 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4720
4720
|
start: i,
|
|
4721
4721
|
end: a
|
|
4722
4722
|
};
|
|
4723
|
-
e.locations && (c.loc = new
|
|
4723
|
+
e.locations && (c.loc = new ce(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
4724
4724
|
};
|
|
4725
4725
|
}
|
|
4726
|
-
var
|
|
4727
|
-
function
|
|
4728
|
-
return
|
|
4726
|
+
var pe = 1, me = 2, A = 4, he = 8, ge = 16, _e = 32, ve = 64, ye = 128, be = 256, xe = 512, Se = 1024, Ce = pe | me | be;
|
|
4727
|
+
function we(e, t) {
|
|
4728
|
+
return me | (e ? A : 0) | (t ? he : 0);
|
|
4729
4729
|
}
|
|
4730
|
-
var
|
|
4731
|
-
this.options = e =
|
|
4730
|
+
var Te = 0, Ee = 1, j = 2, De = 3, Oe = 4, ke = 5, M = function(e, t, n) {
|
|
4731
|
+
this.options = e = de(e), this.sourceFile = e.sourceFile, this.keywords = O(s[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
4732
4732
|
var r = "";
|
|
4733
|
-
e.allowReserved !== !0 && (r = a[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords =
|
|
4733
|
+
e.allowReserved !== !0 && (r = a[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = O(r);
|
|
4734
4734
|
var i = (r ? r + " " : "") + a.strict;
|
|
4735
|
-
this.reservedWordsStrict =
|
|
4735
|
+
this.reservedWordsStrict = O(i), this.reservedWordsStrictBind = O(i + " " + a.strictBind), this.input = String(t), this.containsEsc = !1, n ? (this.pos = n, this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(b).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = y.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? me : pe), this.regexpState = null, this.privateNameStack = [];
|
|
4736
4736
|
}, N = {
|
|
4737
4737
|
inFunction: { configurable: !0 },
|
|
4738
4738
|
inGenerator: { configurable: !0 },
|
|
@@ -4752,37 +4752,37 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4752
4752
|
return e.parseTopLevel(t);
|
|
4753
4753
|
});
|
|
4754
4754
|
}, N.inFunction.get = function() {
|
|
4755
|
-
return (this.currentVarScope().flags & pe) > 0;
|
|
4756
|
-
}, N.inGenerator.get = function() {
|
|
4757
4755
|
return (this.currentVarScope().flags & me) > 0;
|
|
4756
|
+
}, N.inGenerator.get = function() {
|
|
4757
|
+
return (this.currentVarScope().flags & he) > 0;
|
|
4758
4758
|
}, N.inAsync.get = function() {
|
|
4759
|
-
return (this.currentVarScope().flags &
|
|
4759
|
+
return (this.currentVarScope().flags & A) > 0;
|
|
4760
4760
|
}, N.canAwait.get = function() {
|
|
4761
4761
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
4762
4762
|
var t = this.scopeStack[e].flags;
|
|
4763
|
-
if (t & (
|
|
4764
|
-
if (t &
|
|
4763
|
+
if (t & (be | xe)) return !1;
|
|
4764
|
+
if (t & me) return (t & A) > 0;
|
|
4765
4765
|
}
|
|
4766
4766
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
4767
4767
|
}, N.allowReturn.get = function() {
|
|
4768
|
-
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags &
|
|
4768
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & pe);
|
|
4769
4769
|
}, N.allowSuper.get = function() {
|
|
4770
|
-
return (this.currentThisScope().flags &
|
|
4770
|
+
return (this.currentThisScope().flags & ve) > 0 || this.options.allowSuperOutsideMethod;
|
|
4771
4771
|
}, N.allowDirectSuper.get = function() {
|
|
4772
|
-
return (this.currentThisScope().flags &
|
|
4772
|
+
return (this.currentThisScope().flags & ye) > 0;
|
|
4773
4773
|
}, N.treatFunctionsAsVar.get = function() {
|
|
4774
4774
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
4775
4775
|
}, N.allowNewDotTarget.get = function() {
|
|
4776
4776
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
4777
4777
|
var t = this.scopeStack[e].flags;
|
|
4778
|
-
if (t & (
|
|
4778
|
+
if (t & (be | xe) || t & me && !(t & ge)) return !0;
|
|
4779
4779
|
}
|
|
4780
4780
|
return !1;
|
|
4781
4781
|
}, N.allowUsing.get = function() {
|
|
4782
4782
|
var e = this.currentScope().flags;
|
|
4783
|
-
return !(e &
|
|
4783
|
+
return !(e & Se || !this.inModule && e & pe);
|
|
4784
4784
|
}, N.inClassStaticBlock.get = function() {
|
|
4785
|
-
return (this.currentVarScope().flags &
|
|
4785
|
+
return (this.currentVarScope().flags & be) > 0;
|
|
4786
4786
|
}, M.extend = function() {
|
|
4787
4787
|
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
4788
4788
|
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
@@ -4799,15 +4799,15 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4799
4799
|
P.strictDirective = function(e) {
|
|
4800
4800
|
if (this.options.ecmaVersion < 5) return !1;
|
|
4801
4801
|
for (;;) {
|
|
4802
|
-
|
|
4802
|
+
S.lastIndex = e, e += S.exec(this.input)[0].length;
|
|
4803
4803
|
var t = Ae.exec(this.input.slice(e));
|
|
4804
4804
|
if (!t) return !1;
|
|
4805
4805
|
if ((t[1] || t[2]) === "use strict") {
|
|
4806
|
-
|
|
4807
|
-
var n =
|
|
4806
|
+
S.lastIndex = e + t[0].length;
|
|
4807
|
+
var n = S.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
|
|
4808
4808
|
return i === ";" || i === "}" || b.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
|
|
4809
4809
|
}
|
|
4810
|
-
e += t[0].length,
|
|
4810
|
+
e += t[0].length, S.lastIndex = e, e += S.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
4811
4811
|
}
|
|
4812
4812
|
}, P.eat = function(e) {
|
|
4813
4813
|
return this.type === e ? (this.next(), !0) : !1;
|
|
@@ -4872,8 +4872,8 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4872
4872
|
var Me = { kind: "loop" }, Ne = { kind: "switch" };
|
|
4873
4873
|
F.isLet = function(e) {
|
|
4874
4874
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
4875
|
-
|
|
4876
|
-
var t =
|
|
4875
|
+
S.lastIndex = this.pos;
|
|
4876
|
+
var t = S.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
4877
4877
|
if (r === 91 || r === 92) return !0;
|
|
4878
4878
|
if (e) return !1;
|
|
4879
4879
|
if (r === 123) return !0;
|
|
@@ -4889,19 +4889,19 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4889
4889
|
return !1;
|
|
4890
4890
|
}, F.isAsyncFunction = function() {
|
|
4891
4891
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
4892
|
-
|
|
4893
|
-
var e =
|
|
4892
|
+
S.lastIndex = this.pos;
|
|
4893
|
+
var e = S.exec(this.input), t = this.pos + e[0].length, n;
|
|
4894
4894
|
return !b.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(p(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
4895
4895
|
}, F.isUsingKeyword = function(e, t) {
|
|
4896
4896
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
4897
|
-
|
|
4898
|
-
var n =
|
|
4897
|
+
S.lastIndex = this.pos;
|
|
4898
|
+
var n = S.exec(this.input), r = this.pos + n[0].length;
|
|
4899
4899
|
if (b.test(this.input.slice(this.pos, r))) return !1;
|
|
4900
4900
|
if (e) {
|
|
4901
4901
|
var i = r + 5, a;
|
|
4902
4902
|
if (this.input.slice(r, i) !== "using" || i === this.input.length || p(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
4903
|
-
|
|
4904
|
-
var o =
|
|
4903
|
+
S.lastIndex = i;
|
|
4904
|
+
var o = S.exec(this.input);
|
|
4905
4905
|
if (r = i + o[0].length, o && b.test(this.input.slice(i, r))) return !1;
|
|
4906
4906
|
}
|
|
4907
4907
|
var s = this.fullCharCodeAt(r);
|
|
@@ -4914,8 +4914,8 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4914
4914
|
var u = this.input.slice(l, r);
|
|
4915
4915
|
if (c.test(u)) return !1;
|
|
4916
4916
|
if (t && !e && u === "of") {
|
|
4917
|
-
|
|
4918
|
-
var d =
|
|
4917
|
+
S.lastIndex = r;
|
|
4918
|
+
var d = S.exec(this.input);
|
|
4919
4919
|
if (r += d[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
4920
4920
|
}
|
|
4921
4921
|
return !0;
|
|
@@ -4947,8 +4947,8 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4947
4947
|
case y._export:
|
|
4948
4948
|
case y._import:
|
|
4949
4949
|
if (this.options.ecmaVersion > 10 && r === y._import) {
|
|
4950
|
-
|
|
4951
|
-
var o =
|
|
4950
|
+
S.lastIndex = this.pos;
|
|
4951
|
+
var o = S.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
|
|
4952
4952
|
if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
|
|
4953
4953
|
}
|
|
4954
4954
|
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === y._import ? this.parseImport(i) : this.parseExport(i, n);
|
|
@@ -4996,7 +4996,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
4996
4996
|
}, F.parseReturnStatement = function(e) {
|
|
4997
4997
|
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(y.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
4998
4998
|
}, F.parseSwitchStatement = function(e) {
|
|
4999
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(y.braceL), this.labels.push(Ne), this.enterScope(
|
|
4999
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(y.braceL), this.labels.push(Ne), this.enterScope(Se);
|
|
5000
5000
|
for (var t, n = !1; this.type !== y.braceR;) if (this.type === y._case || this.type === y._default) {
|
|
5001
5001
|
var r = this.type === y._case;
|
|
5002
5002
|
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(y.colon);
|
|
@@ -5008,7 +5008,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5008
5008
|
var Pe = [];
|
|
5009
5009
|
F.parseCatchClauseParam = function() {
|
|
5010
5010
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
5011
|
-
return this.enterScope(t ?
|
|
5011
|
+
return this.enterScope(t ? _e : 0), this.checkLValPattern(e, t ? Oe : j), this.expect(y.parenR), e;
|
|
5012
5012
|
}, F.parseTryStatement = function(e) {
|
|
5013
5013
|
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === y._catch) {
|
|
5014
5014
|
var t = this.startNode();
|
|
@@ -5055,13 +5055,13 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5055
5055
|
}
|
|
5056
5056
|
return e;
|
|
5057
5057
|
}, F.parseVarId = function(e, t) {
|
|
5058
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ?
|
|
5058
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? Ee : j, !1);
|
|
5059
5059
|
};
|
|
5060
5060
|
var Fe = 1, Ie = 2, Le = 4;
|
|
5061
5061
|
F.parseFunction = function(e, t, n, r, i) {
|
|
5062
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === y.star && t & Ie && this.unexpected(), e.generator = this.eat(y.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & Fe && (e.id = t & Le && this.type !== y.name ? null : this.parseIdent(), e.id && !(t & Ie) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ?
|
|
5062
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === y.star && t & Ie && this.unexpected(), e.generator = this.eat(y.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & Fe && (e.id = t & Le && this.type !== y.name ? null : this.parseIdent(), e.id && !(t & Ie) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Ee : j : De));
|
|
5063
5063
|
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
5064
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
5064
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(we(e.async, e.generator)), t & Fe || (e.id = this.type === y.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, n, !1, i), this.yieldPos = a, this.awaitPos = o, this.awaitIdentPos = s, this.finishNode(e, t & Fe ? "FunctionDeclaration" : "FunctionExpression");
|
|
5065
5065
|
}, F.parseFunctionParams = function(e) {
|
|
5066
5066
|
this.expect(y.parenL), e.params = this.parseBindingList(y.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
5067
5067
|
}, F.parseClass = function(e, t) {
|
|
@@ -5100,17 +5100,17 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5100
5100
|
var a = e.value = this.parseMethod(t, n, r);
|
|
5101
5101
|
return e.kind === "get" && a.params.length !== 0 && this.raiseRecoverable(a.start, "getter should have no params"), e.kind === "set" && a.params.length !== 1 && this.raiseRecoverable(a.start, "setter should have exactly one param"), e.kind === "set" && a.params[0].type === "RestElement" && this.raiseRecoverable(a.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
5102
5102
|
}, F.parseClassField = function(e) {
|
|
5103
|
-
return L(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && L(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(y.eq) ? (this.enterScope(
|
|
5103
|
+
return L(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && L(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(y.eq) ? (this.enterScope(xe | ve), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
5104
5104
|
}, F.parseClassStaticBlock = function(e) {
|
|
5105
5105
|
e.body = [];
|
|
5106
5106
|
var t = this.labels;
|
|
5107
|
-
for (this.labels = [], this.enterScope(
|
|
5107
|
+
for (this.labels = [], this.enterScope(be | ve); this.type !== y.braceR;) {
|
|
5108
5108
|
var n = this.parseStatement(null);
|
|
5109
5109
|
e.body.push(n);
|
|
5110
5110
|
}
|
|
5111
5111
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
5112
5112
|
}, F.parseClassId = function(e, t) {
|
|
5113
|
-
this.type === y.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id,
|
|
5113
|
+
this.type === y.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, j, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
5114
5114
|
}, F.parseClassSuper = function(e) {
|
|
5115
5115
|
e.superClass = this.eat(y._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
5116
5116
|
}, F.enterClassBody = function() {
|
|
@@ -5123,7 +5123,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5123
5123
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
5124
5124
|
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
5125
5125
|
var o = n[a];
|
|
5126
|
-
|
|
5126
|
+
ie(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
5127
5127
|
}
|
|
5128
5128
|
};
|
|
5129
5129
|
function I(e, t) {
|
|
@@ -5167,7 +5167,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5167
5167
|
return this.semicolon(), r;
|
|
5168
5168
|
}
|
|
5169
5169
|
}, F.checkExport = function(e, t, n) {
|
|
5170
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
5170
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), ie(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
5171
5171
|
}, F.checkPatternExport = function(e, t) {
|
|
5172
5172
|
var n = t.type;
|
|
5173
5173
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
@@ -5202,13 +5202,13 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5202
5202
|
return this.next(), this.type === y.string ? (e.specifiers = Pe, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === y.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
5203
5203
|
}, F.parseImportSpecifier = function() {
|
|
5204
5204
|
var e = this.startNode();
|
|
5205
|
-
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local,
|
|
5205
|
+
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, j), this.finishNode(e, "ImportSpecifier");
|
|
5206
5206
|
}, F.parseImportDefaultSpecifier = function() {
|
|
5207
5207
|
var e = this.startNode();
|
|
5208
|
-
return e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
5208
|
+
return e.local = this.parseIdent(), this.checkLValSimple(e.local, j), this.finishNode(e, "ImportDefaultSpecifier");
|
|
5209
5209
|
}, F.parseImportNamespaceSpecifier = function() {
|
|
5210
5210
|
var e = this.startNode();
|
|
5211
|
-
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
5211
|
+
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, j), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
5212
5212
|
}, F.parseImportSpecifiers = function() {
|
|
5213
5213
|
var e = [], t = !0;
|
|
5214
5214
|
if (this.type === y.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(y.comma))) return e;
|
|
@@ -5227,7 +5227,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5227
5227
|
if (n) n = !1;
|
|
5228
5228
|
else if (this.expect(y.comma), this.afterTrailingComma(y.braceR)) break;
|
|
5229
5229
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
5230
|
-
|
|
5230
|
+
ie(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
5231
5231
|
}
|
|
5232
5232
|
return e;
|
|
5233
5233
|
}, F.parseImportAttribute = function() {
|
|
@@ -5236,7 +5236,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5236
5236
|
}, F.parseModuleExportName = function() {
|
|
5237
5237
|
if (this.options.ecmaVersion >= 13 && this.type === y.string) {
|
|
5238
5238
|
var e = this.parseLiteral(this.value);
|
|
5239
|
-
return
|
|
5239
|
+
return oe.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
5240
5240
|
}
|
|
5241
5241
|
return this.parseIdent(!0);
|
|
5242
5242
|
}, F.adaptDirectivePrologue = function(e) {
|
|
@@ -5327,11 +5327,11 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5327
5327
|
var r = this.startNodeAt(e, t);
|
|
5328
5328
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
5329
5329
|
}, R.checkLValSimple = function(e, t, n) {
|
|
5330
|
-
t === void 0 && (t =
|
|
5331
|
-
var r = t !==
|
|
5330
|
+
t === void 0 && (t = Te);
|
|
5331
|
+
var r = t !== Te;
|
|
5332
5332
|
switch (e.type) {
|
|
5333
5333
|
case "Identifier":
|
|
5334
|
-
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t ===
|
|
5334
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === j && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (ie(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== ke && this.declareName(e.name, t, e.start));
|
|
5335
5335
|
break;
|
|
5336
5336
|
case "ChainExpression":
|
|
5337
5337
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -5343,7 +5343,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5343
5343
|
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
5344
5344
|
}
|
|
5345
5345
|
}, R.checkLValPattern = function(e, t, n) {
|
|
5346
|
-
switch (t === void 0 && (t =
|
|
5346
|
+
switch (t === void 0 && (t = Te), e.type) {
|
|
5347
5347
|
case "ObjectPattern":
|
|
5348
5348
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
5349
5349
|
var a = i[r];
|
|
@@ -5359,7 +5359,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5359
5359
|
default: this.checkLValSimple(e, t, n);
|
|
5360
5360
|
}
|
|
5361
5361
|
}, R.checkLValInnerPattern = function(e, t, n) {
|
|
5362
|
-
switch (t === void 0 && (t =
|
|
5362
|
+
switch (t === void 0 && (t = Te), e.type) {
|
|
5363
5363
|
case "Property":
|
|
5364
5364
|
this.checkLValInnerPattern(e.value, t, n);
|
|
5365
5365
|
break;
|
|
@@ -5738,10 +5738,10 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5738
5738
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
5739
5739
|
}, H.parseMethod = function(e, t, n) {
|
|
5740
5740
|
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
5741
|
-
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
5741
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(we(t, r.generator) | ve | (n ? ye : 0)), this.expect(y.parenL), r.params = this.parseBindingList(y.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(r, "FunctionExpression");
|
|
5742
5742
|
}, H.parseArrowExpression = function(e, t, n, r) {
|
|
5743
5743
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
5744
|
-
return this.enterScope(
|
|
5744
|
+
return this.enterScope(we(n, !1) | ge), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(e, "ArrowFunctionExpression");
|
|
5745
5745
|
}, H.parseFunctionBody = function(e, t, n, r) {
|
|
5746
5746
|
var i = t && this.type !== y.braceL, a = this.strict, o = !1;
|
|
5747
5747
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
@@ -5758,7 +5758,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5758
5758
|
}, H.checkParams = function(e, t) {
|
|
5759
5759
|
for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
|
|
5760
5760
|
var a = i[r];
|
|
5761
|
-
this.checkLValInnerPattern(a,
|
|
5761
|
+
this.checkLValInnerPattern(a, Ee, t ? null : n);
|
|
5762
5762
|
}
|
|
5763
5763
|
}, H.parseExprList = function(e, t, n, r) {
|
|
5764
5764
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
@@ -5770,7 +5770,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5770
5770
|
return i;
|
|
5771
5771
|
}, H.checkUnreserved = function(e) {
|
|
5772
5772
|
var t = e.start, n = e.end, r = e.name;
|
|
5773
|
-
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags &
|
|
5773
|
+
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & Ce) && r === "arguments" && this.raiseRecoverable(t, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (r === "arguments" || r === "await") && this.raise(t, "Cannot use " + r + " in class static initialization block"), this.keywords.test(r) && this.raise(t, "Unexpected keyword '" + r + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(t, n).indexOf("\\") !== -1) && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(r) && (!this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t, "The keyword '" + r + "' is reserved"));
|
|
5774
5774
|
}, H.parseIdent = function(e) {
|
|
5775
5775
|
var t = this.parseIdentNode();
|
|
5776
5776
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
@@ -5791,12 +5791,12 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5791
5791
|
};
|
|
5792
5792
|
var Ve = M.prototype;
|
|
5793
5793
|
Ve.raise = function(e, t) {
|
|
5794
|
-
var n =
|
|
5794
|
+
var n = k(this.input, e);
|
|
5795
5795
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
5796
5796
|
var r = SyntaxError(t);
|
|
5797
5797
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
5798
5798
|
}, Ve.raiseRecoverable = Ve.raise, Ve.curPosition = function() {
|
|
5799
|
-
if (this.options.locations) return new
|
|
5799
|
+
if (this.options.locations) return new se(this.curLine, this.pos - this.lineStart);
|
|
5800
5800
|
};
|
|
5801
5801
|
var He = M.prototype, Ue = function(e) {
|
|
5802
5802
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
@@ -5806,23 +5806,23 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5806
5806
|
}, He.exitScope = function() {
|
|
5807
5807
|
this.scopeStack.pop();
|
|
5808
5808
|
}, He.treatFunctionsAsVarInScope = function(e) {
|
|
5809
|
-
return e.flags &
|
|
5809
|
+
return e.flags & me || !this.inModule && e.flags & pe;
|
|
5810
5810
|
}, He.declareName = function(e, t, n) {
|
|
5811
5811
|
var r = !1;
|
|
5812
|
-
if (t ===
|
|
5812
|
+
if (t === j) {
|
|
5813
5813
|
var i = this.currentScope();
|
|
5814
|
-
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags &
|
|
5814
|
+
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & pe && delete this.undefinedExports[e];
|
|
5815
5815
|
} else if (t === Oe) this.currentScope().lexical.push(e);
|
|
5816
5816
|
else if (t === De) {
|
|
5817
5817
|
var a = this.currentScope();
|
|
5818
5818
|
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
5819
5819
|
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
5820
5820
|
var s = this.scopeStack[o];
|
|
5821
|
-
if (s.lexical.indexOf(e) > -1 && !(s.flags &
|
|
5821
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & _e && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
5822
5822
|
r = !0;
|
|
5823
5823
|
break;
|
|
5824
5824
|
}
|
|
5825
|
-
if (s.var.push(e), this.inModule && s.flags &
|
|
5825
|
+
if (s.var.push(e), this.inModule && s.flags & pe && delete this.undefinedExports[e], s.flags & Ce) break;
|
|
5826
5826
|
}
|
|
5827
5827
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
5828
5828
|
}, He.checkLocalExport = function(e) {
|
|
@@ -5832,16 +5832,16 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5832
5832
|
}, He.currentVarScope = function() {
|
|
5833
5833
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
5834
5834
|
var t = this.scopeStack[e];
|
|
5835
|
-
if (t.flags & (
|
|
5835
|
+
if (t.flags & (Ce | xe | be)) return t;
|
|
5836
5836
|
}
|
|
5837
5837
|
}, He.currentThisScope = function() {
|
|
5838
5838
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
5839
5839
|
var t = this.scopeStack[e];
|
|
5840
|
-
if (t.flags & (
|
|
5840
|
+
if (t.flags & (Ce | xe | be) && !(t.flags & ge)) return t;
|
|
5841
5841
|
}
|
|
5842
5842
|
};
|
|
5843
5843
|
var We = function(e, t, n) {
|
|
5844
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
5844
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new ce(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
5845
5845
|
}, U = M.prototype;
|
|
5846
5846
|
U.startNode = function() {
|
|
5847
5847
|
return new We(this, this.start, this.startLoc);
|
|
@@ -5884,11 +5884,11 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
5884
5884
|
}, it = {};
|
|
5885
5885
|
function at(e) {
|
|
5886
5886
|
var t = it[e] = {
|
|
5887
|
-
binary:
|
|
5888
|
-
binaryOfStrings:
|
|
5887
|
+
binary: O(Ye[e] + " " + Ze),
|
|
5888
|
+
binaryOfStrings: O(Xe[e]),
|
|
5889
5889
|
nonBinary: {
|
|
5890
|
-
General_Category:
|
|
5891
|
-
Script:
|
|
5890
|
+
General_Category: O(Ze),
|
|
5891
|
+
Script: O(rt[e])
|
|
5892
5892
|
}
|
|
5893
5893
|
};
|
|
5894
5894
|
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
@@ -6047,7 +6047,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6047
6047
|
}
|
|
6048
6048
|
return !1;
|
|
6049
6049
|
}, q.regexp_eatModifiers = function(e) {
|
|
6050
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 && dt(n);) t +=
|
|
6050
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && dt(n);) t += ae(n), e.advance();
|
|
6051
6051
|
return t;
|
|
6052
6052
|
};
|
|
6053
6053
|
function dt(e) {
|
|
@@ -6086,7 +6086,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6086
6086
|
return !1;
|
|
6087
6087
|
}, q.regexp_eatRegExpIdentifierName = function(e) {
|
|
6088
6088
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
6089
|
-
for (e.lastStringValue +=
|
|
6089
|
+
for (e.lastStringValue += ae(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += ae(e.lastIntValue);
|
|
6090
6090
|
return !0;
|
|
6091
6091
|
}
|
|
6092
6092
|
return !1;
|
|
@@ -6212,14 +6212,14 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6212
6212
|
}
|
|
6213
6213
|
return _t;
|
|
6214
6214
|
}, q.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
6215
|
-
|
|
6215
|
+
ie(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
6216
6216
|
}, q.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
6217
6217
|
if (e.unicodeProperties.binary.test(t)) return vt;
|
|
6218
6218
|
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return Y;
|
|
6219
6219
|
e.raise("Invalid property name");
|
|
6220
6220
|
}, q.regexp_eatUnicodePropertyName = function(e) {
|
|
6221
6221
|
var t = 0;
|
|
6222
|
-
for (e.lastStringValue = ""; X(t = e.current());) e.lastStringValue +=
|
|
6222
|
+
for (e.lastStringValue = ""; X(t = e.current());) e.lastStringValue += ae(t), e.advance();
|
|
6223
6223
|
return e.lastStringValue !== "";
|
|
6224
6224
|
};
|
|
6225
6225
|
function X(e) {
|
|
@@ -6227,7 +6227,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6227
6227
|
}
|
|
6228
6228
|
q.regexp_eatUnicodePropertyValue = function(e) {
|
|
6229
6229
|
var t = 0;
|
|
6230
|
-
for (e.lastStringValue = ""; bt(t = e.current());) e.lastStringValue +=
|
|
6230
|
+
for (e.lastStringValue = ""; bt(t = e.current());) e.lastStringValue += ae(t), e.advance();
|
|
6231
6231
|
return e.lastStringValue !== "";
|
|
6232
6232
|
};
|
|
6233
6233
|
function bt(e) {
|
|
@@ -6409,7 +6409,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6409
6409
|
return !0;
|
|
6410
6410
|
};
|
|
6411
6411
|
var Z = function(e) {
|
|
6412
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
6412
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new ce(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
6413
6413
|
}, Q = M.prototype;
|
|
6414
6414
|
Q.next = function(e) {
|
|
6415
6415
|
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Z(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
@@ -6470,7 +6470,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6470
6470
|
default: break loop;
|
|
6471
6471
|
}
|
|
6472
6472
|
break;
|
|
6473
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
6473
|
+
default: if (e > 8 && e < 14 || e >= 5760 && re.test(String.fromCharCode(e))) ++this.pos;
|
|
6474
6474
|
else break loop;
|
|
6475
6475
|
}
|
|
6476
6476
|
}
|
|
@@ -6517,7 +6517,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6517
6517
|
}, Q.readToken_numberSign = function() {
|
|
6518
6518
|
var e = this.options.ecmaVersion, t = 35;
|
|
6519
6519
|
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), f(t, !0) || t === 92)) return this.finishToken(y.privateId, this.readWord1());
|
|
6520
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
6520
|
+
this.raise(this.pos, "Unexpected character '" + ae(t) + "'");
|
|
6521
6521
|
}, Q.getTokenFromCode = function(e) {
|
|
6522
6522
|
switch (e) {
|
|
6523
6523
|
case 46: return this.readToken_dot();
|
|
@@ -6567,7 +6567,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6567
6567
|
case 126: return this.finishOp(y.prefix, 1);
|
|
6568
6568
|
case 35: return this.readToken_numberSign();
|
|
6569
6569
|
}
|
|
6570
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
6570
|
+
this.raise(this.pos, "Unexpected character '" + ae(e) + "'");
|
|
6571
6571
|
}, Q.finishOp = function(e, t) {
|
|
6572
6572
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
6573
6573
|
return this.pos += t, this.finishToken(e, n);
|
|
@@ -6705,7 +6705,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6705
6705
|
case 110: return "\n";
|
|
6706
6706
|
case 114: return "\r";
|
|
6707
6707
|
case 120: return String.fromCharCode(this.readHexChar(2));
|
|
6708
|
-
case 117: return
|
|
6708
|
+
case 117: return ae(this.readCodePoint());
|
|
6709
6709
|
case 116: return " ";
|
|
6710
6710
|
case 98: return "\b";
|
|
6711
6711
|
case 118: return "\v";
|
|
@@ -6737,7 +6737,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6737
6737
|
var a = this.pos;
|
|
6738
6738
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
6739
6739
|
var o = this.readCodePoint();
|
|
6740
|
-
(t ? f : p)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e +=
|
|
6740
|
+
(t ? f : p)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += ae(o), n = this.pos;
|
|
6741
6741
|
} else break;
|
|
6742
6742
|
t = !1;
|
|
6743
6743
|
}
|
|
@@ -6750,10 +6750,10 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6750
6750
|
M.acorn = {
|
|
6751
6751
|
Parser: M,
|
|
6752
6752
|
version: jt,
|
|
6753
|
-
defaultOptions:
|
|
6754
|
-
Position:
|
|
6755
|
-
SourceLocation:
|
|
6756
|
-
getLineInfo:
|
|
6753
|
+
defaultOptions: le,
|
|
6754
|
+
Position: se,
|
|
6755
|
+
SourceLocation: ce,
|
|
6756
|
+
getLineInfo: k,
|
|
6757
6757
|
Node: We,
|
|
6758
6758
|
TokenType: m,
|
|
6759
6759
|
tokTypes: y,
|
|
@@ -6766,7 +6766,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6766
6766
|
isNewLine: ne,
|
|
6767
6767
|
lineBreak: b,
|
|
6768
6768
|
lineBreakG: te,
|
|
6769
|
-
nonASCIIwhitespace:
|
|
6769
|
+
nonASCIIwhitespace: re
|
|
6770
6770
|
};
|
|
6771
6771
|
function Mt(e, t) {
|
|
6772
6772
|
return M.parse(e, t);
|
|
@@ -6777,7 +6777,7 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
6777
6777
|
function Pt(e, t) {
|
|
6778
6778
|
return M.tokenizer(e, t);
|
|
6779
6779
|
}
|
|
6780
|
-
e.Node = We, e.Parser = M, e.Position =
|
|
6780
|
+
e.Node = We, e.Parser = M, e.Position = se, e.SourceLocation = ce, e.TokContext = z, e.Token = Z, e.TokenType = m, e.defaultOptions = le, e.getLineInfo = k, e.isIdentifierChar = p, e.isIdentifierStart = f, e.isNewLine = ne, e.keywordTypes = ee, e.lineBreak = b, e.lineBreakG = te, e.nonASCIIwhitespace = re, e.parse = Mt, e.parseExpressionAt = Nt, e.tokContexts = B, e.tokTypes = y, e.tokenizer = Pt, e.version = jt;
|
|
6781
6781
|
}));
|
|
6782
6782
|
})), Wt = /* @__PURE__ */ f((/* @__PURE__ */ u(((e, t) => {
|
|
6783
6783
|
var n = Ht(), r = /^[\da-fA-F]+$/, i = /^\d+$/, a = /* @__PURE__ */ new WeakMap();
|
|
@@ -7008,11 +7008,81 @@ var Ht = /* @__PURE__ */ u(((e, t) => {
|
|
|
7008
7008
|
}
|
|
7009
7009
|
};
|
|
7010
7010
|
}
|
|
7011
|
-
})))(), 1)
|
|
7012
|
-
|
|
7011
|
+
})))(), 1), Gt = class e extends Error {
|
|
7012
|
+
type;
|
|
7013
|
+
location;
|
|
7014
|
+
fileName;
|
|
7015
|
+
snippet;
|
|
7016
|
+
source;
|
|
7017
|
+
cause;
|
|
7018
|
+
constructor(t, n) {
|
|
7019
|
+
super(t), this.name = "JsxParserError", this.type = n.type, this.location = n.location, this.fileName = n.fileName, this.snippet = n.snippet, this.source = n.source, this.cause = n.cause, Object.setPrototypeOf(this, e.prototype);
|
|
7020
|
+
}
|
|
7021
|
+
};
|
|
7022
|
+
function Kt(e) {
|
|
7023
|
+
let t = e.filter((e) => !e.startsWith("{")).reduce((e, t) => {
|
|
7024
|
+
let n = t.match(/^(\s*)\S+/)?.[1];
|
|
7025
|
+
return n ? Math.min(n.length, e ?? Infinity) : e;
|
|
7026
|
+
}, void 0);
|
|
7027
|
+
return e.map((e) => e.replace(RegExp(`^\\s{${t ?? 0}}`), ""));
|
|
7028
|
+
}
|
|
7029
|
+
function qt(e, t) {
|
|
7030
|
+
let n = Math.max(0, t - 3), r = Math.min(e.length, t + 2);
|
|
7031
|
+
return `~~~jsx\n${e.slice(n, r).map((e, r) => {
|
|
7032
|
+
let i = n + r + 1;
|
|
7033
|
+
return `${i === t ? ">>> " : " "}${i}: ${e}`;
|
|
7034
|
+
}).join("\n")}\n~~~`;
|
|
7035
|
+
}
|
|
7036
|
+
function Jt(e, t, n) {
|
|
7037
|
+
return `**${e}**\n\n${t}\n${n}`;
|
|
7038
|
+
}
|
|
7039
|
+
function Yt(e, t, n) {
|
|
7040
|
+
let r = Math.max(0, t), i = e.slice(0, r);
|
|
7041
|
+
return {
|
|
7042
|
+
line: i.split("\n").length,
|
|
7043
|
+
column: r - (i.lastIndexOf("\n") + 1),
|
|
7044
|
+
startOffset: r,
|
|
7045
|
+
endOffset: Math.max(r, n)
|
|
7046
|
+
};
|
|
7047
|
+
}
|
|
7048
|
+
function Xt({ type: e, message: t, source: n, start: r, end: i, fileName: a, cause: o }) {
|
|
7049
|
+
let s = Yt(n, r, i), c = qt(n.split("\n"), s.line);
|
|
7050
|
+
return new Gt(Jt(t, `Error occurred at line \`${s.line}\`${a ? ` of \`${a}\`` : ""}:`, c), {
|
|
7051
|
+
type: e,
|
|
7052
|
+
location: s,
|
|
7053
|
+
fileName: a,
|
|
7054
|
+
snippet: c,
|
|
7055
|
+
source: n.slice(s.startOffset, s.endOffset),
|
|
7056
|
+
cause: o
|
|
7057
|
+
});
|
|
7058
|
+
}
|
|
7059
|
+
function Zt(e) {
|
|
7060
|
+
let { type: t, message: n, bodyLines: r, line: i, functionName: a, fileName: o, cause: s } = e, c = qt(r, i), l = `line \`${i}\`${o ? ` of \`${o}\`` : ""}`;
|
|
7061
|
+
return new Gt(Jt(n, a ? `Error occurred in dynamic function \`${a}\` at ${l}:` : `Error occurred at ${l}:`, c), {
|
|
7062
|
+
type: t,
|
|
7063
|
+
location: { line: i },
|
|
7064
|
+
fileName: o,
|
|
7065
|
+
snippet: c,
|
|
7066
|
+
source: r[i - 1],
|
|
7067
|
+
cause: s
|
|
7068
|
+
});
|
|
7069
|
+
}
|
|
7070
|
+
function Qt(e) {
|
|
7071
|
+
let t = {
|
|
7072
|
+
"&": "&",
|
|
7073
|
+
"<": "<",
|
|
7074
|
+
">": ">",
|
|
7075
|
+
"\"": """,
|
|
7076
|
+
"'": "'"
|
|
7077
|
+
};
|
|
7078
|
+
return e.replace(/[&<>"']/g, (e) => t[e]);
|
|
7079
|
+
}
|
|
7080
|
+
//#endregion
|
|
7081
|
+
//#region source/helpers/functionUtilities.ts
|
|
7082
|
+
function $t(e) {
|
|
7013
7083
|
return e.type === "SpreadElement";
|
|
7014
7084
|
}
|
|
7015
|
-
function
|
|
7085
|
+
function en(e) {
|
|
7016
7086
|
let t = /* @__PURE__ */ new Set(), n = (e, r = /* @__PURE__ */ new Set()) => {
|
|
7017
7087
|
if (e) switch (e.type) {
|
|
7018
7088
|
case "Identifier":
|
|
@@ -7020,7 +7090,7 @@ function Kt(e) {
|
|
|
7020
7090
|
break;
|
|
7021
7091
|
case "ArrayExpression":
|
|
7022
7092
|
(e.elements || []).forEach((e) => {
|
|
7023
|
-
if (
|
|
7093
|
+
if ($t(e)) {
|
|
7024
7094
|
n(e.argument, r);
|
|
7025
7095
|
return;
|
|
7026
7096
|
}
|
|
@@ -7092,7 +7162,7 @@ function Kt(e) {
|
|
|
7092
7162
|
break;
|
|
7093
7163
|
case "ObjectExpression":
|
|
7094
7164
|
(e.properties || []).forEach((e) => {
|
|
7095
|
-
if (
|
|
7165
|
+
if ($t(e)) {
|
|
7096
7166
|
n(e.argument, r);
|
|
7097
7167
|
return;
|
|
7098
7168
|
}
|
|
@@ -7108,14 +7178,14 @@ function Kt(e) {
|
|
|
7108
7178
|
};
|
|
7109
7179
|
return n(e), Array.from(t.values());
|
|
7110
7180
|
}
|
|
7111
|
-
function
|
|
7112
|
-
let
|
|
7113
|
-
return (
|
|
7181
|
+
function tn(e, t, n, r = 0) {
|
|
7182
|
+
let i = I.extend(Wt.default({ autoCloseVoidElements: !0 })).parse(e, { ecmaVersion: "latest" });
|
|
7183
|
+
return (a) => n(e, i.body[0], {
|
|
7114
7184
|
...t,
|
|
7115
|
-
...
|
|
7116
|
-
});
|
|
7185
|
+
...a
|
|
7186
|
+
}, r);
|
|
7117
7187
|
}
|
|
7118
|
-
function
|
|
7188
|
+
function nn(e) {
|
|
7119
7189
|
let t = I.extend(Wt.default({ autoCloseVoidElements: !0 })).parse(`function dummy() ${e}`, { ecmaVersion: "latest" }), n = [], r = (e) => {
|
|
7120
7190
|
if (e) switch (e.type) {
|
|
7121
7191
|
case "JSXElement":
|
|
@@ -7133,53 +7203,51 @@ function Jt(e) {
|
|
|
7133
7203
|
};
|
|
7134
7204
|
return r(t), n;
|
|
7135
7205
|
}
|
|
7136
|
-
function
|
|
7137
|
-
let
|
|
7138
|
-
if (
|
|
7139
|
-
let
|
|
7140
|
-
|
|
7141
|
-
}), !
|
|
7142
|
-
let
|
|
7143
|
-
return
|
|
7144
|
-
|
|
7145
|
-
}), [
|
|
7206
|
+
function rn(e, t, n, r = (e) => e) {
|
|
7207
|
+
let i = {}, a = [];
|
|
7208
|
+
if (nn(e).forEach((o, s) => {
|
|
7209
|
+
let c = `renderJSXElementWrapper_${s}`;
|
|
7210
|
+
i[c] = tn(e.slice(o.start, o.end), t, n, r(o.start)), a.push([`${e.slice(o.start, o.end)}`, `__jsxRenderContext__.${c}({ ${en(o).join(", ")} })`]);
|
|
7211
|
+
}), !a.length) return [e, {}];
|
|
7212
|
+
let o = `{ const __jsxRenderContext__ = this;\r\n${e.slice(1)}`;
|
|
7213
|
+
return a.forEach(([e, t]) => {
|
|
7214
|
+
o = o.replace(e, t);
|
|
7215
|
+
}), [o, i];
|
|
7146
7216
|
}
|
|
7147
|
-
function
|
|
7148
|
-
let
|
|
7149
|
-
|
|
7150
|
-
|
|
7151
|
-
}, void 0);
|
|
7152
|
-
return e.map((e) => e.replace(RegExp(`^\\s{${t ?? 0}}`), ""));
|
|
7153
|
-
}
|
|
7154
|
-
function Zt(e, t, n = "anonymous", r) {
|
|
7155
|
-
let i = `dynamic-${n}-${Math.random().toString(36).substring(2, 9)}.js`, a = t.match(/^\{{1}([\S\s]*)\}{1}$/)?.[1] ?? t;
|
|
7156
|
-
a = a.replace(/^\n+|\n+$/g, "");
|
|
7157
|
-
let o = `//# sourceURL=${i}\n${a}`, s = Function(...e, o);
|
|
7217
|
+
function an(e, t, n = "anonymous", r, i) {
|
|
7218
|
+
let a = `dynamic-${n}-${Math.random().toString(36).substring(2, 9)}.js`, o = t.match(/^\{{1}([\S\s]*)\}{1}$/)?.[1] ?? t;
|
|
7219
|
+
o = o.replace(/^\n+|\n+$/g, "");
|
|
7220
|
+
let s = `//# sourceURL=${a}\n${o}`, c = Function(...e, s);
|
|
7158
7221
|
return function(...e) {
|
|
7159
7222
|
try {
|
|
7160
|
-
return
|
|
7223
|
+
return c.apply(this, e);
|
|
7161
7224
|
} catch (e) {
|
|
7162
|
-
let t = e.stack.split("\n").find((e) => e.includes(
|
|
7163
|
-
|
|
7164
|
-
|
|
7165
|
-
|
|
7166
|
-
|
|
7167
|
-
|
|
7225
|
+
let t = e.stack.split("\n").find((e) => e.includes(a)), s = parseInt(t?.match(/:(\d+):/)?.[1], 10) - 3, c = Kt(o.split("\n")), l = Zt({
|
|
7226
|
+
type: "function-runtime",
|
|
7227
|
+
message: e.message,
|
|
7228
|
+
bodyLines: c,
|
|
7229
|
+
line: s,
|
|
7230
|
+
functionName: n,
|
|
7231
|
+
fileName: i,
|
|
7232
|
+
cause: e
|
|
7233
|
+
});
|
|
7234
|
+
if (r) {
|
|
7235
|
+
r(l);
|
|
7168
7236
|
return;
|
|
7169
7237
|
}
|
|
7170
|
-
throw
|
|
7238
|
+
throw l;
|
|
7171
7239
|
}
|
|
7172
7240
|
};
|
|
7173
7241
|
}
|
|
7174
7242
|
//#endregion
|
|
7175
7243
|
//#region source/constants/attributeNames.ts
|
|
7176
|
-
var
|
|
7244
|
+
var on = {
|
|
7177
7245
|
class: "className",
|
|
7178
7246
|
for: "htmlFor",
|
|
7179
7247
|
maxlength: "maxLength",
|
|
7180
7248
|
colspan: "colSpan",
|
|
7181
7249
|
rowspan: "rowSpan"
|
|
7182
|
-
},
|
|
7250
|
+
}, sn = [
|
|
7183
7251
|
"area",
|
|
7184
7252
|
"base",
|
|
7185
7253
|
"br",
|
|
@@ -7196,45 +7264,45 @@ var Qt = {
|
|
|
7196
7264
|
"source",
|
|
7197
7265
|
"track",
|
|
7198
7266
|
"wbr"
|
|
7199
|
-
],
|
|
7267
|
+
], cn = [
|
|
7200
7268
|
"table",
|
|
7201
7269
|
"tbody",
|
|
7202
7270
|
"tfoot",
|
|
7203
7271
|
"thead",
|
|
7204
7272
|
"tr"
|
|
7205
7273
|
];
|
|
7206
|
-
function
|
|
7207
|
-
return
|
|
7274
|
+
function ln(e) {
|
|
7275
|
+
return sn.indexOf(e.toLowerCase()) === -1;
|
|
7208
7276
|
}
|
|
7209
|
-
function
|
|
7210
|
-
return
|
|
7277
|
+
function un(e) {
|
|
7278
|
+
return cn.indexOf(e.toLowerCase()) !== -1;
|
|
7211
7279
|
}
|
|
7212
7280
|
//#endregion
|
|
7213
7281
|
//#region source/helpers/hash.ts
|
|
7214
|
-
var
|
|
7282
|
+
var dn = (e = "", t = 16) => {
|
|
7215
7283
|
let n = String(e), r = 0;
|
|
7216
7284
|
return n.split("").forEach((e) => {
|
|
7217
7285
|
r = (r << 5) - r + e.charCodeAt(0), r &= r;
|
|
7218
7286
|
}), Math.abs(r).toString(t);
|
|
7219
|
-
},
|
|
7287
|
+
}, fn = () => dn(Math.random().toString()), pn = (e) => e.replace(/([A-Z])([A-Z])/g, "$1 $2").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[^a-zA-Z\u00C0-\u00ff]/g, " ").toLowerCase().split(" ").filter((e) => e).map((e, t) => t > 0 ? e[0].toUpperCase() + e.slice(1) : e).join(""), mn = (e) => {
|
|
7220
7288
|
switch (typeof e) {
|
|
7221
7289
|
case "string": return e.split(";").filter((e) => e).reduce((e, t) => {
|
|
7222
7290
|
let n = t.slice(0, t.indexOf(":")).trim(), r = t.slice(t.indexOf(":") + 1).trim();
|
|
7223
7291
|
return {
|
|
7224
7292
|
...e,
|
|
7225
|
-
[
|
|
7293
|
+
[pn(n)]: r
|
|
7226
7294
|
};
|
|
7227
7295
|
}, {});
|
|
7228
7296
|
case "object": return e;
|
|
7229
7297
|
default: return;
|
|
7230
7298
|
}
|
|
7231
|
-
},
|
|
7299
|
+
}, hn = (e) => e == null || e === "" ? [] : e.split("."), gn = (e, t) => {
|
|
7232
7300
|
let [n, ...r] = t;
|
|
7233
|
-
if (!(e == null || n == null)) return r.length === 0 ? e[n] :
|
|
7234
|
-
},
|
|
7301
|
+
if (!(e == null || n == null)) return r.length === 0 ? e[n] : gn(e[n], r);
|
|
7302
|
+
}, _n = (e, t) => gn(e, hn(t));
|
|
7235
7303
|
//#endregion
|
|
7236
7304
|
//#region source/helpers/functionProxy.ts
|
|
7237
|
-
function
|
|
7305
|
+
function vn(e, t) {
|
|
7238
7306
|
let n = e;
|
|
7239
7307
|
return n.scope = t, new Proxy(n, { apply: (e, t, n) => Reflect.apply(e, {
|
|
7240
7308
|
...e.scope,
|
|
@@ -7242,8 +7310,8 @@ function dn(e, t) {
|
|
|
7242
7310
|
}, n) });
|
|
7243
7311
|
}
|
|
7244
7312
|
//#endregion
|
|
7245
|
-
//#region source/
|
|
7246
|
-
var
|
|
7313
|
+
//#region source/components/JsxParser.tsx
|
|
7314
|
+
var yn = 6, bn = class i extends e.Component {
|
|
7247
7315
|
static displayName = "JsxParser";
|
|
7248
7316
|
static defaultProps = {
|
|
7249
7317
|
allowUnknownElements: !0,
|
|
@@ -7256,6 +7324,7 @@ var fn = class i extends e.Component {
|
|
|
7256
7324
|
componentsOnly: !1,
|
|
7257
7325
|
disableFragments: !1,
|
|
7258
7326
|
disableKeyGeneration: !1,
|
|
7327
|
+
fileName: void 0,
|
|
7259
7328
|
jsx: "",
|
|
7260
7329
|
onError: () => {},
|
|
7261
7330
|
showWarnings: !1,
|
|
@@ -7266,200 +7335,242 @@ var fn = class i extends e.Component {
|
|
|
7266
7335
|
ParsedChildren = null;
|
|
7267
7336
|
lastAttributeName = void 0;
|
|
7268
7337
|
jsx = "";
|
|
7269
|
-
#e =
|
|
7270
|
-
#t =
|
|
7338
|
+
#e = "";
|
|
7339
|
+
#t = 0;
|
|
7340
|
+
#n = [];
|
|
7341
|
+
#r = (e) => this.jsx.slice(e.start, e.end);
|
|
7342
|
+
#i = () => this.#n.length ? this.#n[this.#n.length - 1] : void 0;
|
|
7343
|
+
#a = (e) => {
|
|
7344
|
+
let t = 0;
|
|
7345
|
+
return new Proxy(e, { apply: (e, n, r) => {
|
|
7346
|
+
let i = t;
|
|
7347
|
+
t += 1, this.#n.push(i);
|
|
7348
|
+
try {
|
|
7349
|
+
return Reflect.apply(e, n, r);
|
|
7350
|
+
} finally {
|
|
7351
|
+
this.#n.pop();
|
|
7352
|
+
}
|
|
7353
|
+
} });
|
|
7354
|
+
};
|
|
7355
|
+
#o = (e) => ({
|
|
7356
|
+
fileName: this.props.fileName,
|
|
7357
|
+
source: this.#r(e),
|
|
7358
|
+
location: Yt(this.#e || this.jsx, e.start - this.#t, e.end - this.#t),
|
|
7359
|
+
loopIndex: this.#i(),
|
|
7360
|
+
astNode: e
|
|
7361
|
+
});
|
|
7362
|
+
#s = (e, t, n, r) => Xt({
|
|
7363
|
+
type: e,
|
|
7364
|
+
message: t,
|
|
7365
|
+
source: this.#e || this.jsx,
|
|
7366
|
+
start: n.start - this.#t,
|
|
7367
|
+
end: n.end - this.#t,
|
|
7368
|
+
fileName: this.props.fileName,
|
|
7369
|
+
cause: r
|
|
7370
|
+
});
|
|
7371
|
+
#c = (e) => {
|
|
7271
7372
|
let t = I.extend(Wt.default({ autoCloseVoidElements: this.props.autoCloseVoidElements })), n = `<root>${e}</root>`;
|
|
7272
|
-
this.jsx = n;
|
|
7373
|
+
this.jsx = n, this.#e = e, this.#t = yn, this.#n = [];
|
|
7273
7374
|
let r = [];
|
|
7274
7375
|
try {
|
|
7275
|
-
return r = t.parse(n, { ecmaVersion: "latest" }), r = r.body[0].expression.children || [], r.map((e) => this.#
|
|
7276
|
-
} catch (
|
|
7277
|
-
|
|
7376
|
+
return r = t.parse(n, { ecmaVersion: "latest" }), r = r.body[0].expression.children || [], r.map((e) => this.#l(e)).filter(Boolean);
|
|
7377
|
+
} catch (t) {
|
|
7378
|
+
this.props.showWarnings && console.warn(t);
|
|
7379
|
+
let n = typeof t?.pos == "number" ? t.pos - this.#t : 0, r = Xt({
|
|
7380
|
+
type: "parse",
|
|
7381
|
+
message: Qt(String(t)),
|
|
7382
|
+
source: e,
|
|
7383
|
+
start: n,
|
|
7384
|
+
end: n,
|
|
7385
|
+
fileName: this.props.fileName,
|
|
7386
|
+
cause: t
|
|
7387
|
+
});
|
|
7388
|
+
return this.props.onError && this.props.onError(r), this.props.renderError ? this.props.renderError({ error: String(r) }) : null;
|
|
7278
7389
|
}
|
|
7279
7390
|
};
|
|
7280
|
-
#
|
|
7391
|
+
#l = (e, n) => {
|
|
7281
7392
|
switch (e.type) {
|
|
7282
|
-
case "JSXAttribute": return e.value === null ? !0 : (this.lastAttributeName = e.name.name, this.#
|
|
7393
|
+
case "JSXAttribute": return e.value === null ? !0 : (this.lastAttributeName = e.name.name, this.#l(e.value, n));
|
|
7283
7394
|
case "JSXElement":
|
|
7284
|
-
case "JSXFragment": return this.lastAttributeName = void 0, this.#
|
|
7285
|
-
case "JSXExpressionContainer": return this.#
|
|
7395
|
+
case "JSXFragment": return this.lastAttributeName = void 0, this.#f(e, n);
|
|
7396
|
+
case "JSXExpressionContainer": return this.#l(e.expression, n);
|
|
7286
7397
|
case "JSXText":
|
|
7287
|
-
let a = this.props.disableKeyGeneration ? void 0 :
|
|
7398
|
+
let a = this.props.disableKeyGeneration ? void 0 : fn();
|
|
7288
7399
|
return this.props.disableFragments ? e.value : /* @__PURE__ */ r(t, { children: e.value }, a);
|
|
7289
7400
|
case "ArrayExpression":
|
|
7290
7401
|
let o = [];
|
|
7291
7402
|
return (e.elements || []).forEach((e) => {
|
|
7292
|
-
if (
|
|
7293
|
-
let t = this.#
|
|
7403
|
+
if ($t(e)) {
|
|
7404
|
+
let t = this.#l(e.argument, n);
|
|
7294
7405
|
t && o.push(...t);
|
|
7295
7406
|
return;
|
|
7296
7407
|
}
|
|
7297
|
-
let t = this.#
|
|
7408
|
+
let t = this.#l(e, n);
|
|
7298
7409
|
t !== void 0 && o.push(t);
|
|
7299
7410
|
}), o;
|
|
7300
7411
|
case "ArrowFunctionExpression":
|
|
7301
|
-
if ((e.async || e.generator) && this.props.onError?.(
|
|
7412
|
+
if ((e.async || e.generator) && this.props.onError?.(this.#s("unsupported-function", "Async and generator arrow functions are not supported.", e)), e.body.type === "BlockStatement") {
|
|
7302
7413
|
let t = e.params.map((e, t) => {
|
|
7303
7414
|
switch (e.type) {
|
|
7304
7415
|
case "Identifier": return e.name;
|
|
7305
7416
|
case "RestElement": return `...${e.argument.name}`;
|
|
7306
7417
|
default: return `arg_${t}`;
|
|
7307
7418
|
}
|
|
7308
|
-
}), r = e.params.some((e) => e.type !== "Identifier") ? `{ return (${this.#
|
|
7419
|
+
}), r = e.params.some((e) => e.type !== "Identifier"), a = r ? `{ return (${this.#r(e)})(${t.join(", ")}); }` : this.#r(e.body), o = this.#t, s = r ? (t) => e.start + (t - 10) - o : (t) => e.body.start + t - o;
|
|
7309
7420
|
try {
|
|
7310
|
-
let [e,
|
|
7421
|
+
let [e, r] = rn(a, {
|
|
7311
7422
|
...this.props.bindings,
|
|
7312
7423
|
...n
|
|
7313
|
-
}, (e, t, n) => {
|
|
7314
|
-
let
|
|
7315
|
-
return
|
|
7316
|
-
});
|
|
7317
|
-
return
|
|
7424
|
+
}, (e, t, n, r = 0) => {
|
|
7425
|
+
let a = new i(this.props);
|
|
7426
|
+
return a.jsx = e, a.#e = this.#e, a.#t = -r, a.#n = this.#n, a.#l(t, n);
|
|
7427
|
+
}, s);
|
|
7428
|
+
return this.#a(vn(an(t, e, this.lastAttributeName, this.props.onError, this.props.fileName), {
|
|
7318
7429
|
...this.props.bindings,
|
|
7319
7430
|
...n,
|
|
7320
|
-
...
|
|
7321
|
-
});
|
|
7431
|
+
...r
|
|
7432
|
+
}));
|
|
7322
7433
|
} catch (t) {
|
|
7323
|
-
this.props.onError?.(
|
|
7434
|
+
this.props.onError?.(this.#s("function-parse", `Unable to parse function \`${this.lastAttributeName ?? this.#r(e)}\` => ${t}.`, e, t));
|
|
7324
7435
|
return;
|
|
7325
7436
|
}
|
|
7326
7437
|
}
|
|
7327
|
-
return (...t) => {
|
|
7328
|
-
let r = this.#
|
|
7329
|
-
return this.#
|
|
7330
|
-
};
|
|
7438
|
+
return this.#a((...t) => {
|
|
7439
|
+
let r = this.#p(n, e, t);
|
|
7440
|
+
return this.#l(e.body, r);
|
|
7441
|
+
});
|
|
7331
7442
|
case "BinaryExpression":
|
|
7332
7443
|
switch (e.operator) {
|
|
7333
|
-
case "-": return this.#
|
|
7334
|
-
case "!=": return this.#
|
|
7335
|
-
case "!==": return this.#
|
|
7336
|
-
case "*": return this.#
|
|
7337
|
-
case "**": return this.#
|
|
7338
|
-
case "/": return this.#
|
|
7339
|
-
case "%": return this.#
|
|
7340
|
-
case "+": return this.#
|
|
7341
|
-
case "<": return this.#
|
|
7342
|
-
case "<=": return this.#
|
|
7343
|
-
case "==": return this.#
|
|
7344
|
-
case "===": return this.#
|
|
7345
|
-
case ">": return this.#
|
|
7346
|
-
case ">=": return this.#
|
|
7444
|
+
case "-": return this.#l(e.left, n) - this.#l(e.right, n);
|
|
7445
|
+
case "!=": return this.#l(e.left, n) != this.#l(e.right, n);
|
|
7446
|
+
case "!==": return this.#l(e.left, n) !== this.#l(e.right, n);
|
|
7447
|
+
case "*": return this.#l(e.left, n) * this.#l(e.right, n);
|
|
7448
|
+
case "**": return this.#l(e.left, n) ** this.#l(e.right, n);
|
|
7449
|
+
case "/": return this.#l(e.left, n) / this.#l(e.right, n);
|
|
7450
|
+
case "%": return this.#l(e.left, n) % this.#l(e.right, n);
|
|
7451
|
+
case "+": return this.#l(e.left, n) + this.#l(e.right, n);
|
|
7452
|
+
case "<": return this.#l(e.left, n) < this.#l(e.right, n);
|
|
7453
|
+
case "<=": return this.#l(e.left, n) <= this.#l(e.right, n);
|
|
7454
|
+
case "==": return this.#l(e.left, n) == this.#l(e.right, n);
|
|
7455
|
+
case "===": return this.#l(e.left, n) === this.#l(e.right, n);
|
|
7456
|
+
case ">": return this.#l(e.left, n) > this.#l(e.right, n);
|
|
7457
|
+
case ">=": return this.#l(e.left, n) >= this.#l(e.right, n);
|
|
7347
7458
|
}
|
|
7348
7459
|
return;
|
|
7349
7460
|
case "CallExpression":
|
|
7350
|
-
let s = this.#
|
|
7461
|
+
let s = this.#l(e.callee, n);
|
|
7351
7462
|
if (s === void 0) {
|
|
7352
|
-
this.props.showWarnings && console.warn(`The expression
|
|
7463
|
+
this.props.showWarnings && console.warn(`The expression \`${this.#r(e)}\` could not be resolved, resulting in an undefined return value.`);
|
|
7353
7464
|
return;
|
|
7354
7465
|
}
|
|
7355
7466
|
try {
|
|
7356
|
-
let t = e.arguments.map((e) => this.#
|
|
7467
|
+
let t = e.arguments.map((e) => this.#l(e, n)), r = {
|
|
7357
7468
|
...this.props.bindings,
|
|
7358
7469
|
...n
|
|
7359
7470
|
};
|
|
7360
7471
|
return Reflect.apply(s, r, t);
|
|
7361
7472
|
} catch (t) {
|
|
7362
|
-
this.props.onError?.(
|
|
7473
|
+
this.props.onError?.(this.#s("call", `Unable to call expression \`${this.#r(e)}\` => ${t}.`, e, t));
|
|
7363
7474
|
return;
|
|
7364
7475
|
}
|
|
7365
7476
|
case "ChainExpression": try {
|
|
7366
|
-
return this.#
|
|
7477
|
+
return this.#l(e.expression, n);
|
|
7367
7478
|
} catch (t) {
|
|
7368
|
-
this.props.onError?.(
|
|
7479
|
+
this.props.onError?.(this.#s("chain", `Unable to call expression \`${this.#r(e)}\` => ${t}.`, e, t));
|
|
7369
7480
|
return;
|
|
7370
7481
|
}
|
|
7371
|
-
case "ConditionalExpression": return this.#
|
|
7372
|
-
case "ExpressionStatement": return this.#
|
|
7482
|
+
case "ConditionalExpression": return this.#l(e.test, n) ? this.#l(e.consequent, n) : this.#l(e.alternate, n);
|
|
7483
|
+
case "ExpressionStatement": return this.#l(e.expression, n);
|
|
7373
7484
|
case "Identifier": return n?.[e.name] ?? this.props.bindings?.[e.name] ?? window[e.name];
|
|
7374
7485
|
case "Literal": return e.value;
|
|
7375
7486
|
case "LogicalExpression":
|
|
7376
|
-
let c = this.#
|
|
7487
|
+
let c = this.#l(e.left, n), l = () => this.#l(e.right, n);
|
|
7377
7488
|
switch (e.operator) {
|
|
7378
7489
|
case "||": return c || l();
|
|
7379
7490
|
case "&&": return c && l();
|
|
7380
7491
|
case "??": return c ?? l();
|
|
7381
7492
|
default: return !1;
|
|
7382
7493
|
}
|
|
7383
|
-
case "MemberExpression": return this.#
|
|
7494
|
+
case "MemberExpression": return this.#u(e, n);
|
|
7384
7495
|
case "NewExpression":
|
|
7385
|
-
let u = this.#
|
|
7496
|
+
let u = this.#l(e.callee, n);
|
|
7386
7497
|
if (u === void 0) {
|
|
7387
|
-
this.props.showWarnings && console.warn(`The expression
|
|
7498
|
+
this.props.showWarnings && console.warn(`The expression \`${this.#r(e)}\` could not be resolved, resulting in an undefined return value.`);
|
|
7388
7499
|
return;
|
|
7389
7500
|
}
|
|
7390
|
-
return new u(...e.arguments.map((e) => this.#
|
|
7501
|
+
return new u(...e.arguments.map((e) => this.#l(e, n)));
|
|
7391
7502
|
case "ObjectExpression":
|
|
7392
7503
|
let d = {};
|
|
7393
7504
|
return e.properties.forEach((e) => {
|
|
7394
|
-
if (
|
|
7395
|
-
let t = this.#
|
|
7505
|
+
if ($t(e)) {
|
|
7506
|
+
let t = this.#l(e.argument, n);
|
|
7396
7507
|
Object.entries(t || {}).forEach(([e, t]) => {
|
|
7397
7508
|
d[e] = t;
|
|
7398
7509
|
});
|
|
7399
7510
|
} else {
|
|
7400
7511
|
let t = e.key.name || e.key.value;
|
|
7401
|
-
d[t] = this.#
|
|
7512
|
+
d[t] = this.#l(e.value, n);
|
|
7402
7513
|
}
|
|
7403
7514
|
}), d;
|
|
7404
7515
|
case "TemplateElement": return e.value.cooked;
|
|
7405
|
-
case "TemplateLiteral": return [...e.expressions, ...e.quasis].sort((e, t) => e.start < t.start ? -1 : 1).map((e) => this.#
|
|
7516
|
+
case "TemplateLiteral": return [...e.expressions, ...e.quasis].sort((e, t) => e.start < t.start ? -1 : 1).map((e) => this.#l(e, n)).join("");
|
|
7406
7517
|
case "ThisExpression": return this.props.bindings;
|
|
7407
7518
|
case "UnaryExpression":
|
|
7408
7519
|
switch (e.operator) {
|
|
7409
|
-
case "+": return +this.#
|
|
7410
|
-
case "-": return -this.#
|
|
7411
|
-
case "!": return !this.#
|
|
7520
|
+
case "+": return +this.#l(e.argument, n);
|
|
7521
|
+
case "-": return -this.#l(e.argument, n);
|
|
7522
|
+
case "!": return !this.#l(e.argument, n);
|
|
7412
7523
|
}
|
|
7413
7524
|
return;
|
|
7414
7525
|
}
|
|
7415
7526
|
};
|
|
7416
|
-
#
|
|
7417
|
-
let { object: n } = e, r = [((e) => e.computed ? this.#
|
|
7527
|
+
#u = (e, t) => {
|
|
7528
|
+
let { object: n } = e, r = [((e) => e.computed ? this.#l(e.property, t) : e.property?.name)(e)];
|
|
7418
7529
|
if (e.object.type !== "Literal") for (; n && ["MemberExpression", "Literal"].includes(n?.type);) {
|
|
7419
7530
|
let { property: e } = n;
|
|
7420
|
-
n.computed ? r.unshift(this.#
|
|
7531
|
+
n.computed ? r.unshift(this.#l(e, t)) : r.unshift(e?.name ?? JSON.parse(e?.raw ?? "\"\"")), n = n.object;
|
|
7421
7532
|
}
|
|
7422
|
-
let i = this.#
|
|
7533
|
+
let i = this.#l(n, t);
|
|
7423
7534
|
try {
|
|
7424
7535
|
let e = i, t = r.reduce((t, n) => (e = t, t?.[n]), i);
|
|
7425
7536
|
return typeof t == "function" ? t.bind(e) : t;
|
|
7426
|
-
} catch {
|
|
7427
|
-
let
|
|
7428
|
-
this.props.onError?.(
|
|
7537
|
+
} catch (t) {
|
|
7538
|
+
let i = n?.name || "unknown";
|
|
7539
|
+
this.props.onError?.(this.#s("member-access", `Unable to parse \`${i}["${r.join("\"][\"")}"]\``, e, t));
|
|
7429
7540
|
}
|
|
7430
7541
|
};
|
|
7431
|
-
#
|
|
7432
|
-
#
|
|
7433
|
-
let { allowUnknownElements: i, components: a, componentsOnly: o, onError: s } = this.props, { children: c = [] } = n, l = n.type === "JSXElement" ? n.openingElement : n.openingFragment, { attributes: u = [] } = l, d = n.type === "JSXElement" ? this.#
|
|
7434
|
-
if (/^(html|head|body)$/i.test(d)) return c.map((e) => this.#
|
|
7542
|
+
#d = (e) => e.type === "JSXIdentifier" ? e.name : `${this.#d(e.object)}.${this.#d(e.property)}`;
|
|
7543
|
+
#f = (n, r) => {
|
|
7544
|
+
let { allowUnknownElements: i, components: a, componentsOnly: o, onError: s } = this.props, { children: c = [] } = n, l = n.type === "JSXElement" ? n.openingElement : n.openingFragment, { attributes: u = [] } = l, d = n.type === "JSXElement" ? this.#d(l.name) : "", f = (this.props.blacklistedAttrs || []).map((e) => e instanceof RegExp ? e : new RegExp(e, "i")), p = (this.props.blacklistedTags || []).map((e) => e.trim().toLowerCase()).filter(Boolean);
|
|
7545
|
+
if (/^(html|head|body)$/i.test(d)) return c.map((e) => this.#f(e, r));
|
|
7435
7546
|
let m = d.trim().toLowerCase();
|
|
7436
|
-
if (p.indexOf(m) !== -1) return s(
|
|
7437
|
-
if (d !== "" && !
|
|
7438
|
-
if (o) return s(
|
|
7439
|
-
if (!i && document.createElement(d) instanceof HTMLUnknownElement) return s(
|
|
7547
|
+
if (p.indexOf(m) !== -1) return s(this.#s("blacklisted-tag", `The tag \`<${d}>\` is blacklisted, and will not be rendered.`, n)), null;
|
|
7548
|
+
if (d !== "" && !_n(a, d)) {
|
|
7549
|
+
if (o) return s(this.#s("unrecognized-component", `The component \`<${d}>\` is unrecognized, and will not be rendered.`, n)), this.props.renderUnrecognized(d);
|
|
7550
|
+
if (!i && document.createElement(d) instanceof HTMLUnknownElement) return s(this.#s("unrecognized-tag", `The tag \`<${d}>\` is unrecognized in this browser, and will not be rendered.`, n)), this.props.renderUnrecognized(d);
|
|
7440
7551
|
}
|
|
7441
|
-
let h, g = n.type === "JSXElement" ?
|
|
7442
|
-
(g ||
|
|
7552
|
+
let h, g = n.type === "JSXElement" ? _n(a, d) : t;
|
|
7553
|
+
(g || ln(d)) && (h = c.map((e) => this.#l(e, r)), !g && !un(d) && (h = h.filter((e) => typeof e != "string" || !/^\s*$/.test(e))), h.length === 0 ? h = void 0 : h.length === 1 ? [h] = h : h.length > 1 && !this.props.disableKeyGeneration && (h = h.map((e, t) => e?.type && !e?.key ? {
|
|
7443
7554
|
...e,
|
|
7444
7555
|
key: e.key || t
|
|
7445
7556
|
} : e)));
|
|
7446
|
-
let _ = { key: this.props.disableKeyGeneration ? void 0 :
|
|
7557
|
+
let _ = { key: this.props.disableKeyGeneration ? void 0 : fn() };
|
|
7447
7558
|
u.forEach((e) => {
|
|
7448
7559
|
if (e.type === "JSXAttribute") {
|
|
7449
|
-
let t = e.name.name, n =
|
|
7560
|
+
let t = e.name.name, n = on[t] || t, i = this.#l(e, r);
|
|
7450
7561
|
f.filter((e) => e.test(n)).length === 0 && (_[n] = i);
|
|
7451
7562
|
} else if (e.type === "JSXSpreadAttribute") {
|
|
7452
|
-
let t = e.argument, n = this.#
|
|
7563
|
+
let t = e.argument, n = this.#l(t, r);
|
|
7453
7564
|
typeof n == "object" && Object.keys(n || {}).forEach((e) => {
|
|
7454
|
-
let t =
|
|
7565
|
+
let t = on[e] || e;
|
|
7455
7566
|
f.filter((e) => e.test(t)).length === 0 && (_[t] = n[e]);
|
|
7456
7567
|
});
|
|
7457
7568
|
}
|
|
7458
|
-
}), typeof _.style == "string" && (_.style =
|
|
7569
|
+
}), typeof _.style == "string" && (_.style = mn(_.style)), g && g.injectSourceInfo && (_.sourceInfo = this.#o(n));
|
|
7459
7570
|
let ee = d.toLowerCase();
|
|
7460
7571
|
return ee === "option" && (h = h.props.children), e.createElement(g || ee, _, h);
|
|
7461
7572
|
};
|
|
7462
|
-
#
|
|
7573
|
+
#p = (e, t, n) => {
|
|
7463
7574
|
let r = e ?? {};
|
|
7464
7575
|
return t.params.forEach((t, i) => {
|
|
7465
7576
|
switch (t.type) {
|
|
@@ -7477,7 +7588,7 @@ var fn = class i extends e.Component {
|
|
|
7477
7588
|
});
|
|
7478
7589
|
break;
|
|
7479
7590
|
case "AssignmentPattern":
|
|
7480
|
-
let a = () => this.#
|
|
7591
|
+
let a = () => this.#l(t.right, e);
|
|
7481
7592
|
r[t.left.name] = n[i] === void 0 ? a() : n[i];
|
|
7482
7593
|
break;
|
|
7483
7594
|
case "RestElement":
|
|
@@ -7488,7 +7599,7 @@ var fn = class i extends e.Component {
|
|
|
7488
7599
|
};
|
|
7489
7600
|
render = () => {
|
|
7490
7601
|
let e = (this.props.jsx || "").trim().replace(/<!DOCTYPE([^>]*)>/g, "");
|
|
7491
|
-
this.ParsedChildren = this.#
|
|
7602
|
+
this.ParsedChildren = this.#c(e);
|
|
7492
7603
|
let t = [.../* @__PURE__ */ new Set(["jsx-parser", ...String(this.props.className).split(" ")])].filter(Boolean).join(" ");
|
|
7493
7604
|
return this.props.renderInWrapper ? /* @__PURE__ */ r("div", {
|
|
7494
7605
|
className: t,
|
|
@@ -7497,6 +7608,6 @@ var fn = class i extends e.Component {
|
|
|
7497
7608
|
};
|
|
7498
7609
|
};
|
|
7499
7610
|
//#endregion
|
|
7500
|
-
export {
|
|
7611
|
+
export { Gt as JsxParserError, bn as default };
|
|
7501
7612
|
|
|
7502
7613
|
//# sourceMappingURL=react-jsx-parser.js.map
|