driftjs-ssr 0.0.14 → 0.0.16
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 +811 -733
- 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,20 +1201,20 @@ 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, Ne = 256, Pe = 512, Fe = 1024, Ie = j | M | Ne;
|
|
1208
|
+
function Le(e, t) {
|
|
1209
|
+
return M | (e ? De : 0) | (t ? Oe : 0);
|
|
1210
1210
|
}
|
|
1211
|
-
var
|
|
1212
|
-
this.options = e =
|
|
1211
|
+
var Re = 0, ze = 1, N = 2, Be = 3, Ve = 4, He = 5, P = 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 + " " +
|
|
1217
|
-
},
|
|
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
|
+
}, F = {
|
|
1218
1218
|
inFunction: { configurable: !0 },
|
|
1219
1219
|
inGenerator: { configurable: !0 },
|
|
1220
1220
|
inAsync: { configurable: !0 },
|
|
@@ -1227,61 +1227,61 @@ var ze = 0, Be = 1, P = 2, Ve = 3, He = 4, Ue = 5, F = function(e, t, n) {
|
|
|
1227
1227
|
allowUsing: { configurable: !0 },
|
|
1228
1228
|
inClassStaticBlock: { configurable: !0 }
|
|
1229
1229
|
};
|
|
1230
|
-
|
|
1230
|
+
P.prototype.parse = function() {
|
|
1231
1231
|
var e = this, t = this.options.program || this.startNode();
|
|
1232
1232
|
return this.nextToken(), this.catchStackOverflow(function() {
|
|
1233
1233
|
return e.parseTopLevel(t);
|
|
1234
1234
|
});
|
|
1235
|
-
},
|
|
1235
|
+
}, F.inFunction.get = function() {
|
|
1236
1236
|
return (this.currentVarScope().flags & M) > 0;
|
|
1237
|
-
},
|
|
1238
|
-
return (this.currentVarScope().flags &
|
|
1239
|
-
},
|
|
1240
|
-
return (this.currentVarScope().flags &
|
|
1241
|
-
},
|
|
1237
|
+
}, F.inGenerator.get = function() {
|
|
1238
|
+
return (this.currentVarScope().flags & Oe) > 0;
|
|
1239
|
+
}, F.inAsync.get = function() {
|
|
1240
|
+
return (this.currentVarScope().flags & De) > 0;
|
|
1241
|
+
}, F.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 & (
|
|
1245
|
-
if (t & M) return (t &
|
|
1244
|
+
if (t & (Ne | Pe)) 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
|
+
}, F.allowReturn.get = function() {
|
|
1249
1249
|
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & j);
|
|
1250
|
-
},
|
|
1251
|
-
return (this.currentThisScope().flags &
|
|
1252
|
-
},
|
|
1253
|
-
return (this.currentThisScope().flags &
|
|
1254
|
-
},
|
|
1250
|
+
}, F.allowSuper.get = function() {
|
|
1251
|
+
return (this.currentThisScope().flags & je) > 0 || this.options.allowSuperOutsideMethod;
|
|
1252
|
+
}, F.allowDirectSuper.get = function() {
|
|
1253
|
+
return (this.currentThisScope().flags & Me) > 0;
|
|
1254
|
+
}, F.treatFunctionsAsVar.get = function() {
|
|
1255
1255
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1256
|
-
},
|
|
1256
|
+
}, F.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 & (
|
|
1259
|
+
if (t & (Ne | Pe) || t & M && !(t & ke)) return !0;
|
|
1260
1260
|
}
|
|
1261
1261
|
return !1;
|
|
1262
|
-
},
|
|
1262
|
+
}, F.allowUsing.get = function() {
|
|
1263
1263
|
var e = this.currentScope().flags;
|
|
1264
|
-
return !(e &
|
|
1265
|
-
},
|
|
1266
|
-
return (this.currentVarScope().flags &
|
|
1267
|
-
},
|
|
1264
|
+
return !(e & Fe || !this.inModule && e & j);
|
|
1265
|
+
}, F.inClassStaticBlock.get = function() {
|
|
1266
|
+
return (this.currentVarScope().flags & Ne) > 0;
|
|
1267
|
+
}, P.extend = function() {
|
|
1268
1268
|
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
1269
1269
|
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
1270
1270
|
return n;
|
|
1271
|
-
},
|
|
1271
|
+
}, P.parse = function(e, t) {
|
|
1272
1272
|
return new this(t, e).parse();
|
|
1273
|
-
},
|
|
1273
|
+
}, P.parseExpressionAt = function(e, t, n) {
|
|
1274
1274
|
var r = new this(n, e, t);
|
|
1275
1275
|
return r.nextToken(), r.parseExpression();
|
|
1276
|
-
},
|
|
1276
|
+
}, P.tokenizer = function(e, t) {
|
|
1277
1277
|
return new this(t, e);
|
|
1278
|
-
}, Object.defineProperties(
|
|
1279
|
-
var
|
|
1280
|
-
|
|
1278
|
+
}, Object.defineProperties(P.prototype, F);
|
|
1279
|
+
var I = P.prototype, Ue = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
1280
|
+
I.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 = Ue.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;
|
|
@@ -1290,55 +1290,55 @@ L.strictDirective = function(e) {
|
|
|
1290
1290
|
}
|
|
1291
1291
|
e += t[0].length, O.lastIndex = e, e += O.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
1292
1292
|
}
|
|
1293
|
-
},
|
|
1293
|
+
}, I.eat = function(e) {
|
|
1294
1294
|
return this.type === e ? (this.next(), !0) : !1;
|
|
1295
|
-
},
|
|
1295
|
+
}, I.isContextual = function(e) {
|
|
1296
1296
|
return this.type === E.name && this.value === e && !this.containsEsc;
|
|
1297
|
-
},
|
|
1297
|
+
}, I.eatContextual = function(e) {
|
|
1298
1298
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
1299
|
-
},
|
|
1299
|
+
}, I.catchStackOverflow = function(e) {
|
|
1300
1300
|
try {
|
|
1301
1301
|
return e();
|
|
1302
1302
|
} catch (e) {
|
|
1303
1303
|
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
|
|
1304
1304
|
else throw e;
|
|
1305
1305
|
}
|
|
1306
|
-
},
|
|
1306
|
+
}, I.expectContextual = function(e) {
|
|
1307
1307
|
this.eatContextual(e) || this.unexpected();
|
|
1308
|
-
},
|
|
1308
|
+
}, I.canInsertSemicolon = function() {
|
|
1309
1309
|
return this.type === E.eof || this.type === E.braceR || D.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1310
|
-
},
|
|
1310
|
+
}, I.insertSemicolon = function() {
|
|
1311
1311
|
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
1312
|
-
},
|
|
1312
|
+
}, I.semicolon = function() {
|
|
1313
1313
|
!this.eat(E.semi) && !this.insertSemicolon() && this.unexpected();
|
|
1314
|
-
},
|
|
1314
|
+
}, I.afterTrailingComma = function(e, t) {
|
|
1315
1315
|
if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
1316
|
-
},
|
|
1316
|
+
}, I.expect = function(e) {
|
|
1317
1317
|
this.eat(e) || this.unexpected();
|
|
1318
|
-
},
|
|
1318
|
+
}, I.unexpected = function(e) {
|
|
1319
1319
|
this.raise(e ?? this.start, "Unexpected token");
|
|
1320
1320
|
};
|
|
1321
|
-
var
|
|
1321
|
+
var We = function() {
|
|
1322
1322
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
1323
1323
|
};
|
|
1324
|
-
|
|
1324
|
+
I.checkPatternErrors = function(e, t) {
|
|
1325
1325
|
if (e) {
|
|
1326
1326
|
e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
|
|
1327
1327
|
var n = t ? e.parenthesizedAssign : e.parenthesizedBind;
|
|
1328
1328
|
n > -1 && this.raiseRecoverable(n, t ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
1329
1329
|
}
|
|
1330
|
-
},
|
|
1330
|
+
}, I.checkExpressionErrors = function(e, t) {
|
|
1331
1331
|
if (!e) return !1;
|
|
1332
1332
|
var n = e.shorthandAssign, r = e.doubleProto;
|
|
1333
1333
|
if (!t) return n >= 0 || r >= 0;
|
|
1334
1334
|
n >= 0 && this.raise(n, "Shorthand property assignments are valid only in destructuring patterns"), r >= 0 && this.raiseRecoverable(r, "Redefinition of __proto__ property");
|
|
1335
|
-
},
|
|
1335
|
+
}, I.checkYieldAwaitInDefaultParams = function() {
|
|
1336
1336
|
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
1337
|
-
},
|
|
1337
|
+
}, I.isSimpleAssignTarget = function(e) {
|
|
1338
1338
|
return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
|
|
1339
1339
|
};
|
|
1340
|
-
var
|
|
1341
|
-
|
|
1340
|
+
var L = P.prototype;
|
|
1341
|
+
L.parseTopLevel = function(e) {
|
|
1342
1342
|
var t = Object.create(null);
|
|
1343
1343
|
for (e.body ||= []; this.type !== E.eof;) {
|
|
1344
1344
|
var n = this.parseStatement(null, !0, t);
|
|
@@ -1350,8 +1350,8 @@ 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
|
|
1354
|
-
|
|
1353
|
+
var Ge = { kind: "loop" }, Ke = { kind: "switch" };
|
|
1354
|
+
L.isLet = function(e) {
|
|
1355
1355
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
1356
1356
|
O.lastIndex = this.pos;
|
|
1357
1357
|
var t = O.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
@@ -1365,15 +1365,15 @@ 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
|
+
}, L.isAsyncFunction = function() {
|
|
1372
1372
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
1373
1373
|
O.lastIndex = this.pos;
|
|
1374
1374
|
var e = O.exec(this.input), t = this.pos + e[0].length, n;
|
|
1375
1375
|
return !D.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(b(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
1376
|
-
},
|
|
1376
|
+
}, L.isUsingKeyword = function(e, t) {
|
|
1377
1377
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
1378
1378
|
O.lastIndex = this.pos;
|
|
1379
1379
|
var n = O.exec(this.input), r = this.pos + n[0].length;
|
|
@@ -1393,18 +1393,18 @@ 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);
|
|
1400
1400
|
if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
1401
1401
|
}
|
|
1402
1402
|
return !0;
|
|
1403
|
-
},
|
|
1403
|
+
}, L.isAwaitUsing = function(e) {
|
|
1404
1404
|
return this.isUsingKeyword(!0, e);
|
|
1405
|
-
},
|
|
1405
|
+
}, L.isUsing = function(e) {
|
|
1406
1406
|
return this.isUsingKeyword(!1, e);
|
|
1407
|
-
},
|
|
1407
|
+
}, L.parseStatement = function(e, t, n) {
|
|
1408
1408
|
var r = this.type, i = this.startNode(), a;
|
|
1409
1409
|
switch (this.isLet(e) && (r = E._var, a = "let"), r) {
|
|
1410
1410
|
case E._break:
|
|
@@ -1440,7 +1440,7 @@ R.isLet = function(e) {
|
|
|
1440
1440
|
var u = this.value, d = this.parseExpression();
|
|
1441
1441
|
return r === E.name && d.type === "Identifier" && this.eat(E.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
1442
1442
|
}
|
|
1443
|
-
},
|
|
1443
|
+
}, L.parseBreakContinueStatement = function(e, t) {
|
|
1444
1444
|
var n = t === "break";
|
|
1445
1445
|
this.next(), this.eat(E.semi) || this.insertSemicolon() ? e.label = null : this.type === E.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
|
|
1446
1446
|
for (var r = 0; r < this.labels.length; ++r) {
|
|
@@ -1448,14 +1448,14 @@ R.isLet = function(e) {
|
|
|
1448
1448
|
if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
|
|
1449
1449
|
}
|
|
1450
1450
|
return r === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, n ? "BreakStatement" : "ContinueStatement");
|
|
1451
|
-
},
|
|
1451
|
+
}, L.parseDebuggerStatement = function(e) {
|
|
1452
1452
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
1453
|
-
},
|
|
1454
|
-
return this.next(), this.labels.push(
|
|
1455
|
-
},
|
|
1453
|
+
}, L.parseDoStatement = function(e) {
|
|
1454
|
+
return this.next(), this.labels.push(Ge), 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
|
+
}, L.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(Ge), 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,45 +1466,45 @@ 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 We(), 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
|
+
}, L.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
|
-
},
|
|
1474
|
-
return this.next(), this.parseFunction(e,
|
|
1475
|
-
},
|
|
1473
|
+
}, L.parseFunctionStatement = function(e, t, n) {
|
|
1474
|
+
return this.next(), this.parseFunction(e, Je | (n ? 0 : Ye), !1, t);
|
|
1475
|
+
}, L.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
|
+
}, L.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
|
-
},
|
|
1480
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(E.braceL), this.labels.push(
|
|
1479
|
+
}, L.parseSwitchStatement = function(e) {
|
|
1480
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(E.braceL), this.labels.push(Ke), this.enterScope(Fe);
|
|
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);
|
|
1484
1484
|
} else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
1485
1485
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
1486
|
-
},
|
|
1486
|
+
}, L.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
|
|
1490
|
-
|
|
1489
|
+
var qe = [];
|
|
1490
|
+
L.parseCatchClauseParam = function() {
|
|
1491
1491
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
1492
|
-
return this.enterScope(t ?
|
|
1493
|
-
},
|
|
1492
|
+
return this.enterScope(t ? Ae : 0), this.checkLValPattern(e, t ? Ve : N), this.expect(E.parenR), e;
|
|
1493
|
+
}, L.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();
|
|
1496
1496
|
this.next(), this.eat(E.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
1497
1497
|
}
|
|
1498
1498
|
return e.finalizer = this.eat(E._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
1499
|
-
},
|
|
1499
|
+
}, L.parseVarStatement = function(e, t, n) {
|
|
1500
1500
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
1501
|
-
},
|
|
1502
|
-
return this.next(), e.test = this.parseParenExpression(), this.labels.push(
|
|
1503
|
-
},
|
|
1501
|
+
}, L.parseWhileStatement = function(e) {
|
|
1502
|
+
return this.next(), e.test = this.parseParenExpression(), this.labels.push(Ge), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
1503
|
+
}, L.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
|
+
}, L.parseEmptyStatement = function(e) {
|
|
1506
1506
|
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
1507
|
-
},
|
|
1507
|
+
}, L.parseLabeledStatement = function(e, t, n, r) {
|
|
1508
1508
|
for (var i = 0, a = this.labels; i < a.length; i += 1) a[i].name === t && this.raise(n.start, "Label '" + t + "' is already declared");
|
|
1509
1509
|
for (var o = this.type.isLoop ? "loop" : this.type === E._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
|
|
1510
1510
|
var c = this.labels[s];
|
|
@@ -1516,46 +1516,46 @@ R.parseCatchClauseParam = function() {
|
|
|
1516
1516
|
kind: o,
|
|
1517
1517
|
statementStart: this.start
|
|
1518
1518
|
}), e.body = this.parseStatement(r ? r.indexOf("label") === -1 ? r + "label" : r : "label"), this.labels.pop(), e.label = n, this.finishNode(e, "LabeledStatement");
|
|
1519
|
-
},
|
|
1519
|
+
}, L.parseExpressionStatement = function(e, t) {
|
|
1520
1520
|
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
1521
|
-
},
|
|
1521
|
+
}, L.parseBlock = function(e, t, n) {
|
|
1522
1522
|
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(E.braceL), e && this.enterScope(0); this.type !== E.braceR;) {
|
|
1523
1523
|
var r = this.parseStatement(null);
|
|
1524
1524
|
t.body.push(r);
|
|
1525
1525
|
}
|
|
1526
1526
|
return n && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
1527
|
-
},
|
|
1527
|
+
}, L.parseFor = function(e, t) {
|
|
1528
1528
|
return e.init = t, this.expect(E.semi), e.test = this.type === E.semi ? null : this.parseExpression(), this.expect(E.semi), e.update = this.type === E.parenR ? null : this.parseExpression(), this.expect(E.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
1529
|
-
},
|
|
1529
|
+
}, L.parseForIn = function(e, t) {
|
|
1530
1530
|
var n = this.type === E._in;
|
|
1531
1531
|
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(E.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
|
|
1532
|
-
},
|
|
1532
|
+
}, L.parseVar = function(e, t, n, r) {
|
|
1533
1533
|
for (e.declarations = [], e.kind = n;;) {
|
|
1534
1534
|
var i = this.startNode();
|
|
1535
1535
|
if (this.parseVarId(i, n), this.eat(E.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === E._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== E._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && !(t && (this.type === E._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, e.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(E.comma)) break;
|
|
1536
1536
|
}
|
|
1537
1537
|
return e;
|
|
1538
|
-
},
|
|
1539
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ?
|
|
1538
|
+
}, L.parseVarId = function(e, t) {
|
|
1539
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? ze : N, !1);
|
|
1540
1540
|
};
|
|
1541
|
-
var
|
|
1542
|
-
|
|
1543
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === E.star && t &
|
|
1541
|
+
var Je = 1, Ye = 2, Xe = 4;
|
|
1542
|
+
L.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 & Ye && this.unexpected(), e.generator = this.eat(E.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & Je && (e.id = t & Xe && this.type !== E.name ? null : this.parseIdent(), e.id && !(t & Ye) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? ze : N : Be));
|
|
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(
|
|
1546
|
-
},
|
|
1545
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Le(e.async, e.generator)), t & Je || (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 & Je ? "FunctionDeclaration" : "FunctionExpression");
|
|
1546
|
+
}, L.parseFunctionParams = function(e) {
|
|
1547
1547
|
this.expect(E.parenL), e.params = this.parseBindingList(E.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
1548
|
-
},
|
|
1548
|
+
}, L.parseClass = function(e, t) {
|
|
1549
1549
|
this.next();
|
|
1550
1550
|
var n = this.strict;
|
|
1551
1551
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
1552
1552
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
1553
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" && Ze(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
|
+
}, L.parseClassElement = function(e) {
|
|
1559
1559
|
if (this.eat(E.semi)) return null;
|
|
1560
1560
|
var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
|
|
1561
1561
|
if (this.eatContextual("static")) {
|
|
@@ -1567,57 +1567,57 @@ 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 && Qe(n, "constructor"), u = l && e;
|
|
1571
1571
|
l && o !== "method" && this.raise(n.key.start, "Constructor can't have get/set modifier"), n.kind = l ? "constructor" : o, this.parseClassMethod(n, i, a, u);
|
|
1572
1572
|
} else this.parseClassField(n);
|
|
1573
1573
|
return n;
|
|
1574
|
-
},
|
|
1574
|
+
}, L.isClassElementNameStart = function() {
|
|
1575
1575
|
return this.type === E.name || this.type === E.privateId || this.type === E.num || this.type === E.string || this.type === E.bracketL || this.type.keyword;
|
|
1576
|
-
},
|
|
1576
|
+
}, L.parseClassElementName = function(e) {
|
|
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
|
+
}, L.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 && Qe(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
|
-
},
|
|
1584
|
-
return
|
|
1585
|
-
},
|
|
1583
|
+
}, L.parseClassField = function(e) {
|
|
1584
|
+
return Qe(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Qe(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(E.eq) ? (this.enterScope(Pe | je), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
1585
|
+
}, L.parseClassStaticBlock = function(e) {
|
|
1586
1586
|
e.body = [];
|
|
1587
1587
|
var t = this.labels;
|
|
1588
|
-
for (this.labels = [], this.enterScope(
|
|
1588
|
+
for (this.labels = [], this.enterScope(Ne | je); this.type !== E.braceR;) {
|
|
1589
1589
|
var n = this.parseStatement(null);
|
|
1590
1590
|
e.body.push(n);
|
|
1591
1591
|
}
|
|
1592
1592
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
1593
|
-
},
|
|
1594
|
-
this.type === E.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id,
|
|
1595
|
-
},
|
|
1593
|
+
}, L.parseClassId = function(e, t) {
|
|
1594
|
+
this.type === E.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, N, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
1595
|
+
}, L.parseClassSuper = function(e) {
|
|
1596
1596
|
e.superClass = this.eat(E._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
1597
|
-
},
|
|
1597
|
+
}, L.enterClassBody = function() {
|
|
1598
1598
|
var e = {
|
|
1599
1599
|
declared: Object.create(null),
|
|
1600
1600
|
used: []
|
|
1601
1601
|
};
|
|
1602
1602
|
return this.privateNameStack.push(e), e.declared;
|
|
1603
|
-
},
|
|
1603
|
+
}, L.exitClassBody = function() {
|
|
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 Ze(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 Qe(e, t) {
|
|
1615
1615
|
var n = e.computed, r = e.key;
|
|
1616
1616
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
1617
1617
|
}
|
|
1618
|
-
|
|
1618
|
+
L.parseExportAllDeclaration = function(e, t) {
|
|
1619
1619
|
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== E.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
1620
|
-
},
|
|
1620
|
+
}, L.parseExport = function(e, t) {
|
|
1621
1621
|
if (this.next(), this.eat(E.star)) return this.parseExportAllDeclaration(e, t);
|
|
1622
1622
|
if (this.eat(E._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
1623
1623
|
if (this.shouldParseExportStatement()) e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
@@ -1633,13 +1633,13 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1633
1633
|
this.semicolon();
|
|
1634
1634
|
}
|
|
1635
1635
|
return this.finishNode(e, "ExportNamedDeclaration");
|
|
1636
|
-
},
|
|
1636
|
+
}, L.parseExportDeclaration = function(e) {
|
|
1637
1637
|
return this.parseStatement(null);
|
|
1638
|
-
},
|
|
1638
|
+
}, L.parseExportDefaultDeclaration = function() {
|
|
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, Je | Xe, !1, e);
|
|
1643
1643
|
} else if (this.type === E._class) {
|
|
1644
1644
|
var n = this.startNode();
|
|
1645
1645
|
return this.parseClass(n, "nullableID");
|
|
@@ -1647,9 +1647,9 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1647
1647
|
var r = this.parseMaybeAssign();
|
|
1648
1648
|
return this.semicolon(), r;
|
|
1649
1649
|
}
|
|
1650
|
-
},
|
|
1651
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
1652
|
-
},
|
|
1650
|
+
}, L.checkExport = function(e, t, n) {
|
|
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
|
+
}, L.checkPatternExport = function(e, t) {
|
|
1653
1653
|
var n = t.type;
|
|
1654
1654
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
1655
1655
|
else if (n === "ObjectPattern") for (var r = 0, i = t.properties; r < i.length; r += 1) {
|
|
@@ -1661,17 +1661,17 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1661
1661
|
c && this.checkPatternExport(e, c);
|
|
1662
1662
|
}
|
|
1663
1663
|
else n === "Property" ? this.checkPatternExport(e, t.value) : n === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : n === "RestElement" && this.checkPatternExport(e, t.argument);
|
|
1664
|
-
},
|
|
1664
|
+
}, L.checkVariableExport = function(e, t) {
|
|
1665
1665
|
if (e) for (var n = 0, r = t; n < r.length; n += 1) {
|
|
1666
1666
|
var i = r[n];
|
|
1667
1667
|
this.checkPatternExport(e, i.id);
|
|
1668
1668
|
}
|
|
1669
|
-
},
|
|
1669
|
+
}, L.shouldParseExportStatement = function() {
|
|
1670
1670
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
1671
|
-
},
|
|
1671
|
+
}, L.parseExportSpecifier = function(e) {
|
|
1672
1672
|
var t = this.startNode();
|
|
1673
1673
|
return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(e, t.exported, t.exported.start), this.finishNode(t, "ExportSpecifier");
|
|
1674
|
-
},
|
|
1674
|
+
}, L.parseExportSpecifiers = function(e) {
|
|
1675
1675
|
var t = [], n = !0;
|
|
1676
1676
|
for (this.expect(E.braceL); !this.eat(E.braceR);) {
|
|
1677
1677
|
if (n) n = !1;
|
|
@@ -1679,18 +1679,18 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1679
1679
|
t.push(this.parseExportSpecifier(e));
|
|
1680
1680
|
}
|
|
1681
1681
|
return t;
|
|
1682
|
-
},
|
|
1683
|
-
return this.next(), this.type === E.string ? (e.specifiers =
|
|
1684
|
-
},
|
|
1682
|
+
}, L.parseImport = function(e) {
|
|
1683
|
+
return this.next(), this.type === E.string ? (e.specifiers = qe, 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
|
+
}, L.parseImportSpecifier = function() {
|
|
1685
1685
|
var e = this.startNode();
|
|
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,
|
|
1687
|
-
},
|
|
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, N), this.finishNode(e, "ImportSpecifier");
|
|
1687
|
+
}, L.parseImportDefaultSpecifier = function() {
|
|
1688
1688
|
var e = this.startNode();
|
|
1689
|
-
return e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
1690
|
-
},
|
|
1689
|
+
return e.local = this.parseIdent(), this.checkLValSimple(e.local, N), this.finishNode(e, "ImportDefaultSpecifier");
|
|
1690
|
+
}, L.parseImportNamespaceSpecifier = function() {
|
|
1691
1691
|
var e = this.startNode();
|
|
1692
|
-
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
1693
|
-
},
|
|
1692
|
+
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, N), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
1693
|
+
}, L.parseImportSpecifiers = function() {
|
|
1694
1694
|
var e = [], t = !0;
|
|
1695
1695
|
if (this.type === E.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(E.comma))) return e;
|
|
1696
1696
|
if (this.type === E.star) return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
@@ -1700,7 +1700,7 @@ R.parseExportAllDeclaration = function(e, t) {
|
|
|
1700
1700
|
e.push(this.parseImportSpecifier());
|
|
1701
1701
|
}
|
|
1702
1702
|
return e;
|
|
1703
|
-
},
|
|
1703
|
+
}, L.parseWithClause = function() {
|
|
1704
1704
|
var e = [];
|
|
1705
1705
|
if (!this.eat(E._with)) return e;
|
|
1706
1706
|
this.expect(E.braceL);
|
|
@@ -1708,25 +1708,25 @@ 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
|
+
}, L.parseImportAttribute = function() {
|
|
1715
1715
|
var e = this.startNode();
|
|
1716
1716
|
return e.key = this.type === E.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(E.colon), this.type !== E.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
1717
|
-
},
|
|
1717
|
+
}, L.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
|
+
}, L.adaptDirectivePrologue = function(e) {
|
|
1724
1724
|
for (var t = 0; t < e.length && this.isDirectiveCandidate(e[t]); ++t) e[t].directive = e[t].expression.raw.slice(1, -1);
|
|
1725
|
-
},
|
|
1725
|
+
}, L.isDirectiveCandidate = function(e) {
|
|
1726
1726
|
return this.options.ecmaVersion >= 5 && e.type === "ExpressionStatement" && e.expression.type === "Literal" && typeof e.expression.value == "string" && (this.input[e.start] === "\"" || this.input[e.start] === "'");
|
|
1727
1727
|
};
|
|
1728
|
-
var
|
|
1729
|
-
|
|
1728
|
+
var R = P.prototype;
|
|
1729
|
+
R.toAssignable = function(e, t, n) {
|
|
1730
1730
|
if (this.options.ecmaVersion >= 6 && e) switch (e.type) {
|
|
1731
1731
|
case "Identifier":
|
|
1732
1732
|
this.inAsync && e.name === "await" && this.raise(e.start, "Cannot use 'await' as identifier inside an async function");
|
|
@@ -1765,7 +1765,7 @@ z.toAssignable = function(e, t, n) {
|
|
|
1765
1765
|
}
|
|
1766
1766
|
else n && this.checkPatternErrors(n, !0);
|
|
1767
1767
|
return e;
|
|
1768
|
-
},
|
|
1768
|
+
}, R.toAssignableList = function(e, t) {
|
|
1769
1769
|
for (var n = e.length, r = 0; r < n; r++) {
|
|
1770
1770
|
var i = e[r];
|
|
1771
1771
|
i && this.toAssignable(i, t);
|
|
@@ -1775,13 +1775,13 @@ z.toAssignable = function(e, t, n) {
|
|
|
1775
1775
|
this.options.ecmaVersion === 6 && t && a && a.type === "RestElement" && a.argument.type !== "Identifier" && this.unexpected(a.argument.start);
|
|
1776
1776
|
}
|
|
1777
1777
|
return e;
|
|
1778
|
-
},
|
|
1778
|
+
}, R.parseSpread = function(e) {
|
|
1779
1779
|
var t = this.startNode();
|
|
1780
1780
|
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
1781
|
-
},
|
|
1781
|
+
}, R.parseRestBinding = function() {
|
|
1782
1782
|
var e = this.startNode();
|
|
1783
1783
|
return this.next(), this.options.ecmaVersion === 6 && this.type !== E.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
1784
|
-
},
|
|
1784
|
+
}, R.parseBindingAtom = function() {
|
|
1785
1785
|
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
1786
1786
|
case E.bracketL:
|
|
1787
1787
|
var e = this.startNode();
|
|
@@ -1789,7 +1789,7 @@ z.toAssignable = function(e, t, n) {
|
|
|
1789
1789
|
case E.braceL: return this.parseObj(!0);
|
|
1790
1790
|
}
|
|
1791
1791
|
return this.parseIdent();
|
|
1792
|
-
},
|
|
1792
|
+
}, R.parseBindingList = function(e, t, n, r) {
|
|
1793
1793
|
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(E.comma), t && this.type === E.comma) i.push(null);
|
|
1794
1794
|
else if (n && this.afterTrailingComma(e)) break;
|
|
1795
1795
|
else if (this.type === E.ellipsis) {
|
|
@@ -1798,21 +1798,21 @@ z.toAssignable = function(e, t, n) {
|
|
|
1798
1798
|
break;
|
|
1799
1799
|
} else i.push(this.parseAssignableListItem(r));
|
|
1800
1800
|
return i;
|
|
1801
|
-
},
|
|
1801
|
+
}, R.parseAssignableListItem = function(e) {
|
|
1802
1802
|
var t = this.parseMaybeDefault(this.start, this.startLoc);
|
|
1803
1803
|
return this.parseBindingListItem(t), t;
|
|
1804
|
-
},
|
|
1804
|
+
}, R.parseBindingListItem = function(e) {
|
|
1805
1805
|
return e;
|
|
1806
|
-
},
|
|
1806
|
+
}, R.parseMaybeDefault = function(e, t, n) {
|
|
1807
1807
|
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(E.eq)) return n;
|
|
1808
1808
|
var r = this.startNodeAt(e, t);
|
|
1809
1809
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
1810
|
-
},
|
|
1811
|
-
t === void 0 && (t =
|
|
1812
|
-
var r = t !==
|
|
1810
|
+
}, R.checkLValSimple = function(e, t, n) {
|
|
1811
|
+
t === void 0 && (t = Re);
|
|
1812
|
+
var r = t !== Re;
|
|
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 ===
|
|
1815
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === N && 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 !== He && 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");
|
|
@@ -1823,8 +1823,8 @@ z.toAssignable = function(e, t, n) {
|
|
|
1823
1823
|
case "ParenthesizedExpression": return r && this.raiseRecoverable(e.start, "Binding parenthesized expression"), this.checkLValSimple(e.expression, t, n);
|
|
1824
1824
|
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
1825
1825
|
}
|
|
1826
|
-
},
|
|
1827
|
-
switch (t === void 0 && (t =
|
|
1826
|
+
}, R.checkLValPattern = function(e, t, n) {
|
|
1827
|
+
switch (t === void 0 && (t = Re), 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];
|
|
@@ -1839,8 +1839,8 @@ z.toAssignable = function(e, t, n) {
|
|
|
1839
1839
|
break;
|
|
1840
1840
|
default: this.checkLValSimple(e, t, n);
|
|
1841
1841
|
}
|
|
1842
|
-
},
|
|
1843
|
-
switch (t === void 0 && (t =
|
|
1842
|
+
}, R.checkLValInnerPattern = function(e, t, n) {
|
|
1843
|
+
switch (t === void 0 && (t = Re), e.type) {
|
|
1844
1844
|
case "Property":
|
|
1845
1845
|
this.checkLValInnerPattern(e.value, t, n);
|
|
1846
1846
|
break;
|
|
@@ -1853,39 +1853,39 @@ z.toAssignable = function(e, t, n) {
|
|
|
1853
1853
|
default: this.checkLValPattern(e, t, n);
|
|
1854
1854
|
}
|
|
1855
1855
|
};
|
|
1856
|
-
var
|
|
1856
|
+
var z = function(e, t, n, r, i) {
|
|
1857
1857
|
this.token = e, this.isExpr = !!t, this.preserveSpace = !!n, this.override = r, this.generator = !!i;
|
|
1858
|
-
},
|
|
1859
|
-
b_stat: new
|
|
1860
|
-
b_expr: new
|
|
1861
|
-
b_tmpl: new
|
|
1862
|
-
p_stat: new
|
|
1863
|
-
p_expr: new
|
|
1864
|
-
q_tmpl: new
|
|
1858
|
+
}, B = {
|
|
1859
|
+
b_stat: new z("{", !1),
|
|
1860
|
+
b_expr: new z("{", !0),
|
|
1861
|
+
b_tmpl: new z("${", !1),
|
|
1862
|
+
p_stat: new z("(", !1),
|
|
1863
|
+
p_expr: new z("(", !0),
|
|
1864
|
+
q_tmpl: new z("`", !0, !0, function(e) {
|
|
1865
1865
|
return e.tryReadTemplateToken();
|
|
1866
1866
|
}),
|
|
1867
|
-
f_stat: new
|
|
1868
|
-
f_expr: new
|
|
1869
|
-
f_expr_gen: new
|
|
1870
|
-
f_gen: new
|
|
1871
|
-
},
|
|
1872
|
-
|
|
1873
|
-
return [
|
|
1874
|
-
},
|
|
1867
|
+
f_stat: new z("function", !1),
|
|
1868
|
+
f_expr: new z("function", !0),
|
|
1869
|
+
f_expr_gen: new z("function", !0, !1, null, !0),
|
|
1870
|
+
f_gen: new z("function", !1, !1, null, !0)
|
|
1871
|
+
}, $e = P.prototype;
|
|
1872
|
+
$e.initialContext = function() {
|
|
1873
|
+
return [B.b_stat];
|
|
1874
|
+
}, $e.curContext = function() {
|
|
1875
1875
|
return this.context[this.context.length - 1];
|
|
1876
|
-
},
|
|
1876
|
+
}, $e.braceIsBlock = function(e) {
|
|
1877
1877
|
var t = this.curContext();
|
|
1878
|
-
return t ===
|
|
1879
|
-
},
|
|
1878
|
+
return t === B.f_expr || t === B.f_stat ? !0 : e === E.colon && (t === B.b_stat || t === B.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 === B.b_stat : e === E._var || e === E._const || e === E.name ? !1 : !this.exprAllowed;
|
|
1879
|
+
}, $e.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
|
+
}, $e.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
|
+
}, $e.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) {
|
|
@@ -1893,32 +1893,32 @@ et.initialContext = function() {
|
|
|
1893
1893
|
return;
|
|
1894
1894
|
}
|
|
1895
1895
|
var e = this.context.pop();
|
|
1896
|
-
e ===
|
|
1896
|
+
e === B.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
1897
1897
|
}, E.braceL.updateContext = function(e) {
|
|
1898
|
-
this.context.push(this.braceIsBlock(e) ?
|
|
1898
|
+
this.context.push(this.braceIsBlock(e) ? B.b_stat : B.b_expr), this.exprAllowed = !0;
|
|
1899
1899
|
}, E.dollarBraceL.updateContext = function() {
|
|
1900
|
-
this.context.push(
|
|
1900
|
+
this.context.push(B.b_tmpl), this.exprAllowed = !0;
|
|
1901
1901
|
}, E.parenL.updateContext = function(e) {
|
|
1902
1902
|
var t = e === E._if || e === E._for || e === E._with || e === E._while;
|
|
1903
|
-
this.context.push(t ?
|
|
1903
|
+
this.context.push(t ? B.p_stat : B.p_expr), this.exprAllowed = !0;
|
|
1904
1904
|
}, E.incDec.updateContext = function() {}, E._function.updateContext = E._class.updateContext = function(e) {
|
|
1905
|
-
e.beforeExpr && e !== E._else && !(e === E.semi && this.curContext() !==
|
|
1905
|
+
e.beforeExpr && e !== E._else && !(e === E.semi && this.curContext() !== B.p_stat) && !(e === E._return && D.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === E.colon || e === E.braceL) && this.curContext() === B.b_stat) ? this.context.push(B.f_expr) : this.context.push(B.f_stat), this.exprAllowed = !1;
|
|
1906
1906
|
}, E.colon.updateContext = function() {
|
|
1907
1907
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
1908
1908
|
}, E.backQuote.updateContext = function() {
|
|
1909
|
-
this.curContext() ===
|
|
1909
|
+
this.curContext() === B.q_tmpl ? this.context.pop() : this.context.push(B.q_tmpl), this.exprAllowed = !1;
|
|
1910
1910
|
}, E.star.updateContext = function(e) {
|
|
1911
1911
|
if (e === E._function) {
|
|
1912
1912
|
var t = this.context.length - 1;
|
|
1913
|
-
this.context[t] ===
|
|
1913
|
+
this.context[t] === B.f_expr ? this.context[t] = B.f_expr_gen : this.context[t] = B.f_gen;
|
|
1914
1914
|
}
|
|
1915
1915
|
this.exprAllowed = !0;
|
|
1916
1916
|
}, E.name.updateContext = function(e) {
|
|
1917
1917
|
var t = !1;
|
|
1918
1918
|
this.options.ecmaVersion >= 6 && e !== E.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
1919
1919
|
};
|
|
1920
|
-
var
|
|
1921
|
-
|
|
1920
|
+
var V = P.prototype;
|
|
1921
|
+
V.checkPropClash = function(e, t, n) {
|
|
1922
1922
|
if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
|
|
1923
1923
|
var r = e.key, i;
|
|
1924
1924
|
switch (r.type) {
|
|
@@ -1943,7 +1943,7 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1943
1943
|
set: !1
|
|
1944
1944
|
}, o[a] = !0;
|
|
1945
1945
|
}
|
|
1946
|
-
},
|
|
1946
|
+
}, V.parseExpression = function(e, t) {
|
|
1947
1947
|
var n = this;
|
|
1948
1948
|
return this.catchStackOverflow(function() {
|
|
1949
1949
|
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
@@ -1954,13 +1954,13 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1954
1954
|
}
|
|
1955
1955
|
return a;
|
|
1956
1956
|
});
|
|
1957
|
-
},
|
|
1957
|
+
}, V.parseMaybeAssign = function(e, t, n) {
|
|
1958
1958
|
if (this.isContextual("yield")) {
|
|
1959
1959
|
if (this.inGenerator) return this.parseYield(e);
|
|
1960
1960
|
this.exprAllowed = !1;
|
|
1961
1961
|
}
|
|
1962
1962
|
var r = !1, i = -1, a = -1, o = -1;
|
|
1963
|
-
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
1963
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new We(), 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);
|
|
@@ -1969,7 +1969,7 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1969
1969
|
return u.operator = this.value, this.type === E.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === E.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), u.left = l, this.next(), u.right = this.parseMaybeAssign(e), o > -1 && (t.doubleProto = o), this.finishNode(u, "AssignmentExpression");
|
|
1970
1970
|
} else r && this.checkExpressionErrors(t, !0);
|
|
1971
1971
|
return i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
1972
|
-
},
|
|
1972
|
+
}, V.parseMaybeConditional = function(e, t) {
|
|
1973
1973
|
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
1974
1974
|
if (this.checkExpressionErrors(t)) return i;
|
|
1975
1975
|
if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(E.question)) {
|
|
@@ -1977,10 +1977,10 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1977
1977
|
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(E.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
1978
1978
|
}
|
|
1979
1979
|
return i;
|
|
1980
|
-
},
|
|
1980
|
+
}, V.parseExprOps = function(e, t) {
|
|
1981
1981
|
var n = this.start, r = this.startLoc, i = this.parseMaybeUnary(t, !1, !1, e);
|
|
1982
1982
|
return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
|
|
1983
|
-
},
|
|
1983
|
+
}, V.parseExprOp = function(e, t, n, r, i) {
|
|
1984
1984
|
var a = this.type.binop;
|
|
1985
1985
|
if (a != null && (!i || this.type !== E._in) && a > r) {
|
|
1986
1986
|
var o = this.type === E.logicalOR || this.type === E.logicalAND, s = this.type === E.coalesce;
|
|
@@ -1991,16 +1991,16 @@ H.checkPropClash = function(e, t, n) {
|
|
|
1991
1991
|
return (o && this.type === E.coalesce || s && (this.type === E.logicalOR || this.type === E.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(f, t, n, r, i);
|
|
1992
1992
|
}
|
|
1993
1993
|
return e;
|
|
1994
|
-
},
|
|
1994
|
+
}, V.buildBinary = function(e, t, n, r, i, a) {
|
|
1995
1995
|
r.type === "PrivateIdentifier" && this.raise(r.start, "Private identifier can only be left side of binary expression");
|
|
1996
1996
|
var o = this.startNodeAt(e, t);
|
|
1997
1997
|
return o.left = n, o.operator = i, o.right = r, this.finishNode(o, a ? "LogicalExpression" : "BinaryExpression");
|
|
1998
|
-
},
|
|
1998
|
+
}, V.parseMaybeUnary = function(e, t, n, r) {
|
|
1999
1999
|
var i = this.start, a = this.startLoc, o;
|
|
2000
2000
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
2001
2001
|
else if (this.type.prefix) {
|
|
2002
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" && et(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && tt(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,18 +2013,18 @@ 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 et(e) {
|
|
2017
|
+
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && et(e.expression);
|
|
2018
2018
|
}
|
|
2019
|
-
function
|
|
2020
|
-
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" &&
|
|
2019
|
+
function tt(e) {
|
|
2020
|
+
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && tt(e.expression) || e.type === "ParenthesizedExpression" && tt(e.expression);
|
|
2021
2021
|
}
|
|
2022
|
-
|
|
2022
|
+
V.parseExprSubscripts = function(e, t) {
|
|
2023
2023
|
var n = this.start, r = this.startLoc, i = this.parseExprAtom(e, t);
|
|
2024
2024
|
if (i.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") return i;
|
|
2025
2025
|
var a = this.parseSubscripts(i, n, r, !1, t);
|
|
2026
2026
|
return e && a.type === "MemberExpression" && (e.parenthesizedAssign >= a.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= a.start && (e.parenthesizedBind = -1), e.trailingComma >= a.start && (e.trailingComma = -1)), a;
|
|
2027
|
-
},
|
|
2027
|
+
}, V.parseSubscripts = function(e, t, n, r, i) {
|
|
2028
2028
|
for (var a = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, o = !1;;) {
|
|
2029
2029
|
var s = this.parseSubscript(e, t, n, r, a, o, i);
|
|
2030
2030
|
if (s.optional && (o = !0), s === e || s.type === "ArrowFunctionExpression") {
|
|
@@ -2036,11 +2036,11 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2036
2036
|
}
|
|
2037
2037
|
e = s;
|
|
2038
2038
|
}
|
|
2039
|
-
},
|
|
2039
|
+
}, V.shouldParseAsyncArrow = function() {
|
|
2040
2040
|
return !this.canInsertSemicolon() && this.eat(E.arrow);
|
|
2041
|
-
},
|
|
2041
|
+
}, V.parseSubscriptAsyncArrow = function(e, t, n, r) {
|
|
2042
2042
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
|
|
2043
|
-
},
|
|
2043
|
+
}, V.parseSubscript = function(e, t, n, r, i, a, o) {
|
|
2044
2044
|
var s = this.options.ecmaVersion >= 11, c = s && this.eat(E.questionDot);
|
|
2045
2045
|
r && c && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
2046
2046
|
var l = this.eat(E.bracketL);
|
|
@@ -2048,20 +2048,20 @@ 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 We(), 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
|
+
}, V.parseExprAtom = function(e, t, n) {
|
|
2065
2065
|
this.type === E.slash && this.readRegexp();
|
|
2066
2066
|
var r, i = this.potentialArrowAt === this.start;
|
|
2067
2067
|
switch (this.type) {
|
|
@@ -2069,7 +2069,7 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2069
2069
|
case E._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
2070
2070
|
case E.name:
|
|
2071
2071
|
var a = this.start, o = this.startLoc, s = this.containsEsc, c = this.parseIdent(!1);
|
|
2072
|
-
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(E._function)) return this.overrideContext(
|
|
2072
|
+
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(E._function)) return this.overrideContext(B.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
|
|
2073
2073
|
if (i && !this.canInsertSemicolon()) {
|
|
2074
2074
|
if (this.eat(E.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
|
|
2075
2075
|
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === E.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(E.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
|
|
@@ -2090,7 +2090,7 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2090
2090
|
var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
|
|
2091
2091
|
return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(d) && (e.parenthesizedAssign = u), e.parenthesizedBind < 0 && (e.parenthesizedBind = u)), d;
|
|
2092
2092
|
case E.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(E.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
2093
|
-
case E.braceL: return this.overrideContext(
|
|
2093
|
+
case E.braceL: return this.overrideContext(B.b_expr), this.parseObj(!1, e);
|
|
2094
2094
|
case E._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
2095
2095
|
case E._class: return this.parseClass(this.startNode(), !1);
|
|
2096
2096
|
case E._new: return this.parseNew();
|
|
@@ -2098,40 +2098,40 @@ H.parseExprSubscripts = function(e, t) {
|
|
|
2098
2098
|
case E._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
|
|
2099
2099
|
default: return this.parseExprAtomDefault();
|
|
2100
2100
|
}
|
|
2101
|
-
},
|
|
2101
|
+
}, V.parseExprAtomDefault = function() {
|
|
2102
2102
|
this.unexpected();
|
|
2103
|
-
},
|
|
2103
|
+
}, V.parseExprImport = function(e) {
|
|
2104
2104
|
var t = this.startNode();
|
|
2105
2105
|
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === E.parenL && !e) return this.parseDynamicImport(t);
|
|
2106
2106
|
if (this.type === E.dot) {
|
|
2107
2107
|
var n = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
2108
2108
|
return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
|
|
2109
2109
|
} else this.unexpected();
|
|
2110
|
-
},
|
|
2110
|
+
}, V.parseDynamicImport = function(e) {
|
|
2111
2111
|
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(E.parenR) ? e.options = null : (this.expect(E.comma), this.afterTrailingComma(E.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(E.parenR) || (this.expect(E.comma), this.afterTrailingComma(E.parenR) || this.unexpected())));
|
|
2112
2112
|
else if (!this.eat(E.parenR)) {
|
|
2113
2113
|
var t = this.start;
|
|
2114
2114
|
this.eat(E.comma) && this.eat(E.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
2115
2115
|
}
|
|
2116
2116
|
return this.finishNode(e, "ImportExpression");
|
|
2117
|
-
},
|
|
2117
|
+
}, V.parseImportMeta = function(e) {
|
|
2118
2118
|
this.next();
|
|
2119
2119
|
var t = this.containsEsc;
|
|
2120
2120
|
return e.property = this.parseIdent(!0), e.property.name !== "meta" && this.raiseRecoverable(e.property.start, "The only valid meta property for import is 'import.meta'"), t && this.raiseRecoverable(e.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(e.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e, "MetaProperty");
|
|
2121
|
-
},
|
|
2121
|
+
}, V.parseLiteral = function(e) {
|
|
2122
2122
|
var t = this.startNode();
|
|
2123
2123
|
return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value == null ? t.raw.slice(0, -1).replace(/_/g, "") : t.value.toString()), this.next(), this.finishNode(t, "Literal");
|
|
2124
|
-
},
|
|
2124
|
+
}, V.parseParenExpression = function() {
|
|
2125
2125
|
this.expect(E.parenL);
|
|
2126
2126
|
var e = this.parseExpression();
|
|
2127
2127
|
return this.expect(E.parenR), e;
|
|
2128
|
-
},
|
|
2128
|
+
}, V.shouldParseArrow = function(e) {
|
|
2129
2129
|
return !this.canInsertSemicolon();
|
|
2130
|
-
},
|
|
2130
|
+
}, V.parseParenAndDistinguishExpression = function(e, t) {
|
|
2131
2131
|
var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
|
|
2132
2132
|
if (this.options.ecmaVersion >= 6) {
|
|
2133
2133
|
this.next();
|
|
2134
|
-
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new
|
|
2134
|
+
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new We(), 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,21 +2139,21 @@ 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
|
+
}, V.parseParenItem = function(e) {
|
|
2151
2151
|
return e;
|
|
2152
|
-
},
|
|
2152
|
+
}, V.parseParenArrowList = function(e, t, n, r) {
|
|
2153
2153
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !1, r);
|
|
2154
2154
|
};
|
|
2155
|
-
var
|
|
2156
|
-
|
|
2155
|
+
var nt = [];
|
|
2156
|
+
V.parseNew = function() {
|
|
2157
2157
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
2158
2158
|
var e = this.startNode();
|
|
2159
2159
|
if (this.next(), this.options.ecmaVersion >= 6 && this.type === E.dot) {
|
|
@@ -2163,8 +2163,8 @@ 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 =
|
|
2167
|
-
},
|
|
2166
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(E.parenL) ? e.arguments = this.parseExprList(E.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = nt, this.finishNode(e, "NewExpression");
|
|
2167
|
+
}, V.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 = {
|
|
2170
2170
|
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
@@ -2173,7 +2173,7 @@ H.parseNew = function() {
|
|
|
2173
2173
|
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
|
|
2174
2174
|
cooked: this.value
|
|
2175
2175
|
}, this.next(), n.tail = this.type === E.backQuote, this.finishNode(n, "TemplateElement");
|
|
2176
|
-
},
|
|
2176
|
+
}, V.parseTemplate = function(e) {
|
|
2177
2177
|
e === void 0 && (e = {});
|
|
2178
2178
|
var t = e.isTagged;
|
|
2179
2179
|
t === void 0 && (t = !1);
|
|
@@ -2182,9 +2182,9 @@ H.parseNew = function() {
|
|
|
2182
2182
|
var r = this.parseTemplateElement({ isTagged: t });
|
|
2183
2183
|
for (n.quasis = [r]; !r.tail;) this.type === E.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(E.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(E.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
2184
2184
|
return this.next(), this.finishNode(n, "TemplateLiteral");
|
|
2185
|
-
},
|
|
2185
|
+
}, V.isAsyncProp = function(e) {
|
|
2186
2186
|
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === E.name || this.type === E.num || this.type === E.string || this.type === E.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === E.star) && !D.test(this.input.slice(this.lastTokEnd, this.start));
|
|
2187
|
-
},
|
|
2187
|
+
}, V.parseObj = function(e, t) {
|
|
2188
2188
|
var n = this.startNode(), r = !0, i = {};
|
|
2189
2189
|
for (n.properties = [], this.next(); !this.eat(E.braceR);) {
|
|
2190
2190
|
if (r) r = !1;
|
|
@@ -2193,13 +2193,13 @@ H.parseNew = function() {
|
|
|
2193
2193
|
e || this.checkPropClash(a, i, t), n.properties.push(a);
|
|
2194
2194
|
}
|
|
2195
2195
|
return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
|
|
2196
|
-
},
|
|
2196
|
+
}, V.parseProperty = function(e, t) {
|
|
2197
2197
|
var n = this.startNode(), r, i, a, o;
|
|
2198
2198
|
if (this.options.ecmaVersion >= 9 && this.eat(E.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === E.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(n, "RestElement")) : (n.argument = this.parseMaybeAssign(!1, t), this.type === E.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
|
|
2199
2199
|
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(E.star)));
|
|
2200
2200
|
var s = this.containsEsc;
|
|
2201
2201
|
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(E.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
|
|
2202
|
-
},
|
|
2202
|
+
}, V.parseGetterSetter = function(e) {
|
|
2203
2203
|
var t = e.key.name;
|
|
2204
2204
|
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
2205
2205
|
var n = e.kind === "get" ? 0 : 1;
|
|
@@ -2207,41 +2207,41 @@ H.parseNew = function() {
|
|
|
2207
2207
|
var r = e.value.start;
|
|
2208
2208
|
e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
|
|
2209
2209
|
} else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
2210
|
-
},
|
|
2210
|
+
}, V.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
|
|
2211
2211
|
(n || r) && this.type === E.colon && this.unexpected(), this.eat(E.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === E.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(n, r), e.kind = "init") : !t && !s && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== E.comma && this.type !== E.braceR && this.type !== E.eq ? ((n || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((n || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = i), t ? e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key)) : this.type === E.eq && o ? (o.shorthandAssign < 0 && (o.shorthandAssign = this.start), e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
2212
|
-
},
|
|
2212
|
+
}, V.parsePropertyName = function(e) {
|
|
2213
2213
|
if (this.options.ecmaVersion >= 6) {
|
|
2214
2214
|
if (this.eat(E.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(E.bracketR), e.key;
|
|
2215
2215
|
e.computed = !1;
|
|
2216
2216
|
}
|
|
2217
2217
|
return e.key = this.type === E.num || this.type === E.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2218
|
-
},
|
|
2218
|
+
}, V.initFunction = function(e) {
|
|
2219
2219
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
2220
|
-
},
|
|
2220
|
+
}, V.parseMethod = function(e, t, n) {
|
|
2221
2221
|
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2222
|
-
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
2223
|
-
},
|
|
2222
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Le(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
|
+
}, V.parseArrowExpression = function(e, t, n, r) {
|
|
2224
2224
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2225
|
-
return this.enterScope(
|
|
2226
|
-
},
|
|
2225
|
+
return this.enterScope(Le(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
|
+
}, V.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);
|
|
2229
2229
|
else {
|
|
2230
2230
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
2231
2231
|
(!a || s) && (o = this.strictDirective(this.end), o && s && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
2232
2232
|
var c = this.labels;
|
|
2233
|
-
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id,
|
|
2233
|
+
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, He), 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
|
+
}, V.isSimpleParamList = function(e) {
|
|
2237
2237
|
for (var t = 0, n = e; t < n.length; t += 1) if (n[t].type !== "Identifier") return !1;
|
|
2238
2238
|
return !0;
|
|
2239
|
-
},
|
|
2239
|
+
}, V.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, ze, t ? null : n);
|
|
2243
2243
|
}
|
|
2244
|
-
},
|
|
2244
|
+
}, V.parseExprList = function(e, t, n, r) {
|
|
2245
2245
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
2246
2246
|
if (a) a = !1;
|
|
2247
2247
|
else if (this.expect(E.comma), t && this.afterTrailingComma(e)) break;
|
|
@@ -2249,160 +2249,160 @@ H.parseNew = function() {
|
|
|
2249
2249
|
n && this.type === E.comma ? o = null : this.type === E.ellipsis ? (o = this.parseSpread(r), r && this.type === E.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
|
|
2250
2250
|
}
|
|
2251
2251
|
return i;
|
|
2252
|
-
},
|
|
2252
|
+
}, V.checkUnreserved = function(e) {
|
|
2253
2253
|
var t = e.start, n = e.end, r = e.name;
|
|
2254
|
-
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags &
|
|
2255
|
-
},
|
|
2254
|
+
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & Ie) && 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
|
+
}, V.parseIdent = function(e) {
|
|
2256
2256
|
var t = this.parseIdentNode();
|
|
2257
2257
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
2258
|
-
},
|
|
2258
|
+
}, V.parseIdentNode = function() {
|
|
2259
2259
|
var e = this.startNode();
|
|
2260
2260
|
return this.type === E.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = E.name) : this.unexpected(), e;
|
|
2261
|
-
},
|
|
2261
|
+
}, V.parsePrivateIdent = function() {
|
|
2262
2262
|
var e = this.startNode();
|
|
2263
2263
|
return this.type === E.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
2264
|
-
},
|
|
2264
|
+
}, V.parseYield = function(e) {
|
|
2265
2265
|
this.yieldPos ||= this.start;
|
|
2266
2266
|
var t = this.startNode();
|
|
2267
2267
|
return this.next(), this.type === E.semi || this.canInsertSemicolon() || this.type !== E.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(E.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
2268
|
-
},
|
|
2268
|
+
}, V.parseAwait = function(e) {
|
|
2269
2269
|
this.awaitPos ||= this.start;
|
|
2270
2270
|
var t = this.startNode();
|
|
2271
2271
|
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
2272
2272
|
};
|
|
2273
|
-
var
|
|
2274
|
-
|
|
2275
|
-
var n =
|
|
2273
|
+
var rt = P.prototype;
|
|
2274
|
+
rt.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
|
+
}, rt.raiseRecoverable = rt.raise, rt.curPosition = function() {
|
|
2280
|
+
if (this.options.locations) return new be(this.curLine, this.pos - this.lineStart);
|
|
2281
2281
|
};
|
|
2282
|
-
var
|
|
2282
|
+
var H = P.prototype, it = function(e) {
|
|
2283
2283
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
2284
2284
|
};
|
|
2285
|
-
|
|
2286
|
-
this.scopeStack.push(new
|
|
2287
|
-
},
|
|
2285
|
+
H.enterScope = function(e) {
|
|
2286
|
+
this.scopeStack.push(new it(e));
|
|
2287
|
+
}, H.exitScope = function() {
|
|
2288
2288
|
this.scopeStack.pop();
|
|
2289
|
-
},
|
|
2289
|
+
}, H.treatFunctionsAsVarInScope = function(e) {
|
|
2290
2290
|
return e.flags & M || !this.inModule && e.flags & j;
|
|
2291
|
-
},
|
|
2291
|
+
}, H.declareName = function(e, t, n) {
|
|
2292
2292
|
var r = !1;
|
|
2293
|
-
if (t ===
|
|
2293
|
+
if (t === N) {
|
|
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 === Ve) this.currentScope().lexical.push(e);
|
|
2297
|
+
else if (t === Be) {
|
|
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 & Ie) break;
|
|
2307
2307
|
}
|
|
2308
2308
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
2309
|
-
},
|
|
2309
|
+
}, H.checkLocalExport = function(e) {
|
|
2310
2310
|
this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
|
|
2311
|
-
},
|
|
2311
|
+
}, H.currentScope = function() {
|
|
2312
2312
|
return this.scopeStack[this.scopeStack.length - 1];
|
|
2313
|
-
},
|
|
2313
|
+
}, H.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 & (Ie | Pe | Ne)) return t;
|
|
2317
2317
|
}
|
|
2318
|
-
},
|
|
2318
|
+
}, H.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 & (Ie | Pe | Ne) && !(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 at = 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
|
+
}, ot = P.prototype;
|
|
2327
|
+
ot.startNode = function() {
|
|
2328
|
+
return new at(this, this.start, this.startLoc);
|
|
2329
|
+
}, ot.startNodeAt = function(e, t) {
|
|
2330
|
+
return new at(this, e, t);
|
|
2331
2331
|
};
|
|
2332
|
-
function
|
|
2332
|
+
function st(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
|
+
ot.finishNode = function(e, t) {
|
|
2336
|
+
return st.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
|
|
2337
|
+
}, ot.finishNodeAt = function(e, t, n, r) {
|
|
2338
|
+
return st.call(this, e, t, n, r);
|
|
2339
|
+
}, ot.copyNode = function(e) {
|
|
2340
|
+
var t = new at(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 ct = "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", lt = "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", ut = lt + " Extended_Pictographic", dt = ut, ft = dt + " EBase EComp EMod EPres ExtPict", pt = ft, mt = {
|
|
2345
|
+
9: lt,
|
|
2346
|
+
10: ut,
|
|
2347
|
+
11: dt,
|
|
2348
|
+
12: ft,
|
|
2349
|
+
13: pt,
|
|
2350
|
+
14: pt
|
|
2351
|
+
}, ht = {
|
|
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
|
+
}, gt = "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", _t = "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", vt = _t + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", yt = vt + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", bt = yt + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", xt = bt + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", St = {
|
|
2359
|
+
9: _t,
|
|
2360
|
+
10: vt,
|
|
2361
|
+
11: yt,
|
|
2362
|
+
12: bt,
|
|
2363
|
+
13: xt,
|
|
2364
|
+
14: xt + " " + ct
|
|
2365
|
+
}, Ct = {};
|
|
2366
|
+
function wt(e) {
|
|
2367
|
+
var t = Ct[e] = {
|
|
2368
|
+
binary: k(mt[e] + " " + gt),
|
|
2369
|
+
binaryOfStrings: k(ht[e]),
|
|
2370
2370
|
nonBinary: {
|
|
2371
|
-
General_Category: k(
|
|
2372
|
-
Script: k(
|
|
2371
|
+
General_Category: k(gt),
|
|
2372
|
+
Script: k(St[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 Tt = 0, Et = [
|
|
2378
2378
|
9,
|
|
2379
2379
|
10,
|
|
2380
2380
|
11,
|
|
2381
2381
|
12,
|
|
2382
2382
|
13,
|
|
2383
2383
|
14
|
|
2384
|
-
];
|
|
2385
|
-
var
|
|
2386
|
-
|
|
2384
|
+
]; Tt < Et.length; Tt += 1) {
|
|
2385
|
+
var Dt = Et[Tt];
|
|
2386
|
+
wt(Dt);
|
|
2387
2387
|
}
|
|
2388
|
-
var
|
|
2388
|
+
var U = P.prototype, Ot = function(e, t) {
|
|
2389
2389
|
this.parent = e, this.base = t || this;
|
|
2390
2390
|
};
|
|
2391
|
-
|
|
2391
|
+
Ot.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
|
+
}, Ot.prototype.sibling = function() {
|
|
2395
|
+
return new Ot(this.parent, this.base);
|
|
2396
2396
|
};
|
|
2397
|
-
var
|
|
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 =
|
|
2397
|
+
var W = 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 = Ct[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
|
+
W.prototype.reset = function(e, t, n) {
|
|
2401
2401
|
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
2402
2402
|
this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
|
|
2403
|
-
},
|
|
2403
|
+
}, W.prototype.raise = function(e) {
|
|
2404
2404
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
2405
|
-
},
|
|
2405
|
+
}, W.prototype.at = function(e, t) {
|
|
2406
2406
|
t === void 0 && (t = !1);
|
|
2407
2407
|
var n = this.source, r = n.length;
|
|
2408
2408
|
if (e >= r) return -1;
|
|
@@ -2410,21 +2410,21 @@ G.prototype.reset = function(e, t, n) {
|
|
|
2410
2410
|
if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
|
|
2411
2411
|
var a = n.charCodeAt(e + 1);
|
|
2412
2412
|
return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
|
|
2413
|
-
},
|
|
2413
|
+
}, W.prototype.nextIndex = function(e, t) {
|
|
2414
2414
|
t === void 0 && (t = !1);
|
|
2415
2415
|
var n = this.source, r = n.length;
|
|
2416
2416
|
if (e >= r) return r;
|
|
2417
2417
|
var i = n.charCodeAt(e), a;
|
|
2418
2418
|
return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
|
|
2419
|
-
},
|
|
2419
|
+
}, W.prototype.current = function(e) {
|
|
2420
2420
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
2421
|
-
},
|
|
2421
|
+
}, W.prototype.lookahead = function(e) {
|
|
2422
2422
|
return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
|
|
2423
|
-
},
|
|
2423
|
+
}, W.prototype.advance = function(e) {
|
|
2424
2424
|
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
2425
|
-
},
|
|
2425
|
+
}, W.prototype.eat = function(e, t) {
|
|
2426
2426
|
return t === void 0 && (t = !1), this.current(t) === e ? (this.advance(t), !0) : !1;
|
|
2427
|
-
},
|
|
2427
|
+
}, W.prototype.eatChars = function(e, t) {
|
|
2428
2428
|
t === void 0 && (t = !1);
|
|
2429
2429
|
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
2430
2430
|
var a = i[r], o = this.at(n, t);
|
|
@@ -2432,34 +2432,34 @@ G.prototype.reset = function(e, t, n) {
|
|
|
2432
2432
|
n = this.nextIndex(n, t);
|
|
2433
2433
|
}
|
|
2434
2434
|
return this.pos = n, !0;
|
|
2435
|
-
},
|
|
2435
|
+
}, U.validateRegExpFlags = function(e) {
|
|
2436
2436
|
for (var t = e.validFlags, n = e.flags, r = !1, i = !1, a = 0; a < n.length; a++) {
|
|
2437
2437
|
var o = n.charAt(a);
|
|
2438
2438
|
t.indexOf(o) === -1 && this.raise(e.start, "Invalid regular expression flag"), n.indexOf(o, a + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), o === "u" && (r = !0), o === "v" && (i = !0);
|
|
2439
2439
|
}
|
|
2440
2440
|
this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
|
|
2441
2441
|
};
|
|
2442
|
-
function
|
|
2442
|
+
function kt(e) {
|
|
2443
2443
|
for (var t in e) return !0;
|
|
2444
2444
|
return !1;
|
|
2445
2445
|
}
|
|
2446
|
-
|
|
2447
|
-
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 &&
|
|
2448
|
-
},
|
|
2446
|
+
U.validateRegExpPattern = function(e) {
|
|
2447
|
+
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && kt(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
2448
|
+
}, U.regexp_pattern = function(e) {
|
|
2449
2449
|
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
2450
2450
|
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
2451
2451
|
var r = n[t];
|
|
2452
2452
|
e.groupNames[r] || e.raise("Invalid named capture referenced");
|
|
2453
2453
|
}
|
|
2454
|
-
},
|
|
2454
|
+
}, U.regexp_disjunction = function(e) {
|
|
2455
2455
|
var t = this.options.ecmaVersion >= 16;
|
|
2456
|
-
for (t && (e.branchID = new
|
|
2456
|
+
for (t && (e.branchID = new Ot(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
|
+
}, U.regexp_alternative = function(e) {
|
|
2459
2459
|
for (; e.pos < e.source.length && this.regexp_eatTerm(e););
|
|
2460
|
-
},
|
|
2460
|
+
}, U.regexp_eatTerm = function(e) {
|
|
2461
2461
|
return this.regexp_eatAssertion(e) ? (e.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e) && e.switchU && e.raise("Invalid quantifier"), !0) : (e.switchU ? this.regexp_eatAtom(e) : this.regexp_eatExtendedAtom(e)) ? (this.regexp_eatQuantifier(e), !0) : !1;
|
|
2462
|
-
},
|
|
2462
|
+
}, U.regexp_eatAssertion = function(e) {
|
|
2463
2463
|
var t = e.pos;
|
|
2464
2464
|
if (e.lastAssertionIsQuantifiable = !1, e.eat(94) || e.eat(36)) return !0;
|
|
2465
2465
|
if (e.eat(92)) {
|
|
@@ -2471,11 +2471,11 @@ W.validateRegExpPattern = function(e) {
|
|
|
2471
2471
|
if (this.options.ecmaVersion >= 9 && (n = e.eat(60)), e.eat(61) || e.eat(33)) return this.regexp_disjunction(e), e.eat(41) || e.raise("Unterminated group"), e.lastAssertionIsQuantifiable = !n, !0;
|
|
2472
2472
|
}
|
|
2473
2473
|
return e.pos = t, !1;
|
|
2474
|
-
},
|
|
2474
|
+
}, U.regexp_eatQuantifier = function(e, t) {
|
|
2475
2475
|
return t === void 0 && (t = !1), this.regexp_eatQuantifierPrefix(e, t) ? (e.eat(63), !0) : !1;
|
|
2476
|
-
},
|
|
2476
|
+
}, U.regexp_eatQuantifierPrefix = function(e, t) {
|
|
2477
2477
|
return e.eat(42) || e.eat(43) || e.eat(63) || this.regexp_eatBracedQuantifier(e, t);
|
|
2478
|
-
},
|
|
2478
|
+
}, U.regexp_eatBracedQuantifier = function(e, t) {
|
|
2479
2479
|
var n = e.pos;
|
|
2480
2480
|
if (e.eat(123)) {
|
|
2481
2481
|
var r = 0, i = -1;
|
|
@@ -2483,16 +2483,16 @@ W.validateRegExpPattern = function(e) {
|
|
|
2483
2483
|
e.switchU && !t && e.raise("Incomplete quantifier"), e.pos = n;
|
|
2484
2484
|
}
|
|
2485
2485
|
return !1;
|
|
2486
|
-
},
|
|
2486
|
+
}, U.regexp_eatAtom = function(e) {
|
|
2487
2487
|
return this.regexp_eatPatternCharacters(e) || e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e);
|
|
2488
|
-
},
|
|
2488
|
+
}, U.regexp_eatReverseSolidusAtomEscape = function(e) {
|
|
2489
2489
|
var t = e.pos;
|
|
2490
2490
|
if (e.eat(92)) {
|
|
2491
2491
|
if (this.regexp_eatAtomEscape(e)) return !0;
|
|
2492
2492
|
e.pos = t;
|
|
2493
2493
|
}
|
|
2494
2494
|
return !1;
|
|
2495
|
-
},
|
|
2495
|
+
}, U.regexp_eatUncapturingGroup = function(e) {
|
|
2496
2496
|
var t = e.pos;
|
|
2497
2497
|
if (e.eat(40)) {
|
|
2498
2498
|
if (e.eat(63)) {
|
|
@@ -2521,37 +2521,37 @@ W.validateRegExpPattern = function(e) {
|
|
|
2521
2521
|
e.pos = t;
|
|
2522
2522
|
}
|
|
2523
2523
|
return !1;
|
|
2524
|
-
},
|
|
2524
|
+
}, U.regexp_eatCapturingGroup = function(e) {
|
|
2525
2525
|
if (e.eat(40)) {
|
|
2526
2526
|
if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e) : e.current() === 63 && e.raise("Invalid group"), this.regexp_disjunction(e), e.eat(41)) return e.numCapturingParens += 1, !0;
|
|
2527
2527
|
e.raise("Unterminated group");
|
|
2528
2528
|
}
|
|
2529
2529
|
return !1;
|
|
2530
|
-
},
|
|
2531
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 &&
|
|
2530
|
+
}, U.regexp_eatModifiers = function(e) {
|
|
2531
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && At(n);) t += A(n), e.advance();
|
|
2532
2532
|
return t;
|
|
2533
2533
|
};
|
|
2534
|
-
function
|
|
2534
|
+
function At(e) {
|
|
2535
2535
|
return e === 105 || e === 109 || e === 115;
|
|
2536
2536
|
}
|
|
2537
|
-
|
|
2537
|
+
U.regexp_eatExtendedAtom = function(e) {
|
|
2538
2538
|
return e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e) || this.regexp_eatInvalidBracedQuantifier(e) || this.regexp_eatExtendedPatternCharacter(e);
|
|
2539
|
-
},
|
|
2539
|
+
}, U.regexp_eatInvalidBracedQuantifier = function(e) {
|
|
2540
2540
|
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
2541
|
-
},
|
|
2541
|
+
}, U.regexp_eatSyntaxCharacter = function(e) {
|
|
2542
2542
|
var t = e.current();
|
|
2543
|
-
return
|
|
2543
|
+
return jt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2544
2544
|
};
|
|
2545
|
-
function
|
|
2545
|
+
function jt(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
|
-
|
|
2549
|
-
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !
|
|
2548
|
+
U.regexp_eatPatternCharacters = function(e) {
|
|
2549
|
+
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !jt(n);) e.advance();
|
|
2550
2550
|
return e.pos !== t;
|
|
2551
|
-
},
|
|
2551
|
+
}, U.regexp_eatExtendedPatternCharacter = function(e) {
|
|
2552
2552
|
var t = e.current();
|
|
2553
2553
|
return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 ? (e.advance(), !0) : !1;
|
|
2554
|
-
},
|
|
2554
|
+
}, U.regexp_groupSpecifier = function(e) {
|
|
2555
2555
|
if (e.eat(63)) {
|
|
2556
2556
|
this.regexp_eatGroupName(e) || e.raise("Invalid group");
|
|
2557
2557
|
var t = this.options.ecmaVersion >= 16, n = e.groupNames[e.lastStringValue];
|
|
@@ -2559,35 +2559,35 @@ W.regexp_eatPatternCharacters = function(e) {
|
|
|
2559
2559
|
else e.raise("Duplicate capture group name");
|
|
2560
2560
|
t ? (n || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = !0;
|
|
2561
2561
|
}
|
|
2562
|
-
},
|
|
2562
|
+
}, U.regexp_eatGroupName = function(e) {
|
|
2563
2563
|
if (e.lastStringValue = "", e.eat(60)) {
|
|
2564
2564
|
if (this.regexp_eatRegExpIdentifierName(e) && e.eat(62)) return !0;
|
|
2565
2565
|
e.raise("Invalid capture group name");
|
|
2566
2566
|
}
|
|
2567
2567
|
return !1;
|
|
2568
|
-
},
|
|
2568
|
+
}, U.regexp_eatRegExpIdentifierName = function(e) {
|
|
2569
2569
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
2570
2570
|
for (e.lastStringValue += A(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += A(e.lastIntValue);
|
|
2571
2571
|
return !0;
|
|
2572
2572
|
}
|
|
2573
2573
|
return !1;
|
|
2574
|
-
},
|
|
2574
|
+
}, U.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), Mt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2577
2577
|
};
|
|
2578
|
-
function
|
|
2578
|
+
function Mt(e) {
|
|
2579
2579
|
return y(e, !0) || e === 36 || e === 95;
|
|
2580
2580
|
}
|
|
2581
|
-
|
|
2581
|
+
U.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), Nt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2584
2584
|
};
|
|
2585
|
-
function
|
|
2585
|
+
function Nt(e) {
|
|
2586
2586
|
return b(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2587
2587
|
}
|
|
2588
|
-
|
|
2588
|
+
U.regexp_eatAtomEscape = function(e) {
|
|
2589
2589
|
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
2590
|
-
},
|
|
2590
|
+
}, U.regexp_eatBackReference = function(e) {
|
|
2591
2591
|
var t = e.pos;
|
|
2592
2592
|
if (this.regexp_eatDecimalEscape(e)) {
|
|
2593
2593
|
var n = e.lastIntValue;
|
|
@@ -2596,34 +2596,34 @@ W.regexp_eatAtomEscape = function(e) {
|
|
|
2596
2596
|
e.pos = t;
|
|
2597
2597
|
}
|
|
2598
2598
|
return !1;
|
|
2599
|
-
},
|
|
2599
|
+
}, U.regexp_eatKGroupName = function(e) {
|
|
2600
2600
|
if (e.eat(107)) {
|
|
2601
2601
|
if (this.regexp_eatGroupName(e)) return e.backReferenceNames.push(e.lastStringValue), !0;
|
|
2602
2602
|
e.raise("Invalid named reference");
|
|
2603
2603
|
}
|
|
2604
2604
|
return !1;
|
|
2605
|
-
},
|
|
2605
|
+
}, U.regexp_eatCharacterEscape = function(e) {
|
|
2606
2606
|
return this.regexp_eatControlEscape(e) || this.regexp_eatCControlLetter(e) || this.regexp_eatZero(e) || this.regexp_eatHexEscapeSequence(e) || this.regexp_eatRegExpUnicodeEscapeSequence(e, !1) || !e.switchU && this.regexp_eatLegacyOctalEscapeSequence(e) || this.regexp_eatIdentityEscape(e);
|
|
2607
|
-
},
|
|
2607
|
+
}, U.regexp_eatCControlLetter = function(e) {
|
|
2608
2608
|
var t = e.pos;
|
|
2609
2609
|
if (e.eat(99)) {
|
|
2610
2610
|
if (this.regexp_eatControlLetter(e)) return !0;
|
|
2611
2611
|
e.pos = t;
|
|
2612
2612
|
}
|
|
2613
2613
|
return !1;
|
|
2614
|
-
},
|
|
2615
|
-
return e.current() === 48 && !
|
|
2616
|
-
},
|
|
2614
|
+
}, U.regexp_eatZero = function(e) {
|
|
2615
|
+
return e.current() === 48 && !Ut(e.lookahead()) ? (e.lastIntValue = 0, e.advance(), !0) : !1;
|
|
2616
|
+
}, U.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
|
+
}, U.regexp_eatControlLetter = function(e) {
|
|
2620
2620
|
var t = e.current();
|
|
2621
|
-
return
|
|
2621
|
+
return Pt(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2622
2622
|
};
|
|
2623
|
-
function
|
|
2623
|
+
function Pt(e) {
|
|
2624
2624
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2625
2625
|
}
|
|
2626
|
-
|
|
2626
|
+
U.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
2627
2627
|
t === void 0 && (t = !1);
|
|
2628
2628
|
var n = e.pos, r = t || e.switchU;
|
|
2629
2629
|
if (e.eat(117)) {
|
|
@@ -2639,19 +2639,19 @@ 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) && Ft(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 Ft(e) {
|
|
2648
2648
|
return e >= 0 && e <= 1114111;
|
|
2649
2649
|
}
|
|
2650
|
-
|
|
2650
|
+
U.regexp_eatIdentityEscape = function(e) {
|
|
2651
2651
|
if (e.switchU) return this.regexp_eatSyntaxCharacter(e) ? !0 : e.eat(47) ? (e.lastIntValue = 47, !0) : !1;
|
|
2652
2652
|
var t = e.current();
|
|
2653
2653
|
return t !== 99 && (!e.switchN || t !== 107) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2654
|
-
},
|
|
2654
|
+
}, U.regexp_eatDecimalEscape = function(e) {
|
|
2655
2655
|
e.lastIntValue = 0;
|
|
2656
2656
|
var t = e.current();
|
|
2657
2657
|
if (t >= 49 && t <= 57) {
|
|
@@ -2662,69 +2662,69 @@ W.regexp_eatIdentityEscape = function(e) {
|
|
|
2662
2662
|
}
|
|
2663
2663
|
return !1;
|
|
2664
2664
|
};
|
|
2665
|
-
var
|
|
2666
|
-
|
|
2665
|
+
var It = 0, G = 1, K = 2;
|
|
2666
|
+
U.regexp_eatCharacterClassEscape = function(e) {
|
|
2667
2667
|
var t = e.current();
|
|
2668
|
-
if (
|
|
2668
|
+
if (Lt(t)) return e.lastIntValue = -1, e.advance(), G;
|
|
2669
2669
|
var n = !1;
|
|
2670
2670
|
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
2671
2671
|
e.lastIntValue = -1, e.advance();
|
|
2672
2672
|
var r;
|
|
2673
|
-
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r ===
|
|
2673
|
+
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === K && e.raise("Invalid property name"), r;
|
|
2674
2674
|
e.raise("Invalid property name");
|
|
2675
2675
|
}
|
|
2676
|
-
return
|
|
2676
|
+
return It;
|
|
2677
2677
|
};
|
|
2678
|
-
function
|
|
2678
|
+
function Lt(e) {
|
|
2679
2679
|
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
2680
2680
|
}
|
|
2681
|
-
|
|
2681
|
+
U.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
2682
2682
|
var t = e.pos;
|
|
2683
2683
|
if (this.regexp_eatUnicodePropertyName(e) && e.eat(61)) {
|
|
2684
2684
|
var n = e.lastStringValue;
|
|
2685
2685
|
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
2686
2686
|
var r = e.lastStringValue;
|
|
2687
|
-
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r),
|
|
2687
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), G;
|
|
2688
2688
|
}
|
|
2689
2689
|
}
|
|
2690
2690
|
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
2691
2691
|
var i = e.lastStringValue;
|
|
2692
2692
|
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
2693
2693
|
}
|
|
2694
|
-
return
|
|
2695
|
-
},
|
|
2696
|
-
|
|
2697
|
-
},
|
|
2698
|
-
if (e.unicodeProperties.binary.test(t)) return
|
|
2699
|
-
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return
|
|
2694
|
+
return It;
|
|
2695
|
+
}, U.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
2696
|
+
ge(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
2697
|
+
}, U.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2698
|
+
if (e.unicodeProperties.binary.test(t)) return G;
|
|
2699
|
+
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return K;
|
|
2700
2700
|
e.raise("Invalid property name");
|
|
2701
|
-
},
|
|
2701
|
+
}, U.regexp_eatUnicodePropertyName = function(e) {
|
|
2702
2702
|
var t = 0;
|
|
2703
|
-
for (e.lastStringValue = "";
|
|
2703
|
+
for (e.lastStringValue = ""; Rt(t = e.current());) e.lastStringValue += A(t), e.advance();
|
|
2704
2704
|
return e.lastStringValue !== "";
|
|
2705
2705
|
};
|
|
2706
|
-
function
|
|
2707
|
-
return
|
|
2706
|
+
function Rt(e) {
|
|
2707
|
+
return Pt(e) || e === 95;
|
|
2708
2708
|
}
|
|
2709
|
-
|
|
2709
|
+
U.regexp_eatUnicodePropertyValue = function(e) {
|
|
2710
2710
|
var t = 0;
|
|
2711
|
-
for (e.lastStringValue = "";
|
|
2711
|
+
for (e.lastStringValue = ""; zt(t = e.current());) e.lastStringValue += A(t), e.advance();
|
|
2712
2712
|
return e.lastStringValue !== "";
|
|
2713
2713
|
};
|
|
2714
|
-
function
|
|
2715
|
-
return
|
|
2714
|
+
function zt(e) {
|
|
2715
|
+
return Rt(e) || Ut(e);
|
|
2716
2716
|
}
|
|
2717
|
-
|
|
2717
|
+
U.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
2718
2718
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
2719
|
-
},
|
|
2719
|
+
}, U.regexp_eatCharacterClass = function(e) {
|
|
2720
2720
|
if (e.eat(91)) {
|
|
2721
2721
|
var t = e.eat(94), n = this.regexp_classContents(e);
|
|
2722
|
-
return e.eat(93) || e.raise("Unterminated character class"), t && n ===
|
|
2722
|
+
return e.eat(93) || e.raise("Unterminated character class"), t && n === K && e.raise("Negated character class may contain strings"), !0;
|
|
2723
2723
|
}
|
|
2724
2724
|
return !1;
|
|
2725
|
-
},
|
|
2726
|
-
return e.current() === 93 ?
|
|
2727
|
-
},
|
|
2725
|
+
}, U.regexp_classContents = function(e) {
|
|
2726
|
+
return e.current() === 93 ? G : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), G);
|
|
2727
|
+
}, U.regexp_nonEmptyClassRanges = function(e) {
|
|
2728
2728
|
for (; this.regexp_eatClassAtom(e);) {
|
|
2729
2729
|
var t = e.lastIntValue;
|
|
2730
2730
|
if (e.eat(45) && this.regexp_eatClassAtom(e)) {
|
|
@@ -2732,19 +2732,19 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2732
2732
|
e.switchU && (t === -1 || n === -1) && e.raise("Invalid character class"), t !== -1 && n !== -1 && t > n && e.raise("Range out of order in character class");
|
|
2733
2733
|
}
|
|
2734
2734
|
}
|
|
2735
|
-
},
|
|
2735
|
+
}, U.regexp_eatClassAtom = function(e) {
|
|
2736
2736
|
var t = e.pos;
|
|
2737
2737
|
if (e.eat(92)) {
|
|
2738
2738
|
if (this.regexp_eatClassEscape(e)) return !0;
|
|
2739
2739
|
if (e.switchU) {
|
|
2740
2740
|
var n = e.current();
|
|
2741
|
-
(n === 99 ||
|
|
2741
|
+
(n === 99 || Kt(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
2742
2742
|
}
|
|
2743
2743
|
e.pos = t;
|
|
2744
2744
|
}
|
|
2745
2745
|
var r = e.current();
|
|
2746
2746
|
return r === 93 ? !1 : (e.lastIntValue = r, e.advance(), !0);
|
|
2747
|
-
},
|
|
2747
|
+
}, U.regexp_eatClassEscape = function(e) {
|
|
2748
2748
|
var t = e.pos;
|
|
2749
2749
|
if (e.eat(98)) return e.lastIntValue = 8, !0;
|
|
2750
2750
|
if (e.switchU && e.eat(45)) return e.lastIntValue = 45, !0;
|
|
@@ -2753,13 +2753,13 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2753
2753
|
e.pos = t;
|
|
2754
2754
|
}
|
|
2755
2755
|
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
2756
|
-
},
|
|
2757
|
-
var t =
|
|
2756
|
+
}, U.regexp_classSetExpression = function(e) {
|
|
2757
|
+
var t = G, n;
|
|
2758
2758
|
if (!this.regexp_eatClassSetRange(e)) if (n = this.regexp_eatClassSetOperand(e)) {
|
|
2759
|
-
n ===
|
|
2759
|
+
n === K && (t = K);
|
|
2760
2760
|
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
2761
2761
|
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
2762
|
-
n !==
|
|
2762
|
+
n !== K && (t = G);
|
|
2763
2763
|
continue;
|
|
2764
2764
|
}
|
|
2765
2765
|
e.raise("Invalid character in character class");
|
|
@@ -2770,9 +2770,9 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2770
2770
|
} else e.raise("Invalid character in character class");
|
|
2771
2771
|
for (;;) if (!this.regexp_eatClassSetRange(e)) {
|
|
2772
2772
|
if (n = this.regexp_eatClassSetOperand(e), !n) return t;
|
|
2773
|
-
n ===
|
|
2773
|
+
n === K && (t = K);
|
|
2774
2774
|
}
|
|
2775
|
-
},
|
|
2775
|
+
}, U.regexp_eatClassSetRange = function(e) {
|
|
2776
2776
|
var t = e.pos;
|
|
2777
2777
|
if (this.regexp_eatClassSetCharacter(e)) {
|
|
2778
2778
|
var n = e.lastIntValue;
|
|
@@ -2783,13 +2783,13 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2783
2783
|
e.pos = t;
|
|
2784
2784
|
}
|
|
2785
2785
|
return !1;
|
|
2786
|
-
},
|
|
2787
|
-
return this.regexp_eatClassSetCharacter(e) ?
|
|
2788
|
-
},
|
|
2786
|
+
}, U.regexp_eatClassSetOperand = function(e) {
|
|
2787
|
+
return this.regexp_eatClassSetCharacter(e) ? G : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
2788
|
+
}, U.regexp_eatNestedClass = function(e) {
|
|
2789
2789
|
var t = e.pos;
|
|
2790
2790
|
if (e.eat(91)) {
|
|
2791
2791
|
var n = e.eat(94), r = this.regexp_classContents(e);
|
|
2792
|
-
if (e.eat(93)) return n && r ===
|
|
2792
|
+
if (e.eat(93)) return n && r === K && e.raise("Negated character class may contain strings"), r;
|
|
2793
2793
|
e.pos = t;
|
|
2794
2794
|
}
|
|
2795
2795
|
if (e.eat(92)) {
|
|
@@ -2798,7 +2798,7 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2798
2798
|
e.pos = t;
|
|
2799
2799
|
}
|
|
2800
2800
|
return null;
|
|
2801
|
-
},
|
|
2801
|
+
}, U.regexp_eatClassStringDisjunction = function(e) {
|
|
2802
2802
|
var t = e.pos;
|
|
2803
2803
|
if (e.eatChars([92, 113])) {
|
|
2804
2804
|
if (e.eat(123)) {
|
|
@@ -2808,61 +2808,61 @@ W.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2808
2808
|
e.pos = t;
|
|
2809
2809
|
}
|
|
2810
2810
|
return null;
|
|
2811
|
-
},
|
|
2812
|
-
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) ===
|
|
2811
|
+
}, U.regexp_classStringDisjunctionContents = function(e) {
|
|
2812
|
+
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) === K && (t = K);
|
|
2813
2813
|
return t;
|
|
2814
|
-
},
|
|
2814
|
+
}, U.regexp_classString = function(e) {
|
|
2815
2815
|
for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
|
|
2816
|
-
return t === 1 ?
|
|
2817
|
-
},
|
|
2816
|
+
return t === 1 ? G : K;
|
|
2817
|
+
}, U.regexp_eatClassSetCharacter = function(e) {
|
|
2818
2818
|
var t = e.pos;
|
|
2819
2819
|
if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
2820
2820
|
var n = e.current();
|
|
2821
|
-
return n < 0 || n === e.lookahead() &&
|
|
2821
|
+
return n < 0 || n === e.lookahead() && Bt(n) || Vt(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
|
|
2822
2822
|
};
|
|
2823
|
-
function
|
|
2823
|
+
function Bt(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 Vt(e) {
|
|
2827
2827
|
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
2828
2828
|
}
|
|
2829
|
-
|
|
2829
|
+
U.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
2830
2830
|
var t = e.current();
|
|
2831
|
-
return
|
|
2831
|
+
return Ht(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2832
2832
|
};
|
|
2833
|
-
function
|
|
2833
|
+
function Ht(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
|
+
U.regexp_eatClassControlLetter = function(e) {
|
|
2837
2837
|
var t = e.current();
|
|
2838
|
-
return
|
|
2839
|
-
},
|
|
2838
|
+
return Ut(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2839
|
+
}, U.regexp_eatHexEscapeSequence = function(e) {
|
|
2840
2840
|
var t = e.pos;
|
|
2841
2841
|
if (e.eat(120)) {
|
|
2842
2842
|
if (this.regexp_eatFixedHexDigits(e, 2)) return !0;
|
|
2843
2843
|
e.switchU && e.raise("Invalid escape"), e.pos = t;
|
|
2844
2844
|
}
|
|
2845
2845
|
return !1;
|
|
2846
|
-
},
|
|
2846
|
+
}, U.regexp_eatDecimalDigits = function(e) {
|
|
2847
2847
|
var t = e.pos, n = 0;
|
|
2848
|
-
for (e.lastIntValue = 0;
|
|
2848
|
+
for (e.lastIntValue = 0; Ut(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
2849
2849
|
return e.pos !== t;
|
|
2850
2850
|
};
|
|
2851
|
-
function
|
|
2851
|
+
function Ut(e) {
|
|
2852
2852
|
return e >= 48 && e <= 57;
|
|
2853
2853
|
}
|
|
2854
|
-
|
|
2854
|
+
U.regexp_eatHexDigits = function(e) {
|
|
2855
2855
|
var t = e.pos, n = 0;
|
|
2856
|
-
for (e.lastIntValue = 0;
|
|
2856
|
+
for (e.lastIntValue = 0; Wt(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + Gt(n), e.advance();
|
|
2857
2857
|
return e.pos !== t;
|
|
2858
2858
|
};
|
|
2859
|
-
function
|
|
2859
|
+
function Wt(e) {
|
|
2860
2860
|
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
2861
2861
|
}
|
|
2862
|
-
function
|
|
2862
|
+
function Gt(e) {
|
|
2863
2863
|
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
2864
2864
|
}
|
|
2865
|
-
|
|
2865
|
+
U.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
2866
2866
|
if (this.regexp_eatOctalDigit(e)) {
|
|
2867
2867
|
var t = e.lastIntValue;
|
|
2868
2868
|
if (this.regexp_eatOctalDigit(e)) {
|
|
@@ -2872,31 +2872,31 @@ W.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
2872
2872
|
return !0;
|
|
2873
2873
|
}
|
|
2874
2874
|
return !1;
|
|
2875
|
-
},
|
|
2875
|
+
}, U.regexp_eatOctalDigit = function(e) {
|
|
2876
2876
|
var t = e.current();
|
|
2877
|
-
return
|
|
2877
|
+
return Kt(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
2878
2878
|
};
|
|
2879
|
-
function
|
|
2879
|
+
function Kt(e) {
|
|
2880
2880
|
return e >= 48 && e <= 55;
|
|
2881
2881
|
}
|
|
2882
|
-
|
|
2882
|
+
U.regexp_eatFixedHexDigits = function(e, t) {
|
|
2883
2883
|
var n = e.pos;
|
|
2884
2884
|
e.lastIntValue = 0;
|
|
2885
2885
|
for (var r = 0; r < t; ++r) {
|
|
2886
2886
|
var i = e.current();
|
|
2887
|
-
if (!
|
|
2888
|
-
e.lastIntValue = 16 * e.lastIntValue +
|
|
2887
|
+
if (!Wt(i)) return e.pos = n, !1;
|
|
2888
|
+
e.lastIntValue = 16 * e.lastIntValue + Gt(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
|
|
2894
|
-
},
|
|
2895
|
-
|
|
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
|
|
2897
|
-
},
|
|
2898
|
-
return this.next(), new
|
|
2899
|
-
}, typeof Symbol < "u" && (
|
|
2892
|
+
var qt = 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
|
+
}, q = P.prototype;
|
|
2895
|
+
q.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 qt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
2897
|
+
}, q.getToken = function() {
|
|
2898
|
+
return this.next(), new qt(this);
|
|
2899
|
+
}, typeof Symbol < "u" && (q[Symbol.iterator] = function() {
|
|
2900
2900
|
var e = this;
|
|
2901
2901
|
return { next: function() {
|
|
2902
2902
|
var t = e.getToken();
|
|
@@ -2905,28 +2905,28 @@ J.next = function(e) {
|
|
|
2905
2905
|
value: t
|
|
2906
2906
|
};
|
|
2907
2907
|
} };
|
|
2908
|
-
}),
|
|
2908
|
+
}), q.nextToken = function() {
|
|
2909
2909
|
var e = this.curContext();
|
|
2910
2910
|
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(E.eof);
|
|
2911
2911
|
if (e.override) return e.override(this);
|
|
2912
2912
|
this.readToken(this.fullCharCodeAtPos());
|
|
2913
|
-
},
|
|
2913
|
+
}, q.readToken = function(e) {
|
|
2914
2914
|
return y(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
2915
|
-
},
|
|
2915
|
+
}, q.fullCharCodeAt = function(e) {
|
|
2916
2916
|
var t = this.input.charCodeAt(e);
|
|
2917
2917
|
if (t <= 55295 || t >= 56320) return t;
|
|
2918
2918
|
var n = this.input.charCodeAt(e + 1);
|
|
2919
2919
|
return n <= 56319 || n >= 57344 ? t : (t << 10) + n - 56613888;
|
|
2920
|
-
},
|
|
2920
|
+
}, q.fullCharCodeAtPos = function() {
|
|
2921
2921
|
return this.fullCharCodeAt(this.pos);
|
|
2922
|
-
},
|
|
2922
|
+
}, q.skipBlockComment = function() {
|
|
2923
2923
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
2924
|
-
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r =
|
|
2924
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = de(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
2925
2925
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
2926
|
-
},
|
|
2927
|
-
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !
|
|
2926
|
+
}, q.skipLineComment = function(e) {
|
|
2927
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !ue(r);) r = this.input.charCodeAt(++this.pos);
|
|
2928
2928
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
2929
|
-
},
|
|
2929
|
+
}, q.skipSpace = function() {
|
|
2930
2930
|
loop: for (; this.pos < this.input.length;) {
|
|
2931
2931
|
var e = this.input.charCodeAt(this.pos);
|
|
2932
2932
|
switch (e) {
|
|
@@ -2951,40 +2951,40 @@ 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
|
}
|
|
2958
|
-
},
|
|
2958
|
+
}, q.finishToken = function(e, t) {
|
|
2959
2959
|
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
2960
2960
|
var n = this.type;
|
|
2961
2961
|
this.type = e, this.value = t, this.updateContext(n);
|
|
2962
|
-
},
|
|
2962
|
+
}, q.readToken_dot = function() {
|
|
2963
2963
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2964
2964
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
2965
2965
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
2966
2966
|
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(E.ellipsis)) : (++this.pos, this.finishToken(E.dot));
|
|
2967
|
-
},
|
|
2967
|
+
}, q.readToken_slash = function() {
|
|
2968
2968
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
2969
2969
|
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.slash, 1);
|
|
2970
|
-
},
|
|
2970
|
+
}, q.readToken_mult_modulo_exp = function(e) {
|
|
2971
2971
|
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? E.star : E.modulo;
|
|
2972
2972
|
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = E.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(E.assign, n + 1) : this.finishOp(r, n);
|
|
2973
|
-
},
|
|
2973
|
+
}, q.readToken_pipe_amp = function(e) {
|
|
2974
2974
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2975
2975
|
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(E.assign, 3) : this.finishOp(e === 124 ? E.logicalOR : E.logicalAND, 2) : t === 61 ? this.finishOp(E.assign, 2) : this.finishOp(e === 124 ? E.bitwiseOR : E.bitwiseAND, 1);
|
|
2976
|
-
},
|
|
2976
|
+
}, q.readToken_caret = function() {
|
|
2977
2977
|
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.bitwiseXOR, 1);
|
|
2978
|
-
},
|
|
2978
|
+
}, q.readToken_plus_min = function(e) {
|
|
2979
2979
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2980
2980
|
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || D.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(E.incDec, 2) : t === 61 ? this.finishOp(E.assign, 2) : this.finishOp(E.plusMin, 1);
|
|
2981
|
-
},
|
|
2981
|
+
}, q.readToken_lt_gt = function(e) {
|
|
2982
2982
|
var t = this.input.charCodeAt(this.pos + 1), n = 1;
|
|
2983
2983
|
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(E.assign, n + 1) : this.finishOp(E.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(E.relational, n));
|
|
2984
|
-
},
|
|
2984
|
+
}, q.readToken_eq_excl = function(e) {
|
|
2985
2985
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
2986
2986
|
return t === 61 ? this.finishOp(E.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(E.arrow)) : this.finishOp(e === 61 ? E.eq : E.prefix, 1);
|
|
2987
|
-
},
|
|
2987
|
+
}, q.readToken_question = function() {
|
|
2988
2988
|
var e = this.options.ecmaVersion;
|
|
2989
2989
|
if (e >= 11) {
|
|
2990
2990
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
@@ -2995,11 +2995,11 @@ J.next = function(e) {
|
|
|
2995
2995
|
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(E.assign, 3) : this.finishOp(E.coalesce, 2);
|
|
2996
2996
|
}
|
|
2997
2997
|
return this.finishOp(E.question, 1);
|
|
2998
|
-
},
|
|
2998
|
+
}, q.readToken_numberSign = function() {
|
|
2999
2999
|
var e = this.options.ecmaVersion, t = 35;
|
|
3000
3000
|
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), y(t, !0) || t === 92)) return this.finishToken(E.privateId, this.readWord1());
|
|
3001
3001
|
this.raise(this.pos, "Unexpected character '" + A(t) + "'");
|
|
3002
|
-
},
|
|
3002
|
+
}, q.getTokenFromCode = function(e) {
|
|
3003
3003
|
switch (e) {
|
|
3004
3004
|
case 46: return this.readToken_dot();
|
|
3005
3005
|
case 40: return ++this.pos, this.finishToken(E.parenL);
|
|
@@ -3049,10 +3049,10 @@ J.next = function(e) {
|
|
|
3049
3049
|
case 35: return this.readToken_numberSign();
|
|
3050
3050
|
}
|
|
3051
3051
|
this.raise(this.pos, "Unexpected character '" + A(e) + "'");
|
|
3052
|
-
},
|
|
3052
|
+
}, q.finishOp = function(e, t) {
|
|
3053
3053
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
3054
3054
|
return this.pos += t, this.finishToken(e, n);
|
|
3055
|
-
},
|
|
3055
|
+
}, q.readRegexp = function() {
|
|
3056
3056
|
for (var e, t, n = this.pos;;) {
|
|
3057
3057
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
3058
3058
|
var r = this.input.charAt(this.pos);
|
|
@@ -3069,7 +3069,7 @@ J.next = function(e) {
|
|
|
3069
3069
|
++this.pos;
|
|
3070
3070
|
var a = this.pos, o = this.readWord1();
|
|
3071
3071
|
this.containsEsc && this.unexpected(a);
|
|
3072
|
-
var s = this.regexpState ||= new
|
|
3072
|
+
var s = this.regexpState ||= new W(this);
|
|
3073
3073
|
s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
|
|
3074
3074
|
var c = null;
|
|
3075
3075
|
try {
|
|
@@ -3080,7 +3080,7 @@ J.next = function(e) {
|
|
|
3080
3080
|
flags: o,
|
|
3081
3081
|
value: c
|
|
3082
3082
|
});
|
|
3083
|
-
},
|
|
3083
|
+
}, q.readInt = function(e, t, n) {
|
|
3084
3084
|
for (var r = this.options.ecmaVersion >= 12 && t === void 0, i = n && this.input.charCodeAt(this.pos) === 48, a = this.pos, o = 0, s = 0, c = 0, l = t ?? Infinity; c < l; ++c, ++this.pos) {
|
|
3085
3085
|
var u = this.input.charCodeAt(this.pos), d = void 0;
|
|
3086
3086
|
if (r && u === 95) {
|
|
@@ -3092,31 +3092,31 @@ 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 Jt(e, t) {
|
|
3096
3096
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
3097
3097
|
}
|
|
3098
|
-
function
|
|
3098
|
+
function Yt(e) {
|
|
3099
3099
|
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
3100
3100
|
}
|
|
3101
|
-
|
|
3101
|
+
q.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 =
|
|
3106
|
-
},
|
|
3105
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Yt(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
|
+
}, q.readNumber = function(e) {
|
|
3107
3107
|
var t = this.pos;
|
|
3108
3108
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
3109
3109
|
var n = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
|
|
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 = Yt(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 = Jt(this.input.slice(t, this.pos), n);
|
|
3118
3118
|
return this.finishToken(E.num, a);
|
|
3119
|
-
},
|
|
3119
|
+
}, q.readCodePoint = function() {
|
|
3120
3120
|
var e = this.input.charCodeAt(this.pos), t;
|
|
3121
3121
|
if (e === 123) {
|
|
3122
3122
|
this.options.ecmaVersion < 6 && this.unexpected();
|
|
@@ -3124,35 +3124,35 @@ J.readRadixNumber = function(e) {
|
|
|
3124
3124
|
t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(n, "Code point out of bounds");
|
|
3125
3125
|
} else t = this.readHexChar(4);
|
|
3126
3126
|
return t;
|
|
3127
|
-
},
|
|
3127
|
+
}, q.readString = function(e) {
|
|
3128
3128
|
for (var t = "", n = ++this.pos;;) {
|
|
3129
3129
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3130
3130
|
var r = this.input.charCodeAt(this.pos);
|
|
3131
3131
|
if (r === e) break;
|
|
3132
|
-
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (
|
|
3132
|
+
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (ue(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
3133
3133
|
}
|
|
3134
3134
|
return t += this.input.slice(n, this.pos++), this.finishToken(E.string, t);
|
|
3135
3135
|
};
|
|
3136
|
-
var
|
|
3137
|
-
|
|
3136
|
+
var Xt = {};
|
|
3137
|
+
q.tryReadTemplateToken = function() {
|
|
3138
3138
|
this.inTemplateElement = !0;
|
|
3139
3139
|
try {
|
|
3140
3140
|
this.readTmplToken();
|
|
3141
3141
|
} catch (e) {
|
|
3142
|
-
if (e ===
|
|
3142
|
+
if (e === Xt) this.readInvalidTemplateToken();
|
|
3143
3143
|
else throw e;
|
|
3144
3144
|
}
|
|
3145
3145
|
this.inTemplateElement = !1;
|
|
3146
|
-
},
|
|
3147
|
-
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw
|
|
3146
|
+
}, q.invalidStringToken = function(e, t) {
|
|
3147
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw Xt;
|
|
3148
3148
|
this.raise(e, t);
|
|
3149
|
-
},
|
|
3149
|
+
}, q.readTmplToken = function() {
|
|
3150
3150
|
for (var e = "", t = this.pos;;) {
|
|
3151
3151
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
3152
3152
|
var n = this.input.charCodeAt(this.pos);
|
|
3153
3153
|
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === E.template || this.type === E.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(E.dollarBraceL)) : (++this.pos, this.finishToken(E.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(E.template, e));
|
|
3154
3154
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
3155
|
-
else if (
|
|
3155
|
+
else if (ue(n)) {
|
|
3156
3156
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
3157
3157
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3158
3158
|
case 10:
|
|
@@ -3165,7 +3165,7 @@ J.tryReadTemplateToken = function() {
|
|
|
3165
3165
|
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
3166
3166
|
} else ++this.pos;
|
|
3167
3167
|
}
|
|
3168
|
-
},
|
|
3168
|
+
}, q.readInvalidTemplateToken = function() {
|
|
3169
3169
|
for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
|
|
3170
3170
|
case "\\":
|
|
3171
3171
|
++this.pos;
|
|
@@ -3180,7 +3180,7 @@ J.tryReadTemplateToken = function() {
|
|
|
3180
3180
|
break;
|
|
3181
3181
|
}
|
|
3182
3182
|
this.raise(this.start, "Unterminated template");
|
|
3183
|
-
},
|
|
3183
|
+
}, q.readEscapedChar = function(e) {
|
|
3184
3184
|
var t = this.input.charCodeAt(++this.pos);
|
|
3185
3185
|
switch (++this.pos, t) {
|
|
3186
3186
|
case 110: return "\n";
|
|
@@ -3203,12 +3203,12 @@ 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
|
+
}, q.readHexChar = function(e) {
|
|
3209
3209
|
var t = this.pos, n = this.readInt(16, e);
|
|
3210
3210
|
return n === null && this.invalidStringToken(t, "Bad character escape sequence"), n;
|
|
3211
|
-
},
|
|
3211
|
+
}, q.readWord1 = function() {
|
|
3212
3212
|
this.containsEsc = !1;
|
|
3213
3213
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3214
3214
|
var i = this.fullCharCodeAtPos();
|
|
@@ -3223,124 +3223,124 @@ J.tryReadTemplateToken = function() {
|
|
|
3223
3223
|
t = !1;
|
|
3224
3224
|
}
|
|
3225
3225
|
return e + this.input.slice(n, this.pos);
|
|
3226
|
-
},
|
|
3226
|
+
}, q.readWord = function() {
|
|
3227
3227
|
var e = this.readWord1(), t = E.name;
|
|
3228
|
-
return this.keywords.test(e) && (t =
|
|
3229
|
-
},
|
|
3230
|
-
Parser:
|
|
3228
|
+
return this.keywords.test(e) && (t = ce[e]), this.finishToken(t, e);
|
|
3229
|
+
}, P.acorn = {
|
|
3230
|
+
Parser: P,
|
|
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: at,
|
|
3237
3237
|
TokenType: x,
|
|
3238
3238
|
tokTypes: E,
|
|
3239
|
-
keywordTypes:
|
|
3240
|
-
TokContext:
|
|
3241
|
-
tokContexts:
|
|
3239
|
+
keywordTypes: ce,
|
|
3240
|
+
TokContext: z,
|
|
3241
|
+
tokContexts: B,
|
|
3242
3242
|
isIdentifierChar: b,
|
|
3243
3243
|
isIdentifierStart: y,
|
|
3244
|
-
Token:
|
|
3245
|
-
isNewLine:
|
|
3244
|
+
Token: qt,
|
|
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 Zt(e, t, n) {
|
|
3253
3253
|
n(e, t);
|
|
3254
3254
|
}
|
|
3255
|
-
function
|
|
3256
|
-
var
|
|
3257
|
-
|
|
3255
|
+
function J(e, t, n) {}
|
|
3256
|
+
var Y = {};
|
|
3257
|
+
Y.Program = Y.BlockStatement = Y.StaticBlock = function(e, t, n) {
|
|
3258
3258
|
for (var r = 0, i = e.body; r < i.length; r += 1) {
|
|
3259
3259
|
var a = i[r];
|
|
3260
3260
|
n(a, t, "Statement");
|
|
3261
3261
|
}
|
|
3262
|
-
},
|
|
3262
|
+
}, Y.Statement = Zt, Y.EmptyStatement = J, Y.ExpressionStatement = Y.ParenthesizedExpression = Y.ChainExpression = function(e, t, n) {
|
|
3263
3263
|
return n(e.expression, t, "Expression");
|
|
3264
|
-
},
|
|
3264
|
+
}, Y.IfStatement = function(e, t, n) {
|
|
3265
3265
|
n(e.test, t, "Expression"), n(e.consequent, t, "Statement"), e.alternate && n(e.alternate, t, "Statement");
|
|
3266
|
-
},
|
|
3266
|
+
}, Y.LabeledStatement = function(e, t, n) {
|
|
3267
3267
|
return n(e.body, t, "Statement");
|
|
3268
|
-
},
|
|
3268
|
+
}, Y.BreakStatement = Y.ContinueStatement = J, Y.WithStatement = function(e, t, n) {
|
|
3269
3269
|
n(e.object, t, "Expression"), n(e.body, t, "Statement");
|
|
3270
|
-
},
|
|
3270
|
+
}, Y.SwitchStatement = function(e, t, n) {
|
|
3271
3271
|
n(e.discriminant, t, "Expression");
|
|
3272
3272
|
for (var r = 0, i = e.cases; r < i.length; r += 1) {
|
|
3273
3273
|
var a = i[r];
|
|
3274
3274
|
n(a, t);
|
|
3275
3275
|
}
|
|
3276
|
-
},
|
|
3276
|
+
}, Y.SwitchCase = function(e, t, n) {
|
|
3277
3277
|
e.test && n(e.test, t, "Expression");
|
|
3278
3278
|
for (var r = 0, i = e.consequent; r < i.length; r += 1) {
|
|
3279
3279
|
var a = i[r];
|
|
3280
3280
|
n(a, t, "Statement");
|
|
3281
3281
|
}
|
|
3282
|
-
},
|
|
3282
|
+
}, Y.ReturnStatement = Y.YieldExpression = Y.AwaitExpression = function(e, t, n) {
|
|
3283
3283
|
e.argument && n(e.argument, t, "Expression");
|
|
3284
|
-
},
|
|
3284
|
+
}, Y.ThrowStatement = Y.SpreadElement = function(e, t, n) {
|
|
3285
3285
|
return n(e.argument, t, "Expression");
|
|
3286
|
-
},
|
|
3286
|
+
}, Y.TryStatement = function(e, t, n) {
|
|
3287
3287
|
n(e.block, t, "Statement"), e.handler && n(e.handler, t), e.finalizer && n(e.finalizer, t, "Statement");
|
|
3288
|
-
},
|
|
3288
|
+
}, Y.CatchClause = function(e, t, n) {
|
|
3289
3289
|
e.param && n(e.param, t, "Pattern"), n(e.body, t, "Statement");
|
|
3290
|
-
},
|
|
3290
|
+
}, Y.WhileStatement = Y.DoWhileStatement = function(e, t, n) {
|
|
3291
3291
|
n(e.test, t, "Expression"), n(e.body, t, "Statement");
|
|
3292
|
-
},
|
|
3292
|
+
}, Y.ForStatement = function(e, t, n) {
|
|
3293
3293
|
e.init && n(e.init, t, "ForInit"), e.test && n(e.test, t, "Expression"), e.update && n(e.update, t, "Expression"), n(e.body, t, "Statement");
|
|
3294
|
-
},
|
|
3294
|
+
}, Y.ForInStatement = Y.ForOfStatement = function(e, t, n) {
|
|
3295
3295
|
n(e.left, t, "ForInit"), n(e.right, t, "Expression"), n(e.body, t, "Statement");
|
|
3296
|
-
},
|
|
3296
|
+
}, Y.ForInit = function(e, t, n) {
|
|
3297
3297
|
e.type === "VariableDeclaration" ? n(e, t) : n(e, t, "Expression");
|
|
3298
|
-
},
|
|
3298
|
+
}, Y.DebuggerStatement = J, Y.FunctionDeclaration = function(e, t, n) {
|
|
3299
3299
|
return n(e, t, "Function");
|
|
3300
|
-
},
|
|
3300
|
+
}, Y.VariableDeclaration = function(e, t, n) {
|
|
3301
3301
|
for (var r = 0, i = e.declarations; r < i.length; r += 1) {
|
|
3302
3302
|
var a = i[r];
|
|
3303
3303
|
n(a, t);
|
|
3304
3304
|
}
|
|
3305
|
-
},
|
|
3305
|
+
}, Y.VariableDeclarator = function(e, t, n) {
|
|
3306
3306
|
n(e.id, t, "Pattern"), e.init && n(e.init, t, "Expression");
|
|
3307
|
-
},
|
|
3307
|
+
}, Y.Function = function(e, t, n) {
|
|
3308
3308
|
e.id && n(e.id, t, "Pattern");
|
|
3309
3309
|
for (var r = 0, i = e.params; r < i.length; r += 1) {
|
|
3310
3310
|
var a = i[r];
|
|
3311
3311
|
n(a, t, "Pattern");
|
|
3312
3312
|
}
|
|
3313
3313
|
n(e.body, t, e.expression ? "Expression" : "Statement");
|
|
3314
|
-
},
|
|
3314
|
+
}, Y.Pattern = function(e, t, n) {
|
|
3315
3315
|
e.type === "Identifier" ? n(e, t, "VariablePattern") : e.type === "MemberExpression" ? n(e, t, "MemberPattern") : n(e, t);
|
|
3316
|
-
},
|
|
3316
|
+
}, Y.VariablePattern = J, Y.MemberPattern = Zt, Y.RestElement = function(e, t, n) {
|
|
3317
3317
|
return n(e.argument, t, "Pattern");
|
|
3318
|
-
},
|
|
3318
|
+
}, Y.ArrayPattern = function(e, t, n) {
|
|
3319
3319
|
for (var r = 0, i = e.elements; r < i.length; r += 1) {
|
|
3320
3320
|
var a = i[r];
|
|
3321
3321
|
a && n(a, t, "Pattern");
|
|
3322
3322
|
}
|
|
3323
|
-
},
|
|
3323
|
+
}, Y.ObjectPattern = function(e, t, n) {
|
|
3324
3324
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
3325
3325
|
var a = i[r];
|
|
3326
3326
|
a.type === "Property" ? (a.computed && n(a.key, t, "Expression"), n(a.value, t, "Pattern")) : a.type === "RestElement" && n(a.argument, t, "Pattern");
|
|
3327
3327
|
}
|
|
3328
|
-
},
|
|
3328
|
+
}, Y.Expression = Zt, Y.ThisExpression = Y.Super = Y.MetaProperty = J, Y.ArrayExpression = function(e, t, n) {
|
|
3329
3329
|
for (var r = 0, i = e.elements; r < i.length; r += 1) {
|
|
3330
3330
|
var a = i[r];
|
|
3331
3331
|
a && n(a, t, "Expression");
|
|
3332
3332
|
}
|
|
3333
|
-
},
|
|
3333
|
+
}, Y.ObjectExpression = function(e, t, n) {
|
|
3334
3334
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
3335
3335
|
var a = i[r];
|
|
3336
3336
|
n(a, t);
|
|
3337
3337
|
}
|
|
3338
|
-
},
|
|
3338
|
+
}, Y.FunctionExpression = Y.ArrowFunctionExpression = Y.FunctionDeclaration, Y.SequenceExpression = function(e, t, n) {
|
|
3339
3339
|
for (var r = 0, i = e.expressions; r < i.length; r += 1) {
|
|
3340
3340
|
var a = i[r];
|
|
3341
3341
|
n(a, t, "Expression");
|
|
3342
3342
|
}
|
|
3343
|
-
},
|
|
3343
|
+
}, Y.TemplateLiteral = function(e, t, n) {
|
|
3344
3344
|
for (var r = 0, i = e.quasis; r < i.length; r += 1) {
|
|
3345
3345
|
var a = i[r];
|
|
3346
3346
|
n(a, t);
|
|
@@ -3349,34 +3349,34 @@ X.Program = X.BlockStatement = X.StaticBlock = function(e, t, n) {
|
|
|
3349
3349
|
var c = s[o];
|
|
3350
3350
|
n(c, t, "Expression");
|
|
3351
3351
|
}
|
|
3352
|
-
},
|
|
3352
|
+
}, Y.TemplateElement = J, Y.UnaryExpression = Y.UpdateExpression = function(e, t, n) {
|
|
3353
3353
|
n(e.argument, t, "Expression");
|
|
3354
|
-
},
|
|
3354
|
+
}, Y.BinaryExpression = Y.LogicalExpression = function(e, t, n) {
|
|
3355
3355
|
n(e.left, t, "Expression"), n(e.right, t, "Expression");
|
|
3356
|
-
},
|
|
3356
|
+
}, Y.AssignmentExpression = Y.AssignmentPattern = function(e, t, n) {
|
|
3357
3357
|
n(e.left, t, "Pattern"), n(e.right, t, "Expression");
|
|
3358
|
-
},
|
|
3358
|
+
}, Y.ConditionalExpression = function(e, t, n) {
|
|
3359
3359
|
n(e.test, t, "Expression"), n(e.consequent, t, "Expression"), n(e.alternate, t, "Expression");
|
|
3360
|
-
},
|
|
3360
|
+
}, Y.NewExpression = Y.CallExpression = function(e, t, n) {
|
|
3361
3361
|
if (n(e.callee, t, "Expression"), e.arguments) for (var r = 0, i = e.arguments; r < i.length; r += 1) {
|
|
3362
3362
|
var a = i[r];
|
|
3363
3363
|
n(a, t, "Expression");
|
|
3364
3364
|
}
|
|
3365
|
-
},
|
|
3365
|
+
}, Y.MemberExpression = function(e, t, n) {
|
|
3366
3366
|
n(e.object, t, "Expression"), e.computed && n(e.property, t, "Expression");
|
|
3367
|
-
},
|
|
3367
|
+
}, Y.ExportNamedDeclaration = Y.ExportDefaultDeclaration = function(e, t, n) {
|
|
3368
3368
|
if (e.declaration && n(e.declaration, t, e.type === "ExportNamedDeclaration" || e.declaration.id ? "Statement" : "Expression"), e.source && n(e.source, t, "Expression"), e.attributes) for (var r = 0, i = e.attributes; r < i.length; r += 1) {
|
|
3369
3369
|
var a = i[r];
|
|
3370
3370
|
n(a, t);
|
|
3371
3371
|
}
|
|
3372
|
-
},
|
|
3372
|
+
}, Y.ExportAllDeclaration = function(e, t, n) {
|
|
3373
3373
|
if (e.exported && n(e.exported, t), n(e.source, t, "Expression"), e.attributes) for (var r = 0, i = e.attributes; r < i.length; r += 1) {
|
|
3374
3374
|
var a = i[r];
|
|
3375
3375
|
n(a, t);
|
|
3376
3376
|
}
|
|
3377
|
-
},
|
|
3377
|
+
}, Y.ImportAttribute = function(e, t, n) {
|
|
3378
3378
|
n(e.value, t, "Expression");
|
|
3379
|
-
},
|
|
3379
|
+
}, Y.ImportDeclaration = function(e, t, n) {
|
|
3380
3380
|
for (var r = 0, i = e.specifiers; r < i.length; r += 1) {
|
|
3381
3381
|
var a = i[r];
|
|
3382
3382
|
n(a, t);
|
|
@@ -3385,25 +3385,25 @@ X.Program = X.BlockStatement = X.StaticBlock = function(e, t, n) {
|
|
|
3385
3385
|
var c = s[o];
|
|
3386
3386
|
n(c, t);
|
|
3387
3387
|
}
|
|
3388
|
-
},
|
|
3388
|
+
}, Y.ImportExpression = function(e, t, n) {
|
|
3389
3389
|
n(e.source, t, "Expression"), e.options && n(e.options, t, "Expression");
|
|
3390
|
-
},
|
|
3390
|
+
}, Y.ImportSpecifier = Y.ImportDefaultSpecifier = Y.ImportNamespaceSpecifier = Y.Identifier = Y.PrivateIdentifier = Y.Literal = J, Y.TaggedTemplateExpression = function(e, t, n) {
|
|
3391
3391
|
n(e.tag, t, "Expression"), n(e.quasi, t, "Expression");
|
|
3392
|
-
},
|
|
3392
|
+
}, Y.ClassDeclaration = Y.ClassExpression = function(e, t, n) {
|
|
3393
3393
|
return n(e, t, "Class");
|
|
3394
|
-
},
|
|
3394
|
+
}, Y.Class = function(e, t, n) {
|
|
3395
3395
|
e.id && n(e.id, t, "Pattern"), e.superClass && n(e.superClass, t, "Expression"), n(e.body, t);
|
|
3396
|
-
},
|
|
3396
|
+
}, Y.ClassBody = function(e, t, n) {
|
|
3397
3397
|
for (var r = 0, i = e.body; r < i.length; r += 1) {
|
|
3398
3398
|
var a = i[r];
|
|
3399
3399
|
n(a, t);
|
|
3400
3400
|
}
|
|
3401
|
-
},
|
|
3401
|
+
}, Y.MethodDefinition = Y.PropertyDefinition = Y.Property = function(e, t, n) {
|
|
3402
3402
|
e.computed && n(e.key, t, "Expression"), e.value && n(e.value, t, "Expression");
|
|
3403
3403
|
};
|
|
3404
3404
|
//#endregion
|
|
3405
3405
|
//#region ../compiler/dist/index-es.js
|
|
3406
|
-
var
|
|
3406
|
+
var X = {
|
|
3407
3407
|
Data: "Data",
|
|
3408
3408
|
TagOpen: "TagOpen",
|
|
3409
3409
|
EndTagOpen: "EndTagOpen",
|
|
@@ -3417,16 +3417,35 @@ var Z = {
|
|
|
3417
3417
|
Interpolation: "Interpolation",
|
|
3418
3418
|
RawText: "RawText",
|
|
3419
3419
|
EOF: "EOF"
|
|
3420
|
-
},
|
|
3421
|
-
return e[e.RETURN = 0] = "RETURN", e[e.CREATE_ELEMENT = 1] = "CREATE_ELEMENT", e[e.CREATE_TEXT = 2] = "CREATE_TEXT", e[e.CREATE_COMMENT = 3] = "CREATE_COMMENT", e[e.APPEND_CHILD = 4] = "APPEND_CHILD", e[e.SET_ATTR = 5] = "SET_ATTR", e[e.CREATE_FRAGMENT = 6] = "CREATE_FRAGMENT", e[e.INTERPOLATE_TEXT = 7] = "INTERPOLATE_TEXT", e[e.EXEC_SCRIPT = 12] = "EXEC_SCRIPT", e[e.REACTIVE_IF = 13] = "REACTIVE_IF", e[e.REACTIVE_FOR = 14] = "REACTIVE_FOR", e[e.MOUNT_COMPONENT = 15] = "MOUNT_COMPONENT", e[e.REACTIVE_ASYNC = 16] = "REACTIVE_ASYNC", e;
|
|
3420
|
+
}, Z = /* @__PURE__ */ function(e) {
|
|
3421
|
+
return e[e.RETURN = 0] = "RETURN", e[e.CREATE_ELEMENT = 1] = "CREATE_ELEMENT", e[e.CREATE_TEXT = 2] = "CREATE_TEXT", e[e.CREATE_COMMENT = 3] = "CREATE_COMMENT", e[e.APPEND_CHILD = 4] = "APPEND_CHILD", e[e.SET_ATTR = 5] = "SET_ATTR", e[e.CREATE_FRAGMENT = 6] = "CREATE_FRAGMENT", e[e.INTERPOLATE_TEXT = 7] = "INTERPOLATE_TEXT", e[e.EXEC_SCRIPT = 12] = "EXEC_SCRIPT", e[e.REACTIVE_IF = 13] = "REACTIVE_IF", e[e.REACTIVE_FOR = 14] = "REACTIVE_FOR", e[e.MOUNT_COMPONENT = 15] = "MOUNT_COMPONENT", e[e.REACTIVE_ASYNC = 16] = "REACTIVE_ASYNC", e[e.REACTIVE_SWITCH = 17] = "REACTIVE_SWITCH", e;
|
|
3422
3422
|
}({});
|
|
3423
|
-
|
|
3423
|
+
X.Data, X.Comment, X.EndTagOpen, X.TagOpen, X.Interpolation, X.Data, X.EOF, X.TagOpen, X.BeforeAttributeName, X.EndTagOpen, X.BeforeAttributeName, X.BeforeAttributeName, X.AttributeName, X.Data, X.RawText, X.Data, X.AttributeName, X.AfterAttributeName, X.AfterAttributeName, X.BeforeAttributeValue, X.BeforeAttributeName, X.BeforeAttributeValue, X.AttributeValueQuoted, X.AttributeValueInterpolation, X.AttributeValueQuoted, X.BeforeAttributeName, X.AttributeValueInterpolation, X.BeforeAttributeName, X.Comment, X.Data, X.Interpolation, X.Data, X.BeforeAttributeName, X.RawText, X.RawText, X.EndTagOpen, X.EOF, X.EOF, X.EOF;
|
|
3424
3424
|
//#endregion
|
|
3425
3425
|
//#region src/index.ts
|
|
3426
|
-
function
|
|
3426
|
+
function Q(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,89 +3475,102 @@ 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
|
-
case
|
|
3466
|
-
|
|
3484
|
+
case Z.RETURN:
|
|
3485
|
+
d += 1;
|
|
3467
3486
|
break;
|
|
3468
|
-
case
|
|
3469
|
-
let e = c[
|
|
3487
|
+
case Z.CREATE_ELEMENT: {
|
|
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
|
-
case
|
|
3479
|
-
let t = c[
|
|
3497
|
+
case Z.MOUNT_COMPONENT: {
|
|
3498
|
+
let t = c[d + 1], n = c[d + 2], r = c[d + 3], a = String(l[n]), o = m(this.scope && a in this.scope ? this.scope[a] : typeof globalThis < "u" && globalThis[a]);
|
|
3480
3499
|
if (o) {
|
|
3481
|
-
let n = r === 255 ? null : l[r],
|
|
3500
|
+
let n = r === 255 ? null : l[r], s = i(n, this.scope, this.declaredVars), c;
|
|
3482
3501
|
if (n && n.__drift_children__ !== void 0) {
|
|
3483
3502
|
let t = l[n.__drift_children__] ?? n.__drift_children__;
|
|
3484
3503
|
if (t) {
|
|
3485
3504
|
let n = new e();
|
|
3486
|
-
n.parentVM = this,
|
|
3505
|
+
n.parentVM = this, c = n.execute(t, { scope: this.scope }) ?? void 0;
|
|
3487
3506
|
}
|
|
3488
3507
|
}
|
|
3489
|
-
let
|
|
3490
|
-
|
|
3491
|
-
let
|
|
3492
|
-
|
|
3493
|
-
let
|
|
3494
|
-
|
|
3508
|
+
let u = new e();
|
|
3509
|
+
u.parentVM = this;
|
|
3510
|
+
let d = Object.assign(Object.create(this.scope), { props: s }, s);
|
|
3511
|
+
c !== void 0 && (d.children = c);
|
|
3512
|
+
let f = u.execute(o, { scope: d }), p = null, m;
|
|
3513
|
+
if ("client:load" in s ? p = "eager" : "client:idle" in s ? p = "idle" : "client:visible" in s ? p = "visible" : "client:interaction" in s ? p = "interaction" : "client:media" in s && (p = "media", m = typeof s["client:media"] == "string" ? s["client:media"] : void 0), p) {
|
|
3514
|
+
let e = /* @__PURE__ */ new Map();
|
|
3515
|
+
e.set("data-drift-island", a), e.set("data-drift-trigger", p), m && e.set("data-drift-media", m);
|
|
3516
|
+
let n = {};
|
|
3517
|
+
for (let [e, t] of Object.entries(s)) !e.startsWith("client:") && e !== "__drift_children__" && e !== "__drift_props__" && (n[e] = t);
|
|
3518
|
+
Object.keys(n).length > 0 && e.set("data-drift-props", JSON.stringify(n));
|
|
3519
|
+
let r = {
|
|
3520
|
+
type: "element",
|
|
3521
|
+
tag: "div",
|
|
3522
|
+
attrs: e,
|
|
3523
|
+
children: f ? [f] : []
|
|
3524
|
+
};
|
|
3525
|
+
this.setRegister(t, r);
|
|
3526
|
+
} else f && this.setRegister(t, f);
|
|
3495
3527
|
}
|
|
3496
|
-
|
|
3528
|
+
d += 4;
|
|
3497
3529
|
break;
|
|
3498
3530
|
}
|
|
3499
|
-
case
|
|
3500
|
-
let e = c[
|
|
3531
|
+
case Z.CREATE_TEXT: {
|
|
3532
|
+
let e = c[d + 1], t = l[c[d + 2]], n = r(t, this.scope, this.declaredVars), i = n == null ? "" : String(n);
|
|
3501
3533
|
this.setRegister(e, {
|
|
3502
3534
|
type: "text",
|
|
3503
3535
|
content: i,
|
|
3504
3536
|
children: []
|
|
3505
|
-
}),
|
|
3537
|
+
}), d += 3;
|
|
3506
3538
|
break;
|
|
3507
3539
|
}
|
|
3508
|
-
case
|
|
3509
|
-
let e = c[
|
|
3540
|
+
case Z.CREATE_COMMENT: {
|
|
3541
|
+
let e = c[d + 1], t = c[d + 2], n = String(l[t]);
|
|
3510
3542
|
this.setRegister(e, {
|
|
3511
3543
|
type: "comment",
|
|
3512
3544
|
content: n,
|
|
3513
3545
|
children: []
|
|
3514
|
-
}),
|
|
3546
|
+
}), d += 3;
|
|
3515
3547
|
break;
|
|
3516
3548
|
}
|
|
3517
|
-
case
|
|
3518
|
-
let e = c[
|
|
3549
|
+
case Z.CREATE_FRAGMENT: {
|
|
3550
|
+
let e = c[d + 1];
|
|
3519
3551
|
this.setRegister(e, {
|
|
3520
3552
|
type: "fragment",
|
|
3521
3553
|
children: []
|
|
3522
|
-
}),
|
|
3554
|
+
}), d += 2;
|
|
3523
3555
|
break;
|
|
3524
3556
|
}
|
|
3525
|
-
case
|
|
3526
|
-
let e = c[
|
|
3527
|
-
n.children.push(r),
|
|
3557
|
+
case Z.APPEND_CHILD: {
|
|
3558
|
+
let e = c[d + 1], t = c[d + 2], n = this.getRegister(e), r = this.getRegister(t);
|
|
3559
|
+
n.children.push(r), d += 3;
|
|
3528
3560
|
break;
|
|
3529
3561
|
}
|
|
3530
|
-
case
|
|
3531
|
-
let e = c[
|
|
3562
|
+
case Z.SET_ATTR: {
|
|
3563
|
+
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
3564
|
if (o.startsWith("on")) {
|
|
3533
|
-
|
|
3565
|
+
d += 5;
|
|
3534
3566
|
break;
|
|
3535
3567
|
}
|
|
3536
|
-
let u = l[n],
|
|
3537
|
-
o === "style" && (
|
|
3568
|
+
let u = l[n], f = i === 1 ? r(u, this.scope, this.declaredVars) : u;
|
|
3569
|
+
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
3570
|
break;
|
|
3539
3571
|
}
|
|
3540
|
-
case
|
|
3541
|
-
let e = c[
|
|
3572
|
+
case Z.INTERPOLATE_TEXT: {
|
|
3573
|
+
let e = c[d + 1], t = l[c[d + 2]], n = r(t, this.scope, this.declaredVars);
|
|
3542
3574
|
if (n && typeof n == "object" && "type" in n && Array.isArray(n.children)) this.setRegister(e, n);
|
|
3543
3575
|
else {
|
|
3544
3576
|
let t = n == null ? "" : String(n);
|
|
@@ -3548,63 +3580,94 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3548
3580
|
children: []
|
|
3549
3581
|
});
|
|
3550
3582
|
}
|
|
3551
|
-
|
|
3583
|
+
d += 3;
|
|
3552
3584
|
break;
|
|
3553
3585
|
}
|
|
3554
|
-
case
|
|
3555
|
-
let e = l[c[
|
|
3586
|
+
case Z.EXEC_SCRIPT: {
|
|
3587
|
+
let e = l[c[d + 1]];
|
|
3556
3588
|
if (Array.isArray(e)) for (let t of e) r(t, this.scope, this.declaredVars);
|
|
3557
3589
|
else e && r(e, this.scope, this.declaredVars);
|
|
3558
|
-
|
|
3590
|
+
d += 2;
|
|
3559
3591
|
break;
|
|
3560
3592
|
}
|
|
3561
|
-
case
|
|
3562
|
-
let t = c[
|
|
3593
|
+
case Z.REACTIVE_IF: {
|
|
3594
|
+
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
3595
|
if (o.children.push({
|
|
3564
3596
|
type: "comment",
|
|
3565
3597
|
content: "if",
|
|
3566
3598
|
children: []
|
|
3567
|
-
}),
|
|
3599
|
+
}), p) {
|
|
3568
3600
|
let t = Object.create(this.scope), n = new e();
|
|
3569
3601
|
n.parentVM = this;
|
|
3570
|
-
let r = n.execute(
|
|
3602
|
+
let r = n.execute(p, { scope: t });
|
|
3571
3603
|
r && o.children.push(r);
|
|
3572
3604
|
}
|
|
3573
3605
|
o.children.push({
|
|
3574
3606
|
type: "comment",
|
|
3575
3607
|
content: "/if",
|
|
3576
3608
|
children: []
|
|
3577
|
-
}),
|
|
3609
|
+
}), d += 6;
|
|
3578
3610
|
break;
|
|
3579
3611
|
}
|
|
3580
|
-
case
|
|
3581
|
-
let t = c[
|
|
3582
|
-
|
|
3583
|
-
|
|
3584
|
-
|
|
3612
|
+
case Z.REACTIVE_SWITCH: {
|
|
3613
|
+
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;
|
|
3614
|
+
if (Array.isArray(u)) for (let e = 0; e < u.length; e++) {
|
|
3615
|
+
let t = u[e];
|
|
3616
|
+
if (p === r(l[t.testIdx], this.scope, this.declaredVars)) {
|
|
3617
|
+
m = l[t.modIdx];
|
|
3618
|
+
break;
|
|
3619
|
+
}
|
|
3620
|
+
}
|
|
3621
|
+
if (o.children.push({
|
|
3622
|
+
type: "comment",
|
|
3623
|
+
content: "switch",
|
|
3624
|
+
children: []
|
|
3625
|
+
}), m) {
|
|
3626
|
+
let t = Object.create(this.scope), n = new e();
|
|
3627
|
+
n.parentVM = this;
|
|
3628
|
+
let r = n.execute(m, { scope: t });
|
|
3629
|
+
r && o.children.push(r);
|
|
3630
|
+
}
|
|
3631
|
+
o.children.push({
|
|
3632
|
+
type: "comment",
|
|
3633
|
+
content: "/switch",
|
|
3634
|
+
children: []
|
|
3635
|
+
}), d += 6;
|
|
3636
|
+
break;
|
|
3637
|
+
}
|
|
3638
|
+
case Z.REACTIVE_FOR: {
|
|
3639
|
+
let t = c[d + 1], n = c[d + 2], i = c[d + 3], a = c[d + 4];
|
|
3640
|
+
c[d + 5];
|
|
3641
|
+
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));
|
|
3642
|
+
f.children.push({
|
|
3585
3643
|
type: "comment",
|
|
3586
3644
|
content: "for",
|
|
3587
3645
|
children: []
|
|
3588
3646
|
});
|
|
3589
|
-
for (let t = 0; t <
|
|
3647
|
+
for (let t = 0; t < te.length; t++) {
|
|
3590
3648
|
let n = Object.create(this.scope);
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3594
|
-
|
|
3595
|
-
i
|
|
3649
|
+
if (u) {
|
|
3650
|
+
let e = r(u, n, this.declaredVars);
|
|
3651
|
+
typeof e == "function" ? e(te[t], t) : ($t(n, m, te[t]), h && $t(n, h, t));
|
|
3652
|
+
} else $t(n, m, te[t]), h && $t(n, h, t);
|
|
3653
|
+
let i = new e();
|
|
3654
|
+
i.parentVM = this;
|
|
3655
|
+
let a = i.execute(g, { scope: n });
|
|
3656
|
+
a && f.children.push(a);
|
|
3596
3657
|
}
|
|
3597
|
-
|
|
3658
|
+
f.children.push({
|
|
3598
3659
|
type: "comment",
|
|
3599
3660
|
content: "/for",
|
|
3600
3661
|
children: []
|
|
3601
|
-
}),
|
|
3662
|
+
}), d += 11;
|
|
3602
3663
|
break;
|
|
3603
3664
|
}
|
|
3604
|
-
case
|
|
3605
|
-
let t = c[
|
|
3665
|
+
case Z.REACTIVE_ASYNC: {
|
|
3666
|
+
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) => {
|
|
3667
|
+
en(e, ee, t, f, this.declaredVars);
|
|
3668
|
+
}, _ = r(m, this.scope, this.declaredVars), v = e.nextAsyncId++;
|
|
3606
3669
|
if (this.isStreaming) {
|
|
3607
|
-
if (
|
|
3670
|
+
if (p.children.push({
|
|
3608
3671
|
type: "comment",
|
|
3609
3672
|
content: `drift-async:${v}`,
|
|
3610
3673
|
children: []
|
|
@@ -3612,23 +3675,25 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3612
3675
|
let t = Object.create(this.scope), n = new e();
|
|
3613
3676
|
n.parentVM = this, n.isStreaming = !0;
|
|
3614
3677
|
let r = n.execute(g, { scope: t });
|
|
3615
|
-
r &&
|
|
3678
|
+
r && p.children.push(r);
|
|
3616
3679
|
}
|
|
3617
|
-
|
|
3680
|
+
p.children.push({
|
|
3618
3681
|
type: "comment",
|
|
3619
3682
|
content: `/drift-async:${v}`,
|
|
3620
3683
|
children: []
|
|
3621
3684
|
}), this.asyncBoundaries.push({
|
|
3622
3685
|
id: v,
|
|
3623
|
-
promise:
|
|
3624
|
-
alias:
|
|
3686
|
+
promise: _,
|
|
3687
|
+
alias: ee,
|
|
3625
3688
|
bodyMod: h,
|
|
3626
3689
|
fallbackMod: g,
|
|
3627
|
-
catchMod:
|
|
3628
|
-
scope: this.scope
|
|
3690
|
+
catchMod: te,
|
|
3691
|
+
scope: this.scope,
|
|
3692
|
+
aliasPopulator: f,
|
|
3693
|
+
declaredVars: this.declaredVars
|
|
3629
3694
|
});
|
|
3630
|
-
} else if (
|
|
3631
|
-
if (
|
|
3695
|
+
} else if (_ && typeof _.then == "function") {
|
|
3696
|
+
if (p.children.push({
|
|
3632
3697
|
type: "comment",
|
|
3633
3698
|
content: `drift-async:${v}`,
|
|
3634
3699
|
children: []
|
|
@@ -3636,34 +3701,34 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3636
3701
|
let t = Object.create(this.scope), n = new e();
|
|
3637
3702
|
n.parentVM = this;
|
|
3638
3703
|
let r = n.execute(g, { scope: t });
|
|
3639
|
-
r &&
|
|
3704
|
+
r && p.children.push(r);
|
|
3640
3705
|
}
|
|
3641
|
-
|
|
3706
|
+
p.children.push({
|
|
3642
3707
|
type: "comment",
|
|
3643
3708
|
content: `/drift-async:${v}`,
|
|
3644
3709
|
children: []
|
|
3645
3710
|
});
|
|
3646
3711
|
} else {
|
|
3647
|
-
|
|
3712
|
+
p.children.push({
|
|
3648
3713
|
type: "comment",
|
|
3649
3714
|
content: `drift-async:${v}`,
|
|
3650
3715
|
children: []
|
|
3651
3716
|
});
|
|
3652
3717
|
let t = Object.create(this.scope);
|
|
3653
|
-
|
|
3718
|
+
ne(t, _);
|
|
3654
3719
|
let n = new e();
|
|
3655
3720
|
n.parentVM = this;
|
|
3656
3721
|
let r = n.execute(h, { scope: t });
|
|
3657
|
-
r &&
|
|
3722
|
+
r && p.children.push(r), p.children.push({
|
|
3658
3723
|
type: "comment",
|
|
3659
3724
|
content: `/drift-async:${v}`,
|
|
3660
3725
|
children: []
|
|
3661
3726
|
});
|
|
3662
3727
|
}
|
|
3663
|
-
|
|
3728
|
+
d += 9;
|
|
3664
3729
|
break;
|
|
3665
3730
|
}
|
|
3666
|
-
default: throw Error(`DriftServerVM: Unknown Opcode ${t} at PC ${
|
|
3731
|
+
default: throw Error(`DriftServerVM: Unknown Opcode ${t} at PC ${d}`);
|
|
3667
3732
|
}
|
|
3668
3733
|
}
|
|
3669
3734
|
return this.getRegister(0);
|
|
@@ -3672,25 +3737,25 @@ var en = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, tn = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, nn
|
|
|
3672
3737
|
}
|
|
3673
3738
|
}
|
|
3674
3739
|
};
|
|
3675
|
-
function
|
|
3740
|
+
function an(e, t) {
|
|
3676
3741
|
if (!t) return e;
|
|
3677
3742
|
let n = t.toLowerCase();
|
|
3678
3743
|
return n === "script" ? e.replace(/<\/script/gi, "<\\/script") : n === "style" ? e.replace(/<\/style/gi, "<\\/style") : e;
|
|
3679
3744
|
}
|
|
3680
3745
|
function $(t, n = !1, r) {
|
|
3681
3746
|
if (!t) return "";
|
|
3682
|
-
if (typeof t == "string") return n ?
|
|
3683
|
-
if (t.type === "text") return n ?
|
|
3747
|
+
if (typeof t == "string") return n ? an(t, r) : Q(t);
|
|
3748
|
+
if (t.type === "text") return n ? an(t.content ?? "", r) : Q(t.content ?? "");
|
|
3684
3749
|
if (t.type === "comment") return `<!--${String(t.content ?? "").replace(/-->/g, "-- >").replace(/--!>/g, "--! >")}-->`;
|
|
3685
3750
|
if (t.type === "fragment") return t.children.map((e) => $(e, n, r)).join("");
|
|
3686
3751
|
if (t.type === "element") {
|
|
3687
3752
|
let n = t.tag;
|
|
3688
|
-
if (!n || !
|
|
3753
|
+
if (!n || !nn.test(n)) return "";
|
|
3689
3754
|
let r = n.toLowerCase() === "script" || n.toLowerCase() === "style", i = "";
|
|
3690
3755
|
if (t.attrs && t.attrs.size > 0) for (let [e, n] of t.attrs.entries()) {
|
|
3691
|
-
if (!
|
|
3756
|
+
if (!tn.test(e) || e === "style" && (n === "" || n == null || n === !1)) continue;
|
|
3692
3757
|
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}="${
|
|
3758
|
+
n === !0 ? i += t ? ` ${e}="true"` : ` ${e}` : n === !1 ? t && (i += ` ${e}="false"`) : n != null && (i += ` ${e}="${Q(String(n))}"`);
|
|
3694
3759
|
}
|
|
3695
3760
|
if (e.has(n.toLowerCase())) return `<${n}${i} />`;
|
|
3696
3761
|
let a = t.children.map((e) => $(e, r, r ? n : void 0)).join("");
|
|
@@ -3698,11 +3763,24 @@ function $(t, n = !1, r) {
|
|
|
3698
3763
|
}
|
|
3699
3764
|
return "";
|
|
3700
3765
|
}
|
|
3701
|
-
function
|
|
3702
|
-
let n = new
|
|
3766
|
+
function on(e, t = {}) {
|
|
3767
|
+
let n = new rn().execute(e, t);
|
|
3703
3768
|
return n ? $(n) : "";
|
|
3704
3769
|
}
|
|
3705
|
-
function
|
|
3770
|
+
function sn(e, t, n = {}) {
|
|
3771
|
+
let r = n.islandTag || "div", i = n.trigger || "idle", a = ` data-drift-island="${Q(e)}"`;
|
|
3772
|
+
i && (a += ` data-drift-trigger="${Q(i)}"`), n.props && Object.keys(n.props).length > 0 && (a += ` data-drift-props="${Q(JSON.stringify(n.props))}"`), n.timeout !== void 0 && (a += ` data-drift-timeout="${n.timeout}"`), n.media && (a += ` data-drift-media="${Q(n.media)}"`), n.rootMargin && (a += ` data-drift-root-margin="${Q(n.rootMargin)}"`);
|
|
3773
|
+
let o = n.props ? {
|
|
3774
|
+
...n.scope,
|
|
3775
|
+
props: n.props,
|
|
3776
|
+
...n.props
|
|
3777
|
+
} : n.scope, s = on(t, {
|
|
3778
|
+
...n,
|
|
3779
|
+
scope: o
|
|
3780
|
+
});
|
|
3781
|
+
return `<${r}${a}>${s}</${r}>`;
|
|
3782
|
+
}
|
|
3783
|
+
function cn(e, t = {}) {
|
|
3706
3784
|
let n = !1, r = null, i = new ReadableStream({
|
|
3707
3785
|
start(i) {
|
|
3708
3786
|
let a = new TextEncoder(), o = (e) => {
|
|
@@ -3719,11 +3797,11 @@ function on(e, t = {}) {
|
|
|
3719
3797
|
}
|
|
3720
3798
|
};
|
|
3721
3799
|
try {
|
|
3722
|
-
let i = new
|
|
3800
|
+
let i = new rn();
|
|
3723
3801
|
i.isStreaming = !0;
|
|
3724
3802
|
let a = i.execute(e, t), c = a ? $(a) : "", l = i.asyncBoundaries;
|
|
3725
3803
|
if (l.length > 0) {
|
|
3726
|
-
let e = `<script${t.nonce ? ` nonce="${
|
|
3804
|
+
let e = `<script${t.nonce ? ` nonce="${Q(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
3805
|
c += e;
|
|
3728
3806
|
}
|
|
3729
3807
|
if (o(c), t.onShellReady?.(), l.length === 0) {
|
|
@@ -3738,18 +3816,18 @@ function on(e, t = {}) {
|
|
|
3738
3816
|
}, t.timeoutMs));
|
|
3739
3817
|
let u = l.length;
|
|
3740
3818
|
for (let e of l) {
|
|
3741
|
-
let { id: r, promise: i, alias: a, bodyMod: c, catchMod: l, scope: f } = e;
|
|
3819
|
+
let { id: r, promise: i, alias: a, bodyMod: c, catchMod: l, scope: d, aliasPopulator: f, declaredVars: p } = e;
|
|
3742
3820
|
Promise.resolve(i).then((e) => {
|
|
3743
3821
|
if (n) return;
|
|
3744
|
-
let i = Object.create(
|
|
3745
|
-
|
|
3746
|
-
let s = new
|
|
3747
|
-
o(
|
|
3822
|
+
let i = Object.create(d);
|
|
3823
|
+
en(i, a, e, f, p);
|
|
3824
|
+
let s = new rn().execute(c, { scope: i }), l = s ? $(s) : "", u = t.nonce ? ` nonce="${Q(t.nonce)}"` : "", m = `<template id="drift-t-${r}">${l}</template><script${u}>__drift_swap("${r}","drift-t-${r}")<\/script>`;
|
|
3825
|
+
o(m);
|
|
3748
3826
|
}).catch((e) => {
|
|
3749
3827
|
if (!n && (t.onError?.(e), l)) {
|
|
3750
|
-
let n = Object.create(
|
|
3751
|
-
l.errorVar &&
|
|
3752
|
-
let i = new
|
|
3828
|
+
let n = Object.create(d);
|
|
3829
|
+
l.errorVar && $t(n, l.errorVar, e);
|
|
3830
|
+
let i = new rn().execute(l.module, { scope: n }), a = i ? $(i) : "", s = t.nonce ? ` nonce="${Q(t.nonce)}"` : "", c = `<template id="drift-t-${r}">${a}</template><script${s}>__drift_swap("${r}","drift-t-${r}")<\/script>`;
|
|
3753
3831
|
o(c);
|
|
3754
3832
|
}
|
|
3755
3833
|
}).finally(() => {
|
|
@@ -3791,4 +3869,4 @@ function on(e, t = {}) {
|
|
|
3791
3869
|
}, a;
|
|
3792
3870
|
}
|
|
3793
3871
|
//#endregion
|
|
3794
|
-
export {
|
|
3872
|
+
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 renderIslandToString, cn as renderToStream, on as renderToString, $ as serializeNode };
|