driftjs-ssr 0.0.15 → 0.0.17
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 +568 -534
- package/dist/index.d.ts +81 -0
- package/package.json +8 -8
package/dist/index-es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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
|
-
//#region ../../node_modules/.pnpm/acorn@8.
|
|
2
|
+
//#region ../../node_modules/.pnpm/acorn@8.18.0/node_modules/acorn/dist/acorn.mjs
|
|
3
3
|
var h = [
|
|
4
4
|
509,
|
|
5
5
|
0,
|
|
@@ -950,216 +950,216 @@ var h = [
|
|
|
950
950
|
4938,
|
|
951
951
|
6,
|
|
952
952
|
8489
|
|
953
|
-
], te = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",
|
|
953
|
+
], te = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", _ = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", v = {
|
|
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
|
+
}, y = "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", ne = {
|
|
960
|
+
5: y,
|
|
961
|
+
"5module": y + " export import",
|
|
962
|
+
6: y + " const class extends export import super"
|
|
963
|
+
}, re = /^in(stanceof)?$/, ie = RegExp("[" + _ + "]"), ae = RegExp("[" + _ + te + "]");
|
|
964
|
+
function oe(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 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
|
-
}
|
|
974
971
|
function b(e, t) {
|
|
975
|
-
return e <
|
|
972
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && ie.test(String.fromCharCode(e)) : t !== !1 && oe(e, g);
|
|
973
|
+
}
|
|
974
|
+
function x(e, t) {
|
|
975
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && ae.test(String.fromCharCode(e)) : t === !1 ? !1 : oe(e, g) || oe(e, h);
|
|
976
976
|
}
|
|
977
|
-
var
|
|
977
|
+
var S = function(e, t) {
|
|
978
978
|
t === void 0 && (t = {}), this.label = e, this.keyword = t.keyword, this.beforeExpr = !!t.beforeExpr, this.startsExpr = !!t.startsExpr, this.isLoop = !!t.isLoop, this.isAssign = !!t.isAssign, this.prefix = !!t.prefix, this.postfix = !!t.postfix, this.binop = t.binop || null, this.updateContext = null;
|
|
979
979
|
};
|
|
980
|
-
function
|
|
981
|
-
return new
|
|
980
|
+
function C(e, t) {
|
|
981
|
+
return new S(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 w = { beforeExpr: !0 }, T = { startsExpr: !0 }, se = {};
|
|
987
|
+
function E(e, t) {
|
|
988
|
+
return t === void 0 && (t = {}), t.keyword = e, se[e] = new S(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 D = {
|
|
991
|
+
num: new S("num", T),
|
|
992
|
+
regexp: new S("regexp", T),
|
|
993
|
+
string: new S("string", T),
|
|
994
|
+
name: new S("name", T),
|
|
995
|
+
privateId: new S("privateId", T),
|
|
996
|
+
eof: new S("eof"),
|
|
997
|
+
bracketL: new S("[", {
|
|
998
998
|
beforeExpr: !0,
|
|
999
999
|
startsExpr: !0
|
|
1000
1000
|
}),
|
|
1001
|
-
bracketR: new
|
|
1002
|
-
braceL: new
|
|
1001
|
+
bracketR: new S("]"),
|
|
1002
|
+
braceL: new S("{", {
|
|
1003
1003
|
beforeExpr: !0,
|
|
1004
1004
|
startsExpr: !0
|
|
1005
1005
|
}),
|
|
1006
|
-
braceR: new
|
|
1007
|
-
parenL: new
|
|
1006
|
+
braceR: new S("}"),
|
|
1007
|
+
parenL: new S("(", {
|
|
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 S(")"),
|
|
1012
|
+
comma: new S(",", w),
|
|
1013
|
+
semi: new S(";", w),
|
|
1014
|
+
colon: new S(":", w),
|
|
1015
|
+
dot: new S("."),
|
|
1016
|
+
question: new S("?", w),
|
|
1017
|
+
questionDot: new S("?."),
|
|
1018
|
+
arrow: new S("=>", w),
|
|
1019
|
+
template: new S("template"),
|
|
1020
|
+
invalidTemplate: new S("invalidTemplate"),
|
|
1021
|
+
ellipsis: new S("...", w),
|
|
1022
|
+
backQuote: new S("`", T),
|
|
1023
|
+
dollarBraceL: new S("${", {
|
|
1024
1024
|
beforeExpr: !0,
|
|
1025
1025
|
startsExpr: !0
|
|
1026
1026
|
}),
|
|
1027
|
-
eq: new
|
|
1027
|
+
eq: new S("=", {
|
|
1028
1028
|
beforeExpr: !0,
|
|
1029
1029
|
isAssign: !0
|
|
1030
1030
|
}),
|
|
1031
|
-
assign: new
|
|
1031
|
+
assign: new S("_=", {
|
|
1032
1032
|
beforeExpr: !0,
|
|
1033
1033
|
isAssign: !0
|
|
1034
1034
|
}),
|
|
1035
|
-
incDec: new
|
|
1035
|
+
incDec: new S("++/--", {
|
|
1036
1036
|
prefix: !0,
|
|
1037
1037
|
postfix: !0,
|
|
1038
1038
|
startsExpr: !0
|
|
1039
1039
|
}),
|
|
1040
|
-
prefix: new
|
|
1040
|
+
prefix: new S("!/~", {
|
|
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: C("||", 1),
|
|
1046
|
+
logicalAND: C("&&", 2),
|
|
1047
|
+
bitwiseOR: C("|", 3),
|
|
1048
|
+
bitwiseXOR: C("^", 4),
|
|
1049
|
+
bitwiseAND: C("&", 5),
|
|
1050
|
+
equality: C("==/!=/===/!==", 6),
|
|
1051
|
+
relational: C("</>/<=/>=", 7),
|
|
1052
|
+
bitShift: C("<</>>/>>>", 8),
|
|
1053
|
+
plusMin: new S("+/-", {
|
|
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: C("%", 10),
|
|
1060
|
+
star: C("*", 10),
|
|
1061
|
+
slash: C("/", 10),
|
|
1062
|
+
starstar: new S("**", { beforeExpr: !0 }),
|
|
1063
|
+
coalesce: C("??", 1),
|
|
1064
|
+
_break: E("break"),
|
|
1065
|
+
_case: E("case", w),
|
|
1066
|
+
_catch: E("catch"),
|
|
1067
|
+
_continue: E("continue"),
|
|
1068
|
+
_debugger: E("debugger"),
|
|
1069
|
+
_default: E("default", w),
|
|
1070
|
+
_do: E("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: E("else", w),
|
|
1075
|
+
_finally: E("finally"),
|
|
1076
|
+
_for: E("for", { isLoop: !0 }),
|
|
1077
|
+
_function: E("function", T),
|
|
1078
|
+
_if: E("if"),
|
|
1079
|
+
_return: E("return", w),
|
|
1080
|
+
_switch: E("switch"),
|
|
1081
|
+
_throw: E("throw", w),
|
|
1082
|
+
_try: E("try"),
|
|
1083
|
+
_var: E("var"),
|
|
1084
|
+
_const: E("const"),
|
|
1085
|
+
_while: E("while", { isLoop: !0 }),
|
|
1086
|
+
_with: E("with"),
|
|
1087
|
+
_new: E("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: E("this", T),
|
|
1092
|
+
_super: E("super", T),
|
|
1093
|
+
_class: E("class", T),
|
|
1094
|
+
_extends: E("extends", w),
|
|
1095
|
+
_export: E("export"),
|
|
1096
|
+
_import: E("import", T),
|
|
1097
|
+
_null: E("null", T),
|
|
1098
|
+
_true: E("true", T),
|
|
1099
|
+
_false: E("false", T),
|
|
1100
|
+
_in: E("in", {
|
|
1101
1101
|
beforeExpr: !0,
|
|
1102
1102
|
binop: 7
|
|
1103
1103
|
}),
|
|
1104
|
-
_instanceof:
|
|
1104
|
+
_instanceof: E("instanceof", {
|
|
1105
1105
|
beforeExpr: !0,
|
|
1106
1106
|
binop: 7
|
|
1107
1107
|
}),
|
|
1108
|
-
_typeof:
|
|
1108
|
+
_typeof: E("typeof", {
|
|
1109
1109
|
beforeExpr: !0,
|
|
1110
1110
|
prefix: !0,
|
|
1111
1111
|
startsExpr: !0
|
|
1112
1112
|
}),
|
|
1113
|
-
_void:
|
|
1113
|
+
_void: E("void", {
|
|
1114
1114
|
beforeExpr: !0,
|
|
1115
1115
|
prefix: !0,
|
|
1116
1116
|
startsExpr: !0
|
|
1117
1117
|
}),
|
|
1118
|
-
_delete:
|
|
1118
|
+
_delete: E("delete", {
|
|
1119
1119
|
beforeExpr: !0,
|
|
1120
1120
|
prefix: !0,
|
|
1121
1121
|
startsExpr: !0
|
|
1122
1122
|
})
|
|
1123
|
-
},
|
|
1124
|
-
function
|
|
1123
|
+
}, O = /\r\n?|\n|\u2028|\u2029/, ce = new RegExp(O.source, "g");
|
|
1124
|
+
function le(e) {
|
|
1125
1125
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
1126
1126
|
}
|
|
1127
|
-
function
|
|
1127
|
+
function ue(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 (le(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
|
-
}),
|
|
1140
|
-
function k(e) {
|
|
1141
|
-
return ve[e] || (ve[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
1142
|
-
}
|
|
1135
|
+
var de = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, k = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, fe = Object.prototype, pe = fe.hasOwnProperty, me = fe.toString, he = Object.hasOwn || (function(e, t) {
|
|
1136
|
+
return pe.call(e, t);
|
|
1137
|
+
}), ge = Array.isArray || (function(e) {
|
|
1138
|
+
return me.call(e) === "[object Array]";
|
|
1139
|
+
}), _e = Object.create(null);
|
|
1143
1140
|
function A(e) {
|
|
1141
|
+
return _e[e] || (_e[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
1142
|
+
}
|
|
1143
|
+
function j(e) {
|
|
1144
1144
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
1145
1145
|
}
|
|
1146
|
-
var
|
|
1146
|
+
var ve = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, ye = function(e, t) {
|
|
1147
1147
|
this.line = e, this.column = t;
|
|
1148
1148
|
};
|
|
1149
|
-
|
|
1150
|
-
return new
|
|
1149
|
+
ye.prototype.offset = function(e) {
|
|
1150
|
+
return new ye(this.line, this.column + e);
|
|
1151
1151
|
};
|
|
1152
|
-
var
|
|
1152
|
+
var be = 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 xe(e, t) {
|
|
1156
1156
|
for (var n = 1, r = 0;;) {
|
|
1157
|
-
var i =
|
|
1158
|
-
if (i < 0) return new
|
|
1157
|
+
var i = ue(e, r, t);
|
|
1158
|
+
if (i < 0) return new ye(n, t - r);
|
|
1159
1159
|
++n, r = i;
|
|
1160
1160
|
}
|
|
1161
1161
|
}
|
|
1162
|
-
var
|
|
1162
|
+
var Se = {
|
|
1163
1163
|
ecmaVersion: null,
|
|
1164
1164
|
sourceType: "script",
|
|
1165
1165
|
strict: !1,
|
|
@@ -1173,6 +1173,7 @@ var Ce = {
|
|
|
1173
1173
|
allowHashBang: !1,
|
|
1174
1174
|
checkPrivateFields: !0,
|
|
1175
1175
|
locations: !1,
|
|
1176
|
+
startLocation: null,
|
|
1176
1177
|
onToken: null,
|
|
1177
1178
|
onComment: null,
|
|
1178
1179
|
ranges: !1,
|
|
@@ -1180,20 +1181,20 @@ var Ce = {
|
|
|
1180
1181
|
sourceFile: null,
|
|
1181
1182
|
directSourceFile: null,
|
|
1182
1183
|
preserveParens: !1
|
|
1183
|
-
},
|
|
1184
|
-
function
|
|
1184
|
+
}, Ce = !1;
|
|
1185
|
+
function we(e) {
|
|
1185
1186
|
var t = {};
|
|
1186
|
-
for (var n in
|
|
1187
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
1187
|
+
for (var n in Se) t[n] = e && he(e, n) ? e[n] : Se[n];
|
|
1188
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!Ce && typeof console == "object" && console.warn && (Ce = !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), ge(t.onToken)) {
|
|
1188
1189
|
var r = t.onToken;
|
|
1189
1190
|
t.onToken = function(e) {
|
|
1190
1191
|
return r.push(e);
|
|
1191
1192
|
};
|
|
1192
1193
|
}
|
|
1193
|
-
if (
|
|
1194
|
+
if (ge(t.onComment) && (t.onComment = Te(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
1194
1195
|
return t;
|
|
1195
1196
|
}
|
|
1196
|
-
function
|
|
1197
|
+
function Te(e, t) {
|
|
1197
1198
|
return function(n, r, i, a, o, s) {
|
|
1198
1199
|
var c = {
|
|
1199
1200
|
type: n ? "Block" : "Line",
|
|
@@ -1201,19 +1202,19 @@ function Ee(e, t) {
|
|
|
1201
1202
|
start: i,
|
|
1202
1203
|
end: a
|
|
1203
1204
|
};
|
|
1204
|
-
e.locations && (c.loc = new
|
|
1205
|
+
e.locations && (c.loc = new be(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
1205
1206
|
};
|
|
1206
1207
|
}
|
|
1207
|
-
var
|
|
1208
|
+
var M = 1, N = 2, Ee = 4, De = 8, Oe = 16, ke = 32, Ae = 64, je = 128, Me = 256, Ne = 512, Pe = 1024, Fe = M | N | Me;
|
|
1208
1209
|
function Ie(e, t) {
|
|
1209
|
-
return
|
|
1210
|
+
return N | (e ? Ee : 0) | (t ? De : 0);
|
|
1210
1211
|
}
|
|
1211
1212
|
var Le = 0, Re = 1, P = 2, ze = 3, Be = 4, Ve = 5, F = function(e, t, n) {
|
|
1212
|
-
this.options = e =
|
|
1213
|
+
this.options = e = we(e), this.sourceFile = e.sourceFile, this.keywords = A(ne[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
1213
1214
|
var r = "";
|
|
1214
|
-
e.allowReserved !== !0 && (r =
|
|
1215
|
-
var i = (r ? r + " " : "") +
|
|
1216
|
-
this.reservedWordsStrict =
|
|
1215
|
+
e.allowReserved !== !0 && (r = v[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = A(r);
|
|
1216
|
+
var i = (r ? r + " " : "") + v.strict;
|
|
1217
|
+
this.reservedWordsStrict = A(i), this.reservedWordsStrictBind = A(i + " " + v.strictBind), this.input = String(t), this.containsEsc = !1, this.pos = n || 0, this.curLine = 1, e.startLocation ? (this.lineStart = this.pos - e.startLocation.column, this.curLine = e.startLocation.line) : n ? (this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.options.locations && (this.curLine = this.input.slice(0, this.lineStart).split(O).length)) : this.lineStart = 0, this.type = D.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? N : M), this.regexpState = null, this.privateNameStack = [];
|
|
1217
1218
|
}, I = {
|
|
1218
1219
|
inFunction: { configurable: !0 },
|
|
1219
1220
|
inGenerator: { configurable: !0 },
|
|
@@ -1233,37 +1234,37 @@ F.prototype.parse = function() {
|
|
|
1233
1234
|
return e.parseTopLevel(t);
|
|
1234
1235
|
});
|
|
1235
1236
|
}, I.inFunction.get = function() {
|
|
1236
|
-
return (this.currentVarScope().flags &
|
|
1237
|
+
return (this.currentVarScope().flags & N) > 0;
|
|
1237
1238
|
}, I.inGenerator.get = function() {
|
|
1238
|
-
return (this.currentVarScope().flags & Oe) > 0;
|
|
1239
|
-
}, I.inAsync.get = function() {
|
|
1240
1239
|
return (this.currentVarScope().flags & De) > 0;
|
|
1240
|
+
}, I.inAsync.get = function() {
|
|
1241
|
+
return (this.currentVarScope().flags & Ee) > 0;
|
|
1241
1242
|
}, I.canAwait.get = function() {
|
|
1242
1243
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1243
1244
|
var t = this.scopeStack[e].flags;
|
|
1244
|
-
if (t & (
|
|
1245
|
-
if (t &
|
|
1245
|
+
if (t & (Me | Ne)) return !1;
|
|
1246
|
+
if (t & N) return (t & Ee) > 0;
|
|
1246
1247
|
}
|
|
1247
1248
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
1248
1249
|
}, I.allowReturn.get = function() {
|
|
1249
|
-
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags &
|
|
1250
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & M);
|
|
1250
1251
|
}, I.allowSuper.get = function() {
|
|
1251
|
-
return (this.currentThisScope().flags &
|
|
1252
|
+
return (this.currentThisScope().flags & Ae) > 0 || this.options.allowSuperOutsideMethod;
|
|
1252
1253
|
}, I.allowDirectSuper.get = function() {
|
|
1253
|
-
return (this.currentThisScope().flags &
|
|
1254
|
+
return (this.currentThisScope().flags & je) > 0;
|
|
1254
1255
|
}, I.treatFunctionsAsVar.get = function() {
|
|
1255
1256
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1256
1257
|
}, I.allowNewDotTarget.get = function() {
|
|
1257
1258
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1258
1259
|
var t = this.scopeStack[e].flags;
|
|
1259
|
-
if (t & (
|
|
1260
|
+
if (t & (Me | Ne) || t & N && !(t & Oe)) return !0;
|
|
1260
1261
|
}
|
|
1261
1262
|
return !1;
|
|
1262
1263
|
}, I.allowUsing.get = function() {
|
|
1263
1264
|
var e = this.currentScope().flags;
|
|
1264
|
-
return !(e & Pe || !this.inModule && e &
|
|
1265
|
+
return !(e & Pe || !this.inModule && e & M);
|
|
1265
1266
|
}, I.inClassStaticBlock.get = function() {
|
|
1266
|
-
return (this.currentVarScope().flags &
|
|
1267
|
+
return (this.currentVarScope().flags & Me) > 0;
|
|
1267
1268
|
}, F.extend = function() {
|
|
1268
1269
|
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
1269
1270
|
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
@@ -1280,20 +1281,20 @@ var L = F.prototype, He = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
|
1280
1281
|
L.strictDirective = function(e) {
|
|
1281
1282
|
if (this.options.ecmaVersion < 5) return !1;
|
|
1282
1283
|
for (;;) {
|
|
1283
|
-
|
|
1284
|
+
k.lastIndex = e, e += k.exec(this.input)[0].length;
|
|
1284
1285
|
var t = He.exec(this.input.slice(e));
|
|
1285
1286
|
if (!t) return !1;
|
|
1286
1287
|
if ((t[1] || t[2]) === "use strict") {
|
|
1287
|
-
|
|
1288
|
-
var n =
|
|
1289
|
-
return i === ";" || i === "}" ||
|
|
1288
|
+
k.lastIndex = e + t[0].length;
|
|
1289
|
+
var n = k.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
|
|
1290
|
+
return i === ";" || i === "}" || O.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
|
|
1290
1291
|
}
|
|
1291
|
-
e += t[0].length,
|
|
1292
|
+
e += t[0].length, k.lastIndex = e, e += k.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
1292
1293
|
}
|
|
1293
1294
|
}, L.eat = function(e) {
|
|
1294
|
-
return this.type === e
|
|
1295
|
+
return this.type === e && (this.next(), !0);
|
|
1295
1296
|
}, L.isContextual = function(e) {
|
|
1296
|
-
return this.type ===
|
|
1297
|
+
return this.type === D.name && this.value === e && !this.containsEsc;
|
|
1297
1298
|
}, L.eatContextual = function(e) {
|
|
1298
1299
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
1299
1300
|
}, L.catchStackOverflow = function(e) {
|
|
@@ -1306,11 +1307,11 @@ L.strictDirective = function(e) {
|
|
|
1306
1307
|
}, L.expectContextual = function(e) {
|
|
1307
1308
|
this.eatContextual(e) || this.unexpected();
|
|
1308
1309
|
}, L.canInsertSemicolon = function() {
|
|
1309
|
-
return this.type ===
|
|
1310
|
+
return this.type === D.eof || this.type === D.braceR || O.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1310
1311
|
}, L.insertSemicolon = function() {
|
|
1311
1312
|
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
1312
1313
|
}, L.semicolon = function() {
|
|
1313
|
-
!this.eat(
|
|
1314
|
+
!this.eat(D.semi) && !this.insertSemicolon() && this.unexpected();
|
|
1314
1315
|
}, L.afterTrailingComma = function(e, t) {
|
|
1315
1316
|
if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
1316
1317
|
}, L.expect = function(e) {
|
|
@@ -1340,7 +1341,7 @@ L.checkPatternErrors = function(e, t) {
|
|
|
1340
1341
|
var R = F.prototype;
|
|
1341
1342
|
R.parseTopLevel = function(e) {
|
|
1342
1343
|
var t = Object.create(null);
|
|
1343
|
-
for (e.body ||= []; this.type !==
|
|
1344
|
+
for (e.body ||= []; this.type !== D.eof;) {
|
|
1344
1345
|
var n = this.parseStatement(null, !0, t);
|
|
1345
1346
|
e.body.push(n);
|
|
1346
1347
|
}
|
|
@@ -1353,50 +1354,50 @@ R.parseTopLevel = function(e) {
|
|
|
1353
1354
|
var We = { kind: "loop" }, Ge = { kind: "switch" };
|
|
1354
1355
|
R.isLet = function(e) {
|
|
1355
1356
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
1356
|
-
|
|
1357
|
-
var t =
|
|
1357
|
+
k.lastIndex = this.pos;
|
|
1358
|
+
var t = k.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
1358
1359
|
if (r === 91 || r === 92) return !0;
|
|
1359
1360
|
if (e) return !1;
|
|
1360
1361
|
if (r === 123) return !0;
|
|
1361
|
-
if (
|
|
1362
|
+
if (b(r)) {
|
|
1362
1363
|
var i = n;
|
|
1363
1364
|
do
|
|
1364
1365
|
n += r <= 65535 ? 1 : 2;
|
|
1365
|
-
while (
|
|
1366
|
+
while (x(r = this.fullCharCodeAt(n)));
|
|
1366
1367
|
if (r === 92) return !0;
|
|
1367
1368
|
var a = this.input.slice(i, n);
|
|
1368
|
-
if (!
|
|
1369
|
+
if (!re.test(a)) return !0;
|
|
1369
1370
|
}
|
|
1370
1371
|
return !1;
|
|
1371
1372
|
}, R.isAsyncFunction = function() {
|
|
1372
1373
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
1373
|
-
|
|
1374
|
-
var e =
|
|
1375
|
-
return !
|
|
1374
|
+
k.lastIndex = this.pos;
|
|
1375
|
+
var e = k.exec(this.input), t = this.pos + e[0].length, n;
|
|
1376
|
+
return !O.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(x(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
1376
1377
|
}, R.isUsingKeyword = function(e, t) {
|
|
1377
1378
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
1378
|
-
|
|
1379
|
-
var n =
|
|
1380
|
-
if (
|
|
1379
|
+
k.lastIndex = this.pos;
|
|
1380
|
+
var n = k.exec(this.input), r = this.pos + n[0].length;
|
|
1381
|
+
if (O.test(this.input.slice(this.pos, r))) return !1;
|
|
1381
1382
|
if (e) {
|
|
1382
1383
|
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 &&
|
|
1384
|
+
if (this.input.slice(r, i) !== "using" || i === this.input.length || x(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
1385
|
+
k.lastIndex = i;
|
|
1386
|
+
var o = k.exec(this.input);
|
|
1387
|
+
if (r = i + o[0].length, o && O.test(this.input.slice(i, r))) return !1;
|
|
1387
1388
|
}
|
|
1388
1389
|
var s = this.fullCharCodeAt(r);
|
|
1389
|
-
if (!
|
|
1390
|
+
if (!b(s) && s !== 92) return !1;
|
|
1390
1391
|
var c = r;
|
|
1391
1392
|
do
|
|
1392
1393
|
r += s <= 65535 ? 1 : 2;
|
|
1393
|
-
while (
|
|
1394
|
+
while (x(s = this.fullCharCodeAt(r)));
|
|
1394
1395
|
if (s === 92) return !0;
|
|
1395
1396
|
var l = this.input.slice(c, r);
|
|
1396
|
-
if (
|
|
1397
|
+
if (re.test(l)) return !1;
|
|
1397
1398
|
if (t && !e && l === "of") {
|
|
1398
|
-
|
|
1399
|
-
var u =
|
|
1399
|
+
k.lastIndex = r;
|
|
1400
|
+
var u = k.exec(this.input);
|
|
1400
1401
|
if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
1401
1402
|
}
|
|
1402
1403
|
return !0;
|
|
@@ -1406,43 +1407,43 @@ R.isLet = function(e) {
|
|
|
1406
1407
|
return this.isUsingKeyword(!1, e);
|
|
1407
1408
|
}, R.parseStatement = function(e, t, n) {
|
|
1408
1409
|
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 =
|
|
1410
|
+
switch (this.isLet(e) && (r = D._var, a = "let"), r) {
|
|
1411
|
+
case D._break:
|
|
1412
|
+
case D._continue: return this.parseBreakContinueStatement(i, r.keyword);
|
|
1413
|
+
case D._debugger: return this.parseDebuggerStatement(i);
|
|
1414
|
+
case D._do: return this.parseDoStatement(i);
|
|
1415
|
+
case D._for: return this.parseForStatement(i);
|
|
1416
|
+
case D._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(i, !1, !e);
|
|
1417
|
+
case D._class: return e && this.unexpected(), this.parseClass(i, !0);
|
|
1418
|
+
case D._if: return this.parseIfStatement(i);
|
|
1419
|
+
case D._return: return this.parseReturnStatement(i);
|
|
1420
|
+
case D._switch: return this.parseSwitchStatement(i);
|
|
1421
|
+
case D._throw: return this.parseThrowStatement(i);
|
|
1422
|
+
case D._try: return this.parseTryStatement(i);
|
|
1423
|
+
case D._const:
|
|
1424
|
+
case D._var: return a ||= this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(i, a);
|
|
1425
|
+
case D._while: return this.parseWhileStatement(i);
|
|
1426
|
+
case D._with: return this.parseWithStatement(i);
|
|
1427
|
+
case D.braceL: return this.parseBlock(!0, i);
|
|
1428
|
+
case D.semi: return this.parseEmptyStatement(i);
|
|
1429
|
+
case D._export:
|
|
1430
|
+
case D._import:
|
|
1431
|
+
if (this.options.ecmaVersion > 10 && r === D._import) {
|
|
1432
|
+
k.lastIndex = this.pos;
|
|
1433
|
+
var o = k.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
|
|
1433
1434
|
if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
|
|
1434
1435
|
}
|
|
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 ===
|
|
1436
|
+
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === D._import ? this.parseImport(i) : this.parseExport(i, n);
|
|
1436
1437
|
default:
|
|
1437
1438
|
if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
|
|
1438
1439
|
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
1439
1440
|
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
1441
|
var u = this.value, d = this.parseExpression();
|
|
1441
|
-
return r ===
|
|
1442
|
+
return r === D.name && d.type === "Identifier" && this.eat(D.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
1442
1443
|
}
|
|
1443
1444
|
}, R.parseBreakContinueStatement = function(e, t) {
|
|
1444
1445
|
var n = t === "break";
|
|
1445
|
-
this.next(), this.eat(
|
|
1446
|
+
this.next(), this.eat(D.semi) || this.insertSemicolon() ? e.label = null : this.type === D.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
|
|
1446
1447
|
for (var r = 0; r < this.labels.length; ++r) {
|
|
1447
1448
|
var i = this.labels[r];
|
|
1448
1449
|
if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
|
|
@@ -1451,13 +1452,13 @@ R.isLet = function(e) {
|
|
|
1451
1452
|
}, R.parseDebuggerStatement = function(e) {
|
|
1452
1453
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
1453
1454
|
}, R.parseDoStatement = function(e) {
|
|
1454
|
-
return this.next(), this.labels.push(We), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(
|
|
1455
|
+
return this.next(), this.labels.push(We), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(D._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(D.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
1455
1456
|
}, R.parseForStatement = function(e) {
|
|
1456
1457
|
this.next();
|
|
1457
1458
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
1458
|
-
if (this.labels.push(We), this.enterScope(0), this.expect(
|
|
1459
|
+
if (this.labels.push(We), this.enterScope(0), this.expect(D.parenL), this.type === D.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
1459
1460
|
var n = this.isLet();
|
|
1460
|
-
if (this.type ===
|
|
1461
|
+
if (this.type === D._var || this.type === D._const || n) {
|
|
1461
1462
|
var r = this.startNode(), i = n ? "let" : this.value;
|
|
1462
1463
|
return this.next(), this.parseVar(r, !0, i), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
1463
1464
|
}
|
|
@@ -1467,35 +1468,35 @@ R.isLet = function(e) {
|
|
|
1467
1468
|
return this.next(), s === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.parseVar(c, !0, s), this.finishNode(c, "VariableDeclaration"), this.parseForAfterInit(e, c, t);
|
|
1468
1469
|
}
|
|
1469
1470
|
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 ===
|
|
1471
|
+
return this.type === D._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === D._in && this.unexpected(t), e.await = !0) : o && this.options.ecmaVersion >= 8 && (f.start === d && !l && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && o && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, u), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(u, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
|
|
1471
1472
|
}, R.parseForAfterInit = function(e, t, n) {
|
|
1472
|
-
return (this.type ===
|
|
1473
|
+
return (this.type === D._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === D._in ? ((t.kind === "using" || t.kind === "await using") && !t.declarations[0].init && this.raise(this.start, "Using declaration is not allowed in for-in loops"), this.options.ecmaVersion >= 9 && n > -1 && this.unexpected(n)) : this.options.ecmaVersion >= 9 && (e.await = n > -1), this.parseForIn(e, t)) : (n > -1 && this.unexpected(n), this.parseFor(e, t));
|
|
1473
1474
|
}, R.parseFunctionStatement = function(e, t, n) {
|
|
1474
1475
|
return this.next(), this.parseFunction(e, qe | (n ? 0 : Je), !1, t);
|
|
1475
1476
|
}, R.parseIfStatement = function(e) {
|
|
1476
|
-
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(
|
|
1477
|
+
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(D._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
1477
1478
|
}, R.parseReturnStatement = function(e) {
|
|
1478
|
-
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(
|
|
1479
|
+
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(D.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
1479
1480
|
}, 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(
|
|
1481
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(D.braceL), this.labels.push(Ge), this.enterScope(Pe);
|
|
1482
|
+
for (var t, n = !1; this.type !== D.braceR;) if (this.type === D._case || this.type === D._default) {
|
|
1483
|
+
var r = this.type === D._case;
|
|
1484
|
+
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(D.colon);
|
|
1484
1485
|
} else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
1485
1486
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
1486
1487
|
}, R.parseThrowStatement = function(e) {
|
|
1487
|
-
return this.next(),
|
|
1488
|
+
return this.next(), O.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
|
|
1488
1489
|
};
|
|
1489
1490
|
var Ke = [];
|
|
1490
1491
|
R.parseCatchClauseParam = function() {
|
|
1491
1492
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
1492
|
-
return this.enterScope(t ?
|
|
1493
|
+
return this.enterScope(t ? ke : 0), this.checkLValPattern(e, t ? Be : P), this.expect(D.parenR), e;
|
|
1493
1494
|
}, R.parseTryStatement = function(e) {
|
|
1494
|
-
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type ===
|
|
1495
|
+
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === D._catch) {
|
|
1495
1496
|
var t = this.startNode();
|
|
1496
|
-
this.next(), this.eat(
|
|
1497
|
+
this.next(), this.eat(D.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
1497
1498
|
}
|
|
1498
|
-
return e.finalizer = this.eat(
|
|
1499
|
+
return e.finalizer = this.eat(D._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
1499
1500
|
}, R.parseVarStatement = function(e, t, n) {
|
|
1500
1501
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
1501
1502
|
}, R.parseWhileStatement = function(e) {
|
|
@@ -1506,7 +1507,7 @@ R.parseCatchClauseParam = function() {
|
|
|
1506
1507
|
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
1507
1508
|
}, R.parseLabeledStatement = function(e, t, n, r) {
|
|
1508
1509
|
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 ===
|
|
1510
|
+
for (var o = this.type.isLoop ? "loop" : this.type === D._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
|
|
1510
1511
|
var c = this.labels[s];
|
|
1511
1512
|
if (c.statementStart === e.start) c.statementStart = this.start, c.kind = o;
|
|
1512
1513
|
else break;
|
|
@@ -1519,20 +1520,20 @@ R.parseCatchClauseParam = function() {
|
|
|
1519
1520
|
}, R.parseExpressionStatement = function(e, t) {
|
|
1520
1521
|
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
1521
1522
|
}, R.parseBlock = function(e, t, n) {
|
|
1522
|
-
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(
|
|
1523
|
+
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(D.braceL), e && this.enterScope(0); this.type !== D.braceR;) {
|
|
1523
1524
|
var r = this.parseStatement(null);
|
|
1524
1525
|
t.body.push(r);
|
|
1525
1526
|
}
|
|
1526
1527
|
return n && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
1527
1528
|
}, R.parseFor = function(e, t) {
|
|
1528
|
-
return e.init = t, this.expect(
|
|
1529
|
+
return e.init = t, this.expect(D.semi), e.test = this.type === D.semi ? null : this.parseExpression(), this.expect(D.semi), e.update = this.type === D.parenR ? null : this.parseExpression(), this.expect(D.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
1529
1530
|
}, 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(
|
|
1531
|
+
var n = this.type === D._in;
|
|
1532
|
+
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(D.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
|
|
1532
1533
|
}, R.parseVar = function(e, t, n, r) {
|
|
1533
1534
|
for (e.declarations = [], e.kind = n;;) {
|
|
1534
1535
|
var i = this.startNode();
|
|
1535
|
-
if (this.parseVarId(i, n), this.eat(
|
|
1536
|
+
if (this.parseVarId(i, n), this.eat(D.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === D._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== D._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && (!t || this.type !== D._in && !this.isContextual("of")) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, e.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(D.comma)) break;
|
|
1536
1537
|
}
|
|
1537
1538
|
return e;
|
|
1538
1539
|
}, R.parseVarId = function(e, t) {
|
|
@@ -1540,60 +1541,60 @@ R.parseCatchClauseParam = function() {
|
|
|
1540
1541
|
};
|
|
1541
1542
|
var qe = 1, Je = 2, Ye = 4;
|
|
1542
1543
|
R.parseFunction = function(e, t, n, r, i) {
|
|
1543
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type ===
|
|
1544
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === D.star && t & Je && this.unexpected(), e.generator = this.eat(D.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & qe && (e.id = t & Ye && this.type !== D.name ? null : this.parseIdent(), e.id && !(t & Je) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? Re : P : ze));
|
|
1544
1545
|
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
1545
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ie(e.async, e.generator)), t & qe || (e.id = this.type ===
|
|
1546
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ie(e.async, e.generator)), t & qe || (e.id = this.type === D.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, n, !1, i), this.yieldPos = a, this.awaitPos = o, this.awaitIdentPos = s, this.finishNode(e, t & qe ? "FunctionDeclaration" : "FunctionExpression");
|
|
1546
1547
|
}, R.parseFunctionParams = function(e) {
|
|
1547
|
-
this.expect(
|
|
1548
|
+
this.expect(D.parenL), e.params = this.parseBindingList(D.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
1548
1549
|
}, R.parseClass = function(e, t) {
|
|
1549
1550
|
this.next();
|
|
1550
1551
|
var n = this.strict;
|
|
1551
1552
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
1552
1553
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
1553
|
-
for (i.body = [], this.expect(
|
|
1554
|
+
for (i.body = [], this.expect(D.braceL); this.type !== D.braceR;) {
|
|
1554
1555
|
var o = this.parseClassElement(e.superClass !== null);
|
|
1555
1556
|
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" && Xe(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
1556
1557
|
}
|
|
1557
1558
|
return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
1558
1559
|
}, R.parseClassElement = function(e) {
|
|
1559
|
-
if (this.eat(
|
|
1560
|
+
if (this.eat(D.semi)) return null;
|
|
1560
1561
|
var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
|
|
1561
1562
|
if (this.eatContextual("static")) {
|
|
1562
|
-
if (t >= 13 && this.eat(
|
|
1563
|
-
this.isClassElementNameStart() || this.type ===
|
|
1563
|
+
if (t >= 13 && this.eat(D.braceL)) return this.parseClassStaticBlock(n), n;
|
|
1564
|
+
this.isClassElementNameStart() || this.type === D.star ? s = !0 : r = "static";
|
|
1564
1565
|
}
|
|
1565
|
-
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type ===
|
|
1566
|
+
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === D.star) && !this.canInsertSemicolon() ? a = !0 : r = "async"), !r && (t >= 9 || !a) && this.eat(D.star) && (i = !0), !r && !a && !i) {
|
|
1566
1567
|
var c = this.value;
|
|
1567
1568
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
1568
1569
|
}
|
|
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
|
+
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type === D.parenL || o !== "method" || i || a) {
|
|
1570
1571
|
var l = !n.static && Ze(n, "constructor"), u = l && e;
|
|
1571
1572
|
l && o !== "method" && this.raise(n.key.start, "Constructor can't have get/set modifier"), n.kind = l ? "constructor" : o, this.parseClassMethod(n, i, a, u);
|
|
1572
1573
|
} else this.parseClassField(n);
|
|
1573
1574
|
return n;
|
|
1574
1575
|
}, R.isClassElementNameStart = function() {
|
|
1575
|
-
return this.type ===
|
|
1576
|
+
return this.type === D.name || this.type === D.privateId || this.type === D.num || this.type === D.string || this.type === D.bracketL || this.type.keyword;
|
|
1576
1577
|
}, R.parseClassElementName = function(e) {
|
|
1577
|
-
this.type ===
|
|
1578
|
+
this.type === D.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
|
|
1578
1579
|
}, R.parseClassMethod = function(e, t, n, r) {
|
|
1579
1580
|
var i = e.key;
|
|
1580
1581
|
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static && Ze(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
1581
1582
|
var a = e.value = this.parseMethod(t, n, r);
|
|
1582
1583
|
return e.kind === "get" && a.params.length !== 0 && this.raiseRecoverable(a.start, "getter should have no params"), e.kind === "set" && a.params.length !== 1 && this.raiseRecoverable(a.start, "setter should have exactly one param"), e.kind === "set" && a.params[0].type === "RestElement" && this.raiseRecoverable(a.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
1583
1584
|
}, R.parseClassField = function(e) {
|
|
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(
|
|
1585
|
+
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(D.eq) ? (this.enterScope(Ne | Ae), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
1585
1586
|
}, R.parseClassStaticBlock = function(e) {
|
|
1586
1587
|
e.body = [];
|
|
1587
1588
|
var t = this.labels;
|
|
1588
|
-
for (this.labels = [], this.enterScope(
|
|
1589
|
+
for (this.labels = [], this.enterScope(Me | Ae); this.type !== D.braceR;) {
|
|
1589
1590
|
var n = this.parseStatement(null);
|
|
1590
1591
|
e.body.push(n);
|
|
1591
1592
|
}
|
|
1592
1593
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
1593
1594
|
}, R.parseClassId = function(e, t) {
|
|
1594
|
-
this.type ===
|
|
1595
|
+
this.type === D.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, P, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
1595
1596
|
}, R.parseClassSuper = function(e) {
|
|
1596
|
-
e.superClass = this.eat(
|
|
1597
|
+
e.superClass = this.eat(D._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
1597
1598
|
}, R.enterClassBody = function() {
|
|
1598
1599
|
var e = {
|
|
1599
1600
|
declared: Object.create(null),
|
|
@@ -1604,7 +1605,7 @@ R.parseFunction = function(e, t, n, r, i) {
|
|
|
1604
1605
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
1605
1606
|
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
1606
1607
|
var o = n[a];
|
|
1607
|
-
|
|
1608
|
+
he(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
1608
1609
|
}
|
|
1609
1610
|
};
|
|
1610
1611
|
function Xe(e, t) {
|
|
@@ -1616,13 +1617,13 @@ function Ze(e, t) {
|
|
|
1616
1617
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
1617
1618
|
}
|
|
1618
1619
|
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 !==
|
|
1620
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== D.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
1620
1621
|
}, R.parseExport = function(e, t) {
|
|
1621
|
-
if (this.next(), this.eat(
|
|
1622
|
-
if (this.eat(
|
|
1622
|
+
if (this.next(), this.eat(D.star)) return this.parseExportAllDeclaration(e, t);
|
|
1623
|
+
if (this.eat(D._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
1623
1624
|
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
1625
|
else {
|
|
1625
|
-
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !==
|
|
1626
|
+
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== D.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
1626
1627
|
else {
|
|
1627
1628
|
for (var n = 0, r = e.specifiers; n < r.length; n += 1) {
|
|
1628
1629
|
var i = r[n];
|
|
@@ -1637,18 +1638,18 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1637
1638
|
return this.parseStatement(null);
|
|
1638
1639
|
}, R.parseExportDefaultDeclaration = function() {
|
|
1639
1640
|
var e;
|
|
1640
|
-
if (this.type ===
|
|
1641
|
+
if (this.type === D._function || (e = this.isAsyncFunction())) {
|
|
1641
1642
|
var t = this.startNode();
|
|
1642
1643
|
return this.next(), e && this.next(), this.parseFunction(t, qe | Ye, !1, e);
|
|
1643
|
-
}
|
|
1644
|
+
}
|
|
1645
|
+
if (this.type === D._class) {
|
|
1644
1646
|
var n = this.startNode();
|
|
1645
1647
|
return this.parseClass(n, "nullableID");
|
|
1646
|
-
} else {
|
|
1647
|
-
var r = this.parseMaybeAssign();
|
|
1648
|
-
return this.semicolon(), r;
|
|
1649
1648
|
}
|
|
1649
|
+
var r = this.parseMaybeAssign();
|
|
1650
|
+
return this.semicolon(), r;
|
|
1650
1651
|
}, R.checkExport = function(e, t, n) {
|
|
1651
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
1652
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), he(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
1652
1653
|
}, R.checkPatternExport = function(e, t) {
|
|
1653
1654
|
var n = t.type;
|
|
1654
1655
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
@@ -1673,14 +1674,14 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1673
1674
|
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
1675
|
}, R.parseExportSpecifiers = function(e) {
|
|
1675
1676
|
var t = [], n = !0;
|
|
1676
|
-
for (this.expect(
|
|
1677
|
+
for (this.expect(D.braceL); !this.eat(D.braceR);) {
|
|
1677
1678
|
if (n) n = !1;
|
|
1678
|
-
else if (this.expect(
|
|
1679
|
+
else if (this.expect(D.comma), this.afterTrailingComma(D.braceR)) break;
|
|
1679
1680
|
t.push(this.parseExportSpecifier(e));
|
|
1680
1681
|
}
|
|
1681
1682
|
return t;
|
|
1682
1683
|
}, R.parseImport = function(e) {
|
|
1683
|
-
return this.next(), this.type ===
|
|
1684
|
+
return this.next(), this.type === D.string ? (e.specifiers = Ke, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === D.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
1684
1685
|
}, R.parseImportSpecifier = function() {
|
|
1685
1686
|
var e = this.startNode();
|
|
1686
1687
|
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, P), this.finishNode(e, "ImportSpecifier");
|
|
@@ -1692,32 +1693,32 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1692
1693
|
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, P), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
1693
1694
|
}, R.parseImportSpecifiers = function() {
|
|
1694
1695
|
var e = [], t = !0;
|
|
1695
|
-
if (this.type ===
|
|
1696
|
-
if (this.type ===
|
|
1697
|
-
for (this.expect(
|
|
1696
|
+
if (this.type === D.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(D.comma))) return e;
|
|
1697
|
+
if (this.type === D.star) return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
1698
|
+
for (this.expect(D.braceL); !this.eat(D.braceR);) {
|
|
1698
1699
|
if (t) t = !1;
|
|
1699
|
-
else if (this.expect(
|
|
1700
|
+
else if (this.expect(D.comma), this.afterTrailingComma(D.braceR)) break;
|
|
1700
1701
|
e.push(this.parseImportSpecifier());
|
|
1701
1702
|
}
|
|
1702
1703
|
return e;
|
|
1703
1704
|
}, R.parseWithClause = function() {
|
|
1704
1705
|
var e = [];
|
|
1705
|
-
if (!this.eat(
|
|
1706
|
-
this.expect(
|
|
1707
|
-
for (var t = {}, n = !0; !this.eat(
|
|
1706
|
+
if (!this.eat(D._with)) return e;
|
|
1707
|
+
this.expect(D.braceL);
|
|
1708
|
+
for (var t = {}, n = !0; !this.eat(D.braceR);) {
|
|
1708
1709
|
if (n) n = !1;
|
|
1709
|
-
else if (this.expect(
|
|
1710
|
+
else if (this.expect(D.comma), this.afterTrailingComma(D.braceR)) break;
|
|
1710
1711
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
1711
|
-
|
|
1712
|
+
he(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
1712
1713
|
}
|
|
1713
1714
|
return e;
|
|
1714
1715
|
}, R.parseImportAttribute = function() {
|
|
1715
1716
|
var e = this.startNode();
|
|
1716
|
-
return e.key = this.type ===
|
|
1717
|
+
return e.key = this.type === D.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(D.colon), this.type !== D.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
1717
1718
|
}, R.parseModuleExportName = function() {
|
|
1718
|
-
if (this.options.ecmaVersion >= 13 && this.type ===
|
|
1719
|
+
if (this.options.ecmaVersion >= 13 && this.type === D.string) {
|
|
1719
1720
|
var e = this.parseLiteral(this.value);
|
|
1720
|
-
return
|
|
1721
|
+
return ve.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
1721
1722
|
}
|
|
1722
1723
|
return this.parseIdent(!0);
|
|
1723
1724
|
}, R.adaptDirectivePrologue = function(e) {
|
|
@@ -1780,21 +1781,21 @@ z.toAssignable = function(e, t, n) {
|
|
|
1780
1781
|
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
1781
1782
|
}, z.parseRestBinding = function() {
|
|
1782
1783
|
var e = this.startNode();
|
|
1783
|
-
return this.next(), this.options.ecmaVersion === 6 && this.type !==
|
|
1784
|
+
return this.next(), this.options.ecmaVersion === 6 && this.type !== D.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
1784
1785
|
}, z.parseBindingAtom = function() {
|
|
1785
1786
|
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
1786
|
-
case
|
|
1787
|
+
case D.bracketL:
|
|
1787
1788
|
var e = this.startNode();
|
|
1788
|
-
return this.next(), e.elements = this.parseBindingList(
|
|
1789
|
-
case
|
|
1789
|
+
return this.next(), e.elements = this.parseBindingList(D.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
1790
|
+
case D.braceL: return this.parseObj(!0);
|
|
1790
1791
|
}
|
|
1791
1792
|
return this.parseIdent();
|
|
1792
1793
|
}, z.parseBindingList = function(e, t, n, r) {
|
|
1793
|
-
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(
|
|
1794
|
+
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(D.comma), t && this.type === D.comma) i.push(null);
|
|
1794
1795
|
else if (n && this.afterTrailingComma(e)) break;
|
|
1795
|
-
else if (this.type ===
|
|
1796
|
+
else if (this.type === D.ellipsis) {
|
|
1796
1797
|
var o = this.parseRestBinding();
|
|
1797
|
-
this.parseBindingListItem(o), i.push(o), this.type ===
|
|
1798
|
+
this.parseBindingListItem(o), i.push(o), this.type === D.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
1798
1799
|
break;
|
|
1799
1800
|
} else i.push(this.parseAssignableListItem(r));
|
|
1800
1801
|
return i;
|
|
@@ -1804,7 +1805,7 @@ z.toAssignable = function(e, t, n) {
|
|
|
1804
1805
|
}, z.parseBindingListItem = function(e) {
|
|
1805
1806
|
return e;
|
|
1806
1807
|
}, z.parseMaybeDefault = function(e, t, n) {
|
|
1807
|
-
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(
|
|
1808
|
+
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(D.eq)) return n;
|
|
1808
1809
|
var r = this.startNodeAt(e, t);
|
|
1809
1810
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
1810
1811
|
}, z.checkLValSimple = function(e, t, n) {
|
|
@@ -1812,7 +1813,7 @@ z.toAssignable = function(e, t, n) {
|
|
|
1812
1813
|
var r = t !== Le;
|
|
1813
1814
|
switch (e.type) {
|
|
1814
1815
|
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 && (
|
|
1816
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === P && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (he(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== Ve && this.declareName(e.name, t, e.start));
|
|
1816
1817
|
break;
|
|
1817
1818
|
case "ChainExpression":
|
|
1818
1819
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -1875,7 +1876,7 @@ Qe.initialContext = function() {
|
|
|
1875
1876
|
return this.context[this.context.length - 1];
|
|
1876
1877
|
}, Qe.braceIsBlock = function(e) {
|
|
1877
1878
|
var t = this.curContext();
|
|
1878
|
-
return t === V.f_expr || t === V.f_stat ? !0 : e ===
|
|
1879
|
+
return t === V.f_expr || t === V.f_stat ? !0 : e === D.colon && (t === V.b_stat || t === V.b_expr) ? !t.isExpr : e === D._return || e === D.name && this.exprAllowed ? O.test(this.input.slice(this.lastTokEnd, this.start)) : e === D._else || e === D.semi || e === D.eof || e === D.parenR || e === D.arrow ? !0 : e === D.braceL ? t === V.b_stat : e === D._var || e === D._const || e === D.name ? !1 : !this.exprAllowed;
|
|
1879
1880
|
}, Qe.inGeneratorContext = function() {
|
|
1880
1881
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
1881
1882
|
var t = this.context[e];
|
|
@@ -1884,38 +1885,38 @@ Qe.initialContext = function() {
|
|
|
1884
1885
|
return !1;
|
|
1885
1886
|
}, Qe.updateContext = function(e) {
|
|
1886
1887
|
var t, n = this.type;
|
|
1887
|
-
n.keyword && e ===
|
|
1888
|
+
n.keyword && e === D.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
1888
1889
|
}, Qe.overrideContext = function(e) {
|
|
1889
1890
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
1890
|
-
},
|
|
1891
|
+
}, D.parenR.updateContext = D.braceR.updateContext = function() {
|
|
1891
1892
|
if (this.context.length === 1) {
|
|
1892
1893
|
this.exprAllowed = !0;
|
|
1893
1894
|
return;
|
|
1894
1895
|
}
|
|
1895
1896
|
var e = this.context.pop();
|
|
1896
1897
|
e === V.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
1897
|
-
},
|
|
1898
|
+
}, D.braceL.updateContext = function(e) {
|
|
1898
1899
|
this.context.push(this.braceIsBlock(e) ? V.b_stat : V.b_expr), this.exprAllowed = !0;
|
|
1899
|
-
},
|
|
1900
|
+
}, D.dollarBraceL.updateContext = function() {
|
|
1900
1901
|
this.context.push(V.b_tmpl), this.exprAllowed = !0;
|
|
1901
|
-
},
|
|
1902
|
-
var t = e ===
|
|
1902
|
+
}, D.parenL.updateContext = function(e) {
|
|
1903
|
+
var t = e === D._if || e === D._for || e === D._with || e === D._while;
|
|
1903
1904
|
this.context.push(t ? V.p_stat : V.p_expr), this.exprAllowed = !0;
|
|
1904
|
-
},
|
|
1905
|
-
e.beforeExpr && e !==
|
|
1906
|
-
},
|
|
1905
|
+
}, D.incDec.updateContext = function() {}, D._function.updateContext = D._class.updateContext = function(e) {
|
|
1906
|
+
e.beforeExpr && e !== D._else && (e !== D.semi || this.curContext() === V.p_stat) && !(e === D._return && O.test(this.input.slice(this.lastTokEnd, this.start))) && (e !== D.colon && e !== D.braceL || this.curContext() !== V.b_stat) ? this.context.push(V.f_expr) : this.context.push(V.f_stat), this.exprAllowed = !1;
|
|
1907
|
+
}, D.colon.updateContext = function() {
|
|
1907
1908
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
1908
|
-
},
|
|
1909
|
+
}, D.backQuote.updateContext = function() {
|
|
1909
1910
|
this.curContext() === V.q_tmpl ? this.context.pop() : this.context.push(V.q_tmpl), this.exprAllowed = !1;
|
|
1910
|
-
},
|
|
1911
|
-
if (e ===
|
|
1911
|
+
}, D.star.updateContext = function(e) {
|
|
1912
|
+
if (e === D._function) {
|
|
1912
1913
|
var t = this.context.length - 1;
|
|
1913
1914
|
this.context[t] === V.f_expr ? this.context[t] = V.f_expr_gen : this.context[t] = V.f_gen;
|
|
1914
1915
|
}
|
|
1915
1916
|
this.exprAllowed = !0;
|
|
1916
|
-
},
|
|
1917
|
+
}, D.name.updateContext = function(e) {
|
|
1917
1918
|
var t = !1;
|
|
1918
|
-
this.options.ecmaVersion >= 6 && e !==
|
|
1919
|
+
this.options.ecmaVersion >= 6 && e !== D.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
1919
1920
|
};
|
|
1920
1921
|
var H = F.prototype;
|
|
1921
1922
|
H.checkPropClash = function(e, t, n) {
|
|
@@ -1947,9 +1948,9 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1947
1948
|
var n = this;
|
|
1948
1949
|
return this.catchStackOverflow(function() {
|
|
1949
1950
|
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
1950
|
-
if (n.type ===
|
|
1951
|
+
if (n.type === D.comma) {
|
|
1951
1952
|
var o = n.startNodeAt(r, i);
|
|
1952
|
-
for (o.expressions = [a]; n.eat(
|
|
1953
|
+
for (o.expressions = [a]; n.eat(D.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
|
|
1953
1954
|
return n.finishNode(o, "SequenceExpression");
|
|
1954
1955
|
}
|
|
1955
1956
|
return a;
|
|
@@ -1962,19 +1963,19 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1962
1963
|
var r = !1, i = -1, a = -1, o = -1;
|
|
1963
1964
|
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new Ue(), r = !0);
|
|
1964
1965
|
var s = this.start, c = this.startLoc;
|
|
1965
|
-
(this.type ===
|
|
1966
|
+
(this.type === D.parenL || this.type === D.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
1966
1967
|
var l = this.parseMaybeConditional(e, t);
|
|
1967
1968
|
if (n && (l = n.call(this, l, s, c)), this.type.isAssign) {
|
|
1968
1969
|
var u = this.startNodeAt(s, c);
|
|
1969
|
-
return u.operator = this.value, this.type ===
|
|
1970
|
-
}
|
|
1971
|
-
return i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
1970
|
+
return u.operator = this.value, this.type === D.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === D.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), u.left = l, this.next(), u.right = this.parseMaybeAssign(e), o > -1 && (t.doubleProto = o), this.finishNode(u, "AssignmentExpression");
|
|
1971
|
+
}
|
|
1972
|
+
return r && this.checkExpressionErrors(t, !0), i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
1972
1973
|
}, H.parseMaybeConditional = function(e, t) {
|
|
1973
1974
|
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
1974
1975
|
if (this.checkExpressionErrors(t)) return i;
|
|
1975
|
-
if (
|
|
1976
|
+
if ((i.type !== "ArrowFunctionExpression" || i.start !== n) && this.eat(D.question)) {
|
|
1976
1977
|
var a = this.startNodeAt(n, r);
|
|
1977
|
-
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(
|
|
1978
|
+
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(D.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
1978
1979
|
}
|
|
1979
1980
|
return i;
|
|
1980
1981
|
}, H.parseExprOps = function(e, t) {
|
|
@@ -1982,13 +1983,13 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1982
1983
|
return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
|
|
1983
1984
|
}, H.parseExprOp = function(e, t, n, r, i) {
|
|
1984
1985
|
var a = this.type.binop;
|
|
1985
|
-
if (a != null && (!i || this.type !==
|
|
1986
|
-
var o = this.type ===
|
|
1987
|
-
s && (a =
|
|
1986
|
+
if (a != null && (!i || this.type !== D._in) && a > r) {
|
|
1987
|
+
var o = this.type === D.logicalOR || this.type === D.logicalAND, s = this.type === D.coalesce;
|
|
1988
|
+
s && (a = D.logicalAND.binop);
|
|
1988
1989
|
var c = this.value;
|
|
1989
1990
|
this.next();
|
|
1990
1991
|
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 ===
|
|
1992
|
+
return (o && this.type === D.coalesce || s && (this.type === D.logicalOR || this.type === D.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(f, t, n, r, i);
|
|
1992
1993
|
}
|
|
1993
1994
|
return e;
|
|
1994
1995
|
}, H.buildBinary = function(e, t, n, r, i, a) {
|
|
@@ -1999,9 +2000,9 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1999
2000
|
var i = this.start, a = this.startLoc, o;
|
|
2000
2001
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
2001
2002
|
else if (this.type.prefix) {
|
|
2002
|
-
var s = this.startNode(), c = this.type ===
|
|
2003
|
+
var s = this.startNode(), c = this.type === D.incDec;
|
|
2003
2004
|
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" && $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 ===
|
|
2005
|
+
} else if (!t && this.type === D.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== D._in && this.unexpected();
|
|
2005
2006
|
else {
|
|
2006
2007
|
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
2007
2008
|
for (; this.type.postfix && !this.canInsertSemicolon();) {
|
|
@@ -2009,9 +2010,10 @@ H.checkPropClash = function(e, t, n) {
|
|
|
2009
2010
|
l.operator = this.value, l.prefix = !1, l.argument = o, this.checkLValSimple(o), this.next(), o = this.finishNode(l, "UpdateExpression");
|
|
2010
2011
|
}
|
|
2011
2012
|
}
|
|
2012
|
-
if (!n &&
|
|
2013
|
-
|
|
2014
|
-
|
|
2013
|
+
if (!n && (o.type !== "ArrowFunctionExpression" || o.start !== i) && this.eat(D.starstar)) {
|
|
2014
|
+
if (t) this.unexpected(this.lastTokStart);
|
|
2015
|
+
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
2016
|
+
} else return o;
|
|
2015
2017
|
};
|
|
2016
2018
|
function $e(e) {
|
|
2017
2019
|
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && $e(e.expression);
|
|
@@ -2037,81 +2039,82 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2037
2039
|
e = s;
|
|
2038
2040
|
}
|
|
2039
2041
|
}, H.shouldParseAsyncArrow = function() {
|
|
2040
|
-
return !this.canInsertSemicolon() && this.eat(
|
|
2042
|
+
return !this.canInsertSemicolon() && this.eat(D.arrow);
|
|
2041
2043
|
}, H.parseSubscriptAsyncArrow = function(e, t, n, r) {
|
|
2042
2044
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
|
|
2043
2045
|
}, H.parseSubscript = function(e, t, n, r, i, a, o) {
|
|
2044
|
-
var s = this.options.ecmaVersion >= 11, c = s && this.eat(
|
|
2046
|
+
var s = this.options.ecmaVersion >= 11, c = s && this.eat(D.questionDot);
|
|
2045
2047
|
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 !==
|
|
2048
|
+
var l = this.eat(D.bracketL);
|
|
2049
|
+
if (l || c && this.type !== D.parenL && this.type !== D.backQuote || this.eat(D.dot)) {
|
|
2048
2050
|
var u = this.startNodeAt(t, n);
|
|
2049
|
-
u.object = e, l ? (u.property = this.parseExpression(), this.expect(
|
|
2050
|
-
} else if (!r && this.eat(
|
|
2051
|
+
u.object = e, l ? (u.property = this.parseExpression(), this.expect(D.bracketR)) : u.property = this.type === D.privateId && e.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
2052
|
+
} else if (!r && this.eat(D.parenL)) {
|
|
2051
2053
|
var d = new Ue(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
2052
2054
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
2053
|
-
var ee = this.parseExprList(
|
|
2055
|
+
var ee = this.parseExprList(D.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
2054
2056
|
if (i && !c && this.shouldParseAsyncArrow()) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = f, this.awaitPos = p, this.awaitIdentPos = m, this.parseSubscriptAsyncArrow(t, n, ee, o);
|
|
2055
2057
|
this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
|
|
2056
2058
|
var h = this.startNodeAt(t, n);
|
|
2057
2059
|
h.callee = e, h.arguments = ee, s && (h.optional = c), e = this.finishNode(h, "CallExpression");
|
|
2058
|
-
} else if (this.type ===
|
|
2060
|
+
} else if (this.type === D.backQuote) {
|
|
2059
2061
|
(c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
2060
2062
|
var g = this.startNodeAt(t, n);
|
|
2061
2063
|
g.tag = e, g.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(g, "TaggedTemplateExpression");
|
|
2062
2064
|
}
|
|
2063
2065
|
return e;
|
|
2064
2066
|
}, H.parseExprAtom = function(e, t, n) {
|
|
2065
|
-
this.type ===
|
|
2067
|
+
this.type === D.slash && this.readRegexp();
|
|
2066
2068
|
var r, i = this.potentialArrowAt === this.start;
|
|
2067
2069
|
switch (this.type) {
|
|
2068
|
-
case
|
|
2069
|
-
case
|
|
2070
|
-
case
|
|
2070
|
+
case D._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === D.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== D.dot && this.type !== D.bracketL && this.type !== D.parenL && this.unexpected(), this.finishNode(r, "Super");
|
|
2071
|
+
case D._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
2072
|
+
case D.name:
|
|
2071
2073
|
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(
|
|
2074
|
+
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(D._function)) return this.overrideContext(V.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
|
|
2073
2075
|
if (i && !this.canInsertSemicolon()) {
|
|
2074
|
-
if (this.eat(
|
|
2075
|
-
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type ===
|
|
2076
|
+
if (this.eat(D.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
|
|
2077
|
+
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === D.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(D.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
|
|
2076
2078
|
}
|
|
2077
2079
|
return c;
|
|
2078
|
-
case
|
|
2080
|
+
case D.regexp:
|
|
2079
2081
|
var l = this.value;
|
|
2080
2082
|
return r = this.parseLiteral(l.value), r.regex = {
|
|
2081
2083
|
pattern: l.pattern,
|
|
2082
2084
|
flags: l.flags
|
|
2083
2085
|
}, r;
|
|
2084
|
-
case
|
|
2085
|
-
case
|
|
2086
|
-
case
|
|
2087
|
-
case
|
|
2088
|
-
case
|
|
2089
|
-
case
|
|
2086
|
+
case D.num:
|
|
2087
|
+
case D.string: return this.parseLiteral(this.value);
|
|
2088
|
+
case D._null:
|
|
2089
|
+
case D._true:
|
|
2090
|
+
case D._false: return r = this.startNode(), r.value = this.type === D._null ? null : this.type === D._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
|
|
2091
|
+
case D.parenL:
|
|
2090
2092
|
var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
|
|
2091
2093
|
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
|
|
2094
|
+
case D.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(D.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
2095
|
+
case D.braceL: return this.overrideContext(V.b_expr), this.parseObj(!1, e);
|
|
2096
|
+
case D._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
2097
|
+
case D._class: return this.parseClass(this.startNode(), !1);
|
|
2098
|
+
case D._new: return this.parseNew();
|
|
2099
|
+
case D.backQuote: return this.parseTemplate();
|
|
2100
|
+
case D._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
|
|
2099
2101
|
default: return this.parseExprAtomDefault();
|
|
2100
2102
|
}
|
|
2101
2103
|
}, H.parseExprAtomDefault = function() {
|
|
2102
2104
|
this.unexpected();
|
|
2103
2105
|
}, H.parseExprImport = function(e) {
|
|
2104
2106
|
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 ===
|
|
2107
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === D.parenL && !e) return this.parseDynamicImport(t);
|
|
2108
|
+
if (this.type === D.dot) {
|
|
2107
2109
|
var n = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
2108
2110
|
return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
|
|
2109
|
-
}
|
|
2111
|
+
}
|
|
2112
|
+
this.unexpected();
|
|
2110
2113
|
}, H.parseDynamicImport = function(e) {
|
|
2111
|
-
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(
|
|
2112
|
-
else if (!this.eat(
|
|
2114
|
+
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(D.parenR) ? e.options = null : (this.expect(D.comma), this.afterTrailingComma(D.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(D.parenR) || (this.expect(D.comma), this.afterTrailingComma(D.parenR) || this.unexpected())));
|
|
2115
|
+
else if (!this.eat(D.parenR)) {
|
|
2113
2116
|
var t = this.start;
|
|
2114
|
-
this.eat(
|
|
2117
|
+
this.eat(D.comma) && this.eat(D.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
2115
2118
|
}
|
|
2116
2119
|
return this.finishNode(e, "ImportExpression");
|
|
2117
2120
|
}, H.parseImportMeta = function(e) {
|
|
@@ -2122,9 +2125,9 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2122
2125
|
var t = this.startNode();
|
|
2123
2126
|
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
2127
|
}, H.parseParenExpression = function() {
|
|
2125
|
-
this.expect(
|
|
2128
|
+
this.expect(D.parenL);
|
|
2126
2129
|
var e = this.parseExpression();
|
|
2127
|
-
return this.expect(
|
|
2130
|
+
return this.expect(D.parenR), e;
|
|
2128
2131
|
}, H.shouldParseArrow = function(e) {
|
|
2129
2132
|
return !this.canInsertSemicolon();
|
|
2130
2133
|
}, H.parseParenAndDistinguishExpression = function(e, t) {
|
|
@@ -2132,21 +2135,26 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2132
2135
|
if (this.options.ecmaVersion >= 6) {
|
|
2133
2136
|
this.next();
|
|
2134
2137
|
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 !==
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2138
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== D.parenR;) {
|
|
2139
|
+
if (l ? l = !1 : this.expect(D.comma), a && this.afterTrailingComma(D.parenR, !0)) {
|
|
2140
|
+
u = !0;
|
|
2141
|
+
break;
|
|
2142
|
+
}
|
|
2143
|
+
if (this.type === D.ellipsis) {
|
|
2144
|
+
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type === D.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
2145
|
+
break;
|
|
2146
|
+
}
|
|
2147
|
+
c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
|
|
2148
|
+
}
|
|
2142
2149
|
var ee = this.lastTokEnd, h = this.lastTokEndLoc;
|
|
2143
|
-
if (this.expect(
|
|
2150
|
+
if (this.expect(D.parenR), e && this.shouldParseArrow(c) && this.eat(D.arrow)) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = f, this.awaitPos = p, this.parseParenArrowList(n, r, c, t);
|
|
2144
2151
|
(!c.length || u) && this.unexpected(this.lastTokStart), m && this.unexpected(m), this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, c.length > 1 ? (i = this.startNodeAt(o, s), i.expressions = c, this.finishNodeAt(i, "SequenceExpression", ee, h)) : i = c[0];
|
|
2145
2152
|
} else i = this.parseParenExpression();
|
|
2146
2153
|
if (this.options.preserveParens) {
|
|
2147
2154
|
var g = this.startNodeAt(n, r);
|
|
2148
2155
|
return g.expression = i, this.finishNode(g, "ParenthesizedExpression");
|
|
2149
|
-
}
|
|
2156
|
+
}
|
|
2157
|
+
return i;
|
|
2150
2158
|
}, H.parseParenItem = function(e) {
|
|
2151
2159
|
return e;
|
|
2152
2160
|
}, H.parseParenArrowList = function(e, t, n, r) {
|
|
@@ -2156,23 +2164,23 @@ var tt = [];
|
|
|
2156
2164
|
H.parseNew = function() {
|
|
2157
2165
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
2158
2166
|
var e = this.startNode();
|
|
2159
|
-
if (this.next(), this.options.ecmaVersion >= 6 && this.type ===
|
|
2167
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === D.dot) {
|
|
2160
2168
|
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
2161
2169
|
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
2162
2170
|
var n = this.containsEsc;
|
|
2163
2171
|
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), n && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
2164
2172
|
}
|
|
2165
2173
|
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(
|
|
2174
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), e.arguments = this.eat(D.parenL) ? this.parseExprList(D.parenR, this.options.ecmaVersion >= 8, !1) : tt, this.finishNode(e, "NewExpression");
|
|
2167
2175
|
}, H.parseTemplateElement = function(e) {
|
|
2168
2176
|
var t = e.isTagged, n = this.startNode();
|
|
2169
|
-
return this.type ===
|
|
2177
|
+
return this.type === D.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
2170
2178
|
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
2171
2179
|
cooked: null
|
|
2172
2180
|
}) : n.value = {
|
|
2173
2181
|
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
|
|
2174
2182
|
cooked: this.value
|
|
2175
|
-
}, this.next(), n.tail = this.type ===
|
|
2183
|
+
}, this.next(), n.tail = this.type === D.backQuote, this.finishNode(n, "TemplateElement");
|
|
2176
2184
|
}, H.parseTemplate = function(e) {
|
|
2177
2185
|
e === void 0 && (e = {});
|
|
2178
2186
|
var t = e.isTagged;
|
|
@@ -2180,25 +2188,25 @@ H.parseNew = function() {
|
|
|
2180
2188
|
var n = this.startNode();
|
|
2181
2189
|
this.next(), n.expressions = [];
|
|
2182
2190
|
var r = this.parseTemplateElement({ isTagged: t });
|
|
2183
|
-
for (n.quasis = [r]; !r.tail;) this.type ===
|
|
2191
|
+
for (n.quasis = [r]; !r.tail;) this.type === D.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(D.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(D.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
2184
2192
|
return this.next(), this.finishNode(n, "TemplateLiteral");
|
|
2185
2193
|
}, H.isAsyncProp = function(e) {
|
|
2186
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type ===
|
|
2194
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === D.name || this.type === D.num || this.type === D.string || this.type === D.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === D.star) && !O.test(this.input.slice(this.lastTokEnd, this.start));
|
|
2187
2195
|
}, H.parseObj = function(e, t) {
|
|
2188
2196
|
var n = this.startNode(), r = !0, i = {};
|
|
2189
|
-
for (n.properties = [], this.next(); !this.eat(
|
|
2197
|
+
for (n.properties = [], this.next(); !this.eat(D.braceR);) {
|
|
2190
2198
|
if (r) r = !1;
|
|
2191
|
-
else if (this.expect(
|
|
2199
|
+
else if (this.expect(D.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(D.braceR)) break;
|
|
2192
2200
|
var a = this.parseProperty(e, t);
|
|
2193
2201
|
e || this.checkPropClash(a, i, t), n.properties.push(a);
|
|
2194
2202
|
}
|
|
2195
2203
|
return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
|
|
2196
2204
|
}, H.parseProperty = function(e, t) {
|
|
2197
2205
|
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(
|
|
2206
|
+
if (this.options.ecmaVersion >= 9 && this.eat(D.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === D.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(n, "RestElement")) : (n.argument = this.parseMaybeAssign(!1, t), this.type === D.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
|
|
2207
|
+
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(D.star)));
|
|
2200
2208
|
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(
|
|
2209
|
+
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(D.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
|
|
2202
2210
|
}, H.parseGetterSetter = function(e) {
|
|
2203
2211
|
var t = e.key.name;
|
|
2204
2212
|
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
@@ -2208,23 +2216,23 @@ H.parseNew = function() {
|
|
|
2208
2216
|
e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
|
|
2209
2217
|
} else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
2210
2218
|
}, H.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
|
|
2211
|
-
(n || r) && this.type ===
|
|
2219
|
+
(n || r) && this.type === D.colon && this.unexpected(), this.eat(D.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === D.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(n, r), e.kind = "init") : !t && !s && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== D.comma && this.type !== D.braceR && this.type !== D.eq ? ((n || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((n || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = i), t ? e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key)) : this.type === D.eq && o ? (o.shorthandAssign < 0 && (o.shorthandAssign = this.start), e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
2212
2220
|
}, H.parsePropertyName = function(e) {
|
|
2213
2221
|
if (this.options.ecmaVersion >= 6) {
|
|
2214
|
-
if (this.eat(
|
|
2222
|
+
if (this.eat(D.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(D.bracketR), e.key;
|
|
2215
2223
|
e.computed = !1;
|
|
2216
2224
|
}
|
|
2217
|
-
return e.key = this.type ===
|
|
2225
|
+
return e.key = this.type === D.num || this.type === D.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2218
2226
|
}, H.initFunction = function(e) {
|
|
2219
2227
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
2220
2228
|
}, H.parseMethod = function(e, t, n) {
|
|
2221
2229
|
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(Ie(t, r.generator) |
|
|
2230
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Ie(t, r.generator) | Ae | (n ? je : 0)), this.expect(D.parenL), r.params = this.parseBindingList(D.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(r, "FunctionExpression");
|
|
2223
2231
|
}, H.parseArrowExpression = function(e, t, n, r) {
|
|
2224
2232
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2225
|
-
return this.enterScope(Ie(n, !1) |
|
|
2233
|
+
return this.enterScope(Ie(n, !1) | Oe), 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
2234
|
}, H.parseFunctionBody = function(e, t, n, r) {
|
|
2227
|
-
var i = t && this.type !==
|
|
2235
|
+
var i = t && this.type !== D.braceL, a = this.strict, o = !1;
|
|
2228
2236
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
2229
2237
|
else {
|
|
2230
2238
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
@@ -2244,9 +2252,9 @@ H.parseNew = function() {
|
|
|
2244
2252
|
}, H.parseExprList = function(e, t, n, r) {
|
|
2245
2253
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
2246
2254
|
if (a) a = !1;
|
|
2247
|
-
else if (this.expect(
|
|
2255
|
+
else if (this.expect(D.comma), t && this.afterTrailingComma(e)) break;
|
|
2248
2256
|
var o = void 0;
|
|
2249
|
-
n && this.type ===
|
|
2257
|
+
n && this.type === D.comma ? o = null : this.type === D.ellipsis ? (o = this.parseSpread(r), r && this.type === D.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
|
|
2250
2258
|
}
|
|
2251
2259
|
return i;
|
|
2252
2260
|
}, H.checkUnreserved = function(e) {
|
|
@@ -2257,14 +2265,14 @@ H.parseNew = function() {
|
|
|
2257
2265
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
2258
2266
|
}, H.parseIdentNode = function() {
|
|
2259
2267
|
var e = this.startNode();
|
|
2260
|
-
return this.type ===
|
|
2268
|
+
return this.type === D.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = D.name) : this.unexpected(), e;
|
|
2261
2269
|
}, H.parsePrivateIdent = function() {
|
|
2262
2270
|
var e = this.startNode();
|
|
2263
|
-
return this.type ===
|
|
2271
|
+
return this.type === D.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
2264
2272
|
}, H.parseYield = function(e) {
|
|
2265
2273
|
this.yieldPos ||= this.start;
|
|
2266
2274
|
var t = this.startNode();
|
|
2267
|
-
return this.next(), this.type ===
|
|
2275
|
+
return this.next(), this.type === D.semi || this.canInsertSemicolon() || this.type !== D.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(D.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
2268
2276
|
}, H.parseAwait = function(e) {
|
|
2269
2277
|
this.awaitPos ||= this.start;
|
|
2270
2278
|
var t = this.startNode();
|
|
@@ -2272,12 +2280,12 @@ H.parseNew = function() {
|
|
|
2272
2280
|
};
|
|
2273
2281
|
var nt = F.prototype;
|
|
2274
2282
|
nt.raise = function(e, t) {
|
|
2275
|
-
var n =
|
|
2283
|
+
var n = xe(this.input, e);
|
|
2276
2284
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
2277
2285
|
var r = SyntaxError(t);
|
|
2278
2286
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
2279
2287
|
}, nt.raiseRecoverable = nt.raise, nt.curPosition = function() {
|
|
2280
|
-
if (this.options.locations) return new
|
|
2288
|
+
if (this.options.locations) return new ye(this.curLine, this.pos - this.lineStart);
|
|
2281
2289
|
};
|
|
2282
2290
|
var U = F.prototype, rt = function(e) {
|
|
2283
2291
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
@@ -2287,23 +2295,23 @@ U.enterScope = function(e) {
|
|
|
2287
2295
|
}, U.exitScope = function() {
|
|
2288
2296
|
this.scopeStack.pop();
|
|
2289
2297
|
}, U.treatFunctionsAsVarInScope = function(e) {
|
|
2290
|
-
return e.flags &
|
|
2298
|
+
return e.flags & N || !this.inModule && e.flags & M;
|
|
2291
2299
|
}, U.declareName = function(e, t, n) {
|
|
2292
2300
|
var r = !1;
|
|
2293
2301
|
if (t === P) {
|
|
2294
2302
|
var i = this.currentScope();
|
|
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 &
|
|
2303
|
+
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & M && delete this.undefinedExports[e];
|
|
2296
2304
|
} else if (t === Be) this.currentScope().lexical.push(e);
|
|
2297
2305
|
else if (t === ze) {
|
|
2298
2306
|
var a = this.currentScope();
|
|
2299
2307
|
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
2300
2308
|
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
2301
2309
|
var s = this.scopeStack[o];
|
|
2302
|
-
if (s.lexical.indexOf(e) > -1 && !(s.flags &
|
|
2310
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & ke && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
2303
2311
|
r = !0;
|
|
2304
2312
|
break;
|
|
2305
2313
|
}
|
|
2306
|
-
if (s.var.push(e), this.inModule && s.flags &
|
|
2314
|
+
if (s.var.push(e), this.inModule && s.flags & M && delete this.undefinedExports[e], s.flags & Fe) break;
|
|
2307
2315
|
}
|
|
2308
2316
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
2309
2317
|
}, U.checkLocalExport = function(e) {
|
|
@@ -2313,16 +2321,16 @@ U.enterScope = function(e) {
|
|
|
2313
2321
|
}, U.currentVarScope = function() {
|
|
2314
2322
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2315
2323
|
var t = this.scopeStack[e];
|
|
2316
|
-
if (t.flags & (Fe | Ne |
|
|
2324
|
+
if (t.flags & (Fe | Ne | Me)) return t;
|
|
2317
2325
|
}
|
|
2318
2326
|
}, U.currentThisScope = function() {
|
|
2319
2327
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2320
2328
|
var t = this.scopeStack[e];
|
|
2321
|
-
if (t.flags & (Fe | Ne |
|
|
2329
|
+
if (t.flags & (Fe | Ne | Me) && !(t.flags & Oe)) return t;
|
|
2322
2330
|
}
|
|
2323
2331
|
};
|
|
2324
2332
|
var it = function(e, t, n) {
|
|
2325
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
2333
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new be(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
2326
2334
|
}, at = F.prototype;
|
|
2327
2335
|
at.startNode = function() {
|
|
2328
2336
|
return new it(this, this.start, this.startLoc);
|
|
@@ -2365,11 +2373,11 @@ var st = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana
|
|
|
2365
2373
|
}, St = {};
|
|
2366
2374
|
function Ct(e) {
|
|
2367
2375
|
var t = St[e] = {
|
|
2368
|
-
binary:
|
|
2369
|
-
binaryOfStrings:
|
|
2376
|
+
binary: A(pt[e] + " " + ht),
|
|
2377
|
+
binaryOfStrings: A(mt[e]),
|
|
2370
2378
|
nonBinary: {
|
|
2371
|
-
General_Category:
|
|
2372
|
-
Script:
|
|
2379
|
+
General_Category: A(ht),
|
|
2380
|
+
Script: A(xt[e])
|
|
2373
2381
|
}
|
|
2374
2382
|
};
|
|
2375
2383
|
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
@@ -2423,7 +2431,7 @@ G.prototype.reset = function(e, t, n) {
|
|
|
2423
2431
|
}, G.prototype.advance = function(e) {
|
|
2424
2432
|
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
2425
2433
|
}, G.prototype.eat = function(e, t) {
|
|
2426
|
-
return t === void 0 && (t = !1), this.current(t) === e
|
|
2434
|
+
return t === void 0 && (t = !1), this.current(t) === e && (this.advance(t), !0);
|
|
2427
2435
|
}, G.prototype.eatChars = function(e, t) {
|
|
2428
2436
|
t === void 0 && (t = !1);
|
|
2429
2437
|
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
@@ -2528,7 +2536,7 @@ W.validateRegExpPattern = function(e) {
|
|
|
2528
2536
|
}
|
|
2529
2537
|
return !1;
|
|
2530
2538
|
}, W.regexp_eatModifiers = function(e) {
|
|
2531
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 && kt(n);) t +=
|
|
2539
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && kt(n);) t += j(n), e.advance();
|
|
2532
2540
|
return t;
|
|
2533
2541
|
};
|
|
2534
2542
|
function kt(e) {
|
|
@@ -2550,13 +2558,15 @@ W.regexp_eatPatternCharacters = function(e) {
|
|
|
2550
2558
|
return e.pos !== t;
|
|
2551
2559
|
}, W.regexp_eatExtendedPatternCharacter = function(e) {
|
|
2552
2560
|
var t = e.current();
|
|
2553
|
-
return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124
|
|
2561
|
+
return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 && (e.advance(), !0);
|
|
2554
2562
|
}, W.regexp_groupSpecifier = function(e) {
|
|
2555
2563
|
if (e.eat(63)) {
|
|
2556
2564
|
this.regexp_eatGroupName(e) || e.raise("Invalid group");
|
|
2557
2565
|
var t = this.options.ecmaVersion >= 16, n = e.groupNames[e.lastStringValue];
|
|
2558
|
-
if (n)
|
|
2559
|
-
|
|
2566
|
+
if (n) {
|
|
2567
|
+
if (t) for (var r = 0, i = n; r < i.length; r += 1) i[r].separatedFrom(e.branchID) || e.raise("Duplicate capture group name");
|
|
2568
|
+
else e.raise("Duplicate capture group name");
|
|
2569
|
+
}
|
|
2560
2570
|
t ? (n || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = !0;
|
|
2561
2571
|
}
|
|
2562
2572
|
}, W.regexp_eatGroupName = function(e) {
|
|
@@ -2567,7 +2577,7 @@ W.regexp_eatPatternCharacters = function(e) {
|
|
|
2567
2577
|
return !1;
|
|
2568
2578
|
}, W.regexp_eatRegExpIdentifierName = function(e) {
|
|
2569
2579
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
2570
|
-
for (e.lastStringValue +=
|
|
2580
|
+
for (e.lastStringValue += j(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += j(e.lastIntValue);
|
|
2571
2581
|
return !0;
|
|
2572
2582
|
}
|
|
2573
2583
|
return !1;
|
|
@@ -2576,14 +2586,14 @@ W.regexp_eatPatternCharacters = function(e) {
|
|
|
2576
2586
|
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
2587
|
};
|
|
2578
2588
|
function jt(e) {
|
|
2579
|
-
return
|
|
2589
|
+
return b(e, !0) || e === 36 || e === 95;
|
|
2580
2590
|
}
|
|
2581
2591
|
W.regexp_eatRegExpIdentifierPart = function(e) {
|
|
2582
2592
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2583
2593
|
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
2594
|
};
|
|
2585
2595
|
function Mt(e) {
|
|
2586
|
-
return
|
|
2596
|
+
return x(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2587
2597
|
}
|
|
2588
2598
|
W.regexp_eatAtomEscape = function(e) {
|
|
2589
2599
|
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
@@ -2612,10 +2622,10 @@ W.regexp_eatAtomEscape = function(e) {
|
|
|
2612
2622
|
}
|
|
2613
2623
|
return !1;
|
|
2614
2624
|
}, W.regexp_eatZero = function(e) {
|
|
2615
|
-
return e.current() === 48 && !Ht(e.lookahead())
|
|
2625
|
+
return e.current() === 48 && !Ht(e.lookahead()) && (e.lastIntValue = 0, e.advance(), !0);
|
|
2616
2626
|
}, W.regexp_eatControlEscape = function(e) {
|
|
2617
2627
|
var t = e.current();
|
|
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
|
|
2628
|
+
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 && (e.lastIntValue = 13, e.advance(), !0);
|
|
2619
2629
|
}, W.regexp_eatControlLetter = function(e) {
|
|
2620
2630
|
var t = e.current();
|
|
2621
2631
|
return Nt(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
@@ -2650,7 +2660,7 @@ function Pt(e) {
|
|
|
2650
2660
|
W.regexp_eatIdentityEscape = function(e) {
|
|
2651
2661
|
if (e.switchU) return this.regexp_eatSyntaxCharacter(e) ? !0 : e.eat(47) ? (e.lastIntValue = 47, !0) : !1;
|
|
2652
2662
|
var t = e.current();
|
|
2653
|
-
return t !== 99 && (!e.switchN || t !== 107)
|
|
2663
|
+
return t !== 99 && (!e.switchN || t !== 107) && (e.lastIntValue = t, e.advance(), !0);
|
|
2654
2664
|
}, W.regexp_eatDecimalEscape = function(e) {
|
|
2655
2665
|
e.lastIntValue = 0;
|
|
2656
2666
|
var t = e.current();
|
|
@@ -2693,14 +2703,14 @@ W.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
|
2693
2703
|
}
|
|
2694
2704
|
return Ft;
|
|
2695
2705
|
}, W.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
2696
|
-
|
|
2706
|
+
he(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
2697
2707
|
}, W.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2698
2708
|
if (e.unicodeProperties.binary.test(t)) return K;
|
|
2699
2709
|
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return q;
|
|
2700
2710
|
e.raise("Invalid property name");
|
|
2701
2711
|
}, W.regexp_eatUnicodePropertyName = function(e) {
|
|
2702
2712
|
var t = 0;
|
|
2703
|
-
for (e.lastStringValue = ""; Lt(t = e.current());) e.lastStringValue +=
|
|
2713
|
+
for (e.lastStringValue = ""; Lt(t = e.current());) e.lastStringValue += j(t), e.advance();
|
|
2704
2714
|
return e.lastStringValue !== "";
|
|
2705
2715
|
};
|
|
2706
2716
|
function Lt(e) {
|
|
@@ -2708,7 +2718,7 @@ function Lt(e) {
|
|
|
2708
2718
|
}
|
|
2709
2719
|
W.regexp_eatUnicodePropertyValue = function(e) {
|
|
2710
2720
|
var t = 0;
|
|
2711
|
-
for (e.lastStringValue = ""; Rt(t = e.current());) e.lastStringValue +=
|
|
2721
|
+
for (e.lastStringValue = ""; Rt(t = e.current());) e.lastStringValue += j(t), e.advance();
|
|
2712
2722
|
return e.lastStringValue !== "";
|
|
2713
2723
|
};
|
|
2714
2724
|
function Rt(e) {
|
|
@@ -2743,7 +2753,7 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2743
2753
|
e.pos = t;
|
|
2744
2754
|
}
|
|
2745
2755
|
var r = e.current();
|
|
2746
|
-
return r
|
|
2756
|
+
return r !== 93 && (e.lastIntValue = r, e.advance(), !0);
|
|
2747
2757
|
}, W.regexp_eatClassEscape = function(e) {
|
|
2748
2758
|
var t = e.pos;
|
|
2749
2759
|
if (e.eat(98)) return e.lastIntValue = 8, !0;
|
|
@@ -2755,19 +2765,21 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2755
2765
|
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
2756
2766
|
}, W.regexp_classSetExpression = function(e) {
|
|
2757
2767
|
var t = K, n;
|
|
2758
|
-
if (!this.regexp_eatClassSetRange(e))
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2768
|
+
if (!this.regexp_eatClassSetRange(e)) {
|
|
2769
|
+
if (n = this.regexp_eatClassSetOperand(e)) {
|
|
2770
|
+
n === q && (t = q);
|
|
2771
|
+
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
2772
|
+
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
2773
|
+
n !== q && (t = K);
|
|
2774
|
+
continue;
|
|
2775
|
+
}
|
|
2776
|
+
e.raise("Invalid character in character class");
|
|
2764
2777
|
}
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
} else e.raise("Invalid character in character class");
|
|
2778
|
+
if (r !== e.pos) return t;
|
|
2779
|
+
for (; e.eatChars([45, 45]);) this.regexp_eatClassSetOperand(e) || e.raise("Invalid character in character class");
|
|
2780
|
+
if (r !== e.pos) return t;
|
|
2781
|
+
} else e.raise("Invalid character in character class");
|
|
2782
|
+
}
|
|
2771
2783
|
for (;;) if (!this.regexp_eatClassSetRange(e)) {
|
|
2772
2784
|
if (n = this.regexp_eatClassSetOperand(e), !n) return t;
|
|
2773
2785
|
n === q && (t = q);
|
|
@@ -2867,7 +2879,7 @@ W.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
2867
2879
|
var t = e.lastIntValue;
|
|
2868
2880
|
if (this.regexp_eatOctalDigit(e)) {
|
|
2869
2881
|
var n = e.lastIntValue;
|
|
2870
|
-
t <= 3 && this.regexp_eatOctalDigit(e) ?
|
|
2882
|
+
e.lastIntValue = t <= 3 && this.regexp_eatOctalDigit(e) ? t * 64 + n * 8 + e.lastIntValue : t * 8 + n;
|
|
2871
2883
|
} else e.lastIntValue = t;
|
|
2872
2884
|
return !0;
|
|
2873
2885
|
}
|
|
@@ -2890,7 +2902,7 @@ W.regexp_eatFixedHexDigits = function(e, t) {
|
|
|
2890
2902
|
return !0;
|
|
2891
2903
|
};
|
|
2892
2904
|
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
|
|
2905
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new be(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2894
2906
|
}, J = F.prototype;
|
|
2895
2907
|
J.next = function(e) {
|
|
2896
2908
|
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Kt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
@@ -2901,17 +2913,17 @@ J.next = function(e) {
|
|
|
2901
2913
|
return { next: function() {
|
|
2902
2914
|
var t = e.getToken();
|
|
2903
2915
|
return {
|
|
2904
|
-
done: t.type ===
|
|
2916
|
+
done: t.type === D.eof,
|
|
2905
2917
|
value: t
|
|
2906
2918
|
};
|
|
2907
2919
|
} };
|
|
2908
2920
|
}), J.nextToken = function() {
|
|
2909
2921
|
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(
|
|
2922
|
+
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(D.eof);
|
|
2911
2923
|
if (e.override) return e.override(this);
|
|
2912
2924
|
this.readToken(this.fullCharCodeAtPos());
|
|
2913
2925
|
}, J.readToken = function(e) {
|
|
2914
|
-
return
|
|
2926
|
+
return b(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
2915
2927
|
}, J.fullCharCodeAt = function(e) {
|
|
2916
2928
|
var t = this.input.charCodeAt(e);
|
|
2917
2929
|
if (t <= 55295 || t >= 56320) return t;
|
|
@@ -2921,10 +2933,10 @@ J.next = function(e) {
|
|
|
2921
2933
|
return this.fullCharCodeAt(this.pos);
|
|
2922
2934
|
}, J.skipBlockComment = function() {
|
|
2923
2935
|
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 =
|
|
2936
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = ue(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
2925
2937
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
2926
2938
|
}, 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 && !
|
|
2939
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !le(r);) r = this.input.charCodeAt(++this.pos);
|
|
2928
2940
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
2929
2941
|
}, J.skipSpace = function() {
|
|
2930
2942
|
loop: for (; this.pos < this.input.length;) {
|
|
@@ -2951,7 +2963,7 @@ J.next = function(e) {
|
|
|
2951
2963
|
default: break loop;
|
|
2952
2964
|
}
|
|
2953
2965
|
break;
|
|
2954
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
2966
|
+
default: if (e > 8 && e < 14 || e >= 5760 && de.test(String.fromCharCode(e))) ++this.pos;
|
|
2955
2967
|
else break loop;
|
|
2956
2968
|
}
|
|
2957
2969
|
}
|
|
@@ -2963,57 +2975,57 @@ J.next = function(e) {
|
|
|
2963
2975
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2964
2976
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
2965
2977
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
2966
|
-
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(
|
|
2978
|
+
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(D.ellipsis)) : (++this.pos, this.finishToken(D.dot));
|
|
2967
2979
|
}, J.readToken_slash = function() {
|
|
2968
2980
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2969
|
-
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(
|
|
2981
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(D.assign, 2) : this.finishOp(D.slash, 1);
|
|
2970
2982
|
}, J.readToken_mult_modulo_exp = function(e) {
|
|
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 =
|
|
2983
|
+
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? D.star : D.modulo;
|
|
2984
|
+
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = D.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(D.assign, n + 1) : this.finishOp(r, n);
|
|
2973
2985
|
}, J.readToken_pipe_amp = function(e) {
|
|
2974
2986
|
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(
|
|
2987
|
+
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(D.assign, 3) : this.finishOp(e === 124 ? D.logicalOR : D.logicalAND, 2) : t === 61 ? this.finishOp(D.assign, 2) : this.finishOp(e === 124 ? D.bitwiseOR : D.bitwiseAND, 1);
|
|
2976
2988
|
}, J.readToken_caret = function() {
|
|
2977
|
-
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(
|
|
2989
|
+
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(D.assign, 2) : this.finishOp(D.bitwiseXOR, 1);
|
|
2978
2990
|
}, J.readToken_plus_min = function(e) {
|
|
2979
2991
|
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 ||
|
|
2992
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || O.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(D.incDec, 2) : t === 61 ? this.finishOp(D.assign, 2) : this.finishOp(D.plusMin, 1);
|
|
2981
2993
|
}, J.readToken_lt_gt = function(e) {
|
|
2982
2994
|
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(
|
|
2995
|
+
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(D.assign, n + 1) : this.finishOp(D.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(D.relational, n));
|
|
2984
2996
|
}, J.readToken_eq_excl = function(e) {
|
|
2985
2997
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2986
|
-
return t === 61 ? this.finishOp(
|
|
2998
|
+
return t === 61 ? this.finishOp(D.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(D.arrow)) : this.finishOp(e === 61 ? D.eq : D.prefix, 1);
|
|
2987
2999
|
}, J.readToken_question = function() {
|
|
2988
3000
|
var e = this.options.ecmaVersion;
|
|
2989
3001
|
if (e >= 11) {
|
|
2990
3002
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2991
3003
|
if (t === 46) {
|
|
2992
3004
|
var n = this.input.charCodeAt(this.pos + 2);
|
|
2993
|
-
if (n < 48 || n > 57) return this.finishOp(
|
|
3005
|
+
if (n < 48 || n > 57) return this.finishOp(D.questionDot, 2);
|
|
2994
3006
|
}
|
|
2995
|
-
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
3007
|
+
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(D.assign, 3) : this.finishOp(D.coalesce, 2);
|
|
2996
3008
|
}
|
|
2997
|
-
return this.finishOp(
|
|
3009
|
+
return this.finishOp(D.question, 1);
|
|
2998
3010
|
}, J.readToken_numberSign = function() {
|
|
2999
3011
|
var e = this.options.ecmaVersion, t = 35;
|
|
3000
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(),
|
|
3001
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
3012
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), b(t, !0) || t === 92)) return this.finishToken(D.privateId, this.readWord1());
|
|
3013
|
+
this.raise(this.pos, "Unexpected character '" + j(t) + "'");
|
|
3002
3014
|
}, J.getTokenFromCode = function(e) {
|
|
3003
3015
|
switch (e) {
|
|
3004
3016
|
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(
|
|
3017
|
+
case 40: return ++this.pos, this.finishToken(D.parenL);
|
|
3018
|
+
case 41: return ++this.pos, this.finishToken(D.parenR);
|
|
3019
|
+
case 59: return ++this.pos, this.finishToken(D.semi);
|
|
3020
|
+
case 44: return ++this.pos, this.finishToken(D.comma);
|
|
3021
|
+
case 91: return ++this.pos, this.finishToken(D.bracketL);
|
|
3022
|
+
case 93: return ++this.pos, this.finishToken(D.bracketR);
|
|
3023
|
+
case 123: return ++this.pos, this.finishToken(D.braceL);
|
|
3024
|
+
case 125: return ++this.pos, this.finishToken(D.braceR);
|
|
3025
|
+
case 58: return ++this.pos, this.finishToken(D.colon);
|
|
3014
3026
|
case 96:
|
|
3015
3027
|
if (this.options.ecmaVersion < 6) break;
|
|
3016
|
-
return ++this.pos, this.finishToken(
|
|
3028
|
+
return ++this.pos, this.finishToken(D.backQuote);
|
|
3017
3029
|
case 48:
|
|
3018
3030
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3019
3031
|
if (t === 120 || t === 88) return this.readRadixNumber(16);
|
|
@@ -3045,10 +3057,10 @@ J.next = function(e) {
|
|
|
3045
3057
|
case 61:
|
|
3046
3058
|
case 33: return this.readToken_eq_excl(e);
|
|
3047
3059
|
case 63: return this.readToken_question();
|
|
3048
|
-
case 126: return this.finishOp(
|
|
3060
|
+
case 126: return this.finishOp(D.prefix, 1);
|
|
3049
3061
|
case 35: return this.readToken_numberSign();
|
|
3050
3062
|
}
|
|
3051
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
3063
|
+
this.raise(this.pos, "Unexpected character '" + j(e) + "'");
|
|
3052
3064
|
}, J.finishOp = function(e, t) {
|
|
3053
3065
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
3054
3066
|
return this.pos += t, this.finishToken(e, n);
|
|
@@ -3056,7 +3068,7 @@ J.next = function(e) {
|
|
|
3056
3068
|
for (var e, t, n = this.pos;;) {
|
|
3057
3069
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
3058
3070
|
var r = this.input.charAt(this.pos);
|
|
3059
|
-
if (
|
|
3071
|
+
if (O.test(r) && this.raise(n, "Unterminated regular expression"), e) e = !1;
|
|
3060
3072
|
else {
|
|
3061
3073
|
if (r === "[") t = !0;
|
|
3062
3074
|
else if (r === "]" && t) t = !1;
|
|
@@ -3075,7 +3087,7 @@ J.next = function(e) {
|
|
|
3075
3087
|
try {
|
|
3076
3088
|
c = new RegExp(i, o);
|
|
3077
3089
|
} catch {}
|
|
3078
|
-
return this.finishToken(
|
|
3090
|
+
return this.finishToken(D.regexp, {
|
|
3079
3091
|
pattern: i,
|
|
3080
3092
|
flags: o,
|
|
3081
3093
|
value: c
|
|
@@ -3102,7 +3114,7 @@ J.readRadixNumber = function(e) {
|
|
|
3102
3114
|
var t = this.pos;
|
|
3103
3115
|
this.pos += 2;
|
|
3104
3116
|
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) :
|
|
3117
|
+
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) : b(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(D.num, n);
|
|
3106
3118
|
}, J.readNumber = function(e) {
|
|
3107
3119
|
var t = this.pos;
|
|
3108
3120
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
@@ -3111,11 +3123,11 @@ J.readRadixNumber = function(e) {
|
|
|
3111
3123
|
var r = this.input.charCodeAt(this.pos);
|
|
3112
3124
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3113
3125
|
var i = Jt(this.input.slice(t, this.pos));
|
|
3114
|
-
return ++this.pos,
|
|
3126
|
+
return ++this.pos, b(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(D.num, i);
|
|
3115
3127
|
}
|
|
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")),
|
|
3128
|
+
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), b(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3117
3129
|
var a = qt(this.input.slice(t, this.pos), n);
|
|
3118
|
-
return this.finishToken(
|
|
3130
|
+
return this.finishToken(D.num, a);
|
|
3119
3131
|
}, J.readCodePoint = function() {
|
|
3120
3132
|
var e = this.input.charCodeAt(this.pos), t;
|
|
3121
3133
|
if (e === 123) {
|
|
@@ -3129,9 +3141,9 @@ J.readRadixNumber = function(e) {
|
|
|
3129
3141
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3130
3142
|
var r = this.input.charCodeAt(this.pos);
|
|
3131
3143
|
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)) : (
|
|
3144
|
+
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (le(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
3133
3145
|
}
|
|
3134
|
-
return t += this.input.slice(n, this.pos++), this.finishToken(
|
|
3146
|
+
return t += this.input.slice(n, this.pos++), this.finishToken(D.string, t);
|
|
3135
3147
|
};
|
|
3136
3148
|
var Yt = {};
|
|
3137
3149
|
J.tryReadTemplateToken = function() {
|
|
@@ -3150,17 +3162,15 @@ J.tryReadTemplateToken = function() {
|
|
|
3150
3162
|
for (var e = "", t = this.pos;;) {
|
|
3151
3163
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
3152
3164
|
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 ===
|
|
3165
|
+
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === D.template || this.type === D.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(D.dollarBraceL)) : (++this.pos, this.finishToken(D.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(D.template, e));
|
|
3154
3166
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
3155
|
-
else if (
|
|
3167
|
+
else if (le(n)) {
|
|
3156
3168
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
3157
3169
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3158
3170
|
case 10:
|
|
3159
3171
|
e += "\n";
|
|
3160
3172
|
break;
|
|
3161
|
-
default:
|
|
3162
|
-
e += String.fromCharCode(n);
|
|
3163
|
-
break;
|
|
3173
|
+
default: e += String.fromCharCode(n);
|
|
3164
3174
|
}
|
|
3165
3175
|
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
3166
3176
|
} else ++this.pos;
|
|
@@ -3171,13 +3181,11 @@ J.tryReadTemplateToken = function() {
|
|
|
3171
3181
|
++this.pos;
|
|
3172
3182
|
break;
|
|
3173
3183
|
case "$": if (this.input[this.pos + 1] !== "{") break;
|
|
3174
|
-
case "`": return this.finishToken(
|
|
3184
|
+
case "`": return this.finishToken(D.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
3175
3185
|
case "\r": this.input[this.pos + 1] === "\n" && ++this.pos;
|
|
3176
3186
|
case "\n":
|
|
3177
3187
|
case "\u2028":
|
|
3178
|
-
case "\u2029":
|
|
3179
|
-
++this.curLine, this.lineStart = this.pos + 1;
|
|
3180
|
-
break;
|
|
3188
|
+
case "\u2029": ++this.curLine, this.lineStart = this.pos + 1;
|
|
3181
3189
|
}
|
|
3182
3190
|
this.raise(this.start, "Unterminated template");
|
|
3183
3191
|
}, J.readEscapedChar = function(e) {
|
|
@@ -3186,7 +3194,7 @@ J.tryReadTemplateToken = function() {
|
|
|
3186
3194
|
case 110: return "\n";
|
|
3187
3195
|
case 114: return "\r";
|
|
3188
3196
|
case 120: return String.fromCharCode(this.readHexChar(2));
|
|
3189
|
-
case 117: return
|
|
3197
|
+
case 117: return j(this.readCodePoint());
|
|
3190
3198
|
case 116: return " ";
|
|
3191
3199
|
case 98: return "\b";
|
|
3192
3200
|
case 118: return "\v";
|
|
@@ -3203,7 +3211,7 @@ J.tryReadTemplateToken = function() {
|
|
|
3203
3211
|
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
3204
3212
|
return i > 255 && (r = r.slice(0, -1), i = parseInt(r, 8)), this.pos += r.length - 1, t = this.input.charCodeAt(this.pos), (r !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(this.pos - 1 - r.length, e ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(i);
|
|
3205
3213
|
}
|
|
3206
|
-
return
|
|
3214
|
+
return le(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3207
3215
|
}
|
|
3208
3216
|
}, J.readHexChar = function(e) {
|
|
3209
3217
|
var t = this.pos, n = this.readInt(16, e);
|
|
@@ -3212,40 +3220,40 @@ J.tryReadTemplateToken = function() {
|
|
|
3212
3220
|
this.containsEsc = !1;
|
|
3213
3221
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3214
3222
|
var i = this.fullCharCodeAtPos();
|
|
3215
|
-
if (
|
|
3223
|
+
if (x(i, r)) this.pos += i <= 65535 ? 1 : 2;
|
|
3216
3224
|
else if (i === 92) {
|
|
3217
3225
|
this.containsEsc = !0, e += this.input.slice(n, this.pos);
|
|
3218
3226
|
var a = this.pos;
|
|
3219
3227
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3220
3228
|
var o = this.readCodePoint();
|
|
3221
|
-
(t ?
|
|
3229
|
+
(t ? b : x)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += j(o), n = this.pos;
|
|
3222
3230
|
} else break;
|
|
3223
3231
|
t = !1;
|
|
3224
3232
|
}
|
|
3225
3233
|
return e + this.input.slice(n, this.pos);
|
|
3226
3234
|
}, J.readWord = function() {
|
|
3227
|
-
var e = this.readWord1(), t =
|
|
3228
|
-
return this.keywords.test(e) && (t =
|
|
3235
|
+
var e = this.readWord1(), t = D.name;
|
|
3236
|
+
return this.keywords.test(e) && (t = se[e]), this.finishToken(t, e);
|
|
3229
3237
|
}, F.acorn = {
|
|
3230
3238
|
Parser: F,
|
|
3231
|
-
version: "8.
|
|
3232
|
-
defaultOptions:
|
|
3233
|
-
Position:
|
|
3234
|
-
SourceLocation:
|
|
3235
|
-
getLineInfo:
|
|
3239
|
+
version: "8.18.0",
|
|
3240
|
+
defaultOptions: Se,
|
|
3241
|
+
Position: ye,
|
|
3242
|
+
SourceLocation: be,
|
|
3243
|
+
getLineInfo: xe,
|
|
3236
3244
|
Node: it,
|
|
3237
|
-
TokenType:
|
|
3238
|
-
tokTypes:
|
|
3239
|
-
keywordTypes:
|
|
3245
|
+
TokenType: S,
|
|
3246
|
+
tokTypes: D,
|
|
3247
|
+
keywordTypes: se,
|
|
3240
3248
|
TokContext: B,
|
|
3241
3249
|
tokContexts: V,
|
|
3242
|
-
isIdentifierChar:
|
|
3243
|
-
isIdentifierStart:
|
|
3250
|
+
isIdentifierChar: x,
|
|
3251
|
+
isIdentifierStart: b,
|
|
3244
3252
|
Token: Kt,
|
|
3245
|
-
isNewLine:
|
|
3246
|
-
lineBreak:
|
|
3247
|
-
lineBreakG:
|
|
3248
|
-
nonASCIIwhitespace:
|
|
3253
|
+
isNewLine: le,
|
|
3254
|
+
lineBreak: O,
|
|
3255
|
+
lineBreakG: ce,
|
|
3256
|
+
nonASCIIwhitespace: de
|
|
3249
3257
|
};
|
|
3250
3258
|
//#endregion
|
|
3251
3259
|
//#region ../../node_modules/.pnpm/acorn-walk@8.3.5/node_modules/acorn-walk/dist/walk.mjs
|
|
@@ -3423,19 +3431,19 @@ var Z = {
|
|
|
3423
3431
|
Z.Data, Z.Comment, Z.EndTagOpen, Z.TagOpen, Z.Interpolation, Z.Data, Z.EOF, Z.TagOpen, Z.BeforeAttributeName, Z.EndTagOpen, Z.BeforeAttributeName, Z.BeforeAttributeName, Z.AttributeName, Z.Data, Z.RawText, Z.Data, Z.AttributeName, Z.AfterAttributeName, Z.AfterAttributeName, Z.BeforeAttributeValue, Z.BeforeAttributeName, Z.BeforeAttributeValue, Z.AttributeValueQuoted, Z.AttributeValueInterpolation, Z.AttributeValueQuoted, Z.BeforeAttributeName, Z.AttributeValueInterpolation, Z.BeforeAttributeName, Z.Comment, Z.Data, Z.Interpolation, Z.Data, Z.BeforeAttributeName, Z.RawText, Z.RawText, Z.EndTagOpen, Z.EOF, Z.EOF, Z.EOF;
|
|
3424
3432
|
//#endregion
|
|
3425
3433
|
//#region src/index.ts
|
|
3426
|
-
function
|
|
3434
|
+
function $(e) {
|
|
3427
3435
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3428
3436
|
}
|
|
3429
|
-
var
|
|
3437
|
+
var Zt = /* @__PURE__ */ new Set([
|
|
3430
3438
|
"__proto__",
|
|
3431
3439
|
"constructor",
|
|
3432
3440
|
"prototype",
|
|
3433
3441
|
"__drift_mark_dirty__"
|
|
3434
3442
|
]);
|
|
3435
|
-
function
|
|
3436
|
-
|
|
3443
|
+
function Qt(e, t, n) {
|
|
3444
|
+
e && typeof e == "object" && !Zt.has(t) && (e[t] = n);
|
|
3437
3445
|
}
|
|
3438
|
-
function
|
|
3446
|
+
function $t(e, t, n, i, a) {
|
|
3439
3447
|
if (i) {
|
|
3440
3448
|
let t = r(i, e, a);
|
|
3441
3449
|
if (typeof t == "function") {
|
|
@@ -3443,9 +3451,9 @@ function en(e, t, n, i, a) {
|
|
|
3443
3451
|
return;
|
|
3444
3452
|
}
|
|
3445
3453
|
}
|
|
3446
|
-
|
|
3454
|
+
Qt(e, t, n);
|
|
3447
3455
|
}
|
|
3448
|
-
var
|
|
3456
|
+
var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = class e {
|
|
3449
3457
|
static MAX_REGISTERS = 256;
|
|
3450
3458
|
registers = Array(e.MAX_REGISTERS);
|
|
3451
3459
|
scope = {};
|
|
@@ -3495,22 +3503,35 @@ var tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, rn
|
|
|
3495
3503
|
break;
|
|
3496
3504
|
}
|
|
3497
3505
|
case Q.MOUNT_COMPONENT: {
|
|
3498
|
-
let t = c[d + 1], n = c[d + 2], r = c[d + 3], a = String(l[n]), o =
|
|
3499
|
-
if (
|
|
3500
|
-
let n = r === 255 ? null : l[r],
|
|
3506
|
+
let t = c[d + 1], n = c[d + 2], r = c[d + 3], a = String(l[n]), o = this.scope && a in this.scope ? this.scope[a] : typeof globalThis < "u" && globalThis[a], s = m(o);
|
|
3507
|
+
if (s) {
|
|
3508
|
+
let n = r === 255 ? null : l[r], o = i(n, this.scope, this.declaredVars), c;
|
|
3501
3509
|
if (n && n.__drift_children__ !== void 0) {
|
|
3502
3510
|
let t = l[n.__drift_children__] ?? n.__drift_children__;
|
|
3503
3511
|
if (t) {
|
|
3504
3512
|
let n = new e();
|
|
3505
|
-
n.parentVM = this,
|
|
3513
|
+
n.parentVM = this, c = n.execute(t, { scope: this.scope }) ?? void 0;
|
|
3506
3514
|
}
|
|
3507
3515
|
}
|
|
3508
|
-
let
|
|
3509
|
-
|
|
3510
|
-
let
|
|
3511
|
-
|
|
3512
|
-
let
|
|
3513
|
-
|
|
3516
|
+
let u = new e();
|
|
3517
|
+
u.parentVM = this;
|
|
3518
|
+
let d = Object.assign(Object.create(this.scope), { props: o }, o);
|
|
3519
|
+
c !== void 0 && (d.children = c);
|
|
3520
|
+
let f = u.execute(s, { scope: d }), p = null, m;
|
|
3521
|
+
if ("client:load" in o ? p = "eager" : "client:idle" in o ? p = "idle" : "client:visible" in o ? p = "visible" : "client:interaction" in o ? p = "interaction" : "client:media" in o && (p = "media", m = typeof o["client:media"] == "string" ? o["client:media"] : void 0), p) {
|
|
3522
|
+
let e = /* @__PURE__ */ new Map();
|
|
3523
|
+
e.set("data-drift-island", a), e.set("data-drift-trigger", p), m && e.set("data-drift-media", m);
|
|
3524
|
+
let n = {};
|
|
3525
|
+
for (let [e, t] of Object.entries(o)) !e.startsWith("client:") && e !== "__drift_children__" && e !== "__drift_props__" && (n[e] = t);
|
|
3526
|
+
Object.keys(n).length > 0 && e.set("data-drift-props", JSON.stringify(n));
|
|
3527
|
+
let r = {
|
|
3528
|
+
type: "element",
|
|
3529
|
+
tag: "div",
|
|
3530
|
+
attrs: e,
|
|
3531
|
+
children: f ? [f] : []
|
|
3532
|
+
};
|
|
3533
|
+
this.setRegister(t, r);
|
|
3534
|
+
} else f && this.setRegister(t, f);
|
|
3514
3535
|
}
|
|
3515
3536
|
d += 4;
|
|
3516
3537
|
break;
|
|
@@ -3625,18 +3646,18 @@ var tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, rn
|
|
|
3625
3646
|
case Q.REACTIVE_FOR: {
|
|
3626
3647
|
let t = c[d + 1], n = c[d + 2], i = c[d + 3], a = c[d + 4];
|
|
3627
3648
|
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 =
|
|
3649
|
+
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 = r(p, this.scope, this.declaredVars), _ = ee(te);
|
|
3629
3650
|
f.children.push({
|
|
3630
3651
|
type: "comment",
|
|
3631
3652
|
content: "for",
|
|
3632
3653
|
children: []
|
|
3633
3654
|
});
|
|
3634
|
-
for (let t = 0; t <
|
|
3655
|
+
for (let t = 0; t < _.length; t++) {
|
|
3635
3656
|
let n = Object.create(this.scope);
|
|
3636
3657
|
if (u) {
|
|
3637
3658
|
let e = r(u, n, this.declaredVars);
|
|
3638
|
-
typeof e == "function" ? e(
|
|
3639
|
-
} else
|
|
3659
|
+
typeof e == "function" ? e(_[t], t) : (Qt(n, m, _[t]), h && Qt(n, h, t));
|
|
3660
|
+
} else Qt(n, m, _[t]), h && Qt(n, h, t);
|
|
3640
3661
|
let i = new e();
|
|
3641
3662
|
i.parentVM = this;
|
|
3642
3663
|
let a = i.execute(g, { scope: n });
|
|
@@ -3650,13 +3671,13 @@ var tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, rn
|
|
|
3650
3671
|
break;
|
|
3651
3672
|
}
|
|
3652
3673
|
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],
|
|
3654
|
-
|
|
3655
|
-
},
|
|
3674
|
+
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], _ = (e, t) => {
|
|
3675
|
+
$t(e, ee, t, f, this.declaredVars);
|
|
3676
|
+
}, v = r(m, this.scope, this.declaredVars), y = e.nextAsyncId++;
|
|
3656
3677
|
if (this.isStreaming) {
|
|
3657
3678
|
if (p.children.push({
|
|
3658
3679
|
type: "comment",
|
|
3659
|
-
content: `drift-async:${
|
|
3680
|
+
content: `drift-async:${y}`,
|
|
3660
3681
|
children: []
|
|
3661
3682
|
}), g) {
|
|
3662
3683
|
let t = Object.create(this.scope), n = new e();
|
|
@@ -3666,11 +3687,11 @@ var tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, rn
|
|
|
3666
3687
|
}
|
|
3667
3688
|
p.children.push({
|
|
3668
3689
|
type: "comment",
|
|
3669
|
-
content: `/drift-async:${
|
|
3690
|
+
content: `/drift-async:${y}`,
|
|
3670
3691
|
children: []
|
|
3671
3692
|
}), this.asyncBoundaries.push({
|
|
3672
|
-
id:
|
|
3673
|
-
promise:
|
|
3693
|
+
id: y,
|
|
3694
|
+
promise: v,
|
|
3674
3695
|
alias: ee,
|
|
3675
3696
|
bodyMod: h,
|
|
3676
3697
|
fallbackMod: g,
|
|
@@ -3679,10 +3700,10 @@ var tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, rn
|
|
|
3679
3700
|
aliasPopulator: f,
|
|
3680
3701
|
declaredVars: this.declaredVars
|
|
3681
3702
|
});
|
|
3682
|
-
} else if (
|
|
3703
|
+
} else if (v && typeof v.then == "function") {
|
|
3683
3704
|
if (p.children.push({
|
|
3684
3705
|
type: "comment",
|
|
3685
|
-
content: `drift-async:${
|
|
3706
|
+
content: `drift-async:${y}`,
|
|
3686
3707
|
children: []
|
|
3687
3708
|
}), g) {
|
|
3688
3709
|
let t = Object.create(this.scope), n = new e();
|
|
@@ -3692,23 +3713,23 @@ var tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, rn
|
|
|
3692
3713
|
}
|
|
3693
3714
|
p.children.push({
|
|
3694
3715
|
type: "comment",
|
|
3695
|
-
content: `/drift-async:${
|
|
3716
|
+
content: `/drift-async:${y}`,
|
|
3696
3717
|
children: []
|
|
3697
3718
|
});
|
|
3698
3719
|
} else {
|
|
3699
3720
|
p.children.push({
|
|
3700
3721
|
type: "comment",
|
|
3701
|
-
content: `drift-async:${
|
|
3722
|
+
content: `drift-async:${y}`,
|
|
3702
3723
|
children: []
|
|
3703
3724
|
});
|
|
3704
3725
|
let t = Object.create(this.scope);
|
|
3705
|
-
|
|
3726
|
+
_(t, v);
|
|
3706
3727
|
let n = new e();
|
|
3707
3728
|
n.parentVM = this;
|
|
3708
3729
|
let r = n.execute(h, { scope: t });
|
|
3709
3730
|
r && p.children.push(r), p.children.push({
|
|
3710
3731
|
type: "comment",
|
|
3711
|
-
content: `/drift-async:${
|
|
3732
|
+
content: `/drift-async:${y}`,
|
|
3712
3733
|
children: []
|
|
3713
3734
|
});
|
|
3714
3735
|
}
|
|
@@ -3724,37 +3745,50 @@ var tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, rn
|
|
|
3724
3745
|
}
|
|
3725
3746
|
}
|
|
3726
3747
|
};
|
|
3727
|
-
function
|
|
3748
|
+
function rn(e, t) {
|
|
3728
3749
|
if (!t) return e;
|
|
3729
3750
|
let n = t.toLowerCase();
|
|
3730
3751
|
return n === "script" ? e.replace(/<\/script/gi, "<\\/script") : n === "style" ? e.replace(/<\/style/gi, "<\\/style") : e;
|
|
3731
3752
|
}
|
|
3732
|
-
function
|
|
3753
|
+
function an(t, n = !1, r) {
|
|
3733
3754
|
if (!t) return "";
|
|
3734
|
-
if (typeof t == "string") return n ?
|
|
3735
|
-
if (t.type === "text") return n ?
|
|
3755
|
+
if (typeof t == "string") return n ? rn(t, r) : $(t);
|
|
3756
|
+
if (t.type === "text") return n ? rn(t.content ?? "", r) : $(t.content ?? "");
|
|
3736
3757
|
if (t.type === "comment") return `<!--${String(t.content ?? "").replace(/-->/g, "-- >").replace(/--!>/g, "--! >")}-->`;
|
|
3737
|
-
if (t.type === "fragment") return t.children.map((e) =>
|
|
3758
|
+
if (t.type === "fragment") return t.children.map((e) => an(e, n, r)).join("");
|
|
3738
3759
|
if (t.type === "element") {
|
|
3739
3760
|
let n = t.tag;
|
|
3740
|
-
if (!n || !
|
|
3761
|
+
if (!n || !tn.test(n)) return "";
|
|
3741
3762
|
let r = n.toLowerCase() === "script" || n.toLowerCase() === "style", i = "";
|
|
3742
3763
|
if (t.attrs && t.attrs.size > 0) for (let [e, n] of t.attrs.entries()) {
|
|
3743
|
-
if (!
|
|
3764
|
+
if (!en.test(e) || e === "style" && (n === "" || n == null || n === !1)) continue;
|
|
3744
3765
|
let t = e.startsWith("aria-") || e.startsWith("data-");
|
|
3745
|
-
n === !0 ? i += t ? ` ${e}="true"` : ` ${e}` : n === !1 ? t && (i += ` ${e}="false"`) : n != null && (i += ` ${e}="${
|
|
3766
|
+
n === !0 ? i += t ? ` ${e}="true"` : ` ${e}` : n === !1 ? t && (i += ` ${e}="false"`) : n != null && (i += ` ${e}="${$(String(n))}"`);
|
|
3746
3767
|
}
|
|
3747
3768
|
if (e.has(n.toLowerCase())) return `<${n}${i} />`;
|
|
3748
|
-
let a = t.children.map((e) =>
|
|
3769
|
+
let a = t.children.map((e) => an(e, r, r ? n : void 0)).join("");
|
|
3749
3770
|
return `<${n}${i}>${a}</${n}>`;
|
|
3750
3771
|
}
|
|
3751
3772
|
return "";
|
|
3752
3773
|
}
|
|
3753
3774
|
function on(e, t = {}) {
|
|
3754
|
-
let n = new
|
|
3755
|
-
return n ?
|
|
3775
|
+
let n = new nn().execute(e, t);
|
|
3776
|
+
return n ? an(n) : "";
|
|
3777
|
+
}
|
|
3778
|
+
function sn(e, t, n = {}) {
|
|
3779
|
+
let r = n.islandTag || "div", i = n.trigger || "idle", a = ` data-drift-island="${$(e)}"`;
|
|
3780
|
+
i && (a += ` data-drift-trigger="${$(i)}"`), n.props && Object.keys(n.props).length > 0 && (a += ` data-drift-props="${$(JSON.stringify(n.props))}"`), n.timeout !== void 0 && (a += ` data-drift-timeout="${n.timeout}"`), n.media && (a += ` data-drift-media="${$(n.media)}"`), n.rootMargin && (a += ` data-drift-root-margin="${$(n.rootMargin)}"`);
|
|
3781
|
+
let o = n.props ? {
|
|
3782
|
+
...n.scope,
|
|
3783
|
+
props: n.props,
|
|
3784
|
+
...n.props
|
|
3785
|
+
} : n.scope, s = on(t, {
|
|
3786
|
+
...n,
|
|
3787
|
+
scope: o
|
|
3788
|
+
});
|
|
3789
|
+
return `<${r}${a}>${s}</${r}>`;
|
|
3756
3790
|
}
|
|
3757
|
-
function
|
|
3791
|
+
function cn(e, t = {}) {
|
|
3758
3792
|
let n = !1, r = null, i = new ReadableStream({
|
|
3759
3793
|
start(i) {
|
|
3760
3794
|
let a = new TextEncoder(), o = (e) => {
|
|
@@ -3771,11 +3805,11 @@ function sn(e, t = {}) {
|
|
|
3771
3805
|
}
|
|
3772
3806
|
};
|
|
3773
3807
|
try {
|
|
3774
|
-
let i = new
|
|
3808
|
+
let i = new nn();
|
|
3775
3809
|
i.isStreaming = !0;
|
|
3776
|
-
let a = i.execute(e, t), c = a ?
|
|
3810
|
+
let a = i.execute(e, t), c = a ? an(a) : "", l = i.asyncBoundaries;
|
|
3777
3811
|
if (l.length > 0) {
|
|
3778
|
-
let e = `<script${t.nonce ? ` nonce="${
|
|
3812
|
+
let e = `<script${t.nonce ? ` nonce="${$(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
3813
|
c += e;
|
|
3780
3814
|
}
|
|
3781
3815
|
if (o(c), t.onShellReady?.(), l.length === 0) {
|
|
@@ -3794,14 +3828,14 @@ function sn(e, t = {}) {
|
|
|
3794
3828
|
Promise.resolve(i).then((e) => {
|
|
3795
3829
|
if (n) return;
|
|
3796
3830
|
let i = Object.create(d);
|
|
3797
|
-
|
|
3798
|
-
let s = new
|
|
3831
|
+
$t(i, a, e, f, p);
|
|
3832
|
+
let s = new nn().execute(c, { scope: i }), l = s ? an(s) : "", u = t.nonce ? ` nonce="${$(t.nonce)}"` : "", m = `<template id="drift-t-${r}">${l}</template><script${u}>__drift_swap("${r}","drift-t-${r}")<\/script>`;
|
|
3799
3833
|
o(m);
|
|
3800
3834
|
}).catch((e) => {
|
|
3801
3835
|
if (!n && (t.onError?.(e), l)) {
|
|
3802
3836
|
let n = Object.create(d);
|
|
3803
|
-
l.errorVar &&
|
|
3804
|
-
let i = new
|
|
3837
|
+
l.errorVar && Qt(n, l.errorVar, e);
|
|
3838
|
+
let i = new nn().execute(l.module, { scope: n }), a = i ? an(i) : "", s = t.nonce ? ` nonce="${$(t.nonce)}"` : "", c = `<template id="drift-t-${r}">${a}</template><script${s}>__drift_swap("${r}","drift-t-${r}")<\/script>`;
|
|
3805
3839
|
o(c);
|
|
3806
3840
|
}
|
|
3807
3841
|
}).finally(() => {
|
|
@@ -3843,4 +3877,4 @@ function sn(e, t = {}) {
|
|
|
3843
3877
|
}, a;
|
|
3844
3878
|
}
|
|
3845
3879
|
//#endregion
|
|
3846
|
-
export {
|
|
3880
|
+
export { nn 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 renderIslandToString, cn as renderToStream, on as renderToString, an as serializeNode };
|