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