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