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