@datapos/datapos-development 0.3.173 → 0.3.174
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/datapos-development.es.js +581 -580
- package/dist/types/src/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { exec as
|
|
1
|
+
import { exec as Ii } from "node:child_process";
|
|
2
2
|
import { promises as R } from "node:fs";
|
|
3
|
-
import { nanoid as
|
|
4
|
-
import { promisify as
|
|
5
|
-
var
|
|
3
|
+
import { nanoid as _i } from "nanoid";
|
|
4
|
+
import { promisify as Ni } from "node:util";
|
|
5
|
+
var Li = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 80, 3, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 343, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 726, 6, 110, 6, 6, 9, 4759, 9, 787719, 239], Ue = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 2, 60, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 42, 9, 8936, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 496, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4153, 7, 221, 3, 5761, 15, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 4191], Oi = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", qe = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-Ꟑꟑꟓꟕ-ꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", oe = {
|
|
6
6
|
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",
|
|
7
7
|
5: "class enum extends super const export import",
|
|
8
8
|
6: "enum",
|
|
9
9
|
strict: "implements interface let package private protected public static yield",
|
|
10
10
|
strictBind: "eval arguments"
|
|
11
|
-
}, he = "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",
|
|
11
|
+
}, he = "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", Ri = {
|
|
12
12
|
5: he,
|
|
13
13
|
"5module": he + " export import",
|
|
14
14
|
6: he + " const class extends export import super"
|
|
15
|
-
},
|
|
15
|
+
}, Mi = /^in(stanceof)?$/, Di = new RegExp("[" + qe + "]"), Vi = new RegExp("[" + qe + Oi + "]");
|
|
16
16
|
function le(t, e) {
|
|
17
17
|
for (var r = 65536, a = 0; a < e.length; a += 2) {
|
|
18
18
|
if (r += e[a], r > t)
|
|
@@ -23,10 +23,10 @@ function le(t, e) {
|
|
|
23
23
|
return !1;
|
|
24
24
|
}
|
|
25
25
|
function pt(t, e) {
|
|
26
|
-
return t < 65 ? t === 36 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 &&
|
|
26
|
+
return t < 65 ? t === 36 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 && Di.test(String.fromCharCode(t)) : e === !1 ? !1 : le(t, Ue);
|
|
27
27
|
}
|
|
28
28
|
function dt(t, e) {
|
|
29
|
-
return t < 48 ? t === 36 : t < 58 ? !0 : t < 65 ? !1 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 &&
|
|
29
|
+
return t < 48 ? t === 36 : t < 58 ? !0 : t < 65 ? !1 : t < 91 ? !0 : t < 97 ? t === 95 : t < 123 ? !0 : t <= 65535 ? t >= 170 && Vi.test(String.fromCharCode(t)) : e === !1 ? !1 : le(t, Ue) || le(t, Li);
|
|
30
30
|
}
|
|
31
31
|
var O = function(e, r) {
|
|
32
32
|
r === void 0 && (r = {}), this.label = e, this.keyword = r.keyword, this.beforeExpr = !!r.beforeExpr, this.startsExpr = !!r.startsExpr, this.isLoop = !!r.isLoop, this.isAssign = !!r.isAssign, this.prefix = !!r.prefix, this.postfix = !!r.postfix, this.binop = r.binop || null, this.updateContext = null;
|
|
@@ -131,11 +131,11 @@ var h = {
|
|
|
131
131
|
_typeof: D("typeof", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
132
132
|
_void: D("void", { beforeExpr: !0, prefix: !0, startsExpr: !0 }),
|
|
133
133
|
_delete: D("delete", { beforeExpr: !0, prefix: !0, startsExpr: !0 })
|
|
134
|
-
}, Y = /\r\n?|\n|\u2028|\u2029/,
|
|
134
|
+
}, Y = /\r\n?|\n|\u2028|\u2029/, He = new RegExp(Y.source, "g");
|
|
135
135
|
function Tt(t) {
|
|
136
136
|
return t === 10 || t === 13 || t === 8232 || t === 8233;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function We(t, e, r) {
|
|
139
139
|
r === void 0 && (r = t.length);
|
|
140
140
|
for (var a = e; a < r; a++) {
|
|
141
141
|
var u = t.charCodeAt(a);
|
|
@@ -144,10 +144,10 @@ function Ke(t, e, r) {
|
|
|
144
144
|
}
|
|
145
145
|
return -1;
|
|
146
146
|
}
|
|
147
|
-
var xe = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, $ = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,
|
|
148
|
-
return
|
|
147
|
+
var xe = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, $ = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, Ke = Object.prototype, Fi = Ke.hasOwnProperty, Bi = Ke.toString, wt = Object.hasOwn || (function(t, e) {
|
|
148
|
+
return Fi.call(t, e);
|
|
149
149
|
}), Ie = Array.isArray || (function(t) {
|
|
150
|
-
return
|
|
150
|
+
return Bi.call(t) === "[object Array]";
|
|
151
151
|
}), _e = /* @__PURE__ */ Object.create(null);
|
|
152
152
|
function bt(t) {
|
|
153
153
|
return _e[t] || (_e[t] = new RegExp("^(?:" + t.replace(/ /g, "|") + ")$"));
|
|
@@ -155,7 +155,7 @@ function bt(t) {
|
|
|
155
155
|
function mt(t) {
|
|
156
156
|
return t <= 65535 ? String.fromCharCode(t) : (t -= 65536, String.fromCharCode((t >> 10) + 55296, (t & 1023) + 56320));
|
|
157
157
|
}
|
|
158
|
-
var
|
|
158
|
+
var ji = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, At = function(e, r) {
|
|
159
159
|
this.line = e, this.column = r;
|
|
160
160
|
};
|
|
161
161
|
At.prototype.offset = function(e) {
|
|
@@ -166,7 +166,7 @@ var Ft = function(e, r, a) {
|
|
|
166
166
|
};
|
|
167
167
|
function ve(t, e) {
|
|
168
168
|
for (var r = 1, a = 0; ; ) {
|
|
169
|
-
var u =
|
|
169
|
+
var u = We(t, a, e);
|
|
170
170
|
if (u < 0)
|
|
171
171
|
return new At(r, e - a);
|
|
172
172
|
++r, a = u;
|
|
@@ -269,7 +269,7 @@ var zt = {
|
|
|
269
269
|
// (non-standard) ParenthesizedExpression nodes
|
|
270
270
|
preserveParens: !1
|
|
271
271
|
}, Ne = !1;
|
|
272
|
-
function
|
|
272
|
+
function Ui(t) {
|
|
273
273
|
var e = {};
|
|
274
274
|
for (var r in zt)
|
|
275
275
|
e[r] = t && wt(t, r) ? t[r] : zt[r];
|
|
@@ -280,29 +280,29 @@ Defaulting to 2020, but this will stop working in the future.`)), e.ecmaVersion
|
|
|
280
280
|
return a.push(u);
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
|
-
return Ie(e.onComment) && (e.onComment =
|
|
283
|
+
return Ie(e.onComment) && (e.onComment = qi(e, e.onComment)), e;
|
|
284
284
|
}
|
|
285
|
-
function
|
|
286
|
-
return function(r, a, u,
|
|
285
|
+
function qi(t, e) {
|
|
286
|
+
return function(r, a, u, l, d, v) {
|
|
287
287
|
var g = {
|
|
288
288
|
type: r ? "Block" : "Line",
|
|
289
289
|
value: a,
|
|
290
290
|
start: u,
|
|
291
|
-
end:
|
|
291
|
+
end: l
|
|
292
292
|
};
|
|
293
|
-
t.locations && (g.loc = new Ft(this, d, v)), t.ranges && (g.range = [u,
|
|
293
|
+
t.locations && (g.loc = new Ft(this, d, v)), t.ranges && (g.range = [u, l]), e.push(g);
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
|
-
var Vt = 1, Et = 2, ge = 4,
|
|
296
|
+
var Vt = 1, Et = 2, ge = 4, ze = 8, be = 16, Je = 32, Yt = 64, Ge = 128, Pt = 256, Bt = 512, Zt = Vt | Et | Pt;
|
|
297
297
|
function Se(t, e) {
|
|
298
|
-
return Et | (t ? ge : 0) | (e ?
|
|
298
|
+
return Et | (t ? ge : 0) | (e ? ze : 0);
|
|
299
299
|
}
|
|
300
|
-
var Jt = 0, Te = 1, xt = 2,
|
|
301
|
-
this.options = e =
|
|
300
|
+
var Jt = 0, Te = 1, xt = 2, $e = 3, Xe = 4, Qe = 5, W = function(e, r, a) {
|
|
301
|
+
this.options = e = Ui(e), this.sourceFile = e.sourceFile, this.keywords = bt(Ri[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
302
302
|
var u = "";
|
|
303
303
|
e.allowReserved !== !0 && (u = oe[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (u += " await")), this.reservedWords = bt(u);
|
|
304
|
-
var
|
|
305
|
-
this.reservedWordsStrict = bt(
|
|
304
|
+
var l = (u ? u + " " : "") + oe.strict;
|
|
305
|
+
this.reservedWordsStrict = bt(l), this.reservedWordsStrictBind = bt(l + " " + oe.strictBind), this.input = String(r), this.containsEsc = !1, a ? (this.pos = a, this.lineStart = this.input.lastIndexOf(`
|
|
306
306
|
`, a - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(Y).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = h.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 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = /* @__PURE__ */ Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(Vt), this.regexpState = null, this.privateNameStack = [];
|
|
307
307
|
}, lt = { inFunction: { configurable: !0 }, inGenerator: { configurable: !0 }, inAsync: { configurable: !0 }, canAwait: { configurable: !0 }, allowSuper: { configurable: !0 }, allowDirectSuper: { configurable: !0 }, treatFunctionsAsVar: { configurable: !0 }, allowNewDotTarget: { configurable: !0 }, inClassStaticBlock: { configurable: !0 } };
|
|
308
308
|
W.prototype.parse = function() {
|
|
@@ -313,7 +313,7 @@ lt.inFunction.get = function() {
|
|
|
313
313
|
return (this.currentVarScope().flags & Et) > 0;
|
|
314
314
|
};
|
|
315
315
|
lt.inGenerator.get = function() {
|
|
316
|
-
return (this.currentVarScope().flags &
|
|
316
|
+
return (this.currentVarScope().flags & ze) > 0;
|
|
317
317
|
};
|
|
318
318
|
lt.inAsync.get = function() {
|
|
319
319
|
return (this.currentVarScope().flags & ge) > 0;
|
|
@@ -333,7 +333,7 @@ lt.allowSuper.get = function() {
|
|
|
333
333
|
return (e & Yt) > 0 || this.options.allowSuperOutsideMethod;
|
|
334
334
|
};
|
|
335
335
|
lt.allowDirectSuper.get = function() {
|
|
336
|
-
return (this.currentThisScope().flags &
|
|
336
|
+
return (this.currentThisScope().flags & Ge) > 0;
|
|
337
337
|
};
|
|
338
338
|
lt.treatFunctionsAsVar.get = function() {
|
|
339
339
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
@@ -366,13 +366,13 @@ W.tokenizer = function(e, r) {
|
|
|
366
366
|
return new this(r, e);
|
|
367
367
|
};
|
|
368
368
|
Object.defineProperties(W.prototype, lt);
|
|
369
|
-
var Z = W.prototype,
|
|
369
|
+
var Z = W.prototype, Hi = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
370
370
|
Z.strictDirective = function(t) {
|
|
371
371
|
if (this.options.ecmaVersion < 5)
|
|
372
372
|
return !1;
|
|
373
373
|
for (; ; ) {
|
|
374
374
|
$.lastIndex = t, t += $.exec(this.input)[0].length;
|
|
375
|
-
var e =
|
|
375
|
+
var e = Hi.exec(this.input.slice(t));
|
|
376
376
|
if (!e)
|
|
377
377
|
return !1;
|
|
378
378
|
if ((e[1] || e[2]) === "use strict") {
|
|
@@ -448,12 +448,12 @@ k.parseTopLevel = function(t) {
|
|
|
448
448
|
}
|
|
449
449
|
if (this.inModule)
|
|
450
450
|
for (var a = 0, u = Object.keys(this.undefinedExports); a < u.length; a += 1) {
|
|
451
|
-
var
|
|
452
|
-
this.raiseRecoverable(this.undefinedExports[
|
|
451
|
+
var l = u[a];
|
|
452
|
+
this.raiseRecoverable(this.undefinedExports[l].start, "Export '" + l + "' is not defined");
|
|
453
453
|
}
|
|
454
454
|
return this.adaptDirectivePrologue(t.body), this.next(), t.sourceType = this.options.sourceType, this.finishNode(t, "Program");
|
|
455
455
|
};
|
|
456
|
-
var Pe = { kind: "loop" },
|
|
456
|
+
var Pe = { kind: "loop" }, Wi = { kind: "switch" };
|
|
457
457
|
k.isLet = function(t) {
|
|
458
458
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let"))
|
|
459
459
|
return !1;
|
|
@@ -470,8 +470,8 @@ k.isLet = function(t) {
|
|
|
470
470
|
++u;
|
|
471
471
|
if (a === 92 || a > 55295 && a < 56320)
|
|
472
472
|
return !0;
|
|
473
|
-
var
|
|
474
|
-
if (!
|
|
473
|
+
var l = this.input.slice(r, u);
|
|
474
|
+
if (!Mi.test(l))
|
|
475
475
|
return !0;
|
|
476
476
|
}
|
|
477
477
|
return !1;
|
|
@@ -491,8 +491,8 @@ k.isUsingKeyword = function(t, e) {
|
|
|
491
491
|
if (Y.test(this.input.slice(this.pos, a)))
|
|
492
492
|
return !1;
|
|
493
493
|
if (t) {
|
|
494
|
-
var u = a + 5,
|
|
495
|
-
if (this.input.slice(a, u) !== "using" || u === this.input.length || dt(
|
|
494
|
+
var u = a + 5, l;
|
|
495
|
+
if (this.input.slice(a, u) !== "using" || u === this.input.length || dt(l = this.input.charCodeAt(u)) || l > 55295 && l < 56320)
|
|
496
496
|
return !1;
|
|
497
497
|
$.lastIndex = u;
|
|
498
498
|
var d = $.exec(this.input);
|
|
@@ -514,8 +514,8 @@ k.isUsing = function(t) {
|
|
|
514
514
|
return this.isUsingKeyword(!1, t);
|
|
515
515
|
};
|
|
516
516
|
k.parseStatement = function(t, e, r) {
|
|
517
|
-
var a = this.type, u = this.startNode(),
|
|
518
|
-
switch (this.isLet(t) && (a = h._var,
|
|
517
|
+
var a = this.type, u = this.startNode(), l;
|
|
518
|
+
switch (this.isLet(t) && (a = h._var, l = "let"), a) {
|
|
519
519
|
case h._break:
|
|
520
520
|
case h._continue:
|
|
521
521
|
return this.parseBreakContinueStatement(u, a.keyword);
|
|
@@ -541,7 +541,7 @@ k.parseStatement = function(t, e, r) {
|
|
|
541
541
|
return this.parseTryStatement(u);
|
|
542
542
|
case h._const:
|
|
543
543
|
case h._var:
|
|
544
|
-
return
|
|
544
|
+
return l = l || this.value, t && l !== "var" && this.unexpected(), this.parseVarStatement(u, l);
|
|
545
545
|
case h._while:
|
|
546
546
|
return this.parseWhileStatement(u);
|
|
547
547
|
case h._with:
|
|
@@ -600,13 +600,13 @@ k.parseForStatement = function(t) {
|
|
|
600
600
|
var a = this.startNode(), u = r ? "let" : this.value;
|
|
601
601
|
return this.next(), this.parseVar(a, !0, u), this.finishNode(a, "VariableDeclaration"), this.parseForAfterInit(t, a, e);
|
|
602
602
|
}
|
|
603
|
-
var
|
|
603
|
+
var l = this.isContextual("let"), d = !1, v = this.isUsing(!0) ? "using" : this.isAwaitUsing(!0) ? "await using" : null;
|
|
604
604
|
if (v) {
|
|
605
605
|
var g = this.startNode();
|
|
606
606
|
return this.next(), v === "await using" && this.next(), this.parseVar(g, !0, v), this.finishNode(g, "VariableDeclaration"), this.parseForAfterInit(t, g, e);
|
|
607
607
|
}
|
|
608
608
|
var o = this.containsEsc, w = new te(), L = this.start, F = e > -1 ? this.parseExprSubscripts(w, "await") : this.parseExpression(!0, w);
|
|
609
|
-
return this.type === h._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === h._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (F.start === L && !o && F.type === "Identifier" && F.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (t.await = !1)),
|
|
609
|
+
return this.type === h._in || (d = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (e > -1 ? (this.type === h._in && this.unexpected(e), t.await = !0) : d && this.options.ecmaVersion >= 8 && (F.start === L && !o && F.type === "Identifier" && F.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (t.await = !1)), l && d && this.raise(F.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(F, !1, w), this.checkLValPattern(F), this.parseForIn(t, F)) : (this.checkExpressionErrors(w, !0), e > -1 && this.unexpected(e), this.parseFor(t, F));
|
|
610
610
|
};
|
|
611
611
|
k.parseForAfterInit = function(t, e, r) {
|
|
612
612
|
return (this.type === h._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && e.declarations.length === 1 ? (this.options.ecmaVersion >= 9 && (this.type === h._in ? r > -1 && this.unexpected(r) : t.await = r > -1), this.parseForIn(t, e)) : (r > -1 && this.unexpected(r), this.parseFor(t, e));
|
|
@@ -621,7 +621,7 @@ k.parseReturnStatement = function(t) {
|
|
|
621
621
|
return !this.inFunction && !this.options.allowReturnOutsideFunction && this.raise(this.start, "'return' outside of function"), this.next(), this.eat(h.semi) || this.insertSemicolon() ? t.argument = null : (t.argument = this.parseExpression(), this.semicolon()), this.finishNode(t, "ReturnStatement");
|
|
622
622
|
};
|
|
623
623
|
k.parseSwitchStatement = function(t) {
|
|
624
|
-
this.next(), t.discriminant = this.parseParenExpression(), t.cases = [], this.expect(h.braceL), this.labels.push(
|
|
624
|
+
this.next(), t.discriminant = this.parseParenExpression(), t.cases = [], this.expect(h.braceL), this.labels.push(Wi), this.enterScope(0);
|
|
625
625
|
for (var e, r = !1; this.type !== h.braceR; )
|
|
626
626
|
if (this.type === h._case || this.type === h._default) {
|
|
627
627
|
var a = this.type === h._case;
|
|
@@ -633,10 +633,10 @@ k.parseSwitchStatement = function(t) {
|
|
|
633
633
|
k.parseThrowStatement = function(t) {
|
|
634
634
|
return this.next(), Y.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), t.argument = this.parseExpression(), this.semicolon(), this.finishNode(t, "ThrowStatement");
|
|
635
635
|
};
|
|
636
|
-
var
|
|
636
|
+
var Ki = [];
|
|
637
637
|
k.parseCatchClauseParam = function() {
|
|
638
638
|
var t = this.parseBindingAtom(), e = t.type === "Identifier";
|
|
639
|
-
return this.enterScope(e ?
|
|
639
|
+
return this.enterScope(e ? Je : 0), this.checkLValPattern(t, e ? Xe : xt), this.expect(h.parenR), t;
|
|
640
640
|
};
|
|
641
641
|
k.parseTryStatement = function(t) {
|
|
642
642
|
if (this.next(), t.block = this.parseBlock(), t.handler = null, this.type === h._catch) {
|
|
@@ -658,8 +658,8 @@ k.parseEmptyStatement = function(t) {
|
|
|
658
658
|
return this.next(), this.finishNode(t, "EmptyStatement");
|
|
659
659
|
};
|
|
660
660
|
k.parseLabeledStatement = function(t, e, r, a) {
|
|
661
|
-
for (var u = 0,
|
|
662
|
-
var d =
|
|
661
|
+
for (var u = 0, l = this.labels; u < l.length; u += 1) {
|
|
662
|
+
var d = l[u];
|
|
663
663
|
d.name === e && this.raise(r.start, "Label '" + e + "' is already declared");
|
|
664
664
|
}
|
|
665
665
|
for (var v = this.type.isLoop ? "loop" : this.type === h._switch ? "switch" : null, g = this.labels.length - 1; g >= 0; g--) {
|
|
@@ -702,11 +702,11 @@ k.parseVar = function(t, e, r, a) {
|
|
|
702
702
|
k.parseVarId = function(t, e) {
|
|
703
703
|
t.id = e === "using" || e === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(t.id, e === "var" ? Te : xt, !1);
|
|
704
704
|
};
|
|
705
|
-
var Rt = 1, fe = 2,
|
|
705
|
+
var Rt = 1, fe = 2, Ye = 4;
|
|
706
706
|
k.parseFunction = function(t, e, r, a, u) {
|
|
707
|
-
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === h.star && e & fe && this.unexpected(), t.generator = this.eat(h.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e & Rt && (t.id = e &
|
|
708
|
-
var
|
|
709
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(t.async, t.generator)), e & Rt || (t.id = this.type === h.name ? this.parseIdent() : null), this.parseFunctionParams(t), this.parseFunctionBody(t, r, !1, u), this.yieldPos =
|
|
707
|
+
this.initFunction(t), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !a) && (this.type === h.star && e & fe && this.unexpected(), t.generator = this.eat(h.star)), this.options.ecmaVersion >= 8 && (t.async = !!a), e & Rt && (t.id = e & Ye && this.type !== h.name ? null : this.parseIdent(), t.id && !(e & fe) && this.checkLValSimple(t.id, this.strict || t.generator || t.async ? this.treatFunctionsAsVar ? Te : xt : $e));
|
|
708
|
+
var l = this.yieldPos, d = this.awaitPos, v = this.awaitIdentPos;
|
|
709
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(t.async, t.generator)), e & Rt || (t.id = this.type === h.name ? this.parseIdent() : null), this.parseFunctionParams(t), this.parseFunctionBody(t, r, !1, u), this.yieldPos = l, this.awaitPos = d, this.awaitIdentPos = v, this.finishNode(t, e & Rt ? "FunctionDeclaration" : "FunctionExpression");
|
|
710
710
|
};
|
|
711
711
|
k.parseFunctionParams = function(t) {
|
|
712
712
|
this.expect(h.parenL), t.params = this.parseBindingList(h.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
@@ -715,29 +715,29 @@ k.parseClass = function(t, e) {
|
|
|
715
715
|
this.next();
|
|
716
716
|
var r = this.strict;
|
|
717
717
|
this.strict = !0, this.parseClassId(t, e), this.parseClassSuper(t);
|
|
718
|
-
var a = this.enterClassBody(), u = this.startNode(),
|
|
718
|
+
var a = this.enterClassBody(), u = this.startNode(), l = !1;
|
|
719
719
|
for (u.body = [], this.expect(h.braceL); this.type !== h.braceR; ) {
|
|
720
720
|
var d = this.parseClassElement(t.superClass !== null);
|
|
721
|
-
d && (u.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (
|
|
721
|
+
d && (u.body.push(d), d.type === "MethodDefinition" && d.kind === "constructor" ? (l && this.raiseRecoverable(d.start, "Duplicate constructor in the same class"), l = !0) : d.key && d.key.type === "PrivateIdentifier" && zi(a, d) && this.raiseRecoverable(d.key.start, "Identifier '#" + d.key.name + "' has already been declared"));
|
|
722
722
|
}
|
|
723
723
|
return this.strict = r, this.next(), t.body = this.finishNode(u, "ClassBody"), this.exitClassBody(), this.finishNode(t, e ? "ClassDeclaration" : "ClassExpression");
|
|
724
724
|
};
|
|
725
725
|
k.parseClassElement = function(t) {
|
|
726
726
|
if (this.eat(h.semi))
|
|
727
727
|
return null;
|
|
728
|
-
var e = this.options.ecmaVersion, r = this.startNode(), a = "", u = !1,
|
|
728
|
+
var e = this.options.ecmaVersion, r = this.startNode(), a = "", u = !1, l = !1, d = "method", v = !1;
|
|
729
729
|
if (this.eatContextual("static")) {
|
|
730
730
|
if (e >= 13 && this.eat(h.braceL))
|
|
731
731
|
return this.parseClassStaticBlock(r), r;
|
|
732
732
|
this.isClassElementNameStart() || this.type === h.star ? v = !0 : a = "static";
|
|
733
733
|
}
|
|
734
|
-
if (r.static = v, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === h.star) && !this.canInsertSemicolon() ?
|
|
734
|
+
if (r.static = v, !a && e >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === h.star) && !this.canInsertSemicolon() ? l = !0 : a = "async"), !a && (e >= 9 || !l) && this.eat(h.star) && (u = !0), !a && !l && !u) {
|
|
735
735
|
var g = this.value;
|
|
736
736
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? d = g : a = g);
|
|
737
737
|
}
|
|
738
|
-
if (a ? (r.computed = !1, r.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), r.key.name = a, this.finishNode(r.key, "Identifier")) : this.parseClassElementName(r), e < 13 || this.type === h.parenL || d !== "method" || u ||
|
|
738
|
+
if (a ? (r.computed = !1, r.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), r.key.name = a, this.finishNode(r.key, "Identifier")) : this.parseClassElementName(r), e < 13 || this.type === h.parenL || d !== "method" || u || l) {
|
|
739
739
|
var o = !r.static && Gt(r, "constructor"), w = o && t;
|
|
740
|
-
o && d !== "method" && this.raise(r.key.start, "Constructor can't have get/set modifier"), r.kind = o ? "constructor" : d, this.parseClassMethod(r, u,
|
|
740
|
+
o && d !== "method" && this.raise(r.key.start, "Constructor can't have get/set modifier"), r.kind = o ? "constructor" : d, this.parseClassMethod(r, u, l, w);
|
|
741
741
|
} else
|
|
742
742
|
this.parseClassField(r);
|
|
743
743
|
return r;
|
|
@@ -751,8 +751,8 @@ k.parseClassElementName = function(t) {
|
|
|
751
751
|
k.parseClassMethod = function(t, e, r, a) {
|
|
752
752
|
var u = t.key;
|
|
753
753
|
t.kind === "constructor" ? (e && this.raise(u.start, "Constructor can't be a generator"), r && this.raise(u.start, "Constructor can't be an async method")) : t.static && Gt(t, "prototype") && this.raise(u.start, "Classes may not have a static property named prototype");
|
|
754
|
-
var
|
|
755
|
-
return t.kind === "get" &&
|
|
754
|
+
var l = t.value = this.parseMethod(e, r, a);
|
|
755
|
+
return t.kind === "get" && l.params.length !== 0 && this.raiseRecoverable(l.start, "getter should have no params"), t.kind === "set" && l.params.length !== 1 && this.raiseRecoverable(l.start, "setter should have exactly one param"), t.kind === "set" && l.params[0].type === "RestElement" && this.raiseRecoverable(l.params[0].start, "Setter cannot use rest params"), this.finishNode(t, "MethodDefinition");
|
|
756
756
|
};
|
|
757
757
|
k.parseClassField = function(t) {
|
|
758
758
|
return Gt(t, "constructor") ? this.raise(t.key.start, "Classes can't have a field named 'constructor'") : t.static && Gt(t, "prototype") && this.raise(t.key.start, "Classes can't have a static field named 'prototype'"), this.eat(h.eq) ? (this.enterScope(Bt | Yt), t.value = this.parseMaybeAssign(), this.exitScope()) : t.value = null, this.semicolon(), this.finishNode(t, "PropertyDefinition");
|
|
@@ -779,12 +779,12 @@ k.enterClassBody = function() {
|
|
|
779
779
|
k.exitClassBody = function() {
|
|
780
780
|
var t = this.privateNameStack.pop(), e = t.declared, r = t.used;
|
|
781
781
|
if (this.options.checkPrivateFields)
|
|
782
|
-
for (var a = this.privateNameStack.length, u = a === 0 ? null : this.privateNameStack[a - 1],
|
|
783
|
-
var d = r[
|
|
782
|
+
for (var a = this.privateNameStack.length, u = a === 0 ? null : this.privateNameStack[a - 1], l = 0; l < r.length; ++l) {
|
|
783
|
+
var d = r[l];
|
|
784
784
|
wt(e, d.name) || (u ? u.used.push(d) : this.raiseRecoverable(d.start, "Private field '#" + d.name + "' must be declared in an enclosing class"));
|
|
785
785
|
}
|
|
786
786
|
};
|
|
787
|
-
function
|
|
787
|
+
function zi(t, e) {
|
|
788
788
|
var r = e.key.name, a = t[r], u = "true";
|
|
789
789
|
return e.type === "MethodDefinition" && (e.kind === "get" || e.kind === "set") && (u = (e.static ? "s" : "i") + e.kind), a === "iget" && u === "iset" || a === "iset" && u === "iget" || a === "sget" && u === "sset" || a === "sset" && u === "sget" ? (t[r] = "true", !1) : a ? !0 : (t[r] = u, !1);
|
|
790
790
|
}
|
|
@@ -823,7 +823,7 @@ k.parseExportDefaultDeclaration = function() {
|
|
|
823
823
|
var t;
|
|
824
824
|
if (this.type === h._function || (t = this.isAsyncFunction())) {
|
|
825
825
|
var e = this.startNode();
|
|
826
|
-
return this.next(), t && this.next(), this.parseFunction(e, Rt |
|
|
826
|
+
return this.next(), t && this.next(), this.parseFunction(e, Rt | Ye, !1, t);
|
|
827
827
|
} else if (this.type === h._class) {
|
|
828
828
|
var r = this.startNode();
|
|
829
829
|
return this.parseClass(r, "nullableID");
|
|
@@ -841,8 +841,8 @@ k.checkPatternExport = function(t, e) {
|
|
|
841
841
|
this.checkExport(t, e, e.start);
|
|
842
842
|
else if (r === "ObjectPattern")
|
|
843
843
|
for (var a = 0, u = e.properties; a < u.length; a += 1) {
|
|
844
|
-
var
|
|
845
|
-
this.checkPatternExport(t,
|
|
844
|
+
var l = u[a];
|
|
845
|
+
this.checkPatternExport(t, l);
|
|
846
846
|
}
|
|
847
847
|
else if (r === "ArrayPattern")
|
|
848
848
|
for (var d = 0, v = e.elements; d < v.length; d += 1) {
|
|
@@ -881,7 +881,7 @@ k.parseExportSpecifiers = function(t) {
|
|
|
881
881
|
return e;
|
|
882
882
|
};
|
|
883
883
|
k.parseImport = function(t) {
|
|
884
|
-
return this.next(), this.type === h.string ? (t.specifiers =
|
|
884
|
+
return this.next(), this.type === h.string ? (t.specifiers = Ki, t.source = this.parseExprAtom()) : (t.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), t.source = this.type === h.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (t.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(t, "ImportDeclaration");
|
|
885
885
|
};
|
|
886
886
|
k.parseImportSpecifier = function() {
|
|
887
887
|
var t = this.startNode();
|
|
@@ -932,7 +932,7 @@ k.parseImportAttribute = function() {
|
|
|
932
932
|
k.parseModuleExportName = function() {
|
|
933
933
|
if (this.options.ecmaVersion >= 13 && this.type === h.string) {
|
|
934
934
|
var t = this.parseLiteral(this.value);
|
|
935
|
-
return
|
|
935
|
+
return ji.test(t.value) && this.raise(t.start, "An export name cannot include a lone surrogate."), t;
|
|
936
936
|
}
|
|
937
937
|
return this.parseIdent(!0);
|
|
938
938
|
};
|
|
@@ -959,8 +959,8 @@ ct.toAssignable = function(t, e, r) {
|
|
|
959
959
|
case "ObjectExpression":
|
|
960
960
|
t.type = "ObjectPattern", r && this.checkPatternErrors(r, !0);
|
|
961
961
|
for (var a = 0, u = t.properties; a < u.length; a += 1) {
|
|
962
|
-
var
|
|
963
|
-
this.toAssignable(
|
|
962
|
+
var l = u[a];
|
|
963
|
+
this.toAssignable(l, e), l.type === "RestElement" && (l.argument.type === "ArrayPattern" || l.argument.type === "ObjectPattern") && this.raise(l.argument.start, "Unexpected token");
|
|
964
964
|
}
|
|
965
965
|
break;
|
|
966
966
|
case "Property":
|
|
@@ -996,8 +996,8 @@ ct.toAssignableList = function(t, e) {
|
|
|
996
996
|
u && this.toAssignable(u, e);
|
|
997
997
|
}
|
|
998
998
|
if (r) {
|
|
999
|
-
var
|
|
1000
|
-
this.options.ecmaVersion === 6 && e &&
|
|
999
|
+
var l = t[r - 1];
|
|
1000
|
+
this.options.ecmaVersion === 6 && e && l && l.type === "RestElement" && l.argument.type !== "Identifier" && this.unexpected(l.argument.start);
|
|
1001
1001
|
}
|
|
1002
1002
|
return t;
|
|
1003
1003
|
};
|
|
@@ -1021,8 +1021,8 @@ ct.parseBindingAtom = function() {
|
|
|
1021
1021
|
return this.parseIdent();
|
|
1022
1022
|
};
|
|
1023
1023
|
ct.parseBindingList = function(t, e, r, a) {
|
|
1024
|
-
for (var u = [],
|
|
1025
|
-
if (
|
|
1024
|
+
for (var u = [], l = !0; !this.eat(t); )
|
|
1025
|
+
if (l ? l = !1 : this.expect(h.comma), e && this.type === h.comma)
|
|
1026
1026
|
u.push(null);
|
|
1027
1027
|
else {
|
|
1028
1028
|
if (r && this.afterTrailingComma(t))
|
|
@@ -1054,7 +1054,7 @@ ct.checkLValSimple = function(t, e, r) {
|
|
|
1054
1054
|
var a = e !== Jt;
|
|
1055
1055
|
switch (t.type) {
|
|
1056
1056
|
case "Identifier":
|
|
1057
|
-
this.strict && this.reservedWordsStrictBind.test(t.name) && this.raiseRecoverable(t.start, (a ? "Binding " : "Assigning to ") + t.name + " in strict mode"), a && (e === xt && t.name === "let" && this.raiseRecoverable(t.start, "let is disallowed as a lexically bound name"), r && (wt(r, t.name) && this.raiseRecoverable(t.start, "Argument name clash"), r[t.name] = !0), e !==
|
|
1057
|
+
this.strict && this.reservedWordsStrictBind.test(t.name) && this.raiseRecoverable(t.start, (a ? "Binding " : "Assigning to ") + t.name + " in strict mode"), a && (e === xt && t.name === "let" && this.raiseRecoverable(t.start, "let is disallowed as a lexically bound name"), r && (wt(r, t.name) && this.raiseRecoverable(t.start, "Argument name clash"), r[t.name] = !0), e !== Qe && this.declareName(t.name, e, t.start));
|
|
1058
1058
|
break;
|
|
1059
1059
|
case "ChainExpression":
|
|
1060
1060
|
this.raiseRecoverable(t.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -1072,8 +1072,8 @@ ct.checkLValPattern = function(t, e, r) {
|
|
|
1072
1072
|
switch (e === void 0 && (e = Jt), t.type) {
|
|
1073
1073
|
case "ObjectPattern":
|
|
1074
1074
|
for (var a = 0, u = t.properties; a < u.length; a += 1) {
|
|
1075
|
-
var
|
|
1076
|
-
this.checkLValInnerPattern(
|
|
1075
|
+
var l = u[a];
|
|
1076
|
+
this.checkLValInnerPattern(l, e, r);
|
|
1077
1077
|
}
|
|
1078
1078
|
break;
|
|
1079
1079
|
case "ArrayPattern":
|
|
@@ -1101,8 +1101,8 @@ ct.checkLValInnerPattern = function(t, e, r) {
|
|
|
1101
1101
|
this.checkLValPattern(t, e, r);
|
|
1102
1102
|
}
|
|
1103
1103
|
};
|
|
1104
|
-
var Q = function(e, r, a, u,
|
|
1105
|
-
this.token = e, this.isExpr = !!r, this.preserveSpace = !!a, this.override = u, this.generator = !!
|
|
1104
|
+
var Q = function(e, r, a, u, l) {
|
|
1105
|
+
this.token = e, this.isExpr = !!r, this.preserveSpace = !!a, this.override = u, this.generator = !!l;
|
|
1106
1106
|
}, j = {
|
|
1107
1107
|
b_stat: new Q("{", !1),
|
|
1108
1108
|
b_expr: new Q("{", !0),
|
|
@@ -1196,32 +1196,32 @@ _.checkPropClash = function(t, e, r) {
|
|
|
1196
1196
|
default:
|
|
1197
1197
|
return;
|
|
1198
1198
|
}
|
|
1199
|
-
var
|
|
1199
|
+
var l = t.kind;
|
|
1200
1200
|
if (this.options.ecmaVersion >= 6) {
|
|
1201
|
-
u === "__proto__" &&
|
|
1201
|
+
u === "__proto__" && l === "init" && (e.proto && (r ? r.doubleProto < 0 && (r.doubleProto = a.start) : this.raiseRecoverable(a.start, "Redefinition of __proto__ property")), e.proto = !0);
|
|
1202
1202
|
return;
|
|
1203
1203
|
}
|
|
1204
1204
|
u = "$" + u;
|
|
1205
1205
|
var d = e[u];
|
|
1206
1206
|
if (d) {
|
|
1207
1207
|
var v;
|
|
1208
|
-
|
|
1208
|
+
l === "init" ? v = this.strict && d.init || d.get || d.set : v = d.init || d[l], v && this.raiseRecoverable(a.start, "Redefinition of property");
|
|
1209
1209
|
} else
|
|
1210
1210
|
d = e[u] = {
|
|
1211
1211
|
init: !1,
|
|
1212
1212
|
get: !1,
|
|
1213
1213
|
set: !1
|
|
1214
1214
|
};
|
|
1215
|
-
d[
|
|
1215
|
+
d[l] = !0;
|
|
1216
1216
|
}
|
|
1217
1217
|
};
|
|
1218
1218
|
_.parseExpression = function(t, e) {
|
|
1219
1219
|
var r = this.start, a = this.startLoc, u = this.parseMaybeAssign(t, e);
|
|
1220
1220
|
if (this.type === h.comma) {
|
|
1221
|
-
var
|
|
1222
|
-
for (
|
|
1223
|
-
|
|
1224
|
-
return this.finishNode(
|
|
1221
|
+
var l = this.startNodeAt(r, a);
|
|
1222
|
+
for (l.expressions = [u]; this.eat(h.comma); )
|
|
1223
|
+
l.expressions.push(this.parseMaybeAssign(t, e));
|
|
1224
|
+
return this.finishNode(l, "SequenceExpression");
|
|
1225
1225
|
}
|
|
1226
1226
|
return u;
|
|
1227
1227
|
};
|
|
@@ -1231,8 +1231,8 @@ _.parseMaybeAssign = function(t, e, r) {
|
|
|
1231
1231
|
return this.parseYield(t);
|
|
1232
1232
|
this.exprAllowed = !1;
|
|
1233
1233
|
}
|
|
1234
|
-
var a = !1, u = -1,
|
|
1235
|
-
e ? (u = e.parenthesizedAssign,
|
|
1234
|
+
var a = !1, u = -1, l = -1, d = -1;
|
|
1235
|
+
e ? (u = e.parenthesizedAssign, l = e.trailingComma, d = e.doubleProto, e.parenthesizedAssign = e.trailingComma = -1) : (e = new te(), a = !0);
|
|
1236
1236
|
var v = this.start, g = this.startLoc;
|
|
1237
1237
|
(this.type === h.parenL || this.type === h.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = t === "await");
|
|
1238
1238
|
var o = this.parseMaybeConditional(t, e);
|
|
@@ -1241,15 +1241,15 @@ _.parseMaybeAssign = function(t, e, r) {
|
|
|
1241
1241
|
return w.operator = this.value, this.type === h.eq && (o = this.toAssignable(o, !1, e)), a || (e.parenthesizedAssign = e.trailingComma = e.doubleProto = -1), e.shorthandAssign >= o.start && (e.shorthandAssign = -1), this.type === h.eq ? this.checkLValPattern(o) : this.checkLValSimple(o), w.left = o, this.next(), w.right = this.parseMaybeAssign(t), d > -1 && (e.doubleProto = d), this.finishNode(w, "AssignmentExpression");
|
|
1242
1242
|
} else
|
|
1243
1243
|
a && this.checkExpressionErrors(e, !0);
|
|
1244
|
-
return u > -1 && (e.parenthesizedAssign = u),
|
|
1244
|
+
return u > -1 && (e.parenthesizedAssign = u), l > -1 && (e.trailingComma = l), o;
|
|
1245
1245
|
};
|
|
1246
1246
|
_.parseMaybeConditional = function(t, e) {
|
|
1247
1247
|
var r = this.start, a = this.startLoc, u = this.parseExprOps(t, e);
|
|
1248
1248
|
if (this.checkExpressionErrors(e))
|
|
1249
1249
|
return u;
|
|
1250
1250
|
if (this.eat(h.question)) {
|
|
1251
|
-
var
|
|
1252
|
-
return
|
|
1251
|
+
var l = this.startNodeAt(r, a);
|
|
1252
|
+
return l.test = u, l.consequent = this.parseMaybeAssign(), this.expect(h.colon), l.alternate = this.parseMaybeAssign(t), this.finishNode(l, "ConditionalExpression");
|
|
1253
1253
|
}
|
|
1254
1254
|
return u;
|
|
1255
1255
|
};
|
|
@@ -1258,36 +1258,36 @@ _.parseExprOps = function(t, e) {
|
|
|
1258
1258
|
return this.checkExpressionErrors(e) || u.start === r && u.type === "ArrowFunctionExpression" ? u : this.parseExprOp(u, r, a, -1, t);
|
|
1259
1259
|
};
|
|
1260
1260
|
_.parseExprOp = function(t, e, r, a, u) {
|
|
1261
|
-
var
|
|
1262
|
-
if (
|
|
1261
|
+
var l = this.type.binop;
|
|
1262
|
+
if (l != null && (!u || this.type !== h._in) && l > a) {
|
|
1263
1263
|
var d = this.type === h.logicalOR || this.type === h.logicalAND, v = this.type === h.coalesce;
|
|
1264
|
-
v && (
|
|
1264
|
+
v && (l = h.logicalAND.binop);
|
|
1265
1265
|
var g = this.value;
|
|
1266
1266
|
this.next();
|
|
1267
|
-
var o = this.start, w = this.startLoc, L = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, u), o, w,
|
|
1267
|
+
var o = this.start, w = this.startLoc, L = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, u), o, w, l, u), F = this.buildBinary(e, r, t, L, g, d || v);
|
|
1268
1268
|
return (d && this.type === h.coalesce || v && (this.type === h.logicalOR || this.type === h.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(F, e, r, a, u);
|
|
1269
1269
|
}
|
|
1270
1270
|
return t;
|
|
1271
1271
|
};
|
|
1272
|
-
_.buildBinary = function(t, e, r, a, u,
|
|
1272
|
+
_.buildBinary = function(t, e, r, a, u, l) {
|
|
1273
1273
|
a.type === "PrivateIdentifier" && this.raise(a.start, "Private identifier can only be left side of binary expression");
|
|
1274
1274
|
var d = this.startNodeAt(t, e);
|
|
1275
|
-
return d.left = r, d.operator = u, d.right = a, this.finishNode(d,
|
|
1275
|
+
return d.left = r, d.operator = u, d.right = a, this.finishNode(d, l ? "LogicalExpression" : "BinaryExpression");
|
|
1276
1276
|
};
|
|
1277
1277
|
_.parseMaybeUnary = function(t, e, r, a) {
|
|
1278
|
-
var u = this.start,
|
|
1278
|
+
var u = this.start, l = this.startLoc, d;
|
|
1279
1279
|
if (this.isContextual("await") && this.canAwait)
|
|
1280
1280
|
d = this.parseAwait(a), e = !0;
|
|
1281
1281
|
else if (this.type.prefix) {
|
|
1282
1282
|
var v = this.startNode(), g = this.type === h.incDec;
|
|
1283
|
-
v.operator = this.value, v.prefix = !0, this.next(), v.argument = this.parseMaybeUnary(null, !0, g, a), this.checkExpressionErrors(t, !0), g ? this.checkLValSimple(v.argument) : this.strict && v.operator === "delete" &&
|
|
1283
|
+
v.operator = this.value, v.prefix = !0, this.next(), v.argument = this.parseMaybeUnary(null, !0, g, a), this.checkExpressionErrors(t, !0), g ? this.checkLValSimple(v.argument) : this.strict && v.operator === "delete" && Ze(v.argument) ? this.raiseRecoverable(v.start, "Deleting local variable in strict mode") : v.operator === "delete" && de(v.argument) ? this.raiseRecoverable(v.start, "Private fields can not be deleted") : e = !0, d = this.finishNode(v, g ? "UpdateExpression" : "UnaryExpression");
|
|
1284
1284
|
} else if (!e && this.type === h.privateId)
|
|
1285
1285
|
(a || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), d = this.parsePrivateIdent(), this.type !== h._in && this.unexpected();
|
|
1286
1286
|
else {
|
|
1287
1287
|
if (d = this.parseExprSubscripts(t, a), this.checkExpressionErrors(t))
|
|
1288
1288
|
return d;
|
|
1289
1289
|
for (; this.type.postfix && !this.canInsertSemicolon(); ) {
|
|
1290
|
-
var o = this.startNodeAt(u,
|
|
1290
|
+
var o = this.startNodeAt(u, l);
|
|
1291
1291
|
o.operator = this.value, o.prefix = !1, o.argument = d, this.checkLValSimple(d), this.next(), d = this.finishNode(o, "UpdateExpression");
|
|
1292
1292
|
}
|
|
1293
1293
|
}
|
|
@@ -1295,12 +1295,12 @@ _.parseMaybeUnary = function(t, e, r, a) {
|
|
|
1295
1295
|
if (e)
|
|
1296
1296
|
this.unexpected(this.lastTokStart);
|
|
1297
1297
|
else
|
|
1298
|
-
return this.buildBinary(u,
|
|
1298
|
+
return this.buildBinary(u, l, d, this.parseMaybeUnary(null, !1, !1, a), "**", !1);
|
|
1299
1299
|
else
|
|
1300
1300
|
return d;
|
|
1301
1301
|
};
|
|
1302
|
-
function
|
|
1303
|
-
return t.type === "Identifier" || t.type === "ParenthesizedExpression" &&
|
|
1302
|
+
function Ze(t) {
|
|
1303
|
+
return t.type === "Identifier" || t.type === "ParenthesizedExpression" && Ze(t.expression);
|
|
1304
1304
|
}
|
|
1305
1305
|
function de(t) {
|
|
1306
1306
|
return t.type === "MemberExpression" && t.property.type === "PrivateIdentifier" || t.type === "ChainExpression" && de(t.expression) || t.type === "ParenthesizedExpression" && de(t.expression);
|
|
@@ -1309,12 +1309,12 @@ _.parseExprSubscripts = function(t, e) {
|
|
|
1309
1309
|
var r = this.start, a = this.startLoc, u = this.parseExprAtom(t, e);
|
|
1310
1310
|
if (u.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
|
|
1311
1311
|
return u;
|
|
1312
|
-
var
|
|
1313
|
-
return t &&
|
|
1312
|
+
var l = this.parseSubscripts(u, r, a, !1, e);
|
|
1313
|
+
return t && l.type === "MemberExpression" && (t.parenthesizedAssign >= l.start && (t.parenthesizedAssign = -1), t.parenthesizedBind >= l.start && (t.parenthesizedBind = -1), t.trailingComma >= l.start && (t.trailingComma = -1)), l;
|
|
1314
1314
|
};
|
|
1315
1315
|
_.parseSubscripts = function(t, e, r, a, u) {
|
|
1316
|
-
for (var
|
|
1317
|
-
var v = this.parseSubscript(t, e, r, a,
|
|
1316
|
+
for (var l = this.options.ecmaVersion >= 8 && t.type === "Identifier" && t.name === "async" && this.lastTokEnd === t.end && !this.canInsertSemicolon() && t.end - t.start === 5 && this.potentialArrowAt === t.start, d = !1; ; ) {
|
|
1317
|
+
var v = this.parseSubscript(t, e, r, a, l, d, u);
|
|
1318
1318
|
if (v.optional && (d = !0), v === t || v.type === "ArrowFunctionExpression") {
|
|
1319
1319
|
if (d) {
|
|
1320
1320
|
var g = this.startNodeAt(e, r);
|
|
@@ -1331,7 +1331,7 @@ _.shouldParseAsyncArrow = function() {
|
|
|
1331
1331
|
_.parseSubscriptAsyncArrow = function(t, e, r, a) {
|
|
1332
1332
|
return this.parseArrowExpression(this.startNodeAt(t, e), r, !0, a);
|
|
1333
1333
|
};
|
|
1334
|
-
_.parseSubscript = function(t, e, r, a, u,
|
|
1334
|
+
_.parseSubscript = function(t, e, r, a, u, l, d) {
|
|
1335
1335
|
var v = this.options.ecmaVersion >= 11, g = v && this.eat(h.questionDot);
|
|
1336
1336
|
a && g && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
1337
1337
|
var o = this.eat(h.bracketL);
|
|
@@ -1339,16 +1339,16 @@ _.parseSubscript = function(t, e, r, a, u, f, d) {
|
|
|
1339
1339
|
var w = this.startNodeAt(e, r);
|
|
1340
1340
|
w.object = t, o ? (w.property = this.parseExpression(), this.expect(h.bracketR)) : this.type === h.privateId && t.type !== "Super" ? w.property = this.parsePrivateIdent() : w.property = this.parseIdent(this.options.allowReserved !== "never"), w.computed = !!o, v && (w.optional = g), t = this.finishNode(w, "MemberExpression");
|
|
1341
1341
|
} else if (!a && this.eat(h.parenL)) {
|
|
1342
|
-
var L = new te(), F = this.yieldPos,
|
|
1342
|
+
var L = new te(), F = this.yieldPos, z = this.awaitPos, G = this.awaitIdentPos;
|
|
1343
1343
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
1344
1344
|
var st = this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1, L);
|
|
1345
1345
|
if (u && !g && this.shouldParseAsyncArrow())
|
|
1346
|
-
return this.checkPatternErrors(L, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = F, this.awaitPos =
|
|
1347
|
-
this.checkExpressionErrors(L, !0), this.yieldPos = F || this.yieldPos, this.awaitPos =
|
|
1346
|
+
return this.checkPatternErrors(L, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = F, this.awaitPos = z, this.awaitIdentPos = G, this.parseSubscriptAsyncArrow(e, r, st, d);
|
|
1347
|
+
this.checkExpressionErrors(L, !0), this.yieldPos = F || this.yieldPos, this.awaitPos = z || this.awaitPos, this.awaitIdentPos = G || this.awaitIdentPos;
|
|
1348
1348
|
var I = this.startNodeAt(e, r);
|
|
1349
1349
|
I.callee = t, I.arguments = st, v && (I.optional = g), t = this.finishNode(I, "CallExpression");
|
|
1350
1350
|
} else if (this.type === h.backQuote) {
|
|
1351
|
-
(g ||
|
|
1351
|
+
(g || l) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
1352
1352
|
var tt = this.startNodeAt(e, r);
|
|
1353
1353
|
tt.tag = t, tt.quasi = this.parseTemplate({ isTagged: !0 }), t = this.finishNode(tt, "TaggedTemplateExpression");
|
|
1354
1354
|
}
|
|
@@ -1363,14 +1363,14 @@ _.parseExprAtom = function(t, e, r) {
|
|
|
1363
1363
|
case h._this:
|
|
1364
1364
|
return a = this.startNode(), this.next(), this.finishNode(a, "ThisExpression");
|
|
1365
1365
|
case h.name:
|
|
1366
|
-
var
|
|
1366
|
+
var l = this.start, d = this.startLoc, v = this.containsEsc, g = this.parseIdent(!1);
|
|
1367
1367
|
if (this.options.ecmaVersion >= 8 && !v && g.name === "async" && !this.canInsertSemicolon() && this.eat(h._function))
|
|
1368
|
-
return this.overrideContext(j.f_expr), this.parseFunction(this.startNodeAt(
|
|
1368
|
+
return this.overrideContext(j.f_expr), this.parseFunction(this.startNodeAt(l, d), 0, !1, !0, e);
|
|
1369
1369
|
if (u && !this.canInsertSemicolon()) {
|
|
1370
1370
|
if (this.eat(h.arrow))
|
|
1371
|
-
return this.parseArrowExpression(this.startNodeAt(
|
|
1371
|
+
return this.parseArrowExpression(this.startNodeAt(l, d), [g], !1, e);
|
|
1372
1372
|
if (this.options.ecmaVersion >= 8 && g.name === "async" && this.type === h.name && !v && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc))
|
|
1373
|
-
return g = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(h.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(
|
|
1373
|
+
return g = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(h.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(l, d), [g], !0, e);
|
|
1374
1374
|
}
|
|
1375
1375
|
return g;
|
|
1376
1376
|
case h.regexp:
|
|
@@ -1444,16 +1444,16 @@ _.shouldParseArrow = function(t) {
|
|
|
1444
1444
|
return !this.canInsertSemicolon();
|
|
1445
1445
|
};
|
|
1446
1446
|
_.parseParenAndDistinguishExpression = function(t, e) {
|
|
1447
|
-
var r = this.start, a = this.startLoc, u,
|
|
1447
|
+
var r = this.start, a = this.startLoc, u, l = this.options.ecmaVersion >= 8;
|
|
1448
1448
|
if (this.options.ecmaVersion >= 6) {
|
|
1449
1449
|
this.next();
|
|
1450
|
-
var d = this.start, v = this.startLoc, g = [], o = !0, w = !1, L = new te(), F = this.yieldPos,
|
|
1450
|
+
var d = this.start, v = this.startLoc, g = [], o = !0, w = !1, L = new te(), F = this.yieldPos, z = this.awaitPos, G;
|
|
1451
1451
|
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== h.parenR; )
|
|
1452
|
-
if (o ? o = !1 : this.expect(h.comma),
|
|
1452
|
+
if (o ? o = !1 : this.expect(h.comma), l && this.afterTrailingComma(h.parenR, !0)) {
|
|
1453
1453
|
w = !0;
|
|
1454
1454
|
break;
|
|
1455
1455
|
} else if (this.type === h.ellipsis) {
|
|
1456
|
-
|
|
1456
|
+
G = this.start, g.push(this.parseParenItem(this.parseRestBinding())), this.type === h.comma && this.raiseRecoverable(
|
|
1457
1457
|
this.start,
|
|
1458
1458
|
"Comma is not permitted after the rest element"
|
|
1459
1459
|
);
|
|
@@ -1462,8 +1462,8 @@ _.parseParenAndDistinguishExpression = function(t, e) {
|
|
|
1462
1462
|
g.push(this.parseMaybeAssign(!1, L, this.parseParenItem));
|
|
1463
1463
|
var st = this.lastTokEnd, I = this.lastTokEndLoc;
|
|
1464
1464
|
if (this.expect(h.parenR), t && this.shouldParseArrow(g) && this.eat(h.arrow))
|
|
1465
|
-
return this.checkPatternErrors(L, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = F, this.awaitPos =
|
|
1466
|
-
(!g.length || w) && this.unexpected(this.lastTokStart),
|
|
1465
|
+
return this.checkPatternErrors(L, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = F, this.awaitPos = z, this.parseParenArrowList(r, a, g, e);
|
|
1466
|
+
(!g.length || w) && this.unexpected(this.lastTokStart), G && this.unexpected(G), this.checkExpressionErrors(L, !0), this.yieldPos = F || this.yieldPos, this.awaitPos = z || this.awaitPos, g.length > 1 ? (u = this.startNodeAt(d, v), u.expressions = g, this.finishNodeAt(u, "SequenceExpression", st, I)) : u = g[0];
|
|
1467
1467
|
} else
|
|
1468
1468
|
u = this.parseParenExpression();
|
|
1469
1469
|
if (this.options.preserveParens) {
|
|
@@ -1478,7 +1478,7 @@ _.parseParenItem = function(t) {
|
|
|
1478
1478
|
_.parseParenArrowList = function(t, e, r, a) {
|
|
1479
1479
|
return this.parseArrowExpression(this.startNodeAt(t, e), r, !1, a);
|
|
1480
1480
|
};
|
|
1481
|
-
var
|
|
1481
|
+
var Ji = [];
|
|
1482
1482
|
_.parseNew = function() {
|
|
1483
1483
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
1484
1484
|
var t = this.startNode();
|
|
@@ -1489,7 +1489,7 @@ _.parseNew = function() {
|
|
|
1489
1489
|
return t.property = this.parseIdent(!0), t.property.name !== "target" && this.raiseRecoverable(t.property.start, "The only valid meta property for new is 'new.target'"), r && this.raiseRecoverable(t.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(t.start, "'new.target' can only be used in functions and class static block"), this.finishNode(t, "MetaProperty");
|
|
1490
1490
|
}
|
|
1491
1491
|
var a = this.start, u = this.startLoc;
|
|
1492
|
-
return t.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), a, u, !0, !1), this.eat(h.parenL) ? t.arguments = this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1) : t.arguments =
|
|
1492
|
+
return t.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), a, u, !0, !1), this.eat(h.parenL) ? t.arguments = this.parseExprList(h.parenR, this.options.ecmaVersion >= 8, !1) : t.arguments = Ji, this.finishNode(t, "NewExpression");
|
|
1493
1493
|
};
|
|
1494
1494
|
_.parseTemplateElement = function(t) {
|
|
1495
1495
|
var e = t.isTagged, r = this.startNode();
|
|
@@ -1524,18 +1524,18 @@ _.parseObj = function(t, e) {
|
|
|
1524
1524
|
a = !1;
|
|
1525
1525
|
else if (this.expect(h.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(h.braceR))
|
|
1526
1526
|
break;
|
|
1527
|
-
var
|
|
1528
|
-
t || this.checkPropClash(
|
|
1527
|
+
var l = this.parseProperty(t, e);
|
|
1528
|
+
t || this.checkPropClash(l, u, e), r.properties.push(l);
|
|
1529
1529
|
}
|
|
1530
1530
|
return this.finishNode(r, t ? "ObjectPattern" : "ObjectExpression");
|
|
1531
1531
|
};
|
|
1532
1532
|
_.parseProperty = function(t, e) {
|
|
1533
|
-
var r = this.startNode(), a, u,
|
|
1533
|
+
var r = this.startNode(), a, u, l, d;
|
|
1534
1534
|
if (this.options.ecmaVersion >= 9 && this.eat(h.ellipsis))
|
|
1535
1535
|
return t ? (r.argument = this.parseIdent(!1), this.type === h.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(r, "RestElement")) : (r.argument = this.parseMaybeAssign(!1, e), this.type === h.comma && e && e.trailingComma < 0 && (e.trailingComma = this.start), this.finishNode(r, "SpreadElement"));
|
|
1536
|
-
this.options.ecmaVersion >= 6 && (r.method = !1, r.shorthand = !1, (t || e) && (
|
|
1536
|
+
this.options.ecmaVersion >= 6 && (r.method = !1, r.shorthand = !1, (t || e) && (l = this.start, d = this.startLoc), t || (a = this.eat(h.star)));
|
|
1537
1537
|
var v = this.containsEsc;
|
|
1538
|
-
return this.parsePropertyName(r), !t && !v && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(r) ? (u = !0, a = this.options.ecmaVersion >= 9 && this.eat(h.star), this.parsePropertyName(r)) : u = !1, this.parsePropertyValue(r, t, a, u,
|
|
1538
|
+
return this.parsePropertyName(r), !t && !v && this.options.ecmaVersion >= 8 && !a && this.isAsyncProp(r) ? (u = !0, a = this.options.ecmaVersion >= 9 && this.eat(h.star), this.parsePropertyName(r)) : u = !1, this.parsePropertyValue(r, t, a, u, l, d, e, v), this.finishNode(r, "Property");
|
|
1539
1539
|
};
|
|
1540
1540
|
_.parseGetterSetter = function(t) {
|
|
1541
1541
|
var e = t.key.name;
|
|
@@ -1547,8 +1547,8 @@ _.parseGetterSetter = function(t) {
|
|
|
1547
1547
|
} else
|
|
1548
1548
|
t.kind === "set" && t.value.params[0].type === "RestElement" && this.raiseRecoverable(t.value.params[0].start, "Setter cannot use rest params");
|
|
1549
1549
|
};
|
|
1550
|
-
_.parsePropertyValue = function(t, e, r, a, u,
|
|
1551
|
-
(r || a) && this.type === h.colon && this.unexpected(), this.eat(h.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === h.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(r, a), t.kind = "init") : !e && !v && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== h.comma && this.type !== h.braceR && this.type !== h.eq ? ((r || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((r || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = u), e ? t.value = this.parseMaybeDefault(u,
|
|
1550
|
+
_.parsePropertyValue = function(t, e, r, a, u, l, d, v) {
|
|
1551
|
+
(r || a) && this.type === h.colon && this.unexpected(), this.eat(h.colon) ? (t.value = e ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, d), t.kind = "init") : this.options.ecmaVersion >= 6 && this.type === h.parenL ? (e && this.unexpected(), t.method = !0, t.value = this.parseMethod(r, a), t.kind = "init") : !e && !v && this.options.ecmaVersion >= 5 && !t.computed && t.key.type === "Identifier" && (t.key.name === "get" || t.key.name === "set") && this.type !== h.comma && this.type !== h.braceR && this.type !== h.eq ? ((r || a) && this.unexpected(), this.parseGetterSetter(t)) : this.options.ecmaVersion >= 6 && !t.computed && t.key.type === "Identifier" ? ((r || a) && this.unexpected(), this.checkUnreserved(t.key), t.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = u), e ? t.value = this.parseMaybeDefault(u, l, this.copyNode(t.key)) : this.type === h.eq && d ? (d.shorthandAssign < 0 && (d.shorthandAssign = this.start), t.value = this.parseMaybeDefault(u, l, this.copyNode(t.key))) : t.value = this.copyNode(t.key), t.kind = "init", t.shorthand = !0) : this.unexpected();
|
|
1552
1552
|
};
|
|
1553
1553
|
_.parsePropertyName = function(t) {
|
|
1554
1554
|
if (this.options.ecmaVersion >= 6) {
|
|
@@ -1562,22 +1562,22 @@ _.initFunction = function(t) {
|
|
|
1562
1562
|
t.id = null, this.options.ecmaVersion >= 6 && (t.generator = t.expression = !1), this.options.ecmaVersion >= 8 && (t.async = !1);
|
|
1563
1563
|
};
|
|
1564
1564
|
_.parseMethod = function(t, e, r) {
|
|
1565
|
-
var a = this.startNode(), u = this.yieldPos,
|
|
1566
|
-
return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = t), this.options.ecmaVersion >= 8 && (a.async = !!e), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(e, a.generator) | Yt | (r ?
|
|
1565
|
+
var a = this.startNode(), u = this.yieldPos, l = this.awaitPos, d = this.awaitIdentPos;
|
|
1566
|
+
return this.initFunction(a), this.options.ecmaVersion >= 6 && (a.generator = t), this.options.ecmaVersion >= 8 && (a.async = !!e), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Se(e, a.generator) | Yt | (r ? Ge : 0)), this.expect(h.parenL), a.params = this.parseBindingList(h.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(a, !1, !0, !1), this.yieldPos = u, this.awaitPos = l, this.awaitIdentPos = d, this.finishNode(a, "FunctionExpression");
|
|
1567
1567
|
};
|
|
1568
1568
|
_.parseArrowExpression = function(t, e, r, a) {
|
|
1569
|
-
var u = this.yieldPos,
|
|
1570
|
-
return this.enterScope(Se(r, !1) | be), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos = u, this.awaitPos =
|
|
1569
|
+
var u = this.yieldPos, l = this.awaitPos, d = this.awaitIdentPos;
|
|
1570
|
+
return this.enterScope(Se(r, !1) | be), this.initFunction(t), this.options.ecmaVersion >= 8 && (t.async = !!r), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, t.params = this.toAssignableList(e, !0), this.parseFunctionBody(t, !0, !1, a), this.yieldPos = u, this.awaitPos = l, this.awaitIdentPos = d, this.finishNode(t, "ArrowFunctionExpression");
|
|
1571
1571
|
};
|
|
1572
1572
|
_.parseFunctionBody = function(t, e, r, a) {
|
|
1573
|
-
var u = e && this.type !== h.braceL,
|
|
1573
|
+
var u = e && this.type !== h.braceL, l = this.strict, d = !1;
|
|
1574
1574
|
if (u)
|
|
1575
1575
|
t.body = this.parseMaybeAssign(a), t.expression = !0, this.checkParams(t, !1);
|
|
1576
1576
|
else {
|
|
1577
1577
|
var v = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(t.params);
|
|
1578
|
-
(!
|
|
1578
|
+
(!l || v) && (d = this.strictDirective(this.end), d && v && this.raiseRecoverable(t.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
1579
1579
|
var g = this.labels;
|
|
1580
|
-
this.labels = [], d && (this.strict = !0), this.checkParams(t, !
|
|
1580
|
+
this.labels = [], d && (this.strict = !0), this.checkParams(t, !l && !d && !e && !r && this.isSimpleParamList(t.params)), this.strict && t.id && this.checkLValSimple(t.id, Qe), t.body = this.parseBlock(!1, void 0, d && !l), t.expression = !1, this.adaptDirectivePrologue(t.body.body), this.labels = g;
|
|
1581
1581
|
}
|
|
1582
1582
|
this.exitScope();
|
|
1583
1583
|
};
|
|
@@ -1591,14 +1591,14 @@ _.isSimpleParamList = function(t) {
|
|
|
1591
1591
|
};
|
|
1592
1592
|
_.checkParams = function(t, e) {
|
|
1593
1593
|
for (var r = /* @__PURE__ */ Object.create(null), a = 0, u = t.params; a < u.length; a += 1) {
|
|
1594
|
-
var
|
|
1595
|
-
this.checkLValInnerPattern(
|
|
1594
|
+
var l = u[a];
|
|
1595
|
+
this.checkLValInnerPattern(l, Te, e ? null : r);
|
|
1596
1596
|
}
|
|
1597
1597
|
};
|
|
1598
1598
|
_.parseExprList = function(t, e, r, a) {
|
|
1599
|
-
for (var u = [],
|
|
1600
|
-
if (
|
|
1601
|
-
|
|
1599
|
+
for (var u = [], l = !0; !this.eat(t); ) {
|
|
1600
|
+
if (l)
|
|
1601
|
+
l = !1;
|
|
1602
1602
|
else if (this.expect(h.comma), e && this.afterTrailingComma(t))
|
|
1603
1603
|
break;
|
|
1604
1604
|
var d = void 0;
|
|
@@ -1647,11 +1647,11 @@ $t.curPosition = function() {
|
|
|
1647
1647
|
if (this.options.locations)
|
|
1648
1648
|
return new At(this.curLine, this.pos - this.lineStart);
|
|
1649
1649
|
};
|
|
1650
|
-
var St = W.prototype,
|
|
1650
|
+
var St = W.prototype, Gi = function(e) {
|
|
1651
1651
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
1652
1652
|
};
|
|
1653
1653
|
St.enterScope = function(t) {
|
|
1654
|
-
this.scopeStack.push(new
|
|
1654
|
+
this.scopeStack.push(new Gi(t));
|
|
1655
1655
|
};
|
|
1656
1656
|
St.exitScope = function() {
|
|
1657
1657
|
this.scopeStack.pop();
|
|
@@ -1664,16 +1664,16 @@ St.declareName = function(t, e, r) {
|
|
|
1664
1664
|
if (e === xt) {
|
|
1665
1665
|
var u = this.currentScope();
|
|
1666
1666
|
a = u.lexical.indexOf(t) > -1 || u.functions.indexOf(t) > -1 || u.var.indexOf(t) > -1, u.lexical.push(t), this.inModule && u.flags & Vt && delete this.undefinedExports[t];
|
|
1667
|
-
} else if (e === Qe) {
|
|
1668
|
-
var f = this.currentScope();
|
|
1669
|
-
f.lexical.push(t);
|
|
1670
1667
|
} else if (e === Xe) {
|
|
1668
|
+
var l = this.currentScope();
|
|
1669
|
+
l.lexical.push(t);
|
|
1670
|
+
} else if (e === $e) {
|
|
1671
1671
|
var d = this.currentScope();
|
|
1672
1672
|
this.treatFunctionsAsVar ? a = d.lexical.indexOf(t) > -1 : a = d.lexical.indexOf(t) > -1 || d.var.indexOf(t) > -1, d.functions.push(t);
|
|
1673
1673
|
} else
|
|
1674
1674
|
for (var v = this.scopeStack.length - 1; v >= 0; --v) {
|
|
1675
1675
|
var g = this.scopeStack[v];
|
|
1676
|
-
if (g.lexical.indexOf(t) > -1 && !(g.flags &
|
|
1676
|
+
if (g.lexical.indexOf(t) > -1 && !(g.flags & Je && g.lexical[0] === t) || !this.treatFunctionsAsVarInScope(g) && g.functions.indexOf(t) > -1) {
|
|
1677
1677
|
a = !0;
|
|
1678
1678
|
break;
|
|
1679
1679
|
}
|
|
@@ -1711,14 +1711,14 @@ Ut.startNode = function() {
|
|
|
1711
1711
|
Ut.startNodeAt = function(t, e) {
|
|
1712
1712
|
return new jt(this, t, e);
|
|
1713
1713
|
};
|
|
1714
|
-
function
|
|
1714
|
+
function ti(t, e, r, a) {
|
|
1715
1715
|
return t.type = e, t.end = r, this.options.locations && (t.loc.end = a), this.options.ranges && (t.range[1] = r), t;
|
|
1716
1716
|
}
|
|
1717
1717
|
Ut.finishNode = function(t, e) {
|
|
1718
|
-
return
|
|
1718
|
+
return ti.call(this, t, e, this.lastTokEnd, this.lastTokEndLoc);
|
|
1719
1719
|
};
|
|
1720
1720
|
Ut.finishNodeAt = function(t, e, r, a) {
|
|
1721
|
-
return
|
|
1721
|
+
return ti.call(this, t, e, r, a);
|
|
1722
1722
|
};
|
|
1723
1723
|
Ut.copyNode = function(t) {
|
|
1724
1724
|
var e = new jt(this, t.start, this.startLoc);
|
|
@@ -1726,42 +1726,42 @@ Ut.copyNode = function(t) {
|
|
|
1726
1726
|
e[r] = t[r];
|
|
1727
1727
|
return e;
|
|
1728
1728
|
};
|
|
1729
|
-
var
|
|
1730
|
-
9:
|
|
1731
|
-
10:
|
|
1732
|
-
11:
|
|
1733
|
-
12:
|
|
1734
|
-
13:
|
|
1735
|
-
14:
|
|
1736
|
-
},
|
|
1729
|
+
var $i = "Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sunu Sunuwar Todhri Todr Tulu_Tigalari Tutg Unknown Zzzz", ei = "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", ii = ei + " Extended_Pictographic", si = ii, ri = si + " EBase EComp EMod EPres ExtPict", ai = ri, Xi = ai, Qi = {
|
|
1730
|
+
9: ei,
|
|
1731
|
+
10: ii,
|
|
1732
|
+
11: si,
|
|
1733
|
+
12: ri,
|
|
1734
|
+
13: ai,
|
|
1735
|
+
14: Xi
|
|
1736
|
+
}, Yi = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji", Zi = {
|
|
1737
1737
|
9: "",
|
|
1738
1738
|
10: "",
|
|
1739
1739
|
11: "",
|
|
1740
1740
|
12: "",
|
|
1741
1741
|
13: "",
|
|
1742
|
-
14:
|
|
1743
|
-
}, Le = "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",
|
|
1744
|
-
9:
|
|
1745
|
-
10:
|
|
1746
|
-
11:
|
|
1747
|
-
12:
|
|
1748
|
-
13:
|
|
1749
|
-
14:
|
|
1750
|
-
},
|
|
1751
|
-
function
|
|
1752
|
-
var e =
|
|
1753
|
-
binary: bt(
|
|
1754
|
-
binaryOfStrings: bt(
|
|
1742
|
+
14: Yi
|
|
1743
|
+
}, Le = "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", ni = "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", oi = ni + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", hi = oi + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", ui = hi + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", ci = ui + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", ts = ci + " " + $i, es = {
|
|
1744
|
+
9: ni,
|
|
1745
|
+
10: oi,
|
|
1746
|
+
11: hi,
|
|
1747
|
+
12: ui,
|
|
1748
|
+
13: ci,
|
|
1749
|
+
14: ts
|
|
1750
|
+
}, pi = {};
|
|
1751
|
+
function is(t) {
|
|
1752
|
+
var e = pi[t] = {
|
|
1753
|
+
binary: bt(Qi[t] + " " + Le),
|
|
1754
|
+
binaryOfStrings: bt(Zi[t]),
|
|
1755
1755
|
nonBinary: {
|
|
1756
1756
|
General_Category: bt(Le),
|
|
1757
|
-
Script: bt(
|
|
1757
|
+
Script: bt(es[t])
|
|
1758
1758
|
}
|
|
1759
1759
|
};
|
|
1760
1760
|
e.nonBinary.Script_Extensions = e.nonBinary.Script, e.nonBinary.gc = e.nonBinary.General_Category, e.nonBinary.sc = e.nonBinary.Script, e.nonBinary.scx = e.nonBinary.Script_Extensions;
|
|
1761
1761
|
}
|
|
1762
1762
|
for (var ue = 0, Oe = [9, 10, 11, 12, 13, 14]; ue < Oe.length; ue += 1) {
|
|
1763
|
-
var
|
|
1764
|
-
ss
|
|
1763
|
+
var ss = Oe[ue];
|
|
1764
|
+
is(ss);
|
|
1765
1765
|
}
|
|
1766
1766
|
var P = W.prototype, Xt = function(e, r) {
|
|
1767
1767
|
this.parent = e, this.base = r || this;
|
|
@@ -1777,11 +1777,11 @@ Xt.prototype.sibling = function() {
|
|
|
1777
1777
|
return new Xt(this.parent, this.base);
|
|
1778
1778
|
};
|
|
1779
1779
|
var ft = function(e) {
|
|
1780
|
-
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 =
|
|
1780
|
+
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 = pi[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 = /* @__PURE__ */ Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
1781
1781
|
};
|
|
1782
1782
|
ft.prototype.reset = function(e, r, a) {
|
|
1783
|
-
var u = a.indexOf("v") !== -1,
|
|
1784
|
-
this.start = e | 0, this.source = r + "", this.flags = a, u && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU =
|
|
1783
|
+
var u = a.indexOf("v") !== -1, l = a.indexOf("u") !== -1;
|
|
1784
|
+
this.start = e | 0, this.source = r + "", this.flags = a, u && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = l && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = l && this.parser.options.ecmaVersion >= 9);
|
|
1785
1785
|
};
|
|
1786
1786
|
ft.prototype.raise = function(e) {
|
|
1787
1787
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
@@ -1791,19 +1791,19 @@ ft.prototype.at = function(e, r) {
|
|
|
1791
1791
|
var a = this.source, u = a.length;
|
|
1792
1792
|
if (e >= u)
|
|
1793
1793
|
return -1;
|
|
1794
|
-
var
|
|
1795
|
-
if (!(r || this.switchU) ||
|
|
1796
|
-
return
|
|
1794
|
+
var l = a.charCodeAt(e);
|
|
1795
|
+
if (!(r || this.switchU) || l <= 55295 || l >= 57344 || e + 1 >= u)
|
|
1796
|
+
return l;
|
|
1797
1797
|
var d = a.charCodeAt(e + 1);
|
|
1798
|
-
return d >= 56320 && d <= 57343 ? (
|
|
1798
|
+
return d >= 56320 && d <= 57343 ? (l << 10) + d - 56613888 : l;
|
|
1799
1799
|
};
|
|
1800
1800
|
ft.prototype.nextIndex = function(e, r) {
|
|
1801
1801
|
r === void 0 && (r = !1);
|
|
1802
1802
|
var a = this.source, u = a.length;
|
|
1803
1803
|
if (e >= u)
|
|
1804
1804
|
return u;
|
|
1805
|
-
var
|
|
1806
|
-
return !(r || this.switchU) ||
|
|
1805
|
+
var l = a.charCodeAt(e), d;
|
|
1806
|
+
return !(r || this.switchU) || l <= 55295 || l >= 57344 || e + 1 >= u || (d = a.charCodeAt(e + 1)) < 56320 || d > 57343 ? e + 1 : e + 2;
|
|
1807
1807
|
};
|
|
1808
1808
|
ft.prototype.current = function(e) {
|
|
1809
1809
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
@@ -1819,8 +1819,8 @@ ft.prototype.eat = function(e, r) {
|
|
|
1819
1819
|
};
|
|
1820
1820
|
ft.prototype.eatChars = function(e, r) {
|
|
1821
1821
|
r === void 0 && (r = !1);
|
|
1822
|
-
for (var a = this.pos, u = 0,
|
|
1823
|
-
var d =
|
|
1822
|
+
for (var a = this.pos, u = 0, l = e; u < l.length; u += 1) {
|
|
1823
|
+
var d = l[u], v = this.at(a, r);
|
|
1824
1824
|
if (v === -1 || v !== d)
|
|
1825
1825
|
return !1;
|
|
1826
1826
|
a = this.nextIndex(a, r);
|
|
@@ -1828,19 +1828,19 @@ ft.prototype.eatChars = function(e, r) {
|
|
|
1828
1828
|
return this.pos = a, !0;
|
|
1829
1829
|
};
|
|
1830
1830
|
P.validateRegExpFlags = function(t) {
|
|
1831
|
-
for (var e = t.validFlags, r = t.flags, a = !1, u = !1,
|
|
1832
|
-
var d = r.charAt(
|
|
1833
|
-
e.indexOf(d) === -1 && this.raise(t.start, "Invalid regular expression flag"), r.indexOf(d,
|
|
1831
|
+
for (var e = t.validFlags, r = t.flags, a = !1, u = !1, l = 0; l < r.length; l++) {
|
|
1832
|
+
var d = r.charAt(l);
|
|
1833
|
+
e.indexOf(d) === -1 && this.raise(t.start, "Invalid regular expression flag"), r.indexOf(d, l + 1) > -1 && this.raise(t.start, "Duplicate regular expression flag"), d === "u" && (a = !0), d === "v" && (u = !0);
|
|
1834
1834
|
}
|
|
1835
1835
|
this.options.ecmaVersion >= 15 && a && u && this.raise(t.start, "Invalid regular expression flag");
|
|
1836
1836
|
};
|
|
1837
|
-
function
|
|
1837
|
+
function rs(t) {
|
|
1838
1838
|
for (var e in t)
|
|
1839
1839
|
return !0;
|
|
1840
1840
|
return !1;
|
|
1841
1841
|
}
|
|
1842
1842
|
P.validateRegExpPattern = function(t) {
|
|
1843
|
-
this.regexp_pattern(t), !t.switchN && this.options.ecmaVersion >= 9 &&
|
|
1843
|
+
this.regexp_pattern(t), !t.switchN && this.options.ecmaVersion >= 9 && rs(t.groupNames) && (t.switchN = !0, this.regexp_pattern(t));
|
|
1844
1844
|
};
|
|
1845
1845
|
P.regexp_pattern = function(t) {
|
|
1846
1846
|
t.pos = 0, t.lastIntValue = 0, t.lastStringValue = "", t.lastAssertionIsQuantifiable = !1, t.numCapturingParens = 0, t.maxBackReference = 0, t.groupNames = /* @__PURE__ */ Object.create(null), t.backReferenceNames.length = 0, t.branchID = null, this.regexp_disjunction(t), t.pos !== t.source.length && (t.eat(
|
|
@@ -1998,8 +1998,8 @@ P.regexp_eatUncapturingGroup = function(t) {
|
|
|
1998
1998
|
);
|
|
1999
1999
|
if (r || a) {
|
|
2000
2000
|
for (var u = 0; u < r.length; u++) {
|
|
2001
|
-
var
|
|
2002
|
-
r.indexOf(
|
|
2001
|
+
var l = r.charAt(u);
|
|
2002
|
+
r.indexOf(l, u + 1) > -1 && t.raise("Duplicate regular expression modifiers");
|
|
2003
2003
|
}
|
|
2004
2004
|
if (a) {
|
|
2005
2005
|
var d = this.regexp_eatModifiers(t);
|
|
@@ -2042,11 +2042,11 @@ P.regexp_eatCapturingGroup = function(t) {
|
|
|
2042
2042
|
return !1;
|
|
2043
2043
|
};
|
|
2044
2044
|
P.regexp_eatModifiers = function(t) {
|
|
2045
|
-
for (var e = "", r = 0; (r = t.current()) !== -1 &&
|
|
2045
|
+
for (var e = "", r = 0; (r = t.current()) !== -1 && as(r); )
|
|
2046
2046
|
e += mt(r), t.advance();
|
|
2047
2047
|
return e;
|
|
2048
2048
|
};
|
|
2049
|
-
function
|
|
2049
|
+
function as(t) {
|
|
2050
2050
|
return t === 105 || t === 109 || t === 115;
|
|
2051
2051
|
}
|
|
2052
2052
|
P.regexp_eatExtendedAtom = function(t) {
|
|
@@ -2060,13 +2060,13 @@ P.regexp_eatInvalidBracedQuantifier = function(t) {
|
|
|
2060
2060
|
};
|
|
2061
2061
|
P.regexp_eatSyntaxCharacter = function(t) {
|
|
2062
2062
|
var e = t.current();
|
|
2063
|
-
return
|
|
2063
|
+
return li(e) ? (t.lastIntValue = e, t.advance(), !0) : !1;
|
|
2064
2064
|
};
|
|
2065
|
-
function
|
|
2065
|
+
function li(t) {
|
|
2066
2066
|
return t === 36 || t >= 40 && t <= 43 || t === 46 || t === 63 || t >= 91 && t <= 94 || t >= 123 && t <= 125;
|
|
2067
2067
|
}
|
|
2068
2068
|
P.regexp_eatPatternCharacters = function(t) {
|
|
2069
|
-
for (var e = t.pos, r = 0; (r = t.current()) !== -1 && !
|
|
2069
|
+
for (var e = t.pos, r = 0; (r = t.current()) !== -1 && !li(r); )
|
|
2070
2070
|
t.advance();
|
|
2071
2071
|
return t.pos !== e;
|
|
2072
2072
|
};
|
|
@@ -2084,8 +2084,8 @@ P.regexp_groupSpecifier = function(t) {
|
|
|
2084
2084
|
if (r)
|
|
2085
2085
|
if (e)
|
|
2086
2086
|
for (var a = 0, u = r; a < u.length; a += 1) {
|
|
2087
|
-
var
|
|
2088
|
-
|
|
2087
|
+
var l = u[a];
|
|
2088
|
+
l.separatedFrom(t.branchID) || t.raise("Duplicate capture group name");
|
|
2089
2089
|
}
|
|
2090
2090
|
else
|
|
2091
2091
|
t.raise("Duplicate capture group name");
|
|
@@ -2116,16 +2116,16 @@ P.regexp_eatRegExpIdentifierName = function(t) {
|
|
|
2116
2116
|
};
|
|
2117
2117
|
P.regexp_eatRegExpIdentifierStart = function(t) {
|
|
2118
2118
|
var e = t.pos, r = this.options.ecmaVersion >= 11, a = t.current(r);
|
|
2119
|
-
return t.advance(r), a === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(t, r) && (a = t.lastIntValue),
|
|
2119
|
+
return t.advance(r), a === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(t, r) && (a = t.lastIntValue), ns(a) ? (t.lastIntValue = a, !0) : (t.pos = e, !1);
|
|
2120
2120
|
};
|
|
2121
|
-
function
|
|
2121
|
+
function ns(t) {
|
|
2122
2122
|
return pt(t, !0) || t === 36 || t === 95;
|
|
2123
2123
|
}
|
|
2124
2124
|
P.regexp_eatRegExpIdentifierPart = function(t) {
|
|
2125
2125
|
var e = t.pos, r = this.options.ecmaVersion >= 11, a = t.current(r);
|
|
2126
|
-
return t.advance(r), a === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(t, r) && (a = t.lastIntValue),
|
|
2126
|
+
return t.advance(r), a === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(t, r) && (a = t.lastIntValue), os(a) ? (t.lastIntValue = a, !0) : (t.pos = e, !1);
|
|
2127
2127
|
};
|
|
2128
|
-
function
|
|
2128
|
+
function os(t) {
|
|
2129
2129
|
return dt(t, !0) || t === 36 || t === 95 || t === 8204 || t === 8205;
|
|
2130
2130
|
}
|
|
2131
2131
|
P.regexp_eatAtomEscape = function(t) {
|
|
@@ -2178,9 +2178,9 @@ P.regexp_eatControlEscape = function(t) {
|
|
|
2178
2178
|
};
|
|
2179
2179
|
P.regexp_eatControlLetter = function(t) {
|
|
2180
2180
|
var e = t.current();
|
|
2181
|
-
return
|
|
2181
|
+
return fi(e) ? (t.lastIntValue = e % 32, t.advance(), !0) : !1;
|
|
2182
2182
|
};
|
|
2183
|
-
function
|
|
2183
|
+
function fi(t) {
|
|
2184
2184
|
return t >= 65 && t <= 90 || t >= 97 && t <= 122;
|
|
2185
2185
|
}
|
|
2186
2186
|
P.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
@@ -2193,7 +2193,7 @@ P.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2193
2193
|
if (this.regexp_eatFixedHexDigits(t, 4)) {
|
|
2194
2194
|
var u = t.lastIntValue;
|
|
2195
2195
|
if (a && u >= 55296 && u <= 56319) {
|
|
2196
|
-
var
|
|
2196
|
+
var l = t.pos;
|
|
2197
2197
|
if (t.eat(
|
|
2198
2198
|
92
|
|
2199
2199
|
/* \ */
|
|
@@ -2205,7 +2205,7 @@ P.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2205
2205
|
if (d >= 56320 && d <= 57343)
|
|
2206
2206
|
return t.lastIntValue = (u - 55296) * 1024 + (d - 56320) + 65536, !0;
|
|
2207
2207
|
}
|
|
2208
|
-
t.pos =
|
|
2208
|
+
t.pos = l, t.lastIntValue = u;
|
|
2209
2209
|
}
|
|
2210
2210
|
return !0;
|
|
2211
2211
|
}
|
|
@@ -2215,13 +2215,13 @@ P.regexp_eatRegExpUnicodeEscapeSequence = function(t, e) {
|
|
|
2215
2215
|
) && this.regexp_eatHexDigits(t) && t.eat(
|
|
2216
2216
|
125
|
|
2217
2217
|
/* } */
|
|
2218
|
-
) &&
|
|
2218
|
+
) && hs(t.lastIntValue))
|
|
2219
2219
|
return !0;
|
|
2220
2220
|
a && t.raise("Invalid unicode escape"), t.pos = r;
|
|
2221
2221
|
}
|
|
2222
2222
|
return !1;
|
|
2223
2223
|
};
|
|
2224
|
-
function
|
|
2224
|
+
function hs(t) {
|
|
2225
2225
|
return t >= 0 && t <= 1114111;
|
|
2226
2226
|
}
|
|
2227
2227
|
P.regexp_eatIdentityEscape = function(t) {
|
|
@@ -2244,10 +2244,10 @@ P.regexp_eatDecimalEscape = function(t) {
|
|
|
2244
2244
|
}
|
|
2245
2245
|
return !1;
|
|
2246
2246
|
};
|
|
2247
|
-
var
|
|
2247
|
+
var di = 0, yt = 1, ut = 2;
|
|
2248
2248
|
P.regexp_eatCharacterClassEscape = function(t) {
|
|
2249
2249
|
var e = t.current();
|
|
2250
|
-
if (
|
|
2250
|
+
if (us(e))
|
|
2251
2251
|
return t.lastIntValue = -1, t.advance(), yt;
|
|
2252
2252
|
var r = !1;
|
|
2253
2253
|
if (t.switchU && this.options.ecmaVersion >= 9 && ((r = e === 80) || e === 112)) {
|
|
@@ -2263,9 +2263,9 @@ P.regexp_eatCharacterClassEscape = function(t) {
|
|
|
2263
2263
|
return r && a === ut && t.raise("Invalid property name"), a;
|
|
2264
2264
|
t.raise("Invalid property name");
|
|
2265
2265
|
}
|
|
2266
|
-
return
|
|
2266
|
+
return di;
|
|
2267
2267
|
};
|
|
2268
|
-
function
|
|
2268
|
+
function us(t) {
|
|
2269
2269
|
return t === 100 || t === 68 || t === 115 || t === 83 || t === 119 || t === 87;
|
|
2270
2270
|
}
|
|
2271
2271
|
P.regexp_eatUnicodePropertyValueExpression = function(t) {
|
|
@@ -2284,7 +2284,7 @@ P.regexp_eatUnicodePropertyValueExpression = function(t) {
|
|
|
2284
2284
|
var u = t.lastStringValue;
|
|
2285
2285
|
return this.regexp_validateUnicodePropertyNameOrValue(t, u);
|
|
2286
2286
|
}
|
|
2287
|
-
return
|
|
2287
|
+
return di;
|
|
2288
2288
|
};
|
|
2289
2289
|
P.regexp_validateUnicodePropertyNameAndValue = function(t, e, r) {
|
|
2290
2290
|
wt(t.unicodeProperties.nonBinary, e) || t.raise("Invalid property name"), t.unicodeProperties.nonBinary[e].test(r) || t.raise("Invalid property value");
|
|
@@ -2298,21 +2298,21 @@ P.regexp_validateUnicodePropertyNameOrValue = function(t, e) {
|
|
|
2298
2298
|
};
|
|
2299
2299
|
P.regexp_eatUnicodePropertyName = function(t) {
|
|
2300
2300
|
var e = 0;
|
|
2301
|
-
for (t.lastStringValue = "";
|
|
2301
|
+
for (t.lastStringValue = ""; mi(e = t.current()); )
|
|
2302
2302
|
t.lastStringValue += mt(e), t.advance();
|
|
2303
2303
|
return t.lastStringValue !== "";
|
|
2304
2304
|
};
|
|
2305
|
-
function
|
|
2306
|
-
return
|
|
2305
|
+
function mi(t) {
|
|
2306
|
+
return fi(t) || t === 95;
|
|
2307
2307
|
}
|
|
2308
2308
|
P.regexp_eatUnicodePropertyValue = function(t) {
|
|
2309
2309
|
var e = 0;
|
|
2310
|
-
for (t.lastStringValue = "";
|
|
2310
|
+
for (t.lastStringValue = ""; cs(e = t.current()); )
|
|
2311
2311
|
t.lastStringValue += mt(e), t.advance();
|
|
2312
2312
|
return t.lastStringValue !== "";
|
|
2313
2313
|
};
|
|
2314
|
-
function
|
|
2315
|
-
return
|
|
2314
|
+
function cs(t) {
|
|
2315
|
+
return mi(t) || ee(t);
|
|
2316
2316
|
}
|
|
2317
2317
|
P.regexp_eatLoneUnicodePropertyNameOrValue = function(t) {
|
|
2318
2318
|
return this.regexp_eatUnicodePropertyValue(t);
|
|
@@ -2358,7 +2358,7 @@ P.regexp_eatClassAtom = function(t) {
|
|
|
2358
2358
|
return !0;
|
|
2359
2359
|
if (t.switchU) {
|
|
2360
2360
|
var r = t.current();
|
|
2361
|
-
(r === 99 ||
|
|
2361
|
+
(r === 99 || vi(r)) && t.raise("Invalid class escape"), t.raise("Invalid escape");
|
|
2362
2362
|
}
|
|
2363
2363
|
t.pos = e;
|
|
2364
2364
|
}
|
|
@@ -2511,19 +2511,19 @@ P.regexp_eatClassSetCharacter = function(t) {
|
|
|
2511
2511
|
/* b */
|
|
2512
2512
|
) ? (t.lastIntValue = 8, !0) : (t.pos = e, !1);
|
|
2513
2513
|
var r = t.current();
|
|
2514
|
-
return r < 0 || r === t.lookahead() &&
|
|
2514
|
+
return r < 0 || r === t.lookahead() && ps(r) || ls(r) ? !1 : (t.advance(), t.lastIntValue = r, !0);
|
|
2515
2515
|
};
|
|
2516
|
-
function
|
|
2516
|
+
function ps(t) {
|
|
2517
2517
|
return t === 33 || t >= 35 && t <= 38 || t >= 42 && t <= 44 || t === 46 || t >= 58 && t <= 64 || t === 94 || t === 96 || t === 126;
|
|
2518
2518
|
}
|
|
2519
|
-
function
|
|
2519
|
+
function ls(t) {
|
|
2520
2520
|
return t === 40 || t === 41 || t === 45 || t === 47 || t >= 91 && t <= 93 || t >= 123 && t <= 125;
|
|
2521
2521
|
}
|
|
2522
2522
|
P.regexp_eatClassSetReservedPunctuator = function(t) {
|
|
2523
2523
|
var e = t.current();
|
|
2524
|
-
return
|
|
2524
|
+
return fs(e) ? (t.lastIntValue = e, t.advance(), !0) : !1;
|
|
2525
2525
|
};
|
|
2526
|
-
function
|
|
2526
|
+
function fs(t) {
|
|
2527
2527
|
return t === 33 || t === 35 || t === 37 || t === 38 || t === 44 || t === 45 || t >= 58 && t <= 62 || t === 64 || t === 96 || t === 126;
|
|
2528
2528
|
}
|
|
2529
2529
|
P.regexp_eatClassControlLetter = function(t) {
|
|
@@ -2553,14 +2553,14 @@ function ee(t) {
|
|
|
2553
2553
|
}
|
|
2554
2554
|
P.regexp_eatHexDigits = function(t) {
|
|
2555
2555
|
var e = t.pos, r = 0;
|
|
2556
|
-
for (t.lastIntValue = 0;
|
|
2557
|
-
t.lastIntValue = 16 * t.lastIntValue +
|
|
2556
|
+
for (t.lastIntValue = 0; yi(r = t.current()); )
|
|
2557
|
+
t.lastIntValue = 16 * t.lastIntValue + xi(r), t.advance();
|
|
2558
2558
|
return t.pos !== e;
|
|
2559
2559
|
};
|
|
2560
|
-
function
|
|
2560
|
+
function yi(t) {
|
|
2561
2561
|
return t >= 48 && t <= 57 || t >= 65 && t <= 70 || t >= 97 && t <= 102;
|
|
2562
2562
|
}
|
|
2563
|
-
function
|
|
2563
|
+
function xi(t) {
|
|
2564
2564
|
return t >= 65 && t <= 70 ? 10 + (t - 65) : t >= 97 && t <= 102 ? 10 + (t - 97) : t - 48;
|
|
2565
2565
|
}
|
|
2566
2566
|
P.regexp_eatLegacyOctalEscapeSequence = function(t) {
|
|
@@ -2577,9 +2577,9 @@ P.regexp_eatLegacyOctalEscapeSequence = function(t) {
|
|
|
2577
2577
|
};
|
|
2578
2578
|
P.regexp_eatOctalDigit = function(t) {
|
|
2579
2579
|
var e = t.current();
|
|
2580
|
-
return
|
|
2580
|
+
return vi(e) ? (t.lastIntValue = e - 48, t.advance(), !0) : (t.lastIntValue = 0, !1);
|
|
2581
2581
|
};
|
|
2582
|
-
function
|
|
2582
|
+
function vi(t) {
|
|
2583
2583
|
return t >= 48 && t <= 55;
|
|
2584
2584
|
}
|
|
2585
2585
|
P.regexp_eatFixedHexDigits = function(t, e) {
|
|
@@ -2587,9 +2587,9 @@ P.regexp_eatFixedHexDigits = function(t, e) {
|
|
|
2587
2587
|
t.lastIntValue = 0;
|
|
2588
2588
|
for (var a = 0; a < e; ++a) {
|
|
2589
2589
|
var u = t.current();
|
|
2590
|
-
if (!
|
|
2590
|
+
if (!yi(u))
|
|
2591
2591
|
return t.pos = r, !1;
|
|
2592
|
-
t.lastIntValue = 16 * t.lastIntValue +
|
|
2592
|
+
t.lastIntValue = 16 * t.lastIntValue + xi(u), t.advance();
|
|
2593
2593
|
}
|
|
2594
2594
|
return !0;
|
|
2595
2595
|
};
|
|
@@ -2635,7 +2635,7 @@ M.fullCharCodeAtPos = function() {
|
|
|
2635
2635
|
M.skipBlockComment = function() {
|
|
2636
2636
|
var t = this.options.onComment && this.curPosition(), e = this.pos, r = this.input.indexOf("*/", this.pos += 2);
|
|
2637
2637
|
if (r === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = r + 2, this.options.locations)
|
|
2638
|
-
for (var a = void 0, u = e; (a =
|
|
2638
|
+
for (var a = void 0, u = e; (a = We(this.input, u, this.pos)) > -1; )
|
|
2639
2639
|
++this.curLine, u = this.lineStart = a;
|
|
2640
2640
|
this.options.onComment && this.options.onComment(
|
|
2641
2641
|
!0,
|
|
@@ -2877,8 +2877,8 @@ M.readRegexp = function() {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
var u = this.input.slice(r, this.pos);
|
|
2879
2879
|
++this.pos;
|
|
2880
|
-
var
|
|
2881
|
-
this.containsEsc && this.unexpected(
|
|
2880
|
+
var l = this.pos, d = this.readWord1();
|
|
2881
|
+
this.containsEsc && this.unexpected(l);
|
|
2882
2882
|
var v = this.regexpState || (this.regexpState = new ft(this));
|
|
2883
2883
|
v.reset(r, u, d), this.validateRegExpFlags(v), this.validateRegExpPattern(v);
|
|
2884
2884
|
var g = null;
|
|
@@ -2889,7 +2889,7 @@ M.readRegexp = function() {
|
|
|
2889
2889
|
return this.finishToken(h.regexp, { pattern: u, flags: d, value: g });
|
|
2890
2890
|
};
|
|
2891
2891
|
M.readInt = function(t, e, r) {
|
|
2892
|
-
for (var a = this.options.ecmaVersion >= 12 && e === void 0, u = r && this.input.charCodeAt(this.pos) === 48,
|
|
2892
|
+
for (var a = this.options.ecmaVersion >= 12 && e === void 0, u = r && this.input.charCodeAt(this.pos) === 48, l = this.pos, d = 0, v = 0, g = 0, o = e ?? 1 / 0; g < o; ++g, ++this.pos) {
|
|
2893
2893
|
var w = this.input.charCodeAt(this.pos), L = void 0;
|
|
2894
2894
|
if (a && w === 95) {
|
|
2895
2895
|
u && this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"), v === 95 && this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"), g === 0 && this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"), v = w;
|
|
@@ -2899,19 +2899,19 @@ M.readInt = function(t, e, r) {
|
|
|
2899
2899
|
break;
|
|
2900
2900
|
v = w, d = d * t + L;
|
|
2901
2901
|
}
|
|
2902
|
-
return a && v === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos ===
|
|
2902
|
+
return a && v === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === l || e != null && this.pos - l !== e ? null : d;
|
|
2903
2903
|
};
|
|
2904
|
-
function
|
|
2904
|
+
function ds(t, e) {
|
|
2905
2905
|
return e ? parseInt(t, 8) : parseFloat(t.replace(/_/g, ""));
|
|
2906
2906
|
}
|
|
2907
|
-
function
|
|
2907
|
+
function gi(t) {
|
|
2908
2908
|
return typeof BigInt != "function" ? null : BigInt(t.replace(/_/g, ""));
|
|
2909
2909
|
}
|
|
2910
2910
|
M.readRadixNumber = function(t) {
|
|
2911
2911
|
var e = this.pos;
|
|
2912
2912
|
this.pos += 2;
|
|
2913
2913
|
var r = this.readInt(t);
|
|
2914
|
-
return r == null && this.raise(this.start + 2, "Expected number in radix " + t), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (r =
|
|
2914
|
+
return r == null && this.raise(this.start + 2, "Expected number in radix " + t), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (r = gi(this.input.slice(e, this.pos)), ++this.pos) : pt(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(h.num, r);
|
|
2915
2915
|
};
|
|
2916
2916
|
M.readNumber = function(t) {
|
|
2917
2917
|
var e = this.pos;
|
|
@@ -2920,12 +2920,12 @@ M.readNumber = function(t) {
|
|
|
2920
2920
|
r && this.strict && this.raise(e, "Invalid number");
|
|
2921
2921
|
var a = this.input.charCodeAt(this.pos);
|
|
2922
2922
|
if (!r && !t && this.options.ecmaVersion >= 11 && a === 110) {
|
|
2923
|
-
var u =
|
|
2923
|
+
var u = gi(this.input.slice(e, this.pos));
|
|
2924
2924
|
return ++this.pos, pt(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(h.num, u);
|
|
2925
2925
|
}
|
|
2926
2926
|
r && /[89]/.test(this.input.slice(e, this.pos)) && (r = !1), a === 46 && !r && (++this.pos, this.readInt(10), a = this.input.charCodeAt(this.pos)), (a === 69 || a === 101) && !r && (a = this.input.charCodeAt(++this.pos), (a === 43 || a === 45) && ++this.pos, this.readInt(10) === null && this.raise(e, "Invalid number")), pt(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
2927
|
-
var
|
|
2928
|
-
return this.finishToken(h.num,
|
|
2927
|
+
var l = ds(this.input.slice(e, this.pos), r);
|
|
2928
|
+
return this.finishToken(h.num, l);
|
|
2929
2929
|
};
|
|
2930
2930
|
M.readCodePoint = function() {
|
|
2931
2931
|
var t = this.input.charCodeAt(this.pos), e;
|
|
@@ -2947,13 +2947,13 @@ M.readString = function(t) {
|
|
|
2947
2947
|
}
|
|
2948
2948
|
return e += this.input.slice(r, this.pos++), this.finishToken(h.string, e);
|
|
2949
2949
|
};
|
|
2950
|
-
var
|
|
2950
|
+
var bi = {};
|
|
2951
2951
|
M.tryReadTemplateToken = function() {
|
|
2952
2952
|
this.inTemplateElement = !0;
|
|
2953
2953
|
try {
|
|
2954
2954
|
this.readTmplToken();
|
|
2955
2955
|
} catch (t) {
|
|
2956
|
-
if (t ===
|
|
2956
|
+
if (t === bi)
|
|
2957
2957
|
this.readInvalidTemplateToken();
|
|
2958
2958
|
else
|
|
2959
2959
|
throw t;
|
|
@@ -2962,7 +2962,7 @@ M.tryReadTemplateToken = function() {
|
|
|
2962
2962
|
};
|
|
2963
2963
|
M.invalidStringToken = function(t, e) {
|
|
2964
2964
|
if (this.inTemplateElement && this.options.ecmaVersion >= 9)
|
|
2965
|
-
throw
|
|
2965
|
+
throw bi;
|
|
2966
2966
|
this.raise(t, e);
|
|
2967
2967
|
};
|
|
2968
2968
|
M.readTmplToken = function() {
|
|
@@ -3083,10 +3083,10 @@ M.readWord1 = function() {
|
|
|
3083
3083
|
this.pos += u <= 65535 ? 1 : 2;
|
|
3084
3084
|
else if (u === 92) {
|
|
3085
3085
|
this.containsEsc = !0, t += this.input.slice(r, this.pos);
|
|
3086
|
-
var
|
|
3086
|
+
var l = this.pos;
|
|
3087
3087
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3088
3088
|
var d = this.readCodePoint();
|
|
3089
|
-
(e ? pt : dt)(d, a) || this.invalidStringToken(
|
|
3089
|
+
(e ? pt : dt)(d, a) || this.invalidStringToken(l, "Invalid Unicode escape"), t += mt(d), r = this.pos;
|
|
3090
3090
|
} else
|
|
3091
3091
|
break;
|
|
3092
3092
|
e = !1;
|
|
@@ -3097,10 +3097,10 @@ M.readWord = function() {
|
|
|
3097
3097
|
var t = this.readWord1(), e = h.name;
|
|
3098
3098
|
return this.keywords.test(t) && (e = kt[t]), this.finishToken(e, t);
|
|
3099
3099
|
};
|
|
3100
|
-
var
|
|
3100
|
+
var Si = "8.15.0";
|
|
3101
3101
|
W.acorn = {
|
|
3102
3102
|
Parser: W,
|
|
3103
|
-
version:
|
|
3103
|
+
version: Si,
|
|
3104
3104
|
defaultOptions: zt,
|
|
3105
3105
|
Position: At,
|
|
3106
3106
|
SourceLocation: Ft,
|
|
@@ -3116,19 +3116,19 @@ W.acorn = {
|
|
|
3116
3116
|
Token: ie,
|
|
3117
3117
|
isNewLine: Tt,
|
|
3118
3118
|
lineBreak: Y,
|
|
3119
|
-
lineBreakG:
|
|
3119
|
+
lineBreakG: He,
|
|
3120
3120
|
nonASCIIwhitespace: xe
|
|
3121
3121
|
};
|
|
3122
|
-
function
|
|
3122
|
+
function ms(t, e) {
|
|
3123
3123
|
return W.parse(t, e);
|
|
3124
3124
|
}
|
|
3125
|
-
function
|
|
3125
|
+
function ys(t, e, r) {
|
|
3126
3126
|
return W.parseExpressionAt(t, e, r);
|
|
3127
3127
|
}
|
|
3128
|
-
function
|
|
3128
|
+
function xs(t, e) {
|
|
3129
3129
|
return W.tokenizer(t, e);
|
|
3130
3130
|
}
|
|
3131
|
-
const
|
|
3131
|
+
const vs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3132
3132
|
__proto__: null,
|
|
3133
3133
|
Node: jt,
|
|
3134
3134
|
Parser: W,
|
|
@@ -3144,27 +3144,27 @@ const gs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3144
3144
|
isNewLine: Tt,
|
|
3145
3145
|
keywordTypes: kt,
|
|
3146
3146
|
lineBreak: Y,
|
|
3147
|
-
lineBreakG:
|
|
3147
|
+
lineBreakG: He,
|
|
3148
3148
|
nonASCIIwhitespace: xe,
|
|
3149
|
-
parse:
|
|
3150
|
-
parseExpressionAt:
|
|
3149
|
+
parse: ms,
|
|
3150
|
+
parseExpressionAt: ys,
|
|
3151
3151
|
tokContexts: j,
|
|
3152
3152
|
tokTypes: h,
|
|
3153
|
-
tokenizer:
|
|
3154
|
-
version:
|
|
3153
|
+
tokenizer: xs,
|
|
3154
|
+
version: Si
|
|
3155
3155
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3156
3156
|
function Re(t, e) {
|
|
3157
3157
|
for (var r = 0; r < e.length; r++) {
|
|
3158
3158
|
var a = e[r];
|
|
3159
|
-
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (u = (function(
|
|
3160
|
-
if (typeof
|
|
3161
|
-
var v =
|
|
3159
|
+
a.enumerable = a.enumerable || !1, a.configurable = !0, "value" in a && (a.writable = !0), Object.defineProperty(t, typeof (u = (function(l, d) {
|
|
3160
|
+
if (typeof l != "object" || l === null) return l;
|
|
3161
|
+
var v = l[Symbol.toPrimitive];
|
|
3162
3162
|
if (v !== void 0) {
|
|
3163
|
-
var g = v.call(
|
|
3163
|
+
var g = v.call(l, "string");
|
|
3164
3164
|
if (typeof g != "object") return g;
|
|
3165
3165
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
3166
3166
|
}
|
|
3167
|
-
return String(
|
|
3167
|
+
return String(l);
|
|
3168
3168
|
})(a.key)) == "symbol" ? u : String(u), a);
|
|
3169
3169
|
}
|
|
3170
3170
|
var u;
|
|
@@ -3194,11 +3194,11 @@ function Me(t, e) {
|
|
|
3194
3194
|
function De(t, e) {
|
|
3195
3195
|
var r = typeof Symbol < "u" && t[Symbol.iterator] || t["@@iterator"];
|
|
3196
3196
|
if (r) return (r = r.call(t)).next.bind(r);
|
|
3197
|
-
if (Array.isArray(t) || (r = (function(u,
|
|
3197
|
+
if (Array.isArray(t) || (r = (function(u, l) {
|
|
3198
3198
|
if (u) {
|
|
3199
|
-
if (typeof u == "string") return Me(u,
|
|
3199
|
+
if (typeof u == "string") return Me(u, l);
|
|
3200
3200
|
var d = Object.prototype.toString.call(u).slice(8, -1);
|
|
3201
|
-
return d === "Object" && u.constructor && (d = u.constructor.name), d === "Map" || d === "Set" ? Array.from(u) : d === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d) ? Me(u,
|
|
3201
|
+
return d === "Object" && u.constructor && (d = u.constructor.name), d === "Map" || d === "Set" ? Array.from(u) : d === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(d) ? Me(u, l) : void 0;
|
|
3202
3202
|
}
|
|
3203
3203
|
})(t)) || e) {
|
|
3204
3204
|
r && (t = r);
|
|
@@ -3214,17 +3214,17 @@ var at = !0;
|
|
|
3214
3214
|
function nt(t, e) {
|
|
3215
3215
|
return e === void 0 && (e = {}), new O("name", e);
|
|
3216
3216
|
}
|
|
3217
|
-
var
|
|
3218
|
-
function
|
|
3219
|
-
var e =
|
|
3217
|
+
var gs = /* @__PURE__ */ new WeakMap();
|
|
3218
|
+
function bs(t) {
|
|
3219
|
+
var e = gs.get(t.Parser.acorn || t);
|
|
3220
3220
|
if (!e) {
|
|
3221
|
-
var r = { assert: nt(0, { startsExpr: at }), asserts: nt(0, { startsExpr: at }), global: nt(0, { startsExpr: at }), keyof: nt(0, { startsExpr: at }), readonly: nt(0, { startsExpr: at }), unique: nt(0, { startsExpr: at }), abstract: nt(0, { startsExpr: at }), declare: nt(0, { startsExpr: at }), enum: nt(0, { startsExpr: at }), module: nt(0, { startsExpr: at }), namespace: nt(0, { startsExpr: at }), interface: nt(0, { startsExpr: at }), type: nt(0, { startsExpr: at }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, u = { tc_oTag: new Q("<tag", !1, !1), tc_cTag: new Q("</tag", !1, !1), tc_expr: new Q("<tag>...</tag>", !0, !0) },
|
|
3221
|
+
var r = { assert: nt(0, { startsExpr: at }), asserts: nt(0, { startsExpr: at }), global: nt(0, { startsExpr: at }), keyof: nt(0, { startsExpr: at }), readonly: nt(0, { startsExpr: at }), unique: nt(0, { startsExpr: at }), abstract: nt(0, { startsExpr: at }), declare: nt(0, { startsExpr: at }), enum: nt(0, { startsExpr: at }), module: nt(0, { startsExpr: at }), namespace: nt(0, { startsExpr: at }), interface: nt(0, { startsExpr: at }), type: nt(0, { startsExpr: at }) }, a = { at: new O("@"), jsxName: new O("jsxName"), jsxText: new O("jsxText", { beforeExpr: !0 }), jsxTagStart: new O("jsxTagStart", { startsExpr: !0 }), jsxTagEnd: new O("jsxTagEnd") }, u = { tc_oTag: new Q("<tag", !1, !1), tc_cTag: new Q("</tag", !1, !1), tc_expr: new Q("<tag>...</tag>", !0, !0) }, l = new RegExp("^(?:" + Object.keys(r).join("|") + ")$");
|
|
3222
3222
|
a.jsxTagStart.updateContext = function() {
|
|
3223
3223
|
this.context.push(u.tc_expr), this.context.push(u.tc_oTag), this.exprAllowed = !1;
|
|
3224
3224
|
}, a.jsxTagEnd.updateContext = function(d) {
|
|
3225
3225
|
var v = this.context.pop();
|
|
3226
3226
|
v === u.tc_oTag && d === h.slash || v === u.tc_cTag ? (this.context.pop(), this.exprAllowed = this.curContext() === u.tc_expr) : this.exprAllowed = !0;
|
|
3227
|
-
}, e = { tokTypes: Qt({}, r, a), tokContexts: Qt({}, u), keywordsRegExp:
|
|
3227
|
+
}, e = { tokTypes: Qt({}, r, a), tokContexts: Qt({}, u), keywordsRegExp: l, tokenIsLiteralPropertyName: function(d) {
|
|
3228
3228
|
return [h.name, h.string, h.num].concat(Object.values(kt), Object.values(r)).includes(d);
|
|
3229
3229
|
}, tokenIsKeywordOrIdentifier: function(d) {
|
|
3230
3230
|
return [h.name].concat(Object.values(kt), Object.values(r)).includes(d);
|
|
@@ -3240,10 +3240,10 @@ function Ss(t) {
|
|
|
3240
3240
|
}
|
|
3241
3241
|
return e;
|
|
3242
3242
|
}
|
|
3243
|
-
var Lt = 1024,
|
|
3243
|
+
var Lt = 1024, Ss = new RegExp("(?:[^\\S\\n\\r\\u2028\\u2029]|\\/\\/.*|\\/\\*.*?\\*\\/)*", "y"), Ve = new RegExp("(?=(" + Ss.source + "))\\1" + /(?=[\n\r\u2028\u2029]|\/\*(?!.*?\*\/)|$)/.source, "y"), Ot = function() {
|
|
3244
3244
|
this.shorthandAssign = void 0, this.trailingComma = void 0, this.parenthesizedAssign = void 0, this.parenthesizedBind = void 0, this.doubleProto = void 0, this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
3245
3245
|
};
|
|
3246
|
-
function
|
|
3246
|
+
function Ts(t, e) {
|
|
3247
3247
|
var r = e.key.name, a = t[r], u = "true";
|
|
3248
3248
|
return e.type !== "MethodDefinition" || e.kind !== "get" && e.kind !== "set" || (u = (e.static ? "s" : "i") + e.kind), a === "iget" && u === "iset" || a === "iset" && u === "iget" || a === "sget" && u === "sset" || a === "sset" && u === "sget" ? (t[r] = "true", !1) : !!a || (t[r] = u, !1);
|
|
3249
3249
|
}
|
|
@@ -3288,7 +3288,7 @@ var A = { AbstractMethodHasImplementation: function(t) {
|
|
|
3288
3288
|
return "Single type parameter " + e + " should have a trailing comma. Example usage: <" + e + ",>.";
|
|
3289
3289
|
}, StaticBlockCannotHaveModifier: "Static class blocks cannot have any modifier.", TypeAnnotationAfterAssign: "Type annotations must come before default assignments, e.g. instead of `age = 25: number` use `age: number = 25`.", TypeImportCannotSpecifyDefaultAndNamed: "A type-only import can specify a default import or named bindings, but not both.", TypeModifierIsUsedInTypeExports: "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement.", TypeModifierIsUsedInTypeImports: "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement.", UnexpectedParameterModifier: "A parameter property is only allowed in a constructor implementation.", UnexpectedReadonly: "'readonly' type modifier is only permitted on array and tuple literal types.", GenericsEndWithComma: "Trailing comma is not allowed at the end of generics.", UnexpectedTypeAnnotation: "Did not expect a type annotation here.", UnexpectedTypeCastInParameter: "Unexpected type cast in parameter position.", UnsupportedImportTypeArgument: "Argument in a type import must be a string literal.", UnsupportedParameterPropertyKind: "A parameter property may not be declared using a binding pattern.", UnsupportedSignatureParameterKind: function(t) {
|
|
3290
3290
|
return "Name in a signature must be an Identifier, ObjectPattern or ArrayPattern, instead got " + t.type + ".";
|
|
3291
|
-
}, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." },
|
|
3291
|
+
}, LetInLexicalBinding: "'let' is not allowed to be used as a name in 'let' or 'const' declarations." }, Ps = { quot: '"', amp: "&", apos: "'", lt: "<", gt: ">", nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", fnof: "ƒ", circ: "ˆ", tilde: "˜", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", ensp: " ", emsp: " ", thinsp: " ", zwnj: "", zwj: "", lrm: "", rlm: "", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", bull: "•", hellip: "…", permil: "‰", prime: "′", Prime: "″", lsaquo: "‹", rsaquo: "›", oline: "‾", frasl: "⁄", euro: "€", image: "ℑ", weierp: "℘", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "∧", or: "∨", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦" }, Cs = /^[\da-fA-F]+$/, ks = /^\d+$/;
|
|
3292
3292
|
function Mt(t) {
|
|
3293
3293
|
return t && (t.type === "JSXIdentifier" ? t.name : t.type === "JSXNamespacedName" ? t.namespace.name + ":" + t.name.name : t.type === "JSXMemberExpression" ? Mt(t.object) + "." + Mt(t.property) : void 0);
|
|
3294
3294
|
}
|
|
@@ -3296,35 +3296,35 @@ var ce = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;
|
|
|
3296
3296
|
function Be(t) {
|
|
3297
3297
|
if (!t) throw new Error("Assert fail");
|
|
3298
3298
|
}
|
|
3299
|
-
function
|
|
3299
|
+
function As(t) {
|
|
3300
3300
|
return t === "accessor";
|
|
3301
3301
|
}
|
|
3302
|
-
function
|
|
3302
|
+
function ws(t) {
|
|
3303
3303
|
return t === "in" || t === "out";
|
|
3304
3304
|
}
|
|
3305
3305
|
function pe(t, e) {
|
|
3306
3306
|
return 2 | (t ? 4 : 0) | (e ? 8 : 0);
|
|
3307
3307
|
}
|
|
3308
|
-
function
|
|
3308
|
+
function Es(t) {
|
|
3309
3309
|
if (t.type !== "MemberExpression") return !1;
|
|
3310
3310
|
var e = t.property;
|
|
3311
|
-
return (!t.computed || !(e.type !== "TemplateLiteral" || e.expressions.length > 0)) &&
|
|
3311
|
+
return (!t.computed || !(e.type !== "TemplateLiteral" || e.expressions.length > 0)) && Ti(t.object);
|
|
3312
3312
|
}
|
|
3313
|
-
function
|
|
3314
|
-
return t.type === "Identifier" || t.type === "MemberExpression" && !t.computed &&
|
|
3313
|
+
function Ti(t) {
|
|
3314
|
+
return t.type === "Identifier" || t.type === "MemberExpression" && !t.computed && Ti(t.object);
|
|
3315
3315
|
}
|
|
3316
3316
|
function je(t) {
|
|
3317
3317
|
return t === "private" || t === "public" || t === "protected";
|
|
3318
3318
|
}
|
|
3319
|
-
function
|
|
3320
|
-
var e = {}, r = e.dts, a = r !== void 0 && r, u = e.allowSatisfies,
|
|
3319
|
+
function Is(t) {
|
|
3320
|
+
var e = {}, r = e.dts, a = r !== void 0 && r, u = e.allowSatisfies, l = u !== void 0 && u;
|
|
3321
3321
|
return function(d) {
|
|
3322
|
-
var v = d.acorn ||
|
|
3323
|
-
function
|
|
3322
|
+
var v = d.acorn || vs, g = bs(v), o = v.tokTypes, w = v.keywordTypes, L = v.isIdentifierStart, F = v.lineBreak, z = v.isNewLine, G = v.tokContexts, st = v.isIdentifierChar, I = g.tokTypes, tt = g.tokContexts, se = g.keywordsRegExp, Pi = g.tokenIsLiteralPropertyName, Ci = g.tokenIsTemplate, ki = g.tokenIsTSDeclarationStart, B = g.tokenIsIdentifier, qt = g.tokenIsKeywordOrIdentifier, Ai = g.tokenIsTSTypeOperator;
|
|
3323
|
+
function wi(T, et, X) {
|
|
3324
3324
|
X === void 0 && (X = T.length);
|
|
3325
3325
|
for (var K = et; K < X; K++) {
|
|
3326
3326
|
var V = T.charCodeAt(K);
|
|
3327
|
-
if (
|
|
3327
|
+
if (z(V)) return K < X - 1 && V === 13 && T.charCodeAt(K + 1) === 10 ? K + 2 : K + 1;
|
|
3328
3328
|
}
|
|
3329
3329
|
return -1;
|
|
3330
3330
|
}
|
|
@@ -3341,14 +3341,14 @@ function _s(t) {
|
|
|
3341
3341
|
c.length && (n.decorators = c, this.resetStartLocationFromNode(n, c[0]), this.decoratorStack[this.decoratorStack.length - 1] = []);
|
|
3342
3342
|
}, s.parseDecorators = function(n) {
|
|
3343
3343
|
for (var c = this.decoratorStack[this.decoratorStack.length - 1]; this.match(V.at); ) {
|
|
3344
|
-
var
|
|
3345
|
-
c.push(
|
|
3344
|
+
var f = this.parseDecorator();
|
|
3345
|
+
c.push(f);
|
|
3346
3346
|
}
|
|
3347
3347
|
this.match(K._export) ? n || this.unexpected() : this.canHaveLeadingDecorator() || this.raise(this.start, "Leading decorators must be attached to a class declaration.");
|
|
3348
3348
|
}, s.parseDecorator = function() {
|
|
3349
3349
|
var n = this.startNode();
|
|
3350
3350
|
this.next(), this.decoratorStack.push([]);
|
|
3351
|
-
var c,
|
|
3351
|
+
var c, f = this.start, m = this.startLoc;
|
|
3352
3352
|
if (this.match(K.parenL)) {
|
|
3353
3353
|
var y = this.start, x = this.startLoc;
|
|
3354
3354
|
if (this.next(), c = this.parseExpression(), this.expect(K.parenR), this.options.preserveParens) {
|
|
@@ -3356,7 +3356,7 @@ function _s(t) {
|
|
|
3356
3356
|
b.expression = c, c = this.finishNode(b, "ParenthesizedExpression");
|
|
3357
3357
|
}
|
|
3358
3358
|
} else for (c = this.parseIdent(!1); this.eat(K.dot); ) {
|
|
3359
|
-
var S = this.startNodeAt(
|
|
3359
|
+
var S = this.startNodeAt(f, m);
|
|
3360
3360
|
S.object = c, S.property = this.parseIdent(!0), S.computed = !1, c = this.finishNode(S, "MemberExpression");
|
|
3361
3361
|
}
|
|
3362
3362
|
return n.expression = this.parseMaybeDecoratorArguments(c), this.decoratorStack.pop(), this.finishNode(n, "Decorator");
|
|
@@ -3371,11 +3371,11 @@ function _s(t) {
|
|
|
3371
3371
|
})(d, g, v), d = (function(T, et, X, K) {
|
|
3372
3372
|
var V = T.tokTypes, p = et.tokTypes, i = T.isNewLine, s = T.isIdentifierChar, n = Object.assign({ allowNamespaces: !0, allowNamespacedObjects: !0 }, {});
|
|
3373
3373
|
return (function(c) {
|
|
3374
|
-
function
|
|
3374
|
+
function f() {
|
|
3375
3375
|
return c.apply(this, arguments) || this;
|
|
3376
3376
|
}
|
|
3377
|
-
Kt(
|
|
3378
|
-
var m =
|
|
3377
|
+
Kt(f, c);
|
|
3378
|
+
var m = f.prototype;
|
|
3379
3379
|
return m.jsx_readToken = function() {
|
|
3380
3380
|
for (var y = "", x = this.pos; ; ) {
|
|
3381
3381
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated JSX contents");
|
|
@@ -3412,7 +3412,7 @@ function _s(t) {
|
|
|
3412
3412
|
S !== "&" && this.raise(this.pos, "Entity must start with an ampersand");
|
|
3413
3413
|
for (var E = ++this.pos; this.pos < this.input.length && b++ < 10; ) {
|
|
3414
3414
|
if ((S = this.input[this.pos++]) === ";") {
|
|
3415
|
-
x[0] === "#" ? x[1] === "x" ? (x = x.substr(2),
|
|
3415
|
+
x[0] === "#" ? x[1] === "x" ? (x = x.substr(2), Cs.test(x) && (y = String.fromCharCode(parseInt(x, 16)))) : (x = x.substr(1), ks.test(x) && (y = String.fromCharCode(parseInt(x, 10)))) : y = Ps[x];
|
|
3416
3416
|
break;
|
|
3417
3417
|
}
|
|
3418
3418
|
x += S;
|
|
@@ -3499,7 +3499,7 @@ function _s(t) {
|
|
|
3499
3499
|
}, m.jsx_parseElement = function() {
|
|
3500
3500
|
var y = this.start, x = this.startLoc;
|
|
3501
3501
|
return this.next(), this.jsx_parseElementAt(y, x);
|
|
3502
|
-
},
|
|
3502
|
+
}, f;
|
|
3503
3503
|
})(X);
|
|
3504
3504
|
})(v, g, d), d = (function(T, et, X) {
|
|
3505
3505
|
var K = et.tokTypes, V = X.tokTypes;
|
|
@@ -3523,19 +3523,19 @@ function _s(t) {
|
|
|
3523
3523
|
var n = [], c = /* @__PURE__ */ new Set();
|
|
3524
3524
|
do {
|
|
3525
3525
|
if (this.type === V.braceR) break;
|
|
3526
|
-
var
|
|
3527
|
-
|
|
3526
|
+
var f, m = this.startNode();
|
|
3527
|
+
f = this.type === V.string ? this.parseLiteral(this.value) : this.parseIdent(!0), this.next(), m.key = f, c.has(m.key.name) && this.raise(this.pos, "Duplicated key in attributes"), c.add(m.key.name), this.type !== V.string && this.raise(this.pos, "Only string is supported as an attribute value"), m.value = this.parseLiteral(this.value), n.push(this.finishNode(m, "ImportAttribute"));
|
|
3528
3528
|
} while (this.eat(V.comma));
|
|
3529
3529
|
return n;
|
|
3530
3530
|
}, i;
|
|
3531
3531
|
})(T);
|
|
3532
3532
|
})(d, g, v);
|
|
3533
|
-
var
|
|
3533
|
+
var Ei = /* @__PURE__ */ (function(T) {
|
|
3534
3534
|
function et(i, s, n) {
|
|
3535
3535
|
var c;
|
|
3536
|
-
return (c = T.call(this, i, s, n) || this).preValue = null, c.preToken = null, c.isLookahead = !1, c.isAmbientContext = !1, c.inAbstractClass = !1, c.inType = !1, c.inDisallowConditionalTypesContext = !1, c.maybeInArrowParameters = !1, c.shouldParseArrowReturnType = void 0, c.shouldParseAsyncArrowReturnType = void 0, c.decoratorStack = [[]], c.importsStack = [[]], c.importOrExportOuterKind = void 0, c.tsParseConstModifier = c.tsParseModifiers.bind((function(
|
|
3537
|
-
if (
|
|
3538
|
-
return
|
|
3536
|
+
return (c = T.call(this, i, s, n) || this).preValue = null, c.preToken = null, c.isLookahead = !1, c.isAmbientContext = !1, c.inAbstractClass = !1, c.inType = !1, c.inDisallowConditionalTypesContext = !1, c.maybeInArrowParameters = !1, c.shouldParseArrowReturnType = void 0, c.shouldParseAsyncArrowReturnType = void 0, c.decoratorStack = [[]], c.importsStack = [[]], c.importOrExportOuterKind = void 0, c.tsParseConstModifier = c.tsParseModifiers.bind((function(f) {
|
|
3537
|
+
if (f === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
3538
|
+
return f;
|
|
3539
3539
|
})(c), { allowedModifiers: ["const"], disallowedModifiers: ["in", "out"], errorTemplate: A.InvalidModifierOnTypeParameterPositions }), c;
|
|
3540
3540
|
}
|
|
3541
3541
|
Kt(et, T);
|
|
@@ -3564,14 +3564,14 @@ function _s(t) {
|
|
|
3564
3564
|
s === void 0 && (s = this.cloneCurLookaheadState());
|
|
3565
3565
|
var n = { node: null };
|
|
3566
3566
|
try {
|
|
3567
|
-
return { node: i(function(
|
|
3568
|
-
throw
|
|
3567
|
+
return { node: i(function(f) {
|
|
3568
|
+
throw f === void 0 && (f = null), n.node = f, n;
|
|
3569
3569
|
}), error: null, thrown: !1, aborted: !1, failState: null };
|
|
3570
|
-
} catch (
|
|
3570
|
+
} catch (f) {
|
|
3571
3571
|
var c = this.getCurLookaheadState();
|
|
3572
|
-
if (this.setLookaheadState(s),
|
|
3573
|
-
if (
|
|
3574
|
-
throw
|
|
3572
|
+
if (this.setLookaheadState(s), f instanceof SyntaxError) return { node: null, error: f, thrown: !0, aborted: !1, failState: c };
|
|
3573
|
+
if (f === n) return { node: n.node, error: null, thrown: !1, aborted: !0, failState: c };
|
|
3574
|
+
throw f;
|
|
3575
3575
|
}
|
|
3576
3576
|
}, p.setOptionalParametersError = function(i, s) {
|
|
3577
3577
|
var n;
|
|
@@ -3607,13 +3607,13 @@ function _s(t) {
|
|
|
3607
3607
|
}, p.tsTryParseGenericAsyncArrowFunction = function(i, s, n) {
|
|
3608
3608
|
var c = this;
|
|
3609
3609
|
if (this.tsMatchLeftRelational()) {
|
|
3610
|
-
var
|
|
3610
|
+
var f = this.maybeInArrowParameters;
|
|
3611
3611
|
this.maybeInArrowParameters = !0;
|
|
3612
3612
|
var m = this.tsTryParseAndCatch(function() {
|
|
3613
3613
|
var y = c.startNodeAt(i, s);
|
|
3614
3614
|
return y.typeParameters = c.tsParseTypeParameters(), T.prototype.parseFunctionParams.call(c, y), y.returnType = c.tsTryParseTypeOrTypePredicateAnnotation(), c.expect(o.arrow), y;
|
|
3615
3615
|
});
|
|
3616
|
-
if (this.maybeInArrowParameters =
|
|
3616
|
+
if (this.maybeInArrowParameters = f, m) return T.prototype.parseArrowExpression.call(this, m, null, !0, n);
|
|
3617
3617
|
}
|
|
3618
3618
|
}, p.tsParseTypeArgumentsInExpression = function() {
|
|
3619
3619
|
if (this.reScan_lt() === o.relational) return this.tsParseTypeArguments();
|
|
@@ -3642,8 +3642,8 @@ function _s(t) {
|
|
|
3642
3642
|
return this.input.charCodeAt(this.nextTokenStart());
|
|
3643
3643
|
}, p.compareLookaheadState = function(i, s) {
|
|
3644
3644
|
for (var n = 0, c = Object.keys(i); n < c.length; n++) {
|
|
3645
|
-
var
|
|
3646
|
-
if (i[
|
|
3645
|
+
var f = c[n];
|
|
3646
|
+
if (i[f] !== s[f]) return !1;
|
|
3647
3647
|
}
|
|
3648
3648
|
return !0;
|
|
3649
3649
|
}, p.createLookaheadState = function() {
|
|
@@ -3671,12 +3671,12 @@ function _s(t) {
|
|
|
3671
3671
|
var i;
|
|
3672
3672
|
this.isLookahead || (i = this.options.onComment && this.curPosition());
|
|
3673
3673
|
var s = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
3674
|
-
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var c,
|
|
3674
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var c, f = s; (c = wi(this.input, f, this.pos)) > -1; ) ++this.curLine, f = this.lineStart = c;
|
|
3675
3675
|
this.isLookahead || this.options.onComment && this.options.onComment(!0, this.input.slice(s + 2, n), s, this.pos, i, this.curPosition());
|
|
3676
3676
|
}, p.skipLineComment = function(i) {
|
|
3677
3677
|
var s, n = this.pos;
|
|
3678
3678
|
this.isLookahead || (s = this.options.onComment && this.curPosition());
|
|
3679
|
-
for (var c = this.input.charCodeAt(this.pos += i); this.pos < this.input.length && !
|
|
3679
|
+
for (var c = this.input.charCodeAt(this.pos += i); this.pos < this.input.length && !z(c); ) c = this.input.charCodeAt(++this.pos);
|
|
3680
3680
|
this.isLookahead || this.options.onComment && this.options.onComment(!1, this.input.slice(n + i, this.pos), n, this.pos, s, this.curPosition());
|
|
3681
3681
|
}, p.finishToken = function(i, s) {
|
|
3682
3682
|
this.preValue = this.value, this.preToken = this.type, this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
@@ -3690,11 +3690,11 @@ function _s(t) {
|
|
|
3690
3690
|
return Ve.lastIndex = this.end, Ve.test(this.input);
|
|
3691
3691
|
}, p.addExtra = function(i, s, n, c) {
|
|
3692
3692
|
if (c === void 0 && (c = !0), i) {
|
|
3693
|
-
var
|
|
3694
|
-
c ?
|
|
3693
|
+
var f = i.extra = i.extra || {};
|
|
3694
|
+
c ? f[s] = n : Object.defineProperty(f, s, { enumerable: c, value: n });
|
|
3695
3695
|
}
|
|
3696
3696
|
}, p.isLiteralPropertyName = function() {
|
|
3697
|
-
return
|
|
3697
|
+
return Pi(this.type);
|
|
3698
3698
|
}, p.hasPrecedingLineBreak = function() {
|
|
3699
3699
|
return F.test(this.input.slice(this.lastTokEndLoc.index, this.start));
|
|
3700
3700
|
}, p.createIdentifier = function(i, s) {
|
|
@@ -3745,7 +3745,7 @@ function _s(t) {
|
|
|
3745
3745
|
return !1;
|
|
3746
3746
|
}
|
|
3747
3747
|
if (!this.isContextualWithState(i, n)) return !1;
|
|
3748
|
-
for (var
|
|
3748
|
+
for (var f = 0; f < s; f++) this.next();
|
|
3749
3749
|
return !0;
|
|
3750
3750
|
}, p.canHaveLeadingDecorator = function() {
|
|
3751
3751
|
return this.match(o._class);
|
|
@@ -3788,8 +3788,8 @@ function _s(t) {
|
|
|
3788
3788
|
if (c === I.global) return s.tsParseAmbientExternalModuleDeclaration(i);
|
|
3789
3789
|
if (c === o._const || c === o._var) return s.match(o._const) && s.isLookaheadContextual("enum") ? (s.expect(o._const), s.tsParseEnumDeclaration(i, { const: !0, declare: !0 })) : (i.declare = !0, s.parseVarStatement(i, n || s.value, !0));
|
|
3790
3790
|
if (c === I.interface) {
|
|
3791
|
-
var
|
|
3792
|
-
if (
|
|
3791
|
+
var f = s.tsParseInterfaceDeclaration(i, { declare: !0 });
|
|
3792
|
+
if (f) return f;
|
|
3793
3793
|
}
|
|
3794
3794
|
return B(c) ? s.tsParseDeclaration(i, s.value, !0) : void 0;
|
|
3795
3795
|
});
|
|
@@ -3807,25 +3807,25 @@ function _s(t) {
|
|
|
3807
3807
|
return this.tsMatchRightRelational();
|
|
3808
3808
|
}
|
|
3809
3809
|
}, p.tsParseDelimitedListWorker = function(i, s, n, c) {
|
|
3810
|
-
for (var
|
|
3810
|
+
for (var f = [], m = -1; !this.tsIsListTerminator(i); ) {
|
|
3811
3811
|
m = -1;
|
|
3812
3812
|
var y = s();
|
|
3813
3813
|
if (y == null) return;
|
|
3814
|
-
if (
|
|
3814
|
+
if (f.push(y), !this.eat(o.comma)) {
|
|
3815
3815
|
if (this.tsIsListTerminator(i)) break;
|
|
3816
3816
|
return void (n && this.expect(o.comma));
|
|
3817
3817
|
}
|
|
3818
3818
|
m = this.lastTokStart;
|
|
3819
3819
|
}
|
|
3820
|
-
return c && (c.value = m),
|
|
3820
|
+
return c && (c.value = m), f;
|
|
3821
3821
|
}, p.tsParseDelimitedList = function(i, s, n) {
|
|
3822
3822
|
return (function(c) {
|
|
3823
3823
|
if (c == null) throw new Error("Unexpected " + c + " value.");
|
|
3824
3824
|
return c;
|
|
3825
3825
|
})(this.tsParseDelimitedListWorker(i, s, !0, n));
|
|
3826
|
-
}, p.tsParseBracketedList = function(i, s, n, c,
|
|
3826
|
+
}, p.tsParseBracketedList = function(i, s, n, c, f) {
|
|
3827
3827
|
c || this.expect(n ? o.bracketL : o.relational);
|
|
3828
|
-
var m = this.tsParseDelimitedList(i, s,
|
|
3828
|
+
var m = this.tsParseDelimitedList(i, s, f);
|
|
3829
3829
|
return this.expect(n ? o.bracketR : o.relational), m;
|
|
3830
3830
|
}, p.tsParseTypeParameterName = function() {
|
|
3831
3831
|
return this.parseIdent().name;
|
|
@@ -3906,15 +3906,15 @@ function _s(t) {
|
|
|
3906
3906
|
return this.tsInType(function() {
|
|
3907
3907
|
var n = s.startNode();
|
|
3908
3908
|
s.expect(i);
|
|
3909
|
-
var c = s.startNode(),
|
|
3910
|
-
if (
|
|
3909
|
+
var c = s.startNode(), f = !!s.tsTryParse(s.tsParseTypePredicateAsserts.bind(s));
|
|
3910
|
+
if (f && s.match(o._this)) {
|
|
3911
3911
|
var m = s.tsParseThisTypeOrThisTypePredicate();
|
|
3912
3912
|
return m.type === "TSThisType" ? (c.parameterName = m, c.asserts = !0, c.typeAnnotation = null, m = s.finishNode(c, "TSTypePredicate")) : (s.resetStartLocationFromNode(m, c), m.asserts = !0), n.typeAnnotation = m, s.finishNode(n, "TSTypeAnnotation");
|
|
3913
3913
|
}
|
|
3914
3914
|
var y = s.tsIsIdentifier() && s.tsTryParse(s.tsParseTypePredicatePrefix.bind(s));
|
|
3915
|
-
if (!y) return
|
|
3915
|
+
if (!y) return f ? (c.parameterName = s.parseIdent(), c.asserts = f, c.typeAnnotation = null, n.typeAnnotation = s.finishNode(c, "TSTypePredicate"), s.finishNode(n, "TSTypeAnnotation")) : s.tsParseTypeAnnotation(!1, n);
|
|
3916
3916
|
var x = s.tsParseTypeAnnotation(!1);
|
|
3917
|
-
return c.parameterName = y, c.typeAnnotation = x, c.asserts =
|
|
3917
|
+
return c.parameterName = y, c.typeAnnotation = x, c.asserts = f, n.typeAnnotation = s.finishNode(c, "TSTypePredicate"), s.finishNode(n, "TSTypeAnnotation");
|
|
3918
3918
|
});
|
|
3919
3919
|
}, p.tsFillSignature = function(i, s) {
|
|
3920
3920
|
var n = i === o.arrow;
|
|
@@ -3930,11 +3930,11 @@ function _s(t) {
|
|
|
3930
3930
|
return n.tsFillSignature(o.arrow, c);
|
|
3931
3931
|
}), this.finishNode(c, i);
|
|
3932
3932
|
}, p.tsParseUnionOrIntersectionType = function(i, s, n) {
|
|
3933
|
-
var c = this.startNode(),
|
|
3933
|
+
var c = this.startNode(), f = this.eat(n), m = [];
|
|
3934
3934
|
do
|
|
3935
3935
|
m.push(s());
|
|
3936
3936
|
while (this.eat(n));
|
|
3937
|
-
return m.length !== 1 ||
|
|
3937
|
+
return m.length !== 1 || f ? (c.types = m, this.finishNode(c, i)) : m[0];
|
|
3938
3938
|
}, p.tsCheckTypeAnnotationForReadOnly = function(i) {
|
|
3939
3939
|
switch (i.typeAnnotation.type) {
|
|
3940
3940
|
case "TSTupleType":
|
|
@@ -3990,11 +3990,11 @@ function _s(t) {
|
|
|
3990
3990
|
var i = this.startNode();
|
|
3991
3991
|
return i.members = this.tsParseObjectTypeMembers(), this.finishNode(i, "TSTypeLiteral");
|
|
3992
3992
|
}, p.tsParseTupleElementType = function() {
|
|
3993
|
-
var i = this.startLoc, s = this.start, n = this.eat(o.ellipsis), c = this.tsParseType(),
|
|
3993
|
+
var i = this.startLoc, s = this.start, n = this.eat(o.ellipsis), c = this.tsParseType(), f = this.eat(o.question);
|
|
3994
3994
|
if (this.eat(o.colon)) {
|
|
3995
3995
|
var m = this.startNodeAtNode(c);
|
|
3996
|
-
m.optional =
|
|
3997
|
-
} else if (
|
|
3996
|
+
m.optional = f, c.type !== "TSTypeReference" || c.typeParameters || c.typeName.type !== "Identifier" ? (this.raise(c.start, A.InvalidTupleMemberLabel), m.label = c) : m.label = c.typeName, m.elementType = this.tsParseType(), c = this.finishNode(m, "TSNamedTupleMember");
|
|
3997
|
+
} else if (f) {
|
|
3998
3998
|
var y = this.startNodeAtNode(c);
|
|
3999
3999
|
y.typeAnnotation = c, c = this.finishNode(y, "TSOptionalType");
|
|
4000
4000
|
}
|
|
@@ -4007,13 +4007,13 @@ function _s(t) {
|
|
|
4007
4007
|
var i = this, s = this.startNode();
|
|
4008
4008
|
s.elementTypes = this.tsParseBracketedList("TupleElementTypes", this.tsParseTupleElementType.bind(this), !0, !1);
|
|
4009
4009
|
var n = !1, c = null;
|
|
4010
|
-
return s.elementTypes.forEach(function(
|
|
4011
|
-
var m =
|
|
4012
|
-
!n || m === "TSRestType" || m === "TSOptionalType" || m === "TSNamedTupleMember" &&
|
|
4010
|
+
return s.elementTypes.forEach(function(f) {
|
|
4011
|
+
var m = f.type;
|
|
4012
|
+
!n || m === "TSRestType" || m === "TSOptionalType" || m === "TSNamedTupleMember" && f.optional || i.raise(f.start, A.OptionalTypeBeforeRequired), n || (n = m === "TSNamedTupleMember" && f.optional || m === "TSOptionalType");
|
|
4013
4013
|
var y = m;
|
|
4014
|
-
m === "TSRestType" && (y = (
|
|
4014
|
+
m === "TSRestType" && (y = (f = f.typeAnnotation).type);
|
|
4015
4015
|
var x = y === "TSNamedTupleMember";
|
|
4016
|
-
c != null || (c = x), c !== x && i.raise(
|
|
4016
|
+
c != null || (c = x), c !== x && i.raise(f.start, A.MixedLabeledAndUnlabeledElements);
|
|
4017
4017
|
}), this.finishNode(s, "TSTupleType");
|
|
4018
4018
|
}, p.tsParseTemplateLiteralType = function() {
|
|
4019
4019
|
var i = this.startNode();
|
|
@@ -4059,8 +4059,8 @@ function _s(t) {
|
|
|
4059
4059
|
default:
|
|
4060
4060
|
var s = this.type;
|
|
4061
4061
|
if (B(s) || s === o._void || s === o._null) {
|
|
4062
|
-
var n = s === o._void ? "TSVoidKeyword" : s === o._null ? "TSNullKeyword" : (function(
|
|
4063
|
-
switch (
|
|
4062
|
+
var n = s === o._void ? "TSVoidKeyword" : s === o._null ? "TSNullKeyword" : (function(f) {
|
|
4063
|
+
switch (f) {
|
|
4064
4064
|
case "any":
|
|
4065
4065
|
return "TSAnyKeyword";
|
|
4066
4066
|
case "boolean":
|
|
@@ -4104,7 +4104,7 @@ function _s(t) {
|
|
|
4104
4104
|
return i;
|
|
4105
4105
|
}, p.tsParseTypeOperatorOrHigher = function() {
|
|
4106
4106
|
var i = this;
|
|
4107
|
-
return
|
|
4107
|
+
return Ai(this.type) && !this.containsEsc ? this.tsParseTypeOperator() : this.isContextual("infer") ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(function() {
|
|
4108
4108
|
return i.tsParseArrayTypeOrHigher();
|
|
4109
4109
|
});
|
|
4110
4110
|
}, p.tsParseIntersectionTypeOrHigher = function() {
|
|
@@ -4173,19 +4173,19 @@ function _s(t) {
|
|
|
4173
4173
|
}
|
|
4174
4174
|
}
|
|
4175
4175
|
}, p.tsParseModifiersByMap = function(i) {
|
|
4176
|
-
for (var s = i.modified, n = i.map, c = 0,
|
|
4177
|
-
var m =
|
|
4176
|
+
for (var s = i.modified, n = i.map, c = 0, f = Object.keys(n); c < f.length; c++) {
|
|
4177
|
+
var m = f[c];
|
|
4178
4178
|
s[m] = n[m];
|
|
4179
4179
|
}
|
|
4180
4180
|
}, p.tsParseModifiers = function(i) {
|
|
4181
|
-
for (var s = this, n = i.modified, c = i.allowedModifiers,
|
|
4182
|
-
U === H && n[
|
|
4183
|
-
}, E = function(q, U, H,
|
|
4184
|
-
(n[H] && U ===
|
|
4181
|
+
for (var s = this, n = i.modified, c = i.allowedModifiers, f = i.disallowedModifiers, m = i.stopOnStartOfClassStaticBlock, y = i.errorTemplate, x = y === void 0 ? A.InvalidModifierOnTypeMember : y, b = {}, S = function(q, U, H, J) {
|
|
4182
|
+
U === H && n[J] && s.raise(q.column, A.InvalidModifiersOrder({ orderedModifiers: [H, J] }));
|
|
4183
|
+
}, E = function(q, U, H, J) {
|
|
4184
|
+
(n[H] && U === J || n[J] && U === H) && s.raise(q.column, A.IncompatibleModifiers({ modifiers: [H, J] }));
|
|
4185
4185
|
}; ; ) {
|
|
4186
|
-
var N = this.startLoc, C = this.tsParseModifier(c.concat(
|
|
4186
|
+
var N = this.startLoc, C = this.tsParseModifier(c.concat(f ?? []), m);
|
|
4187
4187
|
if (!C) break;
|
|
4188
|
-
je(C) ? n.accessibility ? this.raise(this.start, A.DuplicateAccessibilityModifier()) : (S(N, C, C, "override"), S(N, C, C, "static"), S(N, C, C, "readonly"), S(N, C, C, "accessor"), b.accessibility = C, n.accessibility = C) :
|
|
4188
|
+
je(C) ? n.accessibility ? this.raise(this.start, A.DuplicateAccessibilityModifier()) : (S(N, C, C, "override"), S(N, C, C, "static"), S(N, C, C, "readonly"), S(N, C, C, "accessor"), b.accessibility = C, n.accessibility = C) : ws(C) ? n[C] ? this.raise(this.start, A.DuplicateModifier({ modifier: C })) : (S(N, C, "in", "out"), b[C] = C, n[C] = !0) : As(C) ? n[C] ? this.raise(this.start, A.DuplicateModifier({ modifier: C })) : (E(N, C, "accessor", "readonly"), E(N, C, "accessor", "static"), E(N, C, "accessor", "override"), b[C] = C, n[C] = !0) : Object.hasOwnProperty.call(n, C) ? this.raise(this.start, A.DuplicateModifier({ modifier: C })) : (S(N, C, "static", "readonly"), S(N, C, "static", "override"), S(N, C, "override", "readonly"), S(N, C, "abstract", "override"), E(N, C, "declare", "override"), E(N, C, "static", "abstract"), b[C] = C, n[C] = !0), f != null && f.includes(C) && this.raise(this.start, x);
|
|
4189
4189
|
}
|
|
4190
4190
|
return b;
|
|
4191
4191
|
}, p.tsParseInOutModifiers = function(i) {
|
|
@@ -4199,8 +4199,8 @@ function _s(t) {
|
|
|
4199
4199
|
}), s.params.length === 0 && this.raise(this.start, A.EmptyTypeArguments), this.exprAllowed = !1, this.expect(o.relational), this.finishNode(s, "TSTypeParameterInstantiation");
|
|
4200
4200
|
}, p.tsParseHeritageClause = function(i) {
|
|
4201
4201
|
var s = this, n = this.start, c = this.tsParseDelimitedList("HeritageClauseElement", function() {
|
|
4202
|
-
var
|
|
4203
|
-
return
|
|
4202
|
+
var f = s.startNode();
|
|
4203
|
+
return f.expression = s.tsParseEntityName(), s.tsMatchLeftRelational() && (f.typeParameters = s.tsParseTypeArguments()), s.finishNode(f, "TSExpressionWithTypeArguments");
|
|
4204
4204
|
});
|
|
4205
4205
|
return c.length || this.raise(n, A.EmptyHeritageClauseType({ token: i })), c;
|
|
4206
4206
|
}, p.tsParseTypeMemberSemicolon = function() {
|
|
@@ -4219,12 +4219,12 @@ function _s(t) {
|
|
|
4219
4219
|
s && this.raise(i.start, A.ReadonlyForMethodSignature);
|
|
4220
4220
|
var c = n;
|
|
4221
4221
|
c.kind && this.tsMatchLeftRelational() && this.raise(this.start, A.AccesorCannotHaveTypeParameters), this.tsFillSignature(o.colon, c), this.tsParseTypeMemberSemicolon();
|
|
4222
|
-
var
|
|
4223
|
-
if (c.kind === "get") c[
|
|
4222
|
+
var f = "parameters", m = "typeAnnotation";
|
|
4223
|
+
if (c.kind === "get") c[f].length > 0 && (this.raise(this.start, "A 'get' accesor must not have any formal parameters."), this.isThisParam(c[f][0]) && this.raise(this.start, A.AccesorCannotDeclareThisParameter));
|
|
4224
4224
|
else if (c.kind === "set") {
|
|
4225
|
-
if (c[
|
|
4225
|
+
if (c[f].length !== 1) this.raise(this.start, "A 'get' accesor must not have any formal parameters.");
|
|
4226
4226
|
else {
|
|
4227
|
-
var y = c[
|
|
4227
|
+
var y = c[f][0];
|
|
4228
4228
|
this.isThisParam(y) && this.raise(this.start, A.AccesorCannotDeclareThisParameter), y.type === "Identifier" && y.optional && this.raise(this.start, A.SetAccesorCannotHaveOptionalParameter), y.type === "RestElement" && this.raise(this.start, A.SetAccesorCannotHaveRestParameter);
|
|
4229
4229
|
}
|
|
4230
4230
|
c[m] && this.raise(c[m].start, A.SetAccesorCannotHaveReturnType);
|
|
@@ -4261,7 +4261,7 @@ function _s(t) {
|
|
|
4261
4261
|
if (!this.hasFollowingLineBreak()) return i.abstract = !0, this.tsParseInterfaceDeclaration(i);
|
|
4262
4262
|
} else this.unexpected(i.start);
|
|
4263
4263
|
}, p.tsIsDeclarationStart = function() {
|
|
4264
|
-
return
|
|
4264
|
+
return ki(this.type);
|
|
4265
4265
|
}, p.tsParseExpressionStatement = function(i, s) {
|
|
4266
4266
|
switch (s.name) {
|
|
4267
4267
|
case "declare":
|
|
@@ -4289,10 +4289,10 @@ function _s(t) {
|
|
|
4289
4289
|
if (B(c.type) && !this.isContextualWithState("from", c) || c.type === o.braceL) return !1;
|
|
4290
4290
|
}
|
|
4291
4291
|
} else if (!this.match(o._default)) return !1;
|
|
4292
|
-
var
|
|
4293
|
-
if (this.input.charCodeAt(
|
|
4292
|
+
var f = this.nextTokenStart(), m = this.isUnparsedContextual(f, "from");
|
|
4293
|
+
if (this.input.charCodeAt(f) === 44 || B(this.type) && m) return !0;
|
|
4294
4294
|
if (this.match(o._default) && m) {
|
|
4295
|
-
var y = this.input.charCodeAt(this.nextTokenStartSince(
|
|
4295
|
+
var y = this.input.charCodeAt(this.nextTokenStartSince(f + 4));
|
|
4296
4296
|
return y === 34 || y === 39;
|
|
4297
4297
|
}
|
|
4298
4298
|
return !1;
|
|
@@ -4359,25 +4359,25 @@ function _s(t) {
|
|
|
4359
4359
|
var n = this.nextTokenStart(), c = this.isUnparsedContextual(n, "from");
|
|
4360
4360
|
if (this.input.charCodeAt(n) === 44 || B(this.type) && c) return !0;
|
|
4361
4361
|
if (this.match(o._default) && c) {
|
|
4362
|
-
var
|
|
4363
|
-
return
|
|
4362
|
+
var f = this.input.charCodeAt(this.nextTokenStartSince(n + 4));
|
|
4363
|
+
return f === 34 || f === 39;
|
|
4364
4364
|
}
|
|
4365
4365
|
return !1;
|
|
4366
4366
|
}, p.parseTemplate = function(i) {
|
|
4367
4367
|
var s = (i === void 0 ? {} : i).isTagged, n = s !== void 0 && s, c = this.startNode();
|
|
4368
4368
|
this.next(), c.expressions = [];
|
|
4369
|
-
var
|
|
4370
|
-
for (c.quasis = [
|
|
4369
|
+
var f = this.parseTemplateElement({ isTagged: n });
|
|
4370
|
+
for (c.quasis = [f]; !f.tail; ) this.type === o.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(o.dollarBraceL), c.expressions.push(this.inType ? this.tsParseType() : this.parseExpression()), this.expect(o.braceR), c.quasis.push(f = this.parseTemplateElement({ isTagged: n }));
|
|
4371
4371
|
return this.next(), this.finishNode(c, "TemplateLiteral");
|
|
4372
|
-
}, p.parseFunction = function(i, s, n, c,
|
|
4372
|
+
}, p.parseFunction = function(i, s, n, c, f) {
|
|
4373
4373
|
this.initFunction(i), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !c) && (this.type === o.star && 2 & s && this.unexpected(), i.generator = this.eat(o.star)), this.options.ecmaVersion >= 8 && (i.async = !!c), 1 & s && (i.id = 4 & s && this.type !== o.name ? null : this.parseIdent());
|
|
4374
4374
|
var m = this.yieldPos, y = this.awaitPos, x = this.awaitIdentPos, b = this.maybeInArrowParameters;
|
|
4375
4375
|
this.maybeInArrowParameters = !1, this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(pe(i.async, i.generator)), 1 & s || (i.id = this.type === o.name ? this.parseIdent() : null), this.parseFunctionParams(i);
|
|
4376
4376
|
var S = 1 & s;
|
|
4377
|
-
return this.parseFunctionBody(i, n, !1,
|
|
4378
|
-
}, p.parseFunctionBody = function(i, s, n, c,
|
|
4377
|
+
return this.parseFunctionBody(i, n, !1, f, { isFunctionDeclaration: S }), this.yieldPos = m, this.awaitPos = y, this.awaitIdentPos = x, 1 & s && i.id && !(2 & s) && this.checkLValSimple(i.id, i.body ? this.strict || i.generator || i.async ? this.treatFunctionsAsVar ? 1 : 2 : 3 : 0), this.maybeInArrowParameters = b, this.finishNode(i, S ? "FunctionDeclaration" : "FunctionExpression");
|
|
4378
|
+
}, p.parseFunctionBody = function(i, s, n, c, f) {
|
|
4379
4379
|
s === void 0 && (s = !1), n === void 0 && (n = !1), c === void 0 && (c = !1), this.match(o.colon) && (i.returnType = this.tsParseTypeOrTypePredicateAnnotation(o.colon));
|
|
4380
|
-
var m =
|
|
4380
|
+
var m = f != null && f.isFunctionDeclaration ? "TSDeclareFunction" : f != null && f.isClassMethod ? "TSDeclareMethod" : void 0;
|
|
4381
4381
|
return m && !this.match(o.braceL) && this.isLineTerminator() ? this.finishNode(i, m) : m === "TSDeclareFunction" && this.isAmbientContext && (this.raise(i.start, A.DeclareFunctionHasImplementation), i.declare) ? (T.prototype.parseFunctionBody.call(this, i, s, n, !1), this.finishNode(i, m)) : (T.prototype.parseFunctionBody.call(this, i, s, n, c), i);
|
|
4382
4382
|
}, p.parseNew = function() {
|
|
4383
4383
|
var i;
|
|
@@ -4388,19 +4388,19 @@ function _s(t) {
|
|
|
4388
4388
|
var c = this.containsEsc;
|
|
4389
4389
|
return s.property = this.parseIdent(!0), s.property.name !== "target" && this.raiseRecoverable(s.property.start, "The only valid meta property for new is 'new.target'"), c && this.raiseRecoverable(s.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(s.start, "'new.target' can only be used in functions and class static block"), this.finishNode(s, "MetaProperty");
|
|
4390
4390
|
}
|
|
4391
|
-
var
|
|
4392
|
-
s.callee = this.parseSubscripts(this.parseExprAtom(),
|
|
4391
|
+
var f = this.start, m = this.startLoc, y = this.type === o._import;
|
|
4392
|
+
s.callee = this.parseSubscripts(this.parseExprAtom(), f, m, !0, !1), y && s.callee.type === "ImportExpression" && this.raise(f, "Cannot use new with import()");
|
|
4393
4393
|
var x = s.callee;
|
|
4394
4394
|
return x.type !== "TSInstantiationExpression" || (i = x.extra) != null && i.parenthesized || (s.typeParameters = x.typeParameters, s.callee = x.expression), s.arguments = this.eat(o.parenL) ? this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1) : [], this.finishNode(s, "NewExpression");
|
|
4395
|
-
}, p.parseExprOp = function(i, s, n, c,
|
|
4395
|
+
}, p.parseExprOp = function(i, s, n, c, f) {
|
|
4396
4396
|
var m;
|
|
4397
|
-
if (o._in.binop > c && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (m = "TSAsExpression"),
|
|
4397
|
+
if (o._in.binop > c && !this.hasPrecedingLineBreak() && (this.isContextual("as") && (m = "TSAsExpression"), l && this.isContextual("satisfies") && (m = "TSSatisfiesExpression"), m)) {
|
|
4398
4398
|
var y = this.startNodeAt(s, n);
|
|
4399
4399
|
y.expression = i;
|
|
4400
4400
|
var x = this.tsTryNextParseConstantContext();
|
|
4401
|
-
return y.typeAnnotation = x || this.tsNextThenParseType(), this.finishNode(y, m), this.reScan_lt_gt(), this.parseExprOp(y, s, n, c,
|
|
4401
|
+
return y.typeAnnotation = x || this.tsNextThenParseType(), this.finishNode(y, m), this.reScan_lt_gt(), this.parseExprOp(y, s, n, c, f);
|
|
4402
4402
|
}
|
|
4403
|
-
return T.prototype.parseExprOp.call(this, i, s, n, c,
|
|
4403
|
+
return T.prototype.parseExprOp.call(this, i, s, n, c, f);
|
|
4404
4404
|
}, p.parseImportSpecifiers = function() {
|
|
4405
4405
|
var i = [], s = !0;
|
|
4406
4406
|
if (g.tokenIsIdentifier(this.type) && (i.push(this.parseImportDefaultSpecifier()), !this.eat(o.comma))) return i;
|
|
@@ -4452,8 +4452,8 @@ function _s(t) {
|
|
|
4452
4452
|
return this.importOrExportOuterKind = void 0, c;
|
|
4453
4453
|
}
|
|
4454
4454
|
if (this.ts_eatWithState(o.eq, 2, n)) {
|
|
4455
|
-
var
|
|
4456
|
-
return
|
|
4455
|
+
var f = i;
|
|
4456
|
+
return f.expression = this.parseExpression(), this.semicolon(), this.importOrExportOuterKind = void 0, this.finishNode(f, "TSExportAssignment");
|
|
4457
4457
|
}
|
|
4458
4458
|
if (this.ts_eatContextualWithState("as", 2, n)) {
|
|
4459
4459
|
var m = i;
|
|
@@ -4493,11 +4493,11 @@ function _s(t) {
|
|
|
4493
4493
|
if (this.type === I.jsxTagStart) return this.jsx_parseElement();
|
|
4494
4494
|
if (this.type === I.at) return this.parseDecorators(), this.parseExprAtom();
|
|
4495
4495
|
if (B(this.type)) {
|
|
4496
|
-
var c = this.potentialArrowAt === this.start,
|
|
4497
|
-
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(o._function)) return this.overrideContext(
|
|
4496
|
+
var c = this.potentialArrowAt === this.start, f = this.start, m = this.startLoc, y = this.containsEsc, x = this.parseIdent(!1);
|
|
4497
|
+
if (this.options.ecmaVersion >= 8 && !y && x.name === "async" && !this.canInsertSemicolon() && this.eat(o._function)) return this.overrideContext(G.f_expr), this.parseFunction(this.startNodeAt(f, m), 0, !1, !0, s);
|
|
4498
4498
|
if (c && !this.canInsertSemicolon()) {
|
|
4499
|
-
if (this.eat(o.arrow)) return this.parseArrowExpression(this.startNodeAt(
|
|
4500
|
-
if (this.options.ecmaVersion >= 8 && x.name === "async" && this.type === o.name && !y && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return x = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(
|
|
4499
|
+
if (this.eat(o.arrow)) return this.parseArrowExpression(this.startNodeAt(f, m), [x], !1, s);
|
|
4500
|
+
if (this.options.ecmaVersion >= 8 && x.name === "async" && this.type === o.name && !y && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return x = this.parseIdent(!1), !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAt(f, m), [x], !0, s);
|
|
4501
4501
|
}
|
|
4502
4502
|
return x;
|
|
4503
4503
|
}
|
|
@@ -4510,8 +4510,8 @@ function _s(t) {
|
|
|
4510
4510
|
if (c === o._function) return this.next(), this.parseFunction(this.startNodeAtNode(n), void 0, !0, !0);
|
|
4511
4511
|
if (B(c)) {
|
|
4512
4512
|
if (this.lookaheadCharCode() === 61) {
|
|
4513
|
-
var
|
|
4514
|
-
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(n), [
|
|
4513
|
+
var f = this.parseIdent(!1);
|
|
4514
|
+
return !this.canInsertSemicolon() && this.eat(o.arrow) || this.unexpected(), this.parseArrowExpression(this.startNodeAtNode(n), [f], !0);
|
|
4515
4515
|
}
|
|
4516
4516
|
return n;
|
|
4517
4517
|
}
|
|
@@ -4526,13 +4526,13 @@ function _s(t) {
|
|
|
4526
4526
|
n === void 0 && (n = !1);
|
|
4527
4527
|
var c = this.isAmbientContext;
|
|
4528
4528
|
this.next(), T.prototype.parseVar.call(this, i, !1, s, n || c), this.semicolon();
|
|
4529
|
-
var
|
|
4530
|
-
if (!c) return
|
|
4531
|
-
for (var m, y = De(
|
|
4529
|
+
var f = this.finishNode(i, "VariableDeclaration");
|
|
4530
|
+
if (!c) return f;
|
|
4531
|
+
for (var m, y = De(f.declarations); !(m = y()).done; ) {
|
|
4532
4532
|
var x = m.value, b = x.init;
|
|
4533
|
-
b && (s !== "const" || x.id.typeAnnotation ? this.raise(b.start, A.InitializerNotAllowedInAmbientContext) : b.type !== "StringLiteral" && b.type !== "BooleanLiteral" && b.type !== "NumericLiteral" && b.type !== "BigIntLiteral" && (b.type !== "TemplateLiteral" || b.expressions.length > 0) && !
|
|
4533
|
+
b && (s !== "const" || x.id.typeAnnotation ? this.raise(b.start, A.InitializerNotAllowedInAmbientContext) : b.type !== "StringLiteral" && b.type !== "BooleanLiteral" && b.type !== "NumericLiteral" && b.type !== "BigIntLiteral" && (b.type !== "TemplateLiteral" || b.expressions.length > 0) && !Es(b) && this.raise(b.start, A.ConstInitiailizerMustBeStringOrNumericLiteralOrLiteralEnumReference));
|
|
4534
4534
|
}
|
|
4535
|
-
return
|
|
4535
|
+
return f;
|
|
4536
4536
|
}, p.parseStatement = function(i, s, n) {
|
|
4537
4537
|
if (this.match(I.at) && this.parseDecorators(!0), this.match(o._const) && this.isLookaheadContextual("enum")) {
|
|
4538
4538
|
var c = this.startNode();
|
|
@@ -4540,8 +4540,8 @@ function _s(t) {
|
|
|
4540
4540
|
}
|
|
4541
4541
|
if (this.ts_isContextual(I.enum)) return this.tsParseEnumDeclaration(this.startNode());
|
|
4542
4542
|
if (this.ts_isContextual(I.interface)) {
|
|
4543
|
-
var
|
|
4544
|
-
if (
|
|
4543
|
+
var f = this.tsParseInterfaceDeclaration(this.startNode());
|
|
4544
|
+
if (f) return f;
|
|
4545
4545
|
}
|
|
4546
4546
|
return T.prototype.parseStatement.call(this, i, s, n);
|
|
4547
4547
|
}, p.parseAccessModifier = function() {
|
|
@@ -4552,18 +4552,18 @@ function _s(t) {
|
|
|
4552
4552
|
return (s.type === "Identifier" ? this.tsParseExpressionStatement(i, s) : void 0) || T.prototype.parseExpressionStatement.call(this, i, s);
|
|
4553
4553
|
}, p.shouldParseExportStatement = function() {
|
|
4554
4554
|
return !!this.tsIsDeclarationStart() || !!this.match(I.at) || T.prototype.shouldParseExportStatement.call(this);
|
|
4555
|
-
}, p.parseConditional = function(i, s, n, c,
|
|
4555
|
+
}, p.parseConditional = function(i, s, n, c, f) {
|
|
4556
4556
|
if (this.eat(o.question)) {
|
|
4557
4557
|
var m = this.startNodeAt(s, n);
|
|
4558
4558
|
return m.test = i, m.consequent = this.parseMaybeAssign(), this.expect(o.colon), m.alternate = this.parseMaybeAssign(c), this.finishNode(m, "ConditionalExpression");
|
|
4559
4559
|
}
|
|
4560
4560
|
return i;
|
|
4561
4561
|
}, p.parseMaybeConditional = function(i, s) {
|
|
4562
|
-
var n = this, c = this.start,
|
|
4562
|
+
var n = this, c = this.start, f = this.startLoc, m = this.parseExprOps(i, s);
|
|
4563
4563
|
if (this.checkExpressionErrors(s)) return m;
|
|
4564
|
-
if (!this.maybeInArrowParameters || !this.match(o.question)) return this.parseConditional(m, c,
|
|
4564
|
+
if (!this.maybeInArrowParameters || !this.match(o.question)) return this.parseConditional(m, c, f, i, s);
|
|
4565
4565
|
var y = this.tryParse(function() {
|
|
4566
|
-
return n.parseConditional(m, c,
|
|
4566
|
+
return n.parseConditional(m, c, f, i, s);
|
|
4567
4567
|
});
|
|
4568
4568
|
return y.node ? (y.error && this.setLookaheadState(y.failState), y.node) : (y.error && this.setOptionalParametersError(s, y.error), m);
|
|
4569
4569
|
}, p.parseParenItem = function(i) {
|
|
@@ -4578,10 +4578,10 @@ function _s(t) {
|
|
|
4578
4578
|
if (!this.isAmbientContext && this.ts_isContextual(I.declare)) return this.tsInAmbientContext(function() {
|
|
4579
4579
|
return s.parseExportDeclaration(i);
|
|
4580
4580
|
});
|
|
4581
|
-
var n = this.start, c = this.startLoc,
|
|
4582
|
-
!
|
|
4581
|
+
var n = this.start, c = this.startLoc, f = this.eatContextual("declare");
|
|
4582
|
+
!f || !this.ts_isContextual(I.declare) && this.shouldParseExportStatement() || this.raise(this.start, A.ExpectedAmbientAfterExportDeclare);
|
|
4583
4583
|
var m = B(this.type) && this.tsTryParseExportDeclaration() || this.parseStatement(null);
|
|
4584
|
-
return m ? ((m.type === "TSInterfaceDeclaration" || m.type === "TSTypeAliasDeclaration" ||
|
|
4584
|
+
return m ? ((m.type === "TSInterfaceDeclaration" || m.type === "TSTypeAliasDeclaration" || f) && (i.exportKind = "type"), f && (this.resetStartLocation(m, n, c), m.declare = !0), m) : null;
|
|
4585
4585
|
}, p.parseClassId = function(i, s) {
|
|
4586
4586
|
if (s || !this.isContextual("implements")) {
|
|
4587
4587
|
T.prototype.parseClassId.call(this, i, s);
|
|
@@ -4600,8 +4600,8 @@ function _s(t) {
|
|
|
4600
4600
|
}
|
|
4601
4601
|
return T.prototype.parseClassField.call(this, i);
|
|
4602
4602
|
}, p.parseClassMethod = function(i, s, n, c) {
|
|
4603
|
-
var
|
|
4604
|
-
m ? (y && (i.typeParameters = y), i.accessibility && this.raise(i.start, A.PrivateMethodsHasAccessibility({ modifier: i.accessibility }))) : y &&
|
|
4603
|
+
var f = i.kind === "constructor", m = i.key.type === "PrivateIdentifier", y = this.tsTryParseTypeParameters();
|
|
4604
|
+
m ? (y && (i.typeParameters = y), i.accessibility && this.raise(i.start, A.PrivateMethodsHasAccessibility({ modifier: i.accessibility }))) : y && f && this.raise(y.start, A.ConstructorHasTypeParameters);
|
|
4605
4605
|
var x = i.declare, b = i.kind;
|
|
4606
4606
|
!(x !== void 0 && x) || b !== "get" && b !== "set" || this.raise(i.start, A.DeclareAccessor({ kind: b })), y && (i.typeParameters = y);
|
|
4607
4607
|
var S = i.key;
|
|
@@ -4613,25 +4613,25 @@ function _s(t) {
|
|
|
4613
4613
|
}, p.parseClassElement = function(i) {
|
|
4614
4614
|
var s = this;
|
|
4615
4615
|
if (this.eat(o.semi)) return null;
|
|
4616
|
-
var n, c = this.options.ecmaVersion,
|
|
4616
|
+
var n, c = this.options.ecmaVersion, f = this.startNode(), m = "", y = !1, x = !1, b = "method", S = ["declare", "private", "public", "protected", "accessor", "override", "abstract", "readonly", "static"], E = this.tsParseModifiers({ modified: f, allowedModifiers: S, disallowedModifiers: ["in", "out"], stopOnStartOfClassStaticBlock: !0, errorTemplate: A.InvalidModifierOnTypeParameterPositions });
|
|
4617
4617
|
n = !!E.static;
|
|
4618
4618
|
var N = function() {
|
|
4619
4619
|
if (!s.tsIsStartOfStaticBlocks()) {
|
|
4620
|
-
var C = s.tsTryParseIndexSignature(
|
|
4621
|
-
if (C) return
|
|
4622
|
-
if (!s.inAbstractClass &&
|
|
4620
|
+
var C = s.tsTryParseIndexSignature(f);
|
|
4621
|
+
if (C) return f.abstract && s.raise(f.start, A.IndexSignatureHasAbstract), f.accessibility && s.raise(f.start, A.IndexSignatureHasAccessibility({ modifier: f.accessibility })), f.declare && s.raise(f.start, A.IndexSignatureHasDeclare), f.override && s.raise(f.start, A.IndexSignatureHasOverride), C;
|
|
4622
|
+
if (!s.inAbstractClass && f.abstract && s.raise(f.start, A.NonAbstractClassHasAbstractMethod), f.override && i && s.raise(f.start, A.OverrideNotInSubClass), f.static = n, n && (s.isClassElementNameStart() || s.type === o.star || (m = "static")), !m && c >= 8 && s.eatContextual("async") && (!s.isClassElementNameStart() && s.type !== o.star || s.canInsertSemicolon() ? m = "async" : x = !0), !m && (c >= 9 || !x) && s.eat(o.star) && (y = !0), !m && !x && !y) {
|
|
4623
4623
|
var q = s.value;
|
|
4624
4624
|
(s.eatContextual("get") || s.eatContextual("set")) && (s.isClassElementNameStart() ? b = q : m = q);
|
|
4625
4625
|
}
|
|
4626
|
-
if (m ? (
|
|
4627
|
-
var U = !
|
|
4628
|
-
U && b !== "method" && s.raise(
|
|
4629
|
-
} else s.parseClassField(
|
|
4630
|
-
return
|
|
4626
|
+
if (m ? (f.computed = !1, f.key = s.startNodeAt(s.lastTokStart, s.lastTokStartLoc), f.key.name = m, s.finishNode(f.key, "Identifier")) : s.parseClassElementName(f), s.parsePostMemberNameModifiers(f), s.isClassMethod() || c < 13 || s.type === o.parenL || b !== "method" || y || x) {
|
|
4627
|
+
var U = !f.static && Fe(f, "constructor"), H = U && i;
|
|
4628
|
+
U && b !== "method" && s.raise(f.key.start, "Constructor can't have get/set modifier"), f.kind = U ? "constructor" : b, s.parseClassMethod(f, y, x, H);
|
|
4629
|
+
} else s.parseClassField(f);
|
|
4630
|
+
return f;
|
|
4631
4631
|
}
|
|
4632
|
-
if (s.next(), s.next(), s.tsHasSomeModifiers(
|
|
4632
|
+
if (s.next(), s.next(), s.tsHasSomeModifiers(f, S) && s.raise(s.start, A.StaticBlockCannotHaveModifier), c >= 13) return T.prototype.parseClassStaticBlock.call(s, f), f;
|
|
4633
4633
|
};
|
|
4634
|
-
return
|
|
4634
|
+
return f.declare ? this.tsInAmbientContext(N) : N(), f;
|
|
4635
4635
|
}, p.isClassElementNameStart = function() {
|
|
4636
4636
|
return !!this.tsIsIdentifier() || T.prototype.isClassElementNameStart.call(this);
|
|
4637
4637
|
}, p.parseClassSuper = function(i) {
|
|
@@ -4645,17 +4645,17 @@ function _s(t) {
|
|
|
4645
4645
|
n && (i.id.typeAnnotation = n, this.resetEndLocation(i.id));
|
|
4646
4646
|
}, p.parseArrowExpression = function(i, s, n, c) {
|
|
4647
4647
|
this.match(o.colon) && (i.returnType = this.tsParseTypeAnnotation());
|
|
4648
|
-
var
|
|
4648
|
+
var f = this.yieldPos, m = this.awaitPos, y = this.awaitIdentPos;
|
|
4649
4649
|
this.enterScope(16 | pe(n, !1)), this.initFunction(i);
|
|
4650
4650
|
var x = this.maybeInArrowParameters;
|
|
4651
|
-
return this.options.ecmaVersion >= 8 && (i.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, i.params = this.toAssignableList(s, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(i, !0, !1, c), this.yieldPos =
|
|
4651
|
+
return this.options.ecmaVersion >= 8 && (i.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.maybeInArrowParameters = !0, i.params = this.toAssignableList(s, !0), this.maybeInArrowParameters = !1, this.parseFunctionBody(i, !0, !1, c), this.yieldPos = f, this.awaitPos = m, this.awaitIdentPos = y, this.maybeInArrowParameters = x, this.finishNode(i, "ArrowFunctionExpression");
|
|
4652
4652
|
}, p.parseMaybeAssignOrigin = function(i, s, n) {
|
|
4653
4653
|
if (this.isContextual("yield")) {
|
|
4654
4654
|
if (this.inGenerator) return this.parseYield(i);
|
|
4655
4655
|
this.exprAllowed = !1;
|
|
4656
4656
|
}
|
|
4657
|
-
var c = !1,
|
|
4658
|
-
s ? (
|
|
4657
|
+
var c = !1, f = -1, m = -1, y = -1;
|
|
4658
|
+
s ? (f = s.parenthesizedAssign, m = s.trailingComma, y = s.doubleProto, s.parenthesizedAssign = s.trailingComma = -1) : (s = new Ot(), c = !0);
|
|
4659
4659
|
var x = this.start, b = this.startLoc;
|
|
4660
4660
|
(this.type === o.parenL || B(this.type)) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = i === "await");
|
|
4661
4661
|
var S = this.parseMaybeConditional(i, s);
|
|
@@ -4663,15 +4663,15 @@ function _s(t) {
|
|
|
4663
4663
|
var E = this.startNodeAt(x, b);
|
|
4664
4664
|
return E.operator = this.value, this.type === o.eq && (S = this.toAssignable(S, !0, s)), c || (s.parenthesizedAssign = s.trailingComma = s.doubleProto = -1), s.shorthandAssign >= S.start && (s.shorthandAssign = -1), this.type === o.eq ? this.checkLValPattern(S) : this.checkLValSimple(S), E.left = S, this.next(), E.right = this.parseMaybeAssign(i), y > -1 && (s.doubleProto = y), this.finishNode(E, "AssignmentExpression");
|
|
4665
4665
|
}
|
|
4666
|
-
return c && this.checkExpressionErrors(s, !0),
|
|
4666
|
+
return c && this.checkExpressionErrors(s, !0), f > -1 && (s.parenthesizedAssign = f), m > -1 && (s.trailingComma = m), S;
|
|
4667
4667
|
}, p.parseMaybeAssign = function(i, s, n) {
|
|
4668
|
-
var c,
|
|
4668
|
+
var c, f, m, y, x, b, S, E, N, C, q, U = this;
|
|
4669
4669
|
if (this.matchJsx("jsxTagStart") || this.tsMatchLeftRelational()) {
|
|
4670
4670
|
if (E = this.cloneCurLookaheadState(), !(N = this.tryParse(function() {
|
|
4671
4671
|
return U.parseMaybeAssignOrigin(i, s, n);
|
|
4672
4672
|
}, E)).error) return N.node;
|
|
4673
|
-
var H = this.context,
|
|
4674
|
-
|
|
4673
|
+
var H = this.context, J = H[H.length - 1];
|
|
4674
|
+
J === g.tokContexts.tc_oTag && H[H.length - 2] === g.tokContexts.tc_expr ? (H.pop(), H.pop()) : J !== g.tokContexts.tc_oTag && J !== g.tokContexts.tc_expr || H.pop();
|
|
4675
4675
|
}
|
|
4676
4676
|
if (!((c = N) != null && c.error || this.tsMatchLeftRelational())) return this.parseMaybeAssignOrigin(i, s, n);
|
|
4677
4677
|
E && !this.compareLookaheadState(E, this.getCurLookaheadState()) || (E = this.cloneCurLookaheadState());
|
|
@@ -4685,22 +4685,22 @@ function _s(t) {
|
|
|
4685
4685
|
if (!N && (Be(!0), !(C = this.tryParse(function() {
|
|
4686
4686
|
return U.parseMaybeAssignOrigin(i, s, n);
|
|
4687
4687
|
}, E)).error)) return C.node;
|
|
4688
|
-
if ((
|
|
4688
|
+
if ((f = N) != null && f.node) return this.setLookaheadState(N.failState), N.node;
|
|
4689
4689
|
if (rt.node) return this.setLookaheadState(rt.failState), q && this.reportReservedArrowTypeParam(q), rt.node;
|
|
4690
4690
|
if ((m = C) != null && m.node) return this.setLookaheadState(C.failState), C.node;
|
|
4691
4691
|
throw (y = N) != null && y.thrown ? N.error : rt.thrown ? rt.error : (x = C) != null && x.thrown ? C.error : ((b = N) == null ? void 0 : b.error) || rt.error || ((S = C) == null ? void 0 : S.error);
|
|
4692
4692
|
}, p.parseAssignableListItem = function(i) {
|
|
4693
4693
|
for (var s = []; this.match(I.at); ) s.push(this.parseDecorator());
|
|
4694
|
-
var n, c = this.start,
|
|
4694
|
+
var n, c = this.start, f = this.startLoc, m = !1, y = !1;
|
|
4695
4695
|
if (i !== void 0) {
|
|
4696
4696
|
var x = {};
|
|
4697
|
-
this.tsParseModifiers({ modified: x, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), n = x.accessibility, y = x.override, m = x.readonly, i === !1 && (n || m || y) && this.raise(
|
|
4697
|
+
this.tsParseModifiers({ modified: x, allowedModifiers: ["public", "private", "protected", "override", "readonly"] }), n = x.accessibility, y = x.override, m = x.readonly, i === !1 && (n || m || y) && this.raise(f.start, A.UnexpectedParameterModifier);
|
|
4698
4698
|
}
|
|
4699
|
-
var b = this.parseMaybeDefault(c,
|
|
4699
|
+
var b = this.parseMaybeDefault(c, f);
|
|
4700
4700
|
this.parseBindingListItem(b);
|
|
4701
4701
|
var S = this.parseMaybeDefault(b.start, b.loc, b);
|
|
4702
4702
|
if (s.length && (S.decorators = s), n || m || y) {
|
|
4703
|
-
var E = this.startNodeAt(c,
|
|
4703
|
+
var E = this.startNodeAt(c, f);
|
|
4704
4704
|
return n && (E.accessibility = n), m && (E.readonly = m), y && (E.override = y), S.type !== "Identifier" && S.type !== "AssignmentPattern" && this.raise(E.start, A.UnsupportedParameterPropertyKind), E.parameter = S, this.finishNode(E, "TSParameterProperty");
|
|
4705
4705
|
}
|
|
4706
4706
|
return S;
|
|
@@ -4724,8 +4724,8 @@ function _s(t) {
|
|
|
4724
4724
|
return !0;
|
|
4725
4725
|
case "ObjectExpression":
|
|
4726
4726
|
var c = i.properties.length - 1;
|
|
4727
|
-
return i.properties.every(function(
|
|
4728
|
-
return
|
|
4727
|
+
return i.properties.every(function(f, m) {
|
|
4728
|
+
return f.type !== "ObjectMethod" && (m === c || f.type !== "SpreadElement") && n.isAssignable(f);
|
|
4729
4729
|
});
|
|
4730
4730
|
case "Property":
|
|
4731
4731
|
case "ObjectProperty":
|
|
@@ -4733,8 +4733,8 @@ function _s(t) {
|
|
|
4733
4733
|
case "SpreadElement":
|
|
4734
4734
|
return this.isAssignable(i.argument);
|
|
4735
4735
|
case "ArrayExpression":
|
|
4736
|
-
return i.elements.every(function(
|
|
4737
|
-
return
|
|
4736
|
+
return i.elements.every(function(f) {
|
|
4737
|
+
return f === null || n.isAssignable(f);
|
|
4738
4738
|
});
|
|
4739
4739
|
case "AssignmentExpression":
|
|
4740
4740
|
return i.operator === "=";
|
|
@@ -4790,13 +4790,13 @@ function _s(t) {
|
|
|
4790
4790
|
return this.type === o._this ? this.parseIdent(!0) : T.prototype.parseBindingAtom.call(this);
|
|
4791
4791
|
}, p.shouldParseArrow = function(i) {
|
|
4792
4792
|
var s, n = this;
|
|
4793
|
-
if (s = this.match(o.colon) ? i.every(function(
|
|
4794
|
-
return n.isAssignable(
|
|
4793
|
+
if (s = this.match(o.colon) ? i.every(function(f) {
|
|
4794
|
+
return n.isAssignable(f, !0);
|
|
4795
4795
|
}) : !this.canInsertSemicolon()) {
|
|
4796
4796
|
if (this.match(o.colon)) {
|
|
4797
|
-
var c = this.tryParse(function(
|
|
4797
|
+
var c = this.tryParse(function(f) {
|
|
4798
4798
|
var m = n.tsParseTypeOrTypePredicateAnnotation(o.colon);
|
|
4799
|
-
return !n.canInsertSemicolon() && n.match(o.arrow) ||
|
|
4799
|
+
return !n.canInsertSemicolon() && n.match(o.arrow) || f(), m;
|
|
4800
4800
|
});
|
|
4801
4801
|
if (c.aborted) return this.shouldParseArrowReturnType = void 0, !1;
|
|
4802
4802
|
c.thrown || (c.error && this.setLookaheadState(c.failState), this.shouldParseArrowReturnType = c.node);
|
|
@@ -4805,10 +4805,10 @@ function _s(t) {
|
|
|
4805
4805
|
}
|
|
4806
4806
|
return this.shouldParseArrowReturnType = void 0, s;
|
|
4807
4807
|
}, p.parseParenArrowList = function(i, s, n, c) {
|
|
4808
|
-
var
|
|
4809
|
-
return
|
|
4808
|
+
var f = this.startNodeAt(i, s);
|
|
4809
|
+
return f.returnType = this.shouldParseArrowReturnType, this.shouldParseArrowReturnType = void 0, this.parseArrowExpression(f, n, !1, c);
|
|
4810
4810
|
}, p.parseParenAndDistinguishExpression = function(i, s) {
|
|
4811
|
-
var n, c = this.start,
|
|
4811
|
+
var n, c = this.start, f = this.startLoc, m = this.options.ecmaVersion >= 8;
|
|
4812
4812
|
if (this.options.ecmaVersion >= 6) {
|
|
4813
4813
|
var y = this.maybeInArrowParameters;
|
|
4814
4814
|
this.maybeInArrowParameters = !0, this.next();
|
|
@@ -4824,18 +4824,18 @@ function _s(t) {
|
|
|
4824
4824
|
}
|
|
4825
4825
|
E.push(this.parseMaybeAssign(s, q, this.parseParenItem));
|
|
4826
4826
|
}
|
|
4827
|
-
var
|
|
4828
|
-
if (this.expect(o.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(o.arrow)) return this.checkPatternErrors(q, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = U, this.awaitPos = H, this.parseParenArrowList(c,
|
|
4829
|
-
E.length && !C || this.unexpected(this.lastTokStart), x && this.unexpected(x), this.checkExpressionErrors(q, !0), this.yieldPos = U || this.yieldPos, this.awaitPos = H || this.awaitPos, E.length > 1 ? ((n = this.startNodeAt(b, S)).expressions = E, this.finishNodeAt(n, "SequenceExpression",
|
|
4827
|
+
var J = this.lastTokEnd, rt = this.lastTokEndLoc;
|
|
4828
|
+
if (this.expect(o.parenR), this.maybeInArrowParameters = y, i && this.shouldParseArrow(E) && this.eat(o.arrow)) return this.checkPatternErrors(q, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = U, this.awaitPos = H, this.parseParenArrowList(c, f, E, s);
|
|
4829
|
+
E.length && !C || this.unexpected(this.lastTokStart), x && this.unexpected(x), this.checkExpressionErrors(q, !0), this.yieldPos = U || this.yieldPos, this.awaitPos = H || this.awaitPos, E.length > 1 ? ((n = this.startNodeAt(b, S)).expressions = E, this.finishNodeAt(n, "SequenceExpression", J, rt)) : n = E[0];
|
|
4830
4830
|
} else n = this.parseParenExpression();
|
|
4831
4831
|
if (this.options.preserveParens) {
|
|
4832
|
-
var vt = this.startNodeAt(c,
|
|
4832
|
+
var vt = this.startNodeAt(c, f);
|
|
4833
4833
|
return vt.expression = n, this.finishNode(vt, "ParenthesizedExpression");
|
|
4834
4834
|
}
|
|
4835
4835
|
return n;
|
|
4836
4836
|
}, p.parseTaggedTemplateExpression = function(i, s, n, c) {
|
|
4837
|
-
var
|
|
4838
|
-
return
|
|
4837
|
+
var f = this.startNodeAt(s, n);
|
|
4838
|
+
return f.tag = i, f.quasi = this.parseTemplate({ isTagged: !0 }), c && this.raise(s, "Tagged Template Literals are not allowed in optionalChain."), this.finishNode(f, "TaggedTemplateExpression");
|
|
4839
4839
|
}, p.shouldParseAsyncArrow = function() {
|
|
4840
4840
|
var i = this;
|
|
4841
4841
|
if (!this.match(o.colon)) return !this.canInsertSemicolon() && this.eat(o.arrow);
|
|
@@ -4845,17 +4845,17 @@ function _s(t) {
|
|
|
4845
4845
|
});
|
|
4846
4846
|
return s.aborted ? (this.shouldParseAsyncArrowReturnType = void 0, !1) : s.thrown ? void 0 : (s.error && this.setLookaheadState(s.failState), this.shouldParseAsyncArrowReturnType = s.node, !this.canInsertSemicolon() && this.eat(o.arrow));
|
|
4847
4847
|
}, p.parseSubscriptAsyncArrow = function(i, s, n, c) {
|
|
4848
|
-
var
|
|
4849
|
-
return
|
|
4848
|
+
var f = this.startNodeAt(i, s);
|
|
4849
|
+
return f.returnType = this.shouldParseAsyncArrowReturnType, this.shouldParseAsyncArrowReturnType = void 0, this.parseArrowExpression(f, n, !0, c);
|
|
4850
4850
|
}, p.parseExprList = function(i, s, n, c) {
|
|
4851
|
-
for (var
|
|
4851
|
+
for (var f = [], m = !0; !this.eat(i); ) {
|
|
4852
4852
|
if (m) m = !1;
|
|
4853
4853
|
else if (this.expect(o.comma), s && this.afterTrailingComma(i)) break;
|
|
4854
4854
|
var y = void 0;
|
|
4855
|
-
n && this.type === o.comma ? y = null : this.type === o.ellipsis ? (y = this.parseSpread(c), c && this.type === o.comma && c.trailingComma < 0 && (c.trailingComma = this.start)) : y = this.parseMaybeAssign(!1, c, this.parseParenItem),
|
|
4855
|
+
n && this.type === o.comma ? y = null : this.type === o.ellipsis ? (y = this.parseSpread(c), c && this.type === o.comma && c.trailingComma < 0 && (c.trailingComma = this.start)) : y = this.parseMaybeAssign(!1, c, this.parseParenItem), f.push(y);
|
|
4856
4856
|
}
|
|
4857
|
-
return
|
|
4858
|
-
}, p.parseSubscript = function(i, s, n, c,
|
|
4857
|
+
return f;
|
|
4858
|
+
}, p.parseSubscript = function(i, s, n, c, f, m, y) {
|
|
4859
4859
|
var x = this, b = m;
|
|
4860
4860
|
if (!this.hasPrecedingLineBreak() && this.value === "!" && this.match(o.prefix)) {
|
|
4861
4861
|
this.exprAllowed = !1, this.next();
|
|
@@ -4876,7 +4876,7 @@ function _s(t) {
|
|
|
4876
4876
|
var Wt = x.tsParseTypeArgumentsInExpression();
|
|
4877
4877
|
if (!Wt) return i;
|
|
4878
4878
|
if (E && !x.match(o.parenL)) return N = x.curPosition(), i;
|
|
4879
|
-
if (
|
|
4879
|
+
if (Ci(x.type) || x.type === o.backQuote) {
|
|
4880
4880
|
var Ae = x.parseTaggedTemplateExpression(i, s, n, b);
|
|
4881
4881
|
return Ae.typeParameters = Wt, Ae;
|
|
4882
4882
|
}
|
|
@@ -4896,15 +4896,15 @@ function _s(t) {
|
|
|
4896
4896
|
c && U && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
4897
4897
|
var H = this.eat(o.bracketL);
|
|
4898
4898
|
if (H || U && this.type !== o.parenL && this.type !== o.backQuote || this.eat(o.dot)) {
|
|
4899
|
-
var
|
|
4900
|
-
|
|
4899
|
+
var J = this.startNodeAt(s, n);
|
|
4900
|
+
J.object = i, H ? (J.property = this.parseExpression(), this.expect(o.bracketR)) : J.property = this.type === o.privateId && i.type !== "Super" ? this.parsePrivateIdent() : this.parseIdent(this.options.allowReserved !== "never"), J.computed = !!H, q && (J.optional = U), i = this.finishNode(J, "MemberExpression");
|
|
4901
4901
|
} else if (!c && this.eat(o.parenL)) {
|
|
4902
4902
|
var rt = this.maybeInArrowParameters;
|
|
4903
4903
|
this.maybeInArrowParameters = !0;
|
|
4904
4904
|
var vt = new Ot(), _t = this.yieldPos, Nt = this.awaitPos, gt = this.awaitIdentPos;
|
|
4905
4905
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
4906
4906
|
var Ce = this.parseExprList(o.parenR, this.options.ecmaVersion >= 8, !1, vt);
|
|
4907
|
-
if (
|
|
4907
|
+
if (f && !U && this.shouldParseAsyncArrow()) this.checkPatternErrors(vt, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = _t, this.awaitPos = Nt, this.awaitIdentPos = gt, i = this.parseSubscriptAsyncArrow(s, n, Ce, y);
|
|
4908
4908
|
else {
|
|
4909
4909
|
this.checkExpressionErrors(vt, !0), this.yieldPos = _t || this.yieldPos, this.awaitPos = Nt || this.awaitPos, this.awaitIdentPos = gt || this.awaitIdentPos;
|
|
4910
4910
|
var Ht = this.startNodeAt(s, n);
|
|
@@ -4941,13 +4941,13 @@ function _s(t) {
|
|
|
4941
4941
|
this.next(), this.takeDecorators(i);
|
|
4942
4942
|
var c = this.strict;
|
|
4943
4943
|
this.strict = !0, this.parseClassId(i, s), this.parseClassSuper(i);
|
|
4944
|
-
var
|
|
4944
|
+
var f = this.enterClassBody(), m = this.startNode(), y = !1;
|
|
4945
4945
|
m.body = [];
|
|
4946
4946
|
var x = [];
|
|
4947
4947
|
for (this.expect(o.braceL); this.type !== o.braceR; ) if (this.match(I.at)) x.push(this.parseDecorator());
|
|
4948
4948
|
else {
|
|
4949
4949
|
var b = this.parseClassElement(i.superClass !== null);
|
|
4950
|
-
x.length && (b.decorators = x, this.resetStartLocationFromNode(b, x[0]), x = []), b && (m.body.push(b), b.type === "MethodDefinition" && b.kind === "constructor" && b.value.type === "FunctionExpression" ? (y && this.raiseRecoverable(b.start, "Duplicate constructor in the same class"), y = !0, b.decorators && b.decorators.length > 0 && this.raise(b.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : b.key && b.key.type === "PrivateIdentifier" &&
|
|
4950
|
+
x.length && (b.decorators = x, this.resetStartLocationFromNode(b, x[0]), x = []), b && (m.body.push(b), b.type === "MethodDefinition" && b.kind === "constructor" && b.value.type === "FunctionExpression" ? (y && this.raiseRecoverable(b.start, "Duplicate constructor in the same class"), y = !0, b.decorators && b.decorators.length > 0 && this.raise(b.start, "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?")) : b.key && b.key.type === "PrivateIdentifier" && Ts(f, b) && this.raiseRecoverable(b.key.start, "Identifier '#" + b.key.name + "' has already been declared"));
|
|
4951
4951
|
}
|
|
4952
4952
|
return this.strict = c, this.next(), x.length && this.raise(this.start, "Decorators must be attached to a class element."), i.body = this.finishNode(m, "ClassBody"), this.exitClassBody(), this.finishNode(i, s ? "ClassDeclaration" : "ClassExpression");
|
|
4953
4953
|
} finally {
|
|
@@ -4956,11 +4956,11 @@ function _s(t) {
|
|
|
4956
4956
|
}, p.parseClassFunctionParams = function() {
|
|
4957
4957
|
var i = this.tsTryParseTypeParameters(this.tsParseConstModifier), s = this.parseBindingList(o.parenR, !1, this.options.ecmaVersion >= 8, !0);
|
|
4958
4958
|
return i && (s.typeParameters = i), s;
|
|
4959
|
-
}, p.parseMethod = function(i, s, n, c,
|
|
4959
|
+
}, p.parseMethod = function(i, s, n, c, f) {
|
|
4960
4960
|
var m = this.startNode(), y = this.yieldPos, x = this.awaitPos, b = this.awaitIdentPos;
|
|
4961
|
-
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | pe(s, m.generator) | (n ? 128 : 0)), this.expect(o.parenL), m.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(m, !1, !0, !1, { isClassMethod: c }), this.yieldPos = y, this.awaitPos = x, this.awaitIdentPos = b,
|
|
4962
|
-
var S =
|
|
4963
|
-
this.raise(
|
|
4961
|
+
if (this.initFunction(m), this.options.ecmaVersion >= 6 && (m.generator = i), this.options.ecmaVersion >= 8 && (m.async = !!s), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(64 | pe(s, m.generator) | (n ? 128 : 0)), this.expect(o.parenL), m.params = this.parseClassFunctionParams(), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(m, !1, !0, !1, { isClassMethod: c }), this.yieldPos = y, this.awaitPos = x, this.awaitIdentPos = b, f && f.abstract && m.body) {
|
|
4962
|
+
var S = f.key;
|
|
4963
|
+
this.raise(f.start, A.AbstractMethodHasImplementation({ methodName: S.type !== "Identifier" || f.computed ? "[" + this.input.slice(S.start, S.end) + "]" : S.name }));
|
|
4964
4964
|
}
|
|
4965
4965
|
return this.finishNode(m, "FunctionExpression");
|
|
4966
4966
|
}, et.parse = function(i, s) {
|
|
@@ -4989,7 +4989,7 @@ function _s(t) {
|
|
|
4989
4989
|
var c = T.prototype.parseExportSpecifier.call(this, i);
|
|
4990
4990
|
return c.exportKind = "value", c;
|
|
4991
4991
|
}, p.parseTypeOnlyImportExportSpecifier = function(i, s, n) {
|
|
4992
|
-
var c,
|
|
4992
|
+
var c, f = s ? "imported" : "local", m = s ? "local" : "exported", y = i[f], x = !1, b = !0, S = y.start;
|
|
4993
4993
|
if (this.isContextual("as")) {
|
|
4994
4994
|
var E = this.parseIdent();
|
|
4995
4995
|
if (this.isContextual("as")) {
|
|
@@ -4997,7 +4997,7 @@ function _s(t) {
|
|
|
4997
4997
|
qt(this.type) ? (x = !0, y = E, c = s ? this.parseIdent() : this.parseModuleExportName(), b = !1) : (c = N, b = !1);
|
|
4998
4998
|
} else qt(this.type) ? (b = !1, c = s ? this.parseIdent() : this.parseModuleExportName()) : (x = !0, y = E);
|
|
4999
4999
|
} else qt(this.type) && (x = !0, s ? (y = T.prototype.parseIdent.call(this, !0), this.isContextual("as") || this.checkUnreserved(y)) : y = this.parseModuleExportName());
|
|
5000
|
-
x && n && this.raise(S, s ? A.TypeModifierIsUsedInTypeImports : A.TypeModifierIsUsedInTypeExports), i[
|
|
5000
|
+
x && n && this.raise(S, s ? A.TypeModifierIsUsedInTypeImports : A.TypeModifierIsUsedInTypeExports), i[f] = y, i[m] = c, i[s ? "importKind" : "exportKind"] = x ? "type" : "value", b && this.eatContextual("as") && (i[m] = s ? this.parseIdent() : this.parseModuleExportName()), i[m] || (i[m] = this.copyNode(i[f])), s && this.checkLValSimple(i[m], 2);
|
|
5001
5001
|
}, p.raiseCommonCheck = function(i, s, n) {
|
|
5002
5002
|
return s === "Comma is not permitted after the rest element" ? this.isAmbientContext && this.match(o.comma) && this.lookaheadCharCode() === 41 ? void this.next() : T.prototype.raise.call(this, i, s) : n ? T.prototype.raiseRecoverable.call(this, i, s) : T.prototype.raise.call(this, i, s);
|
|
5003
5003
|
}, p.raiseRecoverable = function(i, s) {
|
|
@@ -5008,21 +5008,21 @@ function _s(t) {
|
|
|
5008
5008
|
var s = this.type;
|
|
5009
5009
|
if (s == o.braceL) {
|
|
5010
5010
|
var n = this.curContext();
|
|
5011
|
-
n == tt.tc_oTag ? this.context.push(
|
|
5011
|
+
n == tt.tc_oTag ? this.context.push(G.b_expr) : n == tt.tc_expr ? this.context.push(G.b_tmpl) : T.prototype.updateContext.call(this, i), this.exprAllowed = !0;
|
|
5012
5012
|
} else {
|
|
5013
5013
|
if (s !== o.slash || i !== I.jsxTagStart) return T.prototype.updateContext.call(this, i);
|
|
5014
5014
|
this.context.length -= 2, this.context.push(tt.tc_cTag), this.exprAllowed = !1;
|
|
5015
5015
|
}
|
|
5016
5016
|
}, p.jsx_parseOpeningElementAt = function(i, s) {
|
|
5017
|
-
var n = this, c = this.startNodeAt(i, s),
|
|
5018
|
-
if (
|
|
5017
|
+
var n = this, c = this.startNodeAt(i, s), f = this.jsx_parseElementName();
|
|
5018
|
+
if (f && (c.name = f), this.match(o.relational) || this.match(o.bitShift)) {
|
|
5019
5019
|
var m = this.tsTryParseAndCatch(function() {
|
|
5020
5020
|
return n.tsParseTypeArgumentsInExpression();
|
|
5021
5021
|
});
|
|
5022
5022
|
m && (c.typeParameters = m);
|
|
5023
5023
|
}
|
|
5024
5024
|
for (c.attributes = []; this.type !== o.slash && this.type !== I.jsxTagEnd; ) c.attributes.push(this.jsx_parseAttribute());
|
|
5025
|
-
return c.selfClosing = this.eat(o.slash), this.expect(I.jsxTagEnd), this.finishNode(c,
|
|
5025
|
+
return c.selfClosing = this.eat(o.slash), this.expect(I.jsxTagEnd), this.finishNode(c, f ? "JSXOpeningElement" : "JSXOpeningFragment");
|
|
5026
5026
|
}, p.enterScope = function(i) {
|
|
5027
5027
|
i === Lt && this.importsStack.push([]), T.prototype.enterScope.call(this, i);
|
|
5028
5028
|
var s = T.prototype.currentScope.call(this);
|
|
@@ -5062,11 +5062,11 @@ function _s(t) {
|
|
|
5062
5062
|
return g;
|
|
5063
5063
|
} }]) && Re(X.prototype, K), V && Re(X, V), Object.defineProperty(X, "prototype", { writable: !1 }), et;
|
|
5064
5064
|
})(d);
|
|
5065
|
-
return
|
|
5065
|
+
return Ei;
|
|
5066
5066
|
};
|
|
5067
5067
|
}
|
|
5068
|
-
const
|
|
5069
|
-
async function
|
|
5068
|
+
const _s = ["createObject", "dropObject", "removeRecords", "upsertRecords"], Ns = ["findObject", "getRecord", "listNodes", "previewObject", "retrieveRecords"], Dt = Ni(Ii);
|
|
5069
|
+
async function Fs() {
|
|
5070
5070
|
try {
|
|
5071
5071
|
console.info("🚀 Building configuration...");
|
|
5072
5072
|
const t = JSON.parse(await R.readFile("package.json", "utf8")), e = JSON.parse(await R.readFile("config.json", "utf8"));
|
|
@@ -5075,15 +5075,15 @@ async function js() {
|
|
|
5075
5075
|
console.error("❌ Error building configuration.", t);
|
|
5076
5076
|
}
|
|
5077
5077
|
}
|
|
5078
|
-
async function
|
|
5078
|
+
async function Bs(t) {
|
|
5079
5079
|
try {
|
|
5080
5080
|
console.info(`🚀 Building public directory index for identifier '${t}'...`);
|
|
5081
5081
|
const e = {};
|
|
5082
|
-
async function r(u,
|
|
5082
|
+
async function r(u, l) {
|
|
5083
5083
|
console.info(`⚙️ Processing directory '${u}'...`);
|
|
5084
5084
|
const d = [], v = u.slice(`public/${t}`.length);
|
|
5085
5085
|
e[v === "" ? "/" : v] = d;
|
|
5086
|
-
for (const g of
|
|
5086
|
+
for (const g of l) {
|
|
5087
5087
|
const o = `${u}/${g}`;
|
|
5088
5088
|
try {
|
|
5089
5089
|
const w = await R.stat(o);
|
|
@@ -5091,7 +5091,7 @@ async function Us(t) {
|
|
|
5091
5091
|
const L = await R.readdir(o), F = { childCount: L.length, name: g, typeId: "folder" };
|
|
5092
5092
|
d.push(F), await r(o, L);
|
|
5093
5093
|
} else {
|
|
5094
|
-
const L = { id:
|
|
5094
|
+
const L = { id: _i(), lastModifiedAt: w.mtimeMs, name: g, size: w.size, typeId: "object" };
|
|
5095
5095
|
d.push(L);
|
|
5096
5096
|
}
|
|
5097
5097
|
} catch (w) {
|
|
@@ -5109,79 +5109,46 @@ async function Us(t) {
|
|
|
5109
5109
|
console.error("❌ Error building public directory index.", e);
|
|
5110
5110
|
}
|
|
5111
5111
|
}
|
|
5112
|
-
async function
|
|
5112
|
+
async function js() {
|
|
5113
5113
|
try {
|
|
5114
5114
|
console.info("🚀 Building connector configuration...");
|
|
5115
5115
|
const [t, e, r] = await Promise.all([
|
|
5116
|
-
|
|
5117
|
-
|
|
5116
|
+
R.readFile("package.json", "utf8").then((l) => JSON.parse(l)),
|
|
5117
|
+
R.readFile("config.json", "utf8").then((l) => JSON.parse(l)),
|
|
5118
5118
|
R.readFile("src/index.ts", "utf8")
|
|
5119
|
-
]), a =
|
|
5120
|
-
a.operations.length > 0 ? console.info(`ℹ️ Implements ${a.operations.length} operations.`) : console.warn("⚠️ Implements no operations."), u === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports ${u} usage.`);
|
|
5121
|
-
const f = {
|
|
5122
|
-
...e,
|
|
5123
|
-
id: t.name ?? e.id,
|
|
5124
|
-
version: t.version ?? e.version,
|
|
5125
|
-
operations: a.operations,
|
|
5126
|
-
usageId: u
|
|
5127
|
-
};
|
|
5128
|
-
await Os("config.json", f), console.info("✅ Connector configuration built.");
|
|
5119
|
+
]), a = Ls(r), u = Os(a);
|
|
5120
|
+
a.operations.length > 0 ? console.info(`ℹ️ Implements ${a.operations.length} operations.`) : console.warn("⚠️ Implements no operations."), u === "unknown" ? console.warn("⚠️ No usage identified.") : console.info(`ℹ️ Supports '${u}' usage.`), e.id = t.name ?? e.id, e.version = t.version ?? e.version, e.operations = a.operations, e.usageId = u, await R.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8"), console.info("✅ Connector configuration built.");
|
|
5129
5121
|
} catch (t) {
|
|
5130
5122
|
console.error("❌ Error building connector configuration.", t);
|
|
5131
5123
|
}
|
|
5132
5124
|
}
|
|
5133
|
-
async function
|
|
5134
|
-
return JSON.parse(await R.readFile(t, "utf8"));
|
|
5135
|
-
}
|
|
5136
|
-
async function Os(t, e) {
|
|
5137
|
-
await R.writeFile(t, JSON.stringify(e, void 0, 4), "utf8");
|
|
5138
|
-
}
|
|
5139
|
-
function Rs(t) {
|
|
5140
|
-
const r = W.extend(_s()).parse(t, {
|
|
5141
|
-
ecmaVersion: "latest",
|
|
5142
|
-
sourceType: "module",
|
|
5143
|
-
locations: !0
|
|
5144
|
-
}), a = [];
|
|
5145
|
-
let u = !1, f = !1;
|
|
5146
|
-
return ye(r, (d) => {
|
|
5147
|
-
if (d.type !== "MethodDefinition") return;
|
|
5148
|
-
const v = d, o = v.key.name;
|
|
5149
|
-
o && o !== "constructor" && v.accessibility !== "private" && (a.push(o), Ls.includes(o) && (u = !0), Ns.includes(o) && (f = !0));
|
|
5150
|
-
}), { operations: a, sourceOps: u, destinationOps: f };
|
|
5151
|
-
}
|
|
5152
|
-
function Ms(t) {
|
|
5153
|
-
return t.sourceOps && t.destinationOps ? "bidirectional" : t.sourceOps ? "source" : t.destinationOps ? "destination" : "unknown";
|
|
5154
|
-
}
|
|
5155
|
-
function ye(t, e) {
|
|
5156
|
-
e(t);
|
|
5157
|
-
for (const [r, a] of Object.entries(t)) {
|
|
5158
|
-
if (["loc", "range", "start", "end", "comments"].includes(r)) continue;
|
|
5159
|
-
const u = a;
|
|
5160
|
-
if (Array.isArray(u))
|
|
5161
|
-
for (const f of u)
|
|
5162
|
-
f && typeof f.type == "string" && ye(f, e);
|
|
5163
|
-
else u && typeof u == "object" && typeof u.type == "string" && ye(u, e);
|
|
5164
|
-
}
|
|
5165
|
-
}
|
|
5166
|
-
async function Hs() {
|
|
5125
|
+
async function Us() {
|
|
5167
5126
|
try {
|
|
5168
5127
|
console.info("🚀 Building context configuration...");
|
|
5169
|
-
const t
|
|
5128
|
+
const [t, e, r] = await Promise.all([
|
|
5129
|
+
R.readFile("package.json", "utf8").then((l) => JSON.parse(l)),
|
|
5130
|
+
R.readFile("config.json", "utf8").then((l) => JSON.parse(l)),
|
|
5131
|
+
R.readFile("src/index.ts", "utf8")
|
|
5132
|
+
]), a = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, u = [...r.matchAll(a)].filter((l) => l[1] == null && l[2] !== "constructor").map((l) => l[2]);
|
|
5170
5133
|
t.name != null && (e.id = t.name), e.operations = u, t.version != null && (e.version = t.version), await R.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8"), console.info("✅ Context configuration built.");
|
|
5171
5134
|
} catch (t) {
|
|
5172
5135
|
console.error("❌ Error building context configuration.", t);
|
|
5173
5136
|
}
|
|
5174
5137
|
}
|
|
5175
|
-
async function
|
|
5138
|
+
async function qs() {
|
|
5176
5139
|
try {
|
|
5177
5140
|
console.info("🚀 Building presenter configuration...");
|
|
5178
|
-
const t
|
|
5141
|
+
const [t, e, r] = await Promise.all([
|
|
5142
|
+
R.readFile("package.json", "utf8").then((l) => JSON.parse(l)),
|
|
5143
|
+
R.readFile("config.json", "utf8").then((l) => JSON.parse(l)),
|
|
5144
|
+
R.readFile("src/index.ts", "utf8")
|
|
5145
|
+
]), a = /^\s{4}(?:async\s+)?(private\s+)?(?:public\s+|protected\s+)?([A-Za-z_]\w*)\s*\(/gm, u = [...r.matchAll(a)].filter((l) => l[1] == null && l[2] !== "constructor").map((l) => l[2]);
|
|
5179
5146
|
t.name != null && (e.id = t.name), e.operations = u, t.version != null && (e.version = t.version), await R.writeFile("config.json", JSON.stringify(e, void 0, 4), "utf8"), console.info("✅ Presenter configuration built.");
|
|
5180
5147
|
} catch (t) {
|
|
5181
5148
|
console.error("❌ Error building context configuration.", t);
|
|
5182
5149
|
}
|
|
5183
5150
|
}
|
|
5184
|
-
async function
|
|
5151
|
+
async function Hs(t = "./") {
|
|
5185
5152
|
try {
|
|
5186
5153
|
console.info("🚀 Bumping version...");
|
|
5187
5154
|
const e = JSON.parse(await R.readFile(`${t}package.json`, "utf8"));
|
|
@@ -5195,30 +5162,33 @@ async function Ks(t = "./") {
|
|
|
5195
5162
|
console.error("❌ Error bumping package version.", e);
|
|
5196
5163
|
}
|
|
5197
5164
|
}
|
|
5198
|
-
function
|
|
5165
|
+
function Ws(t) {
|
|
5199
5166
|
console.error(`❌ ${t} script not implemented.`);
|
|
5200
5167
|
}
|
|
5201
|
-
async function
|
|
5168
|
+
async function Ks() {
|
|
5202
5169
|
const t = "<!-- DEPENDENCY_LICENSES_START -->", e = "<!-- DEPENDENCY_LICENSES_END -->";
|
|
5203
5170
|
try {
|
|
5204
|
-
const
|
|
5205
|
-
(
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5171
|
+
const a = (await R.readFile("./licenses.md", "utf8")).trim(), u = await R.readFile("./README.md", "utf8"), l = u.indexOf(t), d = u.indexOf(e);
|
|
5172
|
+
if (l === -1 || d === -1) {
|
|
5173
|
+
console.error("❌ Dependency license markers not found in readme file.");
|
|
5174
|
+
return;
|
|
5175
|
+
}
|
|
5176
|
+
const v = u.slice(0, Math.max(0, l + t.length)) + `
|
|
5177
|
+
` + a + `
|
|
5178
|
+
` + u.slice(Math.max(0, d));
|
|
5179
|
+
await R.writeFile("README.md", v, "utf8"), console.log("✅ Readme file updated with license information");
|
|
5210
5180
|
} catch (r) {
|
|
5211
|
-
console.error("❌ Error updating readme file.", r)
|
|
5181
|
+
console.error("❌ Error updating readme file.", r);
|
|
5212
5182
|
}
|
|
5213
5183
|
}
|
|
5214
|
-
async function
|
|
5184
|
+
async function zs() {
|
|
5215
5185
|
const t = "<!-- OWASP_BADGE_START -->", e = "<!-- OWASP_BADGE_END -->";
|
|
5216
5186
|
try {
|
|
5217
|
-
const r = JSON.parse(await R.readFile("./dependency-check-reports/dependency-check-report.json", "
|
|
5218
|
-
for (const
|
|
5219
|
-
if (
|
|
5220
|
-
for (const
|
|
5221
|
-
const st =
|
|
5187
|
+
const r = JSON.parse(await R.readFile("./dependency-check-reports/dependency-check-report.json", "utf8")), a = { critical: 0, high: 0, moderate: 0, low: 0, unknown: 0 };
|
|
5188
|
+
for (const z of r.dependencies)
|
|
5189
|
+
if (z.vulnerabilities != null)
|
|
5190
|
+
for (const G of z.vulnerabilities) {
|
|
5191
|
+
const st = G.severity?.toLowerCase() ?? "unknown";
|
|
5222
5192
|
st in a ? a[st]++ : a.unknown++;
|
|
5223
5193
|
}
|
|
5224
5194
|
const u = {
|
|
@@ -5227,25 +5197,28 @@ async function Gs() {
|
|
|
5227
5197
|
moderate: { color: "FBC02D", label: "moderate" },
|
|
5228
5198
|
low: { color: "6D8C31", label: "low" },
|
|
5229
5199
|
unknown: { color: "616161", label: "unknown" }
|
|
5230
|
-
},
|
|
5231
|
-
if (Object.values(a).reduce((
|
|
5232
|
-
console.info("✅ No vulnerabilities found."), d.push(`[](https://data-positioning.github.io/${
|
|
5200
|
+
}, l = JSON.parse(await R.readFile("config.json", "utf8")), d = [];
|
|
5201
|
+
if (Object.values(a).reduce((z, G) => z + G, 0) === 0)
|
|
5202
|
+
console.info("✅ No vulnerabilities found."), d.push(`[](https://data-positioning.github.io/${l.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5233
5203
|
else
|
|
5234
|
-
for (const [
|
|
5235
|
-
const st = u[
|
|
5236
|
-
if (console.warn(`⚠️ ${
|
|
5237
|
-
const I = `https://img.shields.io/badge/OWASP-${
|
|
5238
|
-
d.push(`[](https://data-positioning.github.io/${
|
|
5204
|
+
for (const [z, G] of Object.entries(a)) {
|
|
5205
|
+
const st = u[z];
|
|
5206
|
+
if (console.warn(`⚠️ ${G} ${st.label} vulnerability(ies) found.`), G === 0) continue;
|
|
5207
|
+
const I = `https://img.shields.io/badge/OWASP-${G}%20${st.label}-${st.color}`;
|
|
5208
|
+
d.push(`[](https://data-positioning.github.io/${l.id}/dependency-check-reports/dependency-check-report.html)`);
|
|
5239
5209
|
}
|
|
5240
5210
|
const g = await R.readFile("./README.md", "utf8"), o = g.indexOf(t), w = g.indexOf(e);
|
|
5241
|
-
(o === -1 || w === -1)
|
|
5242
|
-
|
|
5211
|
+
if (o === -1 || w === -1) {
|
|
5212
|
+
console.error("❌ OWASP badge markers not found in README.md.");
|
|
5213
|
+
return;
|
|
5214
|
+
}
|
|
5215
|
+
const L = d.join(" "), F = g.slice(0, Math.max(0, o + t.length)) + L + g.slice(Math.max(0, w));
|
|
5243
5216
|
await R.writeFile("README.md", F, "utf8"), console.info("✅ OWASP dependency check badge(s) inserted into README.md");
|
|
5244
5217
|
} catch (r) {
|
|
5245
|
-
console.error("❌ Error updating README with OWASP badges:", r)
|
|
5218
|
+
console.error("❌ Error updating README with OWASP badges:", r);
|
|
5246
5219
|
}
|
|
5247
5220
|
}
|
|
5248
|
-
async function
|
|
5221
|
+
async function Js() {
|
|
5249
5222
|
try {
|
|
5250
5223
|
console.info("🚀 Sending deployment notice...");
|
|
5251
5224
|
const t = JSON.parse(await R.readFile("config.json", "utf8")), e = {
|
|
@@ -5259,7 +5232,7 @@ async function $s() {
|
|
|
5259
5232
|
console.error("❌ Error sending deployment notice.", t);
|
|
5260
5233
|
}
|
|
5261
5234
|
}
|
|
5262
|
-
async function
|
|
5235
|
+
async function Gs() {
|
|
5263
5236
|
try {
|
|
5264
5237
|
console.info("🚀 Synchronising with GitHub....");
|
|
5265
5238
|
const t = JSON.parse(await R.readFile("package.json", "utf8"));
|
|
@@ -5268,18 +5241,18 @@ async function Xs() {
|
|
|
5268
5241
|
console.error("❌ Error synchronising with GitHub.", t);
|
|
5269
5242
|
}
|
|
5270
5243
|
}
|
|
5271
|
-
async function
|
|
5244
|
+
async function $s(t, e) {
|
|
5272
5245
|
try {
|
|
5273
5246
|
console.info("🚀 Uploading directory to R2....");
|
|
5274
|
-
async function r(u,
|
|
5247
|
+
async function r(u, l, d) {
|
|
5275
5248
|
for (const v of d) {
|
|
5276
|
-
const g = `${u}/${v}`, o = `${
|
|
5249
|
+
const g = `${u}/${v}`, o = `${l}/${v}`;
|
|
5277
5250
|
if ((await R.stat(g)).isDirectory()) {
|
|
5278
5251
|
const L = await R.readdir(g);
|
|
5279
5252
|
await r(g, o, L);
|
|
5280
5253
|
} else {
|
|
5281
5254
|
console.info(`⚙️ Uploading '${u}/${v}'...`);
|
|
5282
|
-
const L = `wrangler r2 object put "datapos-sample-data-eu/${
|
|
5255
|
+
const L = `wrangler r2 object put "datapos-sample-data-eu/${l}/${v}" --file="${u}/${v}" --jurisdiction=eu --remote`, F = await Dt(L);
|
|
5283
5256
|
if (F.stderr) throw new Error(F.stderr);
|
|
5284
5257
|
}
|
|
5285
5258
|
}
|
|
@@ -5290,7 +5263,7 @@ async function Qs(t, e) {
|
|
|
5290
5263
|
console.error("❌ Error uploading directory to R2.", r);
|
|
5291
5264
|
}
|
|
5292
5265
|
}
|
|
5293
|
-
async function
|
|
5266
|
+
async function Xs() {
|
|
5294
5267
|
try {
|
|
5295
5268
|
console.info("🚀 Uploading module configuration....");
|
|
5296
5269
|
const t = JSON.parse(await R.readFile("config.json", "utf8")), e = t.id, r = {
|
|
@@ -5304,20 +5277,19 @@ async function Ys() {
|
|
|
5304
5277
|
console.error("❌ Error uploading module configuration.", t);
|
|
5305
5278
|
}
|
|
5306
5279
|
}
|
|
5307
|
-
async function
|
|
5280
|
+
async function Qs(t) {
|
|
5308
5281
|
try {
|
|
5309
5282
|
console.info("🚀 Uploading module to R2...");
|
|
5310
5283
|
const r = `v${JSON.parse(await R.readFile("package.json", "utf8")).version}`;
|
|
5311
|
-
async function a(u,
|
|
5284
|
+
async function a(u, l = "") {
|
|
5312
5285
|
const d = await R.readdir(u, { withFileTypes: !0 });
|
|
5313
5286
|
for (const v of d) {
|
|
5314
|
-
const g = `${u}/${v.name}`, o =
|
|
5315
|
-
if (
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
}
|
|
5287
|
+
const g = `${u}/${v.name}`, o = l ? `${l}/${v.name}` : v.name;
|
|
5288
|
+
if (v.isDirectory()) continue;
|
|
5289
|
+
const w = `${t}_${r}/${o}`.replaceAll("\\", "/"), L = v.name.endsWith(".css") ? "text/css" : "application/octet-stream", F = v.name.endsWith(".js") ? "application/javascript" : L;
|
|
5290
|
+
console.info(`⚙️ Uploading '${o}' → '${w}'...`);
|
|
5291
|
+
const { stderr: z } = await Dt(`wrangler r2 object put "${w}" --file="${g}" --content-type ${F} --jurisdiction=eu --remote`);
|
|
5292
|
+
if (z) throw new Error(z);
|
|
5321
5293
|
}
|
|
5322
5294
|
}
|
|
5323
5295
|
await a("dist"), console.info("✅ Module uploaded to R2.");
|
|
@@ -5325,19 +5297,48 @@ async function Zs(t) {
|
|
|
5325
5297
|
console.error("❌ Error uploading module to R2.", e);
|
|
5326
5298
|
}
|
|
5327
5299
|
}
|
|
5300
|
+
function Ls(t) {
|
|
5301
|
+
const r = W.extend(Is()).parse(t, {
|
|
5302
|
+
ecmaVersion: "latest",
|
|
5303
|
+
sourceType: "module",
|
|
5304
|
+
locations: !0
|
|
5305
|
+
}), a = [];
|
|
5306
|
+
let u = !1, l = !1;
|
|
5307
|
+
return ye(r, (d) => {
|
|
5308
|
+
if (d.type !== "MethodDefinition") return;
|
|
5309
|
+
const v = d, o = v.key.name;
|
|
5310
|
+
o && o !== "constructor" && v.accessibility !== "private" && (a.push(o), Ns.includes(o) && (u = !0), _s.includes(o) && (l = !0));
|
|
5311
|
+
}), { operations: a, sourceOps: u, destinationOps: l };
|
|
5312
|
+
}
|
|
5313
|
+
function Os(t) {
|
|
5314
|
+
return t.sourceOps && t.destinationOps ? "bidirectional" : t.sourceOps ? "source" : t.destinationOps ? "destination" : "unknown";
|
|
5315
|
+
}
|
|
5316
|
+
function ye(t, e) {
|
|
5317
|
+
e(t);
|
|
5318
|
+
for (const [r, a] of Object.entries(t)) {
|
|
5319
|
+
if (["loc", "range", "start", "end", "comments"].includes(r)) continue;
|
|
5320
|
+
const u = a;
|
|
5321
|
+
if (Array.isArray(u))
|
|
5322
|
+
for (const l of u) {
|
|
5323
|
+
const d = l;
|
|
5324
|
+
d && typeof d.type == "string" && ye(d, e);
|
|
5325
|
+
}
|
|
5326
|
+
else u && typeof u == "object" && typeof u.type == "string" && ye(u, e);
|
|
5327
|
+
}
|
|
5328
|
+
}
|
|
5328
5329
|
export {
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5330
|
+
Fs as buildConfig,
|
|
5331
|
+
js as buildConnectorConfig,
|
|
5332
|
+
Us as buildContextConfig,
|
|
5333
|
+
qs as buildPresenterConfig,
|
|
5334
|
+
Bs as buildPublicDirectoryIndex,
|
|
5335
|
+
Hs as bumpVersion,
|
|
5336
|
+
Ws as echoScriptNotImplemented,
|
|
5337
|
+
Ks as insertLicensesIntoReadme,
|
|
5338
|
+
zs as insertOWASPDependencyCheckBadgeIntoReadme,
|
|
5339
|
+
Js as sendDeploymentNotice,
|
|
5340
|
+
Gs as syncWithGitHub,
|
|
5341
|
+
$s as uploadDirectoryToR2,
|
|
5342
|
+
Xs as uploadModuleConfigToDO,
|
|
5343
|
+
Qs as uploadModuleToR2
|
|
5343
5344
|
};
|