driftjs-ssr 0.0.13 → 0.0.15
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 +7 -7
- package/dist/index-es.js +970 -765
- package/package.json +3 -3
package/dist/index-es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { VOID_ELEMENTS as e, createContext as t, effect as n, evaluateExpression as r, evaluatePropsSpec as i, inject as a, injectContext as o, normalizeStyle as s, onMount as c, onUnmount as l, popActiveVM as u,
|
|
1
|
+
import { VOID_ELEMENTS as e, createContext as t, effect as n, evaluateExpression as r, evaluatePropsSpec as i, inject as a, injectContext as o, normalizeStyle as s, onMount as c, onUnmount as l, popActiveVM as u, provide as d, provideContext as f, pushActiveVM as p, resolveComponentModule as m, resolveIterable as ee } from "driftjs-shared";
|
|
2
2
|
//#region ../../node_modules/.pnpm/acorn@8.17.0/node_modules/acorn/dist/acorn.mjs
|
|
3
|
-
var
|
|
3
|
+
var h = [
|
|
4
4
|
509,
|
|
5
5
|
0,
|
|
6
6
|
227,
|
|
@@ -331,7 +331,7 @@ var g = [
|
|
|
331
331
|
9,
|
|
332
332
|
787719,
|
|
333
333
|
239
|
|
334
|
-
],
|
|
334
|
+
], g = [
|
|
335
335
|
0,
|
|
336
336
|
11,
|
|
337
337
|
2,
|
|
@@ -950,216 +950,216 @@ var g = [
|
|
|
950
950
|
4938,
|
|
951
951
|
6,
|
|
952
952
|
8489
|
|
953
|
-
],
|
|
953
|
+
], te = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", ne = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", _ = {
|
|
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
|
+
}, v = "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", re = {
|
|
960
|
+
5: v,
|
|
961
|
+
"5module": v + " export import",
|
|
962
|
+
6: v + " const class extends export import super"
|
|
963
|
+
}, ie = /^in(stanceof)?$/, ae = RegExp("[" + ne + "]"), oe = RegExp("[" + ne + te + "]");
|
|
964
|
+
function se(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;
|
|
968
968
|
}
|
|
969
969
|
return !1;
|
|
970
970
|
}
|
|
971
|
-
function
|
|
972
|
-
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 &&
|
|
971
|
+
function y(e, t) {
|
|
972
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && ae.test(String.fromCharCode(e)) : t !== !1 && se(e, g);
|
|
973
973
|
}
|
|
974
|
-
function
|
|
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 &&
|
|
974
|
+
function b(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 && oe.test(String.fromCharCode(e)) : t === !1 ? !1 : se(e, g) || se(e, h);
|
|
976
976
|
}
|
|
977
|
-
var
|
|
977
|
+
var x = 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;
|
|
979
979
|
};
|
|
980
|
-
function
|
|
981
|
-
return new
|
|
980
|
+
function S(e, t) {
|
|
981
|
+
return new x(e, {
|
|
982
982
|
beforeExpr: !0,
|
|
983
983
|
binop: t
|
|
984
984
|
});
|
|
985
985
|
}
|
|
986
|
-
var
|
|
987
|
-
function
|
|
988
|
-
return t === void 0 && (t = {}), t.keyword = e,
|
|
986
|
+
var C = { beforeExpr: !0 }, w = { startsExpr: !0 }, ce = {};
|
|
987
|
+
function T(e, t) {
|
|
988
|
+
return t === void 0 && (t = {}), t.keyword = e, ce[e] = new x(e, t);
|
|
989
989
|
}
|
|
990
|
-
var
|
|
991
|
-
num: new
|
|
992
|
-
regexp: new
|
|
993
|
-
string: new
|
|
994
|
-
name: new
|
|
995
|
-
privateId: new
|
|
996
|
-
eof: new
|
|
997
|
-
bracketL: new
|
|
990
|
+
var E = {
|
|
991
|
+
num: new x("num", w),
|
|
992
|
+
regexp: new x("regexp", w),
|
|
993
|
+
string: new x("string", w),
|
|
994
|
+
name: new x("name", w),
|
|
995
|
+
privateId: new x("privateId", w),
|
|
996
|
+
eof: new x("eof"),
|
|
997
|
+
bracketL: new x("[", {
|
|
998
998
|
beforeExpr: !0,
|
|
999
999
|
startsExpr: !0
|
|
1000
1000
|
}),
|
|
1001
|
-
bracketR: new
|
|
1002
|
-
braceL: new
|
|
1001
|
+
bracketR: new x("]"),
|
|
1002
|
+
braceL: new x("{", {
|
|
1003
1003
|
beforeExpr: !0,
|
|
1004
1004
|
startsExpr: !0
|
|
1005
1005
|
}),
|
|
1006
|
-
braceR: new
|
|
1007
|
-
parenL: new
|
|
1006
|
+
braceR: new x("}"),
|
|
1007
|
+
parenL: new x("(", {
|
|
1008
1008
|
beforeExpr: !0,
|
|
1009
1009
|
startsExpr: !0
|
|
1010
1010
|
}),
|
|
1011
|
-
parenR: new
|
|
1012
|
-
comma: new
|
|
1013
|
-
semi: new
|
|
1014
|
-
colon: new
|
|
1015
|
-
dot: new
|
|
1016
|
-
question: new
|
|
1017
|
-
questionDot: new
|
|
1018
|
-
arrow: new
|
|
1019
|
-
template: new
|
|
1020
|
-
invalidTemplate: new
|
|
1021
|
-
ellipsis: new
|
|
1022
|
-
backQuote: new
|
|
1023
|
-
dollarBraceL: new
|
|
1011
|
+
parenR: new x(")"),
|
|
1012
|
+
comma: new x(",", C),
|
|
1013
|
+
semi: new x(";", C),
|
|
1014
|
+
colon: new x(":", C),
|
|
1015
|
+
dot: new x("."),
|
|
1016
|
+
question: new x("?", C),
|
|
1017
|
+
questionDot: new x("?."),
|
|
1018
|
+
arrow: new x("=>", C),
|
|
1019
|
+
template: new x("template"),
|
|
1020
|
+
invalidTemplate: new x("invalidTemplate"),
|
|
1021
|
+
ellipsis: new x("...", C),
|
|
1022
|
+
backQuote: new x("`", w),
|
|
1023
|
+
dollarBraceL: new x("${", {
|
|
1024
1024
|
beforeExpr: !0,
|
|
1025
1025
|
startsExpr: !0
|
|
1026
1026
|
}),
|
|
1027
|
-
eq: new
|
|
1027
|
+
eq: new x("=", {
|
|
1028
1028
|
beforeExpr: !0,
|
|
1029
1029
|
isAssign: !0
|
|
1030
1030
|
}),
|
|
1031
|
-
assign: new
|
|
1031
|
+
assign: new x("_=", {
|
|
1032
1032
|
beforeExpr: !0,
|
|
1033
1033
|
isAssign: !0
|
|
1034
1034
|
}),
|
|
1035
|
-
incDec: new
|
|
1035
|
+
incDec: new x("++/--", {
|
|
1036
1036
|
prefix: !0,
|
|
1037
1037
|
postfix: !0,
|
|
1038
1038
|
startsExpr: !0
|
|
1039
1039
|
}),
|
|
1040
|
-
prefix: new
|
|
1040
|
+
prefix: new x("!/~", {
|
|
1041
1041
|
beforeExpr: !0,
|
|
1042
1042
|
prefix: !0,
|
|
1043
1043
|
startsExpr: !0
|
|
1044
1044
|
}),
|
|
1045
|
-
logicalOR:
|
|
1046
|
-
logicalAND:
|
|
1047
|
-
bitwiseOR:
|
|
1048
|
-
bitwiseXOR:
|
|
1049
|
-
bitwiseAND:
|
|
1050
|
-
equality:
|
|
1051
|
-
relational:
|
|
1052
|
-
bitShift:
|
|
1053
|
-
plusMin: new
|
|
1045
|
+
logicalOR: S("||", 1),
|
|
1046
|
+
logicalAND: S("&&", 2),
|
|
1047
|
+
bitwiseOR: S("|", 3),
|
|
1048
|
+
bitwiseXOR: S("^", 4),
|
|
1049
|
+
bitwiseAND: S("&", 5),
|
|
1050
|
+
equality: S("==/!=/===/!==", 6),
|
|
1051
|
+
relational: S("</>/<=/>=", 7),
|
|
1052
|
+
bitShift: S("<</>>/>>>", 8),
|
|
1053
|
+
plusMin: new x("+/-", {
|
|
1054
1054
|
beforeExpr: !0,
|
|
1055
1055
|
binop: 9,
|
|
1056
1056
|
prefix: !0,
|
|
1057
1057
|
startsExpr: !0
|
|
1058
1058
|
}),
|
|
1059
|
-
modulo:
|
|
1060
|
-
star:
|
|
1061
|
-
slash:
|
|
1062
|
-
starstar: new
|
|
1063
|
-
coalesce:
|
|
1064
|
-
_break:
|
|
1065
|
-
_case:
|
|
1066
|
-
_catch:
|
|
1067
|
-
_continue:
|
|
1068
|
-
_debugger:
|
|
1069
|
-
_default:
|
|
1070
|
-
_do:
|
|
1059
|
+
modulo: S("%", 10),
|
|
1060
|
+
star: S("*", 10),
|
|
1061
|
+
slash: S("/", 10),
|
|
1062
|
+
starstar: new x("**", { beforeExpr: !0 }),
|
|
1063
|
+
coalesce: S("??", 1),
|
|
1064
|
+
_break: T("break"),
|
|
1065
|
+
_case: T("case", C),
|
|
1066
|
+
_catch: T("catch"),
|
|
1067
|
+
_continue: T("continue"),
|
|
1068
|
+
_debugger: T("debugger"),
|
|
1069
|
+
_default: T("default", C),
|
|
1070
|
+
_do: T("do", {
|
|
1071
1071
|
isLoop: !0,
|
|
1072
1072
|
beforeExpr: !0
|
|
1073
1073
|
}),
|
|
1074
|
-
_else:
|
|
1075
|
-
_finally:
|
|
1076
|
-
_for:
|
|
1077
|
-
_function:
|
|
1078
|
-
_if:
|
|
1079
|
-
_return:
|
|
1080
|
-
_switch:
|
|
1081
|
-
_throw:
|
|
1082
|
-
_try:
|
|
1083
|
-
_var:
|
|
1084
|
-
_const:
|
|
1085
|
-
_while:
|
|
1086
|
-
_with:
|
|
1087
|
-
_new:
|
|
1074
|
+
_else: T("else", C),
|
|
1075
|
+
_finally: T("finally"),
|
|
1076
|
+
_for: T("for", { isLoop: !0 }),
|
|
1077
|
+
_function: T("function", w),
|
|
1078
|
+
_if: T("if"),
|
|
1079
|
+
_return: T("return", C),
|
|
1080
|
+
_switch: T("switch"),
|
|
1081
|
+
_throw: T("throw", C),
|
|
1082
|
+
_try: T("try"),
|
|
1083
|
+
_var: T("var"),
|
|
1084
|
+
_const: T("const"),
|
|
1085
|
+
_while: T("while", { isLoop: !0 }),
|
|
1086
|
+
_with: T("with"),
|
|
1087
|
+
_new: T("new", {
|
|
1088
1088
|
beforeExpr: !0,
|
|
1089
1089
|
startsExpr: !0
|
|
1090
1090
|
}),
|
|
1091
|
-
_this:
|
|
1092
|
-
_super:
|
|
1093
|
-
_class:
|
|
1094
|
-
_extends:
|
|
1095
|
-
_export:
|
|
1096
|
-
_import:
|
|
1097
|
-
_null:
|
|
1098
|
-
_true:
|
|
1099
|
-
_false:
|
|
1100
|
-
_in:
|
|
1091
|
+
_this: T("this", w),
|
|
1092
|
+
_super: T("super", w),
|
|
1093
|
+
_class: T("class", w),
|
|
1094
|
+
_extends: T("extends", C),
|
|
1095
|
+
_export: T("export"),
|
|
1096
|
+
_import: T("import", w),
|
|
1097
|
+
_null: T("null", w),
|
|
1098
|
+
_true: T("true", w),
|
|
1099
|
+
_false: T("false", w),
|
|
1100
|
+
_in: T("in", {
|
|
1101
1101
|
beforeExpr: !0,
|
|
1102
1102
|
binop: 7
|
|
1103
1103
|
}),
|
|
1104
|
-
_instanceof:
|
|
1104
|
+
_instanceof: T("instanceof", {
|
|
1105
1105
|
beforeExpr: !0,
|
|
1106
1106
|
binop: 7
|
|
1107
1107
|
}),
|
|
1108
|
-
_typeof:
|
|
1108
|
+
_typeof: T("typeof", {
|
|
1109
1109
|
beforeExpr: !0,
|
|
1110
1110
|
prefix: !0,
|
|
1111
1111
|
startsExpr: !0
|
|
1112
1112
|
}),
|
|
1113
|
-
_void:
|
|
1113
|
+
_void: T("void", {
|
|
1114
1114
|
beforeExpr: !0,
|
|
1115
1115
|
prefix: !0,
|
|
1116
1116
|
startsExpr: !0
|
|
1117
1117
|
}),
|
|
1118
|
-
_delete:
|
|
1118
|
+
_delete: T("delete", {
|
|
1119
1119
|
beforeExpr: !0,
|
|
1120
1120
|
prefix: !0,
|
|
1121
1121
|
startsExpr: !0
|
|
1122
1122
|
})
|
|
1123
|
-
},
|
|
1124
|
-
function
|
|
1123
|
+
}, D = /\r\n?|\n|\u2028|\u2029/, le = new RegExp(D.source, "g");
|
|
1124
|
+
function ue(e) {
|
|
1125
1125
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function de(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 (ue(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 fe = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, O = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, pe = Object.prototype, me = pe.hasOwnProperty, he = pe.toString, ge = Object.hasOwn || (function(e, t) {
|
|
1136
|
+
return me.call(e, t);
|
|
1137
|
+
}), _e = Array.isArray || (function(e) {
|
|
1138
|
+
return he.call(e) === "[object Array]";
|
|
1139
|
+
}), ve = Object.create(null);
|
|
1140
1140
|
function k(e) {
|
|
1141
|
-
return
|
|
1141
|
+
return ve[e] || (ve[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
1142
1142
|
}
|
|
1143
1143
|
function A(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 ye = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, be = function(e, t) {
|
|
1147
1147
|
this.line = e, this.column = t;
|
|
1148
1148
|
};
|
|
1149
|
-
|
|
1150
|
-
return new
|
|
1149
|
+
be.prototype.offset = function(e) {
|
|
1150
|
+
return new be(this.line, this.column + e);
|
|
1151
1151
|
};
|
|
1152
|
-
var
|
|
1152
|
+
var xe = 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 Se(e, t) {
|
|
1156
1156
|
for (var n = 1, r = 0;;) {
|
|
1157
|
-
var i =
|
|
1158
|
-
if (i < 0) return new
|
|
1157
|
+
var i = de(e, r, t);
|
|
1158
|
+
if (i < 0) return new be(n, t - r);
|
|
1159
1159
|
++n, r = i;
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
var
|
|
1162
|
+
var Ce = {
|
|
1163
1163
|
ecmaVersion: null,
|
|
1164
1164
|
sourceType: "script",
|
|
1165
1165
|
strict: !1,
|
|
@@ -1180,20 +1180,20 @@ var we = {
|
|
|
1180
1180
|
sourceFile: null,
|
|
1181
1181
|
directSourceFile: null,
|
|
1182
1182
|
preserveParens: !1
|
|
1183
|
-
},
|
|
1184
|
-
function
|
|
1183
|
+
}, we = !1;
|
|
1184
|
+
function Te(e) {
|
|
1185
1185
|
var t = {};
|
|
1186
|
-
for (var n in
|
|
1187
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
1186
|
+
for (var n in Ce) t[n] = e && ge(e, n) ? e[n] : Ce[n];
|
|
1187
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!we && typeof console == "object" && console.warn && (we = !0, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved ??= t.ecmaVersion < 5, (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), _e(t.onToken)) {
|
|
1188
1188
|
var r = t.onToken;
|
|
1189
1189
|
t.onToken = function(e) {
|
|
1190
1190
|
return r.push(e);
|
|
1191
1191
|
};
|
|
1192
1192
|
}
|
|
1193
|
-
if (
|
|
1193
|
+
if (_e(t.onComment) && (t.onComment = Ee(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
1194
1194
|
return t;
|
|
1195
1195
|
}
|
|
1196
|
-
function
|
|
1196
|
+
function Ee(e, t) {
|
|
1197
1197
|
return function(n, r, i, a, o, s) {
|
|
1198
1198
|
var c = {
|
|
1199
1199
|
type: n ? "Block" : "Line",
|
|
@@ -1201,19 +1201,19 @@ function De(e, t) {
|
|
|
1201
1201
|
start: i,
|
|
1202
1202
|
end: a
|
|
1203
1203
|
};
|
|
1204
|
-
e.locations && (c.loc = new
|
|
1204
|
+
e.locations && (c.loc = new xe(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
1205
1205
|
};
|
|
1206
1206
|
}
|
|
1207
|
-
var j = 1, M = 2,
|
|
1208
|
-
function
|
|
1209
|
-
return M | (e ?
|
|
1207
|
+
var j = 1, M = 2, De = 4, Oe = 8, ke = 16, Ae = 32, je = 64, Me = 128, N = 256, Ne = 512, Pe = 1024, Fe = j | M | N;
|
|
1208
|
+
function Ie(e, t) {
|
|
1209
|
+
return M | (e ? De : 0) | (t ? Oe : 0);
|
|
1210
1210
|
}
|
|
1211
|
-
var
|
|
1212
|
-
this.options = e =
|
|
1211
|
+
var Le = 0, Re = 1, P = 2, ze = 3, Be = 4, Ve = 5, F = function(e, t, n) {
|
|
1212
|
+
this.options = e = Te(e), this.sourceFile = e.sourceFile, this.keywords = k(re[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
1213
1213
|
var r = "";
|
|
1214
|
-
e.allowReserved !== !0 && (r =
|
|
1215
|
-
var i = (r ? r + " " : "") +
|
|
1216
|
-
this.reservedWordsStrict = k(i), this.reservedWordsStrictBind = k(i + " " +
|
|
1214
|
+
e.allowReserved !== !0 && (r = _[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = k(r);
|
|
1215
|
+
var i = (r ? r + " " : "") + _.strict;
|
|
1216
|
+
this.reservedWordsStrict = k(i), this.reservedWordsStrictBind = k(i + " " + _.strictBind), this.input = String(t), this.containsEsc = !1, n ? (this.pos = n, this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(D).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = E.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 : j), this.regexpState = null, this.privateNameStack = [];
|
|
1217
1217
|
}, I = {
|
|
1218
1218
|
inFunction: { configurable: !0 },
|
|
1219
1219
|
inGenerator: { configurable: !0 },
|
|
@@ -1235,33 +1235,33 @@ F.prototype.parse = function() {
|
|
|
1235
1235
|
}, I.inFunction.get = function() {
|
|
1236
1236
|
return (this.currentVarScope().flags & M) > 0;
|
|
1237
1237
|
}, I.inGenerator.get = function() {
|
|
1238
|
-
return (this.currentVarScope().flags & ke) > 0;
|
|
1239
|
-
}, I.inAsync.get = function() {
|
|
1240
1238
|
return (this.currentVarScope().flags & Oe) > 0;
|
|
1239
|
+
}, I.inAsync.get = function() {
|
|
1240
|
+
return (this.currentVarScope().flags & De) > 0;
|
|
1241
1241
|
}, I.canAwait.get = function() {
|
|
1242
1242
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1243
1243
|
var t = this.scopeStack[e].flags;
|
|
1244
|
-
if (t & (N |
|
|
1245
|
-
if (t & M) return (t &
|
|
1244
|
+
if (t & (N | Ne)) return !1;
|
|
1245
|
+
if (t & M) return (t & De) > 0;
|
|
1246
1246
|
}
|
|
1247
1247
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
1248
1248
|
}, I.allowReturn.get = function() {
|
|
1249
1249
|
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & j);
|
|
1250
1250
|
}, I.allowSuper.get = function() {
|
|
1251
|
-
return (this.currentThisScope().flags &
|
|
1251
|
+
return (this.currentThisScope().flags & je) > 0 || this.options.allowSuperOutsideMethod;
|
|
1252
1252
|
}, I.allowDirectSuper.get = function() {
|
|
1253
|
-
return (this.currentThisScope().flags &
|
|
1253
|
+
return (this.currentThisScope().flags & Me) > 0;
|
|
1254
1254
|
}, I.treatFunctionsAsVar.get = function() {
|
|
1255
1255
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1256
1256
|
}, I.allowNewDotTarget.get = function() {
|
|
1257
1257
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1258
1258
|
var t = this.scopeStack[e].flags;
|
|
1259
|
-
if (t & (N |
|
|
1259
|
+
if (t & (N | Ne) || t & M && !(t & ke)) return !0;
|
|
1260
1260
|
}
|
|
1261
1261
|
return !1;
|
|
1262
1262
|
}, I.allowUsing.get = function() {
|
|
1263
1263
|
var e = this.currentScope().flags;
|
|
1264
|
-
return !(e &
|
|
1264
|
+
return !(e & Pe || !this.inModule && e & j);
|
|
1265
1265
|
}, I.inClassStaticBlock.get = function() {
|
|
1266
1266
|
return (this.currentVarScope().flags & N) > 0;
|
|
1267
1267
|
}, F.extend = function() {
|
|
@@ -1276,24 +1276,24 @@ F.prototype.parse = function() {
|
|
|
1276
1276
|
}, F.tokenizer = function(e, t) {
|
|
1277
1277
|
return new this(t, e);
|
|
1278
1278
|
}, Object.defineProperties(F.prototype, I);
|
|
1279
|
-
var L = F.prototype,
|
|
1279
|
+
var L = F.prototype, He = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
1280
1280
|
L.strictDirective = function(e) {
|
|
1281
1281
|
if (this.options.ecmaVersion < 5) return !1;
|
|
1282
1282
|
for (;;) {
|
|
1283
|
-
|
|
1284
|
-
var t =
|
|
1283
|
+
O.lastIndex = e, e += O.exec(this.input)[0].length;
|
|
1284
|
+
var t = He.exec(this.input.slice(e));
|
|
1285
1285
|
if (!t) return !1;
|
|
1286
1286
|
if ((t[1] || t[2]) === "use strict") {
|
|
1287
|
-
|
|
1288
|
-
var n =
|
|
1289
|
-
return i === ";" || i === "}" ||
|
|
1287
|
+
O.lastIndex = e + t[0].length;
|
|
1288
|
+
var n = O.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
|
|
1289
|
+
return i === ";" || i === "}" || D.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
|
|
1290
1290
|
}
|
|
1291
|
-
e += t[0].length,
|
|
1291
|
+
e += t[0].length, O.lastIndex = e, e += O.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
1292
1292
|
}
|
|
1293
1293
|
}, L.eat = function(e) {
|
|
1294
1294
|
return this.type === e ? (this.next(), !0) : !1;
|
|
1295
1295
|
}, L.isContextual = function(e) {
|
|
1296
|
-
return this.type ===
|
|
1296
|
+
return this.type === E.name && this.value === e && !this.containsEsc;
|
|
1297
1297
|
}, L.eatContextual = function(e) {
|
|
1298
1298
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
1299
1299
|
}, L.catchStackOverflow = function(e) {
|
|
@@ -1306,11 +1306,11 @@ L.strictDirective = function(e) {
|
|
|
1306
1306
|
}, L.expectContextual = function(e) {
|
|
1307
1307
|
this.eatContextual(e) || this.unexpected();
|
|
1308
1308
|
}, L.canInsertSemicolon = function() {
|
|
1309
|
-
return this.type ===
|
|
1309
|
+
return this.type === E.eof || this.type === E.braceR || D.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1310
1310
|
}, L.insertSemicolon = function() {
|
|
1311
1311
|
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
1312
1312
|
}, L.semicolon = function() {
|
|
1313
|
-
!this.eat(
|
|
1313
|
+
!this.eat(E.semi) && !this.insertSemicolon() && this.unexpected();
|
|
1314
1314
|
}, L.afterTrailingComma = function(e, t) {
|
|
1315
1315
|
if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
1316
1316
|
}, L.expect = function(e) {
|
|
@@ -1318,7 +1318,7 @@ L.strictDirective = function(e) {
|
|
|
1318
1318
|
}, L.unexpected = function(e) {
|
|
1319
1319
|
this.raise(e ?? this.start, "Unexpected token");
|
|
1320
1320
|
};
|
|
1321
|
-
var
|
|
1321
|
+
var Ue = function() {
|
|
1322
1322
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
1323
1323
|
};
|
|
1324
1324
|
L.checkPatternErrors = function(e, t) {
|
|
@@ -1340,7 +1340,7 @@ L.checkPatternErrors = function(e, t) {
|
|
|
1340
1340
|
var R = F.prototype;
|
|
1341
1341
|
R.parseTopLevel = function(e) {
|
|
1342
1342
|
var t = Object.create(null);
|
|
1343
|
-
for (e.body ||= []; this.type !==
|
|
1343
|
+
for (e.body ||= []; this.type !== E.eof;) {
|
|
1344
1344
|
var n = this.parseStatement(null, !0, t);
|
|
1345
1345
|
e.body.push(n);
|
|
1346
1346
|
}
|
|
@@ -1350,53 +1350,53 @@ R.parseTopLevel = function(e) {
|
|
|
1350
1350
|
}
|
|
1351
1351
|
return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType, this.finishNode(e, "Program");
|
|
1352
1352
|
};
|
|
1353
|
-
var
|
|
1353
|
+
var We = { kind: "loop" }, Ge = { kind: "switch" };
|
|
1354
1354
|
R.isLet = function(e) {
|
|
1355
1355
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
1356
|
-
|
|
1357
|
-
var t =
|
|
1356
|
+
O.lastIndex = this.pos;
|
|
1357
|
+
var t = O.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
1358
1358
|
if (r === 91 || r === 92) return !0;
|
|
1359
1359
|
if (e) return !1;
|
|
1360
1360
|
if (r === 123) return !0;
|
|
1361
|
-
if (
|
|
1361
|
+
if (y(r)) {
|
|
1362
1362
|
var i = n;
|
|
1363
1363
|
do
|
|
1364
1364
|
n += r <= 65535 ? 1 : 2;
|
|
1365
|
-
while (
|
|
1365
|
+
while (b(r = this.fullCharCodeAt(n)));
|
|
1366
1366
|
if (r === 92) return !0;
|
|
1367
1367
|
var a = this.input.slice(i, n);
|
|
1368
|
-
if (!
|
|
1368
|
+
if (!ie.test(a)) return !0;
|
|
1369
1369
|
}
|
|
1370
1370
|
return !1;
|
|
1371
1371
|
}, R.isAsyncFunction = function() {
|
|
1372
1372
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
1373
|
-
|
|
1374
|
-
var e =
|
|
1375
|
-
return !
|
|
1373
|
+
O.lastIndex = this.pos;
|
|
1374
|
+
var e = O.exec(this.input), t = this.pos + e[0].length, n;
|
|
1375
|
+
return !D.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(b(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
1376
1376
|
}, R.isUsingKeyword = function(e, t) {
|
|
1377
1377
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
1378
|
-
|
|
1379
|
-
var n =
|
|
1380
|
-
if (
|
|
1378
|
+
O.lastIndex = this.pos;
|
|
1379
|
+
var n = O.exec(this.input), r = this.pos + n[0].length;
|
|
1380
|
+
if (D.test(this.input.slice(this.pos, r))) return !1;
|
|
1381
1381
|
if (e) {
|
|
1382
1382
|
var i = r + 5, a;
|
|
1383
|
-
if (this.input.slice(r, i) !== "using" || i === this.input.length ||
|
|
1384
|
-
|
|
1385
|
-
var o =
|
|
1386
|
-
if (r = i + o[0].length, o &&
|
|
1383
|
+
if (this.input.slice(r, i) !== "using" || i === this.input.length || b(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
1384
|
+
O.lastIndex = i;
|
|
1385
|
+
var o = O.exec(this.input);
|
|
1386
|
+
if (r = i + o[0].length, o && D.test(this.input.slice(i, r))) return !1;
|
|
1387
1387
|
}
|
|
1388
1388
|
var s = this.fullCharCodeAt(r);
|
|
1389
|
-
if (!
|
|
1389
|
+
if (!y(s) && s !== 92) return !1;
|
|
1390
1390
|
var c = r;
|
|
1391
1391
|
do
|
|
1392
1392
|
r += s <= 65535 ? 1 : 2;
|
|
1393
|
-
while (
|
|
1393
|
+
while (b(s = this.fullCharCodeAt(r)));
|
|
1394
1394
|
if (s === 92) return !0;
|
|
1395
1395
|
var l = this.input.slice(c, r);
|
|
1396
|
-
if (
|
|
1396
|
+
if (ie.test(l)) return !1;
|
|
1397
1397
|
if (t && !e && l === "of") {
|
|
1398
|
-
|
|
1399
|
-
var u =
|
|
1398
|
+
O.lastIndex = r;
|
|
1399
|
+
var u = O.exec(this.input);
|
|
1400
1400
|
if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
1401
1401
|
}
|
|
1402
1402
|
return !0;
|
|
@@ -1406,43 +1406,43 @@ R.isLet = function(e) {
|
|
|
1406
1406
|
return this.isUsingKeyword(!1, e);
|
|
1407
1407
|
}, R.parseStatement = function(e, t, n) {
|
|
1408
1408
|
var r = this.type, i = this.startNode(), a;
|
|
1409
|
-
switch (this.isLet(e) && (r =
|
|
1410
|
-
case
|
|
1411
|
-
case
|
|
1412
|
-
case
|
|
1413
|
-
case
|
|
1414
|
-
case
|
|
1415
|
-
case
|
|
1416
|
-
case
|
|
1417
|
-
case
|
|
1418
|
-
case
|
|
1419
|
-
case
|
|
1420
|
-
case
|
|
1421
|
-
case
|
|
1422
|
-
case
|
|
1423
|
-
case
|
|
1424
|
-
case
|
|
1425
|
-
case
|
|
1426
|
-
case
|
|
1427
|
-
case
|
|
1428
|
-
case
|
|
1429
|
-
case
|
|
1430
|
-
if (this.options.ecmaVersion > 10 && r ===
|
|
1431
|
-
|
|
1432
|
-
var o =
|
|
1409
|
+
switch (this.isLet(e) && (r = E._var, a = "let"), r) {
|
|
1410
|
+
case E._break:
|
|
1411
|
+
case E._continue: return this.parseBreakContinueStatement(i, r.keyword);
|
|
1412
|
+
case E._debugger: return this.parseDebuggerStatement(i);
|
|
1413
|
+
case E._do: return this.parseDoStatement(i);
|
|
1414
|
+
case E._for: return this.parseForStatement(i);
|
|
1415
|
+
case E._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(i, !1, !e);
|
|
1416
|
+
case E._class: return e && this.unexpected(), this.parseClass(i, !0);
|
|
1417
|
+
case E._if: return this.parseIfStatement(i);
|
|
1418
|
+
case E._return: return this.parseReturnStatement(i);
|
|
1419
|
+
case E._switch: return this.parseSwitchStatement(i);
|
|
1420
|
+
case E._throw: return this.parseThrowStatement(i);
|
|
1421
|
+
case E._try: return this.parseTryStatement(i);
|
|
1422
|
+
case E._const:
|
|
1423
|
+
case E._var: return a ||= this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(i, a);
|
|
1424
|
+
case E._while: return this.parseWhileStatement(i);
|
|
1425
|
+
case E._with: return this.parseWithStatement(i);
|
|
1426
|
+
case E.braceL: return this.parseBlock(!0, i);
|
|
1427
|
+
case E.semi: return this.parseEmptyStatement(i);
|
|
1428
|
+
case E._export:
|
|
1429
|
+
case E._import:
|
|
1430
|
+
if (this.options.ecmaVersion > 10 && r === E._import) {
|
|
1431
|
+
O.lastIndex = this.pos;
|
|
1432
|
+
var o = O.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
|
|
1433
1433
|
if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
|
|
1434
1434
|
}
|
|
1435
|
-
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r ===
|
|
1435
|
+
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === E._import ? this.parseImport(i) : this.parseExport(i, n);
|
|
1436
1436
|
default:
|
|
1437
1437
|
if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
|
|
1438
1438
|
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
1439
1439
|
if (l) return this.allowUsing || this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"), e && this.raise(this.start, "Using declaration is not allowed in single-statement positions"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(i, !1, l), this.semicolon(), this.finishNode(i, "VariableDeclaration");
|
|
1440
1440
|
var u = this.value, d = this.parseExpression();
|
|
1441
|
-
return r ===
|
|
1441
|
+
return r === E.name && d.type === "Identifier" && this.eat(E.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
1442
1442
|
}
|
|
1443
1443
|
}, R.parseBreakContinueStatement = function(e, t) {
|
|
1444
1444
|
var n = t === "break";
|
|
1445
|
-
this.next(), this.eat(
|
|
1445
|
+
this.next(), this.eat(E.semi) || this.insertSemicolon() ? e.label = null : this.type === E.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
|
|
1446
1446
|
for (var r = 0; r < this.labels.length; ++r) {
|
|
1447
1447
|
var i = this.labels[r];
|
|
1448
1448
|
if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
|
|
@@ -1451,13 +1451,13 @@ R.isLet = function(e) {
|
|
|
1451
1451
|
}, R.parseDebuggerStatement = function(e) {
|
|
1452
1452
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
1453
1453
|
}, R.parseDoStatement = function(e) {
|
|
1454
|
-
return this.next(), this.labels.push(
|
|
1454
|
+
return this.next(), this.labels.push(We), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(E._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(E.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
1455
1455
|
}, R.parseForStatement = function(e) {
|
|
1456
1456
|
this.next();
|
|
1457
1457
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
1458
|
-
if (this.labels.push(
|
|
1458
|
+
if (this.labels.push(We), this.enterScope(0), this.expect(E.parenL), this.type === E.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
1459
1459
|
var n = this.isLet();
|
|
1460
|
-
if (this.type ===
|
|
1460
|
+
if (this.type === E._var || this.type === E._const || n) {
|
|
1461
1461
|
var r = this.startNode(), i = n ? "let" : this.value;
|
|
1462
1462
|
return this.next(), this.parseVar(r, !0, i), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
1463
1463
|
}
|
|
@@ -1466,47 +1466,47 @@ R.isLet = function(e) {
|
|
|
1466
1466
|
var c = this.startNode();
|
|
1467
1467
|
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);
|
|
1468
1468
|
}
|
|
1469
|
-
var l = this.containsEsc, u = new
|
|
1470
|
-
return this.type ===
|
|
1469
|
+
var l = this.containsEsc, u = new Ue(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
1470
|
+
return this.type === E._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === E._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));
|
|
1471
1471
|
}, R.parseForAfterInit = function(e, t, n) {
|
|
1472
|
-
return (this.type ===
|
|
1472
|
+
return (this.type === E._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === E._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));
|
|
1473
1473
|
}, R.parseFunctionStatement = function(e, t, n) {
|
|
1474
|
-
return this.next(), this.parseFunction(e,
|
|
1474
|
+
return this.next(), this.parseFunction(e, qe | (n ? 0 : Je), !1, t);
|
|
1475
1475
|
}, R.parseIfStatement = function(e) {
|
|
1476
|
-
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(
|
|
1476
|
+
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(E._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
1477
1477
|
}, R.parseReturnStatement = function(e) {
|
|
1478
|
-
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(
|
|
1478
|
+
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(E.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
1479
1479
|
}, R.parseSwitchStatement = function(e) {
|
|
1480
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(
|
|
1481
|
-
for (var t, n = !1; this.type !==
|
|
1482
|
-
var r = this.type ===
|
|
1483
|
-
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(
|
|
1480
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(E.braceL), this.labels.push(Ge), this.enterScope(Pe);
|
|
1481
|
+
for (var t, n = !1; this.type !== E.braceR;) if (this.type === E._case || this.type === E._default) {
|
|
1482
|
+
var r = this.type === E._case;
|
|
1483
|
+
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(E.colon);
|
|
1484
1484
|
} else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
1485
1485
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
1486
1486
|
}, R.parseThrowStatement = function(e) {
|
|
1487
|
-
return this.next(),
|
|
1487
|
+
return this.next(), D.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");
|
|
1488
1488
|
};
|
|
1489
|
-
var
|
|
1489
|
+
var Ke = [];
|
|
1490
1490
|
R.parseCatchClauseParam = function() {
|
|
1491
1491
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
1492
|
-
return this.enterScope(t ?
|
|
1492
|
+
return this.enterScope(t ? Ae : 0), this.checkLValPattern(e, t ? Be : P), this.expect(E.parenR), e;
|
|
1493
1493
|
}, R.parseTryStatement = function(e) {
|
|
1494
|
-
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type ===
|
|
1494
|
+
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === E._catch) {
|
|
1495
1495
|
var t = this.startNode();
|
|
1496
|
-
this.next(), this.eat(
|
|
1496
|
+
this.next(), this.eat(E.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
1497
1497
|
}
|
|
1498
|
-
return e.finalizer = this.eat(
|
|
1498
|
+
return e.finalizer = this.eat(E._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
1499
1499
|
}, R.parseVarStatement = function(e, t, n) {
|
|
1500
1500
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
1501
1501
|
}, R.parseWhileStatement = function(e) {
|
|
1502
|
-
return this.next(), e.test = this.parseParenExpression(), this.labels.push(
|
|
1502
|
+
return this.next(), e.test = this.parseParenExpression(), this.labels.push(We), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
1503
1503
|
}, R.parseWithStatement = function(e) {
|
|
1504
1504
|
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");
|
|
1505
1505
|
}, R.parseEmptyStatement = function(e) {
|
|
1506
1506
|
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
1507
1507
|
}, R.parseLabeledStatement = function(e, t, n, r) {
|
|
1508
1508
|
for (var i = 0, a = this.labels; i < a.length; i += 1) a[i].name === t && this.raise(n.start, "Label '" + t + "' is already declared");
|
|
1509
|
-
for (var o = this.type.isLoop ? "loop" : this.type ===
|
|
1509
|
+
for (var o = this.type.isLoop ? "loop" : this.type === E._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
|
|
1510
1510
|
var c = this.labels[s];
|
|
1511
1511
|
if (c.statementStart === e.start) c.statementStart = this.start, c.kind = o;
|
|
1512
1512
|
else break;
|
|
@@ -1519,81 +1519,81 @@ R.parseCatchClauseParam = function() {
|
|
|
1519
1519
|
}, R.parseExpressionStatement = function(e, t) {
|
|
1520
1520
|
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
1521
1521
|
}, R.parseBlock = function(e, t, n) {
|
|
1522
|
-
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(
|
|
1522
|
+
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(E.braceL), e && this.enterScope(0); this.type !== E.braceR;) {
|
|
1523
1523
|
var r = this.parseStatement(null);
|
|
1524
1524
|
t.body.push(r);
|
|
1525
1525
|
}
|
|
1526
1526
|
return n && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
1527
1527
|
}, R.parseFor = function(e, t) {
|
|
1528
|
-
return e.init = t, this.expect(
|
|
1528
|
+
return e.init = t, this.expect(E.semi), e.test = this.type === E.semi ? null : this.parseExpression(), this.expect(E.semi), e.update = this.type === E.parenR ? null : this.parseExpression(), this.expect(E.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
1529
1529
|
}, R.parseForIn = function(e, t) {
|
|
1530
|
-
var n = this.type ===
|
|
1531
|
-
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(
|
|
1530
|
+
var n = this.type === E._in;
|
|
1531
|
+
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(E.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
|
|
1532
1532
|
}, R.parseVar = function(e, t, n, r) {
|
|
1533
1533
|
for (e.declarations = [], e.kind = n;;) {
|
|
1534
1534
|
var i = this.startNode();
|
|
1535
|
-
if (this.parseVarId(i, n), this.eat(
|
|
1535
|
+
if (this.parseVarId(i, n), this.eat(E.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === E._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== E._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && !(t && (this.type === E._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, e.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(E.comma)) break;
|
|
1536
1536
|
}
|
|
1537
1537
|
return e;
|
|
1538
1538
|
}, R.parseVarId = function(e, t) {
|
|
1539
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ?
|
|
1539
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? Re : P, !1);
|
|
1540
1540
|
};
|
|
1541
|
-
var
|
|
1541
|
+
var qe = 1, Je = 2, Ye = 4;
|
|
1542
1542
|
R.parseFunction = function(e, t, n, r, i) {
|
|
1543
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type ===
|
|
1543
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === E.star && t & Je && this.unexpected(), e.generator = this.eat(E.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & qe && (e.id = t & Ye && this.type !== E.name ? null : this.parseIdent(), e.id && !(t & Je) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Re : P : ze));
|
|
1544
1544
|
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
1545
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
1545
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ie(e.async, e.generator)), t & qe || (e.id = this.type === E.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 & qe ? "FunctionDeclaration" : "FunctionExpression");
|
|
1546
1546
|
}, R.parseFunctionParams = function(e) {
|
|
1547
|
-
this.expect(
|
|
1547
|
+
this.expect(E.parenL), e.params = this.parseBindingList(E.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
1548
1548
|
}, R.parseClass = function(e, t) {
|
|
1549
1549
|
this.next();
|
|
1550
1550
|
var n = this.strict;
|
|
1551
1551
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
1552
1552
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
1553
|
-
for (i.body = [], this.expect(
|
|
1553
|
+
for (i.body = [], this.expect(E.braceL); this.type !== E.braceR;) {
|
|
1554
1554
|
var o = this.parseClassElement(e.superClass !== null);
|
|
1555
|
-
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" &&
|
|
1555
|
+
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" && Xe(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
1556
1556
|
}
|
|
1557
1557
|
return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
1558
1558
|
}, R.parseClassElement = function(e) {
|
|
1559
|
-
if (this.eat(
|
|
1559
|
+
if (this.eat(E.semi)) return null;
|
|
1560
1560
|
var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
|
|
1561
1561
|
if (this.eatContextual("static")) {
|
|
1562
|
-
if (t >= 13 && this.eat(
|
|
1563
|
-
this.isClassElementNameStart() || this.type ===
|
|
1562
|
+
if (t >= 13 && this.eat(E.braceL)) return this.parseClassStaticBlock(n), n;
|
|
1563
|
+
this.isClassElementNameStart() || this.type === E.star ? s = !0 : r = "static";
|
|
1564
1564
|
}
|
|
1565
|
-
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type ===
|
|
1565
|
+
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === E.star) && !this.canInsertSemicolon() ? a = !0 : r = "async"), !r && (t >= 9 || !a) && this.eat(E.star) && (i = !0), !r && !a && !i) {
|
|
1566
1566
|
var c = this.value;
|
|
1567
1567
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
1568
1568
|
}
|
|
1569
|
-
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 ===
|
|
1570
|
-
var l = !n.static &&
|
|
1569
|
+
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 === E.parenL || o !== "method" || i || a) {
|
|
1570
|
+
var l = !n.static && Ze(n, "constructor"), u = l && e;
|
|
1571
1571
|
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);
|
|
1572
1572
|
} else this.parseClassField(n);
|
|
1573
1573
|
return n;
|
|
1574
1574
|
}, R.isClassElementNameStart = function() {
|
|
1575
|
-
return this.type ===
|
|
1575
|
+
return this.type === E.name || this.type === E.privateId || this.type === E.num || this.type === E.string || this.type === E.bracketL || this.type.keyword;
|
|
1576
1576
|
}, R.parseClassElementName = function(e) {
|
|
1577
|
-
this.type ===
|
|
1577
|
+
this.type === E.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);
|
|
1578
1578
|
}, R.parseClassMethod = function(e, t, n, r) {
|
|
1579
1579
|
var i = e.key;
|
|
1580
|
-
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 &&
|
|
1580
|
+
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 && Ze(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
1581
1581
|
var a = e.value = this.parseMethod(t, n, r);
|
|
1582
1582
|
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");
|
|
1583
1583
|
}, R.parseClassField = function(e) {
|
|
1584
|
-
return
|
|
1584
|
+
return Ze(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Ze(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(E.eq) ? (this.enterScope(Ne | je), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
1585
1585
|
}, R.parseClassStaticBlock = function(e) {
|
|
1586
1586
|
e.body = [];
|
|
1587
1587
|
var t = this.labels;
|
|
1588
|
-
for (this.labels = [], this.enterScope(N |
|
|
1588
|
+
for (this.labels = [], this.enterScope(N | je); this.type !== E.braceR;) {
|
|
1589
1589
|
var n = this.parseStatement(null);
|
|
1590
1590
|
e.body.push(n);
|
|
1591
1591
|
}
|
|
1592
1592
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
1593
1593
|
}, R.parseClassId = function(e, t) {
|
|
1594
|
-
this.type ===
|
|
1594
|
+
this.type === E.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, P, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
1595
1595
|
}, R.parseClassSuper = function(e) {
|
|
1596
|
-
e.superClass = this.eat(
|
|
1596
|
+
e.superClass = this.eat(E._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
1597
1597
|
}, R.enterClassBody = function() {
|
|
1598
1598
|
var e = {
|
|
1599
1599
|
declared: Object.create(null),
|
|
@@ -1604,25 +1604,25 @@ R.parseFunction = function(e, t, n, r, i) {
|
|
|
1604
1604
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
1605
1605
|
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
1606
1606
|
var o = n[a];
|
|
1607
|
-
|
|
1607
|
+
ge(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
1608
1608
|
}
|
|
1609
1609
|
};
|
|
1610
|
-
function
|
|
1610
|
+
function Xe(e, t) {
|
|
1611
1611
|
var n = t.key.name, r = e[n], i = "true";
|
|
1612
1612
|
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);
|
|
1613
1613
|
}
|
|
1614
|
-
function
|
|
1614
|
+
function Ze(e, t) {
|
|
1615
1615
|
var n = e.computed, r = e.key;
|
|
1616
1616
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
1617
1617
|
}
|
|
1618
1618
|
R.parseExportAllDeclaration = function(e, t) {
|
|
1619
|
-
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !==
|
|
1619
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== E.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
1620
1620
|
}, R.parseExport = function(e, t) {
|
|
1621
|
-
if (this.next(), this.eat(
|
|
1622
|
-
if (this.eat(
|
|
1621
|
+
if (this.next(), this.eat(E.star)) return this.parseExportAllDeclaration(e, t);
|
|
1622
|
+
if (this.eat(E._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
1623
1623
|
if (this.shouldParseExportStatement()) e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
1624
1624
|
else {
|
|
1625
|
-
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !==
|
|
1625
|
+
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== E.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
1626
1626
|
else {
|
|
1627
1627
|
for (var n = 0, r = e.specifiers; n < r.length; n += 1) {
|
|
1628
1628
|
var i = r[n];
|
|
@@ -1637,10 +1637,10 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1637
1637
|
return this.parseStatement(null);
|
|
1638
1638
|
}, R.parseExportDefaultDeclaration = function() {
|
|
1639
1639
|
var e;
|
|
1640
|
-
if (this.type ===
|
|
1640
|
+
if (this.type === E._function || (e = this.isAsyncFunction())) {
|
|
1641
1641
|
var t = this.startNode();
|
|
1642
|
-
return this.next(), e && this.next(), this.parseFunction(t,
|
|
1643
|
-
} else if (this.type ===
|
|
1642
|
+
return this.next(), e && this.next(), this.parseFunction(t, qe | Ye, !1, e);
|
|
1643
|
+
} else if (this.type === E._class) {
|
|
1644
1644
|
var n = this.startNode();
|
|
1645
1645
|
return this.parseClass(n, "nullableID");
|
|
1646
1646
|
} else {
|
|
@@ -1648,7 +1648,7 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1648
1648
|
return this.semicolon(), r;
|
|
1649
1649
|
}
|
|
1650
1650
|
}, R.checkExport = function(e, t, n) {
|
|
1651
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
1651
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), ge(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
1652
1652
|
}, R.checkPatternExport = function(e, t) {
|
|
1653
1653
|
var n = t.type;
|
|
1654
1654
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
@@ -1673,14 +1673,14 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1673
1673
|
return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(e, t.exported, t.exported.start), this.finishNode(t, "ExportSpecifier");
|
|
1674
1674
|
}, R.parseExportSpecifiers = function(e) {
|
|
1675
1675
|
var t = [], n = !0;
|
|
1676
|
-
for (this.expect(
|
|
1676
|
+
for (this.expect(E.braceL); !this.eat(E.braceR);) {
|
|
1677
1677
|
if (n) n = !1;
|
|
1678
|
-
else if (this.expect(
|
|
1678
|
+
else if (this.expect(E.comma), this.afterTrailingComma(E.braceR)) break;
|
|
1679
1679
|
t.push(this.parseExportSpecifier(e));
|
|
1680
1680
|
}
|
|
1681
1681
|
return t;
|
|
1682
1682
|
}, R.parseImport = function(e) {
|
|
1683
|
-
return this.next(), this.type ===
|
|
1683
|
+
return this.next(), this.type === E.string ? (e.specifiers = Ke, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === E.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
1684
1684
|
}, R.parseImportSpecifier = function() {
|
|
1685
1685
|
var e = this.startNode();
|
|
1686
1686
|
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");
|
|
@@ -1692,32 +1692,32 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1692
1692
|
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, P), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
1693
1693
|
}, R.parseImportSpecifiers = function() {
|
|
1694
1694
|
var e = [], t = !0;
|
|
1695
|
-
if (this.type ===
|
|
1696
|
-
if (this.type ===
|
|
1697
|
-
for (this.expect(
|
|
1695
|
+
if (this.type === E.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(E.comma))) return e;
|
|
1696
|
+
if (this.type === E.star) return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
1697
|
+
for (this.expect(E.braceL); !this.eat(E.braceR);) {
|
|
1698
1698
|
if (t) t = !1;
|
|
1699
|
-
else if (this.expect(
|
|
1699
|
+
else if (this.expect(E.comma), this.afterTrailingComma(E.braceR)) break;
|
|
1700
1700
|
e.push(this.parseImportSpecifier());
|
|
1701
1701
|
}
|
|
1702
1702
|
return e;
|
|
1703
1703
|
}, R.parseWithClause = function() {
|
|
1704
1704
|
var e = [];
|
|
1705
|
-
if (!this.eat(
|
|
1706
|
-
this.expect(
|
|
1707
|
-
for (var t = {}, n = !0; !this.eat(
|
|
1705
|
+
if (!this.eat(E._with)) return e;
|
|
1706
|
+
this.expect(E.braceL);
|
|
1707
|
+
for (var t = {}, n = !0; !this.eat(E.braceR);) {
|
|
1708
1708
|
if (n) n = !1;
|
|
1709
|
-
else if (this.expect(
|
|
1709
|
+
else if (this.expect(E.comma), this.afterTrailingComma(E.braceR)) break;
|
|
1710
1710
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
1711
|
-
|
|
1711
|
+
ge(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
1712
1712
|
}
|
|
1713
1713
|
return e;
|
|
1714
1714
|
}, R.parseImportAttribute = function() {
|
|
1715
1715
|
var e = this.startNode();
|
|
1716
|
-
return e.key = this.type ===
|
|
1716
|
+
return e.key = this.type === E.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(E.colon), this.type !== E.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
1717
1717
|
}, R.parseModuleExportName = function() {
|
|
1718
|
-
if (this.options.ecmaVersion >= 13 && this.type ===
|
|
1718
|
+
if (this.options.ecmaVersion >= 13 && this.type === E.string) {
|
|
1719
1719
|
var e = this.parseLiteral(this.value);
|
|
1720
|
-
return
|
|
1720
|
+
return ye.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
1721
1721
|
}
|
|
1722
1722
|
return this.parseIdent(!0);
|
|
1723
1723
|
}, R.adaptDirectivePrologue = function(e) {
|
|
@@ -1780,21 +1780,21 @@ z.toAssignable = function(e, t, n) {
|
|
|
1780
1780
|
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
1781
1781
|
}, z.parseRestBinding = function() {
|
|
1782
1782
|
var e = this.startNode();
|
|
1783
|
-
return this.next(), this.options.ecmaVersion === 6 && this.type !==
|
|
1783
|
+
return this.next(), this.options.ecmaVersion === 6 && this.type !== E.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
1784
1784
|
}, z.parseBindingAtom = function() {
|
|
1785
1785
|
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
1786
|
-
case
|
|
1786
|
+
case E.bracketL:
|
|
1787
1787
|
var e = this.startNode();
|
|
1788
|
-
return this.next(), e.elements = this.parseBindingList(
|
|
1789
|
-
case
|
|
1788
|
+
return this.next(), e.elements = this.parseBindingList(E.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
1789
|
+
case E.braceL: return this.parseObj(!0);
|
|
1790
1790
|
}
|
|
1791
1791
|
return this.parseIdent();
|
|
1792
1792
|
}, z.parseBindingList = function(e, t, n, r) {
|
|
1793
|
-
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(
|
|
1793
|
+
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(E.comma), t && this.type === E.comma) i.push(null);
|
|
1794
1794
|
else if (n && this.afterTrailingComma(e)) break;
|
|
1795
|
-
else if (this.type ===
|
|
1795
|
+
else if (this.type === E.ellipsis) {
|
|
1796
1796
|
var o = this.parseRestBinding();
|
|
1797
|
-
this.parseBindingListItem(o), i.push(o), this.type ===
|
|
1797
|
+
this.parseBindingListItem(o), i.push(o), this.type === E.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
1798
1798
|
break;
|
|
1799
1799
|
} else i.push(this.parseAssignableListItem(r));
|
|
1800
1800
|
return i;
|
|
@@ -1804,15 +1804,15 @@ z.toAssignable = function(e, t, n) {
|
|
|
1804
1804
|
}, z.parseBindingListItem = function(e) {
|
|
1805
1805
|
return e;
|
|
1806
1806
|
}, z.parseMaybeDefault = function(e, t, n) {
|
|
1807
|
-
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(
|
|
1807
|
+
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(E.eq)) return n;
|
|
1808
1808
|
var r = this.startNodeAt(e, t);
|
|
1809
1809
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
1810
1810
|
}, z.checkLValSimple = function(e, t, n) {
|
|
1811
|
-
t === void 0 && (t =
|
|
1812
|
-
var r = t !==
|
|
1811
|
+
t === void 0 && (t = Le);
|
|
1812
|
+
var r = t !== Le;
|
|
1813
1813
|
switch (e.type) {
|
|
1814
1814
|
case "Identifier":
|
|
1815
|
-
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 && (
|
|
1815
|
+
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 && (ge(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== Ve && this.declareName(e.name, t, e.start));
|
|
1816
1816
|
break;
|
|
1817
1817
|
case "ChainExpression":
|
|
1818
1818
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -1824,7 +1824,7 @@ z.toAssignable = function(e, t, n) {
|
|
|
1824
1824
|
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
1825
1825
|
}
|
|
1826
1826
|
}, z.checkLValPattern = function(e, t, n) {
|
|
1827
|
-
switch (t === void 0 && (t =
|
|
1827
|
+
switch (t === void 0 && (t = Le), e.type) {
|
|
1828
1828
|
case "ObjectPattern":
|
|
1829
1829
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
1830
1830
|
var a = i[r];
|
|
@@ -1840,7 +1840,7 @@ z.toAssignable = function(e, t, n) {
|
|
|
1840
1840
|
default: this.checkLValSimple(e, t, n);
|
|
1841
1841
|
}
|
|
1842
1842
|
}, z.checkLValInnerPattern = function(e, t, n) {
|
|
1843
|
-
switch (t === void 0 && (t =
|
|
1843
|
+
switch (t === void 0 && (t = Le), e.type) {
|
|
1844
1844
|
case "Property":
|
|
1845
1845
|
this.checkLValInnerPattern(e.value, t, n);
|
|
1846
1846
|
break;
|
|
@@ -1868,57 +1868,57 @@ var B = function(e, t, n, r, i) {
|
|
|
1868
1868
|
f_expr: new B("function", !0),
|
|
1869
1869
|
f_expr_gen: new B("function", !0, !1, null, !0),
|
|
1870
1870
|
f_gen: new B("function", !1, !1, null, !0)
|
|
1871
|
-
},
|
|
1872
|
-
|
|
1871
|
+
}, Qe = F.prototype;
|
|
1872
|
+
Qe.initialContext = function() {
|
|
1873
1873
|
return [V.b_stat];
|
|
1874
|
-
},
|
|
1874
|
+
}, Qe.curContext = function() {
|
|
1875
1875
|
return this.context[this.context.length - 1];
|
|
1876
|
-
},
|
|
1876
|
+
}, Qe.braceIsBlock = function(e) {
|
|
1877
1877
|
var t = this.curContext();
|
|
1878
|
-
return t === V.f_expr || t === V.f_stat ? !0 : e ===
|
|
1879
|
-
},
|
|
1878
|
+
return t === V.f_expr || t === V.f_stat ? !0 : e === E.colon && (t === V.b_stat || t === V.b_expr) ? !t.isExpr : e === E._return || e === E.name && this.exprAllowed ? D.test(this.input.slice(this.lastTokEnd, this.start)) : e === E._else || e === E.semi || e === E.eof || e === E.parenR || e === E.arrow ? !0 : e === E.braceL ? t === V.b_stat : e === E._var || e === E._const || e === E.name ? !1 : !this.exprAllowed;
|
|
1879
|
+
}, Qe.inGeneratorContext = function() {
|
|
1880
1880
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
1881
1881
|
var t = this.context[e];
|
|
1882
1882
|
if (t.token === "function") return t.generator;
|
|
1883
1883
|
}
|
|
1884
1884
|
return !1;
|
|
1885
|
-
},
|
|
1885
|
+
}, Qe.updateContext = function(e) {
|
|
1886
1886
|
var t, n = this.type;
|
|
1887
|
-
n.keyword && e ===
|
|
1888
|
-
},
|
|
1887
|
+
n.keyword && e === E.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
1888
|
+
}, Qe.overrideContext = function(e) {
|
|
1889
1889
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
1890
|
-
},
|
|
1890
|
+
}, E.parenR.updateContext = E.braceR.updateContext = function() {
|
|
1891
1891
|
if (this.context.length === 1) {
|
|
1892
1892
|
this.exprAllowed = !0;
|
|
1893
1893
|
return;
|
|
1894
1894
|
}
|
|
1895
1895
|
var e = this.context.pop();
|
|
1896
1896
|
e === V.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
1897
|
-
},
|
|
1897
|
+
}, E.braceL.updateContext = function(e) {
|
|
1898
1898
|
this.context.push(this.braceIsBlock(e) ? V.b_stat : V.b_expr), this.exprAllowed = !0;
|
|
1899
|
-
},
|
|
1899
|
+
}, E.dollarBraceL.updateContext = function() {
|
|
1900
1900
|
this.context.push(V.b_tmpl), this.exprAllowed = !0;
|
|
1901
|
-
},
|
|
1902
|
-
var t = e ===
|
|
1901
|
+
}, E.parenL.updateContext = function(e) {
|
|
1902
|
+
var t = e === E._if || e === E._for || e === E._with || e === E._while;
|
|
1903
1903
|
this.context.push(t ? V.p_stat : V.p_expr), this.exprAllowed = !0;
|
|
1904
|
-
},
|
|
1905
|
-
e.beforeExpr && e !==
|
|
1906
|
-
},
|
|
1904
|
+
}, E.incDec.updateContext = function() {}, E._function.updateContext = E._class.updateContext = function(e) {
|
|
1905
|
+
e.beforeExpr && e !== E._else && !(e === E.semi && this.curContext() !== V.p_stat) && !(e === E._return && D.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === E.colon || e === E.braceL) && this.curContext() === V.b_stat) ? this.context.push(V.f_expr) : this.context.push(V.f_stat), this.exprAllowed = !1;
|
|
1906
|
+
}, E.colon.updateContext = function() {
|
|
1907
1907
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
1908
|
-
},
|
|
1908
|
+
}, E.backQuote.updateContext = function() {
|
|
1909
1909
|
this.curContext() === V.q_tmpl ? this.context.pop() : this.context.push(V.q_tmpl), this.exprAllowed = !1;
|
|
1910
|
-
},
|
|
1911
|
-
if (e ===
|
|
1910
|
+
}, E.star.updateContext = function(e) {
|
|
1911
|
+
if (e === E._function) {
|
|
1912
1912
|
var t = this.context.length - 1;
|
|
1913
1913
|
this.context[t] === V.f_expr ? this.context[t] = V.f_expr_gen : this.context[t] = V.f_gen;
|
|
1914
1914
|
}
|
|
1915
1915
|
this.exprAllowed = !0;
|
|
1916
|
-
},
|
|
1916
|
+
}, E.name.updateContext = function(e) {
|
|
1917
1917
|
var t = !1;
|
|
1918
|
-
this.options.ecmaVersion >= 6 && e !==
|
|
1918
|
+
this.options.ecmaVersion >= 6 && e !== E.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
1919
1919
|
};
|
|
1920
|
-
var
|
|
1921
|
-
|
|
1920
|
+
var H = F.prototype;
|
|
1921
|
+
H.checkPropClash = function(e, t, n) {
|
|
1922
1922
|
if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
|
|
1923
1923
|
var r = e.key, i;
|
|
1924
1924
|
switch (r.type) {
|
|
@@ -1943,65 +1943,65 @@ U.checkPropClash = function(e, t, n) {
|
|
|
1943
1943
|
set: !1
|
|
1944
1944
|
}, o[a] = !0;
|
|
1945
1945
|
}
|
|
1946
|
-
},
|
|
1946
|
+
}, H.parseExpression = function(e, t) {
|
|
1947
1947
|
var n = this;
|
|
1948
1948
|
return this.catchStackOverflow(function() {
|
|
1949
1949
|
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
1950
|
-
if (n.type ===
|
|
1950
|
+
if (n.type === E.comma) {
|
|
1951
1951
|
var o = n.startNodeAt(r, i);
|
|
1952
|
-
for (o.expressions = [a]; n.eat(
|
|
1952
|
+
for (o.expressions = [a]; n.eat(E.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
|
|
1953
1953
|
return n.finishNode(o, "SequenceExpression");
|
|
1954
1954
|
}
|
|
1955
1955
|
return a;
|
|
1956
1956
|
});
|
|
1957
|
-
},
|
|
1957
|
+
}, H.parseMaybeAssign = function(e, t, n) {
|
|
1958
1958
|
if (this.isContextual("yield")) {
|
|
1959
1959
|
if (this.inGenerator) return this.parseYield(e);
|
|
1960
1960
|
this.exprAllowed = !1;
|
|
1961
1961
|
}
|
|
1962
1962
|
var r = !1, i = -1, a = -1, o = -1;
|
|
1963
|
-
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
1963
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new Ue(), r = !0);
|
|
1964
1964
|
var s = this.start, c = this.startLoc;
|
|
1965
|
-
(this.type ===
|
|
1965
|
+
(this.type === E.parenL || this.type === E.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
1966
1966
|
var l = this.parseMaybeConditional(e, t);
|
|
1967
1967
|
if (n && (l = n.call(this, l, s, c)), this.type.isAssign) {
|
|
1968
1968
|
var u = this.startNodeAt(s, c);
|
|
1969
|
-
return u.operator = this.value, this.type ===
|
|
1969
|
+
return u.operator = this.value, this.type === E.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === E.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), u.left = l, this.next(), u.right = this.parseMaybeAssign(e), o > -1 && (t.doubleProto = o), this.finishNode(u, "AssignmentExpression");
|
|
1970
1970
|
} else r && this.checkExpressionErrors(t, !0);
|
|
1971
1971
|
return i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
1972
|
-
},
|
|
1972
|
+
}, H.parseMaybeConditional = function(e, t) {
|
|
1973
1973
|
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
1974
1974
|
if (this.checkExpressionErrors(t)) return i;
|
|
1975
|
-
if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(
|
|
1975
|
+
if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(E.question)) {
|
|
1976
1976
|
var a = this.startNodeAt(n, r);
|
|
1977
|
-
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(
|
|
1977
|
+
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(E.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
1978
1978
|
}
|
|
1979
1979
|
return i;
|
|
1980
|
-
},
|
|
1980
|
+
}, H.parseExprOps = function(e, t) {
|
|
1981
1981
|
var n = this.start, r = this.startLoc, i = this.parseMaybeUnary(t, !1, !1, e);
|
|
1982
1982
|
return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
|
|
1983
|
-
},
|
|
1983
|
+
}, H.parseExprOp = function(e, t, n, r, i) {
|
|
1984
1984
|
var a = this.type.binop;
|
|
1985
|
-
if (a != null && (!i || this.type !==
|
|
1986
|
-
var o = this.type ===
|
|
1987
|
-
s && (a =
|
|
1985
|
+
if (a != null && (!i || this.type !== E._in) && a > r) {
|
|
1986
|
+
var o = this.type === E.logicalOR || this.type === E.logicalAND, s = this.type === E.coalesce;
|
|
1987
|
+
s && (a = E.logicalAND.binop);
|
|
1988
1988
|
var c = this.value;
|
|
1989
1989
|
this.next();
|
|
1990
1990
|
var l = this.start, u = this.startLoc, d = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, i), l, u, a, i), f = this.buildBinary(t, n, e, d, c, o || s);
|
|
1991
|
-
return (o && this.type ===
|
|
1991
|
+
return (o && this.type === E.coalesce || s && (this.type === E.logicalOR || this.type === E.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(f, t, n, r, i);
|
|
1992
1992
|
}
|
|
1993
1993
|
return e;
|
|
1994
|
-
},
|
|
1994
|
+
}, H.buildBinary = function(e, t, n, r, i, a) {
|
|
1995
1995
|
r.type === "PrivateIdentifier" && this.raise(r.start, "Private identifier can only be left side of binary expression");
|
|
1996
1996
|
var o = this.startNodeAt(e, t);
|
|
1997
1997
|
return o.left = n, o.operator = i, o.right = r, this.finishNode(o, a ? "LogicalExpression" : "BinaryExpression");
|
|
1998
|
-
},
|
|
1998
|
+
}, H.parseMaybeUnary = function(e, t, n, r) {
|
|
1999
1999
|
var i = this.start, a = this.startLoc, o;
|
|
2000
2000
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
2001
2001
|
else if (this.type.prefix) {
|
|
2002
|
-
var s = this.startNode(), c = this.type ===
|
|
2002
|
+
var s = this.startNode(), c = this.type === E.incDec;
|
|
2003
2003
|
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" && $e(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && et(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
|
|
2004
|
-
} else if (!t && this.type ===
|
|
2004
|
+
} else if (!t && this.type === E.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== E._in && this.unexpected();
|
|
2005
2005
|
else {
|
|
2006
2006
|
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
2007
2007
|
for (; this.type.postfix && !this.canInsertSemicolon();) {
|
|
@@ -2009,7 +2009,7 @@ U.checkPropClash = function(e, t, n) {
|
|
|
2009
2009
|
l.operator = this.value, l.prefix = !1, l.argument = o, this.checkLValSimple(o), this.next(), o = this.finishNode(l, "UpdateExpression");
|
|
2010
2010
|
}
|
|
2011
2011
|
}
|
|
2012
|
-
if (!n && this.eat(
|
|
2012
|
+
if (!n && this.eat(E.starstar)) if (t) this.unexpected(this.lastTokStart);
|
|
2013
2013
|
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
2014
2014
|
else return o;
|
|
2015
2015
|
};
|
|
@@ -2019,12 +2019,12 @@ function $e(e) {
|
|
|
2019
2019
|
function et(e) {
|
|
2020
2020
|
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && et(e.expression) || e.type === "ParenthesizedExpression" && et(e.expression);
|
|
2021
2021
|
}
|
|
2022
|
-
|
|
2022
|
+
H.parseExprSubscripts = function(e, t) {
|
|
2023
2023
|
var n = this.start, r = this.startLoc, i = this.parseExprAtom(e, t);
|
|
2024
2024
|
if (i.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") return i;
|
|
2025
2025
|
var a = this.parseSubscripts(i, n, r, !1, t);
|
|
2026
2026
|
return e && a.type === "MemberExpression" && (e.parenthesizedAssign >= a.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= a.start && (e.parenthesizedBind = -1), e.trailingComma >= a.start && (e.trailingComma = -1)), a;
|
|
2027
|
-
},
|
|
2027
|
+
}, H.parseSubscripts = function(e, t, n, r, i) {
|
|
2028
2028
|
for (var a = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, o = !1;;) {
|
|
2029
2029
|
var s = this.parseSubscript(e, t, n, r, a, o, i);
|
|
2030
2030
|
if (s.optional && (o = !0), s === e || s.type === "ArrowFunctionExpression") {
|
|
@@ -2036,170 +2036,170 @@ U.parseExprSubscripts = function(e, t) {
|
|
|
2036
2036
|
}
|
|
2037
2037
|
e = s;
|
|
2038
2038
|
}
|
|
2039
|
-
},
|
|
2040
|
-
return !this.canInsertSemicolon() && this.eat(
|
|
2041
|
-
},
|
|
2039
|
+
}, H.shouldParseAsyncArrow = function() {
|
|
2040
|
+
return !this.canInsertSemicolon() && this.eat(E.arrow);
|
|
2041
|
+
}, H.parseSubscriptAsyncArrow = function(e, t, n, r) {
|
|
2042
2042
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
|
|
2043
|
-
},
|
|
2044
|
-
var s = this.options.ecmaVersion >= 11, c = s && this.eat(
|
|
2043
|
+
}, H.parseSubscript = function(e, t, n, r, i, a, o) {
|
|
2044
|
+
var s = this.options.ecmaVersion >= 11, c = s && this.eat(E.questionDot);
|
|
2045
2045
|
r && c && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
2046
|
-
var l = this.eat(
|
|
2047
|
-
if (l || c && this.type !==
|
|
2046
|
+
var l = this.eat(E.bracketL);
|
|
2047
|
+
if (l || c && this.type !== E.parenL && this.type !== E.backQuote || this.eat(E.dot)) {
|
|
2048
2048
|
var u = this.startNodeAt(t, n);
|
|
2049
|
-
u.object = e, l ? (u.property = this.parseExpression(), this.expect(
|
|
2050
|
-
} else if (!r && this.eat(
|
|
2051
|
-
var d = new
|
|
2049
|
+
u.object = e, l ? (u.property = this.parseExpression(), this.expect(E.bracketR)) : this.type === E.privateId && e.type !== "Super" ? u.property = this.parsePrivateIdent() : u.property = this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
2050
|
+
} else if (!r && this.eat(E.parenL)) {
|
|
2051
|
+
var d = new Ue(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
2052
2052
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
2053
|
-
var
|
|
2054
|
-
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,
|
|
2053
|
+
var ee = this.parseExprList(E.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
2054
|
+
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, ee, o);
|
|
2055
2055
|
this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
|
|
2056
|
-
var
|
|
2057
|
-
|
|
2058
|
-
} else if (this.type ===
|
|
2056
|
+
var h = this.startNodeAt(t, n);
|
|
2057
|
+
h.callee = e, h.arguments = ee, s && (h.optional = c), e = this.finishNode(h, "CallExpression");
|
|
2058
|
+
} else if (this.type === E.backQuote) {
|
|
2059
2059
|
(c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
2060
2060
|
var g = this.startNodeAt(t, n);
|
|
2061
2061
|
g.tag = e, g.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(g, "TaggedTemplateExpression");
|
|
2062
2062
|
}
|
|
2063
2063
|
return e;
|
|
2064
|
-
},
|
|
2065
|
-
this.type ===
|
|
2064
|
+
}, H.parseExprAtom = function(e, t, n) {
|
|
2065
|
+
this.type === E.slash && this.readRegexp();
|
|
2066
2066
|
var r, i = this.potentialArrowAt === this.start;
|
|
2067
2067
|
switch (this.type) {
|
|
2068
|
-
case
|
|
2069
|
-
case
|
|
2070
|
-
case
|
|
2068
|
+
case E._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === E.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== E.dot && this.type !== E.bracketL && this.type !== E.parenL && this.unexpected(), this.finishNode(r, "Super");
|
|
2069
|
+
case E._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
2070
|
+
case E.name:
|
|
2071
2071
|
var a = this.start, o = this.startLoc, s = this.containsEsc, c = this.parseIdent(!1);
|
|
2072
|
-
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(
|
|
2072
|
+
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(E._function)) return this.overrideContext(V.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
|
|
2073
2073
|
if (i && !this.canInsertSemicolon()) {
|
|
2074
|
-
if (this.eat(
|
|
2075
|
-
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type ===
|
|
2074
|
+
if (this.eat(E.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
|
|
2075
|
+
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === E.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(E.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
|
|
2076
2076
|
}
|
|
2077
2077
|
return c;
|
|
2078
|
-
case
|
|
2078
|
+
case E.regexp:
|
|
2079
2079
|
var l = this.value;
|
|
2080
2080
|
return r = this.parseLiteral(l.value), r.regex = {
|
|
2081
2081
|
pattern: l.pattern,
|
|
2082
2082
|
flags: l.flags
|
|
2083
2083
|
}, r;
|
|
2084
|
-
case
|
|
2085
|
-
case
|
|
2086
|
-
case
|
|
2087
|
-
case
|
|
2088
|
-
case
|
|
2089
|
-
case
|
|
2084
|
+
case E.num:
|
|
2085
|
+
case E.string: return this.parseLiteral(this.value);
|
|
2086
|
+
case E._null:
|
|
2087
|
+
case E._true:
|
|
2088
|
+
case E._false: return r = this.startNode(), r.value = this.type === E._null ? null : this.type === E._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
|
|
2089
|
+
case E.parenL:
|
|
2090
2090
|
var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
|
|
2091
2091
|
return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(d) && (e.parenthesizedAssign = u), e.parenthesizedBind < 0 && (e.parenthesizedBind = u)), d;
|
|
2092
|
-
case
|
|
2093
|
-
case
|
|
2094
|
-
case
|
|
2095
|
-
case
|
|
2096
|
-
case
|
|
2097
|
-
case
|
|
2098
|
-
case
|
|
2092
|
+
case E.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(E.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
2093
|
+
case E.braceL: return this.overrideContext(V.b_expr), this.parseObj(!1, e);
|
|
2094
|
+
case E._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
2095
|
+
case E._class: return this.parseClass(this.startNode(), !1);
|
|
2096
|
+
case E._new: return this.parseNew();
|
|
2097
|
+
case E.backQuote: return this.parseTemplate();
|
|
2098
|
+
case E._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
|
|
2099
2099
|
default: return this.parseExprAtomDefault();
|
|
2100
2100
|
}
|
|
2101
|
-
},
|
|
2101
|
+
}, H.parseExprAtomDefault = function() {
|
|
2102
2102
|
this.unexpected();
|
|
2103
|
-
},
|
|
2103
|
+
}, H.parseExprImport = function(e) {
|
|
2104
2104
|
var t = this.startNode();
|
|
2105
|
-
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type ===
|
|
2106
|
-
if (this.type ===
|
|
2105
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === E.parenL && !e) return this.parseDynamicImport(t);
|
|
2106
|
+
if (this.type === E.dot) {
|
|
2107
2107
|
var n = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
2108
2108
|
return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
|
|
2109
2109
|
} else this.unexpected();
|
|
2110
|
-
},
|
|
2111
|
-
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(
|
|
2112
|
-
else if (!this.eat(
|
|
2110
|
+
}, H.parseDynamicImport = function(e) {
|
|
2111
|
+
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(E.parenR) ? e.options = null : (this.expect(E.comma), this.afterTrailingComma(E.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(E.parenR) || (this.expect(E.comma), this.afterTrailingComma(E.parenR) || this.unexpected())));
|
|
2112
|
+
else if (!this.eat(E.parenR)) {
|
|
2113
2113
|
var t = this.start;
|
|
2114
|
-
this.eat(
|
|
2114
|
+
this.eat(E.comma) && this.eat(E.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
2115
2115
|
}
|
|
2116
2116
|
return this.finishNode(e, "ImportExpression");
|
|
2117
|
-
},
|
|
2117
|
+
}, H.parseImportMeta = function(e) {
|
|
2118
2118
|
this.next();
|
|
2119
2119
|
var t = this.containsEsc;
|
|
2120
2120
|
return e.property = this.parseIdent(!0), e.property.name !== "meta" && this.raiseRecoverable(e.property.start, "The only valid meta property for import is 'import.meta'"), t && this.raiseRecoverable(e.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(e.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e, "MetaProperty");
|
|
2121
|
-
},
|
|
2121
|
+
}, H.parseLiteral = function(e) {
|
|
2122
2122
|
var t = this.startNode();
|
|
2123
2123
|
return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value == null ? t.raw.slice(0, -1).replace(/_/g, "") : t.value.toString()), this.next(), this.finishNode(t, "Literal");
|
|
2124
|
-
},
|
|
2125
|
-
this.expect(
|
|
2124
|
+
}, H.parseParenExpression = function() {
|
|
2125
|
+
this.expect(E.parenL);
|
|
2126
2126
|
var e = this.parseExpression();
|
|
2127
|
-
return this.expect(
|
|
2128
|
-
},
|
|
2127
|
+
return this.expect(E.parenR), e;
|
|
2128
|
+
}, H.shouldParseArrow = function(e) {
|
|
2129
2129
|
return !this.canInsertSemicolon();
|
|
2130
|
-
},
|
|
2130
|
+
}, H.parseParenAndDistinguishExpression = function(e, t) {
|
|
2131
2131
|
var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
|
|
2132
2132
|
if (this.options.ecmaVersion >= 6) {
|
|
2133
2133
|
this.next();
|
|
2134
|
-
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new
|
|
2135
|
-
for (this.yieldPos = 0, this.awaitPos = 0; this.type !==
|
|
2134
|
+
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new Ue(), f = this.yieldPos, p = this.awaitPos, m;
|
|
2135
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== E.parenR;) if (l ? l = !1 : this.expect(E.comma), a && this.afterTrailingComma(E.parenR, !0)) {
|
|
2136
2136
|
u = !0;
|
|
2137
2137
|
break;
|
|
2138
|
-
} else if (this.type ===
|
|
2139
|
-
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type ===
|
|
2138
|
+
} else if (this.type === E.ellipsis) {
|
|
2139
|
+
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type === E.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
2140
2140
|
break;
|
|
2141
2141
|
} else c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
|
|
2142
|
-
var
|
|
2143
|
-
if (this.expect(
|
|
2144
|
-
(!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",
|
|
2142
|
+
var ee = this.lastTokEnd, h = this.lastTokEndLoc;
|
|
2143
|
+
if (this.expect(E.parenR), e && this.shouldParseArrow(c) && this.eat(E.arrow)) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = f, this.awaitPos = p, this.parseParenArrowList(n, r, c, t);
|
|
2144
|
+
(!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", ee, h)) : i = c[0];
|
|
2145
2145
|
} else i = this.parseParenExpression();
|
|
2146
2146
|
if (this.options.preserveParens) {
|
|
2147
2147
|
var g = this.startNodeAt(n, r);
|
|
2148
2148
|
return g.expression = i, this.finishNode(g, "ParenthesizedExpression");
|
|
2149
2149
|
} else return i;
|
|
2150
|
-
},
|
|
2150
|
+
}, H.parseParenItem = function(e) {
|
|
2151
2151
|
return e;
|
|
2152
|
-
},
|
|
2152
|
+
}, H.parseParenArrowList = function(e, t, n, r) {
|
|
2153
2153
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !1, r);
|
|
2154
2154
|
};
|
|
2155
2155
|
var tt = [];
|
|
2156
|
-
|
|
2156
|
+
H.parseNew = function() {
|
|
2157
2157
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
2158
2158
|
var e = this.startNode();
|
|
2159
|
-
if (this.next(), this.options.ecmaVersion >= 6 && this.type ===
|
|
2159
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === E.dot) {
|
|
2160
2160
|
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
2161
2161
|
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
2162
2162
|
var n = this.containsEsc;
|
|
2163
2163
|
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");
|
|
2164
2164
|
}
|
|
2165
2165
|
var r = this.start, i = this.startLoc;
|
|
2166
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(
|
|
2167
|
-
},
|
|
2166
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(E.parenL) ? e.arguments = this.parseExprList(E.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = tt, this.finishNode(e, "NewExpression");
|
|
2167
|
+
}, H.parseTemplateElement = function(e) {
|
|
2168
2168
|
var t = e.isTagged, n = this.startNode();
|
|
2169
|
-
return this.type ===
|
|
2169
|
+
return this.type === E.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
2170
2170
|
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
2171
2171
|
cooked: null
|
|
2172
2172
|
}) : n.value = {
|
|
2173
2173
|
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
|
|
2174
2174
|
cooked: this.value
|
|
2175
|
-
}, this.next(), n.tail = this.type ===
|
|
2176
|
-
},
|
|
2175
|
+
}, this.next(), n.tail = this.type === E.backQuote, this.finishNode(n, "TemplateElement");
|
|
2176
|
+
}, H.parseTemplate = function(e) {
|
|
2177
2177
|
e === void 0 && (e = {});
|
|
2178
2178
|
var t = e.isTagged;
|
|
2179
2179
|
t === void 0 && (t = !1);
|
|
2180
2180
|
var n = this.startNode();
|
|
2181
2181
|
this.next(), n.expressions = [];
|
|
2182
2182
|
var r = this.parseTemplateElement({ isTagged: t });
|
|
2183
|
-
for (n.quasis = [r]; !r.tail;) this.type ===
|
|
2183
|
+
for (n.quasis = [r]; !r.tail;) this.type === E.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(E.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(E.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
2184
2184
|
return this.next(), this.finishNode(n, "TemplateLiteral");
|
|
2185
|
-
},
|
|
2186
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type ===
|
|
2187
|
-
},
|
|
2185
|
+
}, H.isAsyncProp = function(e) {
|
|
2186
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === E.name || this.type === E.num || this.type === E.string || this.type === E.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === E.star) && !D.test(this.input.slice(this.lastTokEnd, this.start));
|
|
2187
|
+
}, H.parseObj = function(e, t) {
|
|
2188
2188
|
var n = this.startNode(), r = !0, i = {};
|
|
2189
|
-
for (n.properties = [], this.next(); !this.eat(
|
|
2189
|
+
for (n.properties = [], this.next(); !this.eat(E.braceR);) {
|
|
2190
2190
|
if (r) r = !1;
|
|
2191
|
-
else if (this.expect(
|
|
2191
|
+
else if (this.expect(E.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(E.braceR)) break;
|
|
2192
2192
|
var a = this.parseProperty(e, t);
|
|
2193
2193
|
e || this.checkPropClash(a, i, t), n.properties.push(a);
|
|
2194
2194
|
}
|
|
2195
2195
|
return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
|
|
2196
|
-
},
|
|
2196
|
+
}, H.parseProperty = function(e, t) {
|
|
2197
2197
|
var n = this.startNode(), r, i, a, o;
|
|
2198
|
-
if (this.options.ecmaVersion >= 9 && this.eat(
|
|
2199
|
-
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(
|
|
2198
|
+
if (this.options.ecmaVersion >= 9 && this.eat(E.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === E.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(n, "RestElement")) : (n.argument = this.parseMaybeAssign(!1, t), this.type === E.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
|
|
2199
|
+
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(E.star)));
|
|
2200
2200
|
var s = this.containsEsc;
|
|
2201
|
-
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(
|
|
2202
|
-
},
|
|
2201
|
+
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(E.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
|
|
2202
|
+
}, H.parseGetterSetter = function(e) {
|
|
2203
2203
|
var t = e.key.name;
|
|
2204
2204
|
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
2205
2205
|
var n = e.kind === "get" ? 0 : 1;
|
|
@@ -2207,122 +2207,122 @@ U.parseNew = function() {
|
|
|
2207
2207
|
var r = e.value.start;
|
|
2208
2208
|
e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
|
|
2209
2209
|
} else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
2210
|
-
},
|
|
2211
|
-
(n || r) && this.type ===
|
|
2212
|
-
},
|
|
2210
|
+
}, H.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
|
|
2211
|
+
(n || r) && this.type === E.colon && this.unexpected(), this.eat(E.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === E.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(n, r), e.kind = "init") : !t && !s && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== E.comma && this.type !== E.braceR && this.type !== E.eq ? ((n || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((n || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = i), t ? e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key)) : this.type === E.eq && o ? (o.shorthandAssign < 0 && (o.shorthandAssign = this.start), e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
2212
|
+
}, H.parsePropertyName = function(e) {
|
|
2213
2213
|
if (this.options.ecmaVersion >= 6) {
|
|
2214
|
-
if (this.eat(
|
|
2214
|
+
if (this.eat(E.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(E.bracketR), e.key;
|
|
2215
2215
|
e.computed = !1;
|
|
2216
2216
|
}
|
|
2217
|
-
return e.key = this.type ===
|
|
2218
|
-
},
|
|
2217
|
+
return e.key = this.type === E.num || this.type === E.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2218
|
+
}, H.initFunction = function(e) {
|
|
2219
2219
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
2220
|
-
},
|
|
2220
|
+
}, H.parseMethod = function(e, t, n) {
|
|
2221
2221
|
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2222
|
-
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(
|
|
2223
|
-
},
|
|
2222
|
+
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(Ie(t, r.generator) | je | (n ? Me : 0)), this.expect(E.parenL), r.params = this.parseBindingList(E.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");
|
|
2223
|
+
}, H.parseArrowExpression = function(e, t, n, r) {
|
|
2224
2224
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2225
|
-
return this.enterScope(
|
|
2226
|
-
},
|
|
2227
|
-
var i = t && this.type !==
|
|
2225
|
+
return this.enterScope(Ie(n, !1) | ke), 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");
|
|
2226
|
+
}, H.parseFunctionBody = function(e, t, n, r) {
|
|
2227
|
+
var i = t && this.type !== E.braceL, a = this.strict, o = !1;
|
|
2228
2228
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
2229
2229
|
else {
|
|
2230
2230
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
2231
2231
|
(!a || s) && (o = this.strictDirective(this.end), o && s && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
2232
2232
|
var c = this.labels;
|
|
2233
|
-
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,
|
|
2233
|
+
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, Ve), e.body = this.parseBlock(!1, void 0, o && !a), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = c;
|
|
2234
2234
|
}
|
|
2235
2235
|
this.exitScope();
|
|
2236
|
-
},
|
|
2236
|
+
}, H.isSimpleParamList = function(e) {
|
|
2237
2237
|
for (var t = 0, n = e; t < n.length; t += 1) if (n[t].type !== "Identifier") return !1;
|
|
2238
2238
|
return !0;
|
|
2239
|
-
},
|
|
2239
|
+
}, H.checkParams = function(e, t) {
|
|
2240
2240
|
for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
|
|
2241
2241
|
var a = i[r];
|
|
2242
|
-
this.checkLValInnerPattern(a,
|
|
2242
|
+
this.checkLValInnerPattern(a, Re, t ? null : n);
|
|
2243
2243
|
}
|
|
2244
|
-
},
|
|
2244
|
+
}, H.parseExprList = function(e, t, n, r) {
|
|
2245
2245
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
2246
2246
|
if (a) a = !1;
|
|
2247
|
-
else if (this.expect(
|
|
2247
|
+
else if (this.expect(E.comma), t && this.afterTrailingComma(e)) break;
|
|
2248
2248
|
var o = void 0;
|
|
2249
|
-
n && this.type ===
|
|
2249
|
+
n && this.type === E.comma ? o = null : this.type === E.ellipsis ? (o = this.parseSpread(r), r && this.type === E.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
|
|
2250
2250
|
}
|
|
2251
2251
|
return i;
|
|
2252
|
-
},
|
|
2252
|
+
}, H.checkUnreserved = function(e) {
|
|
2253
2253
|
var t = e.start, n = e.end, r = e.name;
|
|
2254
|
-
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 &
|
|
2255
|
-
},
|
|
2254
|
+
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 & Fe) && 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"));
|
|
2255
|
+
}, H.parseIdent = function(e) {
|
|
2256
2256
|
var t = this.parseIdentNode();
|
|
2257
2257
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
2258
|
-
},
|
|
2258
|
+
}, H.parseIdentNode = function() {
|
|
2259
2259
|
var e = this.startNode();
|
|
2260
|
-
return this.type ===
|
|
2261
|
-
},
|
|
2260
|
+
return this.type === E.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = E.name) : this.unexpected(), e;
|
|
2261
|
+
}, H.parsePrivateIdent = function() {
|
|
2262
2262
|
var e = this.startNode();
|
|
2263
|
-
return this.type ===
|
|
2264
|
-
},
|
|
2263
|
+
return this.type === E.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
2264
|
+
}, H.parseYield = function(e) {
|
|
2265
2265
|
this.yieldPos ||= this.start;
|
|
2266
2266
|
var t = this.startNode();
|
|
2267
|
-
return this.next(), this.type ===
|
|
2268
|
-
},
|
|
2267
|
+
return this.next(), this.type === E.semi || this.canInsertSemicolon() || this.type !== E.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(E.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
2268
|
+
}, H.parseAwait = function(e) {
|
|
2269
2269
|
this.awaitPos ||= this.start;
|
|
2270
2270
|
var t = this.startNode();
|
|
2271
2271
|
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
2272
2272
|
};
|
|
2273
2273
|
var nt = F.prototype;
|
|
2274
2274
|
nt.raise = function(e, t) {
|
|
2275
|
-
var n =
|
|
2275
|
+
var n = Se(this.input, e);
|
|
2276
2276
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
2277
2277
|
var r = SyntaxError(t);
|
|
2278
2278
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
2279
2279
|
}, nt.raiseRecoverable = nt.raise, nt.curPosition = function() {
|
|
2280
|
-
if (this.options.locations) return new
|
|
2280
|
+
if (this.options.locations) return new be(this.curLine, this.pos - this.lineStart);
|
|
2281
2281
|
};
|
|
2282
|
-
var
|
|
2282
|
+
var U = F.prototype, rt = function(e) {
|
|
2283
2283
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
2284
2284
|
};
|
|
2285
|
-
|
|
2285
|
+
U.enterScope = function(e) {
|
|
2286
2286
|
this.scopeStack.push(new rt(e));
|
|
2287
|
-
},
|
|
2287
|
+
}, U.exitScope = function() {
|
|
2288
2288
|
this.scopeStack.pop();
|
|
2289
|
-
},
|
|
2289
|
+
}, U.treatFunctionsAsVarInScope = function(e) {
|
|
2290
2290
|
return e.flags & M || !this.inModule && e.flags & j;
|
|
2291
|
-
},
|
|
2291
|
+
}, U.declareName = function(e, t, n) {
|
|
2292
2292
|
var r = !1;
|
|
2293
2293
|
if (t === P) {
|
|
2294
2294
|
var i = this.currentScope();
|
|
2295
2295
|
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & j && delete this.undefinedExports[e];
|
|
2296
|
-
} else if (t ===
|
|
2297
|
-
else if (t ===
|
|
2296
|
+
} else if (t === Be) this.currentScope().lexical.push(e);
|
|
2297
|
+
else if (t === ze) {
|
|
2298
2298
|
var a = this.currentScope();
|
|
2299
2299
|
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
2300
2300
|
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
2301
2301
|
var s = this.scopeStack[o];
|
|
2302
|
-
if (s.lexical.indexOf(e) > -1 && !(s.flags &
|
|
2302
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & Ae && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
2303
2303
|
r = !0;
|
|
2304
2304
|
break;
|
|
2305
2305
|
}
|
|
2306
|
-
if (s.var.push(e), this.inModule && s.flags & j && delete this.undefinedExports[e], s.flags &
|
|
2306
|
+
if (s.var.push(e), this.inModule && s.flags & j && delete this.undefinedExports[e], s.flags & Fe) break;
|
|
2307
2307
|
}
|
|
2308
2308
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
2309
|
-
},
|
|
2309
|
+
}, U.checkLocalExport = function(e) {
|
|
2310
2310
|
this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
|
|
2311
|
-
},
|
|
2311
|
+
}, U.currentScope = function() {
|
|
2312
2312
|
return this.scopeStack[this.scopeStack.length - 1];
|
|
2313
|
-
},
|
|
2313
|
+
}, U.currentVarScope = function() {
|
|
2314
2314
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2315
2315
|
var t = this.scopeStack[e];
|
|
2316
|
-
if (t.flags & (
|
|
2316
|
+
if (t.flags & (Fe | Ne | N)) return t;
|
|
2317
2317
|
}
|
|
2318
|
-
},
|
|
2318
|
+
}, U.currentThisScope = function() {
|
|
2319
2319
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2320
2320
|
var t = this.scopeStack[e];
|
|
2321
|
-
if (t.flags & (
|
|
2321
|
+
if (t.flags & (Fe | Ne | N) && !(t.flags & ke)) return t;
|
|
2322
2322
|
}
|
|
2323
2323
|
};
|
|
2324
2324
|
var it = function(e, t, n) {
|
|
2325
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
2325
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new xe(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
2326
2326
|
}, at = F.prototype;
|
|
2327
2327
|
at.startNode = function() {
|
|
2328
2328
|
return new it(this, this.start, this.startLoc);
|
|
@@ -2385,7 +2385,7 @@ for (var wt = 0, Tt = [
|
|
|
2385
2385
|
var Et = Tt[wt];
|
|
2386
2386
|
Ct(Et);
|
|
2387
2387
|
}
|
|
2388
|
-
var
|
|
2388
|
+
var W = F.prototype, Dt = function(e, t) {
|
|
2389
2389
|
this.parent = e, this.base = t || this;
|
|
2390
2390
|
};
|
|
2391
2391
|
Dt.prototype.separatedFrom = function(e) {
|
|
@@ -2394,15 +2394,15 @@ Dt.prototype.separatedFrom = function(e) {
|
|
|
2394
2394
|
}, Dt.prototype.sibling = function() {
|
|
2395
2395
|
return new Dt(this.parent, this.base);
|
|
2396
2396
|
};
|
|
2397
|
-
var
|
|
2397
|
+
var G = function(e) {
|
|
2398
2398
|
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 = St[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;
|
|
2399
2399
|
};
|
|
2400
|
-
|
|
2400
|
+
G.prototype.reset = function(e, t, n) {
|
|
2401
2401
|
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
2402
2402
|
this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
|
|
2403
|
-
},
|
|
2403
|
+
}, G.prototype.raise = function(e) {
|
|
2404
2404
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
2405
|
-
},
|
|
2405
|
+
}, G.prototype.at = function(e, t) {
|
|
2406
2406
|
t === void 0 && (t = !1);
|
|
2407
2407
|
var n = this.source, r = n.length;
|
|
2408
2408
|
if (e >= r) return -1;
|
|
@@ -2410,21 +2410,21 @@ K.prototype.reset = function(e, t, n) {
|
|
|
2410
2410
|
if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
|
|
2411
2411
|
var a = n.charCodeAt(e + 1);
|
|
2412
2412
|
return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
|
|
2413
|
-
},
|
|
2413
|
+
}, G.prototype.nextIndex = function(e, t) {
|
|
2414
2414
|
t === void 0 && (t = !1);
|
|
2415
2415
|
var n = this.source, r = n.length;
|
|
2416
2416
|
if (e >= r) return r;
|
|
2417
2417
|
var i = n.charCodeAt(e), a;
|
|
2418
2418
|
return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
|
|
2419
|
-
},
|
|
2419
|
+
}, G.prototype.current = function(e) {
|
|
2420
2420
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
2421
|
-
},
|
|
2421
|
+
}, G.prototype.lookahead = function(e) {
|
|
2422
2422
|
return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
|
|
2423
|
-
},
|
|
2423
|
+
}, G.prototype.advance = function(e) {
|
|
2424
2424
|
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
2425
|
-
},
|
|
2425
|
+
}, G.prototype.eat = function(e, t) {
|
|
2426
2426
|
return t === void 0 && (t = !1), this.current(t) === e ? (this.advance(t), !0) : !1;
|
|
2427
|
-
},
|
|
2427
|
+
}, G.prototype.eatChars = function(e, t) {
|
|
2428
2428
|
t === void 0 && (t = !1);
|
|
2429
2429
|
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
2430
2430
|
var a = i[r], o = this.at(n, t);
|
|
@@ -2432,7 +2432,7 @@ K.prototype.reset = function(e, t, n) {
|
|
|
2432
2432
|
n = this.nextIndex(n, t);
|
|
2433
2433
|
}
|
|
2434
2434
|
return this.pos = n, !0;
|
|
2435
|
-
},
|
|
2435
|
+
}, W.validateRegExpFlags = function(e) {
|
|
2436
2436
|
for (var t = e.validFlags, n = e.flags, r = !1, i = !1, a = 0; a < n.length; a++) {
|
|
2437
2437
|
var o = n.charAt(a);
|
|
2438
2438
|
t.indexOf(o) === -1 && this.raise(e.start, "Invalid regular expression flag"), n.indexOf(o, a + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), o === "u" && (r = !0), o === "v" && (i = !0);
|
|
@@ -2443,23 +2443,23 @@ function Ot(e) {
|
|
|
2443
2443
|
for (var t in e) return !0;
|
|
2444
2444
|
return !1;
|
|
2445
2445
|
}
|
|
2446
|
-
|
|
2446
|
+
W.validateRegExpPattern = function(e) {
|
|
2447
2447
|
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && Ot(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
2448
|
-
},
|
|
2448
|
+
}, W.regexp_pattern = function(e) {
|
|
2449
2449
|
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");
|
|
2450
2450
|
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
2451
2451
|
var r = n[t];
|
|
2452
2452
|
e.groupNames[r] || e.raise("Invalid named capture referenced");
|
|
2453
2453
|
}
|
|
2454
|
-
},
|
|
2454
|
+
}, W.regexp_disjunction = function(e) {
|
|
2455
2455
|
var t = this.options.ecmaVersion >= 16;
|
|
2456
2456
|
for (t && (e.branchID = new Dt(e.branchID, null)), this.regexp_alternative(e); e.eat(124);) t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
|
|
2457
2457
|
t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, !0) && e.raise("Nothing to repeat"), e.eat(123) && e.raise("Lone quantifier brackets");
|
|
2458
|
-
},
|
|
2458
|
+
}, W.regexp_alternative = function(e) {
|
|
2459
2459
|
for (; e.pos < e.source.length && this.regexp_eatTerm(e););
|
|
2460
|
-
},
|
|
2460
|
+
}, W.regexp_eatTerm = function(e) {
|
|
2461
2461
|
return this.regexp_eatAssertion(e) ? (e.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e) && e.switchU && e.raise("Invalid quantifier"), !0) : (e.switchU ? this.regexp_eatAtom(e) : this.regexp_eatExtendedAtom(e)) ? (this.regexp_eatQuantifier(e), !0) : !1;
|
|
2462
|
-
},
|
|
2462
|
+
}, W.regexp_eatAssertion = function(e) {
|
|
2463
2463
|
var t = e.pos;
|
|
2464
2464
|
if (e.lastAssertionIsQuantifiable = !1, e.eat(94) || e.eat(36)) return !0;
|
|
2465
2465
|
if (e.eat(92)) {
|
|
@@ -2471,11 +2471,11 @@ G.validateRegExpPattern = function(e) {
|
|
|
2471
2471
|
if (this.options.ecmaVersion >= 9 && (n = e.eat(60)), e.eat(61) || e.eat(33)) return this.regexp_disjunction(e), e.eat(41) || e.raise("Unterminated group"), e.lastAssertionIsQuantifiable = !n, !0;
|
|
2472
2472
|
}
|
|
2473
2473
|
return e.pos = t, !1;
|
|
2474
|
-
},
|
|
2474
|
+
}, W.regexp_eatQuantifier = function(e, t) {
|
|
2475
2475
|
return t === void 0 && (t = !1), this.regexp_eatQuantifierPrefix(e, t) ? (e.eat(63), !0) : !1;
|
|
2476
|
-
},
|
|
2476
|
+
}, W.regexp_eatQuantifierPrefix = function(e, t) {
|
|
2477
2477
|
return e.eat(42) || e.eat(43) || e.eat(63) || this.regexp_eatBracedQuantifier(e, t);
|
|
2478
|
-
},
|
|
2478
|
+
}, W.regexp_eatBracedQuantifier = function(e, t) {
|
|
2479
2479
|
var n = e.pos;
|
|
2480
2480
|
if (e.eat(123)) {
|
|
2481
2481
|
var r = 0, i = -1;
|
|
@@ -2483,16 +2483,16 @@ G.validateRegExpPattern = function(e) {
|
|
|
2483
2483
|
e.switchU && !t && e.raise("Incomplete quantifier"), e.pos = n;
|
|
2484
2484
|
}
|
|
2485
2485
|
return !1;
|
|
2486
|
-
},
|
|
2486
|
+
}, W.regexp_eatAtom = function(e) {
|
|
2487
2487
|
return this.regexp_eatPatternCharacters(e) || e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e);
|
|
2488
|
-
},
|
|
2488
|
+
}, W.regexp_eatReverseSolidusAtomEscape = function(e) {
|
|
2489
2489
|
var t = e.pos;
|
|
2490
2490
|
if (e.eat(92)) {
|
|
2491
2491
|
if (this.regexp_eatAtomEscape(e)) return !0;
|
|
2492
2492
|
e.pos = t;
|
|
2493
2493
|
}
|
|
2494
2494
|
return !1;
|
|
2495
|
-
},
|
|
2495
|
+
}, W.regexp_eatUncapturingGroup = function(e) {
|
|
2496
2496
|
var t = e.pos;
|
|
2497
2497
|
if (e.eat(40)) {
|
|
2498
2498
|
if (e.eat(63)) {
|
|
@@ -2521,37 +2521,37 @@ G.validateRegExpPattern = function(e) {
|
|
|
2521
2521
|
e.pos = t;
|
|
2522
2522
|
}
|
|
2523
2523
|
return !1;
|
|
2524
|
-
},
|
|
2524
|
+
}, W.regexp_eatCapturingGroup = function(e) {
|
|
2525
2525
|
if (e.eat(40)) {
|
|
2526
2526
|
if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e) : e.current() === 63 && e.raise("Invalid group"), this.regexp_disjunction(e), e.eat(41)) return e.numCapturingParens += 1, !0;
|
|
2527
2527
|
e.raise("Unterminated group");
|
|
2528
2528
|
}
|
|
2529
2529
|
return !1;
|
|
2530
|
-
},
|
|
2530
|
+
}, W.regexp_eatModifiers = function(e) {
|
|
2531
2531
|
for (var t = "", n = 0; (n = e.current()) !== -1 && kt(n);) t += A(n), e.advance();
|
|
2532
2532
|
return t;
|
|
2533
2533
|
};
|
|
2534
2534
|
function kt(e) {
|
|
2535
2535
|
return e === 105 || e === 109 || e === 115;
|
|
2536
2536
|
}
|
|
2537
|
-
|
|
2537
|
+
W.regexp_eatExtendedAtom = function(e) {
|
|
2538
2538
|
return e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e) || this.regexp_eatInvalidBracedQuantifier(e) || this.regexp_eatExtendedPatternCharacter(e);
|
|
2539
|
-
},
|
|
2539
|
+
}, W.regexp_eatInvalidBracedQuantifier = function(e) {
|
|
2540
2540
|
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
2541
|
-
},
|
|
2541
|
+
}, W.regexp_eatSyntaxCharacter = function(e) {
|
|
2542
2542
|
var t = e.current();
|
|
2543
2543
|
return At(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2544
2544
|
};
|
|
2545
2545
|
function At(e) {
|
|
2546
2546
|
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
2547
2547
|
}
|
|
2548
|
-
|
|
2548
|
+
W.regexp_eatPatternCharacters = function(e) {
|
|
2549
2549
|
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !At(n);) e.advance();
|
|
2550
2550
|
return e.pos !== t;
|
|
2551
|
-
},
|
|
2551
|
+
}, W.regexp_eatExtendedPatternCharacter = function(e) {
|
|
2552
2552
|
var t = e.current();
|
|
2553
2553
|
return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 ? (e.advance(), !0) : !1;
|
|
2554
|
-
},
|
|
2554
|
+
}, W.regexp_groupSpecifier = function(e) {
|
|
2555
2555
|
if (e.eat(63)) {
|
|
2556
2556
|
this.regexp_eatGroupName(e) || e.raise("Invalid group");
|
|
2557
2557
|
var t = this.options.ecmaVersion >= 16, n = e.groupNames[e.lastStringValue];
|
|
@@ -2559,35 +2559,35 @@ G.regexp_eatPatternCharacters = function(e) {
|
|
|
2559
2559
|
else e.raise("Duplicate capture group name");
|
|
2560
2560
|
t ? (n || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = !0;
|
|
2561
2561
|
}
|
|
2562
|
-
},
|
|
2562
|
+
}, W.regexp_eatGroupName = function(e) {
|
|
2563
2563
|
if (e.lastStringValue = "", e.eat(60)) {
|
|
2564
2564
|
if (this.regexp_eatRegExpIdentifierName(e) && e.eat(62)) return !0;
|
|
2565
2565
|
e.raise("Invalid capture group name");
|
|
2566
2566
|
}
|
|
2567
2567
|
return !1;
|
|
2568
|
-
},
|
|
2568
|
+
}, W.regexp_eatRegExpIdentifierName = function(e) {
|
|
2569
2569
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
2570
2570
|
for (e.lastStringValue += A(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += A(e.lastIntValue);
|
|
2571
2571
|
return !0;
|
|
2572
2572
|
}
|
|
2573
2573
|
return !1;
|
|
2574
|
-
},
|
|
2574
|
+
}, W.regexp_eatRegExpIdentifierStart = function(e) {
|
|
2575
2575
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2576
2576
|
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), jt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2577
2577
|
};
|
|
2578
2578
|
function jt(e) {
|
|
2579
|
-
return
|
|
2579
|
+
return y(e, !0) || e === 36 || e === 95;
|
|
2580
2580
|
}
|
|
2581
|
-
|
|
2581
|
+
W.regexp_eatRegExpIdentifierPart = function(e) {
|
|
2582
2582
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2583
2583
|
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), Mt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2584
2584
|
};
|
|
2585
2585
|
function Mt(e) {
|
|
2586
|
-
return
|
|
2586
|
+
return b(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2587
2587
|
}
|
|
2588
|
-
|
|
2588
|
+
W.regexp_eatAtomEscape = function(e) {
|
|
2589
2589
|
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
2590
|
-
},
|
|
2590
|
+
}, W.regexp_eatBackReference = function(e) {
|
|
2591
2591
|
var t = e.pos;
|
|
2592
2592
|
if (this.regexp_eatDecimalEscape(e)) {
|
|
2593
2593
|
var n = e.lastIntValue;
|
|
@@ -2596,34 +2596,34 @@ G.regexp_eatAtomEscape = function(e) {
|
|
|
2596
2596
|
e.pos = t;
|
|
2597
2597
|
}
|
|
2598
2598
|
return !1;
|
|
2599
|
-
},
|
|
2599
|
+
}, W.regexp_eatKGroupName = function(e) {
|
|
2600
2600
|
if (e.eat(107)) {
|
|
2601
2601
|
if (this.regexp_eatGroupName(e)) return e.backReferenceNames.push(e.lastStringValue), !0;
|
|
2602
2602
|
e.raise("Invalid named reference");
|
|
2603
2603
|
}
|
|
2604
2604
|
return !1;
|
|
2605
|
-
},
|
|
2605
|
+
}, W.regexp_eatCharacterEscape = function(e) {
|
|
2606
2606
|
return this.regexp_eatControlEscape(e) || this.regexp_eatCControlLetter(e) || this.regexp_eatZero(e) || this.regexp_eatHexEscapeSequence(e) || this.regexp_eatRegExpUnicodeEscapeSequence(e, !1) || !e.switchU && this.regexp_eatLegacyOctalEscapeSequence(e) || this.regexp_eatIdentityEscape(e);
|
|
2607
|
-
},
|
|
2607
|
+
}, W.regexp_eatCControlLetter = function(e) {
|
|
2608
2608
|
var t = e.pos;
|
|
2609
2609
|
if (e.eat(99)) {
|
|
2610
2610
|
if (this.regexp_eatControlLetter(e)) return !0;
|
|
2611
2611
|
e.pos = t;
|
|
2612
2612
|
}
|
|
2613
2613
|
return !1;
|
|
2614
|
-
},
|
|
2614
|
+
}, W.regexp_eatZero = function(e) {
|
|
2615
2615
|
return e.current() === 48 && !Ht(e.lookahead()) ? (e.lastIntValue = 0, e.advance(), !0) : !1;
|
|
2616
|
-
},
|
|
2616
|
+
}, W.regexp_eatControlEscape = function(e) {
|
|
2617
2617
|
var t = e.current();
|
|
2618
2618
|
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) : !1;
|
|
2619
|
-
},
|
|
2619
|
+
}, W.regexp_eatControlLetter = function(e) {
|
|
2620
2620
|
var t = e.current();
|
|
2621
2621
|
return Nt(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2622
2622
|
};
|
|
2623
2623
|
function Nt(e) {
|
|
2624
2624
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2625
2625
|
}
|
|
2626
|
-
|
|
2626
|
+
W.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
2627
2627
|
t === void 0 && (t = !1);
|
|
2628
2628
|
var n = e.pos, r = t || e.switchU;
|
|
2629
2629
|
if (e.eat(117)) {
|
|
@@ -2647,11 +2647,11 @@ G.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
2647
2647
|
function Pt(e) {
|
|
2648
2648
|
return e >= 0 && e <= 1114111;
|
|
2649
2649
|
}
|
|
2650
|
-
|
|
2650
|
+
W.regexp_eatIdentityEscape = function(e) {
|
|
2651
2651
|
if (e.switchU) return this.regexp_eatSyntaxCharacter(e) ? !0 : e.eat(47) ? (e.lastIntValue = 47, !0) : !1;
|
|
2652
2652
|
var t = e.current();
|
|
2653
2653
|
return t !== 99 && (!e.switchN || t !== 107) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2654
|
-
},
|
|
2654
|
+
}, W.regexp_eatDecimalEscape = function(e) {
|
|
2655
2655
|
e.lastIntValue = 0;
|
|
2656
2656
|
var t = e.current();
|
|
2657
2657
|
if (t >= 49 && t <= 57) {
|
|
@@ -2662,15 +2662,15 @@ G.regexp_eatIdentityEscape = function(e) {
|
|
|
2662
2662
|
}
|
|
2663
2663
|
return !1;
|
|
2664
2664
|
};
|
|
2665
|
-
var Ft = 0,
|
|
2666
|
-
|
|
2665
|
+
var Ft = 0, K = 1, q = 2;
|
|
2666
|
+
W.regexp_eatCharacterClassEscape = function(e) {
|
|
2667
2667
|
var t = e.current();
|
|
2668
|
-
if (It(t)) return e.lastIntValue = -1, e.advance(),
|
|
2668
|
+
if (It(t)) return e.lastIntValue = -1, e.advance(), K;
|
|
2669
2669
|
var n = !1;
|
|
2670
2670
|
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
2671
2671
|
e.lastIntValue = -1, e.advance();
|
|
2672
2672
|
var r;
|
|
2673
|
-
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r ===
|
|
2673
|
+
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === q && e.raise("Invalid property name"), r;
|
|
2674
2674
|
e.raise("Invalid property name");
|
|
2675
2675
|
}
|
|
2676
2676
|
return Ft;
|
|
@@ -2678,13 +2678,13 @@ G.regexp_eatCharacterClassEscape = function(e) {
|
|
|
2678
2678
|
function It(e) {
|
|
2679
2679
|
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
2680
2680
|
}
|
|
2681
|
-
|
|
2681
|
+
W.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
2682
2682
|
var t = e.pos;
|
|
2683
2683
|
if (this.regexp_eatUnicodePropertyName(e) && e.eat(61)) {
|
|
2684
2684
|
var n = e.lastStringValue;
|
|
2685
2685
|
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
2686
2686
|
var r = e.lastStringValue;
|
|
2687
|
-
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r),
|
|
2687
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), K;
|
|
2688
2688
|
}
|
|
2689
2689
|
}
|
|
2690
2690
|
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
@@ -2692,13 +2692,13 @@ G.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
2692
2692
|
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
2693
2693
|
}
|
|
2694
2694
|
return Ft;
|
|
2695
|
-
},
|
|
2696
|
-
|
|
2697
|
-
},
|
|
2698
|
-
if (e.unicodeProperties.binary.test(t)) return
|
|
2699
|
-
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return
|
|
2695
|
+
}, W.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
2696
|
+
ge(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
2697
|
+
}, W.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2698
|
+
if (e.unicodeProperties.binary.test(t)) return K;
|
|
2699
|
+
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return q;
|
|
2700
2700
|
e.raise("Invalid property name");
|
|
2701
|
-
},
|
|
2701
|
+
}, W.regexp_eatUnicodePropertyName = function(e) {
|
|
2702
2702
|
var t = 0;
|
|
2703
2703
|
for (e.lastStringValue = ""; Lt(t = e.current());) e.lastStringValue += A(t), e.advance();
|
|
2704
2704
|
return e.lastStringValue !== "";
|
|
@@ -2706,7 +2706,7 @@ G.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
2706
2706
|
function Lt(e) {
|
|
2707
2707
|
return Nt(e) || e === 95;
|
|
2708
2708
|
}
|
|
2709
|
-
|
|
2709
|
+
W.regexp_eatUnicodePropertyValue = function(e) {
|
|
2710
2710
|
var t = 0;
|
|
2711
2711
|
for (e.lastStringValue = ""; Rt(t = e.current());) e.lastStringValue += A(t), e.advance();
|
|
2712
2712
|
return e.lastStringValue !== "";
|
|
@@ -2714,17 +2714,17 @@ G.regexp_eatUnicodePropertyValue = function(e) {
|
|
|
2714
2714
|
function Rt(e) {
|
|
2715
2715
|
return Lt(e) || Ht(e);
|
|
2716
2716
|
}
|
|
2717
|
-
|
|
2717
|
+
W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
2718
2718
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
2719
|
-
},
|
|
2719
|
+
}, W.regexp_eatCharacterClass = function(e) {
|
|
2720
2720
|
if (e.eat(91)) {
|
|
2721
2721
|
var t = e.eat(94), n = this.regexp_classContents(e);
|
|
2722
|
-
return e.eat(93) || e.raise("Unterminated character class"), t && n ===
|
|
2722
|
+
return e.eat(93) || e.raise("Unterminated character class"), t && n === q && e.raise("Negated character class may contain strings"), !0;
|
|
2723
2723
|
}
|
|
2724
2724
|
return !1;
|
|
2725
|
-
},
|
|
2726
|
-
return e.current() === 93 ?
|
|
2727
|
-
},
|
|
2725
|
+
}, W.regexp_classContents = function(e) {
|
|
2726
|
+
return e.current() === 93 ? K : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), K);
|
|
2727
|
+
}, W.regexp_nonEmptyClassRanges = function(e) {
|
|
2728
2728
|
for (; this.regexp_eatClassAtom(e);) {
|
|
2729
2729
|
var t = e.lastIntValue;
|
|
2730
2730
|
if (e.eat(45) && this.regexp_eatClassAtom(e)) {
|
|
@@ -2732,7 +2732,7 @@ G.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2732
2732
|
e.switchU && (t === -1 || n === -1) && e.raise("Invalid character class"), t !== -1 && n !== -1 && t > n && e.raise("Range out of order in character class");
|
|
2733
2733
|
}
|
|
2734
2734
|
}
|
|
2735
|
-
},
|
|
2735
|
+
}, W.regexp_eatClassAtom = function(e) {
|
|
2736
2736
|
var t = e.pos;
|
|
2737
2737
|
if (e.eat(92)) {
|
|
2738
2738
|
if (this.regexp_eatClassEscape(e)) return !0;
|
|
@@ -2744,7 +2744,7 @@ G.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2744
2744
|
}
|
|
2745
2745
|
var r = e.current();
|
|
2746
2746
|
return r === 93 ? !1 : (e.lastIntValue = r, e.advance(), !0);
|
|
2747
|
-
},
|
|
2747
|
+
}, W.regexp_eatClassEscape = function(e) {
|
|
2748
2748
|
var t = e.pos;
|
|
2749
2749
|
if (e.eat(98)) return e.lastIntValue = 8, !0;
|
|
2750
2750
|
if (e.switchU && e.eat(45)) return e.lastIntValue = 45, !0;
|
|
@@ -2753,13 +2753,13 @@ G.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2753
2753
|
e.pos = t;
|
|
2754
2754
|
}
|
|
2755
2755
|
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
2756
|
-
},
|
|
2757
|
-
var t =
|
|
2756
|
+
}, W.regexp_classSetExpression = function(e) {
|
|
2757
|
+
var t = K, n;
|
|
2758
2758
|
if (!this.regexp_eatClassSetRange(e)) if (n = this.regexp_eatClassSetOperand(e)) {
|
|
2759
|
-
n ===
|
|
2759
|
+
n === q && (t = q);
|
|
2760
2760
|
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
2761
2761
|
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
2762
|
-
n !==
|
|
2762
|
+
n !== q && (t = K);
|
|
2763
2763
|
continue;
|
|
2764
2764
|
}
|
|
2765
2765
|
e.raise("Invalid character in character class");
|
|
@@ -2770,9 +2770,9 @@ G.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2770
2770
|
} else e.raise("Invalid character in character class");
|
|
2771
2771
|
for (;;) if (!this.regexp_eatClassSetRange(e)) {
|
|
2772
2772
|
if (n = this.regexp_eatClassSetOperand(e), !n) return t;
|
|
2773
|
-
n ===
|
|
2773
|
+
n === q && (t = q);
|
|
2774
2774
|
}
|
|
2775
|
-
},
|
|
2775
|
+
}, W.regexp_eatClassSetRange = function(e) {
|
|
2776
2776
|
var t = e.pos;
|
|
2777
2777
|
if (this.regexp_eatClassSetCharacter(e)) {
|
|
2778
2778
|
var n = e.lastIntValue;
|
|
@@ -2783,13 +2783,13 @@ G.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2783
2783
|
e.pos = t;
|
|
2784
2784
|
}
|
|
2785
2785
|
return !1;
|
|
2786
|
-
},
|
|
2787
|
-
return this.regexp_eatClassSetCharacter(e) ?
|
|
2788
|
-
},
|
|
2786
|
+
}, W.regexp_eatClassSetOperand = function(e) {
|
|
2787
|
+
return this.regexp_eatClassSetCharacter(e) ? K : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
2788
|
+
}, W.regexp_eatNestedClass = function(e) {
|
|
2789
2789
|
var t = e.pos;
|
|
2790
2790
|
if (e.eat(91)) {
|
|
2791
2791
|
var n = e.eat(94), r = this.regexp_classContents(e);
|
|
2792
|
-
if (e.eat(93)) return n && r ===
|
|
2792
|
+
if (e.eat(93)) return n && r === q && e.raise("Negated character class may contain strings"), r;
|
|
2793
2793
|
e.pos = t;
|
|
2794
2794
|
}
|
|
2795
2795
|
if (e.eat(92)) {
|
|
@@ -2798,7 +2798,7 @@ G.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2798
2798
|
e.pos = t;
|
|
2799
2799
|
}
|
|
2800
2800
|
return null;
|
|
2801
|
-
},
|
|
2801
|
+
}, W.regexp_eatClassStringDisjunction = function(e) {
|
|
2802
2802
|
var t = e.pos;
|
|
2803
2803
|
if (e.eatChars([92, 113])) {
|
|
2804
2804
|
if (e.eat(123)) {
|
|
@@ -2808,13 +2808,13 @@ G.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2808
2808
|
e.pos = t;
|
|
2809
2809
|
}
|
|
2810
2810
|
return null;
|
|
2811
|
-
},
|
|
2812
|
-
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) ===
|
|
2811
|
+
}, W.regexp_classStringDisjunctionContents = function(e) {
|
|
2812
|
+
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) === q && (t = q);
|
|
2813
2813
|
return t;
|
|
2814
|
-
},
|
|
2814
|
+
}, W.regexp_classString = function(e) {
|
|
2815
2815
|
for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
|
|
2816
|
-
return t === 1 ?
|
|
2817
|
-
},
|
|
2816
|
+
return t === 1 ? K : q;
|
|
2817
|
+
}, W.regexp_eatClassSetCharacter = function(e) {
|
|
2818
2818
|
var t = e.pos;
|
|
2819
2819
|
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);
|
|
2820
2820
|
var n = e.current();
|
|
@@ -2826,24 +2826,24 @@ function zt(e) {
|
|
|
2826
2826
|
function Bt(e) {
|
|
2827
2827
|
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
2828
2828
|
}
|
|
2829
|
-
|
|
2829
|
+
W.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
2830
2830
|
var t = e.current();
|
|
2831
2831
|
return Vt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2832
2832
|
};
|
|
2833
2833
|
function Vt(e) {
|
|
2834
2834
|
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
2835
2835
|
}
|
|
2836
|
-
|
|
2836
|
+
W.regexp_eatClassControlLetter = function(e) {
|
|
2837
2837
|
var t = e.current();
|
|
2838
2838
|
return Ht(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2839
|
-
},
|
|
2839
|
+
}, W.regexp_eatHexEscapeSequence = function(e) {
|
|
2840
2840
|
var t = e.pos;
|
|
2841
2841
|
if (e.eat(120)) {
|
|
2842
2842
|
if (this.regexp_eatFixedHexDigits(e, 2)) return !0;
|
|
2843
2843
|
e.switchU && e.raise("Invalid escape"), e.pos = t;
|
|
2844
2844
|
}
|
|
2845
2845
|
return !1;
|
|
2846
|
-
},
|
|
2846
|
+
}, W.regexp_eatDecimalDigits = function(e) {
|
|
2847
2847
|
var t = e.pos, n = 0;
|
|
2848
2848
|
for (e.lastIntValue = 0; Ht(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
2849
2849
|
return e.pos !== t;
|
|
@@ -2851,7 +2851,7 @@ G.regexp_eatClassControlLetter = function(e) {
|
|
|
2851
2851
|
function Ht(e) {
|
|
2852
2852
|
return e >= 48 && e <= 57;
|
|
2853
2853
|
}
|
|
2854
|
-
|
|
2854
|
+
W.regexp_eatHexDigits = function(e) {
|
|
2855
2855
|
var t = e.pos, n = 0;
|
|
2856
2856
|
for (e.lastIntValue = 0; Ut(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + Wt(n), e.advance();
|
|
2857
2857
|
return e.pos !== t;
|
|
@@ -2862,7 +2862,7 @@ function Ut(e) {
|
|
|
2862
2862
|
function Wt(e) {
|
|
2863
2863
|
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
2864
2864
|
}
|
|
2865
|
-
|
|
2865
|
+
W.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
2866
2866
|
if (this.regexp_eatOctalDigit(e)) {
|
|
2867
2867
|
var t = e.lastIntValue;
|
|
2868
2868
|
if (this.regexp_eatOctalDigit(e)) {
|
|
@@ -2872,14 +2872,14 @@ G.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
2872
2872
|
return !0;
|
|
2873
2873
|
}
|
|
2874
2874
|
return !1;
|
|
2875
|
-
},
|
|
2875
|
+
}, W.regexp_eatOctalDigit = function(e) {
|
|
2876
2876
|
var t = e.current();
|
|
2877
2877
|
return Gt(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
2878
2878
|
};
|
|
2879
2879
|
function Gt(e) {
|
|
2880
2880
|
return e >= 48 && e <= 55;
|
|
2881
2881
|
}
|
|
2882
|
-
|
|
2882
|
+
W.regexp_eatFixedHexDigits = function(e, t) {
|
|
2883
2883
|
var n = e.pos;
|
|
2884
2884
|
e.lastIntValue = 0;
|
|
2885
2885
|
for (var r = 0; r < t; ++r) {
|
|
@@ -2890,43 +2890,43 @@ G.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
2890
2890
|
return !0;
|
|
2891
2891
|
};
|
|
2892
2892
|
var Kt = function(e) {
|
|
2893
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
2894
|
-
},
|
|
2895
|
-
|
|
2893
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new xe(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2894
|
+
}, J = F.prototype;
|
|
2895
|
+
J.next = function(e) {
|
|
2896
2896
|
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Kt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
2897
|
-
},
|
|
2897
|
+
}, J.getToken = function() {
|
|
2898
2898
|
return this.next(), new Kt(this);
|
|
2899
|
-
}, typeof Symbol < "u" && (
|
|
2899
|
+
}, typeof Symbol < "u" && (J[Symbol.iterator] = function() {
|
|
2900
2900
|
var e = this;
|
|
2901
2901
|
return { next: function() {
|
|
2902
2902
|
var t = e.getToken();
|
|
2903
2903
|
return {
|
|
2904
|
-
done: t.type ===
|
|
2904
|
+
done: t.type === E.eof,
|
|
2905
2905
|
value: t
|
|
2906
2906
|
};
|
|
2907
2907
|
} };
|
|
2908
|
-
}),
|
|
2908
|
+
}), J.nextToken = function() {
|
|
2909
2909
|
var e = this.curContext();
|
|
2910
|
-
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(
|
|
2910
|
+
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(E.eof);
|
|
2911
2911
|
if (e.override) return e.override(this);
|
|
2912
2912
|
this.readToken(this.fullCharCodeAtPos());
|
|
2913
|
-
},
|
|
2914
|
-
return
|
|
2915
|
-
},
|
|
2913
|
+
}, J.readToken = function(e) {
|
|
2914
|
+
return y(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
2915
|
+
}, J.fullCharCodeAt = function(e) {
|
|
2916
2916
|
var t = this.input.charCodeAt(e);
|
|
2917
2917
|
if (t <= 55295 || t >= 56320) return t;
|
|
2918
2918
|
var n = this.input.charCodeAt(e + 1);
|
|
2919
2919
|
return n <= 56319 || n >= 57344 ? t : (t << 10) + n - 56613888;
|
|
2920
|
-
},
|
|
2920
|
+
}, J.fullCharCodeAtPos = function() {
|
|
2921
2921
|
return this.fullCharCodeAt(this.pos);
|
|
2922
|
-
},
|
|
2922
|
+
}, J.skipBlockComment = function() {
|
|
2923
2923
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
2924
|
-
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 =
|
|
2924
|
+
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 = de(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
2925
2925
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
2926
|
-
},
|
|
2927
|
-
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !
|
|
2926
|
+
}, J.skipLineComment = function(e) {
|
|
2927
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !ue(r);) r = this.input.charCodeAt(++this.pos);
|
|
2928
2928
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
2929
|
-
},
|
|
2929
|
+
}, J.skipSpace = function() {
|
|
2930
2930
|
loop: for (; this.pos < this.input.length;) {
|
|
2931
2931
|
var e = this.input.charCodeAt(this.pos);
|
|
2932
2932
|
switch (e) {
|
|
@@ -2951,69 +2951,69 @@ Y.next = function(e) {
|
|
|
2951
2951
|
default: break loop;
|
|
2952
2952
|
}
|
|
2953
2953
|
break;
|
|
2954
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
2954
|
+
default: if (e > 8 && e < 14 || e >= 5760 && fe.test(String.fromCharCode(e))) ++this.pos;
|
|
2955
2955
|
else break loop;
|
|
2956
2956
|
}
|
|
2957
2957
|
}
|
|
2958
|
-
},
|
|
2958
|
+
}, J.finishToken = function(e, t) {
|
|
2959
2959
|
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
2960
2960
|
var n = this.type;
|
|
2961
2961
|
this.type = e, this.value = t, this.updateContext(n);
|
|
2962
|
-
},
|
|
2962
|
+
}, J.readToken_dot = function() {
|
|
2963
2963
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2964
2964
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
2965
2965
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
2966
|
-
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(
|
|
2967
|
-
},
|
|
2966
|
+
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(E.ellipsis)) : (++this.pos, this.finishToken(E.dot));
|
|
2967
|
+
}, J.readToken_slash = function() {
|
|
2968
2968
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2969
|
-
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(
|
|
2970
|
-
},
|
|
2971
|
-
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ?
|
|
2972
|
-
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r =
|
|
2973
|
-
},
|
|
2969
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.slash, 1);
|
|
2970
|
+
}, J.readToken_mult_modulo_exp = function(e) {
|
|
2971
|
+
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? E.star : E.modulo;
|
|
2972
|
+
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = E.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(E.assign, n + 1) : this.finishOp(r, n);
|
|
2973
|
+
}, J.readToken_pipe_amp = function(e) {
|
|
2974
2974
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2975
|
-
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
2976
|
-
},
|
|
2977
|
-
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(
|
|
2978
|
-
},
|
|
2975
|
+
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(E.assign, 3) : this.finishOp(e === 124 ? E.logicalOR : E.logicalAND, 2) : t === 61 ? this.finishOp(E.assign, 2) : this.finishOp(e === 124 ? E.bitwiseOR : E.bitwiseAND, 1);
|
|
2976
|
+
}, J.readToken_caret = function() {
|
|
2977
|
+
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.bitwiseXOR, 1);
|
|
2978
|
+
}, J.readToken_plus_min = function(e) {
|
|
2979
2979
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2980
|
-
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 ||
|
|
2981
|
-
},
|
|
2980
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || D.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(E.incDec, 2) : t === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.plusMin, 1);
|
|
2981
|
+
}, J.readToken_lt_gt = function(e) {
|
|
2982
2982
|
var t = this.input.charCodeAt(this.pos + 1), n = 1;
|
|
2983
|
-
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(
|
|
2984
|
-
},
|
|
2983
|
+
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(E.assign, n + 1) : this.finishOp(E.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(E.relational, n));
|
|
2984
|
+
}, J.readToken_eq_excl = function(e) {
|
|
2985
2985
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2986
|
-
return t === 61 ? this.finishOp(
|
|
2987
|
-
},
|
|
2986
|
+
return t === 61 ? this.finishOp(E.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(E.arrow)) : this.finishOp(e === 61 ? E.eq : E.prefix, 1);
|
|
2987
|
+
}, J.readToken_question = function() {
|
|
2988
2988
|
var e = this.options.ecmaVersion;
|
|
2989
2989
|
if (e >= 11) {
|
|
2990
2990
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2991
2991
|
if (t === 46) {
|
|
2992
2992
|
var n = this.input.charCodeAt(this.pos + 2);
|
|
2993
|
-
if (n < 48 || n > 57) return this.finishOp(
|
|
2993
|
+
if (n < 48 || n > 57) return this.finishOp(E.questionDot, 2);
|
|
2994
2994
|
}
|
|
2995
|
-
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
2995
|
+
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(E.assign, 3) : this.finishOp(E.coalesce, 2);
|
|
2996
2996
|
}
|
|
2997
|
-
return this.finishOp(
|
|
2998
|
-
},
|
|
2997
|
+
return this.finishOp(E.question, 1);
|
|
2998
|
+
}, J.readToken_numberSign = function() {
|
|
2999
2999
|
var e = this.options.ecmaVersion, t = 35;
|
|
3000
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(),
|
|
3000
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), y(t, !0) || t === 92)) return this.finishToken(E.privateId, this.readWord1());
|
|
3001
3001
|
this.raise(this.pos, "Unexpected character '" + A(t) + "'");
|
|
3002
|
-
},
|
|
3002
|
+
}, J.getTokenFromCode = function(e) {
|
|
3003
3003
|
switch (e) {
|
|
3004
3004
|
case 46: return this.readToken_dot();
|
|
3005
|
-
case 40: return ++this.pos, this.finishToken(
|
|
3006
|
-
case 41: return ++this.pos, this.finishToken(
|
|
3007
|
-
case 59: return ++this.pos, this.finishToken(
|
|
3008
|
-
case 44: return ++this.pos, this.finishToken(
|
|
3009
|
-
case 91: return ++this.pos, this.finishToken(
|
|
3010
|
-
case 93: return ++this.pos, this.finishToken(
|
|
3011
|
-
case 123: return ++this.pos, this.finishToken(
|
|
3012
|
-
case 125: return ++this.pos, this.finishToken(
|
|
3013
|
-
case 58: return ++this.pos, this.finishToken(
|
|
3005
|
+
case 40: return ++this.pos, this.finishToken(E.parenL);
|
|
3006
|
+
case 41: return ++this.pos, this.finishToken(E.parenR);
|
|
3007
|
+
case 59: return ++this.pos, this.finishToken(E.semi);
|
|
3008
|
+
case 44: return ++this.pos, this.finishToken(E.comma);
|
|
3009
|
+
case 91: return ++this.pos, this.finishToken(E.bracketL);
|
|
3010
|
+
case 93: return ++this.pos, this.finishToken(E.bracketR);
|
|
3011
|
+
case 123: return ++this.pos, this.finishToken(E.braceL);
|
|
3012
|
+
case 125: return ++this.pos, this.finishToken(E.braceR);
|
|
3013
|
+
case 58: return ++this.pos, this.finishToken(E.colon);
|
|
3014
3014
|
case 96:
|
|
3015
3015
|
if (this.options.ecmaVersion < 6) break;
|
|
3016
|
-
return ++this.pos, this.finishToken(
|
|
3016
|
+
return ++this.pos, this.finishToken(E.backQuote);
|
|
3017
3017
|
case 48:
|
|
3018
3018
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3019
3019
|
if (t === 120 || t === 88) return this.readRadixNumber(16);
|
|
@@ -3045,18 +3045,18 @@ Y.next = function(e) {
|
|
|
3045
3045
|
case 61:
|
|
3046
3046
|
case 33: return this.readToken_eq_excl(e);
|
|
3047
3047
|
case 63: return this.readToken_question();
|
|
3048
|
-
case 126: return this.finishOp(
|
|
3048
|
+
case 126: return this.finishOp(E.prefix, 1);
|
|
3049
3049
|
case 35: return this.readToken_numberSign();
|
|
3050
3050
|
}
|
|
3051
3051
|
this.raise(this.pos, "Unexpected character '" + A(e) + "'");
|
|
3052
|
-
},
|
|
3052
|
+
}, J.finishOp = function(e, t) {
|
|
3053
3053
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
3054
3054
|
return this.pos += t, this.finishToken(e, n);
|
|
3055
|
-
},
|
|
3055
|
+
}, J.readRegexp = function() {
|
|
3056
3056
|
for (var e, t, n = this.pos;;) {
|
|
3057
3057
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
3058
3058
|
var r = this.input.charAt(this.pos);
|
|
3059
|
-
if (
|
|
3059
|
+
if (D.test(r) && this.raise(n, "Unterminated regular expression"), e) e = !1;
|
|
3060
3060
|
else {
|
|
3061
3061
|
if (r === "[") t = !0;
|
|
3062
3062
|
else if (r === "]" && t) t = !1;
|
|
@@ -3069,18 +3069,18 @@ Y.next = function(e) {
|
|
|
3069
3069
|
++this.pos;
|
|
3070
3070
|
var a = this.pos, o = this.readWord1();
|
|
3071
3071
|
this.containsEsc && this.unexpected(a);
|
|
3072
|
-
var s = this.regexpState ||= new
|
|
3072
|
+
var s = this.regexpState ||= new G(this);
|
|
3073
3073
|
s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
|
|
3074
3074
|
var c = null;
|
|
3075
3075
|
try {
|
|
3076
3076
|
c = new RegExp(i, o);
|
|
3077
3077
|
} catch {}
|
|
3078
|
-
return this.finishToken(
|
|
3078
|
+
return this.finishToken(E.regexp, {
|
|
3079
3079
|
pattern: i,
|
|
3080
3080
|
flags: o,
|
|
3081
3081
|
value: c
|
|
3082
3082
|
});
|
|
3083
|
-
},
|
|
3083
|
+
}, J.readInt = function(e, t, n) {
|
|
3084
3084
|
for (var r = this.options.ecmaVersion >= 12 && t === void 0, i = n && this.input.charCodeAt(this.pos) === 48, a = this.pos, o = 0, s = 0, c = 0, l = t ?? Infinity; c < l; ++c, ++this.pos) {
|
|
3085
3085
|
var u = this.input.charCodeAt(this.pos), d = void 0;
|
|
3086
3086
|
if (r && u === 95) {
|
|
@@ -3098,12 +3098,12 @@ function qt(e, t) {
|
|
|
3098
3098
|
function Jt(e) {
|
|
3099
3099
|
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
3100
3100
|
}
|
|
3101
|
-
|
|
3101
|
+
J.readRadixNumber = function(e) {
|
|
3102
3102
|
var t = this.pos;
|
|
3103
3103
|
this.pos += 2;
|
|
3104
3104
|
var n = this.readInt(e);
|
|
3105
|
-
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Jt(this.input.slice(t, this.pos)), ++this.pos) :
|
|
3106
|
-
},
|
|
3105
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Jt(this.input.slice(t, this.pos)), ++this.pos) : y(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(E.num, n);
|
|
3106
|
+
}, J.readNumber = function(e) {
|
|
3107
3107
|
var t = this.pos;
|
|
3108
3108
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
3109
3109
|
var n = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
|
|
@@ -3111,12 +3111,12 @@ Y.readRadixNumber = function(e) {
|
|
|
3111
3111
|
var r = this.input.charCodeAt(this.pos);
|
|
3112
3112
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3113
3113
|
var i = Jt(this.input.slice(t, this.pos));
|
|
3114
|
-
return ++this.pos,
|
|
3114
|
+
return ++this.pos, y(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(E.num, i);
|
|
3115
3115
|
}
|
|
3116
|
-
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")),
|
|
3116
|
+
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")), y(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3117
3117
|
var a = qt(this.input.slice(t, this.pos), n);
|
|
3118
|
-
return this.finishToken(
|
|
3119
|
-
},
|
|
3118
|
+
return this.finishToken(E.num, a);
|
|
3119
|
+
}, J.readCodePoint = function() {
|
|
3120
3120
|
var e = this.input.charCodeAt(this.pos), t;
|
|
3121
3121
|
if (e === 123) {
|
|
3122
3122
|
this.options.ecmaVersion < 6 && this.unexpected();
|
|
@@ -3124,17 +3124,17 @@ Y.readRadixNumber = function(e) {
|
|
|
3124
3124
|
t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(n, "Code point out of bounds");
|
|
3125
3125
|
} else t = this.readHexChar(4);
|
|
3126
3126
|
return t;
|
|
3127
|
-
},
|
|
3127
|
+
}, J.readString = function(e) {
|
|
3128
3128
|
for (var t = "", n = ++this.pos;;) {
|
|
3129
3129
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3130
3130
|
var r = this.input.charCodeAt(this.pos);
|
|
3131
3131
|
if (r === e) break;
|
|
3132
|
-
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)) : (
|
|
3132
|
+
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)) : (ue(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
3133
3133
|
}
|
|
3134
|
-
return t += this.input.slice(n, this.pos++), this.finishToken(
|
|
3134
|
+
return t += this.input.slice(n, this.pos++), this.finishToken(E.string, t);
|
|
3135
3135
|
};
|
|
3136
3136
|
var Yt = {};
|
|
3137
|
-
|
|
3137
|
+
J.tryReadTemplateToken = function() {
|
|
3138
3138
|
this.inTemplateElement = !0;
|
|
3139
3139
|
try {
|
|
3140
3140
|
this.readTmplToken();
|
|
@@ -3143,16 +3143,16 @@ Y.tryReadTemplateToken = function() {
|
|
|
3143
3143
|
else throw e;
|
|
3144
3144
|
}
|
|
3145
3145
|
this.inTemplateElement = !1;
|
|
3146
|
-
},
|
|
3146
|
+
}, J.invalidStringToken = function(e, t) {
|
|
3147
3147
|
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw Yt;
|
|
3148
3148
|
this.raise(e, t);
|
|
3149
|
-
},
|
|
3149
|
+
}, J.readTmplToken = function() {
|
|
3150
3150
|
for (var e = "", t = this.pos;;) {
|
|
3151
3151
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
3152
3152
|
var n = this.input.charCodeAt(this.pos);
|
|
3153
|
-
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type ===
|
|
3153
|
+
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === E.template || this.type === E.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(E.dollarBraceL)) : (++this.pos, this.finishToken(E.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(E.template, e));
|
|
3154
3154
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
3155
|
-
else if (
|
|
3155
|
+
else if (ue(n)) {
|
|
3156
3156
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
3157
3157
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3158
3158
|
case 10:
|
|
@@ -3165,13 +3165,13 @@ Y.tryReadTemplateToken = function() {
|
|
|
3165
3165
|
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
3166
3166
|
} else ++this.pos;
|
|
3167
3167
|
}
|
|
3168
|
-
},
|
|
3168
|
+
}, J.readInvalidTemplateToken = function() {
|
|
3169
3169
|
for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
|
|
3170
3170
|
case "\\":
|
|
3171
3171
|
++this.pos;
|
|
3172
3172
|
break;
|
|
3173
3173
|
case "$": if (this.input[this.pos + 1] !== "{") break;
|
|
3174
|
-
case "`": return this.finishToken(
|
|
3174
|
+
case "`": return this.finishToken(E.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
3175
3175
|
case "\r": this.input[this.pos + 1] === "\n" && ++this.pos;
|
|
3176
3176
|
case "\n":
|
|
3177
3177
|
case "\u2028":
|
|
@@ -3180,7 +3180,7 @@ Y.tryReadTemplateToken = function() {
|
|
|
3180
3180
|
break;
|
|
3181
3181
|
}
|
|
3182
3182
|
this.raise(this.start, "Unterminated template");
|
|
3183
|
-
},
|
|
3183
|
+
}, J.readEscapedChar = function(e) {
|
|
3184
3184
|
var t = this.input.charCodeAt(++this.pos);
|
|
3185
3185
|
switch (++this.pos, t) {
|
|
3186
3186
|
case 110: return "\n";
|
|
@@ -3203,144 +3203,144 @@ Y.tryReadTemplateToken = function() {
|
|
|
3203
3203
|
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
3204
3204
|
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);
|
|
3205
3205
|
}
|
|
3206
|
-
return
|
|
3206
|
+
return ue(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3207
3207
|
}
|
|
3208
|
-
},
|
|
3208
|
+
}, J.readHexChar = function(e) {
|
|
3209
3209
|
var t = this.pos, n = this.readInt(16, e);
|
|
3210
3210
|
return n === null && this.invalidStringToken(t, "Bad character escape sequence"), n;
|
|
3211
|
-
},
|
|
3211
|
+
}, J.readWord1 = function() {
|
|
3212
3212
|
this.containsEsc = !1;
|
|
3213
3213
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3214
3214
|
var i = this.fullCharCodeAtPos();
|
|
3215
|
-
if (
|
|
3215
|
+
if (b(i, r)) this.pos += i <= 65535 ? 1 : 2;
|
|
3216
3216
|
else if (i === 92) {
|
|
3217
3217
|
this.containsEsc = !0, e += this.input.slice(n, this.pos);
|
|
3218
3218
|
var a = this.pos;
|
|
3219
3219
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3220
3220
|
var o = this.readCodePoint();
|
|
3221
|
-
(t ?
|
|
3221
|
+
(t ? y : b)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += A(o), n = this.pos;
|
|
3222
3222
|
} else break;
|
|
3223
3223
|
t = !1;
|
|
3224
3224
|
}
|
|
3225
3225
|
return e + this.input.slice(n, this.pos);
|
|
3226
|
-
},
|
|
3227
|
-
var e = this.readWord1(), t =
|
|
3228
|
-
return this.keywords.test(e) && (t =
|
|
3226
|
+
}, J.readWord = function() {
|
|
3227
|
+
var e = this.readWord1(), t = E.name;
|
|
3228
|
+
return this.keywords.test(e) && (t = ce[e]), this.finishToken(t, e);
|
|
3229
3229
|
}, F.acorn = {
|
|
3230
3230
|
Parser: F,
|
|
3231
3231
|
version: "8.17.0",
|
|
3232
|
-
defaultOptions:
|
|
3233
|
-
Position:
|
|
3234
|
-
SourceLocation:
|
|
3235
|
-
getLineInfo:
|
|
3232
|
+
defaultOptions: Ce,
|
|
3233
|
+
Position: be,
|
|
3234
|
+
SourceLocation: xe,
|
|
3235
|
+
getLineInfo: Se,
|
|
3236
3236
|
Node: it,
|
|
3237
|
-
TokenType:
|
|
3238
|
-
tokTypes:
|
|
3239
|
-
keywordTypes:
|
|
3237
|
+
TokenType: x,
|
|
3238
|
+
tokTypes: E,
|
|
3239
|
+
keywordTypes: ce,
|
|
3240
3240
|
TokContext: B,
|
|
3241
3241
|
tokContexts: V,
|
|
3242
|
-
isIdentifierChar:
|
|
3243
|
-
isIdentifierStart:
|
|
3242
|
+
isIdentifierChar: b,
|
|
3243
|
+
isIdentifierStart: y,
|
|
3244
3244
|
Token: Kt,
|
|
3245
|
-
isNewLine:
|
|
3246
|
-
lineBreak:
|
|
3247
|
-
lineBreakG:
|
|
3248
|
-
nonASCIIwhitespace:
|
|
3245
|
+
isNewLine: ue,
|
|
3246
|
+
lineBreak: D,
|
|
3247
|
+
lineBreakG: le,
|
|
3248
|
+
nonASCIIwhitespace: fe
|
|
3249
3249
|
};
|
|
3250
3250
|
//#endregion
|
|
3251
3251
|
//#region ../../node_modules/.pnpm/acorn-walk@8.3.5/node_modules/acorn-walk/dist/walk.mjs
|
|
3252
3252
|
function Xt(e, t, n) {
|
|
3253
3253
|
n(e, t);
|
|
3254
3254
|
}
|
|
3255
|
-
function
|
|
3256
|
-
var
|
|
3257
|
-
|
|
3255
|
+
function Y(e, t, n) {}
|
|
3256
|
+
var X = {};
|
|
3257
|
+
X.Program = X.BlockStatement = X.StaticBlock = function(e, t, n) {
|
|
3258
3258
|
for (var r = 0, i = e.body; r < i.length; r += 1) {
|
|
3259
3259
|
var a = i[r];
|
|
3260
3260
|
n(a, t, "Statement");
|
|
3261
3261
|
}
|
|
3262
|
-
},
|
|
3262
|
+
}, X.Statement = Xt, X.EmptyStatement = Y, X.ExpressionStatement = X.ParenthesizedExpression = X.ChainExpression = function(e, t, n) {
|
|
3263
3263
|
return n(e.expression, t, "Expression");
|
|
3264
|
-
},
|
|
3264
|
+
}, X.IfStatement = function(e, t, n) {
|
|
3265
3265
|
n(e.test, t, "Expression"), n(e.consequent, t, "Statement"), e.alternate && n(e.alternate, t, "Statement");
|
|
3266
|
-
},
|
|
3266
|
+
}, X.LabeledStatement = function(e, t, n) {
|
|
3267
3267
|
return n(e.body, t, "Statement");
|
|
3268
|
-
},
|
|
3268
|
+
}, X.BreakStatement = X.ContinueStatement = Y, X.WithStatement = function(e, t, n) {
|
|
3269
3269
|
n(e.object, t, "Expression"), n(e.body, t, "Statement");
|
|
3270
|
-
},
|
|
3270
|
+
}, X.SwitchStatement = function(e, t, n) {
|
|
3271
3271
|
n(e.discriminant, t, "Expression");
|
|
3272
3272
|
for (var r = 0, i = e.cases; r < i.length; r += 1) {
|
|
3273
3273
|
var a = i[r];
|
|
3274
3274
|
n(a, t);
|
|
3275
3275
|
}
|
|
3276
|
-
},
|
|
3276
|
+
}, X.SwitchCase = function(e, t, n) {
|
|
3277
3277
|
e.test && n(e.test, t, "Expression");
|
|
3278
3278
|
for (var r = 0, i = e.consequent; r < i.length; r += 1) {
|
|
3279
3279
|
var a = i[r];
|
|
3280
3280
|
n(a, t, "Statement");
|
|
3281
3281
|
}
|
|
3282
|
-
},
|
|
3282
|
+
}, X.ReturnStatement = X.YieldExpression = X.AwaitExpression = function(e, t, n) {
|
|
3283
3283
|
e.argument && n(e.argument, t, "Expression");
|
|
3284
|
-
},
|
|
3284
|
+
}, X.ThrowStatement = X.SpreadElement = function(e, t, n) {
|
|
3285
3285
|
return n(e.argument, t, "Expression");
|
|
3286
|
-
},
|
|
3286
|
+
}, X.TryStatement = function(e, t, n) {
|
|
3287
3287
|
n(e.block, t, "Statement"), e.handler && n(e.handler, t), e.finalizer && n(e.finalizer, t, "Statement");
|
|
3288
|
-
},
|
|
3288
|
+
}, X.CatchClause = function(e, t, n) {
|
|
3289
3289
|
e.param && n(e.param, t, "Pattern"), n(e.body, t, "Statement");
|
|
3290
|
-
},
|
|
3290
|
+
}, X.WhileStatement = X.DoWhileStatement = function(e, t, n) {
|
|
3291
3291
|
n(e.test, t, "Expression"), n(e.body, t, "Statement");
|
|
3292
|
-
},
|
|
3292
|
+
}, X.ForStatement = function(e, t, n) {
|
|
3293
3293
|
e.init && n(e.init, t, "ForInit"), e.test && n(e.test, t, "Expression"), e.update && n(e.update, t, "Expression"), n(e.body, t, "Statement");
|
|
3294
|
-
},
|
|
3294
|
+
}, X.ForInStatement = X.ForOfStatement = function(e, t, n) {
|
|
3295
3295
|
n(e.left, t, "ForInit"), n(e.right, t, "Expression"), n(e.body, t, "Statement");
|
|
3296
|
-
},
|
|
3296
|
+
}, X.ForInit = function(e, t, n) {
|
|
3297
3297
|
e.type === "VariableDeclaration" ? n(e, t) : n(e, t, "Expression");
|
|
3298
|
-
},
|
|
3298
|
+
}, X.DebuggerStatement = Y, X.FunctionDeclaration = function(e, t, n) {
|
|
3299
3299
|
return n(e, t, "Function");
|
|
3300
|
-
},
|
|
3300
|
+
}, X.VariableDeclaration = function(e, t, n) {
|
|
3301
3301
|
for (var r = 0, i = e.declarations; r < i.length; r += 1) {
|
|
3302
3302
|
var a = i[r];
|
|
3303
3303
|
n(a, t);
|
|
3304
3304
|
}
|
|
3305
|
-
},
|
|
3305
|
+
}, X.VariableDeclarator = function(e, t, n) {
|
|
3306
3306
|
n(e.id, t, "Pattern"), e.init && n(e.init, t, "Expression");
|
|
3307
|
-
},
|
|
3307
|
+
}, X.Function = function(e, t, n) {
|
|
3308
3308
|
e.id && n(e.id, t, "Pattern");
|
|
3309
3309
|
for (var r = 0, i = e.params; r < i.length; r += 1) {
|
|
3310
3310
|
var a = i[r];
|
|
3311
3311
|
n(a, t, "Pattern");
|
|
3312
3312
|
}
|
|
3313
3313
|
n(e.body, t, e.expression ? "Expression" : "Statement");
|
|
3314
|
-
},
|
|
3314
|
+
}, X.Pattern = function(e, t, n) {
|
|
3315
3315
|
e.type === "Identifier" ? n(e, t, "VariablePattern") : e.type === "MemberExpression" ? n(e, t, "MemberPattern") : n(e, t);
|
|
3316
|
-
},
|
|
3316
|
+
}, X.VariablePattern = Y, X.MemberPattern = Xt, X.RestElement = function(e, t, n) {
|
|
3317
3317
|
return n(e.argument, t, "Pattern");
|
|
3318
|
-
},
|
|
3318
|
+
}, X.ArrayPattern = function(e, t, n) {
|
|
3319
3319
|
for (var r = 0, i = e.elements; r < i.length; r += 1) {
|
|
3320
3320
|
var a = i[r];
|
|
3321
3321
|
a && n(a, t, "Pattern");
|
|
3322
3322
|
}
|
|
3323
|
-
},
|
|
3323
|
+
}, X.ObjectPattern = function(e, t, n) {
|
|
3324
3324
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
3325
3325
|
var a = i[r];
|
|
3326
3326
|
a.type === "Property" ? (a.computed && n(a.key, t, "Expression"), n(a.value, t, "Pattern")) : a.type === "RestElement" && n(a.argument, t, "Pattern");
|
|
3327
3327
|
}
|
|
3328
|
-
},
|
|
3328
|
+
}, X.Expression = Xt, X.ThisExpression = X.Super = X.MetaProperty = Y, X.ArrayExpression = function(e, t, n) {
|
|
3329
3329
|
for (var r = 0, i = e.elements; r < i.length; r += 1) {
|
|
3330
3330
|
var a = i[r];
|
|
3331
3331
|
a && n(a, t, "Expression");
|
|
3332
3332
|
}
|
|
3333
|
-
},
|
|
3333
|
+
}, X.ObjectExpression = function(e, t, n) {
|
|
3334
3334
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
3335
3335
|
var a = i[r];
|
|
3336
3336
|
n(a, t);
|
|
3337
3337
|
}
|
|
3338
|
-
},
|
|
3338
|
+
}, X.FunctionExpression = X.ArrowFunctionExpression = X.FunctionDeclaration, X.SequenceExpression = function(e, t, n) {
|
|
3339
3339
|
for (var r = 0, i = e.expressions; r < i.length; r += 1) {
|
|
3340
3340
|
var a = i[r];
|
|
3341
3341
|
n(a, t, "Expression");
|
|
3342
3342
|
}
|
|
3343
|
-
},
|
|
3343
|
+
}, X.TemplateLiteral = function(e, t, n) {
|
|
3344
3344
|
for (var r = 0, i = e.quasis; r < i.length; r += 1) {
|
|
3345
3345
|
var a = i[r];
|
|
3346
3346
|
n(a, t);
|
|
@@ -3349,34 +3349,34 @@ Z.Program = Z.BlockStatement = Z.StaticBlock = function(e, t, n) {
|
|
|
3349
3349
|
var c = s[o];
|
|
3350
3350
|
n(c, t, "Expression");
|
|
3351
3351
|
}
|
|
3352
|
-
},
|
|
3352
|
+
}, X.TemplateElement = Y, X.UnaryExpression = X.UpdateExpression = function(e, t, n) {
|
|
3353
3353
|
n(e.argument, t, "Expression");
|
|
3354
|
-
},
|
|
3354
|
+
}, X.BinaryExpression = X.LogicalExpression = function(e, t, n) {
|
|
3355
3355
|
n(e.left, t, "Expression"), n(e.right, t, "Expression");
|
|
3356
|
-
},
|
|
3356
|
+
}, X.AssignmentExpression = X.AssignmentPattern = function(e, t, n) {
|
|
3357
3357
|
n(e.left, t, "Pattern"), n(e.right, t, "Expression");
|
|
3358
|
-
},
|
|
3358
|
+
}, X.ConditionalExpression = function(e, t, n) {
|
|
3359
3359
|
n(e.test, t, "Expression"), n(e.consequent, t, "Expression"), n(e.alternate, t, "Expression");
|
|
3360
|
-
},
|
|
3360
|
+
}, X.NewExpression = X.CallExpression = function(e, t, n) {
|
|
3361
3361
|
if (n(e.callee, t, "Expression"), e.arguments) for (var r = 0, i = e.arguments; r < i.length; r += 1) {
|
|
3362
3362
|
var a = i[r];
|
|
3363
3363
|
n(a, t, "Expression");
|
|
3364
3364
|
}
|
|
3365
|
-
},
|
|
3365
|
+
}, X.MemberExpression = function(e, t, n) {
|
|
3366
3366
|
n(e.object, t, "Expression"), e.computed && n(e.property, t, "Expression");
|
|
3367
|
-
},
|
|
3367
|
+
}, X.ExportNamedDeclaration = X.ExportDefaultDeclaration = function(e, t, n) {
|
|
3368
3368
|
if (e.declaration && n(e.declaration, t, e.type === "ExportNamedDeclaration" || e.declaration.id ? "Statement" : "Expression"), e.source && n(e.source, t, "Expression"), e.attributes) for (var r = 0, i = e.attributes; r < i.length; r += 1) {
|
|
3369
3369
|
var a = i[r];
|
|
3370
3370
|
n(a, t);
|
|
3371
3371
|
}
|
|
3372
|
-
},
|
|
3372
|
+
}, X.ExportAllDeclaration = function(e, t, n) {
|
|
3373
3373
|
if (e.exported && n(e.exported, t), n(e.source, t, "Expression"), e.attributes) for (var r = 0, i = e.attributes; r < i.length; r += 1) {
|
|
3374
3374
|
var a = i[r];
|
|
3375
3375
|
n(a, t);
|
|
3376
3376
|
}
|
|
3377
|
-
},
|
|
3377
|
+
}, X.ImportAttribute = function(e, t, n) {
|
|
3378
3378
|
n(e.value, t, "Expression");
|
|
3379
|
-
},
|
|
3379
|
+
}, X.ImportDeclaration = function(e, t, n) {
|
|
3380
3380
|
for (var r = 0, i = e.specifiers; r < i.length; r += 1) {
|
|
3381
3381
|
var a = i[r];
|
|
3382
3382
|
n(a, t);
|
|
@@ -3385,25 +3385,25 @@ Z.Program = Z.BlockStatement = Z.StaticBlock = function(e, t, n) {
|
|
|
3385
3385
|
var c = s[o];
|
|
3386
3386
|
n(c, t);
|
|
3387
3387
|
}
|
|
3388
|
-
},
|
|
3388
|
+
}, X.ImportExpression = function(e, t, n) {
|
|
3389
3389
|
n(e.source, t, "Expression"), e.options && n(e.options, t, "Expression");
|
|
3390
|
-
},
|
|
3390
|
+
}, X.ImportSpecifier = X.ImportDefaultSpecifier = X.ImportNamespaceSpecifier = X.Identifier = X.PrivateIdentifier = X.Literal = Y, X.TaggedTemplateExpression = function(e, t, n) {
|
|
3391
3391
|
n(e.tag, t, "Expression"), n(e.quasi, t, "Expression");
|
|
3392
|
-
},
|
|
3392
|
+
}, X.ClassDeclaration = X.ClassExpression = function(e, t, n) {
|
|
3393
3393
|
return n(e, t, "Class");
|
|
3394
|
-
},
|
|
3394
|
+
}, X.Class = function(e, t, n) {
|
|
3395
3395
|
e.id && n(e.id, t, "Pattern"), e.superClass && n(e.superClass, t, "Expression"), n(e.body, t);
|
|
3396
|
-
},
|
|
3396
|
+
}, X.ClassBody = function(e, t, n) {
|
|
3397
3397
|
for (var r = 0, i = e.body; r < i.length; r += 1) {
|
|
3398
3398
|
var a = i[r];
|
|
3399
3399
|
n(a, t);
|
|
3400
3400
|
}
|
|
3401
|
-
},
|
|
3401
|
+
}, X.MethodDefinition = X.PropertyDefinition = X.Property = function(e, t, n) {
|
|
3402
3402
|
e.computed && n(e.key, t, "Expression"), e.value && n(e.value, t, "Expression");
|
|
3403
3403
|
};
|
|
3404
3404
|
//#endregion
|
|
3405
3405
|
//#region ../compiler/dist/index-es.js
|
|
3406
|
-
var
|
|
3406
|
+
var Z = {
|
|
3407
3407
|
Data: "Data",
|
|
3408
3408
|
TagOpen: "TagOpen",
|
|
3409
3409
|
EndTagOpen: "EndTagOpen",
|
|
@@ -3417,22 +3417,44 @@ var Q = {
|
|
|
3417
3417
|
Interpolation: "Interpolation",
|
|
3418
3418
|
RawText: "RawText",
|
|
3419
3419
|
EOF: "EOF"
|
|
3420
|
-
},
|
|
3421
|
-
return e[e.RETURN = 0] = "RETURN", e[e.CREATE_ELEMENT = 1] = "CREATE_ELEMENT", e[e.CREATE_TEXT = 2] = "CREATE_TEXT", e[e.CREATE_COMMENT = 3] = "CREATE_COMMENT", e[e.APPEND_CHILD = 4] = "APPEND_CHILD", e[e.SET_ATTR = 5] = "SET_ATTR", e[e.CREATE_FRAGMENT = 6] = "CREATE_FRAGMENT", e[e.INTERPOLATE_TEXT = 7] = "INTERPOLATE_TEXT", e[e.EXEC_SCRIPT = 12] = "EXEC_SCRIPT", e[e.REACTIVE_IF = 13] = "REACTIVE_IF", e[e.REACTIVE_FOR = 14] = "REACTIVE_FOR", e[e.MOUNT_COMPONENT = 15] = "MOUNT_COMPONENT", e;
|
|
3420
|
+
}, Q = /* @__PURE__ */ function(e) {
|
|
3421
|
+
return e[e.RETURN = 0] = "RETURN", e[e.CREATE_ELEMENT = 1] = "CREATE_ELEMENT", e[e.CREATE_TEXT = 2] = "CREATE_TEXT", e[e.CREATE_COMMENT = 3] = "CREATE_COMMENT", e[e.APPEND_CHILD = 4] = "APPEND_CHILD", e[e.SET_ATTR = 5] = "SET_ATTR", e[e.CREATE_FRAGMENT = 6] = "CREATE_FRAGMENT", e[e.INTERPOLATE_TEXT = 7] = "INTERPOLATE_TEXT", e[e.EXEC_SCRIPT = 12] = "EXEC_SCRIPT", e[e.REACTIVE_IF = 13] = "REACTIVE_IF", e[e.REACTIVE_FOR = 14] = "REACTIVE_FOR", e[e.MOUNT_COMPONENT = 15] = "MOUNT_COMPONENT", e[e.REACTIVE_ASYNC = 16] = "REACTIVE_ASYNC", e[e.REACTIVE_SWITCH = 17] = "REACTIVE_SWITCH", e;
|
|
3422
3422
|
}({});
|
|
3423
|
-
|
|
3423
|
+
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;
|
|
3424
3424
|
//#endregion
|
|
3425
3425
|
//#region src/index.ts
|
|
3426
3426
|
function Zt(e) {
|
|
3427
3427
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3428
3428
|
}
|
|
3429
|
-
var Qt =
|
|
3429
|
+
var Qt = /* @__PURE__ */ new Set([
|
|
3430
|
+
"__proto__",
|
|
3431
|
+
"constructor",
|
|
3432
|
+
"prototype",
|
|
3433
|
+
"__drift_mark_dirty__"
|
|
3434
|
+
]);
|
|
3435
|
+
function $t(e, t, n) {
|
|
3436
|
+
!e || typeof e != "object" || Qt.has(t) || (e[t] = n);
|
|
3437
|
+
}
|
|
3438
|
+
function en(e, t, n, i, a) {
|
|
3439
|
+
if (i) {
|
|
3440
|
+
let t = r(i, e, a);
|
|
3441
|
+
if (typeof t == "function") {
|
|
3442
|
+
t(n, 0);
|
|
3443
|
+
return;
|
|
3444
|
+
}
|
|
3445
|
+
}
|
|
3446
|
+
$t(e, t, n);
|
|
3447
|
+
}
|
|
3448
|
+
var tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, rn = class e {
|
|
3430
3449
|
static MAX_REGISTERS = 256;
|
|
3431
3450
|
registers = Array(e.MAX_REGISTERS);
|
|
3432
3451
|
scope = {};
|
|
3433
3452
|
declaredVars = /* @__PURE__ */ new Set();
|
|
3434
3453
|
parentVM = null;
|
|
3435
3454
|
contextMap = /* @__PURE__ */ new Map();
|
|
3455
|
+
asyncBoundaries = [];
|
|
3456
|
+
isStreaming = !1;
|
|
3457
|
+
static nextAsyncId = 1;
|
|
3436
3458
|
checkRegister(t) {
|
|
3437
3459
|
if (t < 0 || t >= e.MAX_REGISTERS) throw Error(`Register index ${t} out of bounds (0-${e.MAX_REGISTERS - 1})`);
|
|
3438
3460
|
}
|
|
@@ -3443,7 +3465,7 @@ var Qt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, $t = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, en
|
|
|
3443
3465
|
return this.checkRegister(e), this.registers[e];
|
|
3444
3466
|
}
|
|
3445
3467
|
execute(t, n = {}) {
|
|
3446
|
-
let a =
|
|
3468
|
+
let a = m(t) || t, o = n.scope || null;
|
|
3447
3469
|
if (this.scope = Object.assign(Object.create(o), a.scope), a.derived && a.derived.length > 0) for (let e of a.derived) {
|
|
3448
3470
|
let t = a.constants[e.exprIdx];
|
|
3449
3471
|
Object.defineProperty(this.scope, e.name, {
|
|
@@ -3453,27 +3475,27 @@ var Qt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, $t = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, en
|
|
|
3453
3475
|
});
|
|
3454
3476
|
}
|
|
3455
3477
|
this.declaredVars = new Set(a.declaredVars ?? []), this.registers.fill(null);
|
|
3456
|
-
let c = a.bytecode, l = a.constants,
|
|
3457
|
-
|
|
3478
|
+
let c = a.bytecode, l = a.constants, d = 0;
|
|
3479
|
+
p(this);
|
|
3458
3480
|
try {
|
|
3459
|
-
for (;
|
|
3460
|
-
let t = c[
|
|
3481
|
+
for (; d < c.length;) {
|
|
3482
|
+
let t = c[d];
|
|
3461
3483
|
switch (t) {
|
|
3462
|
-
case
|
|
3463
|
-
|
|
3484
|
+
case Q.RETURN:
|
|
3485
|
+
d += 1;
|
|
3464
3486
|
break;
|
|
3465
|
-
case
|
|
3466
|
-
let e = c[
|
|
3487
|
+
case Q.CREATE_ELEMENT: {
|
|
3488
|
+
let e = c[d + 1], t = c[d + 2], n = String(l[t]);
|
|
3467
3489
|
this.setRegister(e, {
|
|
3468
3490
|
type: "element",
|
|
3469
3491
|
tag: n,
|
|
3470
3492
|
attrs: /* @__PURE__ */ new Map(),
|
|
3471
3493
|
children: []
|
|
3472
|
-
}),
|
|
3494
|
+
}), d += 3;
|
|
3473
3495
|
break;
|
|
3474
3496
|
}
|
|
3475
|
-
case
|
|
3476
|
-
let t = c[
|
|
3497
|
+
case Q.MOUNT_COMPONENT: {
|
|
3498
|
+
let t = c[d + 1], n = c[d + 2], r = c[d + 3], a = String(l[n]), o = m(this.scope && a in this.scope ? this.scope[a] : typeof globalThis < "u" && globalThis[a]);
|
|
3477
3499
|
if (o) {
|
|
3478
3500
|
let n = r === 255 ? null : l[r], a = i(n, this.scope, this.declaredVars), s;
|
|
3479
3501
|
if (n && n.__drift_children__ !== void 0) {
|
|
@@ -3490,52 +3512,52 @@ var Qt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, $t = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, en
|
|
|
3490
3512
|
let d = c.execute(o, { scope: u });
|
|
3491
3513
|
d && this.setRegister(t, d);
|
|
3492
3514
|
}
|
|
3493
|
-
|
|
3515
|
+
d += 4;
|
|
3494
3516
|
break;
|
|
3495
3517
|
}
|
|
3496
|
-
case
|
|
3497
|
-
let e = c[
|
|
3518
|
+
case Q.CREATE_TEXT: {
|
|
3519
|
+
let e = c[d + 1], t = l[c[d + 2]], n = r(t, this.scope, this.declaredVars), i = n == null ? "" : String(n);
|
|
3498
3520
|
this.setRegister(e, {
|
|
3499
3521
|
type: "text",
|
|
3500
3522
|
content: i,
|
|
3501
3523
|
children: []
|
|
3502
|
-
}),
|
|
3524
|
+
}), d += 3;
|
|
3503
3525
|
break;
|
|
3504
3526
|
}
|
|
3505
|
-
case
|
|
3506
|
-
let e = c[
|
|
3527
|
+
case Q.CREATE_COMMENT: {
|
|
3528
|
+
let e = c[d + 1], t = c[d + 2], n = String(l[t]);
|
|
3507
3529
|
this.setRegister(e, {
|
|
3508
3530
|
type: "comment",
|
|
3509
3531
|
content: n,
|
|
3510
3532
|
children: []
|
|
3511
|
-
}),
|
|
3533
|
+
}), d += 3;
|
|
3512
3534
|
break;
|
|
3513
3535
|
}
|
|
3514
|
-
case
|
|
3515
|
-
let e = c[
|
|
3536
|
+
case Q.CREATE_FRAGMENT: {
|
|
3537
|
+
let e = c[d + 1];
|
|
3516
3538
|
this.setRegister(e, {
|
|
3517
3539
|
type: "fragment",
|
|
3518
3540
|
children: []
|
|
3519
|
-
}),
|
|
3541
|
+
}), d += 2;
|
|
3520
3542
|
break;
|
|
3521
3543
|
}
|
|
3522
|
-
case
|
|
3523
|
-
let e = c[
|
|
3524
|
-
n.children.push(r),
|
|
3544
|
+
case Q.APPEND_CHILD: {
|
|
3545
|
+
let e = c[d + 1], t = c[d + 2], n = this.getRegister(e), r = this.getRegister(t);
|
|
3546
|
+
n.children.push(r), d += 3;
|
|
3525
3547
|
break;
|
|
3526
3548
|
}
|
|
3527
|
-
case
|
|
3528
|
-
let e = c[
|
|
3549
|
+
case Q.SET_ATTR: {
|
|
3550
|
+
let e = c[d + 1], t = c[d + 2], n = c[d + 3], i = c[d + 4], a = this.getRegister(e), o = String(l[t]);
|
|
3529
3551
|
if (o.startsWith("on")) {
|
|
3530
|
-
|
|
3552
|
+
d += 5;
|
|
3531
3553
|
break;
|
|
3532
3554
|
}
|
|
3533
|
-
let u = l[n],
|
|
3534
|
-
o === "style" && (
|
|
3555
|
+
let u = l[n], f = i === 1 ? r(u, this.scope, this.declaredVars) : u;
|
|
3556
|
+
o === "style" && (f = s(f)), a.attrs ||= /* @__PURE__ */ new Map(), o === "className" ? a.attrs.set("class", f) : a.attrs.set(o, f), d += 5;
|
|
3535
3557
|
break;
|
|
3536
3558
|
}
|
|
3537
|
-
case
|
|
3538
|
-
let e = c[
|
|
3559
|
+
case Q.INTERPOLATE_TEXT: {
|
|
3560
|
+
let e = c[d + 1], t = l[c[d + 2]], n = r(t, this.scope, this.declaredVars);
|
|
3539
3561
|
if (n && typeof n == "object" && "type" in n && Array.isArray(n.children)) this.setRegister(e, n);
|
|
3540
3562
|
else {
|
|
3541
3563
|
let t = n == null ? "" : String(n);
|
|
@@ -3545,18 +3567,18 @@ var Qt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, $t = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, en
|
|
|
3545
3567
|
children: []
|
|
3546
3568
|
});
|
|
3547
3569
|
}
|
|
3548
|
-
|
|
3570
|
+
d += 3;
|
|
3549
3571
|
break;
|
|
3550
3572
|
}
|
|
3551
|
-
case
|
|
3552
|
-
let e = l[c[
|
|
3573
|
+
case Q.EXEC_SCRIPT: {
|
|
3574
|
+
let e = l[c[d + 1]];
|
|
3553
3575
|
if (Array.isArray(e)) for (let t of e) r(t, this.scope, this.declaredVars);
|
|
3554
3576
|
else e && r(e, this.scope, this.declaredVars);
|
|
3555
|
-
|
|
3577
|
+
d += 2;
|
|
3556
3578
|
break;
|
|
3557
3579
|
}
|
|
3558
|
-
case
|
|
3559
|
-
let t = c[
|
|
3580
|
+
case Q.REACTIVE_IF: {
|
|
3581
|
+
let t = c[d + 1], n = c[d + 2], i = c[d + 3], a = c[d + 4], o = this.getRegister(t), s = l[n], u = l[i], f = a === 255 ? null : l[a], p = r(s, this.scope, this.declaredVars) ? u : f;
|
|
3560
3582
|
if (o.children.push({
|
|
3561
3583
|
type: "comment",
|
|
3562
3584
|
content: "if",
|
|
@@ -3571,34 +3593,129 @@ var Qt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, $t = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, en
|
|
|
3571
3593
|
type: "comment",
|
|
3572
3594
|
content: "/if",
|
|
3573
3595
|
children: []
|
|
3574
|
-
}),
|
|
3596
|
+
}), d += 6;
|
|
3575
3597
|
break;
|
|
3576
3598
|
}
|
|
3577
|
-
case
|
|
3578
|
-
let t = c[
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3599
|
+
case Q.REACTIVE_SWITCH: {
|
|
3600
|
+
let t = c[d + 1], n = c[d + 2], i = c[d + 3], a = c[d + 4], o = this.getRegister(t), s = l[n], u = l[i], f = a === 255 ? null : l[a], p = r(s, this.scope, this.declaredVars), m = f;
|
|
3601
|
+
if (Array.isArray(u)) for (let e = 0; e < u.length; e++) {
|
|
3602
|
+
let t = u[e];
|
|
3603
|
+
if (p === r(l[t.testIdx], this.scope, this.declaredVars)) {
|
|
3604
|
+
m = l[t.modIdx];
|
|
3605
|
+
break;
|
|
3606
|
+
}
|
|
3607
|
+
}
|
|
3608
|
+
if (o.children.push({
|
|
3609
|
+
type: "comment",
|
|
3610
|
+
content: "switch",
|
|
3611
|
+
children: []
|
|
3612
|
+
}), m) {
|
|
3613
|
+
let t = Object.create(this.scope), n = new e();
|
|
3614
|
+
n.parentVM = this;
|
|
3615
|
+
let r = n.execute(m, { scope: t });
|
|
3616
|
+
r && o.children.push(r);
|
|
3617
|
+
}
|
|
3618
|
+
o.children.push({
|
|
3619
|
+
type: "comment",
|
|
3620
|
+
content: "/switch",
|
|
3621
|
+
children: []
|
|
3622
|
+
}), d += 6;
|
|
3623
|
+
break;
|
|
3624
|
+
}
|
|
3625
|
+
case Q.REACTIVE_FOR: {
|
|
3626
|
+
let t = c[d + 1], n = c[d + 2], i = c[d + 3], a = c[d + 4];
|
|
3627
|
+
c[d + 5];
|
|
3628
|
+
let o = c[d + 6], s = c[d + 10] ?? 255, u = s === 255 ? null : l[s], f = this.getRegister(t), p = l[n], m = l[i], h = a === 255 ? null : l[a], g = l[o], te = ee(r(p, this.scope, this.declaredVars));
|
|
3629
|
+
f.children.push({
|
|
3582
3630
|
type: "comment",
|
|
3583
3631
|
content: "for",
|
|
3584
3632
|
children: []
|
|
3585
3633
|
});
|
|
3586
|
-
for (let t = 0; t <
|
|
3634
|
+
for (let t = 0; t < te.length; t++) {
|
|
3587
3635
|
let n = Object.create(this.scope);
|
|
3588
|
-
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
i
|
|
3636
|
+
if (u) {
|
|
3637
|
+
let e = r(u, n, this.declaredVars);
|
|
3638
|
+
typeof e == "function" ? e(te[t], t) : ($t(n, m, te[t]), h && $t(n, h, t));
|
|
3639
|
+
} else $t(n, m, te[t]), h && $t(n, h, t);
|
|
3640
|
+
let i = new e();
|
|
3641
|
+
i.parentVM = this;
|
|
3642
|
+
let a = i.execute(g, { scope: n });
|
|
3643
|
+
a && f.children.push(a);
|
|
3593
3644
|
}
|
|
3594
|
-
|
|
3645
|
+
f.children.push({
|
|
3595
3646
|
type: "comment",
|
|
3596
3647
|
content: "/for",
|
|
3597
3648
|
children: []
|
|
3598
|
-
}),
|
|
3649
|
+
}), d += 11;
|
|
3650
|
+
break;
|
|
3651
|
+
}
|
|
3652
|
+
case Q.REACTIVE_ASYNC: {
|
|
3653
|
+
let t = c[d + 1], n = c[d + 2], i = c[d + 3], a = c[d + 4], o = c[d + 5], s = c[d + 6], u = c[d + 8] ?? 255, f = u === 255 ? null : l[u], p = this.getRegister(t), m = l[n], ee = l[i], h = l[a], g = o === 255 ? null : l[o], te = s === 255 ? null : l[s], ne = (e, t) => {
|
|
3654
|
+
en(e, ee, t, f, this.declaredVars);
|
|
3655
|
+
}, _ = r(m, this.scope, this.declaredVars), v = e.nextAsyncId++;
|
|
3656
|
+
if (this.isStreaming) {
|
|
3657
|
+
if (p.children.push({
|
|
3658
|
+
type: "comment",
|
|
3659
|
+
content: `drift-async:${v}`,
|
|
3660
|
+
children: []
|
|
3661
|
+
}), g) {
|
|
3662
|
+
let t = Object.create(this.scope), n = new e();
|
|
3663
|
+
n.parentVM = this, n.isStreaming = !0;
|
|
3664
|
+
let r = n.execute(g, { scope: t });
|
|
3665
|
+
r && p.children.push(r);
|
|
3666
|
+
}
|
|
3667
|
+
p.children.push({
|
|
3668
|
+
type: "comment",
|
|
3669
|
+
content: `/drift-async:${v}`,
|
|
3670
|
+
children: []
|
|
3671
|
+
}), this.asyncBoundaries.push({
|
|
3672
|
+
id: v,
|
|
3673
|
+
promise: _,
|
|
3674
|
+
alias: ee,
|
|
3675
|
+
bodyMod: h,
|
|
3676
|
+
fallbackMod: g,
|
|
3677
|
+
catchMod: te,
|
|
3678
|
+
scope: this.scope,
|
|
3679
|
+
aliasPopulator: f,
|
|
3680
|
+
declaredVars: this.declaredVars
|
|
3681
|
+
});
|
|
3682
|
+
} else if (_ && typeof _.then == "function") {
|
|
3683
|
+
if (p.children.push({
|
|
3684
|
+
type: "comment",
|
|
3685
|
+
content: `drift-async:${v}`,
|
|
3686
|
+
children: []
|
|
3687
|
+
}), g) {
|
|
3688
|
+
let t = Object.create(this.scope), n = new e();
|
|
3689
|
+
n.parentVM = this;
|
|
3690
|
+
let r = n.execute(g, { scope: t });
|
|
3691
|
+
r && p.children.push(r);
|
|
3692
|
+
}
|
|
3693
|
+
p.children.push({
|
|
3694
|
+
type: "comment",
|
|
3695
|
+
content: `/drift-async:${v}`,
|
|
3696
|
+
children: []
|
|
3697
|
+
});
|
|
3698
|
+
} else {
|
|
3699
|
+
p.children.push({
|
|
3700
|
+
type: "comment",
|
|
3701
|
+
content: `drift-async:${v}`,
|
|
3702
|
+
children: []
|
|
3703
|
+
});
|
|
3704
|
+
let t = Object.create(this.scope);
|
|
3705
|
+
ne(t, _);
|
|
3706
|
+
let n = new e();
|
|
3707
|
+
n.parentVM = this;
|
|
3708
|
+
let r = n.execute(h, { scope: t });
|
|
3709
|
+
r && p.children.push(r), p.children.push({
|
|
3710
|
+
type: "comment",
|
|
3711
|
+
content: `/drift-async:${v}`,
|
|
3712
|
+
children: []
|
|
3713
|
+
});
|
|
3714
|
+
}
|
|
3715
|
+
d += 9;
|
|
3599
3716
|
break;
|
|
3600
3717
|
}
|
|
3601
|
-
default: throw Error(`DriftServerVM: Unknown Opcode ${t} at PC ${
|
|
3718
|
+
default: throw Error(`DriftServerVM: Unknown Opcode ${t} at PC ${d}`);
|
|
3602
3719
|
}
|
|
3603
3720
|
}
|
|
3604
3721
|
return this.getRegister(0);
|
|
@@ -3607,35 +3724,123 @@ var Qt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, $t = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, en
|
|
|
3607
3724
|
}
|
|
3608
3725
|
}
|
|
3609
3726
|
};
|
|
3610
|
-
function
|
|
3727
|
+
function an(e, t) {
|
|
3611
3728
|
if (!t) return e;
|
|
3612
3729
|
let n = t.toLowerCase();
|
|
3613
3730
|
return n === "script" ? e.replace(/<\/script/gi, "<\\/script") : n === "style" ? e.replace(/<\/style/gi, "<\\/style") : e;
|
|
3614
3731
|
}
|
|
3615
|
-
function
|
|
3732
|
+
function $(t, n = !1, r) {
|
|
3616
3733
|
if (!t) return "";
|
|
3617
|
-
if (typeof t == "string") return n ?
|
|
3618
|
-
if (t.type === "text") return n ?
|
|
3734
|
+
if (typeof t == "string") return n ? an(t, r) : Zt(t);
|
|
3735
|
+
if (t.type === "text") return n ? an(t.content ?? "", r) : Zt(t.content ?? "");
|
|
3619
3736
|
if (t.type === "comment") return `<!--${String(t.content ?? "").replace(/-->/g, "-- >").replace(/--!>/g, "--! >")}-->`;
|
|
3620
|
-
if (t.type === "fragment") return t.children.map((e) =>
|
|
3737
|
+
if (t.type === "fragment") return t.children.map((e) => $(e, n, r)).join("");
|
|
3621
3738
|
if (t.type === "element") {
|
|
3622
3739
|
let n = t.tag;
|
|
3623
|
-
if (!n ||
|
|
3740
|
+
if (!n || !nn.test(n)) return "";
|
|
3624
3741
|
let r = n.toLowerCase() === "script" || n.toLowerCase() === "style", i = "";
|
|
3625
3742
|
if (t.attrs && t.attrs.size > 0) for (let [e, n] of t.attrs.entries()) {
|
|
3626
|
-
if (!
|
|
3743
|
+
if (!tn.test(e) || e === "style" && (n === "" || n == null || n === !1)) continue;
|
|
3627
3744
|
let t = e.startsWith("aria-") || e.startsWith("data-");
|
|
3628
3745
|
n === !0 ? i += t ? ` ${e}="true"` : ` ${e}` : n === !1 ? t && (i += ` ${e}="false"`) : n != null && (i += ` ${e}="${Zt(String(n))}"`);
|
|
3629
3746
|
}
|
|
3630
3747
|
if (e.has(n.toLowerCase())) return `<${n}${i} />`;
|
|
3631
|
-
let a = t.children.map((e) =>
|
|
3748
|
+
let a = t.children.map((e) => $(e, r, r ? n : void 0)).join("");
|
|
3632
3749
|
return `<${n}${i}>${a}</${n}>`;
|
|
3633
3750
|
}
|
|
3634
3751
|
return "";
|
|
3635
3752
|
}
|
|
3636
|
-
function
|
|
3637
|
-
let n = new
|
|
3638
|
-
return n ?
|
|
3753
|
+
function on(e, t = {}) {
|
|
3754
|
+
let n = new rn().execute(e, t);
|
|
3755
|
+
return n ? $(n) : "";
|
|
3756
|
+
}
|
|
3757
|
+
function sn(e, t = {}) {
|
|
3758
|
+
let n = !1, r = null, i = new ReadableStream({
|
|
3759
|
+
start(i) {
|
|
3760
|
+
let a = new TextEncoder(), o = (e) => {
|
|
3761
|
+
n || i.enqueue(a.encode(e));
|
|
3762
|
+
}, s = () => {
|
|
3763
|
+
if (!n) {
|
|
3764
|
+
r && clearTimeout(r);
|
|
3765
|
+
try {
|
|
3766
|
+
i.close();
|
|
3767
|
+
} catch (e) {
|
|
3768
|
+
console.debug("[DriftJS SSR] Stream controller already closed:", e);
|
|
3769
|
+
}
|
|
3770
|
+
t.onAllReady?.();
|
|
3771
|
+
}
|
|
3772
|
+
};
|
|
3773
|
+
try {
|
|
3774
|
+
let i = new rn();
|
|
3775
|
+
i.isStreaming = !0;
|
|
3776
|
+
let a = i.execute(e, t), c = a ? $(a) : "", l = i.asyncBoundaries;
|
|
3777
|
+
if (l.length > 0) {
|
|
3778
|
+
let e = `<script${t.nonce ? ` nonce="${Zt(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>`;
|
|
3779
|
+
c += e;
|
|
3780
|
+
}
|
|
3781
|
+
if (o(c), t.onShellReady?.(), l.length === 0) {
|
|
3782
|
+
s();
|
|
3783
|
+
return;
|
|
3784
|
+
}
|
|
3785
|
+
t.timeoutMs && t.timeoutMs > 0 && (r = setTimeout(() => {
|
|
3786
|
+
if (!n) {
|
|
3787
|
+
let e = /* @__PURE__ */ Error(`[DriftJS] renderToStream timed out after ${t.timeoutMs}ms`);
|
|
3788
|
+
t.onError?.(e), s();
|
|
3789
|
+
}
|
|
3790
|
+
}, t.timeoutMs));
|
|
3791
|
+
let u = l.length;
|
|
3792
|
+
for (let e of l) {
|
|
3793
|
+
let { id: r, promise: i, alias: a, bodyMod: c, catchMod: l, scope: d, aliasPopulator: f, declaredVars: p } = e;
|
|
3794
|
+
Promise.resolve(i).then((e) => {
|
|
3795
|
+
if (n) return;
|
|
3796
|
+
let i = Object.create(d);
|
|
3797
|
+
en(i, a, e, f, p);
|
|
3798
|
+
let s = new rn().execute(c, { scope: i }), l = s ? $(s) : "", u = t.nonce ? ` nonce="${Zt(t.nonce)}"` : "", m = `<template id="drift-t-${r}">${l}</template><script${u}>__drift_swap("${r}","drift-t-${r}")<\/script>`;
|
|
3799
|
+
o(m);
|
|
3800
|
+
}).catch((e) => {
|
|
3801
|
+
if (!n && (t.onError?.(e), l)) {
|
|
3802
|
+
let n = Object.create(d);
|
|
3803
|
+
l.errorVar && $t(n, l.errorVar, e);
|
|
3804
|
+
let i = new rn().execute(l.module, { scope: n }), a = i ? $(i) : "", s = t.nonce ? ` nonce="${Zt(t.nonce)}"` : "", c = `<template id="drift-t-${r}">${a}</template><script${s}>__drift_swap("${r}","drift-t-${r}")<\/script>`;
|
|
3805
|
+
o(c);
|
|
3806
|
+
}
|
|
3807
|
+
}).finally(() => {
|
|
3808
|
+
u--, u === 0 && s();
|
|
3809
|
+
});
|
|
3810
|
+
}
|
|
3811
|
+
} catch (e) {
|
|
3812
|
+
t.onError?.(e), i.error(e);
|
|
3813
|
+
}
|
|
3814
|
+
},
|
|
3815
|
+
cancel(e) {
|
|
3816
|
+
n = !0, r && clearTimeout(r);
|
|
3817
|
+
}
|
|
3818
|
+
}), a = i;
|
|
3819
|
+
return a.abort = (e) => {
|
|
3820
|
+
n = !0, r && clearTimeout(r);
|
|
3821
|
+
try {
|
|
3822
|
+
a.cancel(e);
|
|
3823
|
+
} catch (e) {
|
|
3824
|
+
console.debug("[DriftJS SSR] Stream abort cancel error:", e);
|
|
3825
|
+
}
|
|
3826
|
+
}, a.pipe = function(e) {
|
|
3827
|
+
let t = i.getReader(), n = e;
|
|
3828
|
+
async function r() {
|
|
3829
|
+
try {
|
|
3830
|
+
for (;;) {
|
|
3831
|
+
let { done: e, value: r } = await t.read();
|
|
3832
|
+
if (e) {
|
|
3833
|
+
typeof n.end == "function" && n.end();
|
|
3834
|
+
break;
|
|
3835
|
+
}
|
|
3836
|
+
typeof n.write == "function" && n.write(Buffer.from(r));
|
|
3837
|
+
}
|
|
3838
|
+
} catch (e) {
|
|
3839
|
+
typeof n.destroy == "function" && n.destroy(e);
|
|
3840
|
+
}
|
|
3841
|
+
}
|
|
3842
|
+
return r(), e;
|
|
3843
|
+
}, a;
|
|
3639
3844
|
}
|
|
3640
3845
|
//#endregion
|
|
3641
|
-
export {
|
|
3846
|
+
export { rn as DriftServerVM, t as createContext, n as effect, a as inject, o as injectContext, c as onMount, l as onUnmount, d as provide, f as provideContext, sn as renderToStream, on as renderToString, $ as serializeNode };
|