driftjs-ssr 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index-cjs.js +7 -7
- package/dist/index-es.js +1057 -1071
- package/package.json +3 -3
package/dist/index-es.js
CHANGED
|
@@ -1,42 +1,6 @@
|
|
|
1
|
-
import { VOID_ELEMENTS as e, createContext as t,
|
|
2
|
-
//#region
|
|
3
|
-
var
|
|
4
|
-
Data: "Data",
|
|
5
|
-
TagOpen: "TagOpen",
|
|
6
|
-
EndTagOpen: "EndTagOpen",
|
|
7
|
-
BeforeAttributeName: "BeforeAttributeName",
|
|
8
|
-
AttributeName: "AttributeName",
|
|
9
|
-
AfterAttributeName: "AfterAttributeName",
|
|
10
|
-
BeforeAttributeValue: "BeforeAttributeValue",
|
|
11
|
-
AttributeValueQuoted: "AttributeValueQuoted",
|
|
12
|
-
AttributeValueInterpolation: "AttributeValueInterpolation",
|
|
13
|
-
Comment: "Comment",
|
|
14
|
-
Interpolation: "Interpolation",
|
|
15
|
-
RawText: "RawText",
|
|
16
|
-
EOF: "EOF"
|
|
17
|
-
}, h = /* @__PURE__ */ function(e) {
|
|
18
|
-
return e[e.RETURN = 0] = "RETURN", e[e.CREATE_ELEMENT = 1] = "CREATE_ELEMENT", e[e.CREATE_TEXT = 2] = "CREATE_TEXT", e[e.CREATE_COMMENT = 3] = "CREATE_COMMENT", e[e.APPEND_CHILD = 4] = "APPEND_CHILD", e[e.SET_ATTR = 5] = "SET_ATTR", e[e.CREATE_FRAGMENT = 6] = "CREATE_FRAGMENT", e[e.INTERPOLATE_TEXT = 7] = "INTERPOLATE_TEXT", e[e.EXEC_SCRIPT = 12] = "EXEC_SCRIPT", e[e.REACTIVE_IF = 13] = "REACTIVE_IF", e[e.REACTIVE_FOR = 14] = "REACTIVE_FOR", e[e.MOUNT_COMPONENT = 15] = "MOUNT_COMPONENT", e;
|
|
19
|
-
}({});
|
|
20
|
-
function g(e, t) {
|
|
21
|
-
if (!(t === "__proto__" || t === "constructor" || t === "prototype" || t === "__drift_mark_dirty__")) {
|
|
22
|
-
if (e && typeof e == "object") {
|
|
23
|
-
let n = e;
|
|
24
|
-
for (; n && n !== Object.prototype;) {
|
|
25
|
-
if (Object.prototype.hasOwnProperty.call(n, t)) return n[t];
|
|
26
|
-
n = Object.getPrototypeOf(n);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (typeof globalThis < "u" && globalThis) {
|
|
30
|
-
let e = globalThis;
|
|
31
|
-
for (; e && e !== Object.prototype;) {
|
|
32
|
-
if (Object.prototype.hasOwnProperty.call(e, t)) return globalThis[t];
|
|
33
|
-
e = Object.getPrototypeOf(e);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
typeof globalThis < "u" && !globalThis._get && (globalThis._get = g), m.Data, m.Comment, m.EndTagOpen, m.TagOpen, m.Interpolation, m.Data, m.EOF, m.TagOpen, m.BeforeAttributeName, m.EndTagOpen, m.BeforeAttributeName, m.BeforeAttributeName, m.AttributeName, m.Data, m.RawText, m.Data, m.AttributeName, m.AfterAttributeName, m.AfterAttributeName, m.BeforeAttributeValue, m.BeforeAttributeName, m.BeforeAttributeValue, m.AttributeValueQuoted, m.AttributeValueInterpolation, m.AttributeValueQuoted, m.BeforeAttributeName, m.AttributeValueInterpolation, m.BeforeAttributeName, m.Comment, m.Data, m.Interpolation, m.Data, m.BeforeAttributeName, m.RawText, m.RawText, m.EndTagOpen, m.EOF, m.EOF, m.EOF;
|
|
39
|
-
var _ = [
|
|
1
|
+
import { VOID_ELEMENTS as e, createContext as t, effect as n, evaluateExpression as r, evaluatePropsSpec as i, inject as a, injectContext as o, normalizeStyle as s, onMount as c, onUnmount as l, popActiveVM as u, populateItemScope as d, provide as f, provideContext as p, pushActiveVM as m, resolveComponentModule as h, resolveIterable as ee } from "driftjs-shared";
|
|
2
|
+
//#region ../../node_modules/.pnpm/acorn@8.17.0/node_modules/acorn/dist/acorn.mjs
|
|
3
|
+
var g = [
|
|
40
4
|
509,
|
|
41
5
|
0,
|
|
42
6
|
227,
|
|
@@ -367,7 +331,7 @@ var _ = [
|
|
|
367
331
|
9,
|
|
368
332
|
787719,
|
|
369
333
|
239
|
|
370
|
-
],
|
|
334
|
+
], te = [
|
|
371
335
|
0,
|
|
372
336
|
11,
|
|
373
337
|
2,
|
|
@@ -986,216 +950,216 @@ var _ = [
|
|
|
986
950
|
4938,
|
|
987
951
|
6,
|
|
988
952
|
8489
|
|
989
|
-
],
|
|
953
|
+
], ne = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・", re = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ", ie = {
|
|
990
954
|
3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
|
|
991
955
|
5: "class enum extends super const export import",
|
|
992
956
|
6: "enum",
|
|
993
957
|
strict: "implements interface let package private protected public static yield",
|
|
994
958
|
strictBind: "eval arguments"
|
|
995
|
-
},
|
|
996
|
-
5:
|
|
997
|
-
"5module":
|
|
998
|
-
6:
|
|
999
|
-
},
|
|
1000
|
-
function
|
|
959
|
+
}, ae = "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", oe = {
|
|
960
|
+
5: ae,
|
|
961
|
+
"5module": ae + " export import",
|
|
962
|
+
6: ae + " const class extends export import super"
|
|
963
|
+
}, se = /^in(stanceof)?$/, ce = RegExp("[" + re + "]"), le = RegExp("[" + re + ne + "]");
|
|
964
|
+
function ue(e, t) {
|
|
1001
965
|
for (var n = 65536, r = 0; r < t.length; r += 2) {
|
|
1002
966
|
if (n += t[r], n > e) return !1;
|
|
1003
967
|
if (n += t[r + 1], n >= e) return !0;
|
|
1004
968
|
}
|
|
1005
969
|
return !1;
|
|
1006
970
|
}
|
|
1007
|
-
function
|
|
1008
|
-
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 &&
|
|
971
|
+
function _(e, t) {
|
|
972
|
+
return e < 65 ? e === 36 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && ce.test(String.fromCharCode(e)) : t !== !1 && ue(e, te);
|
|
1009
973
|
}
|
|
1010
|
-
function
|
|
1011
|
-
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 &&
|
|
974
|
+
function v(e, t) {
|
|
975
|
+
return e < 48 ? e === 36 : e < 58 ? !0 : e < 65 ? !1 : e < 91 ? !0 : e < 97 ? e === 95 : e < 123 ? !0 : e <= 65535 ? e >= 170 && le.test(String.fromCharCode(e)) : t === !1 ? !1 : ue(e, te) || ue(e, g);
|
|
1012
976
|
}
|
|
1013
|
-
var
|
|
977
|
+
var y = function(e, t) {
|
|
1014
978
|
t === void 0 && (t = {}), this.label = e, this.keyword = t.keyword, this.beforeExpr = !!t.beforeExpr, this.startsExpr = !!t.startsExpr, this.isLoop = !!t.isLoop, this.isAssign = !!t.isAssign, this.prefix = !!t.prefix, this.postfix = !!t.postfix, this.binop = t.binop || null, this.updateContext = null;
|
|
1015
979
|
};
|
|
1016
|
-
function
|
|
1017
|
-
return new
|
|
980
|
+
function b(e, t) {
|
|
981
|
+
return new y(e, {
|
|
1018
982
|
beforeExpr: !0,
|
|
1019
983
|
binop: t
|
|
1020
984
|
});
|
|
1021
985
|
}
|
|
1022
|
-
var
|
|
1023
|
-
function
|
|
1024
|
-
return t === void 0 && (t = {}), t.keyword = e,
|
|
986
|
+
var x = { beforeExpr: !0 }, S = { startsExpr: !0 }, de = {};
|
|
987
|
+
function C(e, t) {
|
|
988
|
+
return t === void 0 && (t = {}), t.keyword = e, de[e] = new y(e, t);
|
|
1025
989
|
}
|
|
1026
|
-
var
|
|
1027
|
-
num: new
|
|
1028
|
-
regexp: new
|
|
1029
|
-
string: new
|
|
1030
|
-
name: new
|
|
1031
|
-
privateId: new
|
|
1032
|
-
eof: new
|
|
1033
|
-
bracketL: new
|
|
990
|
+
var w = {
|
|
991
|
+
num: new y("num", S),
|
|
992
|
+
regexp: new y("regexp", S),
|
|
993
|
+
string: new y("string", S),
|
|
994
|
+
name: new y("name", S),
|
|
995
|
+
privateId: new y("privateId", S),
|
|
996
|
+
eof: new y("eof"),
|
|
997
|
+
bracketL: new y("[", {
|
|
1034
998
|
beforeExpr: !0,
|
|
1035
999
|
startsExpr: !0
|
|
1036
1000
|
}),
|
|
1037
|
-
bracketR: new
|
|
1038
|
-
braceL: new
|
|
1001
|
+
bracketR: new y("]"),
|
|
1002
|
+
braceL: new y("{", {
|
|
1039
1003
|
beforeExpr: !0,
|
|
1040
1004
|
startsExpr: !0
|
|
1041
1005
|
}),
|
|
1042
|
-
braceR: new
|
|
1043
|
-
parenL: new
|
|
1006
|
+
braceR: new y("}"),
|
|
1007
|
+
parenL: new y("(", {
|
|
1044
1008
|
beforeExpr: !0,
|
|
1045
1009
|
startsExpr: !0
|
|
1046
1010
|
}),
|
|
1047
|
-
parenR: new
|
|
1048
|
-
comma: new
|
|
1049
|
-
semi: new
|
|
1050
|
-
colon: new
|
|
1051
|
-
dot: new
|
|
1052
|
-
question: new
|
|
1053
|
-
questionDot: new
|
|
1054
|
-
arrow: new
|
|
1055
|
-
template: new
|
|
1056
|
-
invalidTemplate: new
|
|
1057
|
-
ellipsis: new
|
|
1058
|
-
backQuote: new
|
|
1059
|
-
dollarBraceL: new
|
|
1011
|
+
parenR: new y(")"),
|
|
1012
|
+
comma: new y(",", x),
|
|
1013
|
+
semi: new y(";", x),
|
|
1014
|
+
colon: new y(":", x),
|
|
1015
|
+
dot: new y("."),
|
|
1016
|
+
question: new y("?", x),
|
|
1017
|
+
questionDot: new y("?."),
|
|
1018
|
+
arrow: new y("=>", x),
|
|
1019
|
+
template: new y("template"),
|
|
1020
|
+
invalidTemplate: new y("invalidTemplate"),
|
|
1021
|
+
ellipsis: new y("...", x),
|
|
1022
|
+
backQuote: new y("`", S),
|
|
1023
|
+
dollarBraceL: new y("${", {
|
|
1060
1024
|
beforeExpr: !0,
|
|
1061
1025
|
startsExpr: !0
|
|
1062
1026
|
}),
|
|
1063
|
-
eq: new
|
|
1027
|
+
eq: new y("=", {
|
|
1064
1028
|
beforeExpr: !0,
|
|
1065
1029
|
isAssign: !0
|
|
1066
1030
|
}),
|
|
1067
|
-
assign: new
|
|
1031
|
+
assign: new y("_=", {
|
|
1068
1032
|
beforeExpr: !0,
|
|
1069
1033
|
isAssign: !0
|
|
1070
1034
|
}),
|
|
1071
|
-
incDec: new
|
|
1035
|
+
incDec: new y("++/--", {
|
|
1072
1036
|
prefix: !0,
|
|
1073
1037
|
postfix: !0,
|
|
1074
1038
|
startsExpr: !0
|
|
1075
1039
|
}),
|
|
1076
|
-
prefix: new
|
|
1040
|
+
prefix: new y("!/~", {
|
|
1077
1041
|
beforeExpr: !0,
|
|
1078
1042
|
prefix: !0,
|
|
1079
1043
|
startsExpr: !0
|
|
1080
1044
|
}),
|
|
1081
|
-
logicalOR:
|
|
1082
|
-
logicalAND:
|
|
1083
|
-
bitwiseOR:
|
|
1084
|
-
bitwiseXOR:
|
|
1085
|
-
bitwiseAND:
|
|
1086
|
-
equality:
|
|
1087
|
-
relational:
|
|
1088
|
-
bitShift:
|
|
1089
|
-
plusMin: new
|
|
1045
|
+
logicalOR: b("||", 1),
|
|
1046
|
+
logicalAND: b("&&", 2),
|
|
1047
|
+
bitwiseOR: b("|", 3),
|
|
1048
|
+
bitwiseXOR: b("^", 4),
|
|
1049
|
+
bitwiseAND: b("&", 5),
|
|
1050
|
+
equality: b("==/!=/===/!==", 6),
|
|
1051
|
+
relational: b("</>/<=/>=", 7),
|
|
1052
|
+
bitShift: b("<</>>/>>>", 8),
|
|
1053
|
+
plusMin: new y("+/-", {
|
|
1090
1054
|
beforeExpr: !0,
|
|
1091
1055
|
binop: 9,
|
|
1092
1056
|
prefix: !0,
|
|
1093
1057
|
startsExpr: !0
|
|
1094
1058
|
}),
|
|
1095
|
-
modulo:
|
|
1096
|
-
star:
|
|
1097
|
-
slash:
|
|
1098
|
-
starstar: new
|
|
1099
|
-
coalesce:
|
|
1100
|
-
_break:
|
|
1101
|
-
_case:
|
|
1102
|
-
_catch:
|
|
1103
|
-
_continue:
|
|
1104
|
-
_debugger:
|
|
1105
|
-
_default:
|
|
1106
|
-
_do:
|
|
1059
|
+
modulo: b("%", 10),
|
|
1060
|
+
star: b("*", 10),
|
|
1061
|
+
slash: b("/", 10),
|
|
1062
|
+
starstar: new y("**", { beforeExpr: !0 }),
|
|
1063
|
+
coalesce: b("??", 1),
|
|
1064
|
+
_break: C("break"),
|
|
1065
|
+
_case: C("case", x),
|
|
1066
|
+
_catch: C("catch"),
|
|
1067
|
+
_continue: C("continue"),
|
|
1068
|
+
_debugger: C("debugger"),
|
|
1069
|
+
_default: C("default", x),
|
|
1070
|
+
_do: C("do", {
|
|
1107
1071
|
isLoop: !0,
|
|
1108
1072
|
beforeExpr: !0
|
|
1109
1073
|
}),
|
|
1110
|
-
_else:
|
|
1111
|
-
_finally:
|
|
1112
|
-
_for:
|
|
1113
|
-
_function:
|
|
1114
|
-
_if:
|
|
1115
|
-
_return:
|
|
1116
|
-
_switch:
|
|
1117
|
-
_throw:
|
|
1118
|
-
_try:
|
|
1119
|
-
_var:
|
|
1120
|
-
_const:
|
|
1121
|
-
_while:
|
|
1122
|
-
_with:
|
|
1123
|
-
_new:
|
|
1074
|
+
_else: C("else", x),
|
|
1075
|
+
_finally: C("finally"),
|
|
1076
|
+
_for: C("for", { isLoop: !0 }),
|
|
1077
|
+
_function: C("function", S),
|
|
1078
|
+
_if: C("if"),
|
|
1079
|
+
_return: C("return", x),
|
|
1080
|
+
_switch: C("switch"),
|
|
1081
|
+
_throw: C("throw", x),
|
|
1082
|
+
_try: C("try"),
|
|
1083
|
+
_var: C("var"),
|
|
1084
|
+
_const: C("const"),
|
|
1085
|
+
_while: C("while", { isLoop: !0 }),
|
|
1086
|
+
_with: C("with"),
|
|
1087
|
+
_new: C("new", {
|
|
1124
1088
|
beforeExpr: !0,
|
|
1125
1089
|
startsExpr: !0
|
|
1126
1090
|
}),
|
|
1127
|
-
_this:
|
|
1128
|
-
_super:
|
|
1129
|
-
_class:
|
|
1130
|
-
_extends:
|
|
1131
|
-
_export:
|
|
1132
|
-
_import:
|
|
1133
|
-
_null:
|
|
1134
|
-
_true:
|
|
1135
|
-
_false:
|
|
1136
|
-
_in:
|
|
1091
|
+
_this: C("this", S),
|
|
1092
|
+
_super: C("super", S),
|
|
1093
|
+
_class: C("class", S),
|
|
1094
|
+
_extends: C("extends", x),
|
|
1095
|
+
_export: C("export"),
|
|
1096
|
+
_import: C("import", S),
|
|
1097
|
+
_null: C("null", S),
|
|
1098
|
+
_true: C("true", S),
|
|
1099
|
+
_false: C("false", S),
|
|
1100
|
+
_in: C("in", {
|
|
1137
1101
|
beforeExpr: !0,
|
|
1138
1102
|
binop: 7
|
|
1139
1103
|
}),
|
|
1140
|
-
_instanceof:
|
|
1104
|
+
_instanceof: C("instanceof", {
|
|
1141
1105
|
beforeExpr: !0,
|
|
1142
1106
|
binop: 7
|
|
1143
1107
|
}),
|
|
1144
|
-
_typeof:
|
|
1108
|
+
_typeof: C("typeof", {
|
|
1145
1109
|
beforeExpr: !0,
|
|
1146
1110
|
prefix: !0,
|
|
1147
1111
|
startsExpr: !0
|
|
1148
1112
|
}),
|
|
1149
|
-
_void:
|
|
1113
|
+
_void: C("void", {
|
|
1150
1114
|
beforeExpr: !0,
|
|
1151
1115
|
prefix: !0,
|
|
1152
1116
|
startsExpr: !0
|
|
1153
1117
|
}),
|
|
1154
|
-
_delete:
|
|
1118
|
+
_delete: C("delete", {
|
|
1155
1119
|
beforeExpr: !0,
|
|
1156
1120
|
prefix: !0,
|
|
1157
1121
|
startsExpr: !0
|
|
1158
1122
|
})
|
|
1159
|
-
},
|
|
1160
|
-
function
|
|
1123
|
+
}, T = /\r\n?|\n|\u2028|\u2029/, fe = new RegExp(T.source, "g");
|
|
1124
|
+
function E(e) {
|
|
1161
1125
|
return e === 10 || e === 13 || e === 8232 || e === 8233;
|
|
1162
1126
|
}
|
|
1163
|
-
function
|
|
1127
|
+
function pe(e, t, n) {
|
|
1164
1128
|
n === void 0 && (n = e.length);
|
|
1165
1129
|
for (var r = t; r < n; r++) {
|
|
1166
1130
|
var i = e.charCodeAt(r);
|
|
1167
|
-
if (
|
|
1131
|
+
if (E(i)) return r < n - 1 && i === 13 && e.charCodeAt(r + 1) === 10 ? r + 2 : r + 1;
|
|
1168
1132
|
}
|
|
1169
1133
|
return -1;
|
|
1170
1134
|
}
|
|
1171
|
-
var
|
|
1172
|
-
return
|
|
1173
|
-
}),
|
|
1174
|
-
return
|
|
1175
|
-
}),
|
|
1176
|
-
function
|
|
1177
|
-
return
|
|
1135
|
+
var me = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/, D = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g, he = Object.prototype, ge = he.hasOwnProperty, _e = he.toString, O = Object.hasOwn || (function(e, t) {
|
|
1136
|
+
return ge.call(e, t);
|
|
1137
|
+
}), ve = Array.isArray || (function(e) {
|
|
1138
|
+
return _e.call(e) === "[object Array]";
|
|
1139
|
+
}), ye = Object.create(null);
|
|
1140
|
+
function k(e) {
|
|
1141
|
+
return ye[e] || (ye[e] = RegExp("^(?:" + e.replace(/ /g, "|") + ")$"));
|
|
1178
1142
|
}
|
|
1179
|
-
function
|
|
1143
|
+
function A(e) {
|
|
1180
1144
|
return e <= 65535 ? String.fromCharCode(e) : (e -= 65536, String.fromCharCode((e >> 10) + 55296, (e & 1023) + 56320));
|
|
1181
1145
|
}
|
|
1182
|
-
var
|
|
1146
|
+
var be = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/, xe = function(e, t) {
|
|
1183
1147
|
this.line = e, this.column = t;
|
|
1184
1148
|
};
|
|
1185
|
-
|
|
1186
|
-
return new
|
|
1149
|
+
xe.prototype.offset = function(e) {
|
|
1150
|
+
return new xe(this.line, this.column + e);
|
|
1187
1151
|
};
|
|
1188
|
-
var
|
|
1152
|
+
var Se = function(e, t, n) {
|
|
1189
1153
|
this.start = t, this.end = n, e.sourceFile !== null && (this.source = e.sourceFile);
|
|
1190
1154
|
};
|
|
1191
|
-
function
|
|
1155
|
+
function Ce(e, t) {
|
|
1192
1156
|
for (var n = 1, r = 0;;) {
|
|
1193
|
-
var i =
|
|
1194
|
-
if (i < 0) return new
|
|
1157
|
+
var i = pe(e, r, t);
|
|
1158
|
+
if (i < 0) return new xe(n, t - r);
|
|
1195
1159
|
++n, r = i;
|
|
1196
1160
|
}
|
|
1197
1161
|
}
|
|
1198
|
-
var
|
|
1162
|
+
var we = {
|
|
1199
1163
|
ecmaVersion: null,
|
|
1200
1164
|
sourceType: "script",
|
|
1201
1165
|
strict: !1,
|
|
@@ -1216,20 +1180,20 @@ var Se = {
|
|
|
1216
1180
|
sourceFile: null,
|
|
1217
1181
|
directSourceFile: null,
|
|
1218
1182
|
preserveParens: !1
|
|
1219
|
-
},
|
|
1220
|
-
function
|
|
1183
|
+
}, Te = !1;
|
|
1184
|
+
function Ee(e) {
|
|
1221
1185
|
var t = {};
|
|
1222
|
-
for (var n in
|
|
1223
|
-
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!
|
|
1186
|
+
for (var n in we) t[n] = e && O(e, n) ? e[n] : we[n];
|
|
1187
|
+
if (t.ecmaVersion === "latest" ? t.ecmaVersion = 1e8 : t.ecmaVersion == null ? (!Te && typeof console == "object" && console.warn && (Te = !0, console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.")), t.ecmaVersion = 11) : t.ecmaVersion >= 2015 && (t.ecmaVersion -= 2009), t.allowReserved ??= t.ecmaVersion < 5, (!e || e.allowHashBang == null) && (t.allowHashBang = t.ecmaVersion >= 14), ve(t.onToken)) {
|
|
1224
1188
|
var r = t.onToken;
|
|
1225
1189
|
t.onToken = function(e) {
|
|
1226
1190
|
return r.push(e);
|
|
1227
1191
|
};
|
|
1228
1192
|
}
|
|
1229
|
-
if (
|
|
1193
|
+
if (ve(t.onComment) && (t.onComment = De(t, t.onComment)), t.sourceType === "commonjs" && t.allowAwaitOutsideFunction) throw Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");
|
|
1230
1194
|
return t;
|
|
1231
1195
|
}
|
|
1232
|
-
function
|
|
1196
|
+
function De(e, t) {
|
|
1233
1197
|
return function(n, r, i, a, o, s) {
|
|
1234
1198
|
var c = {
|
|
1235
1199
|
type: n ? "Block" : "Line",
|
|
@@ -1237,20 +1201,20 @@ function Te(e, t) {
|
|
|
1237
1201
|
start: i,
|
|
1238
1202
|
end: a
|
|
1239
1203
|
};
|
|
1240
|
-
e.locations && (c.loc = new
|
|
1204
|
+
e.locations && (c.loc = new Se(this, o, s)), e.ranges && (c.range = [i, a]), t.push(c);
|
|
1241
1205
|
};
|
|
1242
1206
|
}
|
|
1243
|
-
var
|
|
1244
|
-
function
|
|
1245
|
-
return
|
|
1207
|
+
var j = 1, M = 2, Oe = 4, ke = 8, Ae = 16, je = 32, Me = 64, Ne = 128, N = 256, Pe = 512, Fe = 1024, Ie = j | M | N;
|
|
1208
|
+
function Le(e, t) {
|
|
1209
|
+
return M | (e ? Oe : 0) | (t ? ke : 0);
|
|
1246
1210
|
}
|
|
1247
|
-
var
|
|
1248
|
-
this.options = e =
|
|
1211
|
+
var Re = 0, ze = 1, P = 2, Be = 3, Ve = 4, He = 5, F = function(e, t, n) {
|
|
1212
|
+
this.options = e = Ee(e), this.sourceFile = e.sourceFile, this.keywords = k(oe[e.ecmaVersion >= 6 ? 6 : e.sourceType === "module" ? "5module" : 5]);
|
|
1249
1213
|
var r = "";
|
|
1250
|
-
e.allowReserved !== !0 && (r =
|
|
1251
|
-
var i = (r ? r + " " : "") +
|
|
1252
|
-
this.reservedWordsStrict =
|
|
1253
|
-
},
|
|
1214
|
+
e.allowReserved !== !0 && (r = ie[e.ecmaVersion >= 6 ? 6 : e.ecmaVersion === 5 ? 5 : 3], e.sourceType === "module" && (r += " await")), this.reservedWords = k(r);
|
|
1215
|
+
var i = (r ? r + " " : "") + ie.strict;
|
|
1216
|
+
this.reservedWordsStrict = k(i), this.reservedWordsStrictBind = k(i + " " + ie.strictBind), this.input = String(t), this.containsEsc = !1, n ? (this.pos = n, this.lineStart = this.input.lastIndexOf("\n", n - 1) + 1, this.curLine = this.input.slice(0, this.lineStart).split(T).length) : (this.pos = this.lineStart = 0, this.curLine = 1), this.type = w.eof, this.value = null, this.start = this.end = this.pos, this.startLoc = this.endLoc = this.curPosition(), this.lastTokEndLoc = this.lastTokStartLoc = null, this.lastTokStart = this.lastTokEnd = this.pos, this.context = this.initialContext(), this.exprAllowed = !0, this.inModule = e.sourceType === "module", this.strict = this.inModule || e.strict === !0 || this.strictDirective(this.pos), this.potentialArrowAt = -1, this.potentialArrowInForAwait = !1, this.yieldPos = this.awaitPos = this.awaitIdentPos = 0, this.labels = [], this.undefinedExports = Object.create(null), this.pos === 0 && e.allowHashBang && this.input.slice(0, 2) === "#!" && this.skipLineComment(2), this.scopeStack = [], this.enterScope(this.options.sourceType === "commonjs" ? M : j), this.regexpState = null, this.privateNameStack = [];
|
|
1217
|
+
}, I = {
|
|
1254
1218
|
inFunction: { configurable: !0 },
|
|
1255
1219
|
inGenerator: { configurable: !0 },
|
|
1256
1220
|
inAsync: { configurable: !0 },
|
|
@@ -1263,120 +1227,120 @@ var Ie = 0, Le = 1, I = 2, Re = 3, ze = 4, Be = 5, L = function(e, t, n) {
|
|
|
1263
1227
|
allowUsing: { configurable: !0 },
|
|
1264
1228
|
inClassStaticBlock: { configurable: !0 }
|
|
1265
1229
|
};
|
|
1266
|
-
|
|
1230
|
+
F.prototype.parse = function() {
|
|
1267
1231
|
var e = this, t = this.options.program || this.startNode();
|
|
1268
1232
|
return this.nextToken(), this.catchStackOverflow(function() {
|
|
1269
1233
|
return e.parseTopLevel(t);
|
|
1270
1234
|
});
|
|
1271
|
-
},
|
|
1272
|
-
return (this.currentVarScope().flags &
|
|
1273
|
-
},
|
|
1274
|
-
return (this.currentVarScope().flags &
|
|
1275
|
-
},
|
|
1276
|
-
return (this.currentVarScope().flags &
|
|
1277
|
-
},
|
|
1235
|
+
}, I.inFunction.get = function() {
|
|
1236
|
+
return (this.currentVarScope().flags & M) > 0;
|
|
1237
|
+
}, I.inGenerator.get = function() {
|
|
1238
|
+
return (this.currentVarScope().flags & ke) > 0;
|
|
1239
|
+
}, I.inAsync.get = function() {
|
|
1240
|
+
return (this.currentVarScope().flags & Oe) > 0;
|
|
1241
|
+
}, I.canAwait.get = function() {
|
|
1278
1242
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1279
1243
|
var t = this.scopeStack[e].flags;
|
|
1280
|
-
if (t & (
|
|
1281
|
-
if (t &
|
|
1244
|
+
if (t & (N | Pe)) return !1;
|
|
1245
|
+
if (t & M) return (t & Oe) > 0;
|
|
1282
1246
|
}
|
|
1283
1247
|
return this.inModule && this.options.ecmaVersion >= 13 || this.options.allowAwaitOutsideFunction;
|
|
1284
|
-
},
|
|
1285
|
-
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags &
|
|
1286
|
-
},
|
|
1287
|
-
return (this.currentThisScope().flags &
|
|
1288
|
-
},
|
|
1289
|
-
return (this.currentThisScope().flags &
|
|
1290
|
-
},
|
|
1248
|
+
}, I.allowReturn.get = function() {
|
|
1249
|
+
return !!(this.inFunction || this.options.allowReturnOutsideFunction && this.currentVarScope().flags & j);
|
|
1250
|
+
}, I.allowSuper.get = function() {
|
|
1251
|
+
return (this.currentThisScope().flags & Me) > 0 || this.options.allowSuperOutsideMethod;
|
|
1252
|
+
}, I.allowDirectSuper.get = function() {
|
|
1253
|
+
return (this.currentThisScope().flags & Ne) > 0;
|
|
1254
|
+
}, I.treatFunctionsAsVar.get = function() {
|
|
1291
1255
|
return this.treatFunctionsAsVarInScope(this.currentScope());
|
|
1292
|
-
},
|
|
1256
|
+
}, I.allowNewDotTarget.get = function() {
|
|
1293
1257
|
for (var e = this.scopeStack.length - 1; e >= 0; e--) {
|
|
1294
1258
|
var t = this.scopeStack[e].flags;
|
|
1295
|
-
if (t & (
|
|
1259
|
+
if (t & (N | Pe) || t & M && !(t & Ae)) return !0;
|
|
1296
1260
|
}
|
|
1297
1261
|
return !1;
|
|
1298
|
-
},
|
|
1262
|
+
}, I.allowUsing.get = function() {
|
|
1299
1263
|
var e = this.currentScope().flags;
|
|
1300
|
-
return !(e &
|
|
1301
|
-
},
|
|
1302
|
-
return (this.currentVarScope().flags &
|
|
1303
|
-
},
|
|
1264
|
+
return !(e & Fe || !this.inModule && e & j);
|
|
1265
|
+
}, I.inClassStaticBlock.get = function() {
|
|
1266
|
+
return (this.currentVarScope().flags & N) > 0;
|
|
1267
|
+
}, F.extend = function() {
|
|
1304
1268
|
for (var e = [], t = arguments.length; t--;) e[t] = arguments[t];
|
|
1305
1269
|
for (var n = this, r = 0; r < e.length; r++) n = e[r](n);
|
|
1306
1270
|
return n;
|
|
1307
|
-
},
|
|
1271
|
+
}, F.parse = function(e, t) {
|
|
1308
1272
|
return new this(t, e).parse();
|
|
1309
|
-
},
|
|
1273
|
+
}, F.parseExpressionAt = function(e, t, n) {
|
|
1310
1274
|
var r = new this(n, e, t);
|
|
1311
1275
|
return r.nextToken(), r.parseExpression();
|
|
1312
|
-
},
|
|
1276
|
+
}, F.tokenizer = function(e, t) {
|
|
1313
1277
|
return new this(t, e);
|
|
1314
|
-
}, Object.defineProperties(
|
|
1315
|
-
var
|
|
1316
|
-
|
|
1278
|
+
}, Object.defineProperties(F.prototype, I);
|
|
1279
|
+
var L = F.prototype, Ue = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
|
|
1280
|
+
L.strictDirective = function(e) {
|
|
1317
1281
|
if (this.options.ecmaVersion < 5) return !1;
|
|
1318
1282
|
for (;;) {
|
|
1319
|
-
|
|
1320
|
-
var t =
|
|
1283
|
+
D.lastIndex = e, e += D.exec(this.input)[0].length;
|
|
1284
|
+
var t = Ue.exec(this.input.slice(e));
|
|
1321
1285
|
if (!t) return !1;
|
|
1322
1286
|
if ((t[1] || t[2]) === "use strict") {
|
|
1323
|
-
|
|
1324
|
-
var n =
|
|
1325
|
-
return i === ";" || i === "}" ||
|
|
1287
|
+
D.lastIndex = e + t[0].length;
|
|
1288
|
+
var n = D.exec(this.input), r = n.index + n[0].length, i = this.input.charAt(r);
|
|
1289
|
+
return i === ";" || i === "}" || T.test(n[0]) && !(/[(`.[+\-/*%<>=,?^&]/.test(i) || i === "!" && this.input.charAt(r + 1) === "=");
|
|
1326
1290
|
}
|
|
1327
|
-
e += t[0].length,
|
|
1291
|
+
e += t[0].length, D.lastIndex = e, e += D.exec(this.input)[0].length, this.input[e] === ";" && e++;
|
|
1328
1292
|
}
|
|
1329
|
-
},
|
|
1293
|
+
}, L.eat = function(e) {
|
|
1330
1294
|
return this.type === e ? (this.next(), !0) : !1;
|
|
1331
|
-
},
|
|
1332
|
-
return this.type ===
|
|
1333
|
-
},
|
|
1295
|
+
}, L.isContextual = function(e) {
|
|
1296
|
+
return this.type === w.name && this.value === e && !this.containsEsc;
|
|
1297
|
+
}, L.eatContextual = function(e) {
|
|
1334
1298
|
return this.isContextual(e) ? (this.next(), !0) : !1;
|
|
1335
|
-
},
|
|
1299
|
+
}, L.catchStackOverflow = function(e) {
|
|
1336
1300
|
try {
|
|
1337
1301
|
return e();
|
|
1338
1302
|
} catch (e) {
|
|
1339
1303
|
if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message))) this.raise(this.start, "Not enough stack space to parse input");
|
|
1340
1304
|
else throw e;
|
|
1341
1305
|
}
|
|
1342
|
-
},
|
|
1306
|
+
}, L.expectContextual = function(e) {
|
|
1343
1307
|
this.eatContextual(e) || this.unexpected();
|
|
1344
|
-
},
|
|
1345
|
-
return this.type ===
|
|
1346
|
-
},
|
|
1308
|
+
}, L.canInsertSemicolon = function() {
|
|
1309
|
+
return this.type === w.eof || this.type === w.braceR || T.test(this.input.slice(this.lastTokEnd, this.start));
|
|
1310
|
+
}, L.insertSemicolon = function() {
|
|
1347
1311
|
if (this.canInsertSemicolon()) return this.options.onInsertedSemicolon && this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc), !0;
|
|
1348
|
-
},
|
|
1349
|
-
!this.eat(
|
|
1350
|
-
},
|
|
1312
|
+
}, L.semicolon = function() {
|
|
1313
|
+
!this.eat(w.semi) && !this.insertSemicolon() && this.unexpected();
|
|
1314
|
+
}, L.afterTrailingComma = function(e, t) {
|
|
1351
1315
|
if (this.type === e) return this.options.onTrailingComma && this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc), t || this.next(), !0;
|
|
1352
|
-
},
|
|
1316
|
+
}, L.expect = function(e) {
|
|
1353
1317
|
this.eat(e) || this.unexpected();
|
|
1354
|
-
},
|
|
1318
|
+
}, L.unexpected = function(e) {
|
|
1355
1319
|
this.raise(e ?? this.start, "Unexpected token");
|
|
1356
1320
|
};
|
|
1357
|
-
var
|
|
1321
|
+
var We = function() {
|
|
1358
1322
|
this.shorthandAssign = this.trailingComma = this.parenthesizedAssign = this.parenthesizedBind = this.doubleProto = -1;
|
|
1359
1323
|
};
|
|
1360
|
-
|
|
1324
|
+
L.checkPatternErrors = function(e, t) {
|
|
1361
1325
|
if (e) {
|
|
1362
1326
|
e.trailingComma > -1 && this.raiseRecoverable(e.trailingComma, "Comma is not permitted after the rest element");
|
|
1363
1327
|
var n = t ? e.parenthesizedAssign : e.parenthesizedBind;
|
|
1364
1328
|
n > -1 && this.raiseRecoverable(n, t ? "Assigning to rvalue" : "Parenthesized pattern");
|
|
1365
1329
|
}
|
|
1366
|
-
},
|
|
1330
|
+
}, L.checkExpressionErrors = function(e, t) {
|
|
1367
1331
|
if (!e) return !1;
|
|
1368
1332
|
var n = e.shorthandAssign, r = e.doubleProto;
|
|
1369
1333
|
if (!t) return n >= 0 || r >= 0;
|
|
1370
1334
|
n >= 0 && this.raise(n, "Shorthand property assignments are valid only in destructuring patterns"), r >= 0 && this.raiseRecoverable(r, "Redefinition of __proto__ property");
|
|
1371
|
-
},
|
|
1335
|
+
}, L.checkYieldAwaitInDefaultParams = function() {
|
|
1372
1336
|
this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos) && this.raise(this.yieldPos, "Yield expression cannot be a default value"), this.awaitPos && this.raise(this.awaitPos, "Await expression cannot be a default value");
|
|
1373
|
-
},
|
|
1337
|
+
}, L.isSimpleAssignTarget = function(e) {
|
|
1374
1338
|
return e.type === "ParenthesizedExpression" ? this.isSimpleAssignTarget(e.expression) : e.type === "Identifier" || e.type === "MemberExpression";
|
|
1375
1339
|
};
|
|
1376
|
-
var
|
|
1377
|
-
|
|
1340
|
+
var R = F.prototype;
|
|
1341
|
+
R.parseTopLevel = function(e) {
|
|
1378
1342
|
var t = Object.create(null);
|
|
1379
|
-
for (e.body ||= []; this.type !==
|
|
1343
|
+
for (e.body ||= []; this.type !== w.eof;) {
|
|
1380
1344
|
var n = this.parseStatement(null, !0, t);
|
|
1381
1345
|
e.body.push(n);
|
|
1382
1346
|
}
|
|
@@ -1386,114 +1350,114 @@ B.parseTopLevel = function(e) {
|
|
|
1386
1350
|
}
|
|
1387
1351
|
return this.adaptDirectivePrologue(e.body), this.next(), e.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType, this.finishNode(e, "Program");
|
|
1388
1352
|
};
|
|
1389
|
-
var
|
|
1390
|
-
|
|
1353
|
+
var Ge = { kind: "loop" }, Ke = { kind: "switch" };
|
|
1354
|
+
R.isLet = function(e) {
|
|
1391
1355
|
if (this.options.ecmaVersion < 6 || !this.isContextual("let")) return !1;
|
|
1392
|
-
|
|
1393
|
-
var t =
|
|
1356
|
+
D.lastIndex = this.pos;
|
|
1357
|
+
var t = D.exec(this.input), n = this.pos + t[0].length, r = this.fullCharCodeAt(n);
|
|
1394
1358
|
if (r === 91 || r === 92) return !0;
|
|
1395
1359
|
if (e) return !1;
|
|
1396
1360
|
if (r === 123) return !0;
|
|
1397
|
-
if (
|
|
1361
|
+
if (_(r)) {
|
|
1398
1362
|
var i = n;
|
|
1399
1363
|
do
|
|
1400
1364
|
n += r <= 65535 ? 1 : 2;
|
|
1401
|
-
while (
|
|
1365
|
+
while (v(r = this.fullCharCodeAt(n)));
|
|
1402
1366
|
if (r === 92) return !0;
|
|
1403
1367
|
var a = this.input.slice(i, n);
|
|
1404
|
-
if (!
|
|
1368
|
+
if (!se.test(a)) return !0;
|
|
1405
1369
|
}
|
|
1406
1370
|
return !1;
|
|
1407
|
-
},
|
|
1371
|
+
}, R.isAsyncFunction = function() {
|
|
1408
1372
|
if (this.options.ecmaVersion < 8 || !this.isContextual("async")) return !1;
|
|
1409
|
-
|
|
1410
|
-
var e =
|
|
1411
|
-
return !
|
|
1412
|
-
},
|
|
1373
|
+
D.lastIndex = this.pos;
|
|
1374
|
+
var e = D.exec(this.input), t = this.pos + e[0].length, n;
|
|
1375
|
+
return !T.test(this.input.slice(this.pos, t)) && this.input.slice(t, t + 8) === "function" && (t + 8 === this.input.length || !(v(n = this.fullCharCodeAt(t + 8)) || n === 92));
|
|
1376
|
+
}, R.isUsingKeyword = function(e, t) {
|
|
1413
1377
|
if (this.options.ecmaVersion < 17 || !this.isContextual(e ? "await" : "using")) return !1;
|
|
1414
|
-
|
|
1415
|
-
var n =
|
|
1416
|
-
if (
|
|
1378
|
+
D.lastIndex = this.pos;
|
|
1379
|
+
var n = D.exec(this.input), r = this.pos + n[0].length;
|
|
1380
|
+
if (T.test(this.input.slice(this.pos, r))) return !1;
|
|
1417
1381
|
if (e) {
|
|
1418
1382
|
var i = r + 5, a;
|
|
1419
|
-
if (this.input.slice(r, i) !== "using" || i === this.input.length ||
|
|
1420
|
-
|
|
1421
|
-
var o =
|
|
1422
|
-
if (r = i + o[0].length, o &&
|
|
1383
|
+
if (this.input.slice(r, i) !== "using" || i === this.input.length || v(a = this.fullCharCodeAt(i)) || a === 92) return !1;
|
|
1384
|
+
D.lastIndex = i;
|
|
1385
|
+
var o = D.exec(this.input);
|
|
1386
|
+
if (r = i + o[0].length, o && T.test(this.input.slice(i, r))) return !1;
|
|
1423
1387
|
}
|
|
1424
1388
|
var s = this.fullCharCodeAt(r);
|
|
1425
|
-
if (!
|
|
1389
|
+
if (!_(s) && s !== 92) return !1;
|
|
1426
1390
|
var c = r;
|
|
1427
1391
|
do
|
|
1428
1392
|
r += s <= 65535 ? 1 : 2;
|
|
1429
|
-
while (
|
|
1393
|
+
while (v(s = this.fullCharCodeAt(r)));
|
|
1430
1394
|
if (s === 92) return !0;
|
|
1431
1395
|
var l = this.input.slice(c, r);
|
|
1432
|
-
if (
|
|
1396
|
+
if (se.test(l)) return !1;
|
|
1433
1397
|
if (t && !e && l === "of") {
|
|
1434
|
-
|
|
1435
|
-
var u =
|
|
1398
|
+
D.lastIndex = r;
|
|
1399
|
+
var u = D.exec(this.input);
|
|
1436
1400
|
if (r += u[0].length, this.input.charCodeAt(r) !== 61 || (s = this.input.charCodeAt(r + 1)) === 61 || s === 62) return !1;
|
|
1437
1401
|
}
|
|
1438
1402
|
return !0;
|
|
1439
|
-
},
|
|
1403
|
+
}, R.isAwaitUsing = function(e) {
|
|
1440
1404
|
return this.isUsingKeyword(!0, e);
|
|
1441
|
-
},
|
|
1405
|
+
}, R.isUsing = function(e) {
|
|
1442
1406
|
return this.isUsingKeyword(!1, e);
|
|
1443
|
-
},
|
|
1407
|
+
}, R.parseStatement = function(e, t, n) {
|
|
1444
1408
|
var r = this.type, i = this.startNode(), a;
|
|
1445
|
-
switch (this.isLet(e) && (r =
|
|
1446
|
-
case
|
|
1447
|
-
case
|
|
1448
|
-
case
|
|
1449
|
-
case
|
|
1450
|
-
case
|
|
1451
|
-
case
|
|
1452
|
-
case
|
|
1453
|
-
case
|
|
1454
|
-
case
|
|
1455
|
-
case
|
|
1456
|
-
case
|
|
1457
|
-
case
|
|
1458
|
-
case
|
|
1459
|
-
case
|
|
1460
|
-
case
|
|
1461
|
-
case
|
|
1462
|
-
case
|
|
1463
|
-
case
|
|
1464
|
-
case
|
|
1465
|
-
case
|
|
1466
|
-
if (this.options.ecmaVersion > 10 && r ===
|
|
1467
|
-
|
|
1468
|
-
var o =
|
|
1409
|
+
switch (this.isLet(e) && (r = w._var, a = "let"), r) {
|
|
1410
|
+
case w._break:
|
|
1411
|
+
case w._continue: return this.parseBreakContinueStatement(i, r.keyword);
|
|
1412
|
+
case w._debugger: return this.parseDebuggerStatement(i);
|
|
1413
|
+
case w._do: return this.parseDoStatement(i);
|
|
1414
|
+
case w._for: return this.parseForStatement(i);
|
|
1415
|
+
case w._function: return e && (this.strict || e !== "if" && e !== "label") && this.options.ecmaVersion >= 6 && this.unexpected(), this.parseFunctionStatement(i, !1, !e);
|
|
1416
|
+
case w._class: return e && this.unexpected(), this.parseClass(i, !0);
|
|
1417
|
+
case w._if: return this.parseIfStatement(i);
|
|
1418
|
+
case w._return: return this.parseReturnStatement(i);
|
|
1419
|
+
case w._switch: return this.parseSwitchStatement(i);
|
|
1420
|
+
case w._throw: return this.parseThrowStatement(i);
|
|
1421
|
+
case w._try: return this.parseTryStatement(i);
|
|
1422
|
+
case w._const:
|
|
1423
|
+
case w._var: return a ||= this.value, e && a !== "var" && this.unexpected(), this.parseVarStatement(i, a);
|
|
1424
|
+
case w._while: return this.parseWhileStatement(i);
|
|
1425
|
+
case w._with: return this.parseWithStatement(i);
|
|
1426
|
+
case w.braceL: return this.parseBlock(!0, i);
|
|
1427
|
+
case w.semi: return this.parseEmptyStatement(i);
|
|
1428
|
+
case w._export:
|
|
1429
|
+
case w._import:
|
|
1430
|
+
if (this.options.ecmaVersion > 10 && r === w._import) {
|
|
1431
|
+
D.lastIndex = this.pos;
|
|
1432
|
+
var o = D.exec(this.input), s = this.pos + o[0].length, c = this.input.charCodeAt(s);
|
|
1469
1433
|
if (c === 40 || c === 46) return this.parseExpressionStatement(i, this.parseExpression());
|
|
1470
1434
|
}
|
|
1471
|
-
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r ===
|
|
1435
|
+
return this.options.allowImportExportEverywhere || (t || this.raise(this.start, "'import' and 'export' may only appear at the top level"), this.inModule || this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'")), r === w._import ? this.parseImport(i) : this.parseExport(i, n);
|
|
1472
1436
|
default:
|
|
1473
1437
|
if (this.isAsyncFunction()) return e && this.unexpected(), this.next(), this.parseFunctionStatement(i, !0, !e);
|
|
1474
1438
|
var l = this.isAwaitUsing(!1) ? "await using" : this.isUsing(!1) ? "using" : null;
|
|
1475
1439
|
if (l) return this.allowUsing || this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"), e && this.raise(this.start, "Using declaration is not allowed in single-statement positions"), l === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.next(), this.parseVar(i, !1, l), this.semicolon(), this.finishNode(i, "VariableDeclaration");
|
|
1476
1440
|
var u = this.value, d = this.parseExpression();
|
|
1477
|
-
return r ===
|
|
1441
|
+
return r === w.name && d.type === "Identifier" && this.eat(w.colon) ? this.parseLabeledStatement(i, u, d, e) : this.parseExpressionStatement(i, d);
|
|
1478
1442
|
}
|
|
1479
|
-
},
|
|
1443
|
+
}, R.parseBreakContinueStatement = function(e, t) {
|
|
1480
1444
|
var n = t === "break";
|
|
1481
|
-
this.next(), this.eat(
|
|
1445
|
+
this.next(), this.eat(w.semi) || this.insertSemicolon() ? e.label = null : this.type === w.name ? (e.label = this.parseIdent(), this.semicolon()) : this.unexpected();
|
|
1482
1446
|
for (var r = 0; r < this.labels.length; ++r) {
|
|
1483
1447
|
var i = this.labels[r];
|
|
1484
1448
|
if ((e.label == null || i.name === e.label.name) && (i.kind != null && (n || i.kind === "loop") || e.label && n)) break;
|
|
1485
1449
|
}
|
|
1486
1450
|
return r === this.labels.length && this.raise(e.start, "Unsyntactic " + t), this.finishNode(e, n ? "BreakStatement" : "ContinueStatement");
|
|
1487
|
-
},
|
|
1451
|
+
}, R.parseDebuggerStatement = function(e) {
|
|
1488
1452
|
return this.next(), this.semicolon(), this.finishNode(e, "DebuggerStatement");
|
|
1489
|
-
},
|
|
1490
|
-
return this.next(), this.labels.push(
|
|
1491
|
-
},
|
|
1453
|
+
}, R.parseDoStatement = function(e) {
|
|
1454
|
+
return this.next(), this.labels.push(Ge), e.body = this.parseStatement("do"), this.labels.pop(), this.expect(w._while), e.test = this.parseParenExpression(), this.options.ecmaVersion >= 6 ? this.eat(w.semi) : this.semicolon(), this.finishNode(e, "DoWhileStatement");
|
|
1455
|
+
}, R.parseForStatement = function(e) {
|
|
1492
1456
|
this.next();
|
|
1493
1457
|
var t = this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await") ? this.lastTokStart : -1;
|
|
1494
|
-
if (this.labels.push(
|
|
1458
|
+
if (this.labels.push(Ge), this.enterScope(0), this.expect(w.parenL), this.type === w.semi) return t > -1 && this.unexpected(t), this.parseFor(e, null);
|
|
1495
1459
|
var n = this.isLet();
|
|
1496
|
-
if (this.type ===
|
|
1460
|
+
if (this.type === w._var || this.type === w._const || n) {
|
|
1497
1461
|
var r = this.startNode(), i = n ? "let" : this.value;
|
|
1498
1462
|
return this.next(), this.parseVar(r, !0, i), this.finishNode(r, "VariableDeclaration"), this.parseForAfterInit(e, r, t);
|
|
1499
1463
|
}
|
|
@@ -1502,47 +1466,47 @@ B.isLet = function(e) {
|
|
|
1502
1466
|
var c = this.startNode();
|
|
1503
1467
|
return this.next(), s === "await using" && (this.canAwait || this.raise(this.start, "Await using cannot appear outside of async function"), this.next()), this.parseVar(c, !0, s), this.finishNode(c, "VariableDeclaration"), this.parseForAfterInit(e, c, t);
|
|
1504
1468
|
}
|
|
1505
|
-
var l = this.containsEsc, u = new
|
|
1506
|
-
return this.type ===
|
|
1507
|
-
},
|
|
1508
|
-
return (this.type ===
|
|
1509
|
-
},
|
|
1510
|
-
return this.next(), this.parseFunction(e,
|
|
1511
|
-
},
|
|
1512
|
-
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(
|
|
1513
|
-
},
|
|
1514
|
-
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(
|
|
1515
|
-
},
|
|
1516
|
-
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(
|
|
1517
|
-
for (var t, n = !1; this.type !==
|
|
1518
|
-
var r = this.type ===
|
|
1519
|
-
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(
|
|
1469
|
+
var l = this.containsEsc, u = new We(), d = this.start, f = t > -1 ? this.parseExprSubscripts(u, "await") : this.parseExpression(!0, u);
|
|
1470
|
+
return this.type === w._in || (o = this.options.ecmaVersion >= 6 && this.isContextual("of")) ? (t > -1 ? (this.type === w._in && this.unexpected(t), e.await = !0) : o && this.options.ecmaVersion >= 8 && (f.start === d && !l && f.type === "Identifier" && f.name === "async" ? this.unexpected() : this.options.ecmaVersion >= 9 && (e.await = !1)), a && o && this.raise(f.start, "The left-hand side of a for-of loop may not start with 'let'."), this.toAssignable(f, !1, u), this.checkLValPattern(f), this.parseForIn(e, f)) : (this.checkExpressionErrors(u, !0), t > -1 && this.unexpected(t), this.parseFor(e, f));
|
|
1471
|
+
}, R.parseForAfterInit = function(e, t, n) {
|
|
1472
|
+
return (this.type === w._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && t.declarations.length === 1 ? (this.type === w._in ? ((t.kind === "using" || t.kind === "await using") && !t.declarations[0].init && this.raise(this.start, "Using declaration is not allowed in for-in loops"), this.options.ecmaVersion >= 9 && n > -1 && this.unexpected(n)) : this.options.ecmaVersion >= 9 && (e.await = n > -1), this.parseForIn(e, t)) : (n > -1 && this.unexpected(n), this.parseFor(e, t));
|
|
1473
|
+
}, R.parseFunctionStatement = function(e, t, n) {
|
|
1474
|
+
return this.next(), this.parseFunction(e, Je | (n ? 0 : Ye), !1, t);
|
|
1475
|
+
}, R.parseIfStatement = function(e) {
|
|
1476
|
+
return this.next(), e.test = this.parseParenExpression(), e.consequent = this.parseStatement("if"), e.alternate = this.eat(w._else) ? this.parseStatement("if") : null, this.finishNode(e, "IfStatement");
|
|
1477
|
+
}, R.parseReturnStatement = function(e) {
|
|
1478
|
+
return this.allowReturn || this.raise(this.start, "'return' outside of function"), this.next(), this.eat(w.semi) || this.insertSemicolon() ? e.argument = null : (e.argument = this.parseExpression(), this.semicolon()), this.finishNode(e, "ReturnStatement");
|
|
1479
|
+
}, R.parseSwitchStatement = function(e) {
|
|
1480
|
+
this.next(), e.discriminant = this.parseParenExpression(), e.cases = [], this.expect(w.braceL), this.labels.push(Ke), this.enterScope(Fe);
|
|
1481
|
+
for (var t, n = !1; this.type !== w.braceR;) if (this.type === w._case || this.type === w._default) {
|
|
1482
|
+
var r = this.type === w._case;
|
|
1483
|
+
t && this.finishNode(t, "SwitchCase"), e.cases.push(t = this.startNode()), t.consequent = [], this.next(), r ? t.test = this.parseExpression() : (n && this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"), n = !0, t.test = null), this.expect(w.colon);
|
|
1520
1484
|
} else t || this.unexpected(), t.consequent.push(this.parseStatement(null));
|
|
1521
1485
|
return this.exitScope(), t && this.finishNode(t, "SwitchCase"), this.next(), this.labels.pop(), this.finishNode(e, "SwitchStatement");
|
|
1522
|
-
},
|
|
1523
|
-
return this.next(),
|
|
1486
|
+
}, R.parseThrowStatement = function(e) {
|
|
1487
|
+
return this.next(), T.test(this.input.slice(this.lastTokEnd, this.start)) && this.raise(this.lastTokEnd, "Illegal newline after throw"), e.argument = this.parseExpression(), this.semicolon(), this.finishNode(e, "ThrowStatement");
|
|
1524
1488
|
};
|
|
1525
|
-
var
|
|
1526
|
-
|
|
1489
|
+
var qe = [];
|
|
1490
|
+
R.parseCatchClauseParam = function() {
|
|
1527
1491
|
var e = this.parseBindingAtom(), t = e.type === "Identifier";
|
|
1528
|
-
return this.enterScope(t ?
|
|
1529
|
-
},
|
|
1530
|
-
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type ===
|
|
1492
|
+
return this.enterScope(t ? je : 0), this.checkLValPattern(e, t ? Ve : P), this.expect(w.parenR), e;
|
|
1493
|
+
}, R.parseTryStatement = function(e) {
|
|
1494
|
+
if (this.next(), e.block = this.parseBlock(), e.handler = null, this.type === w._catch) {
|
|
1531
1495
|
var t = this.startNode();
|
|
1532
|
-
this.next(), this.eat(
|
|
1496
|
+
this.next(), this.eat(w.parenL) ? t.param = this.parseCatchClauseParam() : (this.options.ecmaVersion < 10 && this.unexpected(), t.param = null, this.enterScope(0)), t.body = this.parseBlock(!1), this.exitScope(), e.handler = this.finishNode(t, "CatchClause");
|
|
1533
1497
|
}
|
|
1534
|
-
return e.finalizer = this.eat(
|
|
1535
|
-
},
|
|
1498
|
+
return e.finalizer = this.eat(w._finally) ? this.parseBlock() : null, !e.handler && !e.finalizer && this.raise(e.start, "Missing catch or finally clause"), this.finishNode(e, "TryStatement");
|
|
1499
|
+
}, R.parseVarStatement = function(e, t, n) {
|
|
1536
1500
|
return this.next(), this.parseVar(e, !1, t, n), this.semicolon(), this.finishNode(e, "VariableDeclaration");
|
|
1537
|
-
},
|
|
1538
|
-
return this.next(), e.test = this.parseParenExpression(), this.labels.push(
|
|
1539
|
-
},
|
|
1501
|
+
}, R.parseWhileStatement = function(e) {
|
|
1502
|
+
return this.next(), e.test = this.parseParenExpression(), this.labels.push(Ge), e.body = this.parseStatement("while"), this.labels.pop(), this.finishNode(e, "WhileStatement");
|
|
1503
|
+
}, R.parseWithStatement = function(e) {
|
|
1540
1504
|
return this.strict && this.raise(this.start, "'with' in strict mode"), this.next(), e.object = this.parseParenExpression(), e.body = this.parseStatement("with"), this.finishNode(e, "WithStatement");
|
|
1541
|
-
},
|
|
1505
|
+
}, R.parseEmptyStatement = function(e) {
|
|
1542
1506
|
return this.next(), this.finishNode(e, "EmptyStatement");
|
|
1543
|
-
},
|
|
1507
|
+
}, R.parseLabeledStatement = function(e, t, n, r) {
|
|
1544
1508
|
for (var i = 0, a = this.labels; i < a.length; i += 1) a[i].name === t && this.raise(n.start, "Label '" + t + "' is already declared");
|
|
1545
|
-
for (var o = this.type.isLoop ? "loop" : this.type ===
|
|
1509
|
+
for (var o = this.type.isLoop ? "loop" : this.type === w._switch ? "switch" : null, s = this.labels.length - 1; s >= 0; s--) {
|
|
1546
1510
|
var c = this.labels[s];
|
|
1547
1511
|
if (c.statementStart === e.start) c.statementStart = this.start, c.kind = o;
|
|
1548
1512
|
else break;
|
|
@@ -1552,113 +1516,113 @@ B.parseCatchClauseParam = function() {
|
|
|
1552
1516
|
kind: o,
|
|
1553
1517
|
statementStart: this.start
|
|
1554
1518
|
}), e.body = this.parseStatement(r ? r.indexOf("label") === -1 ? r + "label" : r : "label"), this.labels.pop(), e.label = n, this.finishNode(e, "LabeledStatement");
|
|
1555
|
-
},
|
|
1519
|
+
}, R.parseExpressionStatement = function(e, t) {
|
|
1556
1520
|
return e.expression = t, this.semicolon(), this.finishNode(e, "ExpressionStatement");
|
|
1557
|
-
},
|
|
1558
|
-
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(
|
|
1521
|
+
}, R.parseBlock = function(e, t, n) {
|
|
1522
|
+
for (e === void 0 && (e = !0), t === void 0 && (t = this.startNode()), t.body = [], this.expect(w.braceL), e && this.enterScope(0); this.type !== w.braceR;) {
|
|
1559
1523
|
var r = this.parseStatement(null);
|
|
1560
1524
|
t.body.push(r);
|
|
1561
1525
|
}
|
|
1562
1526
|
return n && (this.strict = !1), this.next(), e && this.exitScope(), this.finishNode(t, "BlockStatement");
|
|
1563
|
-
},
|
|
1564
|
-
return e.init = t, this.expect(
|
|
1565
|
-
},
|
|
1566
|
-
var n = this.type ===
|
|
1567
|
-
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(
|
|
1568
|
-
},
|
|
1527
|
+
}, R.parseFor = function(e, t) {
|
|
1528
|
+
return e.init = t, this.expect(w.semi), e.test = this.type === w.semi ? null : this.parseExpression(), this.expect(w.semi), e.update = this.type === w.parenR ? null : this.parseExpression(), this.expect(w.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, "ForStatement");
|
|
1529
|
+
}, R.parseForIn = function(e, t) {
|
|
1530
|
+
var n = this.type === w._in;
|
|
1531
|
+
return this.next(), t.type === "VariableDeclaration" && t.declarations[0].init != null && (!n || this.options.ecmaVersion < 8 || this.strict || t.kind !== "var" || t.declarations[0].id.type !== "Identifier") && this.raise(t.start, (n ? "for-in" : "for-of") + " loop variable declaration may not have an initializer"), e.left = t, e.right = n ? this.parseExpression() : this.parseMaybeAssign(), this.expect(w.parenR), e.body = this.parseStatement("for"), this.exitScope(), this.labels.pop(), this.finishNode(e, n ? "ForInStatement" : "ForOfStatement");
|
|
1532
|
+
}, R.parseVar = function(e, t, n, r) {
|
|
1569
1533
|
for (e.declarations = [], e.kind = n;;) {
|
|
1570
1534
|
var i = this.startNode();
|
|
1571
|
-
if (this.parseVarId(i, n), this.eat(
|
|
1535
|
+
if (this.parseVarId(i, n), this.eat(w.eq) ? i.init = this.parseMaybeAssign(t) : !r && n === "const" && !(this.type === w._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) ? this.unexpected() : !r && (n === "using" || n === "await using") && this.options.ecmaVersion >= 17 && this.type !== w._in && !this.isContextual("of") ? this.raise(this.lastTokEnd, "Missing initializer in " + n + " declaration") : !r && i.id.type !== "Identifier" && !(t && (this.type === w._in || this.isContextual("of"))) ? this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value") : i.init = null, e.declarations.push(this.finishNode(i, "VariableDeclarator")), !this.eat(w.comma)) break;
|
|
1572
1536
|
}
|
|
1573
1537
|
return e;
|
|
1574
|
-
},
|
|
1575
|
-
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ?
|
|
1538
|
+
}, R.parseVarId = function(e, t) {
|
|
1539
|
+
e.id = t === "using" || t === "await using" ? this.parseIdent() : this.parseBindingAtom(), this.checkLValPattern(e.id, t === "var" ? ze : P, !1);
|
|
1576
1540
|
};
|
|
1577
|
-
var
|
|
1578
|
-
|
|
1579
|
-
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type ===
|
|
1541
|
+
var Je = 1, Ye = 2, Xe = 4;
|
|
1542
|
+
R.parseFunction = function(e, t, n, r, i) {
|
|
1543
|
+
this.initFunction(e), (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !r) && (this.type === w.star && t & Ye && this.unexpected(), e.generator = this.eat(w.star)), this.options.ecmaVersion >= 8 && (e.async = !!r), t & Je && (e.id = t & Xe && this.type !== w.name ? null : this.parseIdent(), e.id && !(t & Ye) && this.checkLValSimple(e.id, this.strict || e.generator || e.async ? this.treatFunctionsAsVar ? ze : P : Be));
|
|
1580
1544
|
var a = this.yieldPos, o = this.awaitPos, s = this.awaitIdentPos;
|
|
1581
|
-
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
1582
|
-
},
|
|
1583
|
-
this.expect(
|
|
1584
|
-
},
|
|
1545
|
+
return this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Le(e.async, e.generator)), t & Je || (e.id = this.type === w.name ? this.parseIdent() : null), this.parseFunctionParams(e), this.parseFunctionBody(e, n, !1, i), this.yieldPos = a, this.awaitPos = o, this.awaitIdentPos = s, this.finishNode(e, t & Je ? "FunctionDeclaration" : "FunctionExpression");
|
|
1546
|
+
}, R.parseFunctionParams = function(e) {
|
|
1547
|
+
this.expect(w.parenL), e.params = this.parseBindingList(w.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams();
|
|
1548
|
+
}, R.parseClass = function(e, t) {
|
|
1585
1549
|
this.next();
|
|
1586
1550
|
var n = this.strict;
|
|
1587
1551
|
this.strict = !0, this.parseClassId(e, t), this.parseClassSuper(e);
|
|
1588
1552
|
var r = this.enterClassBody(), i = this.startNode(), a = !1;
|
|
1589
|
-
for (i.body = [], this.expect(
|
|
1553
|
+
for (i.body = [], this.expect(w.braceL); this.type !== w.braceR;) {
|
|
1590
1554
|
var o = this.parseClassElement(e.superClass !== null);
|
|
1591
|
-
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" &&
|
|
1555
|
+
o && (i.body.push(o), o.type === "MethodDefinition" && o.kind === "constructor" ? (a && this.raiseRecoverable(o.start, "Duplicate constructor in the same class"), a = !0) : o.key && o.key.type === "PrivateIdentifier" && Ze(r, o) && this.raiseRecoverable(o.key.start, "Identifier '#" + o.key.name + "' has already been declared"));
|
|
1592
1556
|
}
|
|
1593
1557
|
return this.strict = n, this.next(), e.body = this.finishNode(i, "ClassBody"), this.exitClassBody(), this.finishNode(e, t ? "ClassDeclaration" : "ClassExpression");
|
|
1594
|
-
},
|
|
1595
|
-
if (this.eat(
|
|
1558
|
+
}, R.parseClassElement = function(e) {
|
|
1559
|
+
if (this.eat(w.semi)) return null;
|
|
1596
1560
|
var t = this.options.ecmaVersion, n = this.startNode(), r = "", i = !1, a = !1, o = "method", s = !1;
|
|
1597
1561
|
if (this.eatContextual("static")) {
|
|
1598
|
-
if (t >= 13 && this.eat(
|
|
1599
|
-
this.isClassElementNameStart() || this.type ===
|
|
1562
|
+
if (t >= 13 && this.eat(w.braceL)) return this.parseClassStaticBlock(n), n;
|
|
1563
|
+
this.isClassElementNameStart() || this.type === w.star ? s = !0 : r = "static";
|
|
1600
1564
|
}
|
|
1601
|
-
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type ===
|
|
1565
|
+
if (n.static = s, !r && t >= 8 && this.eatContextual("async") && ((this.isClassElementNameStart() || this.type === w.star) && !this.canInsertSemicolon() ? a = !0 : r = "async"), !r && (t >= 9 || !a) && this.eat(w.star) && (i = !0), !r && !a && !i) {
|
|
1602
1566
|
var c = this.value;
|
|
1603
1567
|
(this.eatContextual("get") || this.eatContextual("set")) && (this.isClassElementNameStart() ? o = c : r = c);
|
|
1604
1568
|
}
|
|
1605
|
-
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type ===
|
|
1606
|
-
var l = !n.static &&
|
|
1569
|
+
if (r ? (n.computed = !1, n.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc), n.key.name = r, this.finishNode(n.key, "Identifier")) : this.parseClassElementName(n), t < 13 || this.type === w.parenL || o !== "method" || i || a) {
|
|
1570
|
+
var l = !n.static && Qe(n, "constructor"), u = l && e;
|
|
1607
1571
|
l && o !== "method" && this.raise(n.key.start, "Constructor can't have get/set modifier"), n.kind = l ? "constructor" : o, this.parseClassMethod(n, i, a, u);
|
|
1608
1572
|
} else this.parseClassField(n);
|
|
1609
1573
|
return n;
|
|
1610
|
-
},
|
|
1611
|
-
return this.type ===
|
|
1612
|
-
},
|
|
1613
|
-
this.type ===
|
|
1614
|
-
},
|
|
1574
|
+
}, R.isClassElementNameStart = function() {
|
|
1575
|
+
return this.type === w.name || this.type === w.privateId || this.type === w.num || this.type === w.string || this.type === w.bracketL || this.type.keyword;
|
|
1576
|
+
}, R.parseClassElementName = function(e) {
|
|
1577
|
+
this.type === w.privateId ? (this.value === "constructor" && this.raise(this.start, "Classes can't have an element named '#constructor'"), e.computed = !1, e.key = this.parsePrivateIdent()) : this.parsePropertyName(e);
|
|
1578
|
+
}, R.parseClassMethod = function(e, t, n, r) {
|
|
1615
1579
|
var i = e.key;
|
|
1616
|
-
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static &&
|
|
1580
|
+
e.kind === "constructor" ? (t && this.raise(i.start, "Constructor can't be a generator"), n && this.raise(i.start, "Constructor can't be an async method")) : e.static && Qe(e, "prototype") && this.raise(i.start, "Classes may not have a static property named prototype");
|
|
1617
1581
|
var a = e.value = this.parseMethod(t, n, r);
|
|
1618
1582
|
return e.kind === "get" && a.params.length !== 0 && this.raiseRecoverable(a.start, "getter should have no params"), e.kind === "set" && a.params.length !== 1 && this.raiseRecoverable(a.start, "setter should have exactly one param"), e.kind === "set" && a.params[0].type === "RestElement" && this.raiseRecoverable(a.params[0].start, "Setter cannot use rest params"), this.finishNode(e, "MethodDefinition");
|
|
1619
|
-
},
|
|
1620
|
-
return
|
|
1621
|
-
},
|
|
1583
|
+
}, R.parseClassField = function(e) {
|
|
1584
|
+
return Qe(e, "constructor") ? this.raise(e.key.start, "Classes can't have a field named 'constructor'") : e.static && Qe(e, "prototype") && this.raise(e.key.start, "Classes can't have a static field named 'prototype'"), this.eat(w.eq) ? (this.enterScope(Pe | Me), e.value = this.parseMaybeAssign(), this.exitScope()) : e.value = null, this.semicolon(), this.finishNode(e, "PropertyDefinition");
|
|
1585
|
+
}, R.parseClassStaticBlock = function(e) {
|
|
1622
1586
|
e.body = [];
|
|
1623
1587
|
var t = this.labels;
|
|
1624
|
-
for (this.labels = [], this.enterScope(
|
|
1588
|
+
for (this.labels = [], this.enterScope(N | Me); this.type !== w.braceR;) {
|
|
1625
1589
|
var n = this.parseStatement(null);
|
|
1626
1590
|
e.body.push(n);
|
|
1627
1591
|
}
|
|
1628
1592
|
return this.next(), this.exitScope(), this.labels = t, this.finishNode(e, "StaticBlock");
|
|
1629
|
-
},
|
|
1630
|
-
this.type ===
|
|
1631
|
-
},
|
|
1632
|
-
e.superClass = this.eat(
|
|
1633
|
-
},
|
|
1593
|
+
}, R.parseClassId = function(e, t) {
|
|
1594
|
+
this.type === w.name ? (e.id = this.parseIdent(), t && this.checkLValSimple(e.id, P, !1)) : (t === !0 && this.unexpected(), e.id = null);
|
|
1595
|
+
}, R.parseClassSuper = function(e) {
|
|
1596
|
+
e.superClass = this.eat(w._extends) ? this.parseExprSubscripts(null, !1) : null;
|
|
1597
|
+
}, R.enterClassBody = function() {
|
|
1634
1598
|
var e = {
|
|
1635
1599
|
declared: Object.create(null),
|
|
1636
1600
|
used: []
|
|
1637
1601
|
};
|
|
1638
1602
|
return this.privateNameStack.push(e), e.declared;
|
|
1639
|
-
},
|
|
1603
|
+
}, R.exitClassBody = function() {
|
|
1640
1604
|
var e = this.privateNameStack.pop(), t = e.declared, n = e.used;
|
|
1641
1605
|
if (this.options.checkPrivateFields) for (var r = this.privateNameStack.length, i = r === 0 ? null : this.privateNameStack[r - 1], a = 0; a < n.length; ++a) {
|
|
1642
1606
|
var o = n[a];
|
|
1643
|
-
|
|
1607
|
+
O(t, o.name) || (i ? i.used.push(o) : this.raiseRecoverable(o.start, "Private field '#" + o.name + "' must be declared in an enclosing class"));
|
|
1644
1608
|
}
|
|
1645
1609
|
};
|
|
1646
|
-
function
|
|
1610
|
+
function Ze(e, t) {
|
|
1647
1611
|
var n = t.key.name, r = e[n], i = "true";
|
|
1648
1612
|
return t.type === "MethodDefinition" && (t.kind === "get" || t.kind === "set") && (i = (t.static ? "s" : "i") + t.kind), r === "iget" && i === "iset" || r === "iset" && i === "iget" || r === "sget" && i === "sset" || r === "sset" && i === "sget" ? (e[n] = "true", !1) : r ? !0 : (e[n] = i, !1);
|
|
1649
1613
|
}
|
|
1650
|
-
function
|
|
1614
|
+
function Qe(e, t) {
|
|
1651
1615
|
var n = e.computed, r = e.key;
|
|
1652
1616
|
return !n && (r.type === "Identifier" && r.name === t || r.type === "Literal" && r.value === t);
|
|
1653
1617
|
}
|
|
1654
|
-
|
|
1655
|
-
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !==
|
|
1656
|
-
},
|
|
1657
|
-
if (this.next(), this.eat(
|
|
1658
|
-
if (this.eat(
|
|
1618
|
+
R.parseExportAllDeclaration = function(e, t) {
|
|
1619
|
+
return this.options.ecmaVersion >= 11 && (this.eatContextual("as") ? (e.exported = this.parseModuleExportName(), this.checkExport(t, e.exported, this.lastTokStart)) : e.exported = null), this.expectContextual("from"), this.type !== w.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ExportAllDeclaration");
|
|
1620
|
+
}, R.parseExport = function(e, t) {
|
|
1621
|
+
if (this.next(), this.eat(w.star)) return this.parseExportAllDeclaration(e, t);
|
|
1622
|
+
if (this.eat(w._default)) return this.checkExport(t, "default", this.lastTokStart), e.declaration = this.parseExportDefaultDeclaration(), this.finishNode(e, "ExportDefaultDeclaration");
|
|
1659
1623
|
if (this.shouldParseExportStatement()) e.declaration = this.parseExportDeclaration(e), e.declaration.type === "VariableDeclaration" ? this.checkVariableExport(t, e.declaration.declarations) : this.checkExport(t, e.declaration.id, e.declaration.id.start), e.specifiers = [], e.source = null, this.options.ecmaVersion >= 16 && (e.attributes = []);
|
|
1660
1624
|
else {
|
|
1661
|
-
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !==
|
|
1625
|
+
if (e.declaration = null, e.specifiers = this.parseExportSpecifiers(t), this.eatContextual("from")) this.type !== w.string && this.unexpected(), e.source = this.parseExprAtom(), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause());
|
|
1662
1626
|
else {
|
|
1663
1627
|
for (var n = 0, r = e.specifiers; n < r.length; n += 1) {
|
|
1664
1628
|
var i = r[n];
|
|
@@ -1669,23 +1633,23 @@ B.parseExportAllDeclaration = function(e, t) {
|
|
|
1669
1633
|
this.semicolon();
|
|
1670
1634
|
}
|
|
1671
1635
|
return this.finishNode(e, "ExportNamedDeclaration");
|
|
1672
|
-
},
|
|
1636
|
+
}, R.parseExportDeclaration = function(e) {
|
|
1673
1637
|
return this.parseStatement(null);
|
|
1674
|
-
},
|
|
1638
|
+
}, R.parseExportDefaultDeclaration = function() {
|
|
1675
1639
|
var e;
|
|
1676
|
-
if (this.type ===
|
|
1640
|
+
if (this.type === w._function || (e = this.isAsyncFunction())) {
|
|
1677
1641
|
var t = this.startNode();
|
|
1678
|
-
return this.next(), e && this.next(), this.parseFunction(t,
|
|
1679
|
-
} else if (this.type ===
|
|
1642
|
+
return this.next(), e && this.next(), this.parseFunction(t, Je | Xe, !1, e);
|
|
1643
|
+
} else if (this.type === w._class) {
|
|
1680
1644
|
var n = this.startNode();
|
|
1681
1645
|
return this.parseClass(n, "nullableID");
|
|
1682
1646
|
} else {
|
|
1683
1647
|
var r = this.parseMaybeAssign();
|
|
1684
1648
|
return this.semicolon(), r;
|
|
1685
1649
|
}
|
|
1686
|
-
},
|
|
1687
|
-
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value),
|
|
1688
|
-
},
|
|
1650
|
+
}, R.checkExport = function(e, t, n) {
|
|
1651
|
+
e && (typeof t != "string" && (t = t.type === "Identifier" ? t.name : t.value), O(e, t) && this.raiseRecoverable(n, "Duplicate export '" + t + "'"), e[t] = !0);
|
|
1652
|
+
}, R.checkPatternExport = function(e, t) {
|
|
1689
1653
|
var n = t.type;
|
|
1690
1654
|
if (n === "Identifier") this.checkExport(e, t, t.start);
|
|
1691
1655
|
else if (n === "ObjectPattern") for (var r = 0, i = t.properties; r < i.length; r += 1) {
|
|
@@ -1697,72 +1661,72 @@ B.parseExportAllDeclaration = function(e, t) {
|
|
|
1697
1661
|
c && this.checkPatternExport(e, c);
|
|
1698
1662
|
}
|
|
1699
1663
|
else n === "Property" ? this.checkPatternExport(e, t.value) : n === "AssignmentPattern" ? this.checkPatternExport(e, t.left) : n === "RestElement" && this.checkPatternExport(e, t.argument);
|
|
1700
|
-
},
|
|
1664
|
+
}, R.checkVariableExport = function(e, t) {
|
|
1701
1665
|
if (e) for (var n = 0, r = t; n < r.length; n += 1) {
|
|
1702
1666
|
var i = r[n];
|
|
1703
1667
|
this.checkPatternExport(e, i.id);
|
|
1704
1668
|
}
|
|
1705
|
-
},
|
|
1669
|
+
}, R.shouldParseExportStatement = function() {
|
|
1706
1670
|
return this.type.keyword === "var" || this.type.keyword === "const" || this.type.keyword === "class" || this.type.keyword === "function" || this.isLet() || this.isAsyncFunction();
|
|
1707
|
-
},
|
|
1671
|
+
}, R.parseExportSpecifier = function(e) {
|
|
1708
1672
|
var t = this.startNode();
|
|
1709
1673
|
return t.local = this.parseModuleExportName(), t.exported = this.eatContextual("as") ? this.parseModuleExportName() : t.local, this.checkExport(e, t.exported, t.exported.start), this.finishNode(t, "ExportSpecifier");
|
|
1710
|
-
},
|
|
1674
|
+
}, R.parseExportSpecifiers = function(e) {
|
|
1711
1675
|
var t = [], n = !0;
|
|
1712
|
-
for (this.expect(
|
|
1676
|
+
for (this.expect(w.braceL); !this.eat(w.braceR);) {
|
|
1713
1677
|
if (n) n = !1;
|
|
1714
|
-
else if (this.expect(
|
|
1678
|
+
else if (this.expect(w.comma), this.afterTrailingComma(w.braceR)) break;
|
|
1715
1679
|
t.push(this.parseExportSpecifier(e));
|
|
1716
1680
|
}
|
|
1717
1681
|
return t;
|
|
1718
|
-
},
|
|
1719
|
-
return this.next(), this.type ===
|
|
1720
|
-
},
|
|
1682
|
+
}, R.parseImport = function(e) {
|
|
1683
|
+
return this.next(), this.type === w.string ? (e.specifiers = qe, e.source = this.parseExprAtom()) : (e.specifiers = this.parseImportSpecifiers(), this.expectContextual("from"), e.source = this.type === w.string ? this.parseExprAtom() : this.unexpected()), this.options.ecmaVersion >= 16 && (e.attributes = this.parseWithClause()), this.semicolon(), this.finishNode(e, "ImportDeclaration");
|
|
1684
|
+
}, R.parseImportSpecifier = function() {
|
|
1721
1685
|
var e = this.startNode();
|
|
1722
|
-
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local,
|
|
1723
|
-
},
|
|
1686
|
+
return e.imported = this.parseModuleExportName(), this.eatContextual("as") ? e.local = this.parseIdent() : (this.checkUnreserved(e.imported), e.local = e.imported), this.checkLValSimple(e.local, P), this.finishNode(e, "ImportSpecifier");
|
|
1687
|
+
}, R.parseImportDefaultSpecifier = function() {
|
|
1724
1688
|
var e = this.startNode();
|
|
1725
|
-
return e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
1726
|
-
},
|
|
1689
|
+
return e.local = this.parseIdent(), this.checkLValSimple(e.local, P), this.finishNode(e, "ImportDefaultSpecifier");
|
|
1690
|
+
}, R.parseImportNamespaceSpecifier = function() {
|
|
1727
1691
|
var e = this.startNode();
|
|
1728
|
-
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local,
|
|
1729
|
-
},
|
|
1692
|
+
return this.next(), this.expectContextual("as"), e.local = this.parseIdent(), this.checkLValSimple(e.local, P), this.finishNode(e, "ImportNamespaceSpecifier");
|
|
1693
|
+
}, R.parseImportSpecifiers = function() {
|
|
1730
1694
|
var e = [], t = !0;
|
|
1731
|
-
if (this.type ===
|
|
1732
|
-
if (this.type ===
|
|
1733
|
-
for (this.expect(
|
|
1695
|
+
if (this.type === w.name && (e.push(this.parseImportDefaultSpecifier()), !this.eat(w.comma))) return e;
|
|
1696
|
+
if (this.type === w.star) return e.push(this.parseImportNamespaceSpecifier()), e;
|
|
1697
|
+
for (this.expect(w.braceL); !this.eat(w.braceR);) {
|
|
1734
1698
|
if (t) t = !1;
|
|
1735
|
-
else if (this.expect(
|
|
1699
|
+
else if (this.expect(w.comma), this.afterTrailingComma(w.braceR)) break;
|
|
1736
1700
|
e.push(this.parseImportSpecifier());
|
|
1737
1701
|
}
|
|
1738
1702
|
return e;
|
|
1739
|
-
},
|
|
1703
|
+
}, R.parseWithClause = function() {
|
|
1740
1704
|
var e = [];
|
|
1741
|
-
if (!this.eat(
|
|
1742
|
-
this.expect(
|
|
1743
|
-
for (var t = {}, n = !0; !this.eat(
|
|
1705
|
+
if (!this.eat(w._with)) return e;
|
|
1706
|
+
this.expect(w.braceL);
|
|
1707
|
+
for (var t = {}, n = !0; !this.eat(w.braceR);) {
|
|
1744
1708
|
if (n) n = !1;
|
|
1745
|
-
else if (this.expect(
|
|
1709
|
+
else if (this.expect(w.comma), this.afterTrailingComma(w.braceR)) break;
|
|
1746
1710
|
var r = this.parseImportAttribute(), i = r.key.type === "Identifier" ? r.key.name : r.key.value;
|
|
1747
|
-
|
|
1711
|
+
O(t, i) && this.raiseRecoverable(r.key.start, "Duplicate attribute key '" + i + "'"), t[i] = !0, e.push(r);
|
|
1748
1712
|
}
|
|
1749
1713
|
return e;
|
|
1750
|
-
},
|
|
1714
|
+
}, R.parseImportAttribute = function() {
|
|
1751
1715
|
var e = this.startNode();
|
|
1752
|
-
return e.key = this.type ===
|
|
1753
|
-
},
|
|
1754
|
-
if (this.options.ecmaVersion >= 13 && this.type ===
|
|
1716
|
+
return e.key = this.type === w.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never"), this.expect(w.colon), this.type !== w.string && this.unexpected(), e.value = this.parseExprAtom(), this.finishNode(e, "ImportAttribute");
|
|
1717
|
+
}, R.parseModuleExportName = function() {
|
|
1718
|
+
if (this.options.ecmaVersion >= 13 && this.type === w.string) {
|
|
1755
1719
|
var e = this.parseLiteral(this.value);
|
|
1756
|
-
return
|
|
1720
|
+
return be.test(e.value) && this.raise(e.start, "An export name cannot include a lone surrogate."), e;
|
|
1757
1721
|
}
|
|
1758
1722
|
return this.parseIdent(!0);
|
|
1759
|
-
},
|
|
1723
|
+
}, R.adaptDirectivePrologue = function(e) {
|
|
1760
1724
|
for (var t = 0; t < e.length && this.isDirectiveCandidate(e[t]); ++t) e[t].directive = e[t].expression.raw.slice(1, -1);
|
|
1761
|
-
},
|
|
1725
|
+
}, R.isDirectiveCandidate = function(e) {
|
|
1762
1726
|
return this.options.ecmaVersion >= 5 && e.type === "ExpressionStatement" && e.expression.type === "Literal" && typeof e.expression.value == "string" && (this.input[e.start] === "\"" || this.input[e.start] === "'");
|
|
1763
1727
|
};
|
|
1764
|
-
var
|
|
1765
|
-
|
|
1728
|
+
var z = F.prototype;
|
|
1729
|
+
z.toAssignable = function(e, t, n) {
|
|
1766
1730
|
if (this.options.ecmaVersion >= 6 && e) switch (e.type) {
|
|
1767
1731
|
case "Identifier":
|
|
1768
1732
|
this.inAsync && e.name === "await" && this.raise(e.start, "Cannot use 'await' as identifier inside an async function");
|
|
@@ -1801,7 +1765,7 @@ V.toAssignable = function(e, t, n) {
|
|
|
1801
1765
|
}
|
|
1802
1766
|
else n && this.checkPatternErrors(n, !0);
|
|
1803
1767
|
return e;
|
|
1804
|
-
},
|
|
1768
|
+
}, z.toAssignableList = function(e, t) {
|
|
1805
1769
|
for (var n = e.length, r = 0; r < n; r++) {
|
|
1806
1770
|
var i = e[r];
|
|
1807
1771
|
i && this.toAssignable(i, t);
|
|
@@ -1811,44 +1775,44 @@ V.toAssignable = function(e, t, n) {
|
|
|
1811
1775
|
this.options.ecmaVersion === 6 && t && a && a.type === "RestElement" && a.argument.type !== "Identifier" && this.unexpected(a.argument.start);
|
|
1812
1776
|
}
|
|
1813
1777
|
return e;
|
|
1814
|
-
},
|
|
1778
|
+
}, z.parseSpread = function(e) {
|
|
1815
1779
|
var t = this.startNode();
|
|
1816
1780
|
return this.next(), t.argument = this.parseMaybeAssign(!1, e), this.finishNode(t, "SpreadElement");
|
|
1817
|
-
},
|
|
1781
|
+
}, z.parseRestBinding = function() {
|
|
1818
1782
|
var e = this.startNode();
|
|
1819
|
-
return this.next(), this.options.ecmaVersion === 6 && this.type !==
|
|
1820
|
-
},
|
|
1783
|
+
return this.next(), this.options.ecmaVersion === 6 && this.type !== w.name && this.unexpected(), e.argument = this.parseBindingAtom(), this.finishNode(e, "RestElement");
|
|
1784
|
+
}, z.parseBindingAtom = function() {
|
|
1821
1785
|
if (this.options.ecmaVersion >= 6) switch (this.type) {
|
|
1822
|
-
case
|
|
1786
|
+
case w.bracketL:
|
|
1823
1787
|
var e = this.startNode();
|
|
1824
|
-
return this.next(), e.elements = this.parseBindingList(
|
|
1825
|
-
case
|
|
1788
|
+
return this.next(), e.elements = this.parseBindingList(w.bracketR, !0, !0), this.finishNode(e, "ArrayPattern");
|
|
1789
|
+
case w.braceL: return this.parseObj(!0);
|
|
1826
1790
|
}
|
|
1827
1791
|
return this.parseIdent();
|
|
1828
|
-
},
|
|
1829
|
-
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(
|
|
1792
|
+
}, z.parseBindingList = function(e, t, n, r) {
|
|
1793
|
+
for (var i = [], a = !0; !this.eat(e);) if (a ? a = !1 : this.expect(w.comma), t && this.type === w.comma) i.push(null);
|
|
1830
1794
|
else if (n && this.afterTrailingComma(e)) break;
|
|
1831
|
-
else if (this.type ===
|
|
1795
|
+
else if (this.type === w.ellipsis) {
|
|
1832
1796
|
var o = this.parseRestBinding();
|
|
1833
|
-
this.parseBindingListItem(o), i.push(o), this.type ===
|
|
1797
|
+
this.parseBindingListItem(o), i.push(o), this.type === w.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.expect(e);
|
|
1834
1798
|
break;
|
|
1835
1799
|
} else i.push(this.parseAssignableListItem(r));
|
|
1836
1800
|
return i;
|
|
1837
|
-
},
|
|
1801
|
+
}, z.parseAssignableListItem = function(e) {
|
|
1838
1802
|
var t = this.parseMaybeDefault(this.start, this.startLoc);
|
|
1839
1803
|
return this.parseBindingListItem(t), t;
|
|
1840
|
-
},
|
|
1804
|
+
}, z.parseBindingListItem = function(e) {
|
|
1841
1805
|
return e;
|
|
1842
|
-
},
|
|
1843
|
-
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(
|
|
1806
|
+
}, z.parseMaybeDefault = function(e, t, n) {
|
|
1807
|
+
if (n ||= this.parseBindingAtom(), this.options.ecmaVersion < 6 || !this.eat(w.eq)) return n;
|
|
1844
1808
|
var r = this.startNodeAt(e, t);
|
|
1845
1809
|
return r.left = n, r.right = this.parseMaybeAssign(), this.finishNode(r, "AssignmentPattern");
|
|
1846
|
-
},
|
|
1847
|
-
t === void 0 && (t =
|
|
1848
|
-
var r = t !==
|
|
1810
|
+
}, z.checkLValSimple = function(e, t, n) {
|
|
1811
|
+
t === void 0 && (t = Re);
|
|
1812
|
+
var r = t !== Re;
|
|
1849
1813
|
switch (e.type) {
|
|
1850
1814
|
case "Identifier":
|
|
1851
|
-
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t ===
|
|
1815
|
+
this.strict && this.reservedWordsStrictBind.test(e.name) && this.raiseRecoverable(e.start, (r ? "Binding " : "Assigning to ") + e.name + " in strict mode"), r && (t === P && e.name === "let" && this.raiseRecoverable(e.start, "let is disallowed as a lexically bound name"), n && (O(n, e.name) && this.raiseRecoverable(e.start, "Argument name clash"), n[e.name] = !0), t !== He && this.declareName(e.name, t, e.start));
|
|
1852
1816
|
break;
|
|
1853
1817
|
case "ChainExpression":
|
|
1854
1818
|
this.raiseRecoverable(e.start, "Optional chaining cannot appear in left-hand side");
|
|
@@ -1859,8 +1823,8 @@ V.toAssignable = function(e, t, n) {
|
|
|
1859
1823
|
case "ParenthesizedExpression": return r && this.raiseRecoverable(e.start, "Binding parenthesized expression"), this.checkLValSimple(e.expression, t, n);
|
|
1860
1824
|
default: this.raise(e.start, (r ? "Binding" : "Assigning to") + " rvalue");
|
|
1861
1825
|
}
|
|
1862
|
-
},
|
|
1863
|
-
switch (t === void 0 && (t =
|
|
1826
|
+
}, z.checkLValPattern = function(e, t, n) {
|
|
1827
|
+
switch (t === void 0 && (t = Re), e.type) {
|
|
1864
1828
|
case "ObjectPattern":
|
|
1865
1829
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
1866
1830
|
var a = i[r];
|
|
@@ -1875,8 +1839,8 @@ V.toAssignable = function(e, t, n) {
|
|
|
1875
1839
|
break;
|
|
1876
1840
|
default: this.checkLValSimple(e, t, n);
|
|
1877
1841
|
}
|
|
1878
|
-
},
|
|
1879
|
-
switch (t === void 0 && (t =
|
|
1842
|
+
}, z.checkLValInnerPattern = function(e, t, n) {
|
|
1843
|
+
switch (t === void 0 && (t = Re), e.type) {
|
|
1880
1844
|
case "Property":
|
|
1881
1845
|
this.checkLValInnerPattern(e.value, t, n);
|
|
1882
1846
|
break;
|
|
@@ -1889,72 +1853,72 @@ V.toAssignable = function(e, t, n) {
|
|
|
1889
1853
|
default: this.checkLValPattern(e, t, n);
|
|
1890
1854
|
}
|
|
1891
1855
|
};
|
|
1892
|
-
var
|
|
1856
|
+
var B = function(e, t, n, r, i) {
|
|
1893
1857
|
this.token = e, this.isExpr = !!t, this.preserveSpace = !!n, this.override = r, this.generator = !!i;
|
|
1894
|
-
},
|
|
1895
|
-
b_stat: new
|
|
1896
|
-
b_expr: new
|
|
1897
|
-
b_tmpl: new
|
|
1898
|
-
p_stat: new
|
|
1899
|
-
p_expr: new
|
|
1900
|
-
q_tmpl: new
|
|
1858
|
+
}, V = {
|
|
1859
|
+
b_stat: new B("{", !1),
|
|
1860
|
+
b_expr: new B("{", !0),
|
|
1861
|
+
b_tmpl: new B("${", !1),
|
|
1862
|
+
p_stat: new B("(", !1),
|
|
1863
|
+
p_expr: new B("(", !0),
|
|
1864
|
+
q_tmpl: new B("`", !0, !0, function(e) {
|
|
1901
1865
|
return e.tryReadTemplateToken();
|
|
1902
1866
|
}),
|
|
1903
|
-
f_stat: new
|
|
1904
|
-
f_expr: new
|
|
1905
|
-
f_expr_gen: new
|
|
1906
|
-
f_gen: new
|
|
1907
|
-
},
|
|
1908
|
-
|
|
1909
|
-
return [
|
|
1910
|
-
},
|
|
1867
|
+
f_stat: new B("function", !1),
|
|
1868
|
+
f_expr: new B("function", !0),
|
|
1869
|
+
f_expr_gen: new B("function", !0, !1, null, !0),
|
|
1870
|
+
f_gen: new B("function", !1, !1, null, !0)
|
|
1871
|
+
}, H = F.prototype;
|
|
1872
|
+
H.initialContext = function() {
|
|
1873
|
+
return [V.b_stat];
|
|
1874
|
+
}, H.curContext = function() {
|
|
1911
1875
|
return this.context[this.context.length - 1];
|
|
1912
|
-
},
|
|
1876
|
+
}, H.braceIsBlock = function(e) {
|
|
1913
1877
|
var t = this.curContext();
|
|
1914
|
-
return t ===
|
|
1915
|
-
},
|
|
1878
|
+
return t === V.f_expr || t === V.f_stat ? !0 : e === w.colon && (t === V.b_stat || t === V.b_expr) ? !t.isExpr : e === w._return || e === w.name && this.exprAllowed ? T.test(this.input.slice(this.lastTokEnd, this.start)) : e === w._else || e === w.semi || e === w.eof || e === w.parenR || e === w.arrow ? !0 : e === w.braceL ? t === V.b_stat : e === w._var || e === w._const || e === w.name ? !1 : !this.exprAllowed;
|
|
1879
|
+
}, H.inGeneratorContext = function() {
|
|
1916
1880
|
for (var e = this.context.length - 1; e >= 1; e--) {
|
|
1917
1881
|
var t = this.context[e];
|
|
1918
1882
|
if (t.token === "function") return t.generator;
|
|
1919
1883
|
}
|
|
1920
1884
|
return !1;
|
|
1921
|
-
},
|
|
1885
|
+
}, H.updateContext = function(e) {
|
|
1922
1886
|
var t, n = this.type;
|
|
1923
|
-
n.keyword && e ===
|
|
1924
|
-
},
|
|
1887
|
+
n.keyword && e === w.dot ? this.exprAllowed = !1 : (t = n.updateContext) ? t.call(this, e) : this.exprAllowed = n.beforeExpr;
|
|
1888
|
+
}, H.overrideContext = function(e) {
|
|
1925
1889
|
this.curContext() !== e && (this.context[this.context.length - 1] = e);
|
|
1926
|
-
},
|
|
1890
|
+
}, w.parenR.updateContext = w.braceR.updateContext = function() {
|
|
1927
1891
|
if (this.context.length === 1) {
|
|
1928
1892
|
this.exprAllowed = !0;
|
|
1929
1893
|
return;
|
|
1930
1894
|
}
|
|
1931
1895
|
var e = this.context.pop();
|
|
1932
|
-
e ===
|
|
1933
|
-
},
|
|
1934
|
-
this.context.push(this.braceIsBlock(e) ?
|
|
1935
|
-
},
|
|
1936
|
-
this.context.push(
|
|
1937
|
-
},
|
|
1938
|
-
var t = e ===
|
|
1939
|
-
this.context.push(t ?
|
|
1940
|
-
},
|
|
1941
|
-
e.beforeExpr && e !==
|
|
1942
|
-
},
|
|
1896
|
+
e === V.b_stat && this.curContext().token === "function" && (e = this.context.pop()), this.exprAllowed = !e.isExpr;
|
|
1897
|
+
}, w.braceL.updateContext = function(e) {
|
|
1898
|
+
this.context.push(this.braceIsBlock(e) ? V.b_stat : V.b_expr), this.exprAllowed = !0;
|
|
1899
|
+
}, w.dollarBraceL.updateContext = function() {
|
|
1900
|
+
this.context.push(V.b_tmpl), this.exprAllowed = !0;
|
|
1901
|
+
}, w.parenL.updateContext = function(e) {
|
|
1902
|
+
var t = e === w._if || e === w._for || e === w._with || e === w._while;
|
|
1903
|
+
this.context.push(t ? V.p_stat : V.p_expr), this.exprAllowed = !0;
|
|
1904
|
+
}, w.incDec.updateContext = function() {}, w._function.updateContext = w._class.updateContext = function(e) {
|
|
1905
|
+
e.beforeExpr && e !== w._else && !(e === w.semi && this.curContext() !== V.p_stat) && !(e === w._return && T.test(this.input.slice(this.lastTokEnd, this.start))) && !((e === w.colon || e === w.braceL) && this.curContext() === V.b_stat) ? this.context.push(V.f_expr) : this.context.push(V.f_stat), this.exprAllowed = !1;
|
|
1906
|
+
}, w.colon.updateContext = function() {
|
|
1943
1907
|
this.curContext().token === "function" && this.context.pop(), this.exprAllowed = !0;
|
|
1944
|
-
},
|
|
1945
|
-
this.curContext() ===
|
|
1946
|
-
},
|
|
1947
|
-
if (e ===
|
|
1908
|
+
}, w.backQuote.updateContext = function() {
|
|
1909
|
+
this.curContext() === V.q_tmpl ? this.context.pop() : this.context.push(V.q_tmpl), this.exprAllowed = !1;
|
|
1910
|
+
}, w.star.updateContext = function(e) {
|
|
1911
|
+
if (e === w._function) {
|
|
1948
1912
|
var t = this.context.length - 1;
|
|
1949
|
-
this.context[t] ===
|
|
1913
|
+
this.context[t] === V.f_expr ? this.context[t] = V.f_expr_gen : this.context[t] = V.f_gen;
|
|
1950
1914
|
}
|
|
1951
1915
|
this.exprAllowed = !0;
|
|
1952
|
-
},
|
|
1916
|
+
}, w.name.updateContext = function(e) {
|
|
1953
1917
|
var t = !1;
|
|
1954
|
-
this.options.ecmaVersion >= 6 && e !==
|
|
1918
|
+
this.options.ecmaVersion >= 6 && e !== w.dot && (this.value === "of" && !this.exprAllowed || this.value === "yield" && this.inGeneratorContext()) && (t = !0), this.exprAllowed = t;
|
|
1955
1919
|
};
|
|
1956
|
-
var
|
|
1957
|
-
|
|
1920
|
+
var U = F.prototype;
|
|
1921
|
+
U.checkPropClash = function(e, t, n) {
|
|
1958
1922
|
if (!(this.options.ecmaVersion >= 9 && e.type === "SpreadElement") && !(this.options.ecmaVersion >= 6 && (e.computed || e.method || e.shorthand))) {
|
|
1959
1923
|
var r = e.key, i;
|
|
1960
1924
|
switch (r.type) {
|
|
@@ -1979,65 +1943,65 @@ G.checkPropClash = function(e, t, n) {
|
|
|
1979
1943
|
set: !1
|
|
1980
1944
|
}, o[a] = !0;
|
|
1981
1945
|
}
|
|
1982
|
-
},
|
|
1946
|
+
}, U.parseExpression = function(e, t) {
|
|
1983
1947
|
var n = this;
|
|
1984
1948
|
return this.catchStackOverflow(function() {
|
|
1985
1949
|
var r = n.start, i = n.startLoc, a = n.parseMaybeAssign(e, t);
|
|
1986
|
-
if (n.type ===
|
|
1950
|
+
if (n.type === w.comma) {
|
|
1987
1951
|
var o = n.startNodeAt(r, i);
|
|
1988
|
-
for (o.expressions = [a]; n.eat(
|
|
1952
|
+
for (o.expressions = [a]; n.eat(w.comma);) o.expressions.push(n.parseMaybeAssign(e, t));
|
|
1989
1953
|
return n.finishNode(o, "SequenceExpression");
|
|
1990
1954
|
}
|
|
1991
1955
|
return a;
|
|
1992
1956
|
});
|
|
1993
|
-
},
|
|
1957
|
+
}, U.parseMaybeAssign = function(e, t, n) {
|
|
1994
1958
|
if (this.isContextual("yield")) {
|
|
1995
1959
|
if (this.inGenerator) return this.parseYield(e);
|
|
1996
1960
|
this.exprAllowed = !1;
|
|
1997
1961
|
}
|
|
1998
1962
|
var r = !1, i = -1, a = -1, o = -1;
|
|
1999
|
-
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new
|
|
1963
|
+
t ? (i = t.parenthesizedAssign, a = t.trailingComma, o = t.doubleProto, t.parenthesizedAssign = t.trailingComma = -1) : (t = new We(), r = !0);
|
|
2000
1964
|
var s = this.start, c = this.startLoc;
|
|
2001
|
-
(this.type ===
|
|
1965
|
+
(this.type === w.parenL || this.type === w.name) && (this.potentialArrowAt = this.start, this.potentialArrowInForAwait = e === "await");
|
|
2002
1966
|
var l = this.parseMaybeConditional(e, t);
|
|
2003
1967
|
if (n && (l = n.call(this, l, s, c)), this.type.isAssign) {
|
|
2004
1968
|
var u = this.startNodeAt(s, c);
|
|
2005
|
-
return u.operator = this.value, this.type ===
|
|
1969
|
+
return u.operator = this.value, this.type === w.eq && (l = this.toAssignable(l, !1, t)), r || (t.parenthesizedAssign = t.trailingComma = t.doubleProto = -1), t.shorthandAssign >= l.start && (t.shorthandAssign = -1), this.type === w.eq ? this.checkLValPattern(l) : this.checkLValSimple(l), u.left = l, this.next(), u.right = this.parseMaybeAssign(e), o > -1 && (t.doubleProto = o), this.finishNode(u, "AssignmentExpression");
|
|
2006
1970
|
} else r && this.checkExpressionErrors(t, !0);
|
|
2007
1971
|
return i > -1 && (t.parenthesizedAssign = i), a > -1 && (t.trailingComma = a), l;
|
|
2008
|
-
},
|
|
1972
|
+
}, U.parseMaybeConditional = function(e, t) {
|
|
2009
1973
|
var n = this.start, r = this.startLoc, i = this.parseExprOps(e, t);
|
|
2010
1974
|
if (this.checkExpressionErrors(t)) return i;
|
|
2011
|
-
if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(
|
|
1975
|
+
if (!(i.type === "ArrowFunctionExpression" && i.start === n) && this.eat(w.question)) {
|
|
2012
1976
|
var a = this.startNodeAt(n, r);
|
|
2013
|
-
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(
|
|
1977
|
+
return a.test = i, a.consequent = this.parseMaybeAssign(), this.expect(w.colon), a.alternate = this.parseMaybeAssign(e), this.finishNode(a, "ConditionalExpression");
|
|
2014
1978
|
}
|
|
2015
1979
|
return i;
|
|
2016
|
-
},
|
|
1980
|
+
}, U.parseExprOps = function(e, t) {
|
|
2017
1981
|
var n = this.start, r = this.startLoc, i = this.parseMaybeUnary(t, !1, !1, e);
|
|
2018
1982
|
return this.checkExpressionErrors(t) || i.start === n && i.type === "ArrowFunctionExpression" ? i : this.parseExprOp(i, n, r, -1, e);
|
|
2019
|
-
},
|
|
1983
|
+
}, U.parseExprOp = function(e, t, n, r, i) {
|
|
2020
1984
|
var a = this.type.binop;
|
|
2021
|
-
if (a != null && (!i || this.type !==
|
|
2022
|
-
var o = this.type ===
|
|
2023
|
-
s && (a =
|
|
1985
|
+
if (a != null && (!i || this.type !== w._in) && a > r) {
|
|
1986
|
+
var o = this.type === w.logicalOR || this.type === w.logicalAND, s = this.type === w.coalesce;
|
|
1987
|
+
s && (a = w.logicalAND.binop);
|
|
2024
1988
|
var c = this.value;
|
|
2025
1989
|
this.next();
|
|
2026
1990
|
var l = this.start, u = this.startLoc, d = this.parseExprOp(this.parseMaybeUnary(null, !1, !1, i), l, u, a, i), f = this.buildBinary(t, n, e, d, c, o || s);
|
|
2027
|
-
return (o && this.type ===
|
|
1991
|
+
return (o && this.type === w.coalesce || s && (this.type === w.logicalOR || this.type === w.logicalAND)) && this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"), this.parseExprOp(f, t, n, r, i);
|
|
2028
1992
|
}
|
|
2029
1993
|
return e;
|
|
2030
|
-
},
|
|
1994
|
+
}, U.buildBinary = function(e, t, n, r, i, a) {
|
|
2031
1995
|
r.type === "PrivateIdentifier" && this.raise(r.start, "Private identifier can only be left side of binary expression");
|
|
2032
1996
|
var o = this.startNodeAt(e, t);
|
|
2033
1997
|
return o.left = n, o.operator = i, o.right = r, this.finishNode(o, a ? "LogicalExpression" : "BinaryExpression");
|
|
2034
|
-
},
|
|
1998
|
+
}, U.parseMaybeUnary = function(e, t, n, r) {
|
|
2035
1999
|
var i = this.start, a = this.startLoc, o;
|
|
2036
2000
|
if (this.isContextual("await") && this.canAwait) o = this.parseAwait(r), t = !0;
|
|
2037
2001
|
else if (this.type.prefix) {
|
|
2038
|
-
var s = this.startNode(), c = this.type ===
|
|
2039
|
-
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" &&
|
|
2040
|
-
} else if (!t && this.type ===
|
|
2002
|
+
var s = this.startNode(), c = this.type === w.incDec;
|
|
2003
|
+
s.operator = this.value, s.prefix = !0, this.next(), s.argument = this.parseMaybeUnary(null, !0, c, r), this.checkExpressionErrors(e, !0), c ? this.checkLValSimple(s.argument) : this.strict && s.operator === "delete" && $e(s.argument) ? this.raiseRecoverable(s.start, "Deleting local variable in strict mode") : s.operator === "delete" && et(s.argument) ? this.raiseRecoverable(s.start, "Private fields can not be deleted") : t = !0, o = this.finishNode(s, c ? "UpdateExpression" : "UnaryExpression");
|
|
2004
|
+
} else if (!t && this.type === w.privateId) (r || this.privateNameStack.length === 0) && this.options.checkPrivateFields && this.unexpected(), o = this.parsePrivateIdent(), this.type !== w._in && this.unexpected();
|
|
2041
2005
|
else {
|
|
2042
2006
|
if (o = this.parseExprSubscripts(e, r), this.checkExpressionErrors(e)) return o;
|
|
2043
2007
|
for (; this.type.postfix && !this.canInsertSemicolon();) {
|
|
@@ -2045,22 +2009,22 @@ G.checkPropClash = function(e, t, n) {
|
|
|
2045
2009
|
l.operator = this.value, l.prefix = !1, l.argument = o, this.checkLValSimple(o), this.next(), o = this.finishNode(l, "UpdateExpression");
|
|
2046
2010
|
}
|
|
2047
2011
|
}
|
|
2048
|
-
if (!n && this.eat(
|
|
2012
|
+
if (!n && this.eat(w.starstar)) if (t) this.unexpected(this.lastTokStart);
|
|
2049
2013
|
else return this.buildBinary(i, a, o, this.parseMaybeUnary(null, !1, !1, r), "**", !1);
|
|
2050
2014
|
else return o;
|
|
2051
2015
|
};
|
|
2052
|
-
function
|
|
2053
|
-
return e.type === "Identifier" || e.type === "ParenthesizedExpression" &&
|
|
2016
|
+
function $e(e) {
|
|
2017
|
+
return e.type === "Identifier" || e.type === "ParenthesizedExpression" && $e(e.expression);
|
|
2054
2018
|
}
|
|
2055
|
-
function
|
|
2056
|
-
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" &&
|
|
2019
|
+
function et(e) {
|
|
2020
|
+
return e.type === "MemberExpression" && e.property.type === "PrivateIdentifier" || e.type === "ChainExpression" && et(e.expression) || e.type === "ParenthesizedExpression" && et(e.expression);
|
|
2057
2021
|
}
|
|
2058
|
-
|
|
2022
|
+
U.parseExprSubscripts = function(e, t) {
|
|
2059
2023
|
var n = this.start, r = this.startLoc, i = this.parseExprAtom(e, t);
|
|
2060
2024
|
if (i.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")") return i;
|
|
2061
2025
|
var a = this.parseSubscripts(i, n, r, !1, t);
|
|
2062
2026
|
return e && a.type === "MemberExpression" && (e.parenthesizedAssign >= a.start && (e.parenthesizedAssign = -1), e.parenthesizedBind >= a.start && (e.parenthesizedBind = -1), e.trailingComma >= a.start && (e.trailingComma = -1)), a;
|
|
2063
|
-
},
|
|
2027
|
+
}, U.parseSubscripts = function(e, t, n, r, i) {
|
|
2064
2028
|
for (var a = this.options.ecmaVersion >= 8 && e.type === "Identifier" && e.name === "async" && this.lastTokEnd === e.end && !this.canInsertSemicolon() && e.end - e.start === 5 && this.potentialArrowAt === e.start, o = !1;;) {
|
|
2065
2029
|
var s = this.parseSubscript(e, t, n, r, a, o, i);
|
|
2066
2030
|
if (s.optional && (o = !0), s === e || s.type === "ArrowFunctionExpression") {
|
|
@@ -2072,170 +2036,170 @@ G.parseExprSubscripts = function(e, t) {
|
|
|
2072
2036
|
}
|
|
2073
2037
|
e = s;
|
|
2074
2038
|
}
|
|
2075
|
-
},
|
|
2076
|
-
return !this.canInsertSemicolon() && this.eat(
|
|
2077
|
-
},
|
|
2039
|
+
}, U.shouldParseAsyncArrow = function() {
|
|
2040
|
+
return !this.canInsertSemicolon() && this.eat(w.arrow);
|
|
2041
|
+
}, U.parseSubscriptAsyncArrow = function(e, t, n, r) {
|
|
2078
2042
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !0, r);
|
|
2079
|
-
},
|
|
2080
|
-
var s = this.options.ecmaVersion >= 11, c = s && this.eat(
|
|
2043
|
+
}, U.parseSubscript = function(e, t, n, r, i, a, o) {
|
|
2044
|
+
var s = this.options.ecmaVersion >= 11, c = s && this.eat(w.questionDot);
|
|
2081
2045
|
r && c && this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions");
|
|
2082
|
-
var l = this.eat(
|
|
2083
|
-
if (l || c && this.type !==
|
|
2046
|
+
var l = this.eat(w.bracketL);
|
|
2047
|
+
if (l || c && this.type !== w.parenL && this.type !== w.backQuote || this.eat(w.dot)) {
|
|
2084
2048
|
var u = this.startNodeAt(t, n);
|
|
2085
|
-
u.object = e, l ? (u.property = this.parseExpression(), this.expect(
|
|
2086
|
-
} else if (!r && this.eat(
|
|
2087
|
-
var d = new
|
|
2049
|
+
u.object = e, l ? (u.property = this.parseExpression(), this.expect(w.bracketR)) : this.type === w.privateId && e.type !== "Super" ? u.property = this.parsePrivateIdent() : u.property = this.parseIdent(this.options.allowReserved !== "never"), u.computed = !!l, s && (u.optional = c), e = this.finishNode(u, "MemberExpression");
|
|
2050
|
+
} else if (!r && this.eat(w.parenL)) {
|
|
2051
|
+
var d = new We(), f = this.yieldPos, p = this.awaitPos, m = this.awaitIdentPos;
|
|
2088
2052
|
this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0;
|
|
2089
|
-
var h = this.parseExprList(
|
|
2053
|
+
var h = this.parseExprList(w.parenR, this.options.ecmaVersion >= 8, !1, d);
|
|
2090
2054
|
if (i && !c && this.shouldParseAsyncArrow()) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.awaitIdentPos > 0 && this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"), this.yieldPos = f, this.awaitPos = p, this.awaitIdentPos = m, this.parseSubscriptAsyncArrow(t, n, h, o);
|
|
2091
2055
|
this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, this.awaitIdentPos = m || this.awaitIdentPos;
|
|
2092
|
-
var
|
|
2093
|
-
|
|
2094
|
-
} else if (this.type ===
|
|
2056
|
+
var ee = this.startNodeAt(t, n);
|
|
2057
|
+
ee.callee = e, ee.arguments = h, s && (ee.optional = c), e = this.finishNode(ee, "CallExpression");
|
|
2058
|
+
} else if (this.type === w.backQuote) {
|
|
2095
2059
|
(c || a) && this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
|
|
2096
|
-
var
|
|
2097
|
-
|
|
2060
|
+
var g = this.startNodeAt(t, n);
|
|
2061
|
+
g.tag = e, g.quasi = this.parseTemplate({ isTagged: !0 }), e = this.finishNode(g, "TaggedTemplateExpression");
|
|
2098
2062
|
}
|
|
2099
2063
|
return e;
|
|
2100
|
-
},
|
|
2101
|
-
this.type ===
|
|
2064
|
+
}, U.parseExprAtom = function(e, t, n) {
|
|
2065
|
+
this.type === w.slash && this.readRegexp();
|
|
2102
2066
|
var r, i = this.potentialArrowAt === this.start;
|
|
2103
2067
|
switch (this.type) {
|
|
2104
|
-
case
|
|
2105
|
-
case
|
|
2106
|
-
case
|
|
2068
|
+
case w._super: return this.allowSuper || this.raise(this.start, "'super' keyword outside a method"), r = this.startNode(), this.next(), this.type === w.parenL && !this.allowDirectSuper && this.raise(r.start, "super() call outside constructor of a subclass"), this.type !== w.dot && this.type !== w.bracketL && this.type !== w.parenL && this.unexpected(), this.finishNode(r, "Super");
|
|
2069
|
+
case w._this: return r = this.startNode(), this.next(), this.finishNode(r, "ThisExpression");
|
|
2070
|
+
case w.name:
|
|
2107
2071
|
var a = this.start, o = this.startLoc, s = this.containsEsc, c = this.parseIdent(!1);
|
|
2108
|
-
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(
|
|
2072
|
+
if (this.options.ecmaVersion >= 8 && !s && c.name === "async" && !this.canInsertSemicolon() && this.eat(w._function)) return this.overrideContext(V.f_expr), this.parseFunction(this.startNodeAt(a, o), 0, !1, !0, t);
|
|
2109
2073
|
if (i && !this.canInsertSemicolon()) {
|
|
2110
|
-
if (this.eat(
|
|
2111
|
-
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type ===
|
|
2074
|
+
if (this.eat(w.arrow)) return this.parseArrowExpression(this.startNodeAt(a, o), [c], !1, t);
|
|
2075
|
+
if (this.options.ecmaVersion >= 8 && c.name === "async" && this.type === w.name && !s && (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) return c = this.parseIdent(!1), (this.canInsertSemicolon() || !this.eat(w.arrow)) && this.unexpected(), this.parseArrowExpression(this.startNodeAt(a, o), [c], !0, t);
|
|
2112
2076
|
}
|
|
2113
2077
|
return c;
|
|
2114
|
-
case
|
|
2078
|
+
case w.regexp:
|
|
2115
2079
|
var l = this.value;
|
|
2116
2080
|
return r = this.parseLiteral(l.value), r.regex = {
|
|
2117
2081
|
pattern: l.pattern,
|
|
2118
2082
|
flags: l.flags
|
|
2119
2083
|
}, r;
|
|
2120
|
-
case
|
|
2121
|
-
case
|
|
2122
|
-
case
|
|
2123
|
-
case
|
|
2124
|
-
case
|
|
2125
|
-
case
|
|
2084
|
+
case w.num:
|
|
2085
|
+
case w.string: return this.parseLiteral(this.value);
|
|
2086
|
+
case w._null:
|
|
2087
|
+
case w._true:
|
|
2088
|
+
case w._false: return r = this.startNode(), r.value = this.type === w._null ? null : this.type === w._true, r.raw = this.type.keyword, this.next(), this.finishNode(r, "Literal");
|
|
2089
|
+
case w.parenL:
|
|
2126
2090
|
var u = this.start, d = this.parseParenAndDistinguishExpression(i, t);
|
|
2127
2091
|
return e && (e.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(d) && (e.parenthesizedAssign = u), e.parenthesizedBind < 0 && (e.parenthesizedBind = u)), d;
|
|
2128
|
-
case
|
|
2129
|
-
case
|
|
2130
|
-
case
|
|
2131
|
-
case
|
|
2132
|
-
case
|
|
2133
|
-
case
|
|
2134
|
-
case
|
|
2092
|
+
case w.bracketL: return r = this.startNode(), this.next(), r.elements = this.parseExprList(w.bracketR, !0, !0, e), this.finishNode(r, "ArrayExpression");
|
|
2093
|
+
case w.braceL: return this.overrideContext(V.b_expr), this.parseObj(!1, e);
|
|
2094
|
+
case w._function: return r = this.startNode(), this.next(), this.parseFunction(r, 0);
|
|
2095
|
+
case w._class: return this.parseClass(this.startNode(), !1);
|
|
2096
|
+
case w._new: return this.parseNew();
|
|
2097
|
+
case w.backQuote: return this.parseTemplate();
|
|
2098
|
+
case w._import: return this.options.ecmaVersion >= 11 ? this.parseExprImport(n) : this.unexpected();
|
|
2135
2099
|
default: return this.parseExprAtomDefault();
|
|
2136
2100
|
}
|
|
2137
|
-
},
|
|
2101
|
+
}, U.parseExprAtomDefault = function() {
|
|
2138
2102
|
this.unexpected();
|
|
2139
|
-
},
|
|
2103
|
+
}, U.parseExprImport = function(e) {
|
|
2140
2104
|
var t = this.startNode();
|
|
2141
|
-
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type ===
|
|
2142
|
-
if (this.type ===
|
|
2105
|
+
if (this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword import"), this.next(), this.type === w.parenL && !e) return this.parseDynamicImport(t);
|
|
2106
|
+
if (this.type === w.dot) {
|
|
2143
2107
|
var n = this.startNodeAt(t.start, t.loc && t.loc.start);
|
|
2144
2108
|
return n.name = "import", t.meta = this.finishNode(n, "Identifier"), this.parseImportMeta(t);
|
|
2145
2109
|
} else this.unexpected();
|
|
2146
|
-
},
|
|
2147
|
-
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(
|
|
2148
|
-
else if (!this.eat(
|
|
2110
|
+
}, U.parseDynamicImport = function(e) {
|
|
2111
|
+
if (this.next(), e.source = this.parseMaybeAssign(), this.options.ecmaVersion >= 16) this.eat(w.parenR) ? e.options = null : (this.expect(w.comma), this.afterTrailingComma(w.parenR) ? e.options = null : (e.options = this.parseMaybeAssign(), this.eat(w.parenR) || (this.expect(w.comma), this.afterTrailingComma(w.parenR) || this.unexpected())));
|
|
2112
|
+
else if (!this.eat(w.parenR)) {
|
|
2149
2113
|
var t = this.start;
|
|
2150
|
-
this.eat(
|
|
2114
|
+
this.eat(w.comma) && this.eat(w.parenR) ? this.raiseRecoverable(t, "Trailing comma is not allowed in import()") : this.unexpected(t);
|
|
2151
2115
|
}
|
|
2152
2116
|
return this.finishNode(e, "ImportExpression");
|
|
2153
|
-
},
|
|
2117
|
+
}, U.parseImportMeta = function(e) {
|
|
2154
2118
|
this.next();
|
|
2155
2119
|
var t = this.containsEsc;
|
|
2156
2120
|
return e.property = this.parseIdent(!0), e.property.name !== "meta" && this.raiseRecoverable(e.property.start, "The only valid meta property for import is 'import.meta'"), t && this.raiseRecoverable(e.start, "'import.meta' must not contain escaped characters"), this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere && this.raiseRecoverable(e.start, "Cannot use 'import.meta' outside a module"), this.finishNode(e, "MetaProperty");
|
|
2157
|
-
},
|
|
2121
|
+
}, U.parseLiteral = function(e) {
|
|
2158
2122
|
var t = this.startNode();
|
|
2159
2123
|
return t.value = e, t.raw = this.input.slice(this.start, this.end), t.raw.charCodeAt(t.raw.length - 1) === 110 && (t.bigint = t.value == null ? t.raw.slice(0, -1).replace(/_/g, "") : t.value.toString()), this.next(), this.finishNode(t, "Literal");
|
|
2160
|
-
},
|
|
2161
|
-
this.expect(
|
|
2124
|
+
}, U.parseParenExpression = function() {
|
|
2125
|
+
this.expect(w.parenL);
|
|
2162
2126
|
var e = this.parseExpression();
|
|
2163
|
-
return this.expect(
|
|
2164
|
-
},
|
|
2127
|
+
return this.expect(w.parenR), e;
|
|
2128
|
+
}, U.shouldParseArrow = function(e) {
|
|
2165
2129
|
return !this.canInsertSemicolon();
|
|
2166
|
-
},
|
|
2130
|
+
}, U.parseParenAndDistinguishExpression = function(e, t) {
|
|
2167
2131
|
var n = this.start, r = this.startLoc, i, a = this.options.ecmaVersion >= 8;
|
|
2168
2132
|
if (this.options.ecmaVersion >= 6) {
|
|
2169
2133
|
this.next();
|
|
2170
|
-
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new
|
|
2171
|
-
for (this.yieldPos = 0, this.awaitPos = 0; this.type !==
|
|
2134
|
+
var o = this.start, s = this.startLoc, c = [], l = !0, u = !1, d = new We(), f = this.yieldPos, p = this.awaitPos, m;
|
|
2135
|
+
for (this.yieldPos = 0, this.awaitPos = 0; this.type !== w.parenR;) if (l ? l = !1 : this.expect(w.comma), a && this.afterTrailingComma(w.parenR, !0)) {
|
|
2172
2136
|
u = !0;
|
|
2173
2137
|
break;
|
|
2174
|
-
} else if (this.type ===
|
|
2175
|
-
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type ===
|
|
2138
|
+
} else if (this.type === w.ellipsis) {
|
|
2139
|
+
m = this.start, c.push(this.parseParenItem(this.parseRestBinding())), this.type === w.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
|
|
2176
2140
|
break;
|
|
2177
2141
|
} else c.push(this.parseMaybeAssign(!1, d, this.parseParenItem));
|
|
2178
|
-
var h = this.lastTokEnd,
|
|
2179
|
-
if (this.expect(
|
|
2180
|
-
(!c.length || u) && this.unexpected(this.lastTokStart), m && this.unexpected(m), this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, c.length > 1 ? (i = this.startNodeAt(o, s), i.expressions = c, this.finishNodeAt(i, "SequenceExpression", h,
|
|
2142
|
+
var h = this.lastTokEnd, ee = this.lastTokEndLoc;
|
|
2143
|
+
if (this.expect(w.parenR), e && this.shouldParseArrow(c) && this.eat(w.arrow)) return this.checkPatternErrors(d, !1), this.checkYieldAwaitInDefaultParams(), this.yieldPos = f, this.awaitPos = p, this.parseParenArrowList(n, r, c, t);
|
|
2144
|
+
(!c.length || u) && this.unexpected(this.lastTokStart), m && this.unexpected(m), this.checkExpressionErrors(d, !0), this.yieldPos = f || this.yieldPos, this.awaitPos = p || this.awaitPos, c.length > 1 ? (i = this.startNodeAt(o, s), i.expressions = c, this.finishNodeAt(i, "SequenceExpression", h, ee)) : i = c[0];
|
|
2181
2145
|
} else i = this.parseParenExpression();
|
|
2182
2146
|
if (this.options.preserveParens) {
|
|
2183
|
-
var
|
|
2184
|
-
return
|
|
2147
|
+
var g = this.startNodeAt(n, r);
|
|
2148
|
+
return g.expression = i, this.finishNode(g, "ParenthesizedExpression");
|
|
2185
2149
|
} else return i;
|
|
2186
|
-
},
|
|
2150
|
+
}, U.parseParenItem = function(e) {
|
|
2187
2151
|
return e;
|
|
2188
|
-
},
|
|
2152
|
+
}, U.parseParenArrowList = function(e, t, n, r) {
|
|
2189
2153
|
return this.parseArrowExpression(this.startNodeAt(e, t), n, !1, r);
|
|
2190
2154
|
};
|
|
2191
|
-
var
|
|
2192
|
-
|
|
2155
|
+
var tt = [];
|
|
2156
|
+
U.parseNew = function() {
|
|
2193
2157
|
this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword new");
|
|
2194
2158
|
var e = this.startNode();
|
|
2195
|
-
if (this.next(), this.options.ecmaVersion >= 6 && this.type ===
|
|
2159
|
+
if (this.next(), this.options.ecmaVersion >= 6 && this.type === w.dot) {
|
|
2196
2160
|
var t = this.startNodeAt(e.start, e.loc && e.loc.start);
|
|
2197
2161
|
t.name = "new", e.meta = this.finishNode(t, "Identifier"), this.next();
|
|
2198
2162
|
var n = this.containsEsc;
|
|
2199
2163
|
return e.property = this.parseIdent(!0), e.property.name !== "target" && this.raiseRecoverable(e.property.start, "The only valid meta property for new is 'new.target'"), n && this.raiseRecoverable(e.start, "'new.target' must not contain escaped characters"), this.allowNewDotTarget || this.raiseRecoverable(e.start, "'new.target' can only be used in functions and class static block"), this.finishNode(e, "MetaProperty");
|
|
2200
2164
|
}
|
|
2201
2165
|
var r = this.start, i = this.startLoc;
|
|
2202
|
-
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(
|
|
2203
|
-
},
|
|
2166
|
+
return e.callee = this.parseSubscripts(this.parseExprAtom(null, !1, !0), r, i, !0, !1), e.callee.type === "Super" && this.raiseRecoverable(r, "Invalid use of 'super'"), this.eat(w.parenL) ? e.arguments = this.parseExprList(w.parenR, this.options.ecmaVersion >= 8, !1) : e.arguments = tt, this.finishNode(e, "NewExpression");
|
|
2167
|
+
}, U.parseTemplateElement = function(e) {
|
|
2204
2168
|
var t = e.isTagged, n = this.startNode();
|
|
2205
|
-
return this.type ===
|
|
2169
|
+
return this.type === w.invalidTemplate ? (t || this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal"), n.value = {
|
|
2206
2170
|
raw: this.value.replace(/\r\n?/g, "\n"),
|
|
2207
2171
|
cooked: null
|
|
2208
2172
|
}) : n.value = {
|
|
2209
2173
|
raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
|
|
2210
2174
|
cooked: this.value
|
|
2211
|
-
}, this.next(), n.tail = this.type ===
|
|
2212
|
-
},
|
|
2175
|
+
}, this.next(), n.tail = this.type === w.backQuote, this.finishNode(n, "TemplateElement");
|
|
2176
|
+
}, U.parseTemplate = function(e) {
|
|
2213
2177
|
e === void 0 && (e = {});
|
|
2214
2178
|
var t = e.isTagged;
|
|
2215
2179
|
t === void 0 && (t = !1);
|
|
2216
2180
|
var n = this.startNode();
|
|
2217
2181
|
this.next(), n.expressions = [];
|
|
2218
2182
|
var r = this.parseTemplateElement({ isTagged: t });
|
|
2219
|
-
for (n.quasis = [r]; !r.tail;) this.type ===
|
|
2183
|
+
for (n.quasis = [r]; !r.tail;) this.type === w.eof && this.raise(this.pos, "Unterminated template literal"), this.expect(w.dollarBraceL), n.expressions.push(this.parseExpression()), this.expect(w.braceR), n.quasis.push(r = this.parseTemplateElement({ isTagged: t }));
|
|
2220
2184
|
return this.next(), this.finishNode(n, "TemplateLiteral");
|
|
2221
|
-
},
|
|
2222
|
-
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type ===
|
|
2223
|
-
},
|
|
2185
|
+
}, U.isAsyncProp = function(e) {
|
|
2186
|
+
return !e.computed && e.key.type === "Identifier" && e.key.name === "async" && (this.type === w.name || this.type === w.num || this.type === w.string || this.type === w.bracketL || this.type.keyword || this.options.ecmaVersion >= 9 && this.type === w.star) && !T.test(this.input.slice(this.lastTokEnd, this.start));
|
|
2187
|
+
}, U.parseObj = function(e, t) {
|
|
2224
2188
|
var n = this.startNode(), r = !0, i = {};
|
|
2225
|
-
for (n.properties = [], this.next(); !this.eat(
|
|
2189
|
+
for (n.properties = [], this.next(); !this.eat(w.braceR);) {
|
|
2226
2190
|
if (r) r = !1;
|
|
2227
|
-
else if (this.expect(
|
|
2191
|
+
else if (this.expect(w.comma), this.options.ecmaVersion >= 5 && this.afterTrailingComma(w.braceR)) break;
|
|
2228
2192
|
var a = this.parseProperty(e, t);
|
|
2229
2193
|
e || this.checkPropClash(a, i, t), n.properties.push(a);
|
|
2230
2194
|
}
|
|
2231
2195
|
return this.finishNode(n, e ? "ObjectPattern" : "ObjectExpression");
|
|
2232
|
-
},
|
|
2196
|
+
}, U.parseProperty = function(e, t) {
|
|
2233
2197
|
var n = this.startNode(), r, i, a, o;
|
|
2234
|
-
if (this.options.ecmaVersion >= 9 && this.eat(
|
|
2235
|
-
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(
|
|
2198
|
+
if (this.options.ecmaVersion >= 9 && this.eat(w.ellipsis)) return e ? (n.argument = this.parseIdent(!1), this.type === w.comma && this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"), this.finishNode(n, "RestElement")) : (n.argument = this.parseMaybeAssign(!1, t), this.type === w.comma && t && t.trailingComma < 0 && (t.trailingComma = this.start), this.finishNode(n, "SpreadElement"));
|
|
2199
|
+
this.options.ecmaVersion >= 6 && (n.method = !1, n.shorthand = !1, (e || t) && (a = this.start, o = this.startLoc), e || (r = this.eat(w.star)));
|
|
2236
2200
|
var s = this.containsEsc;
|
|
2237
|
-
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(
|
|
2238
|
-
},
|
|
2201
|
+
return this.parsePropertyName(n), !e && !s && this.options.ecmaVersion >= 8 && !r && this.isAsyncProp(n) ? (i = !0, r = this.options.ecmaVersion >= 9 && this.eat(w.star), this.parsePropertyName(n)) : i = !1, this.parsePropertyValue(n, e, r, i, a, o, t, s), this.finishNode(n, "Property");
|
|
2202
|
+
}, U.parseGetterSetter = function(e) {
|
|
2239
2203
|
var t = e.key.name;
|
|
2240
2204
|
this.parsePropertyName(e), e.value = this.parseMethod(!1), e.kind = t;
|
|
2241
2205
|
var n = e.kind === "get" ? 0 : 1;
|
|
@@ -2243,202 +2207,202 @@ G.parseNew = function() {
|
|
|
2243
2207
|
var r = e.value.start;
|
|
2244
2208
|
e.kind === "get" ? this.raiseRecoverable(r, "getter should have no params") : this.raiseRecoverable(r, "setter should have exactly one param");
|
|
2245
2209
|
} else e.kind === "set" && e.value.params[0].type === "RestElement" && this.raiseRecoverable(e.value.params[0].start, "Setter cannot use rest params");
|
|
2246
|
-
},
|
|
2247
|
-
(n || r) && this.type ===
|
|
2248
|
-
},
|
|
2210
|
+
}, U.parsePropertyValue = function(e, t, n, r, i, a, o, s) {
|
|
2211
|
+
(n || r) && this.type === w.colon && this.unexpected(), this.eat(w.colon) ? (e.value = t ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(!1, o), e.kind = "init") : this.options.ecmaVersion >= 6 && this.type === w.parenL ? (t && this.unexpected(), e.method = !0, e.value = this.parseMethod(n, r), e.kind = "init") : !t && !s && this.options.ecmaVersion >= 5 && !e.computed && e.key.type === "Identifier" && (e.key.name === "get" || e.key.name === "set") && this.type !== w.comma && this.type !== w.braceR && this.type !== w.eq ? ((n || r) && this.unexpected(), this.parseGetterSetter(e)) : this.options.ecmaVersion >= 6 && !e.computed && e.key.type === "Identifier" ? ((n || r) && this.unexpected(), this.checkUnreserved(e.key), e.key.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = i), t ? e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key)) : this.type === w.eq && o ? (o.shorthandAssign < 0 && (o.shorthandAssign = this.start), e.value = this.parseMaybeDefault(i, a, this.copyNode(e.key))) : e.value = this.copyNode(e.key), e.kind = "init", e.shorthand = !0) : this.unexpected();
|
|
2212
|
+
}, U.parsePropertyName = function(e) {
|
|
2249
2213
|
if (this.options.ecmaVersion >= 6) {
|
|
2250
|
-
if (this.eat(
|
|
2214
|
+
if (this.eat(w.bracketL)) return e.computed = !0, e.key = this.parseMaybeAssign(), this.expect(w.bracketR), e.key;
|
|
2251
2215
|
e.computed = !1;
|
|
2252
2216
|
}
|
|
2253
|
-
return e.key = this.type ===
|
|
2254
|
-
},
|
|
2217
|
+
return e.key = this.type === w.num || this.type === w.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
|
|
2218
|
+
}, U.initFunction = function(e) {
|
|
2255
2219
|
e.id = null, this.options.ecmaVersion >= 6 && (e.generator = e.expression = !1), this.options.ecmaVersion >= 8 && (e.async = !1);
|
|
2256
|
-
},
|
|
2220
|
+
}, U.parseMethod = function(e, t, n) {
|
|
2257
2221
|
var r = this.startNode(), i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2258
|
-
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(
|
|
2259
|
-
},
|
|
2222
|
+
return this.initFunction(r), this.options.ecmaVersion >= 6 && (r.generator = e), this.options.ecmaVersion >= 8 && (r.async = !!t), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, this.enterScope(Le(t, r.generator) | Me | (n ? Ne : 0)), this.expect(w.parenL), r.params = this.parseBindingList(w.parenR, !1, this.options.ecmaVersion >= 8), this.checkYieldAwaitInDefaultParams(), this.parseFunctionBody(r, !1, !0, !1), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(r, "FunctionExpression");
|
|
2223
|
+
}, U.parseArrowExpression = function(e, t, n, r) {
|
|
2260
2224
|
var i = this.yieldPos, a = this.awaitPos, o = this.awaitIdentPos;
|
|
2261
|
-
return this.enterScope(
|
|
2262
|
-
},
|
|
2263
|
-
var i = t && this.type !==
|
|
2225
|
+
return this.enterScope(Le(n, !1) | Ae), this.initFunction(e), this.options.ecmaVersion >= 8 && (e.async = !!n), this.yieldPos = 0, this.awaitPos = 0, this.awaitIdentPos = 0, e.params = this.toAssignableList(t, !0), this.parseFunctionBody(e, !0, !1, r), this.yieldPos = i, this.awaitPos = a, this.awaitIdentPos = o, this.finishNode(e, "ArrowFunctionExpression");
|
|
2226
|
+
}, U.parseFunctionBody = function(e, t, n, r) {
|
|
2227
|
+
var i = t && this.type !== w.braceL, a = this.strict, o = !1;
|
|
2264
2228
|
if (i) e.body = this.parseMaybeAssign(r), e.expression = !0, this.checkParams(e, !1);
|
|
2265
2229
|
else {
|
|
2266
2230
|
var s = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(e.params);
|
|
2267
2231
|
(!a || s) && (o = this.strictDirective(this.end), o && s && this.raiseRecoverable(e.start, "Illegal 'use strict' directive in function with non-simple parameter list"));
|
|
2268
2232
|
var c = this.labels;
|
|
2269
|
-
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id,
|
|
2233
|
+
this.labels = [], o && (this.strict = !0), this.checkParams(e, !a && !o && !t && !n && this.isSimpleParamList(e.params)), this.strict && e.id && this.checkLValSimple(e.id, He), e.body = this.parseBlock(!1, void 0, o && !a), e.expression = !1, this.adaptDirectivePrologue(e.body.body), this.labels = c;
|
|
2270
2234
|
}
|
|
2271
2235
|
this.exitScope();
|
|
2272
|
-
},
|
|
2236
|
+
}, U.isSimpleParamList = function(e) {
|
|
2273
2237
|
for (var t = 0, n = e; t < n.length; t += 1) if (n[t].type !== "Identifier") return !1;
|
|
2274
2238
|
return !0;
|
|
2275
|
-
},
|
|
2239
|
+
}, U.checkParams = function(e, t) {
|
|
2276
2240
|
for (var n = Object.create(null), r = 0, i = e.params; r < i.length; r += 1) {
|
|
2277
2241
|
var a = i[r];
|
|
2278
|
-
this.checkLValInnerPattern(a,
|
|
2242
|
+
this.checkLValInnerPattern(a, ze, t ? null : n);
|
|
2279
2243
|
}
|
|
2280
|
-
},
|
|
2244
|
+
}, U.parseExprList = function(e, t, n, r) {
|
|
2281
2245
|
for (var i = [], a = !0; !this.eat(e);) {
|
|
2282
2246
|
if (a) a = !1;
|
|
2283
|
-
else if (this.expect(
|
|
2247
|
+
else if (this.expect(w.comma), t && this.afterTrailingComma(e)) break;
|
|
2284
2248
|
var o = void 0;
|
|
2285
|
-
n && this.type ===
|
|
2249
|
+
n && this.type === w.comma ? o = null : this.type === w.ellipsis ? (o = this.parseSpread(r), r && this.type === w.comma && r.trailingComma < 0 && (r.trailingComma = this.start)) : o = this.parseMaybeAssign(!1, r), i.push(o);
|
|
2286
2250
|
}
|
|
2287
2251
|
return i;
|
|
2288
|
-
},
|
|
2252
|
+
}, U.checkUnreserved = function(e) {
|
|
2289
2253
|
var t = e.start, n = e.end, r = e.name;
|
|
2290
|
-
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags &
|
|
2291
|
-
},
|
|
2254
|
+
this.inGenerator && r === "yield" && this.raiseRecoverable(t, "Cannot use 'yield' as identifier inside a generator"), this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use 'await' as identifier inside an async function"), !(this.currentThisScope().flags & Ie) && r === "arguments" && this.raiseRecoverable(t, "Cannot use 'arguments' in class field initializer"), this.inClassStaticBlock && (r === "arguments" || r === "await") && this.raise(t, "Cannot use " + r + " in class static initialization block"), this.keywords.test(r) && this.raise(t, "Unexpected keyword '" + r + "'"), !(this.options.ecmaVersion < 6 && this.input.slice(t, n).indexOf("\\") !== -1) && (this.strict ? this.reservedWordsStrict : this.reservedWords).test(r) && (!this.inAsync && r === "await" && this.raiseRecoverable(t, "Cannot use keyword 'await' outside an async function"), this.raiseRecoverable(t, "The keyword '" + r + "' is reserved"));
|
|
2255
|
+
}, U.parseIdent = function(e) {
|
|
2292
2256
|
var t = this.parseIdentNode();
|
|
2293
2257
|
return this.next(!!e), this.finishNode(t, "Identifier"), e || (this.checkUnreserved(t), t.name === "await" && !this.awaitIdentPos && (this.awaitIdentPos = t.start)), t;
|
|
2294
|
-
},
|
|
2258
|
+
}, U.parseIdentNode = function() {
|
|
2295
2259
|
var e = this.startNode();
|
|
2296
|
-
return this.type ===
|
|
2297
|
-
},
|
|
2260
|
+
return this.type === w.name ? e.name = this.value : this.type.keyword ? (e.name = this.type.keyword, (e.name === "class" || e.name === "function") && (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46) && this.context.pop(), this.type = w.name) : this.unexpected(), e;
|
|
2261
|
+
}, U.parsePrivateIdent = function() {
|
|
2298
2262
|
var e = this.startNode();
|
|
2299
|
-
return this.type ===
|
|
2300
|
-
},
|
|
2263
|
+
return this.type === w.privateId ? e.name = this.value : this.unexpected(), this.next(), this.finishNode(e, "PrivateIdentifier"), this.options.checkPrivateFields && (this.privateNameStack.length === 0 ? this.raise(e.start, "Private field '#" + e.name + "' must be declared in an enclosing class") : this.privateNameStack[this.privateNameStack.length - 1].used.push(e)), e;
|
|
2264
|
+
}, U.parseYield = function(e) {
|
|
2301
2265
|
this.yieldPos ||= this.start;
|
|
2302
2266
|
var t = this.startNode();
|
|
2303
|
-
return this.next(), this.type ===
|
|
2304
|
-
},
|
|
2267
|
+
return this.next(), this.type === w.semi || this.canInsertSemicolon() || this.type !== w.star && !this.type.startsExpr ? (t.delegate = !1, t.argument = null) : (t.delegate = this.eat(w.star), t.argument = this.parseMaybeAssign(e)), this.finishNode(t, "YieldExpression");
|
|
2268
|
+
}, U.parseAwait = function(e) {
|
|
2305
2269
|
this.awaitPos ||= this.start;
|
|
2306
2270
|
var t = this.startNode();
|
|
2307
2271
|
return this.next(), t.argument = this.parseMaybeUnary(null, !0, !1, e), this.finishNode(t, "AwaitExpression");
|
|
2308
2272
|
};
|
|
2309
|
-
var
|
|
2310
|
-
|
|
2311
|
-
var n =
|
|
2273
|
+
var nt = F.prototype;
|
|
2274
|
+
nt.raise = function(e, t) {
|
|
2275
|
+
var n = Ce(this.input, e);
|
|
2312
2276
|
t += " (" + n.line + ":" + n.column + ")", this.sourceFile && (t += " in " + this.sourceFile);
|
|
2313
2277
|
var r = SyntaxError(t);
|
|
2314
2278
|
throw r.pos = e, r.loc = n, r.raisedAt = this.pos, r;
|
|
2315
|
-
},
|
|
2316
|
-
if (this.options.locations) return new
|
|
2279
|
+
}, nt.raiseRecoverable = nt.raise, nt.curPosition = function() {
|
|
2280
|
+
if (this.options.locations) return new xe(this.curLine, this.pos - this.lineStart);
|
|
2317
2281
|
};
|
|
2318
|
-
var
|
|
2282
|
+
var W = F.prototype, rt = function(e) {
|
|
2319
2283
|
this.flags = e, this.var = [], this.lexical = [], this.functions = [];
|
|
2320
2284
|
};
|
|
2321
|
-
|
|
2322
|
-
this.scopeStack.push(new
|
|
2323
|
-
},
|
|
2285
|
+
W.enterScope = function(e) {
|
|
2286
|
+
this.scopeStack.push(new rt(e));
|
|
2287
|
+
}, W.exitScope = function() {
|
|
2324
2288
|
this.scopeStack.pop();
|
|
2325
|
-
},
|
|
2326
|
-
return e.flags &
|
|
2327
|
-
},
|
|
2289
|
+
}, W.treatFunctionsAsVarInScope = function(e) {
|
|
2290
|
+
return e.flags & M || !this.inModule && e.flags & j;
|
|
2291
|
+
}, W.declareName = function(e, t, n) {
|
|
2328
2292
|
var r = !1;
|
|
2329
|
-
if (t ===
|
|
2293
|
+
if (t === P) {
|
|
2330
2294
|
var i = this.currentScope();
|
|
2331
|
-
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags &
|
|
2332
|
-
} else if (t ===
|
|
2333
|
-
else if (t ===
|
|
2295
|
+
r = i.lexical.indexOf(e) > -1 || i.functions.indexOf(e) > -1 || i.var.indexOf(e) > -1, i.lexical.push(e), this.inModule && i.flags & j && delete this.undefinedExports[e];
|
|
2296
|
+
} else if (t === Ve) this.currentScope().lexical.push(e);
|
|
2297
|
+
else if (t === Be) {
|
|
2334
2298
|
var a = this.currentScope();
|
|
2335
2299
|
r = this.treatFunctionsAsVar ? a.lexical.indexOf(e) > -1 : a.lexical.indexOf(e) > -1 || a.var.indexOf(e) > -1, a.functions.push(e);
|
|
2336
2300
|
} else for (var o = this.scopeStack.length - 1; o >= 0; --o) {
|
|
2337
2301
|
var s = this.scopeStack[o];
|
|
2338
|
-
if (s.lexical.indexOf(e) > -1 && !(s.flags &
|
|
2302
|
+
if (s.lexical.indexOf(e) > -1 && !(s.flags & je && s.lexical[0] === e) || !this.treatFunctionsAsVarInScope(s) && s.functions.indexOf(e) > -1) {
|
|
2339
2303
|
r = !0;
|
|
2340
2304
|
break;
|
|
2341
2305
|
}
|
|
2342
|
-
if (s.var.push(e), this.inModule && s.flags &
|
|
2306
|
+
if (s.var.push(e), this.inModule && s.flags & j && delete this.undefinedExports[e], s.flags & Ie) break;
|
|
2343
2307
|
}
|
|
2344
2308
|
r && this.raiseRecoverable(n, "Identifier '" + e + "' has already been declared");
|
|
2345
|
-
},
|
|
2309
|
+
}, W.checkLocalExport = function(e) {
|
|
2346
2310
|
this.scopeStack[0].lexical.indexOf(e.name) === -1 && this.scopeStack[0].var.indexOf(e.name) === -1 && (this.undefinedExports[e.name] = e);
|
|
2347
|
-
},
|
|
2311
|
+
}, W.currentScope = function() {
|
|
2348
2312
|
return this.scopeStack[this.scopeStack.length - 1];
|
|
2349
|
-
},
|
|
2313
|
+
}, W.currentVarScope = function() {
|
|
2350
2314
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2351
2315
|
var t = this.scopeStack[e];
|
|
2352
|
-
if (t.flags & (
|
|
2316
|
+
if (t.flags & (Ie | Pe | N)) return t;
|
|
2353
2317
|
}
|
|
2354
|
-
},
|
|
2318
|
+
}, W.currentThisScope = function() {
|
|
2355
2319
|
for (var e = this.scopeStack.length - 1;; e--) {
|
|
2356
2320
|
var t = this.scopeStack[e];
|
|
2357
|
-
if (t.flags & (
|
|
2321
|
+
if (t.flags & (Ie | Pe | N) && !(t.flags & Ae)) return t;
|
|
2358
2322
|
}
|
|
2359
2323
|
};
|
|
2360
|
-
var
|
|
2361
|
-
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new
|
|
2362
|
-
},
|
|
2363
|
-
|
|
2364
|
-
return new
|
|
2365
|
-
},
|
|
2366
|
-
return new
|
|
2324
|
+
var it = function(e, t, n) {
|
|
2325
|
+
this.type = "", this.start = t, this.end = 0, e.options.locations && (this.loc = new Se(e, n)), e.options.directSourceFile && (this.sourceFile = e.options.directSourceFile), e.options.ranges && (this.range = [t, 0]);
|
|
2326
|
+
}, at = F.prototype;
|
|
2327
|
+
at.startNode = function() {
|
|
2328
|
+
return new it(this, this.start, this.startLoc);
|
|
2329
|
+
}, at.startNodeAt = function(e, t) {
|
|
2330
|
+
return new it(this, e, t);
|
|
2367
2331
|
};
|
|
2368
|
-
function
|
|
2332
|
+
function ot(e, t, n, r) {
|
|
2369
2333
|
return e.type = t, e.end = n, this.options.locations && (e.loc.end = r), this.options.ranges && (e.range[1] = n), e;
|
|
2370
2334
|
}
|
|
2371
|
-
|
|
2372
|
-
return
|
|
2373
|
-
},
|
|
2374
|
-
return
|
|
2375
|
-
},
|
|
2376
|
-
var t = new
|
|
2335
|
+
at.finishNode = function(e, t) {
|
|
2336
|
+
return ot.call(this, e, t, this.lastTokEnd, this.lastTokEndLoc);
|
|
2337
|
+
}, at.finishNodeAt = function(e, t, n, r) {
|
|
2338
|
+
return ot.call(this, e, t, n, r);
|
|
2339
|
+
}, at.copyNode = function(e) {
|
|
2340
|
+
var t = new it(this, e.start, this.startLoc);
|
|
2377
2341
|
for (var n in e) t[n] = e[n];
|
|
2378
2342
|
return t;
|
|
2379
2343
|
};
|
|
2380
|
-
var
|
|
2381
|
-
9:
|
|
2382
|
-
10:
|
|
2383
|
-
11:
|
|
2384
|
-
12:
|
|
2385
|
-
13:
|
|
2386
|
-
14:
|
|
2387
|
-
},
|
|
2344
|
+
var st = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz", ct = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS", lt = ct + " Extended_Pictographic", ut = lt, dt = ut + " EBase EComp EMod EPres ExtPict", ft = dt, pt = {
|
|
2345
|
+
9: ct,
|
|
2346
|
+
10: lt,
|
|
2347
|
+
11: ut,
|
|
2348
|
+
12: dt,
|
|
2349
|
+
13: ft,
|
|
2350
|
+
14: ft
|
|
2351
|
+
}, mt = {
|
|
2388
2352
|
9: "",
|
|
2389
2353
|
10: "",
|
|
2390
2354
|
11: "",
|
|
2391
2355
|
12: "",
|
|
2392
2356
|
13: "",
|
|
2393
2357
|
14: "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji"
|
|
2394
|
-
},
|
|
2395
|
-
9:
|
|
2396
|
-
10:
|
|
2397
|
-
11:
|
|
2398
|
-
12:
|
|
2399
|
-
13:
|
|
2400
|
-
14:
|
|
2401
|
-
},
|
|
2402
|
-
function
|
|
2403
|
-
var t =
|
|
2404
|
-
binary:
|
|
2405
|
-
binaryOfStrings:
|
|
2358
|
+
}, ht = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu", gt = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb", _t = gt + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd", vt = _t + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho", yt = vt + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", bt = yt + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith", xt = {
|
|
2359
|
+
9: gt,
|
|
2360
|
+
10: _t,
|
|
2361
|
+
11: vt,
|
|
2362
|
+
12: yt,
|
|
2363
|
+
13: bt,
|
|
2364
|
+
14: bt + " " + st
|
|
2365
|
+
}, St = {};
|
|
2366
|
+
function Ct(e) {
|
|
2367
|
+
var t = St[e] = {
|
|
2368
|
+
binary: k(pt[e] + " " + ht),
|
|
2369
|
+
binaryOfStrings: k(mt[e]),
|
|
2406
2370
|
nonBinary: {
|
|
2407
|
-
General_Category:
|
|
2408
|
-
Script:
|
|
2371
|
+
General_Category: k(ht),
|
|
2372
|
+
Script: k(xt[e])
|
|
2409
2373
|
}
|
|
2410
2374
|
};
|
|
2411
2375
|
t.nonBinary.Script_Extensions = t.nonBinary.Script, t.nonBinary.gc = t.nonBinary.General_Category, t.nonBinary.sc = t.nonBinary.Script, t.nonBinary.scx = t.nonBinary.Script_Extensions;
|
|
2412
2376
|
}
|
|
2413
|
-
for (var
|
|
2377
|
+
for (var wt = 0, Tt = [
|
|
2414
2378
|
9,
|
|
2415
2379
|
10,
|
|
2416
2380
|
11,
|
|
2417
2381
|
12,
|
|
2418
2382
|
13,
|
|
2419
2383
|
14
|
|
2420
|
-
];
|
|
2421
|
-
var
|
|
2422
|
-
|
|
2384
|
+
]; wt < Tt.length; wt += 1) {
|
|
2385
|
+
var Et = Tt[wt];
|
|
2386
|
+
Ct(Et);
|
|
2423
2387
|
}
|
|
2424
|
-
var
|
|
2388
|
+
var G = F.prototype, Dt = function(e, t) {
|
|
2425
2389
|
this.parent = e, this.base = t || this;
|
|
2426
2390
|
};
|
|
2427
|
-
|
|
2391
|
+
Dt.prototype.separatedFrom = function(e) {
|
|
2428
2392
|
for (var t = this; t; t = t.parent) for (var n = e; n; n = n.parent) if (t.base === n.base && t !== n) return !0;
|
|
2429
2393
|
return !1;
|
|
2430
|
-
},
|
|
2431
|
-
return new
|
|
2394
|
+
}, Dt.prototype.sibling = function() {
|
|
2395
|
+
return new Dt(this.parent, this.base);
|
|
2432
2396
|
};
|
|
2433
|
-
var
|
|
2434
|
-
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties =
|
|
2397
|
+
var K = function(e) {
|
|
2398
|
+
this.parser = e, this.validFlags = "gim" + (e.options.ecmaVersion >= 6 ? "uy" : "") + (e.options.ecmaVersion >= 9 ? "s" : "") + (e.options.ecmaVersion >= 13 ? "d" : "") + (e.options.ecmaVersion >= 15 ? "v" : ""), this.unicodeProperties = St[e.options.ecmaVersion >= 14 ? 14 : e.options.ecmaVersion], this.source = "", this.flags = "", this.start = 0, this.switchU = !1, this.switchV = !1, this.switchN = !1, this.pos = 0, this.lastIntValue = 0, this.lastStringValue = "", this.lastAssertionIsQuantifiable = !1, this.numCapturingParens = 0, this.maxBackReference = 0, this.groupNames = Object.create(null), this.backReferenceNames = [], this.branchID = null;
|
|
2435
2399
|
};
|
|
2436
|
-
|
|
2400
|
+
K.prototype.reset = function(e, t, n) {
|
|
2437
2401
|
var r = n.indexOf("v") !== -1, i = n.indexOf("u") !== -1;
|
|
2438
2402
|
this.start = e | 0, this.source = t + "", this.flags = n, r && this.parser.options.ecmaVersion >= 15 ? (this.switchU = !0, this.switchV = !0, this.switchN = !0) : (this.switchU = i && this.parser.options.ecmaVersion >= 6, this.switchV = !1, this.switchN = i && this.parser.options.ecmaVersion >= 9);
|
|
2439
|
-
},
|
|
2403
|
+
}, K.prototype.raise = function(e) {
|
|
2440
2404
|
this.parser.raiseRecoverable(this.start, "Invalid regular expression: /" + this.source + "/: " + e);
|
|
2441
|
-
},
|
|
2405
|
+
}, K.prototype.at = function(e, t) {
|
|
2442
2406
|
t === void 0 && (t = !1);
|
|
2443
2407
|
var n = this.source, r = n.length;
|
|
2444
2408
|
if (e >= r) return -1;
|
|
@@ -2446,21 +2410,21 @@ J.prototype.reset = function(e, t, n) {
|
|
|
2446
2410
|
if (!(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r) return i;
|
|
2447
2411
|
var a = n.charCodeAt(e + 1);
|
|
2448
2412
|
return a >= 56320 && a <= 57343 ? (i << 10) + a - 56613888 : i;
|
|
2449
|
-
},
|
|
2413
|
+
}, K.prototype.nextIndex = function(e, t) {
|
|
2450
2414
|
t === void 0 && (t = !1);
|
|
2451
2415
|
var n = this.source, r = n.length;
|
|
2452
2416
|
if (e >= r) return r;
|
|
2453
2417
|
var i = n.charCodeAt(e), a;
|
|
2454
2418
|
return !(t || this.switchU) || i <= 55295 || i >= 57344 || e + 1 >= r || (a = n.charCodeAt(e + 1)) < 56320 || a > 57343 ? e + 1 : e + 2;
|
|
2455
|
-
},
|
|
2419
|
+
}, K.prototype.current = function(e) {
|
|
2456
2420
|
return e === void 0 && (e = !1), this.at(this.pos, e);
|
|
2457
|
-
},
|
|
2421
|
+
}, K.prototype.lookahead = function(e) {
|
|
2458
2422
|
return e === void 0 && (e = !1), this.at(this.nextIndex(this.pos, e), e);
|
|
2459
|
-
},
|
|
2423
|
+
}, K.prototype.advance = function(e) {
|
|
2460
2424
|
e === void 0 && (e = !1), this.pos = this.nextIndex(this.pos, e);
|
|
2461
|
-
},
|
|
2425
|
+
}, K.prototype.eat = function(e, t) {
|
|
2462
2426
|
return t === void 0 && (t = !1), this.current(t) === e ? (this.advance(t), !0) : !1;
|
|
2463
|
-
},
|
|
2427
|
+
}, K.prototype.eatChars = function(e, t) {
|
|
2464
2428
|
t === void 0 && (t = !1);
|
|
2465
2429
|
for (var n = this.pos, r = 0, i = e; r < i.length; r += 1) {
|
|
2466
2430
|
var a = i[r], o = this.at(n, t);
|
|
@@ -2468,34 +2432,34 @@ J.prototype.reset = function(e, t, n) {
|
|
|
2468
2432
|
n = this.nextIndex(n, t);
|
|
2469
2433
|
}
|
|
2470
2434
|
return this.pos = n, !0;
|
|
2471
|
-
},
|
|
2435
|
+
}, G.validateRegExpFlags = function(e) {
|
|
2472
2436
|
for (var t = e.validFlags, n = e.flags, r = !1, i = !1, a = 0; a < n.length; a++) {
|
|
2473
2437
|
var o = n.charAt(a);
|
|
2474
2438
|
t.indexOf(o) === -1 && this.raise(e.start, "Invalid regular expression flag"), n.indexOf(o, a + 1) > -1 && this.raise(e.start, "Duplicate regular expression flag"), o === "u" && (r = !0), o === "v" && (i = !0);
|
|
2475
2439
|
}
|
|
2476
2440
|
this.options.ecmaVersion >= 15 && r && i && this.raise(e.start, "Invalid regular expression flag");
|
|
2477
2441
|
};
|
|
2478
|
-
function
|
|
2442
|
+
function Ot(e) {
|
|
2479
2443
|
for (var t in e) return !0;
|
|
2480
2444
|
return !1;
|
|
2481
2445
|
}
|
|
2482
|
-
|
|
2483
|
-
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 &&
|
|
2484
|
-
},
|
|
2446
|
+
G.validateRegExpPattern = function(e) {
|
|
2447
|
+
this.regexp_pattern(e), !e.switchN && this.options.ecmaVersion >= 9 && Ot(e.groupNames) && (e.switchN = !0, this.regexp_pattern(e));
|
|
2448
|
+
}, G.regexp_pattern = function(e) {
|
|
2485
2449
|
e.pos = 0, e.lastIntValue = 0, e.lastStringValue = "", e.lastAssertionIsQuantifiable = !1, e.numCapturingParens = 0, e.maxBackReference = 0, e.groupNames = Object.create(null), e.backReferenceNames.length = 0, e.branchID = null, this.regexp_disjunction(e), e.pos !== e.source.length && (e.eat(41) && e.raise("Unmatched ')'"), (e.eat(93) || e.eat(125)) && e.raise("Lone quantifier brackets")), e.maxBackReference > e.numCapturingParens && e.raise("Invalid escape");
|
|
2486
2450
|
for (var t = 0, n = e.backReferenceNames; t < n.length; t += 1) {
|
|
2487
2451
|
var r = n[t];
|
|
2488
2452
|
e.groupNames[r] || e.raise("Invalid named capture referenced");
|
|
2489
2453
|
}
|
|
2490
|
-
},
|
|
2454
|
+
}, G.regexp_disjunction = function(e) {
|
|
2491
2455
|
var t = this.options.ecmaVersion >= 16;
|
|
2492
|
-
for (t && (e.branchID = new
|
|
2456
|
+
for (t && (e.branchID = new Dt(e.branchID, null)), this.regexp_alternative(e); e.eat(124);) t && (e.branchID = e.branchID.sibling()), this.regexp_alternative(e);
|
|
2493
2457
|
t && (e.branchID = e.branchID.parent), this.regexp_eatQuantifier(e, !0) && e.raise("Nothing to repeat"), e.eat(123) && e.raise("Lone quantifier brackets");
|
|
2494
|
-
},
|
|
2458
|
+
}, G.regexp_alternative = function(e) {
|
|
2495
2459
|
for (; e.pos < e.source.length && this.regexp_eatTerm(e););
|
|
2496
|
-
},
|
|
2460
|
+
}, G.regexp_eatTerm = function(e) {
|
|
2497
2461
|
return this.regexp_eatAssertion(e) ? (e.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(e) && e.switchU && e.raise("Invalid quantifier"), !0) : (e.switchU ? this.regexp_eatAtom(e) : this.regexp_eatExtendedAtom(e)) ? (this.regexp_eatQuantifier(e), !0) : !1;
|
|
2498
|
-
},
|
|
2462
|
+
}, G.regexp_eatAssertion = function(e) {
|
|
2499
2463
|
var t = e.pos;
|
|
2500
2464
|
if (e.lastAssertionIsQuantifiable = !1, e.eat(94) || e.eat(36)) return !0;
|
|
2501
2465
|
if (e.eat(92)) {
|
|
@@ -2507,11 +2471,11 @@ q.validateRegExpPattern = function(e) {
|
|
|
2507
2471
|
if (this.options.ecmaVersion >= 9 && (n = e.eat(60)), e.eat(61) || e.eat(33)) return this.regexp_disjunction(e), e.eat(41) || e.raise("Unterminated group"), e.lastAssertionIsQuantifiable = !n, !0;
|
|
2508
2472
|
}
|
|
2509
2473
|
return e.pos = t, !1;
|
|
2510
|
-
},
|
|
2474
|
+
}, G.regexp_eatQuantifier = function(e, t) {
|
|
2511
2475
|
return t === void 0 && (t = !1), this.regexp_eatQuantifierPrefix(e, t) ? (e.eat(63), !0) : !1;
|
|
2512
|
-
},
|
|
2476
|
+
}, G.regexp_eatQuantifierPrefix = function(e, t) {
|
|
2513
2477
|
return e.eat(42) || e.eat(43) || e.eat(63) || this.regexp_eatBracedQuantifier(e, t);
|
|
2514
|
-
},
|
|
2478
|
+
}, G.regexp_eatBracedQuantifier = function(e, t) {
|
|
2515
2479
|
var n = e.pos;
|
|
2516
2480
|
if (e.eat(123)) {
|
|
2517
2481
|
var r = 0, i = -1;
|
|
@@ -2519,16 +2483,16 @@ q.validateRegExpPattern = function(e) {
|
|
|
2519
2483
|
e.switchU && !t && e.raise("Incomplete quantifier"), e.pos = n;
|
|
2520
2484
|
}
|
|
2521
2485
|
return !1;
|
|
2522
|
-
},
|
|
2486
|
+
}, G.regexp_eatAtom = function(e) {
|
|
2523
2487
|
return this.regexp_eatPatternCharacters(e) || e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e);
|
|
2524
|
-
},
|
|
2488
|
+
}, G.regexp_eatReverseSolidusAtomEscape = function(e) {
|
|
2525
2489
|
var t = e.pos;
|
|
2526
2490
|
if (e.eat(92)) {
|
|
2527
2491
|
if (this.regexp_eatAtomEscape(e)) return !0;
|
|
2528
2492
|
e.pos = t;
|
|
2529
2493
|
}
|
|
2530
2494
|
return !1;
|
|
2531
|
-
},
|
|
2495
|
+
}, G.regexp_eatUncapturingGroup = function(e) {
|
|
2532
2496
|
var t = e.pos;
|
|
2533
2497
|
if (e.eat(40)) {
|
|
2534
2498
|
if (e.eat(63)) {
|
|
@@ -2557,37 +2521,37 @@ q.validateRegExpPattern = function(e) {
|
|
|
2557
2521
|
e.pos = t;
|
|
2558
2522
|
}
|
|
2559
2523
|
return !1;
|
|
2560
|
-
},
|
|
2524
|
+
}, G.regexp_eatCapturingGroup = function(e) {
|
|
2561
2525
|
if (e.eat(40)) {
|
|
2562
2526
|
if (this.options.ecmaVersion >= 9 ? this.regexp_groupSpecifier(e) : e.current() === 63 && e.raise("Invalid group"), this.regexp_disjunction(e), e.eat(41)) return e.numCapturingParens += 1, !0;
|
|
2563
2527
|
e.raise("Unterminated group");
|
|
2564
2528
|
}
|
|
2565
2529
|
return !1;
|
|
2566
|
-
},
|
|
2567
|
-
for (var t = "", n = 0; (n = e.current()) !== -1 &&
|
|
2530
|
+
}, G.regexp_eatModifiers = function(e) {
|
|
2531
|
+
for (var t = "", n = 0; (n = e.current()) !== -1 && kt(n);) t += A(n), e.advance();
|
|
2568
2532
|
return t;
|
|
2569
2533
|
};
|
|
2570
|
-
function
|
|
2534
|
+
function kt(e) {
|
|
2571
2535
|
return e === 105 || e === 109 || e === 115;
|
|
2572
2536
|
}
|
|
2573
|
-
|
|
2537
|
+
G.regexp_eatExtendedAtom = function(e) {
|
|
2574
2538
|
return e.eat(46) || this.regexp_eatReverseSolidusAtomEscape(e) || this.regexp_eatCharacterClass(e) || this.regexp_eatUncapturingGroup(e) || this.regexp_eatCapturingGroup(e) || this.regexp_eatInvalidBracedQuantifier(e) || this.regexp_eatExtendedPatternCharacter(e);
|
|
2575
|
-
},
|
|
2539
|
+
}, G.regexp_eatInvalidBracedQuantifier = function(e) {
|
|
2576
2540
|
return this.regexp_eatBracedQuantifier(e, !0) && e.raise("Nothing to repeat"), !1;
|
|
2577
|
-
},
|
|
2541
|
+
}, G.regexp_eatSyntaxCharacter = function(e) {
|
|
2578
2542
|
var t = e.current();
|
|
2579
|
-
return
|
|
2543
|
+
return At(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2580
2544
|
};
|
|
2581
|
-
function
|
|
2545
|
+
function At(e) {
|
|
2582
2546
|
return e === 36 || e >= 40 && e <= 43 || e === 46 || e === 63 || e >= 91 && e <= 94 || e >= 123 && e <= 125;
|
|
2583
2547
|
}
|
|
2584
|
-
|
|
2585
|
-
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !
|
|
2548
|
+
G.regexp_eatPatternCharacters = function(e) {
|
|
2549
|
+
for (var t = e.pos, n = 0; (n = e.current()) !== -1 && !At(n);) e.advance();
|
|
2586
2550
|
return e.pos !== t;
|
|
2587
|
-
},
|
|
2551
|
+
}, G.regexp_eatExtendedPatternCharacter = function(e) {
|
|
2588
2552
|
var t = e.current();
|
|
2589
2553
|
return t !== -1 && t !== 36 && !(t >= 40 && t <= 43) && t !== 46 && t !== 63 && t !== 91 && t !== 94 && t !== 124 ? (e.advance(), !0) : !1;
|
|
2590
|
-
},
|
|
2554
|
+
}, G.regexp_groupSpecifier = function(e) {
|
|
2591
2555
|
if (e.eat(63)) {
|
|
2592
2556
|
this.regexp_eatGroupName(e) || e.raise("Invalid group");
|
|
2593
2557
|
var t = this.options.ecmaVersion >= 16, n = e.groupNames[e.lastStringValue];
|
|
@@ -2595,35 +2559,35 @@ q.regexp_eatPatternCharacters = function(e) {
|
|
|
2595
2559
|
else e.raise("Duplicate capture group name");
|
|
2596
2560
|
t ? (n || (e.groupNames[e.lastStringValue] = [])).push(e.branchID) : e.groupNames[e.lastStringValue] = !0;
|
|
2597
2561
|
}
|
|
2598
|
-
},
|
|
2562
|
+
}, G.regexp_eatGroupName = function(e) {
|
|
2599
2563
|
if (e.lastStringValue = "", e.eat(60)) {
|
|
2600
2564
|
if (this.regexp_eatRegExpIdentifierName(e) && e.eat(62)) return !0;
|
|
2601
2565
|
e.raise("Invalid capture group name");
|
|
2602
2566
|
}
|
|
2603
2567
|
return !1;
|
|
2604
|
-
},
|
|
2568
|
+
}, G.regexp_eatRegExpIdentifierName = function(e) {
|
|
2605
2569
|
if (e.lastStringValue = "", this.regexp_eatRegExpIdentifierStart(e)) {
|
|
2606
|
-
for (e.lastStringValue +=
|
|
2570
|
+
for (e.lastStringValue += A(e.lastIntValue); this.regexp_eatRegExpIdentifierPart(e);) e.lastStringValue += A(e.lastIntValue);
|
|
2607
2571
|
return !0;
|
|
2608
2572
|
}
|
|
2609
2573
|
return !1;
|
|
2610
|
-
},
|
|
2574
|
+
}, G.regexp_eatRegExpIdentifierStart = function(e) {
|
|
2611
2575
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2612
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
2576
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), jt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2613
2577
|
};
|
|
2614
|
-
function
|
|
2615
|
-
return
|
|
2578
|
+
function jt(e) {
|
|
2579
|
+
return _(e, !0) || e === 36 || e === 95;
|
|
2616
2580
|
}
|
|
2617
|
-
|
|
2581
|
+
G.regexp_eatRegExpIdentifierPart = function(e) {
|
|
2618
2582
|
var t = e.pos, n = this.options.ecmaVersion >= 11, r = e.current(n);
|
|
2619
|
-
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue),
|
|
2583
|
+
return e.advance(n), r === 92 && this.regexp_eatRegExpUnicodeEscapeSequence(e, n) && (r = e.lastIntValue), Mt(r) ? (e.lastIntValue = r, !0) : (e.pos = t, !1);
|
|
2620
2584
|
};
|
|
2621
|
-
function
|
|
2622
|
-
return
|
|
2585
|
+
function Mt(e) {
|
|
2586
|
+
return v(e, !0) || e === 36 || e === 95 || e === 8204 || e === 8205;
|
|
2623
2587
|
}
|
|
2624
|
-
|
|
2588
|
+
G.regexp_eatAtomEscape = function(e) {
|
|
2625
2589
|
return this.regexp_eatBackReference(e) || this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e) || e.switchN && this.regexp_eatKGroupName(e) ? !0 : (e.switchU && (e.current() === 99 && e.raise("Invalid unicode escape"), e.raise("Invalid escape")), !1);
|
|
2626
|
-
},
|
|
2590
|
+
}, G.regexp_eatBackReference = function(e) {
|
|
2627
2591
|
var t = e.pos;
|
|
2628
2592
|
if (this.regexp_eatDecimalEscape(e)) {
|
|
2629
2593
|
var n = e.lastIntValue;
|
|
@@ -2632,34 +2596,34 @@ q.regexp_eatAtomEscape = function(e) {
|
|
|
2632
2596
|
e.pos = t;
|
|
2633
2597
|
}
|
|
2634
2598
|
return !1;
|
|
2635
|
-
},
|
|
2599
|
+
}, G.regexp_eatKGroupName = function(e) {
|
|
2636
2600
|
if (e.eat(107)) {
|
|
2637
2601
|
if (this.regexp_eatGroupName(e)) return e.backReferenceNames.push(e.lastStringValue), !0;
|
|
2638
2602
|
e.raise("Invalid named reference");
|
|
2639
2603
|
}
|
|
2640
2604
|
return !1;
|
|
2641
|
-
},
|
|
2605
|
+
}, G.regexp_eatCharacterEscape = function(e) {
|
|
2642
2606
|
return this.regexp_eatControlEscape(e) || this.regexp_eatCControlLetter(e) || this.regexp_eatZero(e) || this.regexp_eatHexEscapeSequence(e) || this.regexp_eatRegExpUnicodeEscapeSequence(e, !1) || !e.switchU && this.regexp_eatLegacyOctalEscapeSequence(e) || this.regexp_eatIdentityEscape(e);
|
|
2643
|
-
},
|
|
2607
|
+
}, G.regexp_eatCControlLetter = function(e) {
|
|
2644
2608
|
var t = e.pos;
|
|
2645
2609
|
if (e.eat(99)) {
|
|
2646
2610
|
if (this.regexp_eatControlLetter(e)) return !0;
|
|
2647
2611
|
e.pos = t;
|
|
2648
2612
|
}
|
|
2649
2613
|
return !1;
|
|
2650
|
-
},
|
|
2651
|
-
return e.current() === 48 && !
|
|
2652
|
-
},
|
|
2614
|
+
}, G.regexp_eatZero = function(e) {
|
|
2615
|
+
return e.current() === 48 && !Ht(e.lookahead()) ? (e.lastIntValue = 0, e.advance(), !0) : !1;
|
|
2616
|
+
}, G.regexp_eatControlEscape = function(e) {
|
|
2653
2617
|
var t = e.current();
|
|
2654
2618
|
return t === 116 ? (e.lastIntValue = 9, e.advance(), !0) : t === 110 ? (e.lastIntValue = 10, e.advance(), !0) : t === 118 ? (e.lastIntValue = 11, e.advance(), !0) : t === 102 ? (e.lastIntValue = 12, e.advance(), !0) : t === 114 ? (e.lastIntValue = 13, e.advance(), !0) : !1;
|
|
2655
|
-
},
|
|
2619
|
+
}, G.regexp_eatControlLetter = function(e) {
|
|
2656
2620
|
var t = e.current();
|
|
2657
|
-
return
|
|
2621
|
+
return Nt(t) ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2658
2622
|
};
|
|
2659
|
-
function
|
|
2623
|
+
function Nt(e) {
|
|
2660
2624
|
return e >= 65 && e <= 90 || e >= 97 && e <= 122;
|
|
2661
2625
|
}
|
|
2662
|
-
|
|
2626
|
+
G.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
2663
2627
|
t === void 0 && (t = !1);
|
|
2664
2628
|
var n = e.pos, r = t || e.switchU;
|
|
2665
2629
|
if (e.eat(117)) {
|
|
@@ -2675,19 +2639,19 @@ q.regexp_eatRegExpUnicodeEscapeSequence = function(e, t) {
|
|
|
2675
2639
|
}
|
|
2676
2640
|
return !0;
|
|
2677
2641
|
}
|
|
2678
|
-
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) &&
|
|
2642
|
+
if (r && e.eat(123) && this.regexp_eatHexDigits(e) && e.eat(125) && Pt(e.lastIntValue)) return !0;
|
|
2679
2643
|
r && e.raise("Invalid unicode escape"), e.pos = n;
|
|
2680
2644
|
}
|
|
2681
2645
|
return !1;
|
|
2682
2646
|
};
|
|
2683
|
-
function
|
|
2647
|
+
function Pt(e) {
|
|
2684
2648
|
return e >= 0 && e <= 1114111;
|
|
2685
2649
|
}
|
|
2686
|
-
|
|
2650
|
+
G.regexp_eatIdentityEscape = function(e) {
|
|
2687
2651
|
if (e.switchU) return this.regexp_eatSyntaxCharacter(e) ? !0 : e.eat(47) ? (e.lastIntValue = 47, !0) : !1;
|
|
2688
2652
|
var t = e.current();
|
|
2689
2653
|
return t !== 99 && (!e.switchN || t !== 107) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2690
|
-
},
|
|
2654
|
+
}, G.regexp_eatDecimalEscape = function(e) {
|
|
2691
2655
|
e.lastIntValue = 0;
|
|
2692
2656
|
var t = e.current();
|
|
2693
2657
|
if (t >= 49 && t <= 57) {
|
|
@@ -2698,69 +2662,69 @@ q.regexp_eatIdentityEscape = function(e) {
|
|
|
2698
2662
|
}
|
|
2699
2663
|
return !1;
|
|
2700
2664
|
};
|
|
2701
|
-
var
|
|
2702
|
-
|
|
2665
|
+
var Ft = 0, q = 1, J = 2;
|
|
2666
|
+
G.regexp_eatCharacterClassEscape = function(e) {
|
|
2703
2667
|
var t = e.current();
|
|
2704
|
-
if (
|
|
2668
|
+
if (It(t)) return e.lastIntValue = -1, e.advance(), q;
|
|
2705
2669
|
var n = !1;
|
|
2706
2670
|
if (e.switchU && this.options.ecmaVersion >= 9 && ((n = t === 80) || t === 112)) {
|
|
2707
2671
|
e.lastIntValue = -1, e.advance();
|
|
2708
2672
|
var r;
|
|
2709
|
-
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r ===
|
|
2673
|
+
if (e.eat(123) && (r = this.regexp_eatUnicodePropertyValueExpression(e)) && e.eat(125)) return n && r === J && e.raise("Invalid property name"), r;
|
|
2710
2674
|
e.raise("Invalid property name");
|
|
2711
2675
|
}
|
|
2712
|
-
return
|
|
2676
|
+
return Ft;
|
|
2713
2677
|
};
|
|
2714
|
-
function
|
|
2678
|
+
function It(e) {
|
|
2715
2679
|
return e === 100 || e === 68 || e === 115 || e === 83 || e === 119 || e === 87;
|
|
2716
2680
|
}
|
|
2717
|
-
|
|
2681
|
+
G.regexp_eatUnicodePropertyValueExpression = function(e) {
|
|
2718
2682
|
var t = e.pos;
|
|
2719
2683
|
if (this.regexp_eatUnicodePropertyName(e) && e.eat(61)) {
|
|
2720
2684
|
var n = e.lastStringValue;
|
|
2721
2685
|
if (this.regexp_eatUnicodePropertyValue(e)) {
|
|
2722
2686
|
var r = e.lastStringValue;
|
|
2723
|
-
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r),
|
|
2687
|
+
return this.regexp_validateUnicodePropertyNameAndValue(e, n, r), q;
|
|
2724
2688
|
}
|
|
2725
2689
|
}
|
|
2726
2690
|
if (e.pos = t, this.regexp_eatLoneUnicodePropertyNameOrValue(e)) {
|
|
2727
2691
|
var i = e.lastStringValue;
|
|
2728
2692
|
return this.regexp_validateUnicodePropertyNameOrValue(e, i);
|
|
2729
2693
|
}
|
|
2730
|
-
return
|
|
2731
|
-
},
|
|
2732
|
-
|
|
2733
|
-
},
|
|
2734
|
-
if (e.unicodeProperties.binary.test(t)) return
|
|
2735
|
-
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return
|
|
2694
|
+
return Ft;
|
|
2695
|
+
}, G.regexp_validateUnicodePropertyNameAndValue = function(e, t, n) {
|
|
2696
|
+
O(e.unicodeProperties.nonBinary, t) || e.raise("Invalid property name"), e.unicodeProperties.nonBinary[t].test(n) || e.raise("Invalid property value");
|
|
2697
|
+
}, G.regexp_validateUnicodePropertyNameOrValue = function(e, t) {
|
|
2698
|
+
if (e.unicodeProperties.binary.test(t)) return q;
|
|
2699
|
+
if (e.switchV && e.unicodeProperties.binaryOfStrings.test(t)) return J;
|
|
2736
2700
|
e.raise("Invalid property name");
|
|
2737
|
-
},
|
|
2701
|
+
}, G.regexp_eatUnicodePropertyName = function(e) {
|
|
2738
2702
|
var t = 0;
|
|
2739
|
-
for (e.lastStringValue = "";
|
|
2703
|
+
for (e.lastStringValue = ""; Lt(t = e.current());) e.lastStringValue += A(t), e.advance();
|
|
2740
2704
|
return e.lastStringValue !== "";
|
|
2741
2705
|
};
|
|
2742
|
-
function
|
|
2743
|
-
return
|
|
2706
|
+
function Lt(e) {
|
|
2707
|
+
return Nt(e) || e === 95;
|
|
2744
2708
|
}
|
|
2745
|
-
|
|
2709
|
+
G.regexp_eatUnicodePropertyValue = function(e) {
|
|
2746
2710
|
var t = 0;
|
|
2747
|
-
for (e.lastStringValue = "";
|
|
2711
|
+
for (e.lastStringValue = ""; Rt(t = e.current());) e.lastStringValue += A(t), e.advance();
|
|
2748
2712
|
return e.lastStringValue !== "";
|
|
2749
2713
|
};
|
|
2750
|
-
function
|
|
2751
|
-
return
|
|
2714
|
+
function Rt(e) {
|
|
2715
|
+
return Lt(e) || Ht(e);
|
|
2752
2716
|
}
|
|
2753
|
-
|
|
2717
|
+
G.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
2754
2718
|
return this.regexp_eatUnicodePropertyValue(e);
|
|
2755
|
-
},
|
|
2719
|
+
}, G.regexp_eatCharacterClass = function(e) {
|
|
2756
2720
|
if (e.eat(91)) {
|
|
2757
2721
|
var t = e.eat(94), n = this.regexp_classContents(e);
|
|
2758
|
-
return e.eat(93) || e.raise("Unterminated character class"), t && n ===
|
|
2722
|
+
return e.eat(93) || e.raise("Unterminated character class"), t && n === J && e.raise("Negated character class may contain strings"), !0;
|
|
2759
2723
|
}
|
|
2760
2724
|
return !1;
|
|
2761
|
-
},
|
|
2762
|
-
return e.current() === 93 ?
|
|
2763
|
-
},
|
|
2725
|
+
}, G.regexp_classContents = function(e) {
|
|
2726
|
+
return e.current() === 93 ? q : e.switchV ? this.regexp_classSetExpression(e) : (this.regexp_nonEmptyClassRanges(e), q);
|
|
2727
|
+
}, G.regexp_nonEmptyClassRanges = function(e) {
|
|
2764
2728
|
for (; this.regexp_eatClassAtom(e);) {
|
|
2765
2729
|
var t = e.lastIntValue;
|
|
2766
2730
|
if (e.eat(45) && this.regexp_eatClassAtom(e)) {
|
|
@@ -2768,19 +2732,19 @@ q.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2768
2732
|
e.switchU && (t === -1 || n === -1) && e.raise("Invalid character class"), t !== -1 && n !== -1 && t > n && e.raise("Range out of order in character class");
|
|
2769
2733
|
}
|
|
2770
2734
|
}
|
|
2771
|
-
},
|
|
2735
|
+
}, G.regexp_eatClassAtom = function(e) {
|
|
2772
2736
|
var t = e.pos;
|
|
2773
2737
|
if (e.eat(92)) {
|
|
2774
2738
|
if (this.regexp_eatClassEscape(e)) return !0;
|
|
2775
2739
|
if (e.switchU) {
|
|
2776
2740
|
var n = e.current();
|
|
2777
|
-
(n === 99 ||
|
|
2741
|
+
(n === 99 || Gt(n)) && e.raise("Invalid class escape"), e.raise("Invalid escape");
|
|
2778
2742
|
}
|
|
2779
2743
|
e.pos = t;
|
|
2780
2744
|
}
|
|
2781
2745
|
var r = e.current();
|
|
2782
2746
|
return r === 93 ? !1 : (e.lastIntValue = r, e.advance(), !0);
|
|
2783
|
-
},
|
|
2747
|
+
}, G.regexp_eatClassEscape = function(e) {
|
|
2784
2748
|
var t = e.pos;
|
|
2785
2749
|
if (e.eat(98)) return e.lastIntValue = 8, !0;
|
|
2786
2750
|
if (e.switchU && e.eat(45)) return e.lastIntValue = 45, !0;
|
|
@@ -2789,13 +2753,13 @@ q.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2789
2753
|
e.pos = t;
|
|
2790
2754
|
}
|
|
2791
2755
|
return this.regexp_eatCharacterClassEscape(e) || this.regexp_eatCharacterEscape(e);
|
|
2792
|
-
},
|
|
2793
|
-
var t =
|
|
2756
|
+
}, G.regexp_classSetExpression = function(e) {
|
|
2757
|
+
var t = q, n;
|
|
2794
2758
|
if (!this.regexp_eatClassSetRange(e)) if (n = this.regexp_eatClassSetOperand(e)) {
|
|
2795
|
-
n ===
|
|
2759
|
+
n === J && (t = J);
|
|
2796
2760
|
for (var r = e.pos; e.eatChars([38, 38]);) {
|
|
2797
2761
|
if (e.current() !== 38 && (n = this.regexp_eatClassSetOperand(e))) {
|
|
2798
|
-
n !==
|
|
2762
|
+
n !== J && (t = q);
|
|
2799
2763
|
continue;
|
|
2800
2764
|
}
|
|
2801
2765
|
e.raise("Invalid character in character class");
|
|
@@ -2806,9 +2770,9 @@ q.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2806
2770
|
} else e.raise("Invalid character in character class");
|
|
2807
2771
|
for (;;) if (!this.regexp_eatClassSetRange(e)) {
|
|
2808
2772
|
if (n = this.regexp_eatClassSetOperand(e), !n) return t;
|
|
2809
|
-
n ===
|
|
2773
|
+
n === J && (t = J);
|
|
2810
2774
|
}
|
|
2811
|
-
},
|
|
2775
|
+
}, G.regexp_eatClassSetRange = function(e) {
|
|
2812
2776
|
var t = e.pos;
|
|
2813
2777
|
if (this.regexp_eatClassSetCharacter(e)) {
|
|
2814
2778
|
var n = e.lastIntValue;
|
|
@@ -2819,13 +2783,13 @@ q.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2819
2783
|
e.pos = t;
|
|
2820
2784
|
}
|
|
2821
2785
|
return !1;
|
|
2822
|
-
},
|
|
2823
|
-
return this.regexp_eatClassSetCharacter(e) ?
|
|
2824
|
-
},
|
|
2786
|
+
}, G.regexp_eatClassSetOperand = function(e) {
|
|
2787
|
+
return this.regexp_eatClassSetCharacter(e) ? q : this.regexp_eatClassStringDisjunction(e) || this.regexp_eatNestedClass(e);
|
|
2788
|
+
}, G.regexp_eatNestedClass = function(e) {
|
|
2825
2789
|
var t = e.pos;
|
|
2826
2790
|
if (e.eat(91)) {
|
|
2827
2791
|
var n = e.eat(94), r = this.regexp_classContents(e);
|
|
2828
|
-
if (e.eat(93)) return n && r ===
|
|
2792
|
+
if (e.eat(93)) return n && r === J && e.raise("Negated character class may contain strings"), r;
|
|
2829
2793
|
e.pos = t;
|
|
2830
2794
|
}
|
|
2831
2795
|
if (e.eat(92)) {
|
|
@@ -2834,7 +2798,7 @@ q.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2834
2798
|
e.pos = t;
|
|
2835
2799
|
}
|
|
2836
2800
|
return null;
|
|
2837
|
-
},
|
|
2801
|
+
}, G.regexp_eatClassStringDisjunction = function(e) {
|
|
2838
2802
|
var t = e.pos;
|
|
2839
2803
|
if (e.eatChars([92, 113])) {
|
|
2840
2804
|
if (e.eat(123)) {
|
|
@@ -2844,61 +2808,61 @@ q.regexp_eatLoneUnicodePropertyNameOrValue = function(e) {
|
|
|
2844
2808
|
e.pos = t;
|
|
2845
2809
|
}
|
|
2846
2810
|
return null;
|
|
2847
|
-
},
|
|
2848
|
-
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) ===
|
|
2811
|
+
}, G.regexp_classStringDisjunctionContents = function(e) {
|
|
2812
|
+
for (var t = this.regexp_classString(e); e.eat(124);) this.regexp_classString(e) === J && (t = J);
|
|
2849
2813
|
return t;
|
|
2850
|
-
},
|
|
2814
|
+
}, G.regexp_classString = function(e) {
|
|
2851
2815
|
for (var t = 0; this.regexp_eatClassSetCharacter(e);) t++;
|
|
2852
|
-
return t === 1 ?
|
|
2853
|
-
},
|
|
2816
|
+
return t === 1 ? q : J;
|
|
2817
|
+
}, G.regexp_eatClassSetCharacter = function(e) {
|
|
2854
2818
|
var t = e.pos;
|
|
2855
2819
|
if (e.eat(92)) return this.regexp_eatCharacterEscape(e) || this.regexp_eatClassSetReservedPunctuator(e) ? !0 : e.eat(98) ? (e.lastIntValue = 8, !0) : (e.pos = t, !1);
|
|
2856
2820
|
var n = e.current();
|
|
2857
|
-
return n < 0 || n === e.lookahead() &&
|
|
2821
|
+
return n < 0 || n === e.lookahead() && zt(n) || Bt(n) ? !1 : (e.advance(), e.lastIntValue = n, !0);
|
|
2858
2822
|
};
|
|
2859
|
-
function
|
|
2823
|
+
function zt(e) {
|
|
2860
2824
|
return e === 33 || e >= 35 && e <= 38 || e >= 42 && e <= 44 || e === 46 || e >= 58 && e <= 64 || e === 94 || e === 96 || e === 126;
|
|
2861
2825
|
}
|
|
2862
|
-
function
|
|
2826
|
+
function Bt(e) {
|
|
2863
2827
|
return e === 40 || e === 41 || e === 45 || e === 47 || e >= 91 && e <= 93 || e >= 123 && e <= 125;
|
|
2864
2828
|
}
|
|
2865
|
-
|
|
2829
|
+
G.regexp_eatClassSetReservedPunctuator = function(e) {
|
|
2866
2830
|
var t = e.current();
|
|
2867
|
-
return
|
|
2831
|
+
return Vt(t) ? (e.lastIntValue = t, e.advance(), !0) : !1;
|
|
2868
2832
|
};
|
|
2869
|
-
function
|
|
2833
|
+
function Vt(e) {
|
|
2870
2834
|
return e === 33 || e === 35 || e === 37 || e === 38 || e === 44 || e === 45 || e >= 58 && e <= 62 || e === 64 || e === 96 || e === 126;
|
|
2871
2835
|
}
|
|
2872
|
-
|
|
2836
|
+
G.regexp_eatClassControlLetter = function(e) {
|
|
2873
2837
|
var t = e.current();
|
|
2874
|
-
return
|
|
2875
|
-
},
|
|
2838
|
+
return Ht(t) || t === 95 ? (e.lastIntValue = t % 32, e.advance(), !0) : !1;
|
|
2839
|
+
}, G.regexp_eatHexEscapeSequence = function(e) {
|
|
2876
2840
|
var t = e.pos;
|
|
2877
2841
|
if (e.eat(120)) {
|
|
2878
2842
|
if (this.regexp_eatFixedHexDigits(e, 2)) return !0;
|
|
2879
2843
|
e.switchU && e.raise("Invalid escape"), e.pos = t;
|
|
2880
2844
|
}
|
|
2881
2845
|
return !1;
|
|
2882
|
-
},
|
|
2846
|
+
}, G.regexp_eatDecimalDigits = function(e) {
|
|
2883
2847
|
var t = e.pos, n = 0;
|
|
2884
|
-
for (e.lastIntValue = 0;
|
|
2848
|
+
for (e.lastIntValue = 0; Ht(n = e.current());) e.lastIntValue = 10 * e.lastIntValue + (n - 48), e.advance();
|
|
2885
2849
|
return e.pos !== t;
|
|
2886
2850
|
};
|
|
2887
|
-
function
|
|
2851
|
+
function Ht(e) {
|
|
2888
2852
|
return e >= 48 && e <= 57;
|
|
2889
2853
|
}
|
|
2890
|
-
|
|
2854
|
+
G.regexp_eatHexDigits = function(e) {
|
|
2891
2855
|
var t = e.pos, n = 0;
|
|
2892
|
-
for (e.lastIntValue = 0;
|
|
2856
|
+
for (e.lastIntValue = 0; Ut(n = e.current());) e.lastIntValue = 16 * e.lastIntValue + Wt(n), e.advance();
|
|
2893
2857
|
return e.pos !== t;
|
|
2894
2858
|
};
|
|
2895
|
-
function
|
|
2859
|
+
function Ut(e) {
|
|
2896
2860
|
return e >= 48 && e <= 57 || e >= 65 && e <= 70 || e >= 97 && e <= 102;
|
|
2897
2861
|
}
|
|
2898
|
-
function
|
|
2862
|
+
function Wt(e) {
|
|
2899
2863
|
return e >= 65 && e <= 70 ? 10 + (e - 65) : e >= 97 && e <= 102 ? 10 + (e - 97) : e - 48;
|
|
2900
2864
|
}
|
|
2901
|
-
|
|
2865
|
+
G.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
2902
2866
|
if (this.regexp_eatOctalDigit(e)) {
|
|
2903
2867
|
var t = e.lastIntValue;
|
|
2904
2868
|
if (this.regexp_eatOctalDigit(e)) {
|
|
@@ -2908,61 +2872,61 @@ q.regexp_eatLegacyOctalEscapeSequence = function(e) {
|
|
|
2908
2872
|
return !0;
|
|
2909
2873
|
}
|
|
2910
2874
|
return !1;
|
|
2911
|
-
},
|
|
2875
|
+
}, G.regexp_eatOctalDigit = function(e) {
|
|
2912
2876
|
var t = e.current();
|
|
2913
|
-
return
|
|
2877
|
+
return Gt(t) ? (e.lastIntValue = t - 48, e.advance(), !0) : (e.lastIntValue = 0, !1);
|
|
2914
2878
|
};
|
|
2915
|
-
function
|
|
2879
|
+
function Gt(e) {
|
|
2916
2880
|
return e >= 48 && e <= 55;
|
|
2917
2881
|
}
|
|
2918
|
-
|
|
2882
|
+
G.regexp_eatFixedHexDigits = function(e, t) {
|
|
2919
2883
|
var n = e.pos;
|
|
2920
2884
|
e.lastIntValue = 0;
|
|
2921
2885
|
for (var r = 0; r < t; ++r) {
|
|
2922
2886
|
var i = e.current();
|
|
2923
|
-
if (!
|
|
2924
|
-
e.lastIntValue = 16 * e.lastIntValue +
|
|
2887
|
+
if (!Ut(i)) return e.pos = n, !1;
|
|
2888
|
+
e.lastIntValue = 16 * e.lastIntValue + Wt(i), e.advance();
|
|
2925
2889
|
}
|
|
2926
2890
|
return !0;
|
|
2927
2891
|
};
|
|
2928
|
-
var
|
|
2929
|
-
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new
|
|
2930
|
-
},
|
|
2931
|
-
|
|
2932
|
-
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new
|
|
2933
|
-
},
|
|
2934
|
-
return this.next(), new
|
|
2935
|
-
}, typeof Symbol < "u" && (
|
|
2892
|
+
var Kt = function(e) {
|
|
2893
|
+
this.type = e.type, this.value = e.value, this.start = e.start, this.end = e.end, e.options.locations && (this.loc = new Se(e, e.startLoc, e.endLoc)), e.options.ranges && (this.range = [e.start, e.end]);
|
|
2894
|
+
}, Y = F.prototype;
|
|
2895
|
+
Y.next = function(e) {
|
|
2896
|
+
!e && this.type.keyword && this.containsEsc && this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword), this.options.onToken && this.options.onToken(new Kt(this)), this.lastTokEnd = this.end, this.lastTokStart = this.start, this.lastTokEndLoc = this.endLoc, this.lastTokStartLoc = this.startLoc, this.nextToken();
|
|
2897
|
+
}, Y.getToken = function() {
|
|
2898
|
+
return this.next(), new Kt(this);
|
|
2899
|
+
}, typeof Symbol < "u" && (Y[Symbol.iterator] = function() {
|
|
2936
2900
|
var e = this;
|
|
2937
2901
|
return { next: function() {
|
|
2938
2902
|
var t = e.getToken();
|
|
2939
2903
|
return {
|
|
2940
|
-
done: t.type ===
|
|
2904
|
+
done: t.type === w.eof,
|
|
2941
2905
|
value: t
|
|
2942
2906
|
};
|
|
2943
2907
|
} };
|
|
2944
|
-
}),
|
|
2908
|
+
}), Y.nextToken = function() {
|
|
2945
2909
|
var e = this.curContext();
|
|
2946
|
-
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(
|
|
2910
|
+
if ((!e || !e.preserveSpace) && this.skipSpace(), this.start = this.pos, this.options.locations && (this.startLoc = this.curPosition()), this.pos >= this.input.length) return this.finishToken(w.eof);
|
|
2947
2911
|
if (e.override) return e.override(this);
|
|
2948
2912
|
this.readToken(this.fullCharCodeAtPos());
|
|
2949
|
-
},
|
|
2950
|
-
return
|
|
2951
|
-
},
|
|
2913
|
+
}, Y.readToken = function(e) {
|
|
2914
|
+
return _(e, this.options.ecmaVersion >= 6) || e === 92 ? this.readWord() : this.getTokenFromCode(e);
|
|
2915
|
+
}, Y.fullCharCodeAt = function(e) {
|
|
2952
2916
|
var t = this.input.charCodeAt(e);
|
|
2953
2917
|
if (t <= 55295 || t >= 56320) return t;
|
|
2954
2918
|
var n = this.input.charCodeAt(e + 1);
|
|
2955
2919
|
return n <= 56319 || n >= 57344 ? t : (t << 10) + n - 56613888;
|
|
2956
|
-
},
|
|
2920
|
+
}, Y.fullCharCodeAtPos = function() {
|
|
2957
2921
|
return this.fullCharCodeAt(this.pos);
|
|
2958
|
-
},
|
|
2922
|
+
}, Y.skipBlockComment = function() {
|
|
2959
2923
|
var e = this.options.onComment && this.curPosition(), t = this.pos, n = this.input.indexOf("*/", this.pos += 2);
|
|
2960
|
-
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r =
|
|
2924
|
+
if (n === -1 && this.raise(this.pos - 2, "Unterminated comment"), this.pos = n + 2, this.options.locations) for (var r = void 0, i = t; (r = pe(this.input, i, this.pos)) > -1;) ++this.curLine, i = this.lineStart = r;
|
|
2961
2925
|
this.options.onComment && this.options.onComment(!0, this.input.slice(t + 2, n), t, this.pos, e, this.curPosition());
|
|
2962
|
-
},
|
|
2963
|
-
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !
|
|
2926
|
+
}, Y.skipLineComment = function(e) {
|
|
2927
|
+
for (var t = this.pos, n = this.options.onComment && this.curPosition(), r = this.input.charCodeAt(this.pos += e); this.pos < this.input.length && !E(r);) r = this.input.charCodeAt(++this.pos);
|
|
2964
2928
|
this.options.onComment && this.options.onComment(!1, this.input.slice(t + e, this.pos), t, this.pos, n, this.curPosition());
|
|
2965
|
-
},
|
|
2929
|
+
}, Y.skipSpace = function() {
|
|
2966
2930
|
loop: for (; this.pos < this.input.length;) {
|
|
2967
2931
|
var e = this.input.charCodeAt(this.pos);
|
|
2968
2932
|
switch (e) {
|
|
@@ -2987,69 +2951,69 @@ Z.next = function(e) {
|
|
|
2987
2951
|
default: break loop;
|
|
2988
2952
|
}
|
|
2989
2953
|
break;
|
|
2990
|
-
default: if (e > 8 && e < 14 || e >= 5760 &&
|
|
2954
|
+
default: if (e > 8 && e < 14 || e >= 5760 && me.test(String.fromCharCode(e))) ++this.pos;
|
|
2991
2955
|
else break loop;
|
|
2992
2956
|
}
|
|
2993
2957
|
}
|
|
2994
|
-
},
|
|
2958
|
+
}, Y.finishToken = function(e, t) {
|
|
2995
2959
|
this.end = this.pos, this.options.locations && (this.endLoc = this.curPosition());
|
|
2996
2960
|
var n = this.type;
|
|
2997
2961
|
this.type = e, this.value = t, this.updateContext(n);
|
|
2998
|
-
},
|
|
2962
|
+
}, Y.readToken_dot = function() {
|
|
2999
2963
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
3000
2964
|
if (e >= 48 && e <= 57) return this.readNumber(!0);
|
|
3001
2965
|
var t = this.input.charCodeAt(this.pos + 2);
|
|
3002
|
-
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(
|
|
3003
|
-
},
|
|
2966
|
+
return this.options.ecmaVersion >= 6 && e === 46 && t === 46 ? (this.pos += 3, this.finishToken(w.ellipsis)) : (++this.pos, this.finishToken(w.dot));
|
|
2967
|
+
}, Y.readToken_slash = function() {
|
|
3004
2968
|
var e = this.input.charCodeAt(this.pos + 1);
|
|
3005
|
-
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(
|
|
3006
|
-
},
|
|
3007
|
-
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ?
|
|
3008
|
-
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r =
|
|
3009
|
-
},
|
|
2969
|
+
return this.exprAllowed ? (++this.pos, this.readRegexp()) : e === 61 ? this.finishOp(w.assign, 2) : this.finishOp(w.slash, 1);
|
|
2970
|
+
}, Y.readToken_mult_modulo_exp = function(e) {
|
|
2971
|
+
var t = this.input.charCodeAt(this.pos + 1), n = 1, r = e === 42 ? w.star : w.modulo;
|
|
2972
|
+
return this.options.ecmaVersion >= 7 && e === 42 && t === 42 && (++n, r = w.starstar, t = this.input.charCodeAt(this.pos + 2)), t === 61 ? this.finishOp(w.assign, n + 1) : this.finishOp(r, n);
|
|
2973
|
+
}, Y.readToken_pipe_amp = function(e) {
|
|
3010
2974
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3011
|
-
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
3012
|
-
},
|
|
3013
|
-
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(
|
|
3014
|
-
},
|
|
2975
|
+
return t === e ? this.options.ecmaVersion >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(w.assign, 3) : this.finishOp(e === 124 ? w.logicalOR : w.logicalAND, 2) : t === 61 ? this.finishOp(w.assign, 2) : this.finishOp(e === 124 ? w.bitwiseOR : w.bitwiseAND, 1);
|
|
2976
|
+
}, Y.readToken_caret = function() {
|
|
2977
|
+
return this.input.charCodeAt(this.pos + 1) === 61 ? this.finishOp(w.assign, 2) : this.finishOp(w.bitwiseXOR, 1);
|
|
2978
|
+
}, Y.readToken_plus_min = function(e) {
|
|
3015
2979
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3016
|
-
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 ||
|
|
3017
|
-
},
|
|
2980
|
+
return t === e ? t === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 && (this.lastTokEnd === 0 || T.test(this.input.slice(this.lastTokEnd, this.pos))) ? (this.skipLineComment(3), this.skipSpace(), this.nextToken()) : this.finishOp(w.incDec, 2) : t === 61 ? this.finishOp(w.assign, 2) : this.finishOp(w.plusMin, 1);
|
|
2981
|
+
}, Y.readToken_lt_gt = function(e) {
|
|
3018
2982
|
var t = this.input.charCodeAt(this.pos + 1), n = 1;
|
|
3019
|
-
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(
|
|
3020
|
-
},
|
|
2983
|
+
return t === e ? (n = e === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2, this.input.charCodeAt(this.pos + n) === 61 ? this.finishOp(w.assign, n + 1) : this.finishOp(w.bitShift, n)) : t === 33 && e === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 && this.input.charCodeAt(this.pos + 3) === 45 ? (this.skipLineComment(4), this.skipSpace(), this.nextToken()) : (t === 61 && (n = 2), this.finishOp(w.relational, n));
|
|
2984
|
+
}, Y.readToken_eq_excl = function(e) {
|
|
3021
2985
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3022
|
-
return t === 61 ? this.finishOp(
|
|
3023
|
-
},
|
|
2986
|
+
return t === 61 ? this.finishOp(w.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) : e === 61 && t === 62 && this.options.ecmaVersion >= 6 ? (this.pos += 2, this.finishToken(w.arrow)) : this.finishOp(e === 61 ? w.eq : w.prefix, 1);
|
|
2987
|
+
}, Y.readToken_question = function() {
|
|
3024
2988
|
var e = this.options.ecmaVersion;
|
|
3025
2989
|
if (e >= 11) {
|
|
3026
2990
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3027
2991
|
if (t === 46) {
|
|
3028
2992
|
var n = this.input.charCodeAt(this.pos + 2);
|
|
3029
|
-
if (n < 48 || n > 57) return this.finishOp(
|
|
2993
|
+
if (n < 48 || n > 57) return this.finishOp(w.questionDot, 2);
|
|
3030
2994
|
}
|
|
3031
|
-
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(
|
|
2995
|
+
if (t === 63) return e >= 12 && this.input.charCodeAt(this.pos + 2) === 61 ? this.finishOp(w.assign, 3) : this.finishOp(w.coalesce, 2);
|
|
3032
2996
|
}
|
|
3033
|
-
return this.finishOp(
|
|
3034
|
-
},
|
|
2997
|
+
return this.finishOp(w.question, 1);
|
|
2998
|
+
}, Y.readToken_numberSign = function() {
|
|
3035
2999
|
var e = this.options.ecmaVersion, t = 35;
|
|
3036
|
-
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(),
|
|
3037
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
3038
|
-
},
|
|
3000
|
+
if (e >= 13 && (++this.pos, t = this.fullCharCodeAtPos(), _(t, !0) || t === 92)) return this.finishToken(w.privateId, this.readWord1());
|
|
3001
|
+
this.raise(this.pos, "Unexpected character '" + A(t) + "'");
|
|
3002
|
+
}, Y.getTokenFromCode = function(e) {
|
|
3039
3003
|
switch (e) {
|
|
3040
3004
|
case 46: return this.readToken_dot();
|
|
3041
|
-
case 40: return ++this.pos, this.finishToken(
|
|
3042
|
-
case 41: return ++this.pos, this.finishToken(
|
|
3043
|
-
case 59: return ++this.pos, this.finishToken(
|
|
3044
|
-
case 44: return ++this.pos, this.finishToken(
|
|
3045
|
-
case 91: return ++this.pos, this.finishToken(
|
|
3046
|
-
case 93: return ++this.pos, this.finishToken(
|
|
3047
|
-
case 123: return ++this.pos, this.finishToken(
|
|
3048
|
-
case 125: return ++this.pos, this.finishToken(
|
|
3049
|
-
case 58: return ++this.pos, this.finishToken(
|
|
3005
|
+
case 40: return ++this.pos, this.finishToken(w.parenL);
|
|
3006
|
+
case 41: return ++this.pos, this.finishToken(w.parenR);
|
|
3007
|
+
case 59: return ++this.pos, this.finishToken(w.semi);
|
|
3008
|
+
case 44: return ++this.pos, this.finishToken(w.comma);
|
|
3009
|
+
case 91: return ++this.pos, this.finishToken(w.bracketL);
|
|
3010
|
+
case 93: return ++this.pos, this.finishToken(w.bracketR);
|
|
3011
|
+
case 123: return ++this.pos, this.finishToken(w.braceL);
|
|
3012
|
+
case 125: return ++this.pos, this.finishToken(w.braceR);
|
|
3013
|
+
case 58: return ++this.pos, this.finishToken(w.colon);
|
|
3050
3014
|
case 96:
|
|
3051
3015
|
if (this.options.ecmaVersion < 6) break;
|
|
3052
|
-
return ++this.pos, this.finishToken(
|
|
3016
|
+
return ++this.pos, this.finishToken(w.backQuote);
|
|
3053
3017
|
case 48:
|
|
3054
3018
|
var t = this.input.charCodeAt(this.pos + 1);
|
|
3055
3019
|
if (t === 120 || t === 88) return this.readRadixNumber(16);
|
|
@@ -3081,18 +3045,18 @@ Z.next = function(e) {
|
|
|
3081
3045
|
case 61:
|
|
3082
3046
|
case 33: return this.readToken_eq_excl(e);
|
|
3083
3047
|
case 63: return this.readToken_question();
|
|
3084
|
-
case 126: return this.finishOp(
|
|
3048
|
+
case 126: return this.finishOp(w.prefix, 1);
|
|
3085
3049
|
case 35: return this.readToken_numberSign();
|
|
3086
3050
|
}
|
|
3087
|
-
this.raise(this.pos, "Unexpected character '" +
|
|
3088
|
-
},
|
|
3051
|
+
this.raise(this.pos, "Unexpected character '" + A(e) + "'");
|
|
3052
|
+
}, Y.finishOp = function(e, t) {
|
|
3089
3053
|
var n = this.input.slice(this.pos, this.pos + t);
|
|
3090
3054
|
return this.pos += t, this.finishToken(e, n);
|
|
3091
|
-
},
|
|
3055
|
+
}, Y.readRegexp = function() {
|
|
3092
3056
|
for (var e, t, n = this.pos;;) {
|
|
3093
3057
|
this.pos >= this.input.length && this.raise(n, "Unterminated regular expression");
|
|
3094
3058
|
var r = this.input.charAt(this.pos);
|
|
3095
|
-
if (
|
|
3059
|
+
if (T.test(r) && this.raise(n, "Unterminated regular expression"), e) e = !1;
|
|
3096
3060
|
else {
|
|
3097
3061
|
if (r === "[") t = !0;
|
|
3098
3062
|
else if (r === "]" && t) t = !1;
|
|
@@ -3105,18 +3069,18 @@ Z.next = function(e) {
|
|
|
3105
3069
|
++this.pos;
|
|
3106
3070
|
var a = this.pos, o = this.readWord1();
|
|
3107
3071
|
this.containsEsc && this.unexpected(a);
|
|
3108
|
-
var s = this.regexpState ||= new
|
|
3072
|
+
var s = this.regexpState ||= new K(this);
|
|
3109
3073
|
s.reset(n, i, o), this.validateRegExpFlags(s), this.validateRegExpPattern(s);
|
|
3110
3074
|
var c = null;
|
|
3111
3075
|
try {
|
|
3112
3076
|
c = new RegExp(i, o);
|
|
3113
3077
|
} catch {}
|
|
3114
|
-
return this.finishToken(
|
|
3078
|
+
return this.finishToken(w.regexp, {
|
|
3115
3079
|
pattern: i,
|
|
3116
3080
|
flags: o,
|
|
3117
3081
|
value: c
|
|
3118
3082
|
});
|
|
3119
|
-
},
|
|
3083
|
+
}, Y.readInt = function(e, t, n) {
|
|
3120
3084
|
for (var r = this.options.ecmaVersion >= 12 && t === void 0, i = n && this.input.charCodeAt(this.pos) === 48, a = this.pos, o = 0, s = 0, c = 0, l = t ?? Infinity; c < l; ++c, ++this.pos) {
|
|
3121
3085
|
var u = this.input.charCodeAt(this.pos), d = void 0;
|
|
3122
3086
|
if (r && u === 95) {
|
|
@@ -3128,31 +3092,31 @@ Z.next = function(e) {
|
|
|
3128
3092
|
}
|
|
3129
3093
|
return r && s === 95 && this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"), this.pos === a || t != null && this.pos - a !== t ? null : o;
|
|
3130
3094
|
};
|
|
3131
|
-
function
|
|
3095
|
+
function qt(e, t) {
|
|
3132
3096
|
return t ? parseInt(e, 8) : parseFloat(e.replace(/_/g, ""));
|
|
3133
3097
|
}
|
|
3134
|
-
function
|
|
3098
|
+
function Jt(e) {
|
|
3135
3099
|
return typeof BigInt == "function" ? BigInt(e.replace(/_/g, "")) : null;
|
|
3136
3100
|
}
|
|
3137
|
-
|
|
3101
|
+
Y.readRadixNumber = function(e) {
|
|
3138
3102
|
var t = this.pos;
|
|
3139
3103
|
this.pos += 2;
|
|
3140
3104
|
var n = this.readInt(e);
|
|
3141
|
-
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n =
|
|
3142
|
-
},
|
|
3105
|
+
return n ?? this.raise(this.start + 2, "Expected number in radix " + e), this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110 ? (n = Jt(this.input.slice(t, this.pos)), ++this.pos) : _(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(w.num, n);
|
|
3106
|
+
}, Y.readNumber = function(e) {
|
|
3143
3107
|
var t = this.pos;
|
|
3144
3108
|
!e && this.readInt(10, void 0, !0) === null && this.raise(t, "Invalid number");
|
|
3145
3109
|
var n = this.pos - t >= 2 && this.input.charCodeAt(t) === 48;
|
|
3146
3110
|
n && this.strict && this.raise(t, "Invalid number");
|
|
3147
3111
|
var r = this.input.charCodeAt(this.pos);
|
|
3148
3112
|
if (!n && !e && this.options.ecmaVersion >= 11 && r === 110) {
|
|
3149
|
-
var i =
|
|
3150
|
-
return ++this.pos,
|
|
3113
|
+
var i = Jt(this.input.slice(t, this.pos));
|
|
3114
|
+
return ++this.pos, _(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number"), this.finishToken(w.num, i);
|
|
3151
3115
|
}
|
|
3152
|
-
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")),
|
|
3153
|
-
var a =
|
|
3154
|
-
return this.finishToken(
|
|
3155
|
-
},
|
|
3116
|
+
n && /[89]/.test(this.input.slice(t, this.pos)) && (n = !1), r === 46 && !n && (++this.pos, this.readInt(10), r = this.input.charCodeAt(this.pos)), (r === 69 || r === 101) && !n && (r = this.input.charCodeAt(++this.pos), (r === 43 || r === 45) && ++this.pos, this.readInt(10) === null && this.raise(t, "Invalid number")), _(this.fullCharCodeAtPos()) && this.raise(this.pos, "Identifier directly after number");
|
|
3117
|
+
var a = qt(this.input.slice(t, this.pos), n);
|
|
3118
|
+
return this.finishToken(w.num, a);
|
|
3119
|
+
}, Y.readCodePoint = function() {
|
|
3156
3120
|
var e = this.input.charCodeAt(this.pos), t;
|
|
3157
3121
|
if (e === 123) {
|
|
3158
3122
|
this.options.ecmaVersion < 6 && this.unexpected();
|
|
@@ -3160,35 +3124,35 @@ Z.readRadixNumber = function(e) {
|
|
|
3160
3124
|
t = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos), ++this.pos, t > 1114111 && this.invalidStringToken(n, "Code point out of bounds");
|
|
3161
3125
|
} else t = this.readHexChar(4);
|
|
3162
3126
|
return t;
|
|
3163
|
-
},
|
|
3127
|
+
}, Y.readString = function(e) {
|
|
3164
3128
|
for (var t = "", n = ++this.pos;;) {
|
|
3165
3129
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated string constant");
|
|
3166
3130
|
var r = this.input.charCodeAt(this.pos);
|
|
3167
3131
|
if (r === e) break;
|
|
3168
|
-
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (
|
|
3132
|
+
r === 92 ? (t += this.input.slice(n, this.pos), t += this.readEscapedChar(!1), n = this.pos) : r === 8232 || r === 8233 ? (this.options.ecmaVersion < 10 && this.raise(this.start, "Unterminated string constant"), ++this.pos, this.options.locations && (this.curLine++, this.lineStart = this.pos)) : (E(r) && this.raise(this.start, "Unterminated string constant"), ++this.pos);
|
|
3169
3133
|
}
|
|
3170
|
-
return t += this.input.slice(n, this.pos++), this.finishToken(
|
|
3134
|
+
return t += this.input.slice(n, this.pos++), this.finishToken(w.string, t);
|
|
3171
3135
|
};
|
|
3172
|
-
var
|
|
3173
|
-
|
|
3136
|
+
var Yt = {};
|
|
3137
|
+
Y.tryReadTemplateToken = function() {
|
|
3174
3138
|
this.inTemplateElement = !0;
|
|
3175
3139
|
try {
|
|
3176
3140
|
this.readTmplToken();
|
|
3177
3141
|
} catch (e) {
|
|
3178
|
-
if (e ===
|
|
3142
|
+
if (e === Yt) this.readInvalidTemplateToken();
|
|
3179
3143
|
else throw e;
|
|
3180
3144
|
}
|
|
3181
3145
|
this.inTemplateElement = !1;
|
|
3182
|
-
},
|
|
3183
|
-
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw
|
|
3146
|
+
}, Y.invalidStringToken = function(e, t) {
|
|
3147
|
+
if (this.inTemplateElement && this.options.ecmaVersion >= 9) throw Yt;
|
|
3184
3148
|
this.raise(e, t);
|
|
3185
|
-
},
|
|
3149
|
+
}, Y.readTmplToken = function() {
|
|
3186
3150
|
for (var e = "", t = this.pos;;) {
|
|
3187
3151
|
this.pos >= this.input.length && this.raise(this.start, "Unterminated template");
|
|
3188
3152
|
var n = this.input.charCodeAt(this.pos);
|
|
3189
|
-
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type ===
|
|
3153
|
+
if (n === 96 || n === 36 && this.input.charCodeAt(this.pos + 1) === 123) return this.pos === this.start && (this.type === w.template || this.type === w.invalidTemplate) ? n === 36 ? (this.pos += 2, this.finishToken(w.dollarBraceL)) : (++this.pos, this.finishToken(w.backQuote)) : (e += this.input.slice(t, this.pos), this.finishToken(w.template, e));
|
|
3190
3154
|
if (n === 92) e += this.input.slice(t, this.pos), e += this.readEscapedChar(!0), t = this.pos;
|
|
3191
|
-
else if (
|
|
3155
|
+
else if (E(n)) {
|
|
3192
3156
|
switch (e += this.input.slice(t, this.pos), ++this.pos, n) {
|
|
3193
3157
|
case 13: this.input.charCodeAt(this.pos) === 10 && ++this.pos;
|
|
3194
3158
|
case 10:
|
|
@@ -3201,13 +3165,13 @@ Z.tryReadTemplateToken = function() {
|
|
|
3201
3165
|
this.options.locations && (++this.curLine, this.lineStart = this.pos), t = this.pos;
|
|
3202
3166
|
} else ++this.pos;
|
|
3203
3167
|
}
|
|
3204
|
-
},
|
|
3168
|
+
}, Y.readInvalidTemplateToken = function() {
|
|
3205
3169
|
for (; this.pos < this.input.length; this.pos++) switch (this.input[this.pos]) {
|
|
3206
3170
|
case "\\":
|
|
3207
3171
|
++this.pos;
|
|
3208
3172
|
break;
|
|
3209
3173
|
case "$": if (this.input[this.pos + 1] !== "{") break;
|
|
3210
|
-
case "`": return this.finishToken(
|
|
3174
|
+
case "`": return this.finishToken(w.invalidTemplate, this.input.slice(this.start, this.pos));
|
|
3211
3175
|
case "\r": this.input[this.pos + 1] === "\n" && ++this.pos;
|
|
3212
3176
|
case "\n":
|
|
3213
3177
|
case "\u2028":
|
|
@@ -3216,13 +3180,13 @@ Z.tryReadTemplateToken = function() {
|
|
|
3216
3180
|
break;
|
|
3217
3181
|
}
|
|
3218
3182
|
this.raise(this.start, "Unterminated template");
|
|
3219
|
-
},
|
|
3183
|
+
}, Y.readEscapedChar = function(e) {
|
|
3220
3184
|
var t = this.input.charCodeAt(++this.pos);
|
|
3221
3185
|
switch (++this.pos, t) {
|
|
3222
3186
|
case 110: return "\n";
|
|
3223
3187
|
case 114: return "\r";
|
|
3224
3188
|
case 120: return String.fromCharCode(this.readHexChar(2));
|
|
3225
|
-
case 117: return
|
|
3189
|
+
case 117: return A(this.readCodePoint());
|
|
3226
3190
|
case 116: return " ";
|
|
3227
3191
|
case 98: return "\b";
|
|
3228
3192
|
case 118: return "\v";
|
|
@@ -3239,142 +3203,144 @@ Z.tryReadTemplateToken = function() {
|
|
|
3239
3203
|
var r = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0], i = parseInt(r, 8);
|
|
3240
3204
|
return i > 255 && (r = r.slice(0, -1), i = parseInt(r, 8)), this.pos += r.length - 1, t = this.input.charCodeAt(this.pos), (r !== "0" || t === 56 || t === 57) && (this.strict || e) && this.invalidStringToken(this.pos - 1 - r.length, e ? "Octal literal in template string" : "Octal literal in strict mode"), String.fromCharCode(i);
|
|
3241
3205
|
}
|
|
3242
|
-
return
|
|
3206
|
+
return E(t) ? (this.options.locations && (this.lineStart = this.pos, ++this.curLine), "") : String.fromCharCode(t);
|
|
3243
3207
|
}
|
|
3244
|
-
},
|
|
3208
|
+
}, Y.readHexChar = function(e) {
|
|
3245
3209
|
var t = this.pos, n = this.readInt(16, e);
|
|
3246
3210
|
return n === null && this.invalidStringToken(t, "Bad character escape sequence"), n;
|
|
3247
|
-
},
|
|
3211
|
+
}, Y.readWord1 = function() {
|
|
3248
3212
|
this.containsEsc = !1;
|
|
3249
3213
|
for (var e = "", t = !0, n = this.pos, r = this.options.ecmaVersion >= 6; this.pos < this.input.length;) {
|
|
3250
3214
|
var i = this.fullCharCodeAtPos();
|
|
3251
|
-
if (
|
|
3215
|
+
if (v(i, r)) this.pos += i <= 65535 ? 1 : 2;
|
|
3252
3216
|
else if (i === 92) {
|
|
3253
3217
|
this.containsEsc = !0, e += this.input.slice(n, this.pos);
|
|
3254
3218
|
var a = this.pos;
|
|
3255
3219
|
this.input.charCodeAt(++this.pos) !== 117 && this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"), ++this.pos;
|
|
3256
3220
|
var o = this.readCodePoint();
|
|
3257
|
-
(t ?
|
|
3221
|
+
(t ? _ : v)(o, r) || this.invalidStringToken(a, "Invalid Unicode escape"), e += A(o), n = this.pos;
|
|
3258
3222
|
} else break;
|
|
3259
3223
|
t = !1;
|
|
3260
3224
|
}
|
|
3261
3225
|
return e + this.input.slice(n, this.pos);
|
|
3262
|
-
},
|
|
3263
|
-
var e = this.readWord1(), t =
|
|
3264
|
-
return this.keywords.test(e) && (t =
|
|
3265
|
-
},
|
|
3266
|
-
Parser:
|
|
3226
|
+
}, Y.readWord = function() {
|
|
3227
|
+
var e = this.readWord1(), t = w.name;
|
|
3228
|
+
return this.keywords.test(e) && (t = de[e]), this.finishToken(t, e);
|
|
3229
|
+
}, F.acorn = {
|
|
3230
|
+
Parser: F,
|
|
3267
3231
|
version: "8.17.0",
|
|
3268
|
-
defaultOptions:
|
|
3269
|
-
Position:
|
|
3270
|
-
SourceLocation:
|
|
3271
|
-
getLineInfo:
|
|
3272
|
-
Node:
|
|
3273
|
-
TokenType:
|
|
3274
|
-
tokTypes:
|
|
3275
|
-
keywordTypes:
|
|
3276
|
-
TokContext:
|
|
3277
|
-
tokContexts:
|
|
3278
|
-
isIdentifierChar:
|
|
3279
|
-
isIdentifierStart:
|
|
3280
|
-
Token:
|
|
3281
|
-
isNewLine:
|
|
3282
|
-
lineBreak:
|
|
3283
|
-
lineBreakG:
|
|
3284
|
-
nonASCIIwhitespace:
|
|
3232
|
+
defaultOptions: we,
|
|
3233
|
+
Position: xe,
|
|
3234
|
+
SourceLocation: Se,
|
|
3235
|
+
getLineInfo: Ce,
|
|
3236
|
+
Node: it,
|
|
3237
|
+
TokenType: y,
|
|
3238
|
+
tokTypes: w,
|
|
3239
|
+
keywordTypes: de,
|
|
3240
|
+
TokContext: B,
|
|
3241
|
+
tokContexts: V,
|
|
3242
|
+
isIdentifierChar: v,
|
|
3243
|
+
isIdentifierStart: _,
|
|
3244
|
+
Token: Kt,
|
|
3245
|
+
isNewLine: E,
|
|
3246
|
+
lineBreak: T,
|
|
3247
|
+
lineBreakG: fe,
|
|
3248
|
+
nonASCIIwhitespace: me
|
|
3285
3249
|
};
|
|
3286
|
-
|
|
3250
|
+
//#endregion
|
|
3251
|
+
//#region ../../node_modules/.pnpm/acorn-walk@8.3.5/node_modules/acorn-walk/dist/walk.mjs
|
|
3252
|
+
function Xt(e, t, n) {
|
|
3287
3253
|
n(e, t);
|
|
3288
3254
|
}
|
|
3289
|
-
function
|
|
3290
|
-
var
|
|
3291
|
-
|
|
3255
|
+
function X(e, t, n) {}
|
|
3256
|
+
var Z = {};
|
|
3257
|
+
Z.Program = Z.BlockStatement = Z.StaticBlock = function(e, t, n) {
|
|
3292
3258
|
for (var r = 0, i = e.body; r < i.length; r += 1) {
|
|
3293
3259
|
var a = i[r];
|
|
3294
3260
|
n(a, t, "Statement");
|
|
3295
3261
|
}
|
|
3296
|
-
},
|
|
3262
|
+
}, Z.Statement = Xt, Z.EmptyStatement = X, Z.ExpressionStatement = Z.ParenthesizedExpression = Z.ChainExpression = function(e, t, n) {
|
|
3297
3263
|
return n(e.expression, t, "Expression");
|
|
3298
|
-
},
|
|
3264
|
+
}, Z.IfStatement = function(e, t, n) {
|
|
3299
3265
|
n(e.test, t, "Expression"), n(e.consequent, t, "Statement"), e.alternate && n(e.alternate, t, "Statement");
|
|
3300
|
-
},
|
|
3266
|
+
}, Z.LabeledStatement = function(e, t, n) {
|
|
3301
3267
|
return n(e.body, t, "Statement");
|
|
3302
|
-
},
|
|
3268
|
+
}, Z.BreakStatement = Z.ContinueStatement = X, Z.WithStatement = function(e, t, n) {
|
|
3303
3269
|
n(e.object, t, "Expression"), n(e.body, t, "Statement");
|
|
3304
|
-
},
|
|
3270
|
+
}, Z.SwitchStatement = function(e, t, n) {
|
|
3305
3271
|
n(e.discriminant, t, "Expression");
|
|
3306
3272
|
for (var r = 0, i = e.cases; r < i.length; r += 1) {
|
|
3307
3273
|
var a = i[r];
|
|
3308
3274
|
n(a, t);
|
|
3309
3275
|
}
|
|
3310
|
-
},
|
|
3276
|
+
}, Z.SwitchCase = function(e, t, n) {
|
|
3311
3277
|
e.test && n(e.test, t, "Expression");
|
|
3312
3278
|
for (var r = 0, i = e.consequent; r < i.length; r += 1) {
|
|
3313
3279
|
var a = i[r];
|
|
3314
3280
|
n(a, t, "Statement");
|
|
3315
3281
|
}
|
|
3316
|
-
},
|
|
3282
|
+
}, Z.ReturnStatement = Z.YieldExpression = Z.AwaitExpression = function(e, t, n) {
|
|
3317
3283
|
e.argument && n(e.argument, t, "Expression");
|
|
3318
|
-
},
|
|
3284
|
+
}, Z.ThrowStatement = Z.SpreadElement = function(e, t, n) {
|
|
3319
3285
|
return n(e.argument, t, "Expression");
|
|
3320
|
-
},
|
|
3286
|
+
}, Z.TryStatement = function(e, t, n) {
|
|
3321
3287
|
n(e.block, t, "Statement"), e.handler && n(e.handler, t), e.finalizer && n(e.finalizer, t, "Statement");
|
|
3322
|
-
},
|
|
3288
|
+
}, Z.CatchClause = function(e, t, n) {
|
|
3323
3289
|
e.param && n(e.param, t, "Pattern"), n(e.body, t, "Statement");
|
|
3324
|
-
},
|
|
3290
|
+
}, Z.WhileStatement = Z.DoWhileStatement = function(e, t, n) {
|
|
3325
3291
|
n(e.test, t, "Expression"), n(e.body, t, "Statement");
|
|
3326
|
-
},
|
|
3292
|
+
}, Z.ForStatement = function(e, t, n) {
|
|
3327
3293
|
e.init && n(e.init, t, "ForInit"), e.test && n(e.test, t, "Expression"), e.update && n(e.update, t, "Expression"), n(e.body, t, "Statement");
|
|
3328
|
-
},
|
|
3294
|
+
}, Z.ForInStatement = Z.ForOfStatement = function(e, t, n) {
|
|
3329
3295
|
n(e.left, t, "ForInit"), n(e.right, t, "Expression"), n(e.body, t, "Statement");
|
|
3330
|
-
},
|
|
3296
|
+
}, Z.ForInit = function(e, t, n) {
|
|
3331
3297
|
e.type === "VariableDeclaration" ? n(e, t) : n(e, t, "Expression");
|
|
3332
|
-
},
|
|
3298
|
+
}, Z.DebuggerStatement = X, Z.FunctionDeclaration = function(e, t, n) {
|
|
3333
3299
|
return n(e, t, "Function");
|
|
3334
|
-
},
|
|
3300
|
+
}, Z.VariableDeclaration = function(e, t, n) {
|
|
3335
3301
|
for (var r = 0, i = e.declarations; r < i.length; r += 1) {
|
|
3336
3302
|
var a = i[r];
|
|
3337
3303
|
n(a, t);
|
|
3338
3304
|
}
|
|
3339
|
-
},
|
|
3305
|
+
}, Z.VariableDeclarator = function(e, t, n) {
|
|
3340
3306
|
n(e.id, t, "Pattern"), e.init && n(e.init, t, "Expression");
|
|
3341
|
-
},
|
|
3307
|
+
}, Z.Function = function(e, t, n) {
|
|
3342
3308
|
e.id && n(e.id, t, "Pattern");
|
|
3343
3309
|
for (var r = 0, i = e.params; r < i.length; r += 1) {
|
|
3344
3310
|
var a = i[r];
|
|
3345
3311
|
n(a, t, "Pattern");
|
|
3346
3312
|
}
|
|
3347
3313
|
n(e.body, t, e.expression ? "Expression" : "Statement");
|
|
3348
|
-
},
|
|
3314
|
+
}, Z.Pattern = function(e, t, n) {
|
|
3349
3315
|
e.type === "Identifier" ? n(e, t, "VariablePattern") : e.type === "MemberExpression" ? n(e, t, "MemberPattern") : n(e, t);
|
|
3350
|
-
},
|
|
3316
|
+
}, Z.VariablePattern = X, Z.MemberPattern = Xt, Z.RestElement = function(e, t, n) {
|
|
3351
3317
|
return n(e.argument, t, "Pattern");
|
|
3352
|
-
},
|
|
3318
|
+
}, Z.ArrayPattern = function(e, t, n) {
|
|
3353
3319
|
for (var r = 0, i = e.elements; r < i.length; r += 1) {
|
|
3354
3320
|
var a = i[r];
|
|
3355
3321
|
a && n(a, t, "Pattern");
|
|
3356
3322
|
}
|
|
3357
|
-
},
|
|
3323
|
+
}, Z.ObjectPattern = function(e, t, n) {
|
|
3358
3324
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
3359
3325
|
var a = i[r];
|
|
3360
3326
|
a.type === "Property" ? (a.computed && n(a.key, t, "Expression"), n(a.value, t, "Pattern")) : a.type === "RestElement" && n(a.argument, t, "Pattern");
|
|
3361
3327
|
}
|
|
3362
|
-
},
|
|
3328
|
+
}, Z.Expression = Xt, Z.ThisExpression = Z.Super = Z.MetaProperty = X, Z.ArrayExpression = function(e, t, n) {
|
|
3363
3329
|
for (var r = 0, i = e.elements; r < i.length; r += 1) {
|
|
3364
3330
|
var a = i[r];
|
|
3365
3331
|
a && n(a, t, "Expression");
|
|
3366
3332
|
}
|
|
3367
|
-
},
|
|
3333
|
+
}, Z.ObjectExpression = function(e, t, n) {
|
|
3368
3334
|
for (var r = 0, i = e.properties; r < i.length; r += 1) {
|
|
3369
3335
|
var a = i[r];
|
|
3370
3336
|
n(a, t);
|
|
3371
3337
|
}
|
|
3372
|
-
},
|
|
3338
|
+
}, Z.FunctionExpression = Z.ArrowFunctionExpression = Z.FunctionDeclaration, Z.SequenceExpression = function(e, t, n) {
|
|
3373
3339
|
for (var r = 0, i = e.expressions; r < i.length; r += 1) {
|
|
3374
3340
|
var a = i[r];
|
|
3375
3341
|
n(a, t, "Expression");
|
|
3376
3342
|
}
|
|
3377
|
-
},
|
|
3343
|
+
}, Z.TemplateLiteral = function(e, t, n) {
|
|
3378
3344
|
for (var r = 0, i = e.quasis; r < i.length; r += 1) {
|
|
3379
3345
|
var a = i[r];
|
|
3380
3346
|
n(a, t);
|
|
@@ -3383,34 +3349,34 @@ $.Program = $.BlockStatement = $.StaticBlock = function(e, t, n) {
|
|
|
3383
3349
|
var c = s[o];
|
|
3384
3350
|
n(c, t, "Expression");
|
|
3385
3351
|
}
|
|
3386
|
-
},
|
|
3352
|
+
}, Z.TemplateElement = X, Z.UnaryExpression = Z.UpdateExpression = function(e, t, n) {
|
|
3387
3353
|
n(e.argument, t, "Expression");
|
|
3388
|
-
},
|
|
3354
|
+
}, Z.BinaryExpression = Z.LogicalExpression = function(e, t, n) {
|
|
3389
3355
|
n(e.left, t, "Expression"), n(e.right, t, "Expression");
|
|
3390
|
-
},
|
|
3356
|
+
}, Z.AssignmentExpression = Z.AssignmentPattern = function(e, t, n) {
|
|
3391
3357
|
n(e.left, t, "Pattern"), n(e.right, t, "Expression");
|
|
3392
|
-
},
|
|
3358
|
+
}, Z.ConditionalExpression = function(e, t, n) {
|
|
3393
3359
|
n(e.test, t, "Expression"), n(e.consequent, t, "Expression"), n(e.alternate, t, "Expression");
|
|
3394
|
-
},
|
|
3360
|
+
}, Z.NewExpression = Z.CallExpression = function(e, t, n) {
|
|
3395
3361
|
if (n(e.callee, t, "Expression"), e.arguments) for (var r = 0, i = e.arguments; r < i.length; r += 1) {
|
|
3396
3362
|
var a = i[r];
|
|
3397
3363
|
n(a, t, "Expression");
|
|
3398
3364
|
}
|
|
3399
|
-
},
|
|
3365
|
+
}, Z.MemberExpression = function(e, t, n) {
|
|
3400
3366
|
n(e.object, t, "Expression"), e.computed && n(e.property, t, "Expression");
|
|
3401
|
-
},
|
|
3367
|
+
}, Z.ExportNamedDeclaration = Z.ExportDefaultDeclaration = function(e, t, n) {
|
|
3402
3368
|
if (e.declaration && n(e.declaration, t, e.type === "ExportNamedDeclaration" || e.declaration.id ? "Statement" : "Expression"), e.source && n(e.source, t, "Expression"), e.attributes) for (var r = 0, i = e.attributes; r < i.length; r += 1) {
|
|
3403
3369
|
var a = i[r];
|
|
3404
3370
|
n(a, t);
|
|
3405
3371
|
}
|
|
3406
|
-
},
|
|
3372
|
+
}, Z.ExportAllDeclaration = function(e, t, n) {
|
|
3407
3373
|
if (e.exported && n(e.exported, t), n(e.source, t, "Expression"), e.attributes) for (var r = 0, i = e.attributes; r < i.length; r += 1) {
|
|
3408
3374
|
var a = i[r];
|
|
3409
3375
|
n(a, t);
|
|
3410
3376
|
}
|
|
3411
|
-
},
|
|
3377
|
+
}, Z.ImportAttribute = function(e, t, n) {
|
|
3412
3378
|
n(e.value, t, "Expression");
|
|
3413
|
-
},
|
|
3379
|
+
}, Z.ImportDeclaration = function(e, t, n) {
|
|
3414
3380
|
for (var r = 0, i = e.specifiers; r < i.length; r += 1) {
|
|
3415
3381
|
var a = i[r];
|
|
3416
3382
|
n(a, t);
|
|
@@ -3419,28 +3385,48 @@ $.Program = $.BlockStatement = $.StaticBlock = function(e, t, n) {
|
|
|
3419
3385
|
var c = s[o];
|
|
3420
3386
|
n(c, t);
|
|
3421
3387
|
}
|
|
3422
|
-
},
|
|
3388
|
+
}, Z.ImportExpression = function(e, t, n) {
|
|
3423
3389
|
n(e.source, t, "Expression"), e.options && n(e.options, t, "Expression");
|
|
3424
|
-
},
|
|
3390
|
+
}, Z.ImportSpecifier = Z.ImportDefaultSpecifier = Z.ImportNamespaceSpecifier = Z.Identifier = Z.PrivateIdentifier = Z.Literal = X, Z.TaggedTemplateExpression = function(e, t, n) {
|
|
3425
3391
|
n(e.tag, t, "Expression"), n(e.quasi, t, "Expression");
|
|
3426
|
-
},
|
|
3392
|
+
}, Z.ClassDeclaration = Z.ClassExpression = function(e, t, n) {
|
|
3427
3393
|
return n(e, t, "Class");
|
|
3428
|
-
},
|
|
3394
|
+
}, Z.Class = function(e, t, n) {
|
|
3429
3395
|
e.id && n(e.id, t, "Pattern"), e.superClass && n(e.superClass, t, "Expression"), n(e.body, t);
|
|
3430
|
-
},
|
|
3396
|
+
}, Z.ClassBody = function(e, t, n) {
|
|
3431
3397
|
for (var r = 0, i = e.body; r < i.length; r += 1) {
|
|
3432
3398
|
var a = i[r];
|
|
3433
3399
|
n(a, t);
|
|
3434
3400
|
}
|
|
3435
|
-
},
|
|
3401
|
+
}, Z.MethodDefinition = Z.PropertyDefinition = Z.Property = function(e, t, n) {
|
|
3436
3402
|
e.computed && n(e.key, t, "Expression"), e.value && n(e.value, t, "Expression");
|
|
3437
3403
|
};
|
|
3438
3404
|
//#endregion
|
|
3405
|
+
//#region ../compiler/dist/index-es.js
|
|
3406
|
+
var Q = {
|
|
3407
|
+
Data: "Data",
|
|
3408
|
+
TagOpen: "TagOpen",
|
|
3409
|
+
EndTagOpen: "EndTagOpen",
|
|
3410
|
+
BeforeAttributeName: "BeforeAttributeName",
|
|
3411
|
+
AttributeName: "AttributeName",
|
|
3412
|
+
AfterAttributeName: "AfterAttributeName",
|
|
3413
|
+
BeforeAttributeValue: "BeforeAttributeValue",
|
|
3414
|
+
AttributeValueQuoted: "AttributeValueQuoted",
|
|
3415
|
+
AttributeValueInterpolation: "AttributeValueInterpolation",
|
|
3416
|
+
Comment: "Comment",
|
|
3417
|
+
Interpolation: "Interpolation",
|
|
3418
|
+
RawText: "RawText",
|
|
3419
|
+
EOF: "EOF"
|
|
3420
|
+
}, $ = /* @__PURE__ */ function(e) {
|
|
3421
|
+
return e[e.RETURN = 0] = "RETURN", e[e.CREATE_ELEMENT = 1] = "CREATE_ELEMENT", e[e.CREATE_TEXT = 2] = "CREATE_TEXT", e[e.CREATE_COMMENT = 3] = "CREATE_COMMENT", e[e.APPEND_CHILD = 4] = "APPEND_CHILD", e[e.SET_ATTR = 5] = "SET_ATTR", e[e.CREATE_FRAGMENT = 6] = "CREATE_FRAGMENT", e[e.INTERPOLATE_TEXT = 7] = "INTERPOLATE_TEXT", e[e.EXEC_SCRIPT = 12] = "EXEC_SCRIPT", e[e.REACTIVE_IF = 13] = "REACTIVE_IF", e[e.REACTIVE_FOR = 14] = "REACTIVE_FOR", e[e.MOUNT_COMPONENT = 15] = "MOUNT_COMPONENT", e;
|
|
3422
|
+
}({});
|
|
3423
|
+
Q.Data, Q.Comment, Q.EndTagOpen, Q.TagOpen, Q.Interpolation, Q.Data, Q.EOF, Q.TagOpen, Q.BeforeAttributeName, Q.EndTagOpen, Q.BeforeAttributeName, Q.BeforeAttributeName, Q.AttributeName, Q.Data, Q.RawText, Q.Data, Q.AttributeName, Q.AfterAttributeName, Q.AfterAttributeName, Q.BeforeAttributeValue, Q.BeforeAttributeName, Q.BeforeAttributeValue, Q.AttributeValueQuoted, Q.AttributeValueInterpolation, Q.AttributeValueQuoted, Q.BeforeAttributeName, Q.AttributeValueInterpolation, Q.BeforeAttributeName, Q.Comment, Q.Data, Q.Interpolation, Q.Data, Q.BeforeAttributeName, Q.RawText, Q.RawText, Q.EndTagOpen, Q.EOF, Q.EOF, Q.EOF;
|
|
3424
|
+
//#endregion
|
|
3439
3425
|
//#region src/index.ts
|
|
3440
|
-
function
|
|
3426
|
+
function Zt(e) {
|
|
3441
3427
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
3442
3428
|
}
|
|
3443
|
-
var
|
|
3429
|
+
var Qt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, $t = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, en = class e {
|
|
3444
3430
|
static MAX_REGISTERS = 256;
|
|
3445
3431
|
registers = Array(e.MAX_REGISTERS);
|
|
3446
3432
|
scope = {};
|
|
@@ -3456,42 +3442,42 @@ var Xt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, Zt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, Qt
|
|
|
3456
3442
|
getRegister(e) {
|
|
3457
3443
|
return this.checkRegister(e), this.registers[e];
|
|
3458
3444
|
}
|
|
3459
|
-
execute(t,
|
|
3460
|
-
let a =
|
|
3461
|
-
if (this.scope = Object.assign(Object.create(
|
|
3445
|
+
execute(t, n = {}) {
|
|
3446
|
+
let a = h(t) || t, o = n.scope || null;
|
|
3447
|
+
if (this.scope = Object.assign(Object.create(o), a.scope), a.derived && a.derived.length > 0) for (let e of a.derived) {
|
|
3462
3448
|
let t = a.constants[e.exprIdx];
|
|
3463
3449
|
Object.defineProperty(this.scope, e.name, {
|
|
3464
|
-
get: () =>
|
|
3450
|
+
get: () => r(t, this.scope, this.declaredVars),
|
|
3465
3451
|
enumerable: !0,
|
|
3466
3452
|
configurable: !0
|
|
3467
3453
|
});
|
|
3468
3454
|
}
|
|
3469
3455
|
this.declaredVars = new Set(a.declaredVars ?? []), this.registers.fill(null);
|
|
3470
|
-
let
|
|
3471
|
-
|
|
3456
|
+
let c = a.bytecode, l = a.constants, f = 0;
|
|
3457
|
+
m(this);
|
|
3472
3458
|
try {
|
|
3473
|
-
for (;
|
|
3474
|
-
let t =
|
|
3459
|
+
for (; f < c.length;) {
|
|
3460
|
+
let t = c[f];
|
|
3475
3461
|
switch (t) {
|
|
3476
|
-
case
|
|
3477
|
-
|
|
3462
|
+
case $.RETURN:
|
|
3463
|
+
f += 1;
|
|
3478
3464
|
break;
|
|
3479
|
-
case
|
|
3480
|
-
let e =
|
|
3465
|
+
case $.CREATE_ELEMENT: {
|
|
3466
|
+
let e = c[f + 1], t = c[f + 2], n = String(l[t]);
|
|
3481
3467
|
this.setRegister(e, {
|
|
3482
3468
|
type: "element",
|
|
3483
3469
|
tag: n,
|
|
3484
3470
|
attrs: /* @__PURE__ */ new Map(),
|
|
3485
3471
|
children: []
|
|
3486
|
-
}),
|
|
3472
|
+
}), f += 3;
|
|
3487
3473
|
break;
|
|
3488
3474
|
}
|
|
3489
|
-
case
|
|
3490
|
-
let t =
|
|
3475
|
+
case $.MOUNT_COMPONENT: {
|
|
3476
|
+
let t = c[f + 1], n = c[f + 2], r = c[f + 3], a = String(l[n]), o = h(this.scope && a in this.scope ? this.scope[a] : typeof globalThis < "u" && globalThis[a]);
|
|
3491
3477
|
if (o) {
|
|
3492
|
-
let n =
|
|
3478
|
+
let n = r === 255 ? null : l[r], a = i(n, this.scope, this.declaredVars), s;
|
|
3493
3479
|
if (n && n.__drift_children__ !== void 0) {
|
|
3494
|
-
let t =
|
|
3480
|
+
let t = l[n.__drift_children__] ?? n.__drift_children__;
|
|
3495
3481
|
if (t) {
|
|
3496
3482
|
let n = new e();
|
|
3497
3483
|
n.parentVM = this, s = n.execute(t, { scope: this.scope }) ?? void 0;
|
|
@@ -3499,107 +3485,107 @@ var Xt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, Zt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, Qt
|
|
|
3499
3485
|
}
|
|
3500
3486
|
let c = new e();
|
|
3501
3487
|
c.parentVM = this;
|
|
3502
|
-
let
|
|
3503
|
-
s !== void 0 && (
|
|
3504
|
-
let
|
|
3505
|
-
|
|
3488
|
+
let u = Object.assign(Object.create(this.scope), { props: a }, a);
|
|
3489
|
+
s !== void 0 && (u.children = s);
|
|
3490
|
+
let d = c.execute(o, { scope: u });
|
|
3491
|
+
d && this.setRegister(t, d);
|
|
3506
3492
|
}
|
|
3507
|
-
|
|
3493
|
+
f += 4;
|
|
3508
3494
|
break;
|
|
3509
3495
|
}
|
|
3510
|
-
case
|
|
3511
|
-
let e =
|
|
3496
|
+
case $.CREATE_TEXT: {
|
|
3497
|
+
let e = c[f + 1], t = l[c[f + 2]], n = r(t, this.scope, this.declaredVars), i = n == null ? "" : String(n);
|
|
3512
3498
|
this.setRegister(e, {
|
|
3513
3499
|
type: "text",
|
|
3514
3500
|
content: i,
|
|
3515
3501
|
children: []
|
|
3516
|
-
}),
|
|
3502
|
+
}), f += 3;
|
|
3517
3503
|
break;
|
|
3518
3504
|
}
|
|
3519
|
-
case
|
|
3520
|
-
let e =
|
|
3505
|
+
case $.CREATE_COMMENT: {
|
|
3506
|
+
let e = c[f + 1], t = c[f + 2], n = String(l[t]);
|
|
3521
3507
|
this.setRegister(e, {
|
|
3522
3508
|
type: "comment",
|
|
3523
3509
|
content: n,
|
|
3524
3510
|
children: []
|
|
3525
|
-
}),
|
|
3511
|
+
}), f += 3;
|
|
3526
3512
|
break;
|
|
3527
3513
|
}
|
|
3528
|
-
case
|
|
3529
|
-
let e =
|
|
3514
|
+
case $.CREATE_FRAGMENT: {
|
|
3515
|
+
let e = c[f + 1];
|
|
3530
3516
|
this.setRegister(e, {
|
|
3531
3517
|
type: "fragment",
|
|
3532
3518
|
children: []
|
|
3533
|
-
}),
|
|
3519
|
+
}), f += 2;
|
|
3534
3520
|
break;
|
|
3535
3521
|
}
|
|
3536
|
-
case
|
|
3537
|
-
let e =
|
|
3538
|
-
n.children.push(r),
|
|
3522
|
+
case $.APPEND_CHILD: {
|
|
3523
|
+
let e = c[f + 1], t = c[f + 2], n = this.getRegister(e), r = this.getRegister(t);
|
|
3524
|
+
n.children.push(r), f += 3;
|
|
3539
3525
|
break;
|
|
3540
3526
|
}
|
|
3541
|
-
case
|
|
3542
|
-
let e =
|
|
3543
|
-
if (
|
|
3544
|
-
|
|
3527
|
+
case $.SET_ATTR: {
|
|
3528
|
+
let e = c[f + 1], t = c[f + 2], n = c[f + 3], i = c[f + 4], a = this.getRegister(e), o = String(l[t]);
|
|
3529
|
+
if (o.startsWith("on")) {
|
|
3530
|
+
f += 5;
|
|
3545
3531
|
break;
|
|
3546
3532
|
}
|
|
3547
|
-
let
|
|
3548
|
-
|
|
3533
|
+
let u = l[n], d = i === 1 ? r(u, this.scope, this.declaredVars) : u;
|
|
3534
|
+
o === "style" && (d = s(d)), a.attrs ||= /* @__PURE__ */ new Map(), o === "className" ? a.attrs.set("class", d) : a.attrs.set(o, d), f += 5;
|
|
3549
3535
|
break;
|
|
3550
3536
|
}
|
|
3551
|
-
case
|
|
3552
|
-
let e =
|
|
3553
|
-
if (
|
|
3537
|
+
case $.INTERPOLATE_TEXT: {
|
|
3538
|
+
let e = c[f + 1], t = l[c[f + 2]], n = r(t, this.scope, this.declaredVars);
|
|
3539
|
+
if (n && typeof n == "object" && "type" in n && Array.isArray(n.children)) this.setRegister(e, n);
|
|
3554
3540
|
else {
|
|
3555
|
-
let t =
|
|
3541
|
+
let t = n == null ? "" : String(n);
|
|
3556
3542
|
this.setRegister(e, {
|
|
3557
3543
|
type: "text",
|
|
3558
3544
|
content: t,
|
|
3559
3545
|
children: []
|
|
3560
3546
|
});
|
|
3561
3547
|
}
|
|
3562
|
-
|
|
3548
|
+
f += 3;
|
|
3563
3549
|
break;
|
|
3564
3550
|
}
|
|
3565
|
-
case
|
|
3566
|
-
let e =
|
|
3567
|
-
if (Array.isArray(e)) for (let t of e)
|
|
3568
|
-
else e &&
|
|
3569
|
-
|
|
3551
|
+
case $.EXEC_SCRIPT: {
|
|
3552
|
+
let e = l[c[f + 1]];
|
|
3553
|
+
if (Array.isArray(e)) for (let t of e) r(t, this.scope, this.declaredVars);
|
|
3554
|
+
else e && r(e, this.scope, this.declaredVars);
|
|
3555
|
+
f += 2;
|
|
3570
3556
|
break;
|
|
3571
3557
|
}
|
|
3572
|
-
case
|
|
3573
|
-
let t =
|
|
3558
|
+
case $.REACTIVE_IF: {
|
|
3559
|
+
let t = c[f + 1], n = c[f + 2], i = c[f + 3], a = c[f + 4], o = this.getRegister(t), s = l[n], u = l[i], d = a === 255 ? null : l[a], p = r(s, this.scope, this.declaredVars) ? u : d;
|
|
3574
3560
|
if (o.children.push({
|
|
3575
3561
|
type: "comment",
|
|
3576
3562
|
content: "if",
|
|
3577
3563
|
children: []
|
|
3578
|
-
}),
|
|
3564
|
+
}), p) {
|
|
3579
3565
|
let t = Object.create(this.scope), n = new e();
|
|
3580
3566
|
n.parentVM = this;
|
|
3581
|
-
let r = n.execute(
|
|
3567
|
+
let r = n.execute(p, { scope: t });
|
|
3582
3568
|
r && o.children.push(r);
|
|
3583
3569
|
}
|
|
3584
3570
|
o.children.push({
|
|
3585
3571
|
type: "comment",
|
|
3586
3572
|
content: "/if",
|
|
3587
3573
|
children: []
|
|
3588
|
-
}),
|
|
3574
|
+
}), f += 6;
|
|
3589
3575
|
break;
|
|
3590
3576
|
}
|
|
3591
|
-
case
|
|
3592
|
-
let t =
|
|
3593
|
-
|
|
3594
|
-
let o =
|
|
3577
|
+
case $.REACTIVE_FOR: {
|
|
3578
|
+
let t = c[f + 1], n = c[f + 2], i = c[f + 3], a = c[f + 4];
|
|
3579
|
+
c[f + 5];
|
|
3580
|
+
let o = c[f + 6], s = this.getRegister(t), u = l[n], p = l[i], m = a === 255 ? null : l[a], h = l[o], g = ee(r(u, this.scope, this.declaredVars));
|
|
3595
3581
|
s.children.push({
|
|
3596
3582
|
type: "comment",
|
|
3597
3583
|
content: "for",
|
|
3598
3584
|
children: []
|
|
3599
3585
|
});
|
|
3600
|
-
for (let t = 0; t <
|
|
3586
|
+
for (let t = 0; t < g.length; t++) {
|
|
3601
3587
|
let n = Object.create(this.scope);
|
|
3602
|
-
|
|
3588
|
+
d(n, p, g[t], m, t);
|
|
3603
3589
|
let r = new e();
|
|
3604
3590
|
r.parentVM = this;
|
|
3605
3591
|
let i = r.execute(h, { scope: n });
|
|
@@ -3609,47 +3595,47 @@ var Xt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, Zt = /^[a-zA-Z_:][a-zA-Z0-9_.:-]*$/, Qt
|
|
|
3609
3595
|
type: "comment",
|
|
3610
3596
|
content: "/for",
|
|
3611
3597
|
children: []
|
|
3612
|
-
}),
|
|
3598
|
+
}), f += 8;
|
|
3613
3599
|
break;
|
|
3614
3600
|
}
|
|
3615
|
-
default: throw Error(`DriftServerVM: Unknown Opcode ${t} at PC ${
|
|
3601
|
+
default: throw Error(`DriftServerVM: Unknown Opcode ${t} at PC ${f}`);
|
|
3616
3602
|
}
|
|
3617
3603
|
}
|
|
3618
3604
|
return this.getRegister(0);
|
|
3619
3605
|
} finally {
|
|
3620
|
-
|
|
3606
|
+
u();
|
|
3621
3607
|
}
|
|
3622
3608
|
}
|
|
3623
3609
|
};
|
|
3624
|
-
function
|
|
3610
|
+
function tn(e, t) {
|
|
3625
3611
|
if (!t) return e;
|
|
3626
3612
|
let n = t.toLowerCase();
|
|
3627
3613
|
return n === "script" ? e.replace(/<\/script/gi, "<\\/script") : n === "style" ? e.replace(/<\/style/gi, "<\\/style") : e;
|
|
3628
3614
|
}
|
|
3629
|
-
function
|
|
3615
|
+
function nn(t, n = !1, r) {
|
|
3630
3616
|
if (!t) return "";
|
|
3631
|
-
if (typeof t == "string") return n ?
|
|
3632
|
-
if (t.type === "text") return n ?
|
|
3617
|
+
if (typeof t == "string") return n ? tn(t, r) : Zt(t);
|
|
3618
|
+
if (t.type === "text") return n ? tn(t.content ?? "", r) : Zt(t.content ?? "");
|
|
3633
3619
|
if (t.type === "comment") return `<!--${String(t.content ?? "").replace(/-->/g, "-- >").replace(/--!>/g, "--! >")}-->`;
|
|
3634
|
-
if (t.type === "fragment") return t.children.map((e) =>
|
|
3620
|
+
if (t.type === "fragment") return t.children.map((e) => nn(e, n, r)).join("");
|
|
3635
3621
|
if (t.type === "element") {
|
|
3636
3622
|
let n = t.tag;
|
|
3637
|
-
if (!n ||
|
|
3623
|
+
if (!n || !$t.test(n)) return "";
|
|
3638
3624
|
let r = n.toLowerCase() === "script" || n.toLowerCase() === "style", i = "";
|
|
3639
3625
|
if (t.attrs && t.attrs.size > 0) for (let [e, n] of t.attrs.entries()) {
|
|
3640
|
-
if (!
|
|
3626
|
+
if (!Qt.test(e) || e === "style" && (n === "" || n == null || n === !1)) continue;
|
|
3641
3627
|
let t = e.startsWith("aria-") || e.startsWith("data-");
|
|
3642
|
-
n === !0 ? i += t ? ` ${e}="true"` : ` ${e}` : n === !1 ? t && (i += ` ${e}="false"`) : n != null && (i += ` ${e}="${
|
|
3628
|
+
n === !0 ? i += t ? ` ${e}="true"` : ` ${e}` : n === !1 ? t && (i += ` ${e}="false"`) : n != null && (i += ` ${e}="${Zt(String(n))}"`);
|
|
3643
3629
|
}
|
|
3644
3630
|
if (e.has(n.toLowerCase())) return `<${n}${i} />`;
|
|
3645
|
-
let a = t.children.map((e) =>
|
|
3631
|
+
let a = t.children.map((e) => nn(e, r, r ? n : void 0)).join("");
|
|
3646
3632
|
return `<${n}${i}>${a}</${n}>`;
|
|
3647
3633
|
}
|
|
3648
3634
|
return "";
|
|
3649
3635
|
}
|
|
3650
|
-
function
|
|
3651
|
-
let n = new
|
|
3652
|
-
return n ?
|
|
3636
|
+
function rn(e, t = {}) {
|
|
3637
|
+
let n = new en().execute(e, t);
|
|
3638
|
+
return n ? nn(n) : "";
|
|
3653
3639
|
}
|
|
3654
3640
|
//#endregion
|
|
3655
|
-
export {
|
|
3641
|
+
export { en as DriftServerVM, t as createContext, n as effect, a as inject, o as injectContext, c as onMount, l as onUnmount, f as provide, p as provideContext, rn as renderToString, nn as serializeNode };
|