driftjs-ssr 0.0.17 → 0.0.18
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/index-cjs.js +5 -5
- package/dist/index-es.js +422 -425
- package/package.json +3 -3
package/dist/index-es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { VALID_ATTR_NAME_REGEX as e, VALID_TAG_NAME_REGEX as t, VOID_ELEMENTS as n, createContext as r, effect as i, escapeHtml as a, evaluateExpression as o, evaluatePropsSpec as s, inject as c, injectContext as l, isValidHtmlTagName as u, normalizeStyle as d, onMount as f, onUnmount as p, popActiveVM as m, provide as h, provideContext as g, pushActiveVM as _, resolveComponentModule as v, resolveIterable as ee } from "driftjs-shared";
|
|
2
2
|
//#region ../../node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.mjs
|
|
3
|
-
var
|
|
3
|
+
var te = [
|
|
4
4
|
509,
|
|
5
5
|
0,
|
|
6
6
|
227,
|
|
@@ -331,7 +331,7 @@ var h = [
|
|
|
331
331
|
9,
|
|
332
332
|
787719,
|
|
333
333
|
239
|
|
334
|
-
],
|
|
334
|
+
], y = [
|
|
335
335
|
0,
|
|
336
336
|
11,
|
|
337
337
|
2,
|
|
@@ -950,18 +950,18 @@ var h = [
|
|
|
950
950
|
4938,
|
|
951
951
|
6,
|
|
952
952
|
8489
|
|
953
|
-
],
|
|
953
|
+
], ne = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", re = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", ie = {
|
|
954
954
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
955
955
|
5: "class enum extends super const export import",
|
|
956
956
|
6: "enum",
|
|
957
957
|
strict: "implements interface let package private protected public static yield",
|
|
958
958
|
strictBind: "eval arguments"
|
|
959
|
-
},
|
|
960
|
-
5:
|
|
961
|
-
"5module":
|
|
962
|
-
6:
|
|
963
|
-
},
|
|
964
|
-
function
|
|
959
|
+
}, ae = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this", oe = {
|
|
960
|
+
5: ae,
|
|
961
|
+
"5module": ae + " export import",
|
|
962
|
+
6: ae + " const class extends export import super"
|
|
963
|
+
}, se = /^in(stanceof)?$/, ce = RegExp("[" + re + "]"), le = RegExp("[" + re + ne + "]");
|
|
964
|
+
function ue(e, t) {
|
|
965
965
|
for (var n = 65536, r = 0; r < t.length; r += 2) {
|
|
966
966
|
if (n += t[r], n > e) return !1;
|
|
967
967
|
if (n += t[r + 1], n >= e) return !0;
|
|
@@ -969,10 +969,10 @@ function oe(e, t) {
|
|
|
969
969
|
return !1;
|
|
970
970
|
}
|
|
971
971
|
function b(e, t) {
|
|
972
|
-
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 &&
|
|
972
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && ce.test(String.fromCharCode(e)) : t !== !1 && ue(e, y);
|
|
973
973
|
}
|
|
974
974
|
function x(e, t) {
|
|
975
|
-
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 &&
|
|
975
|
+
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 && le.test(String.fromCharCode(e)) : t === !1 ? !1 : ue(e, y) || ue(e, te);
|
|
976
976
|
}
|
|
977
977
|
var S = function(e, t) {
|
|
978
978
|
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;
|
|
@@ -983,9 +983,9 @@ function C(e, t) {
|
|
|
983
983
|
binop: t
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
|
-
var w = { beforeExpr: !0 }, T = { startsExpr: !0 },
|
|
986
|
+
var w = { beforeExpr: !0 }, T = { startsExpr: !0 }, de = {};
|
|
987
987
|
function E(e, t) {
|
|
988
|
-
return t === void 0 && (t = {}), t.keyword = e,
|
|
988
|
+
return t === void 0 && (t = {}), t.keyword = e, de[e] = new S(e, t);
|
|
989
989
|
}
|
|
990
990
|
var D = {
|
|
991
991
|
num: new S("num", T),
|
|
@@ -1120,46 +1120,46 @@ var D = {
|
|
|
1120
1120
|
prefix: !0,
|
|
1121
1121
|
startsExpr: !0
|
|
1122
1122
|
})
|
|
1123
|
-
}, O = /\r\n?|\n|\u2028|\u2029/,
|
|
1124
|
-
function
|
|
1123
|
+
}, O = /\r\n?|\n|\u2028|\u2029/, fe = new RegExp(O.source, "g");
|
|
1124
|
+
function pe(e) {
|
|
1125
1125
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function me(e, t, n) {
|
|
1128
1128
|
n === void 0 && (n = e.length);
|
|
1129
1129
|
for (var r = t; r < n; r++) {
|
|
1130
1130
|
var i = e.charCodeAt(r);
|
|
1131
|
-
if (
|
|
1131
|
+
if (pe(i)) return r < n - 1 && i === 13 && e.charCodeAt(r + 1) === 10 ? r + 2 : r + 1;
|
|
1132
1132
|
}
|
|
1133
1133
|
return -1;
|
|
1134
1134
|
}
|
|
1135
|
-
var
|
|
1136
|
-
return
|
|
1137
|
-
}),
|
|
1138
|
-
return
|
|
1139
|
-
}),
|
|
1135
|
+
var he = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, k = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, ge = Object.prototype, _e = ge.hasOwnProperty, ve = ge.toString, ye = Object.hasOwn || (function(e, t) {
|
|
1136
|
+
return _e.call(e, t);
|
|
1137
|
+
}), be = Array.isArray || (function(e) {
|
|
1138
|
+
return ve.call(e) === "[object Array]";
|
|
1139
|
+
}), xe = Object.create(null);
|
|
1140
1140
|
function A(e) {
|
|
1141
|
-
return
|
|
1141
|
+
return xe[e] || (xe[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
1142
1142
|
}
|
|
1143
1143
|
function j(e) {
|
|
1144
1144
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
1145
1145
|
}
|
|
1146
|
-
var
|
|
1146
|
+
var Se = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, Ce = function(e, t) {
|
|
1147
1147
|
this.line = e, this.column = t;
|
|
1148
1148
|
};
|
|
1149
|
-
|
|
1150
|
-
return new
|
|
1149
|
+
Ce.prototype.offset = function(e) {
|
|
1150
|
+
return new Ce(this.line, this.column + e);
|
|
1151
1151
|
};
|
|
1152
|
-
var
|
|
1152
|
+
var we = function(e, t, n) {
|
|
1153
1153
|
this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
1154
1154
|
};
|
|
1155
|
-
function
|
|
1155
|
+
function Te(e, t) {
|
|
1156
1156
|
for (var n = 1, r = 0;;) {
|
|
1157
|
-
var i =
|
|
1158
|
-
if (i < 0) return new
|
|
1157
|
+
var i = me(e, r, t);
|
|
1158
|
+
if (i < 0) return new Ce(n, t - r);
|
|
1159
1159
|
++n, r = i;
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
var
|
|
1162
|
+
var Ee = {
|
|
1163
1163
|
ecmaVersion: null,
|
|
1164
1164
|
sourceType: "script",
|
|
1165
1165
|
strict: !1,
|
|
@@ -1181,20 +1181,20 @@ var Se = {
|
|
|
1181
1181
|
sourceFile: null,
|
|
1182
1182
|
directSourceFile: null,
|
|
1183
1183
|
preserveParens: !1
|
|
1184
|
-
},
|
|
1185
|
-
function
|
|
1184
|
+
}, De = !1;
|
|
1185
|
+
function Oe(e) {
|
|
1186
1186
|
var t = {};
|
|
1187
|
-
for (var n in
|
|
1188
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
1187
|
+
for (var n in Ee) t[n] = e && ye(e, n) ? e[n] : Ee[n];
|
|
1188
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!De && typeof console == "object" && console.warn && (De = !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), be(t.onToken)) {
|
|
1189
1189
|
var r = t.onToken;
|
|
1190
1190
|
t.onToken = function(e) {
|
|
1191
1191
|
return r.push(e);
|
|
1192
1192
|
};
|
|
1193
1193
|
}
|
|
1194
|
-
if (
|
|
1194
|
+
if (be(t.onComment) && (t.onComment = ke(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
1195
1195
|
return t;
|
|
1196
1196
|
}
|
|
1197
|
-
function
|
|
1197
|
+
function ke(e, t) {
|
|
1198
1198
|
return function(n, r, i, a, o, s) {
|
|
1199
1199
|
var c = {
|
|
1200
1200
|
type: n ? "Block" : "Line",
|
|
@@ -1202,19 +1202,19 @@ function Te(e, t) {
|
|
|
1202
1202
|
start: i,
|
|
1203
1203
|
end: a
|
|
1204
1204
|
};
|
|
1205
|
-
e.locations && (c.loc = new
|
|
1205
|
+
e.locations && (c.loc = new we(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
1206
1206
|
};
|
|
1207
1207
|
}
|
|
1208
|
-
var
|
|
1209
|
-
function
|
|
1210
|
-
return
|
|
1208
|
+
var Ae = 1, M = 2, je = 4, Me = 8, Ne = 16, Pe = 32, Fe = 64, Ie = 128, N = 256, Le = 512, Re = 1024, ze = Ae | M | N;
|
|
1209
|
+
function Be(e, t) {
|
|
1210
|
+
return M | (e ? je : 0) | (t ? Me : 0);
|
|
1211
1211
|
}
|
|
1212
|
-
var
|
|
1213
|
-
this.options = e =
|
|
1212
|
+
var Ve = 0, He = 1, P = 2, Ue = 3, We = 4, Ge = 5, F = function(e, t, n) {
|
|
1213
|
+
this.options = e = Oe(e), this.sourceFile = e.sourceFile, this.keywords = A(oe[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
1214
1214
|
var r = "";
|
|
1215
|
-
e.allowReserved !== !0 && (r =
|
|
1216
|
-
var i = (r ? r + " " : "") +
|
|
1217
|
-
this.reservedWordsStrict = A(i), this.reservedWordsStrictBind = A(i + " " +
|
|
1215
|
+
e.allowReserved !== !0 && (r = ie[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = A(r);
|
|
1216
|
+
var i = (r ? r + " " : "") + ie.strict;
|
|
1217
|
+
this.reservedWordsStrict = A(i), this.reservedWordsStrictBind = A(i + " " + ie.strictBind), this.input = String(t), this.containsEsc = !1, this.pos = n || 0, this.curLine = 1, e.startLocation ? (this.lineStart = this.pos - e.startLocation.column, this.curLine = e.startLocation.line) : n ? (this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.options.locations && (this.curLine = this.input.slice(0, this.lineStart).split(O).length)) : this.lineStart = 0, 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" ? M : Ae), this.regexpState = null, this.privateNameStack = [];
|
|
1218
1218
|
}, I = {
|
|
1219
1219
|
inFunction: { configurable: !0 },
|
|
1220
1220
|
inGenerator: { configurable: !0 },
|
|
@@ -1234,37 +1234,37 @@ F.prototype.parse = function() {
|
|
|
1234
1234
|
return e.parseTopLevel(t);
|
|
1235
1235
|
});
|
|
1236
1236
|
}, I.inFunction.get = function() {
|
|
1237
|
-
return (this.currentVarScope().flags &
|
|
1237
|
+
return (this.currentVarScope().flags & M) > 0;
|
|
1238
1238
|
}, I.inGenerator.get = function() {
|
|
1239
|
-
return (this.currentVarScope().flags &
|
|
1239
|
+
return (this.currentVarScope().flags & Me) > 0;
|
|
1240
1240
|
}, I.inAsync.get = function() {
|
|
1241
|
-
return (this.currentVarScope().flags &
|
|
1241
|
+
return (this.currentVarScope().flags & je) > 0;
|
|
1242
1242
|
}, I.canAwait.get = function() {
|
|
1243
1243
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1244
1244
|
var t = this.scopeStack[e].flags;
|
|
1245
|
-
if (t & (
|
|
1246
|
-
if (t &
|
|
1245
|
+
if (t & (N | Le)) return !1;
|
|
1246
|
+
if (t & M) return (t & je) > 0;
|
|
1247
1247
|
}
|
|
1248
1248
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
1249
1249
|
}, I.allowReturn.get = function() {
|
|
1250
|
-
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags &
|
|
1250
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & Ae);
|
|
1251
1251
|
}, I.allowSuper.get = function() {
|
|
1252
|
-
return (this.currentThisScope().flags &
|
|
1252
|
+
return (this.currentThisScope().flags & Fe) > 0 || this.options.allowSuperOutsideMethod;
|
|
1253
1253
|
}, I.allowDirectSuper.get = function() {
|
|
1254
|
-
return (this.currentThisScope().flags &
|
|
1254
|
+
return (this.currentThisScope().flags & Ie) > 0;
|
|
1255
1255
|
}, I.treatFunctionsAsVar.get = function() {
|
|
1256
1256
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1257
1257
|
}, I.allowNewDotTarget.get = function() {
|
|
1258
1258
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1259
1259
|
var t = this.scopeStack[e].flags;
|
|
1260
|
-
if (t & (
|
|
1260
|
+
if (t & (N | Le) || t & M && !(t & Ne)) return !0;
|
|
1261
1261
|
}
|
|
1262
1262
|
return !1;
|
|
1263
1263
|
}, I.allowUsing.get = function() {
|
|
1264
1264
|
var e = this.currentScope().flags;
|
|
1265
|
-
return !(e &
|
|
1265
|
+
return !(e & Re || !this.inModule && e & Ae);
|
|
1266
1266
|
}, I.inClassStaticBlock.get = function() {
|
|
1267
|
-
return (this.currentVarScope().flags &
|
|
1267
|
+
return (this.currentVarScope().flags & N) > 0;
|
|
1268
1268
|
}, F.extend = function() {
|
|
1269
1269
|
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
1270
1270
|
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
@@ -1277,12 +1277,12 @@ F.prototype.parse = function() {
|
|
|
1277
1277
|
}, F.tokenizer = function(e, t) {
|
|
1278
1278
|
return new this(t, e);
|
|
1279
1279
|
}, Object.defineProperties(F.prototype, I);
|
|
1280
|
-
var L = F.prototype,
|
|
1280
|
+
var L = F.prototype, Ke = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
1281
1281
|
L.strictDirective = function(e) {
|
|
1282
1282
|
if (this.options.ecmaVersion < 5) return !1;
|
|
1283
1283
|
for (;;) {
|
|
1284
1284
|
k.lastIndex = e, e += k.exec(this.input)[0].length;
|
|
1285
|
-
var t =
|
|
1285
|
+
var t = Ke.exec(this.input.slice(e));
|
|
1286
1286
|
if (!t) return !1;
|
|
1287
1287
|
if ((t[1] || t[2]) === "use strict") {
|
|
1288
1288
|
k.lastIndex = e + t[0].length;
|
|
@@ -1319,7 +1319,7 @@ L.strictDirective = function(e) {
|
|
|
1319
1319
|
}, L.unexpected = function(e) {
|
|
1320
1320
|
this.raise(e ?? this.start, "Unexpected token");
|
|
1321
1321
|
};
|
|
1322
|
-
var
|
|
1322
|
+
var qe = function() {
|
|
1323
1323
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
1324
1324
|
};
|
|
1325
1325
|
L.checkPatternErrors = function(e, t) {
|
|
@@ -1351,7 +1351,7 @@ R.parseTopLevel = function(e) {
|
|
|
1351
1351
|
}
|
|
1352
1352
|
return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType, this.finishNode(e, "Program");
|
|
1353
1353
|
};
|
|
1354
|
-
var
|
|
1354
|
+
var Je = { kind: "loop" }, Ye = { kind: "switch" };
|
|
1355
1355
|
R.isLet = function(e) {
|
|
1356
1356
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
1357
1357
|
k.lastIndex = this.pos;
|
|
@@ -1366,7 +1366,7 @@ R.isLet = function(e) {
|
|
|
1366
1366
|
while (x(r = this.fullCharCodeAt(n)));
|
|
1367
1367
|
if (r === 92) return !0;
|
|
1368
1368
|
var a = this.input.slice(i, n);
|
|
1369
|
-
if (!
|
|
1369
|
+
if (!se.test(a)) return !0;
|
|
1370
1370
|
}
|
|
1371
1371
|
return !1;
|
|
1372
1372
|
}, R.isAsyncFunction = function() {
|
|
@@ -1394,7 +1394,7 @@ R.isLet = function(e) {
|
|
|
1394
1394
|
while (x(s = this.fullCharCodeAt(r)));
|
|
1395
1395
|
if (s === 92) return !0;
|
|
1396
1396
|
var l = this.input.slice(c, r);
|
|
1397
|
-
if (
|
|
1397
|
+
if (se.test(l)) return !1;
|
|
1398
1398
|
if (t && !e && l === "of") {
|
|
1399
1399
|
k.lastIndex = r;
|
|
1400
1400
|
var u = k.exec(this.input);
|
|
@@ -1452,11 +1452,11 @@ R.isLet = function(e) {
|
|
|
1452
1452
|
}, R.parseDebuggerStatement = function(e) {
|
|
1453
1453
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
1454
1454
|
}, R.parseDoStatement = function(e) {
|
|
1455
|
-
return this.next(), this.labels.push(
|
|
1455
|
+
return this.next(), this.labels.push(Je), 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");
|
|
1456
1456
|
}, R.parseForStatement = function(e) {
|
|
1457
1457
|
this.next();
|
|
1458
1458
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
1459
|
-
if (this.labels.push(
|
|
1459
|
+
if (this.labels.push(Je), this.enterScope(0), this.expect(D.parenL), this.type === D.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
1460
1460
|
var n = this.isLet();
|
|
1461
1461
|
if (this.type === D._var || this.type === D._const || n) {
|
|
1462
1462
|
var r = this.startNode(), i = n ? "let" : this.value;
|
|
@@ -1467,18 +1467,18 @@ R.isLet = function(e) {
|
|
|
1467
1467
|
var c = this.startNode();
|
|
1468
1468
|
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);
|
|
1469
1469
|
}
|
|
1470
|
-
var l = this.containsEsc, u = new
|
|
1470
|
+
var l = this.containsEsc, u = new qe(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
1471
1471
|
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));
|
|
1472
1472
|
}, R.parseForAfterInit = function(e, t, n) {
|
|
1473
1473
|
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));
|
|
1474
1474
|
}, R.parseFunctionStatement = function(e, t, n) {
|
|
1475
|
-
return this.next(), this.parseFunction(e,
|
|
1475
|
+
return this.next(), this.parseFunction(e, Ze | (n ? 0 : Qe), !1, t);
|
|
1476
1476
|
}, R.parseIfStatement = function(e) {
|
|
1477
1477
|
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");
|
|
1478
1478
|
}, R.parseReturnStatement = function(e) {
|
|
1479
1479
|
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");
|
|
1480
1480
|
}, R.parseSwitchStatement = function(e) {
|
|
1481
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(D.braceL), this.labels.push(
|
|
1481
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(D.braceL), this.labels.push(Ye), this.enterScope(Re);
|
|
1482
1482
|
for (var t, n = !1; this.type !== D.braceR;) if (this.type === D._case || this.type === D._default) {
|
|
1483
1483
|
var r = this.type === D._case;
|
|
1484
1484
|
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);
|
|
@@ -1487,10 +1487,10 @@ R.isLet = function(e) {
|
|
|
1487
1487
|
}, R.parseThrowStatement = function(e) {
|
|
1488
1488
|
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");
|
|
1489
1489
|
};
|
|
1490
|
-
var
|
|
1490
|
+
var Xe = [];
|
|
1491
1491
|
R.parseCatchClauseParam = function() {
|
|
1492
1492
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
1493
|
-
return this.enterScope(t ?
|
|
1493
|
+
return this.enterScope(t ? Pe : 0), this.checkLValPattern(e, t ? We : P), this.expect(D.parenR), e;
|
|
1494
1494
|
}, R.parseTryStatement = function(e) {
|
|
1495
1495
|
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === D._catch) {
|
|
1496
1496
|
var t = this.startNode();
|
|
@@ -1500,7 +1500,7 @@ R.parseCatchClauseParam = function() {
|
|
|
1500
1500
|
}, R.parseVarStatement = function(e, t, n) {
|
|
1501
1501
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
1502
1502
|
}, R.parseWhileStatement = function(e) {
|
|
1503
|
-
return this.next(), e.test = this.parseParenExpression(), this.labels.push(
|
|
1503
|
+
return this.next(), e.test = this.parseParenExpression(), this.labels.push(Je), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
1504
1504
|
}, R.parseWithStatement = function(e) {
|
|
1505
1505
|
return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
|
|
1506
1506
|
}, R.parseEmptyStatement = function(e) {
|
|
@@ -1537,13 +1537,13 @@ R.parseCatchClauseParam = function() {
|
|
|
1537
1537
|
}
|
|
1538
1538
|
return e;
|
|
1539
1539
|
}, R.parseVarId = function(e, t) {
|
|
1540
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ?
|
|
1540
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? He : P, !1);
|
|
1541
1541
|
};
|
|
1542
|
-
var
|
|
1542
|
+
var Ze = 1, Qe = 2, $e = 4;
|
|
1543
1543
|
R.parseFunction = function(e, t, n, r, i) {
|
|
1544
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === D.star && t &
|
|
1544
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === D.star && t & Qe && this.unexpected(), e.generator = this.eat(D.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & Ze && (e.id = t & $e && this.type !== D.name ? null : this.parseIdent(), e.id && !(t & Qe) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? He : P : Ue));
|
|
1545
1545
|
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
1546
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
1546
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Be(e.async, e.generator)), t & Ze || (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 & Ze ? "FunctionDeclaration" : "FunctionExpression");
|
|
1547
1547
|
}, R.parseFunctionParams = function(e) {
|
|
1548
1548
|
this.expect(D.parenL), e.params = this.parseBindingList(D.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
1549
1549
|
}, R.parseClass = function(e, t) {
|
|
@@ -1553,7 +1553,7 @@ R.parseFunction = function(e, t, n, r, i) {
|
|
|
1553
1553
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
1554
1554
|
for (i.body = [], this.expect(D.braceL); this.type !== D.braceR;) {
|
|
1555
1555
|
var o = this.parseClassElement(e.superClass !== null);
|
|
1556
|
-
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" &&
|
|
1556
|
+
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" && et(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
1557
1557
|
}
|
|
1558
1558
|
return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
1559
1559
|
}, R.parseClassElement = function(e) {
|
|
@@ -1568,7 +1568,7 @@ R.parseFunction = function(e, t, n, r, i) {
|
|
|
1568
1568
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
1569
1569
|
}
|
|
1570
1570
|
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) {
|
|
1571
|
-
var l = !n.static &&
|
|
1571
|
+
var l = !n.static && tt(n, "constructor"), u = l && e;
|
|
1572
1572
|
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);
|
|
1573
1573
|
} else this.parseClassField(n);
|
|
1574
1574
|
return n;
|
|
@@ -1578,15 +1578,15 @@ R.parseFunction = function(e, t, n, r, i) {
|
|
|
1578
1578
|
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);
|
|
1579
1579
|
}, R.parseClassMethod = function(e, t, n, r) {
|
|
1580
1580
|
var i = e.key;
|
|
1581
|
-
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 &&
|
|
1581
|
+
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 && tt(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
1582
1582
|
var a = e.value = this.parseMethod(t, n, r);
|
|
1583
1583
|
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");
|
|
1584
1584
|
}, R.parseClassField = function(e) {
|
|
1585
|
-
return
|
|
1585
|
+
return tt(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && tt(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(D.eq) ? (this.enterScope(Le | Fe), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
1586
1586
|
}, R.parseClassStaticBlock = function(e) {
|
|
1587
1587
|
e.body = [];
|
|
1588
1588
|
var t = this.labels;
|
|
1589
|
-
for (this.labels = [], this.enterScope(
|
|
1589
|
+
for (this.labels = [], this.enterScope(N | Fe); this.type !== D.braceR;) {
|
|
1590
1590
|
var n = this.parseStatement(null);
|
|
1591
1591
|
e.body.push(n);
|
|
1592
1592
|
}
|
|
@@ -1605,14 +1605,14 @@ R.parseFunction = function(e, t, n, r, i) {
|
|
|
1605
1605
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
1606
1606
|
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
1607
1607
|
var o = n[a];
|
|
1608
|
-
|
|
1608
|
+
ye(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
1609
1609
|
}
|
|
1610
1610
|
};
|
|
1611
|
-
function
|
|
1611
|
+
function et(e, t) {
|
|
1612
1612
|
var n = t.key.name, r = e[n], i = "true";
|
|
1613
1613
|
return t.type === "MethodDefinition" && (t.kind === "get" || t.kind === "set") && (i = (t.static ? "s" : "i") + t.kind), r === "iget" && i === "iset" || r === "iset" && i === "iget" || r === "sget" && i === "sset" || r === "sset" && i === "sget" ? (e[n] = "true", !1) : r ? !0 : (e[n] = i, !1);
|
|
1614
1614
|
}
|
|
1615
|
-
function
|
|
1615
|
+
function tt(e, t) {
|
|
1616
1616
|
var n = e.computed, r = e.key;
|
|
1617
1617
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
1618
1618
|
}
|
|
@@ -1640,7 +1640,7 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1640
1640
|
var e;
|
|
1641
1641
|
if (this.type === D._function || (e = this.isAsyncFunction())) {
|
|
1642
1642
|
var t = this.startNode();
|
|
1643
|
-
return this.next(), e && this.next(), this.parseFunction(t,
|
|
1643
|
+
return this.next(), e && this.next(), this.parseFunction(t, Ze | $e, !1, e);
|
|
1644
1644
|
}
|
|
1645
1645
|
if (this.type === D._class) {
|
|
1646
1646
|
var n = this.startNode();
|
|
@@ -1649,7 +1649,7 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1649
1649
|
var r = this.parseMaybeAssign();
|
|
1650
1650
|
return this.semicolon(), r;
|
|
1651
1651
|
}, R.checkExport = function(e, t, n) {
|
|
1652
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
1652
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), ye(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
1653
1653
|
}, R.checkPatternExport = function(e, t) {
|
|
1654
1654
|
var n = t.type;
|
|
1655
1655
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
@@ -1681,7 +1681,7 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1681
1681
|
}
|
|
1682
1682
|
return t;
|
|
1683
1683
|
}, R.parseImport = function(e) {
|
|
1684
|
-
return this.next(), this.type === D.string ? (e.specifiers =
|
|
1684
|
+
return this.next(), this.type === D.string ? (e.specifiers = Xe, 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");
|
|
1685
1685
|
}, R.parseImportSpecifier = function() {
|
|
1686
1686
|
var e = this.startNode();
|
|
1687
1687
|
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, P), this.finishNode(e, "ImportSpecifier");
|
|
@@ -1709,7 +1709,7 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1709
1709
|
if (n) n = !1;
|
|
1710
1710
|
else if (this.expect(D.comma), this.afterTrailingComma(D.braceR)) break;
|
|
1711
1711
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
1712
|
-
|
|
1712
|
+
ye(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
1713
1713
|
}
|
|
1714
1714
|
return e;
|
|
1715
1715
|
}, R.parseImportAttribute = function() {
|
|
@@ -1718,7 +1718,7 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1718
1718
|
}, R.parseModuleExportName = function() {
|
|
1719
1719
|
if (this.options.ecmaVersion >= 13 && this.type === D.string) {
|
|
1720
1720
|
var e = this.parseLiteral(this.value);
|
|
1721
|
-
return
|
|
1721
|
+
return Se.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
1722
1722
|
}
|
|
1723
1723
|
return this.parseIdent(!0);
|
|
1724
1724
|
}, R.adaptDirectivePrologue = function(e) {
|
|
@@ -1809,11 +1809,11 @@ z.toAssignable = function(e, t, n) {
|
|
|
1809
1809
|
var r = this.startNodeAt(e, t);
|
|
1810
1810
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
1811
1811
|
}, z.checkLValSimple = function(e, t, n) {
|
|
1812
|
-
t === void 0 && (t =
|
|
1813
|
-
var r = t !==
|
|
1812
|
+
t === void 0 && (t = Ve);
|
|
1813
|
+
var r = t !== Ve;
|
|
1814
1814
|
switch (e.type) {
|
|
1815
1815
|
case "Identifier":
|
|
1816
|
-
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === P && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (
|
|
1816
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === P && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (ye(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== Ge && this.declareName(e.name, t, e.start));
|
|
1817
1817
|
break;
|
|
1818
1818
|
case "ChainExpression":
|
|
1819
1819
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -1825,7 +1825,7 @@ z.toAssignable = function(e, t, n) {
|
|
|
1825
1825
|
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
1826
1826
|
}
|
|
1827
1827
|
}, z.checkLValPattern = function(e, t, n) {
|
|
1828
|
-
switch (t === void 0 && (t =
|
|
1828
|
+
switch (t === void 0 && (t = Ve), e.type) {
|
|
1829
1829
|
case "ObjectPattern":
|
|
1830
1830
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
1831
1831
|
var a = i[r];
|
|
@@ -1841,7 +1841,7 @@ z.toAssignable = function(e, t, n) {
|
|
|
1841
1841
|
default: this.checkLValSimple(e, t, n);
|
|
1842
1842
|
}
|
|
1843
1843
|
}, z.checkLValInnerPattern = function(e, t, n) {
|
|
1844
|
-
switch (t === void 0 && (t =
|
|
1844
|
+
switch (t === void 0 && (t = Ve), e.type) {
|
|
1845
1845
|
case "Property":
|
|
1846
1846
|
this.checkLValInnerPattern(e.value, t, n);
|
|
1847
1847
|
break;
|
|
@@ -1869,24 +1869,24 @@ var B = function(e, t, n, r, i) {
|
|
|
1869
1869
|
f_expr: new B("function", !0),
|
|
1870
1870
|
f_expr_gen: new B("function", !0, !1, null, !0),
|
|
1871
1871
|
f_gen: new B("function", !1, !1, null, !0)
|
|
1872
|
-
},
|
|
1873
|
-
|
|
1872
|
+
}, nt = F.prototype;
|
|
1873
|
+
nt.initialContext = function() {
|
|
1874
1874
|
return [V.b_stat];
|
|
1875
|
-
},
|
|
1875
|
+
}, nt.curContext = function() {
|
|
1876
1876
|
return this.context[this.context.length - 1];
|
|
1877
|
-
},
|
|
1877
|
+
}, nt.braceIsBlock = function(e) {
|
|
1878
1878
|
var t = this.curContext();
|
|
1879
1879
|
return t === V.f_expr || t === V.f_stat ? !0 : e === D.colon && (t === V.b_stat || t === V.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 === V.b_stat : e === D._var || e === D._const || e === D.name ? !1 : !this.exprAllowed;
|
|
1880
|
-
},
|
|
1880
|
+
}, nt.inGeneratorContext = function() {
|
|
1881
1881
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
1882
1882
|
var t = this.context[e];
|
|
1883
1883
|
if (t.token === "function") return t.generator;
|
|
1884
1884
|
}
|
|
1885
1885
|
return !1;
|
|
1886
|
-
},
|
|
1886
|
+
}, nt.updateContext = function(e) {
|
|
1887
1887
|
var t, n = this.type;
|
|
1888
1888
|
n.keyword && e === D.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
1889
|
-
},
|
|
1889
|
+
}, nt.overrideContext = function(e) {
|
|
1890
1890
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
1891
1891
|
}, D.parenR.updateContext = D.braceR.updateContext = function() {
|
|
1892
1892
|
if (this.context.length === 1) {
|
|
@@ -1961,7 +1961,7 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1961
1961
|
this.exprAllowed = !1;
|
|
1962
1962
|
}
|
|
1963
1963
|
var r = !1, i = -1, a = -1, o = -1;
|
|
1964
|
-
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
1964
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new qe(), r = !0);
|
|
1965
1965
|
var s = this.start, c = this.startLoc;
|
|
1966
1966
|
(this.type === D.parenL || this.type === D.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
1967
1967
|
var l = this.parseMaybeConditional(e, t);
|
|
@@ -2001,7 +2001,7 @@ H.checkPropClash = function(e, t, n) {
|
|
|
2001
2001
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
2002
2002
|
else if (this.type.prefix) {
|
|
2003
2003
|
var s = this.startNode(), c = this.type === D.incDec;
|
|
2004
|
-
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" &&
|
|
2004
|
+
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" && rt(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && it(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
|
|
2005
2005
|
} 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();
|
|
2006
2006
|
else {
|
|
2007
2007
|
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
@@ -2015,11 +2015,11 @@ H.checkPropClash = function(e, t, n) {
|
|
|
2015
2015
|
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
2016
2016
|
} else return o;
|
|
2017
2017
|
};
|
|
2018
|
-
function
|
|
2019
|
-
return e.type === "Identifier" || e.type === "ParenthesizedExpression" &&
|
|
2018
|
+
function rt(e) {
|
|
2019
|
+
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && rt(e.expression);
|
|
2020
2020
|
}
|
|
2021
|
-
function
|
|
2022
|
-
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" &&
|
|
2021
|
+
function it(e) {
|
|
2022
|
+
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && it(e.expression) || e.type === "ParenthesizedExpression" && it(e.expression);
|
|
2023
2023
|
}
|
|
2024
2024
|
H.parseExprSubscripts = function(e, t) {
|
|
2025
2025
|
var n = this.start, r = this.startLoc, i = this.parseExprAtom(e, t);
|
|
@@ -2050,17 +2050,17 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2050
2050
|
var u = this.startNodeAt(t, n);
|
|
2051
2051
|
u.object = e, l ? (u.property = this.parseExpression(), this.expect(D.bracketR)) : u.property = this.type === D.privateId && e.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
2052
2052
|
} else if (!r && this.eat(D.parenL)) {
|
|
2053
|
-
var d = new
|
|
2053
|
+
var d = new qe(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
2054
2054
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
2055
|
-
var
|
|
2056
|
-
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,
|
|
2055
|
+
var h = this.parseExprList(D.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
2056
|
+
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);
|
|
2057
2057
|
this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
|
|
2058
|
-
var
|
|
2059
|
-
|
|
2058
|
+
var g = this.startNodeAt(t, n);
|
|
2059
|
+
g.callee = e, g.arguments = h, s && (g.optional = c), e = this.finishNode(g, "CallExpression");
|
|
2060
2060
|
} else if (this.type === D.backQuote) {
|
|
2061
2061
|
(c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
2062
|
-
var
|
|
2063
|
-
|
|
2062
|
+
var _ = this.startNodeAt(t, n);
|
|
2063
|
+
_.tag = e, _.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(_, "TaggedTemplateExpression");
|
|
2064
2064
|
}
|
|
2065
2065
|
return e;
|
|
2066
2066
|
}, H.parseExprAtom = function(e, t, n) {
|
|
@@ -2134,7 +2134,7 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2134
2134
|
var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
|
|
2135
2135
|
if (this.options.ecmaVersion >= 6) {
|
|
2136
2136
|
this.next();
|
|
2137
|
-
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new
|
|
2137
|
+
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new qe(), f = this.yieldPos, p = this.awaitPos, m;
|
|
2138
2138
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== D.parenR;) {
|
|
2139
2139
|
if (l ? l = !1 : this.expect(D.comma), a && this.afterTrailingComma(D.parenR, !0)) {
|
|
2140
2140
|
u = !0;
|
|
@@ -2146,13 +2146,13 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2146
2146
|
}
|
|
2147
2147
|
c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
|
|
2148
2148
|
}
|
|
2149
|
-
var
|
|
2149
|
+
var h = this.lastTokEnd, g = this.lastTokEndLoc;
|
|
2150
2150
|
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);
|
|
2151
|
-
(!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",
|
|
2151
|
+
(!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];
|
|
2152
2152
|
} else i = this.parseParenExpression();
|
|
2153
2153
|
if (this.options.preserveParens) {
|
|
2154
|
-
var
|
|
2155
|
-
return
|
|
2154
|
+
var _ = this.startNodeAt(n, r);
|
|
2155
|
+
return _.expression = i, this.finishNode(_, "ParenthesizedExpression");
|
|
2156
2156
|
}
|
|
2157
2157
|
return i;
|
|
2158
2158
|
}, H.parseParenItem = function(e) {
|
|
@@ -2160,7 +2160,7 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2160
2160
|
}, H.parseParenArrowList = function(e, t, n, r) {
|
|
2161
2161
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !1, r);
|
|
2162
2162
|
};
|
|
2163
|
-
var
|
|
2163
|
+
var at = [];
|
|
2164
2164
|
H.parseNew = function() {
|
|
2165
2165
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
2166
2166
|
var e = this.startNode();
|
|
@@ -2171,7 +2171,7 @@ H.parseNew = function() {
|
|
|
2171
2171
|
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");
|
|
2172
2172
|
}
|
|
2173
2173
|
var r = this.start, i = this.startLoc;
|
|
2174
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), e.arguments = this.eat(D.parenL) ? this.parseExprList(D.parenR, this.options.ecmaVersion >= 8, !1) :
|
|
2174
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), e.arguments = this.eat(D.parenL) ? this.parseExprList(D.parenR, this.options.ecmaVersion >= 8, !1) : at, this.finishNode(e, "NewExpression");
|
|
2175
2175
|
}, H.parseTemplateElement = function(e) {
|
|
2176
2176
|
var t = e.isTagged, n = this.startNode();
|
|
2177
2177
|
return this.type === D.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
@@ -2227,10 +2227,10 @@ H.parseNew = function() {
|
|
|
2227
2227
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
2228
2228
|
}, H.parseMethod = function(e, t, n) {
|
|
2229
2229
|
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2230
|
-
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(
|
|
2230
|
+
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(Be(t, r.generator) | Fe | (n ? Ie : 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");
|
|
2231
2231
|
}, H.parseArrowExpression = function(e, t, n, r) {
|
|
2232
2232
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2233
|
-
return this.enterScope(
|
|
2233
|
+
return this.enterScope(Be(n, !1) | Ne), 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");
|
|
2234
2234
|
}, H.parseFunctionBody = function(e, t, n, r) {
|
|
2235
2235
|
var i = t && this.type !== D.braceL, a = this.strict, o = !1;
|
|
2236
2236
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
@@ -2238,7 +2238,7 @@ H.parseNew = function() {
|
|
|
2238
2238
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
2239
2239
|
(!a || s) && (o = this.strictDirective(this.end), o && s && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
2240
2240
|
var c = this.labels;
|
|
2241
|
-
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id,
|
|
2241
|
+
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, Ge), e.body = this.parseBlock(!1, void 0, o && !a), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = c;
|
|
2242
2242
|
}
|
|
2243
2243
|
this.exitScope();
|
|
2244
2244
|
}, H.isSimpleParamList = function(e) {
|
|
@@ -2247,7 +2247,7 @@ H.parseNew = function() {
|
|
|
2247
2247
|
}, H.checkParams = function(e, t) {
|
|
2248
2248
|
for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
|
|
2249
2249
|
var a = i[r];
|
|
2250
|
-
this.checkLValInnerPattern(a,
|
|
2250
|
+
this.checkLValInnerPattern(a, He, t ? null : n);
|
|
2251
2251
|
}
|
|
2252
2252
|
}, H.parseExprList = function(e, t, n, r) {
|
|
2253
2253
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
@@ -2259,7 +2259,7 @@ H.parseNew = function() {
|
|
|
2259
2259
|
return i;
|
|
2260
2260
|
}, H.checkUnreserved = function(e) {
|
|
2261
2261
|
var t = e.start, n = e.end, r = e.name;
|
|
2262
|
-
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 &
|
|
2262
|
+
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 & ze) && 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"));
|
|
2263
2263
|
}, H.parseIdent = function(e) {
|
|
2264
2264
|
var t = this.parseIdentNode();
|
|
2265
2265
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
@@ -2278,40 +2278,40 @@ H.parseNew = function() {
|
|
|
2278
2278
|
var t = this.startNode();
|
|
2279
2279
|
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
2280
2280
|
};
|
|
2281
|
-
var
|
|
2282
|
-
|
|
2283
|
-
var n =
|
|
2281
|
+
var ot = F.prototype;
|
|
2282
|
+
ot.raise = function(e, t) {
|
|
2283
|
+
var n = Te(this.input, e);
|
|
2284
2284
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
2285
2285
|
var r = SyntaxError(t);
|
|
2286
2286
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
2287
|
-
},
|
|
2288
|
-
if (this.options.locations) return new
|
|
2287
|
+
}, ot.raiseRecoverable = ot.raise, ot.curPosition = function() {
|
|
2288
|
+
if (this.options.locations) return new Ce(this.curLine, this.pos - this.lineStart);
|
|
2289
2289
|
};
|
|
2290
|
-
var U = F.prototype,
|
|
2290
|
+
var U = F.prototype, st = function(e) {
|
|
2291
2291
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
2292
2292
|
};
|
|
2293
2293
|
U.enterScope = function(e) {
|
|
2294
|
-
this.scopeStack.push(new
|
|
2294
|
+
this.scopeStack.push(new st(e));
|
|
2295
2295
|
}, U.exitScope = function() {
|
|
2296
2296
|
this.scopeStack.pop();
|
|
2297
2297
|
}, U.treatFunctionsAsVarInScope = function(e) {
|
|
2298
|
-
return e.flags &
|
|
2298
|
+
return e.flags & M || !this.inModule && e.flags & Ae;
|
|
2299
2299
|
}, U.declareName = function(e, t, n) {
|
|
2300
2300
|
var r = !1;
|
|
2301
2301
|
if (t === P) {
|
|
2302
2302
|
var i = this.currentScope();
|
|
2303
|
-
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags &
|
|
2304
|
-
} else if (t ===
|
|
2305
|
-
else if (t ===
|
|
2303
|
+
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & Ae && delete this.undefinedExports[e];
|
|
2304
|
+
} else if (t === We) this.currentScope().lexical.push(e);
|
|
2305
|
+
else if (t === Ue) {
|
|
2306
2306
|
var a = this.currentScope();
|
|
2307
2307
|
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
2308
2308
|
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
2309
2309
|
var s = this.scopeStack[o];
|
|
2310
|
-
if (s.lexical.indexOf(e) > -1 && !(s.flags &
|
|
2310
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & Pe && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
2311
2311
|
r = !0;
|
|
2312
2312
|
break;
|
|
2313
2313
|
}
|
|
2314
|
-
if (s.var.push(e), this.inModule && s.flags &
|
|
2314
|
+
if (s.var.push(e), this.inModule && s.flags & Ae && delete this.undefinedExports[e], s.flags & ze) break;
|
|
2315
2315
|
}
|
|
2316
2316
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
2317
2317
|
}, U.checkLocalExport = function(e) {
|
|
@@ -2321,89 +2321,89 @@ U.enterScope = function(e) {
|
|
|
2321
2321
|
}, U.currentVarScope = function() {
|
|
2322
2322
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2323
2323
|
var t = this.scopeStack[e];
|
|
2324
|
-
if (t.flags & (
|
|
2324
|
+
if (t.flags & (ze | Le | N)) return t;
|
|
2325
2325
|
}
|
|
2326
2326
|
}, U.currentThisScope = function() {
|
|
2327
2327
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2328
2328
|
var t = this.scopeStack[e];
|
|
2329
|
-
if (t.flags & (
|
|
2329
|
+
if (t.flags & (ze | Le | N) && !(t.flags & Ne)) return t;
|
|
2330
2330
|
}
|
|
2331
2331
|
};
|
|
2332
|
-
var
|
|
2333
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
2334
|
-
},
|
|
2335
|
-
|
|
2336
|
-
return new
|
|
2337
|
-
},
|
|
2338
|
-
return new
|
|
2332
|
+
var ct = function(e, t, n) {
|
|
2333
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new we(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
2334
|
+
}, lt = F.prototype;
|
|
2335
|
+
lt.startNode = function() {
|
|
2336
|
+
return new ct(this, this.start, this.startLoc);
|
|
2337
|
+
}, lt.startNodeAt = function(e, t) {
|
|
2338
|
+
return new ct(this, e, t);
|
|
2339
2339
|
};
|
|
2340
|
-
function
|
|
2340
|
+
function ut(e, t, n, r) {
|
|
2341
2341
|
return e.type = t, e.end = n, this.options.locations && (e.loc.end = r), this.options.ranges && (e.range[1] = n), e;
|
|
2342
2342
|
}
|
|
2343
|
-
|
|
2344
|
-
return
|
|
2345
|
-
},
|
|
2346
|
-
return
|
|
2347
|
-
},
|
|
2348
|
-
var t = new
|
|
2343
|
+
lt.finishNode = function(e, t) {
|
|
2344
|
+
return ut.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
|
|
2345
|
+
}, lt.finishNodeAt = function(e, t, n, r) {
|
|
2346
|
+
return ut.call(this, e, t, n, r);
|
|
2347
|
+
}, lt.copyNode = function(e) {
|
|
2348
|
+
var t = new ct(this, e.start, this.startLoc);
|
|
2349
2349
|
for (var n in e) t[n] = e[n];
|
|
2350
2350
|
return t;
|
|
2351
2351
|
};
|
|
2352
|
-
var
|
|
2353
|
-
9:
|
|
2354
|
-
10:
|
|
2355
|
-
11:
|
|
2356
|
-
12:
|
|
2357
|
-
13:
|
|
2358
|
-
14:
|
|
2359
|
-
},
|
|
2352
|
+
var dt = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz", ft = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", pt = ft + " Extended_Pictographic", mt = pt, ht = mt + " EBase EComp EMod EPres ExtPict", gt = ht, _t = {
|
|
2353
|
+
9: ft,
|
|
2354
|
+
10: pt,
|
|
2355
|
+
11: mt,
|
|
2356
|
+
12: ht,
|
|
2357
|
+
13: gt,
|
|
2358
|
+
14: gt
|
|
2359
|
+
}, vt = {
|
|
2360
2360
|
9: "",
|
|
2361
2361
|
10: "",
|
|
2362
2362
|
11: "",
|
|
2363
2363
|
12: "",
|
|
2364
2364
|
13: "",
|
|
2365
2365
|
14: "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"
|
|
2366
|
-
},
|
|
2367
|
-
9:
|
|
2368
|
-
10:
|
|
2369
|
-
11:
|
|
2370
|
-
12:
|
|
2371
|
-
13:
|
|
2372
|
-
14:
|
|
2373
|
-
},
|
|
2374
|
-
function
|
|
2375
|
-
var t =
|
|
2376
|
-
binary: A(
|
|
2377
|
-
binaryOfStrings: A(
|
|
2366
|
+
}, yt = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", bt = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", xt = bt + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", St = xt + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", Ct = St + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", wt = Ct + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", Tt = {
|
|
2367
|
+
9: bt,
|
|
2368
|
+
10: xt,
|
|
2369
|
+
11: St,
|
|
2370
|
+
12: Ct,
|
|
2371
|
+
13: wt,
|
|
2372
|
+
14: wt + " " + dt
|
|
2373
|
+
}, Et = {};
|
|
2374
|
+
function Dt(e) {
|
|
2375
|
+
var t = Et[e] = {
|
|
2376
|
+
binary: A(_t[e] + " " + yt),
|
|
2377
|
+
binaryOfStrings: A(vt[e]),
|
|
2378
2378
|
nonBinary: {
|
|
2379
|
-
General_Category: A(
|
|
2380
|
-
Script: A(
|
|
2379
|
+
General_Category: A(yt),
|
|
2380
|
+
Script: A(Tt[e])
|
|
2381
2381
|
}
|
|
2382
2382
|
};
|
|
2383
2383
|
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;
|
|
2384
2384
|
}
|
|
2385
|
-
for (var
|
|
2385
|
+
for (var Ot = 0, kt = [
|
|
2386
2386
|
9,
|
|
2387
2387
|
10,
|
|
2388
2388
|
11,
|
|
2389
2389
|
12,
|
|
2390
2390
|
13,
|
|
2391
2391
|
14
|
|
2392
|
-
];
|
|
2393
|
-
var
|
|
2394
|
-
|
|
2392
|
+
]; Ot < kt.length; Ot += 1) {
|
|
2393
|
+
var At = kt[Ot];
|
|
2394
|
+
Dt(At);
|
|
2395
2395
|
}
|
|
2396
|
-
var W = F.prototype,
|
|
2396
|
+
var W = F.prototype, jt = function(e, t) {
|
|
2397
2397
|
this.parent = e, this.base = t || this;
|
|
2398
2398
|
};
|
|
2399
|
-
|
|
2399
|
+
jt.prototype.separatedFrom = function(e) {
|
|
2400
2400
|
for (var t = this; t; t = t.parent) for (var n = e; n; n = n.parent) if (t.base === n.base && t !== n) return !0;
|
|
2401
2401
|
return !1;
|
|
2402
|
-
},
|
|
2403
|
-
return new
|
|
2402
|
+
}, jt.prototype.sibling = function() {
|
|
2403
|
+
return new jt(this.parent, this.base);
|
|
2404
2404
|
};
|
|
2405
2405
|
var G = function(e) {
|
|
2406
|
-
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties =
|
|
2406
|
+
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = Et[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
2407
2407
|
};
|
|
2408
2408
|
G.prototype.reset = function(e, t, n) {
|
|
2409
2409
|
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
@@ -2447,12 +2447,12 @@ G.prototype.reset = function(e, t, n) {
|
|
|
2447
2447
|
}
|
|
2448
2448
|
this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
|
|
2449
2449
|
};
|
|
2450
|
-
function
|
|
2450
|
+
function Mt(e) {
|
|
2451
2451
|
for (var t in e) return !0;
|
|
2452
2452
|
return !1;
|
|
2453
2453
|
}
|
|
2454
2454
|
W.validateRegExpPattern = function(e) {
|
|
2455
|
-
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 &&
|
|
2455
|
+
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && Mt(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
2456
2456
|
}, W.regexp_pattern = function(e) {
|
|
2457
2457
|
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
2458
2458
|
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
@@ -2461,7 +2461,7 @@ W.validateRegExpPattern = function(e) {
|
|
|
2461
2461
|
}
|
|
2462
2462
|
}, W.regexp_disjunction = function(e) {
|
|
2463
2463
|
var t = this.options.ecmaVersion >= 16;
|
|
2464
|
-
for (t && (e.branchID = new
|
|
2464
|
+
for (t && (e.branchID = new jt(e.branchID, null)), this.regexp_alternative(e); e.eat(124);) t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
|
|
2465
2465
|
t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, !0) && e.raise("Nothing to repeat"), e.eat(123) && e.raise("Lone quantifier brackets");
|
|
2466
2466
|
}, W.regexp_alternative = function(e) {
|
|
2467
2467
|
for (; e.pos < e.source.length && this.regexp_eatTerm(e););
|
|
@@ -2536,10 +2536,10 @@ W.validateRegExpPattern = function(e) {
|
|
|
2536
2536
|
}
|
|
2537
2537
|
return !1;
|
|
2538
2538
|
}, W.regexp_eatModifiers = function(e) {
|
|
2539
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 &&
|
|
2539
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && Nt(n);) t += j(n), e.advance();
|
|
2540
2540
|
return t;
|
|
2541
2541
|
};
|
|
2542
|
-
function
|
|
2542
|
+
function Nt(e) {
|
|
2543
2543
|
return e === 105 || e === 109 || e === 115;
|
|
2544
2544
|
}
|
|
2545
2545
|
W.regexp_eatExtendedAtom = function(e) {
|
|
@@ -2548,13 +2548,13 @@ W.regexp_eatExtendedAtom = function(e) {
|
|
|
2548
2548
|
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
2549
2549
|
}, W.regexp_eatSyntaxCharacter = function(e) {
|
|
2550
2550
|
var t = e.current();
|
|
2551
|
-
return
|
|
2551
|
+
return Pt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2552
2552
|
};
|
|
2553
|
-
function
|
|
2553
|
+
function Pt(e) {
|
|
2554
2554
|
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
2555
2555
|
}
|
|
2556
2556
|
W.regexp_eatPatternCharacters = function(e) {
|
|
2557
|
-
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !
|
|
2557
|
+
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !Pt(n);) e.advance();
|
|
2558
2558
|
return e.pos !== t;
|
|
2559
2559
|
}, W.regexp_eatExtendedPatternCharacter = function(e) {
|
|
2560
2560
|
var t = e.current();
|
|
@@ -2583,16 +2583,16 @@ W.regexp_eatPatternCharacters = function(e) {
|
|
|
2583
2583
|
return !1;
|
|
2584
2584
|
}, W.regexp_eatRegExpIdentifierStart = function(e) {
|
|
2585
2585
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2586
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
2586
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), Ft(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2587
2587
|
};
|
|
2588
|
-
function
|
|
2588
|
+
function Ft(e) {
|
|
2589
2589
|
return b(e, !0) || e === 36 || e === 95;
|
|
2590
2590
|
}
|
|
2591
2591
|
W.regexp_eatRegExpIdentifierPart = function(e) {
|
|
2592
2592
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2593
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
2593
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), It(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2594
2594
|
};
|
|
2595
|
-
function
|
|
2595
|
+
function It(e) {
|
|
2596
2596
|
return x(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2597
2597
|
}
|
|
2598
2598
|
W.regexp_eatAtomEscape = function(e) {
|
|
@@ -2622,15 +2622,15 @@ W.regexp_eatAtomEscape = function(e) {
|
|
|
2622
2622
|
}
|
|
2623
2623
|
return !1;
|
|
2624
2624
|
}, W.regexp_eatZero = function(e) {
|
|
2625
|
-
return e.current() === 48 && !
|
|
2625
|
+
return e.current() === 48 && !Kt(e.lookahead()) && (e.lastIntValue = 0, e.advance(), !0);
|
|
2626
2626
|
}, W.regexp_eatControlEscape = function(e) {
|
|
2627
2627
|
var t = e.current();
|
|
2628
2628
|
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 && (e.lastIntValue = 13, e.advance(), !0);
|
|
2629
2629
|
}, W.regexp_eatControlLetter = function(e) {
|
|
2630
2630
|
var t = e.current();
|
|
2631
|
-
return
|
|
2631
|
+
return Lt(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2632
2632
|
};
|
|
2633
|
-
function
|
|
2633
|
+
function Lt(e) {
|
|
2634
2634
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2635
2635
|
}
|
|
2636
2636
|
W.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
@@ -2649,12 +2649,12 @@ W.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
2649
2649
|
}
|
|
2650
2650
|
return !0;
|
|
2651
2651
|
}
|
|
2652
|
-
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) &&
|
|
2652
|
+
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && Rt(e.lastIntValue)) return !0;
|
|
2653
2653
|
r && e.raise("Invalid unicode escape"), e.pos = n;
|
|
2654
2654
|
}
|
|
2655
2655
|
return !1;
|
|
2656
2656
|
};
|
|
2657
|
-
function
|
|
2657
|
+
function Rt(e) {
|
|
2658
2658
|
return e >= 0 && e <= 1114111;
|
|
2659
2659
|
}
|
|
2660
2660
|
W.regexp_eatIdentityEscape = function(e) {
|
|
@@ -2672,10 +2672,10 @@ W.regexp_eatIdentityEscape = function(e) {
|
|
|
2672
2672
|
}
|
|
2673
2673
|
return !1;
|
|
2674
2674
|
};
|
|
2675
|
-
var
|
|
2675
|
+
var zt = 0, K = 1, q = 2;
|
|
2676
2676
|
W.regexp_eatCharacterClassEscape = function(e) {
|
|
2677
2677
|
var t = e.current();
|
|
2678
|
-
if (
|
|
2678
|
+
if (Bt(t)) return e.lastIntValue = -1, e.advance(), K;
|
|
2679
2679
|
var n = !1;
|
|
2680
2680
|
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
2681
2681
|
e.lastIntValue = -1, e.advance();
|
|
@@ -2683,9 +2683,9 @@ W.regexp_eatCharacterClassEscape = function(e) {
|
|
|
2683
2683
|
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === q && e.raise("Invalid property name"), r;
|
|
2684
2684
|
e.raise("Invalid property name");
|
|
2685
2685
|
}
|
|
2686
|
-
return
|
|
2686
|
+
return zt;
|
|
2687
2687
|
};
|
|
2688
|
-
function
|
|
2688
|
+
function Bt(e) {
|
|
2689
2689
|
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
2690
2690
|
}
|
|
2691
2691
|
W.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
@@ -2701,28 +2701,28 @@ W.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
2701
2701
|
var i = e.lastStringValue;
|
|
2702
2702
|
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
2703
2703
|
}
|
|
2704
|
-
return
|
|
2704
|
+
return zt;
|
|
2705
2705
|
}, W.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
2706
|
-
|
|
2706
|
+
ye(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
2707
2707
|
}, W.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2708
2708
|
if (e.unicodeProperties.binary.test(t)) return K;
|
|
2709
2709
|
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return q;
|
|
2710
2710
|
e.raise("Invalid property name");
|
|
2711
2711
|
}, W.regexp_eatUnicodePropertyName = function(e) {
|
|
2712
2712
|
var t = 0;
|
|
2713
|
-
for (e.lastStringValue = "";
|
|
2713
|
+
for (e.lastStringValue = ""; Vt(t = e.current());) e.lastStringValue += j(t), e.advance();
|
|
2714
2714
|
return e.lastStringValue !== "";
|
|
2715
2715
|
};
|
|
2716
|
-
function
|
|
2717
|
-
return
|
|
2716
|
+
function Vt(e) {
|
|
2717
|
+
return Lt(e) || e === 95;
|
|
2718
2718
|
}
|
|
2719
2719
|
W.regexp_eatUnicodePropertyValue = function(e) {
|
|
2720
2720
|
var t = 0;
|
|
2721
|
-
for (e.lastStringValue = "";
|
|
2721
|
+
for (e.lastStringValue = ""; Ht(t = e.current());) e.lastStringValue += j(t), e.advance();
|
|
2722
2722
|
return e.lastStringValue !== "";
|
|
2723
2723
|
};
|
|
2724
|
-
function
|
|
2725
|
-
return
|
|
2724
|
+
function Ht(e) {
|
|
2725
|
+
return Vt(e) || Kt(e);
|
|
2726
2726
|
}
|
|
2727
2727
|
W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
2728
2728
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
@@ -2748,7 +2748,7 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2748
2748
|
if (this.regexp_eatClassEscape(e)) return !0;
|
|
2749
2749
|
if (e.switchU) {
|
|
2750
2750
|
var n = e.current();
|
|
2751
|
-
(n === 99 ||
|
|
2751
|
+
(n === 99 || Yt(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
2752
2752
|
}
|
|
2753
2753
|
e.pos = t;
|
|
2754
2754
|
}
|
|
@@ -2830,24 +2830,24 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2830
2830
|
var t = e.pos;
|
|
2831
2831
|
if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
2832
2832
|
var n = e.current();
|
|
2833
|
-
return n < 0 || n === e.lookahead() &&
|
|
2833
|
+
return n < 0 || n === e.lookahead() && Ut(n) || Wt(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
|
|
2834
2834
|
};
|
|
2835
|
-
function
|
|
2835
|
+
function Ut(e) {
|
|
2836
2836
|
return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
|
|
2837
2837
|
}
|
|
2838
|
-
function
|
|
2838
|
+
function Wt(e) {
|
|
2839
2839
|
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
2840
2840
|
}
|
|
2841
2841
|
W.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
2842
2842
|
var t = e.current();
|
|
2843
|
-
return
|
|
2843
|
+
return Gt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2844
2844
|
};
|
|
2845
|
-
function
|
|
2845
|
+
function Gt(e) {
|
|
2846
2846
|
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
2847
2847
|
}
|
|
2848
2848
|
W.regexp_eatClassControlLetter = function(e) {
|
|
2849
2849
|
var t = e.current();
|
|
2850
|
-
return
|
|
2850
|
+
return Kt(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2851
2851
|
}, W.regexp_eatHexEscapeSequence = function(e) {
|
|
2852
2852
|
var t = e.pos;
|
|
2853
2853
|
if (e.eat(120)) {
|
|
@@ -2857,21 +2857,21 @@ W.regexp_eatClassControlLetter = function(e) {
|
|
|
2857
2857
|
return !1;
|
|
2858
2858
|
}, W.regexp_eatDecimalDigits = function(e) {
|
|
2859
2859
|
var t = e.pos, n = 0;
|
|
2860
|
-
for (e.lastIntValue = 0;
|
|
2860
|
+
for (e.lastIntValue = 0; Kt(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
2861
2861
|
return e.pos !== t;
|
|
2862
2862
|
};
|
|
2863
|
-
function
|
|
2863
|
+
function Kt(e) {
|
|
2864
2864
|
return e >= 48 && e <= 57;
|
|
2865
2865
|
}
|
|
2866
2866
|
W.regexp_eatHexDigits = function(e) {
|
|
2867
2867
|
var t = e.pos, n = 0;
|
|
2868
|
-
for (e.lastIntValue = 0;
|
|
2868
|
+
for (e.lastIntValue = 0; qt(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + Jt(n), e.advance();
|
|
2869
2869
|
return e.pos !== t;
|
|
2870
2870
|
};
|
|
2871
|
-
function
|
|
2871
|
+
function qt(e) {
|
|
2872
2872
|
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
2873
2873
|
}
|
|
2874
|
-
function
|
|
2874
|
+
function Jt(e) {
|
|
2875
2875
|
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
2876
2876
|
}
|
|
2877
2877
|
W.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
@@ -2886,9 +2886,9 @@ W.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
2886
2886
|
return !1;
|
|
2887
2887
|
}, W.regexp_eatOctalDigit = function(e) {
|
|
2888
2888
|
var t = e.current();
|
|
2889
|
-
return
|
|
2889
|
+
return Yt(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
2890
2890
|
};
|
|
2891
|
-
function
|
|
2891
|
+
function Yt(e) {
|
|
2892
2892
|
return e >= 48 && e <= 55;
|
|
2893
2893
|
}
|
|
2894
2894
|
W.regexp_eatFixedHexDigits = function(e, t) {
|
|
@@ -2896,18 +2896,18 @@ W.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
2896
2896
|
e.lastIntValue = 0;
|
|
2897
2897
|
for (var r = 0; r < t; ++r) {
|
|
2898
2898
|
var i = e.current();
|
|
2899
|
-
if (!
|
|
2900
|
-
e.lastIntValue = 16 * e.lastIntValue +
|
|
2899
|
+
if (!qt(i)) return e.pos = n, !1;
|
|
2900
|
+
e.lastIntValue = 16 * e.lastIntValue + Jt(i), e.advance();
|
|
2901
2901
|
}
|
|
2902
2902
|
return !0;
|
|
2903
2903
|
};
|
|
2904
|
-
var
|
|
2905
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
2904
|
+
var Xt = function(e) {
|
|
2905
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new we(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2906
2906
|
}, J = F.prototype;
|
|
2907
2907
|
J.next = function(e) {
|
|
2908
|
-
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new
|
|
2908
|
+
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Xt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
2909
2909
|
}, J.getToken = function() {
|
|
2910
|
-
return this.next(), new
|
|
2910
|
+
return this.next(), new Xt(this);
|
|
2911
2911
|
}, typeof Symbol < "u" && (J[Symbol.iterator] = function() {
|
|
2912
2912
|
var e = this;
|
|
2913
2913
|
return { next: function() {
|
|
@@ -2933,10 +2933,10 @@ J.next = function(e) {
|
|
|
2933
2933
|
return this.fullCharCodeAt(this.pos);
|
|
2934
2934
|
}, J.skipBlockComment = function() {
|
|
2935
2935
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
2936
|
-
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 =
|
|
2936
|
+
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 = me(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
2937
2937
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
2938
2938
|
}, J.skipLineComment = function(e) {
|
|
2939
|
-
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !
|
|
2939
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !pe(r);) r = this.input.charCodeAt(++this.pos);
|
|
2940
2940
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
2941
2941
|
}, J.skipSpace = function() {
|
|
2942
2942
|
loop: for (; this.pos < this.input.length;) {
|
|
@@ -2963,7 +2963,7 @@ J.next = function(e) {
|
|
|
2963
2963
|
default: break loop;
|
|
2964
2964
|
}
|
|
2965
2965
|
break;
|
|
2966
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
2966
|
+
default: if (e > 8 && e < 14 || e >= 5760 && he.test(String.fromCharCode(e))) ++this.pos;
|
|
2967
2967
|
else break loop;
|
|
2968
2968
|
}
|
|
2969
2969
|
}
|
|
@@ -3104,17 +3104,17 @@ J.next = function(e) {
|
|
|
3104
3104
|
}
|
|
3105
3105
|
return r && s === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === a || t != null && this.pos - a !== t ? null : o;
|
|
3106
3106
|
};
|
|
3107
|
-
function
|
|
3107
|
+
function Zt(e, t) {
|
|
3108
3108
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
3109
3109
|
}
|
|
3110
|
-
function
|
|
3110
|
+
function Qt(e) {
|
|
3111
3111
|
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
3112
3112
|
}
|
|
3113
3113
|
J.readRadixNumber = function(e) {
|
|
3114
3114
|
var t = this.pos;
|
|
3115
3115
|
this.pos += 2;
|
|
3116
3116
|
var n = this.readInt(e);
|
|
3117
|
-
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n =
|
|
3117
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Qt(this.input.slice(t, this.pos)), ++this.pos) : b(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(D.num, n);
|
|
3118
3118
|
}, J.readNumber = function(e) {
|
|
3119
3119
|
var t = this.pos;
|
|
3120
3120
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
@@ -3122,11 +3122,11 @@ J.readRadixNumber = function(e) {
|
|
|
3122
3122
|
n && this.strict && this.raise(t, "Invalid number");
|
|
3123
3123
|
var r = this.input.charCodeAt(this.pos);
|
|
3124
3124
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3125
|
-
var i =
|
|
3125
|
+
var i = Qt(this.input.slice(t, this.pos));
|
|
3126
3126
|
return ++this.pos, b(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(D.num, i);
|
|
3127
3127
|
}
|
|
3128
3128
|
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")), b(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3129
|
-
var a =
|
|
3129
|
+
var a = Zt(this.input.slice(t, this.pos), n);
|
|
3130
3130
|
return this.finishToken(D.num, a);
|
|
3131
3131
|
}, J.readCodePoint = function() {
|
|
3132
3132
|
var e = this.input.charCodeAt(this.pos), t;
|
|
@@ -3141,22 +3141,22 @@ J.readRadixNumber = function(e) {
|
|
|
3141
3141
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3142
3142
|
var r = this.input.charCodeAt(this.pos);
|
|
3143
3143
|
if (r === e) break;
|
|
3144
|
-
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)) : (
|
|
3144
|
+
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)) : (pe(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
3145
3145
|
}
|
|
3146
3146
|
return t += this.input.slice(n, this.pos++), this.finishToken(D.string, t);
|
|
3147
3147
|
};
|
|
3148
|
-
var
|
|
3148
|
+
var $t = {};
|
|
3149
3149
|
J.tryReadTemplateToken = function() {
|
|
3150
3150
|
this.inTemplateElement = !0;
|
|
3151
3151
|
try {
|
|
3152
3152
|
this.readTmplToken();
|
|
3153
3153
|
} catch (e) {
|
|
3154
|
-
if (e ===
|
|
3154
|
+
if (e === $t) this.readInvalidTemplateToken();
|
|
3155
3155
|
else throw e;
|
|
3156
3156
|
}
|
|
3157
3157
|
this.inTemplateElement = !1;
|
|
3158
3158
|
}, J.invalidStringToken = function(e, t) {
|
|
3159
|
-
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw
|
|
3159
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw $t;
|
|
3160
3160
|
this.raise(e, t);
|
|
3161
3161
|
}, J.readTmplToken = function() {
|
|
3162
3162
|
for (var e = "", t = this.pos;;) {
|
|
@@ -3164,7 +3164,7 @@ J.tryReadTemplateToken = function() {
|
|
|
3164
3164
|
var n = this.input.charCodeAt(this.pos);
|
|
3165
3165
|
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));
|
|
3166
3166
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
3167
|
-
else if (
|
|
3167
|
+
else if (pe(n)) {
|
|
3168
3168
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
3169
3169
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3170
3170
|
case 10:
|
|
@@ -3211,7 +3211,7 @@ J.tryReadTemplateToken = function() {
|
|
|
3211
3211
|
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
3212
3212
|
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);
|
|
3213
3213
|
}
|
|
3214
|
-
return
|
|
3214
|
+
return pe(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3215
3215
|
}
|
|
3216
3216
|
}, J.readHexChar = function(e) {
|
|
3217
3217
|
var t = this.pos, n = this.readInt(16, e);
|
|
@@ -3233,31 +3233,31 @@ J.tryReadTemplateToken = function() {
|
|
|
3233
3233
|
return e + this.input.slice(n, this.pos);
|
|
3234
3234
|
}, J.readWord = function() {
|
|
3235
3235
|
var e = this.readWord1(), t = D.name;
|
|
3236
|
-
return this.keywords.test(e) && (t =
|
|
3236
|
+
return this.keywords.test(e) && (t = de[e]), this.finishToken(t, e);
|
|
3237
3237
|
}, F.acorn = {
|
|
3238
3238
|
Parser: F,
|
|
3239
3239
|
version: "8.18.0",
|
|
3240
|
-
defaultOptions:
|
|
3241
|
-
Position:
|
|
3242
|
-
SourceLocation:
|
|
3243
|
-
getLineInfo:
|
|
3244
|
-
Node:
|
|
3240
|
+
defaultOptions: Ee,
|
|
3241
|
+
Position: Ce,
|
|
3242
|
+
SourceLocation: we,
|
|
3243
|
+
getLineInfo: Te,
|
|
3244
|
+
Node: ct,
|
|
3245
3245
|
TokenType: S,
|
|
3246
3246
|
tokTypes: D,
|
|
3247
|
-
keywordTypes:
|
|
3247
|
+
keywordTypes: de,
|
|
3248
3248
|
TokContext: B,
|
|
3249
3249
|
tokContexts: V,
|
|
3250
3250
|
isIdentifierChar: x,
|
|
3251
3251
|
isIdentifierStart: b,
|
|
3252
|
-
Token:
|
|
3253
|
-
isNewLine:
|
|
3252
|
+
Token: Xt,
|
|
3253
|
+
isNewLine: pe,
|
|
3254
3254
|
lineBreak: O,
|
|
3255
|
-
lineBreakG:
|
|
3256
|
-
nonASCIIwhitespace:
|
|
3255
|
+
lineBreakG: fe,
|
|
3256
|
+
nonASCIIwhitespace: he
|
|
3257
3257
|
};
|
|
3258
3258
|
//#endregion
|
|
3259
3259
|
//#region ../../node_modules/.pnpm/acorn-walk@8.3.5/node_modules/acorn-walk/dist/walk.mjs
|
|
3260
|
-
function
|
|
3260
|
+
function en(e, t, n) {
|
|
3261
3261
|
n(e, t);
|
|
3262
3262
|
}
|
|
3263
3263
|
function Y(e, t, n) {}
|
|
@@ -3267,7 +3267,7 @@ X.Program = X.BlockStatement = X.StaticBlock = function(e, t, n) {
|
|
|
3267
3267
|
var a = i[r];
|
|
3268
3268
|
n(a, t, "Statement");
|
|
3269
3269
|
}
|
|
3270
|
-
}, X.Statement =
|
|
3270
|
+
}, X.Statement = en, X.EmptyStatement = Y, X.ExpressionStatement = X.ParenthesizedExpression = X.ChainExpression = function(e, t, n) {
|
|
3271
3271
|
return n(e.expression, t, "Expression");
|
|
3272
3272
|
}, X.IfStatement = function(e, t, n) {
|
|
3273
3273
|
n(e.test, t, "Expression"), n(e.consequent, t, "Statement"), e.alternate && n(e.alternate, t, "Statement");
|
|
@@ -3321,7 +3321,7 @@ X.Program = X.BlockStatement = X.StaticBlock = function(e, t, n) {
|
|
|
3321
3321
|
n(e.body, t, e.expression ? "Expression" : "Statement");
|
|
3322
3322
|
}, X.Pattern = function(e, t, n) {
|
|
3323
3323
|
e.type === "Identifier" ? n(e, t, "VariablePattern") : e.type === "MemberExpression" ? n(e, t, "MemberPattern") : n(e, t);
|
|
3324
|
-
}, X.VariablePattern = Y, X.MemberPattern =
|
|
3324
|
+
}, X.VariablePattern = Y, X.MemberPattern = en, X.RestElement = function(e, t, n) {
|
|
3325
3325
|
return n(e.argument, t, "Pattern");
|
|
3326
3326
|
}, X.ArrayPattern = function(e, t, n) {
|
|
3327
3327
|
for (var r = 0, i = e.elements; r < i.length; r += 1) {
|
|
@@ -3333,7 +3333,7 @@ X.Program = X.BlockStatement = X.StaticBlock = function(e, t, n) {
|
|
|
3333
3333
|
var a = i[r];
|
|
3334
3334
|
a.type === "Property" ? (a.computed && n(a.key, t, "Expression"), n(a.value, t, "Pattern")) : a.type === "RestElement" && n(a.argument, t, "Pattern");
|
|
3335
3335
|
}
|
|
3336
|
-
}, X.Expression =
|
|
3336
|
+
}, X.Expression = en, X.ThisExpression = X.Super = X.MetaProperty = Y, X.ArrayExpression = function(e, t, n) {
|
|
3337
3337
|
for (var r = 0, i = e.elements; r < i.length; r += 1) {
|
|
3338
3338
|
var a = i[r];
|
|
3339
3339
|
a && n(a, t, "Expression");
|
|
@@ -3431,29 +3431,26 @@ var Z = {
|
|
|
3431
3431
|
Z.Data, Z.Comment, Z.EndTagOpen, Z.TagOpen, Z.Interpolation, Z.Data, Z.EOF, Z.TagOpen, Z.BeforeAttributeName, Z.EndTagOpen, Z.BeforeAttributeName, Z.BeforeAttributeName, Z.AttributeName, Z.Data, Z.RawText, Z.Data, Z.AttributeName, Z.AfterAttributeName, Z.AfterAttributeName, Z.BeforeAttributeValue, Z.BeforeAttributeName, Z.BeforeAttributeValue, Z.AttributeValueQuoted, Z.AttributeValueInterpolation, Z.AttributeValueQuoted, Z.BeforeAttributeName, Z.AttributeValueInterpolation, Z.BeforeAttributeName, Z.Comment, Z.Data, Z.Interpolation, Z.Data, Z.BeforeAttributeName, Z.RawText, Z.RawText, Z.EndTagOpen, Z.EOF, Z.EOF, Z.EOF;
|
|
3432
3432
|
//#endregion
|
|
3433
3433
|
//#region src/index.ts
|
|
3434
|
-
|
|
3435
|
-
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3436
|
-
}
|
|
3437
|
-
var Zt = /* @__PURE__ */ new Set([
|
|
3434
|
+
var tn = /* @__PURE__ */ new Set([
|
|
3438
3435
|
"__proto__",
|
|
3439
3436
|
"constructor",
|
|
3440
3437
|
"prototype",
|
|
3441
3438
|
"__drift_mark_dirty__"
|
|
3442
3439
|
]);
|
|
3443
|
-
function
|
|
3444
|
-
e && typeof e == "object" && !
|
|
3440
|
+
function nn(e, t, n) {
|
|
3441
|
+
e && typeof e == "object" && !tn.has(t) && (e[t] = n);
|
|
3445
3442
|
}
|
|
3446
|
-
function
|
|
3447
|
-
if (
|
|
3448
|
-
let t = r
|
|
3443
|
+
function rn(e, t, n, r, i) {
|
|
3444
|
+
if (r) {
|
|
3445
|
+
let t = o(r, e, i);
|
|
3449
3446
|
if (typeof t == "function") {
|
|
3450
3447
|
t(n, 0);
|
|
3451
3448
|
return;
|
|
3452
3449
|
}
|
|
3453
3450
|
}
|
|
3454
|
-
|
|
3451
|
+
nn(e, t, n);
|
|
3455
3452
|
}
|
|
3456
|
-
var
|
|
3453
|
+
var an = class e {
|
|
3457
3454
|
static MAX_REGISTERS = 256;
|
|
3458
3455
|
registers = Array(e.MAX_REGISTERS);
|
|
3459
3456
|
scope = {};
|
|
@@ -3473,56 +3470,56 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3473
3470
|
return this.checkRegister(e), this.registers[e];
|
|
3474
3471
|
}
|
|
3475
3472
|
execute(t, n = {}) {
|
|
3476
|
-
let
|
|
3477
|
-
if (this.scope = Object.assign(Object.create(
|
|
3478
|
-
let t =
|
|
3473
|
+
let r = v(t) || t, i = n.scope || null;
|
|
3474
|
+
if (this.scope = Object.assign(Object.create(i), r.scope), r.derived && r.derived.length > 0) for (let e of r.derived) {
|
|
3475
|
+
let t = r.constants[e.exprIdx];
|
|
3479
3476
|
Object.defineProperty(this.scope, e.name, {
|
|
3480
|
-
get: () =>
|
|
3477
|
+
get: () => o(t, this.scope, this.declaredVars),
|
|
3481
3478
|
enumerable: !0,
|
|
3482
3479
|
configurable: !0
|
|
3483
3480
|
});
|
|
3484
3481
|
}
|
|
3485
|
-
this.declaredVars = new Set(
|
|
3486
|
-
let
|
|
3487
|
-
|
|
3482
|
+
this.declaredVars = new Set(r.declaredVars ?? []), this.registers.fill(null);
|
|
3483
|
+
let a = r.bytecode, c = r.constants, l = 0;
|
|
3484
|
+
_(this);
|
|
3488
3485
|
try {
|
|
3489
|
-
for (;
|
|
3490
|
-
let t =
|
|
3486
|
+
for (; l < a.length;) {
|
|
3487
|
+
let t = a[l];
|
|
3491
3488
|
switch (t) {
|
|
3492
3489
|
case Q.RETURN:
|
|
3493
|
-
|
|
3490
|
+
l += 1;
|
|
3494
3491
|
break;
|
|
3495
3492
|
case Q.CREATE_ELEMENT: {
|
|
3496
|
-
let e =
|
|
3493
|
+
let e = a[l + 1], t = a[l + 2], n = String(c[t]);
|
|
3497
3494
|
this.setRegister(e, {
|
|
3498
3495
|
type: "element",
|
|
3499
3496
|
tag: n,
|
|
3500
3497
|
attrs: /* @__PURE__ */ new Map(),
|
|
3501
3498
|
children: []
|
|
3502
|
-
}),
|
|
3499
|
+
}), l += 3;
|
|
3503
3500
|
break;
|
|
3504
3501
|
}
|
|
3505
3502
|
case Q.MOUNT_COMPONENT: {
|
|
3506
|
-
let t =
|
|
3507
|
-
if (
|
|
3508
|
-
let n = r === 255 ? null :
|
|
3503
|
+
let t = a[l + 1], n = a[l + 2], r = a[l + 3], i = String(c[n]), o = this.scope && i in this.scope ? this.scope[i] : typeof globalThis < "u" && globalThis[i], u = v(o);
|
|
3504
|
+
if (u) {
|
|
3505
|
+
let n = r === 255 ? null : c[r], a = s(n, this.scope, this.declaredVars), o;
|
|
3509
3506
|
if (n && n.__drift_children__ !== void 0) {
|
|
3510
|
-
let t =
|
|
3507
|
+
let t = c[n.__drift_children__] ?? n.__drift_children__;
|
|
3511
3508
|
if (t) {
|
|
3512
3509
|
let n = new e();
|
|
3513
|
-
n.parentVM = this,
|
|
3510
|
+
n.parentVM = this, o = n.execute(t, { scope: this.scope }) ?? void 0;
|
|
3514
3511
|
}
|
|
3515
3512
|
}
|
|
3516
|
-
let
|
|
3517
|
-
|
|
3518
|
-
let d = Object.assign(Object.create(this.scope), { props:
|
|
3519
|
-
|
|
3520
|
-
let f =
|
|
3521
|
-
if ("client:load" in
|
|
3513
|
+
let l = new e();
|
|
3514
|
+
l.parentVM = this;
|
|
3515
|
+
let d = Object.assign(Object.create(this.scope), { props: a }, a);
|
|
3516
|
+
o !== void 0 && (d.children = o);
|
|
3517
|
+
let f = l.execute(u, { scope: d }), p = null, m;
|
|
3518
|
+
if ("client:load" in a ? p = "eager" : "client:idle" in a ? p = "idle" : "client:visible" in a ? p = "visible" : "client:interaction" in a ? p = "interaction" : "client:media" in a && (p = "media", m = typeof a["client:media"] == "string" ? a["client:media"] : void 0), p) {
|
|
3522
3519
|
let e = /* @__PURE__ */ new Map();
|
|
3523
|
-
e.set("data-drift-island",
|
|
3520
|
+
e.set("data-drift-island", i), e.set("data-drift-trigger", p), m && e.set("data-drift-media", m);
|
|
3524
3521
|
let n = {};
|
|
3525
|
-
for (let [e, t] of Object.entries(
|
|
3522
|
+
for (let [e, t] of Object.entries(a)) !e.startsWith("client:") && e !== "__drift_children__" && e !== "__drift_props__" && (n[e] = t);
|
|
3526
3523
|
Object.keys(n).length > 0 && e.set("data-drift-props", JSON.stringify(n));
|
|
3527
3524
|
let r = {
|
|
3528
3525
|
type: "element",
|
|
@@ -3533,52 +3530,52 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3533
3530
|
this.setRegister(t, r);
|
|
3534
3531
|
} else f && this.setRegister(t, f);
|
|
3535
3532
|
}
|
|
3536
|
-
|
|
3533
|
+
l += 4;
|
|
3537
3534
|
break;
|
|
3538
3535
|
}
|
|
3539
3536
|
case Q.CREATE_TEXT: {
|
|
3540
|
-
let e =
|
|
3537
|
+
let e = a[l + 1], t = c[a[l + 2]], n = o(t, this.scope, this.declaredVars), r = n == null ? "" : String(n);
|
|
3541
3538
|
this.setRegister(e, {
|
|
3542
3539
|
type: "text",
|
|
3543
|
-
content:
|
|
3540
|
+
content: r,
|
|
3544
3541
|
children: []
|
|
3545
|
-
}),
|
|
3542
|
+
}), l += 3;
|
|
3546
3543
|
break;
|
|
3547
3544
|
}
|
|
3548
3545
|
case Q.CREATE_COMMENT: {
|
|
3549
|
-
let e =
|
|
3546
|
+
let e = a[l + 1], t = a[l + 2], n = String(c[t]);
|
|
3550
3547
|
this.setRegister(e, {
|
|
3551
3548
|
type: "comment",
|
|
3552
3549
|
content: n,
|
|
3553
3550
|
children: []
|
|
3554
|
-
}),
|
|
3551
|
+
}), l += 3;
|
|
3555
3552
|
break;
|
|
3556
3553
|
}
|
|
3557
3554
|
case Q.CREATE_FRAGMENT: {
|
|
3558
|
-
let e =
|
|
3555
|
+
let e = a[l + 1];
|
|
3559
3556
|
this.setRegister(e, {
|
|
3560
3557
|
type: "fragment",
|
|
3561
3558
|
children: []
|
|
3562
|
-
}),
|
|
3559
|
+
}), l += 2;
|
|
3563
3560
|
break;
|
|
3564
3561
|
}
|
|
3565
3562
|
case Q.APPEND_CHILD: {
|
|
3566
|
-
let e =
|
|
3567
|
-
n.children.push(r),
|
|
3563
|
+
let e = a[l + 1], t = a[l + 2], n = this.getRegister(e), r = this.getRegister(t);
|
|
3564
|
+
n.children.push(r), l += 3;
|
|
3568
3565
|
break;
|
|
3569
3566
|
}
|
|
3570
3567
|
case Q.SET_ATTR: {
|
|
3571
|
-
let e =
|
|
3572
|
-
if (
|
|
3573
|
-
|
|
3568
|
+
let e = a[l + 1], t = a[l + 2], n = a[l + 3], r = a[l + 4], i = this.getRegister(e), s = String(c[t]);
|
|
3569
|
+
if (s.startsWith("on")) {
|
|
3570
|
+
l += 5;
|
|
3574
3571
|
break;
|
|
3575
3572
|
}
|
|
3576
|
-
let u =
|
|
3577
|
-
|
|
3573
|
+
let u = c[n], f = r === 1 ? o(u, this.scope, this.declaredVars) : u;
|
|
3574
|
+
s === "style" && (f = d(f)), i.attrs ||= /* @__PURE__ */ new Map(), s === "className" ? i.attrs.set("class", f) : i.attrs.set(s, f), l += 5;
|
|
3578
3575
|
break;
|
|
3579
3576
|
}
|
|
3580
3577
|
case Q.INTERPOLATE_TEXT: {
|
|
3581
|
-
let e =
|
|
3578
|
+
let e = a[l + 1], t = c[a[l + 2]], n = o(t, this.scope, this.declaredVars);
|
|
3582
3579
|
if (n && typeof n == "object" && "type" in n && Array.isArray(n.children)) this.setRegister(e, n);
|
|
3583
3580
|
else {
|
|
3584
3581
|
let t = n == null ? "" : String(n);
|
|
@@ -3588,19 +3585,19 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3588
3585
|
children: []
|
|
3589
3586
|
});
|
|
3590
3587
|
}
|
|
3591
|
-
|
|
3588
|
+
l += 3;
|
|
3592
3589
|
break;
|
|
3593
3590
|
}
|
|
3594
3591
|
case Q.EXEC_SCRIPT: {
|
|
3595
|
-
let e =
|
|
3596
|
-
if (Array.isArray(e)) for (let t of e)
|
|
3597
|
-
else e &&
|
|
3598
|
-
|
|
3592
|
+
let e = c[a[l + 1]];
|
|
3593
|
+
if (Array.isArray(e)) for (let t of e) o(t, this.scope, this.declaredVars);
|
|
3594
|
+
else e && o(e, this.scope, this.declaredVars);
|
|
3595
|
+
l += 2;
|
|
3599
3596
|
break;
|
|
3600
3597
|
}
|
|
3601
3598
|
case Q.REACTIVE_IF: {
|
|
3602
|
-
let t =
|
|
3603
|
-
if (
|
|
3599
|
+
let t = a[l + 1], n = a[l + 2], r = a[l + 3], i = a[l + 4], s = this.getRegister(t), u = c[n], d = c[r], f = i === 255 ? null : c[i], p = o(u, this.scope, this.declaredVars) ? d : f;
|
|
3600
|
+
if (s.children.push({
|
|
3604
3601
|
type: "comment",
|
|
3605
3602
|
content: "if",
|
|
3606
3603
|
children: []
|
|
@@ -3608,25 +3605,25 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3608
3605
|
let t = Object.create(this.scope), n = new e();
|
|
3609
3606
|
n.parentVM = this;
|
|
3610
3607
|
let r = n.execute(p, { scope: t });
|
|
3611
|
-
r &&
|
|
3608
|
+
r && s.children.push(r);
|
|
3612
3609
|
}
|
|
3613
|
-
|
|
3610
|
+
s.children.push({
|
|
3614
3611
|
type: "comment",
|
|
3615
3612
|
content: "/if",
|
|
3616
3613
|
children: []
|
|
3617
|
-
}),
|
|
3614
|
+
}), l += 6;
|
|
3618
3615
|
break;
|
|
3619
3616
|
}
|
|
3620
3617
|
case Q.REACTIVE_SWITCH: {
|
|
3621
|
-
let t =
|
|
3622
|
-
if (Array.isArray(
|
|
3623
|
-
let t =
|
|
3624
|
-
if (p ===
|
|
3625
|
-
m =
|
|
3618
|
+
let t = a[l + 1], n = a[l + 2], r = a[l + 3], i = a[l + 4], s = this.getRegister(t), u = c[n], d = c[r], f = i === 255 ? null : c[i], p = o(u, this.scope, this.declaredVars), m = f;
|
|
3619
|
+
if (Array.isArray(d)) for (let e = 0; e < d.length; e++) {
|
|
3620
|
+
let t = d[e];
|
|
3621
|
+
if (p === o(c[t.testIdx], this.scope, this.declaredVars)) {
|
|
3622
|
+
m = c[t.modIdx];
|
|
3626
3623
|
break;
|
|
3627
3624
|
}
|
|
3628
3625
|
}
|
|
3629
|
-
if (
|
|
3626
|
+
if (s.children.push({
|
|
3630
3627
|
type: "comment",
|
|
3631
3628
|
content: "switch",
|
|
3632
3629
|
children: []
|
|
@@ -3634,55 +3631,55 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3634
3631
|
let t = Object.create(this.scope), n = new e();
|
|
3635
3632
|
n.parentVM = this;
|
|
3636
3633
|
let r = n.execute(m, { scope: t });
|
|
3637
|
-
r &&
|
|
3634
|
+
r && s.children.push(r);
|
|
3638
3635
|
}
|
|
3639
|
-
|
|
3636
|
+
s.children.push({
|
|
3640
3637
|
type: "comment",
|
|
3641
3638
|
content: "/switch",
|
|
3642
3639
|
children: []
|
|
3643
|
-
}),
|
|
3640
|
+
}), l += 6;
|
|
3644
3641
|
break;
|
|
3645
3642
|
}
|
|
3646
3643
|
case Q.REACTIVE_FOR: {
|
|
3647
|
-
let t =
|
|
3648
|
-
|
|
3649
|
-
let
|
|
3644
|
+
let t = a[l + 1], n = a[l + 2], r = a[l + 3], i = a[l + 4];
|
|
3645
|
+
a[l + 5];
|
|
3646
|
+
let s = a[l + 6], u = a[l + 10] ?? 255, d = u === 255 ? null : c[u], f = this.getRegister(t), p = c[n], m = c[r], h = i === 255 ? null : c[i], g = c[s], _ = o(p, this.scope, this.declaredVars), v = ee(_);
|
|
3650
3647
|
f.children.push({
|
|
3651
3648
|
type: "comment",
|
|
3652
3649
|
content: "for",
|
|
3653
3650
|
children: []
|
|
3654
3651
|
});
|
|
3655
|
-
for (let t = 0; t <
|
|
3652
|
+
for (let t = 0; t < v.length; t++) {
|
|
3656
3653
|
let n = Object.create(this.scope);
|
|
3657
|
-
if (
|
|
3658
|
-
let e =
|
|
3659
|
-
typeof e == "function" ? e(
|
|
3660
|
-
} else
|
|
3661
|
-
let
|
|
3662
|
-
|
|
3663
|
-
let
|
|
3664
|
-
|
|
3654
|
+
if (d) {
|
|
3655
|
+
let e = o(d, n, this.declaredVars);
|
|
3656
|
+
typeof e == "function" ? e(v[t], t) : (nn(n, m, v[t]), h && nn(n, h, t));
|
|
3657
|
+
} else nn(n, m, v[t]), h && nn(n, h, t);
|
|
3658
|
+
let r = new e();
|
|
3659
|
+
r.parentVM = this;
|
|
3660
|
+
let i = r.execute(g, { scope: n });
|
|
3661
|
+
i && f.children.push(i);
|
|
3665
3662
|
}
|
|
3666
3663
|
f.children.push({
|
|
3667
3664
|
type: "comment",
|
|
3668
3665
|
content: "/for",
|
|
3669
3666
|
children: []
|
|
3670
|
-
}),
|
|
3667
|
+
}), l += 11;
|
|
3671
3668
|
break;
|
|
3672
3669
|
}
|
|
3673
3670
|
case Q.REACTIVE_ASYNC: {
|
|
3674
|
-
let t =
|
|
3675
|
-
|
|
3676
|
-
},
|
|
3671
|
+
let t = a[l + 1], n = a[l + 2], r = a[l + 3], i = a[l + 4], s = a[l + 5], u = a[l + 6], d = a[l + 8] ?? 255, f = d === 255 ? null : c[d], p = this.getRegister(t), m = c[n], h = c[r], g = c[i], _ = s === 255 ? null : c[s], v = u === 255 ? null : c[u], ee = (e, t) => {
|
|
3672
|
+
rn(e, h, t, f, this.declaredVars);
|
|
3673
|
+
}, te = o(m, this.scope, this.declaredVars), y = e.nextAsyncId++;
|
|
3677
3674
|
if (this.isStreaming) {
|
|
3678
3675
|
if (p.children.push({
|
|
3679
3676
|
type: "comment",
|
|
3680
3677
|
content: `drift-async:${y}`,
|
|
3681
3678
|
children: []
|
|
3682
|
-
}),
|
|
3679
|
+
}), _) {
|
|
3683
3680
|
let t = Object.create(this.scope), n = new e();
|
|
3684
3681
|
n.parentVM = this, n.isStreaming = !0;
|
|
3685
|
-
let r = n.execute(
|
|
3682
|
+
let r = n.execute(_, { scope: t });
|
|
3686
3683
|
r && p.children.push(r);
|
|
3687
3684
|
}
|
|
3688
3685
|
p.children.push({
|
|
@@ -3691,24 +3688,24 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3691
3688
|
children: []
|
|
3692
3689
|
}), this.asyncBoundaries.push({
|
|
3693
3690
|
id: y,
|
|
3694
|
-
promise:
|
|
3695
|
-
alias:
|
|
3696
|
-
bodyMod:
|
|
3697
|
-
fallbackMod:
|
|
3698
|
-
catchMod:
|
|
3691
|
+
promise: te,
|
|
3692
|
+
alias: h,
|
|
3693
|
+
bodyMod: g,
|
|
3694
|
+
fallbackMod: _,
|
|
3695
|
+
catchMod: v,
|
|
3699
3696
|
scope: this.scope,
|
|
3700
3697
|
aliasPopulator: f,
|
|
3701
3698
|
declaredVars: this.declaredVars
|
|
3702
3699
|
});
|
|
3703
|
-
} else if (
|
|
3700
|
+
} else if (te && typeof te.then == "function") {
|
|
3704
3701
|
if (p.children.push({
|
|
3705
3702
|
type: "comment",
|
|
3706
3703
|
content: `drift-async:${y}`,
|
|
3707
3704
|
children: []
|
|
3708
|
-
}),
|
|
3705
|
+
}), _) {
|
|
3709
3706
|
let t = Object.create(this.scope), n = new e();
|
|
3710
3707
|
n.parentVM = this;
|
|
3711
|
-
let r = n.execute(
|
|
3708
|
+
let r = n.execute(_, { scope: t });
|
|
3712
3709
|
r && p.children.push(r);
|
|
3713
3710
|
}
|
|
3714
3711
|
p.children.push({
|
|
@@ -3723,77 +3720,77 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3723
3720
|
children: []
|
|
3724
3721
|
});
|
|
3725
3722
|
let t = Object.create(this.scope);
|
|
3726
|
-
|
|
3723
|
+
ee(t, te);
|
|
3727
3724
|
let n = new e();
|
|
3728
3725
|
n.parentVM = this;
|
|
3729
|
-
let r = n.execute(
|
|
3726
|
+
let r = n.execute(g, { scope: t });
|
|
3730
3727
|
r && p.children.push(r), p.children.push({
|
|
3731
3728
|
type: "comment",
|
|
3732
3729
|
content: `/drift-async:${y}`,
|
|
3733
3730
|
children: []
|
|
3734
3731
|
});
|
|
3735
3732
|
}
|
|
3736
|
-
|
|
3733
|
+
l += 9;
|
|
3737
3734
|
break;
|
|
3738
3735
|
}
|
|
3739
|
-
default: throw Error(`DriftServerVM: Unknown Opcode ${t} at PC ${
|
|
3736
|
+
default: throw Error(`DriftServerVM: Unknown Opcode ${t} at PC ${l}`);
|
|
3740
3737
|
}
|
|
3741
3738
|
}
|
|
3742
3739
|
return this.getRegister(0);
|
|
3743
3740
|
} finally {
|
|
3744
|
-
|
|
3741
|
+
m();
|
|
3745
3742
|
}
|
|
3746
3743
|
}
|
|
3747
3744
|
};
|
|
3748
|
-
function
|
|
3745
|
+
function on(e, t) {
|
|
3749
3746
|
if (!t) return e;
|
|
3750
3747
|
let n = t.toLowerCase();
|
|
3751
3748
|
return n === "script" ? e.replace(/<\/script/gi, "<\\/script") : n === "style" ? e.replace(/<\/style/gi, "<\\/style") : e;
|
|
3752
3749
|
}
|
|
3753
|
-
function
|
|
3754
|
-
if (!
|
|
3755
|
-
if (typeof
|
|
3756
|
-
if (
|
|
3757
|
-
if (
|
|
3758
|
-
if (
|
|
3759
|
-
if (
|
|
3760
|
-
let
|
|
3761
|
-
if (!
|
|
3762
|
-
let
|
|
3763
|
-
if (
|
|
3764
|
-
if (!
|
|
3765
|
-
let
|
|
3766
|
-
n === !0 ?
|
|
3750
|
+
function $(r, i = !1, o) {
|
|
3751
|
+
if (!r) return "";
|
|
3752
|
+
if (typeof r == "string") return i ? on(r, o) : a(r);
|
|
3753
|
+
if (r.type === "text") return i ? on(r.content ?? "", o) : a(r.content ?? "");
|
|
3754
|
+
if (r.type === "comment") return `<!--${String(r.content ?? "").replace(/-->/g, "-- >").replace(/--!>/g, "--! >")}-->`;
|
|
3755
|
+
if (r.type === "fragment") return r.children.map((e) => $(e, i, o)).join("");
|
|
3756
|
+
if (r.type === "element") {
|
|
3757
|
+
let i = r.tag;
|
|
3758
|
+
if (!i || !t.test(i)) return "";
|
|
3759
|
+
let o = i.toLowerCase() === "script" || i.toLowerCase() === "style", s = "";
|
|
3760
|
+
if (r.attrs && r.attrs.size > 0) for (let [t, n] of r.attrs.entries()) {
|
|
3761
|
+
if (!e.test(t) || t === "style" && (n === "" || n == null || n === !1)) continue;
|
|
3762
|
+
let r = t.startsWith("aria-") || t.startsWith("data-");
|
|
3763
|
+
n === !0 ? s += r ? ` ${t}="true"` : ` ${t}` : n === !1 ? r && (s += ` ${t}="false"`) : n != null && (s += ` ${t}="${a(String(n))}"`);
|
|
3767
3764
|
}
|
|
3768
|
-
if (
|
|
3769
|
-
let
|
|
3770
|
-
return `<${
|
|
3765
|
+
if (n.has(i.toLowerCase())) return `<${i}${s} />`;
|
|
3766
|
+
let c = r.children.map((e) => $(e, o, o ? i : void 0)).join("");
|
|
3767
|
+
return `<${i}${s}>${c}</${i}>`;
|
|
3771
3768
|
}
|
|
3772
3769
|
return "";
|
|
3773
3770
|
}
|
|
3774
|
-
function
|
|
3775
|
-
let n = new
|
|
3776
|
-
return n ?
|
|
3771
|
+
function sn(e, t = {}) {
|
|
3772
|
+
let n = new an().execute(e, t);
|
|
3773
|
+
return n ? $(n) : "";
|
|
3777
3774
|
}
|
|
3778
|
-
function
|
|
3779
|
-
let r = n.islandTag || "div", i = n.trigger || "idle",
|
|
3780
|
-
|
|
3781
|
-
let
|
|
3775
|
+
function cn(e, t, n = {}) {
|
|
3776
|
+
let r = n.islandTag || "div", i = u(r) ? r : "div", o = n.trigger || "idle", s = ` data-drift-island="${a(e)}"`;
|
|
3777
|
+
o && (s += ` data-drift-trigger="${a(o)}"`), n.props && Object.keys(n.props).length > 0 && (s += ` data-drift-props="${a(JSON.stringify(n.props))}"`), n.timeout !== void 0 && (s += ` data-drift-timeout="${n.timeout}"`), n.media && (s += ` data-drift-media="${a(n.media)}"`), n.rootMargin && (s += ` data-drift-root-margin="${a(n.rootMargin)}"`);
|
|
3778
|
+
let c = n.props ? {
|
|
3782
3779
|
...n.scope,
|
|
3783
3780
|
props: n.props,
|
|
3784
3781
|
...n.props
|
|
3785
|
-
} : n.scope,
|
|
3782
|
+
} : n.scope, l = sn(t, {
|
|
3786
3783
|
...n,
|
|
3787
|
-
scope:
|
|
3784
|
+
scope: c
|
|
3788
3785
|
});
|
|
3789
|
-
return `<${
|
|
3786
|
+
return `<${i}${s}>${l}</${i}>`;
|
|
3790
3787
|
}
|
|
3791
|
-
function
|
|
3788
|
+
function ln(e, t = {}) {
|
|
3792
3789
|
let n = !1, r = null, i = new ReadableStream({
|
|
3793
3790
|
start(i) {
|
|
3794
|
-
let
|
|
3795
|
-
n || i.enqueue(
|
|
3796
|
-
},
|
|
3791
|
+
let o = new TextEncoder(), s = (e) => {
|
|
3792
|
+
n || i.enqueue(o.encode(e));
|
|
3793
|
+
}, c = () => {
|
|
3797
3794
|
if (!n) {
|
|
3798
3795
|
r && clearTimeout(r);
|
|
3799
3796
|
try {
|
|
@@ -3805,41 +3802,41 @@ function cn(e, t = {}) {
|
|
|
3805
3802
|
}
|
|
3806
3803
|
};
|
|
3807
3804
|
try {
|
|
3808
|
-
let i = new
|
|
3805
|
+
let i = new an();
|
|
3809
3806
|
i.isStreaming = !0;
|
|
3810
|
-
let
|
|
3811
|
-
if (
|
|
3812
|
-
let e = `<script${t.nonce ? ` nonce="${
|
|
3813
|
-
|
|
3807
|
+
let o = i.execute(e, t), l = o ? $(o) : "", u = i.asyncBoundaries;
|
|
3808
|
+
if (u.length > 0) {
|
|
3809
|
+
let e = `<script${t.nonce ? ` nonce="${a(t.nonce)}"` : ""}>function __drift_swap(d,t){var e=document.getElementById(t);if(!e)return;var w=document.createTreeWalker(document.body,128,null),s=null,k=null;while(w.nextNode()){var c=w.currentNode;if(c.nodeValue==='drift-async:'+d)s=c;else if(c.nodeValue==='/drift-async:'+d){k=c;break;}}if(s&&k&&s.parentNode){var p=s.parentNode,r=s.nextSibling;while(r&&r!==k){var n=r.nextSibling;p.removeChild(r);r=n;}p.insertBefore(e.content,k);e.remove();}}<\/script>`;
|
|
3810
|
+
l += e;
|
|
3814
3811
|
}
|
|
3815
|
-
if (
|
|
3816
|
-
|
|
3812
|
+
if (s(l), t.onShellReady?.(), u.length === 0) {
|
|
3813
|
+
c();
|
|
3817
3814
|
return;
|
|
3818
3815
|
}
|
|
3819
3816
|
t.timeoutMs && t.timeoutMs > 0 && (r = setTimeout(() => {
|
|
3820
3817
|
if (!n) {
|
|
3821
3818
|
let e = /* @__PURE__ */ Error(`[DriftJS] renderToStream timed out after ${t.timeoutMs}ms`);
|
|
3822
|
-
t.onError?.(e),
|
|
3819
|
+
t.onError?.(e), c();
|
|
3823
3820
|
}
|
|
3824
3821
|
}, t.timeoutMs));
|
|
3825
|
-
let
|
|
3826
|
-
for (let e of
|
|
3827
|
-
let { id: r, promise: i, alias:
|
|
3822
|
+
let d = u.length;
|
|
3823
|
+
for (let e of u) {
|
|
3824
|
+
let { id: r, promise: i, alias: o, bodyMod: l, catchMod: u, scope: f, aliasPopulator: p, declaredVars: m } = e;
|
|
3828
3825
|
Promise.resolve(i).then((e) => {
|
|
3829
3826
|
if (n) return;
|
|
3830
|
-
let i = Object.create(
|
|
3831
|
-
|
|
3832
|
-
let
|
|
3833
|
-
|
|
3827
|
+
let i = Object.create(f);
|
|
3828
|
+
rn(i, o, e, p, m);
|
|
3829
|
+
let c = new an().execute(l, { scope: i }), u = c ? $(c) : "", d = t.nonce ? ` nonce="${a(t.nonce)}"` : "", h = `<template id="drift-t-${r}">${u}</template><script${d}>__drift_swap("${r}","drift-t-${r}")<\/script>`;
|
|
3830
|
+
s(h);
|
|
3834
3831
|
}).catch((e) => {
|
|
3835
|
-
if (!n && (t.onError?.(e),
|
|
3836
|
-
let n = Object.create(
|
|
3837
|
-
|
|
3838
|
-
let i = new
|
|
3839
|
-
|
|
3832
|
+
if (!n && (t.onError?.(e), u)) {
|
|
3833
|
+
let n = Object.create(f);
|
|
3834
|
+
u.errorVar && nn(n, u.errorVar, e);
|
|
3835
|
+
let i = new an().execute(u.module, { scope: n }), o = i ? $(i) : "", c = t.nonce ? ` nonce="${a(t.nonce)}"` : "", l = `<template id="drift-t-${r}">${o}</template><script${c}>__drift_swap("${r}","drift-t-${r}")<\/script>`;
|
|
3836
|
+
s(l);
|
|
3840
3837
|
}
|
|
3841
3838
|
}).finally(() => {
|
|
3842
|
-
|
|
3839
|
+
d--, d === 0 && c();
|
|
3843
3840
|
});
|
|
3844
3841
|
}
|
|
3845
3842
|
} catch (e) {
|
|
@@ -3849,15 +3846,15 @@ function cn(e, t = {}) {
|
|
|
3849
3846
|
cancel(e) {
|
|
3850
3847
|
n = !0, r && clearTimeout(r);
|
|
3851
3848
|
}
|
|
3852
|
-
}),
|
|
3853
|
-
return
|
|
3849
|
+
}), o = i;
|
|
3850
|
+
return o.abort = (e) => {
|
|
3854
3851
|
n = !0, r && clearTimeout(r);
|
|
3855
3852
|
try {
|
|
3856
|
-
|
|
3853
|
+
o.cancel(e);
|
|
3857
3854
|
} catch (e) {
|
|
3858
3855
|
console.debug("[DriftJS SSR] Stream abort cancel error:", e);
|
|
3859
3856
|
}
|
|
3860
|
-
},
|
|
3857
|
+
}, o.pipe = function(e) {
|
|
3861
3858
|
let t = i.getReader(), n = e;
|
|
3862
3859
|
async function r() {
|
|
3863
3860
|
try {
|
|
@@ -3874,7 +3871,7 @@ function cn(e, t = {}) {
|
|
|
3874
3871
|
}
|
|
3875
3872
|
}
|
|
3876
3873
|
return r(), e;
|
|
3877
|
-
},
|
|
3874
|
+
}, o;
|
|
3878
3875
|
}
|
|
3879
3876
|
//#endregion
|
|
3880
|
-
export {
|
|
3877
|
+
export { an as DriftServerVM, r as createContext, i as effect, c as inject, l as injectContext, f as onMount, p as onUnmount, h as provide, g as provideContext, cn as renderIslandToString, ln as renderToStream, sn as renderToString, $ as serializeNode };
|