@voidzero-dev/vite-plus-core 0.1.15-alpha.5 → 0.1.15-alpha.7
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/tsdown/build-DU-BFLB1-BCro_0va.js +2 -0
- package/dist/tsdown/{build-DpU0PBVv-DmeUpIF7.js → build-DU-BFLB1-BP6FOpRZ.js} +132 -38
- package/dist/tsdown/{debug-C4FmgzkJ-A9B4RM_w.js → debug-BmAPbhgA-BPQhbB8P.js} +2 -2
- package/dist/tsdown/{detect-DN3DXXYt-GIMDNpE1.js → detect-h8ZFBH96-C_8f1Pj6.js} +1 -1
- package/dist/tsdown/{dist-CtF_Stv5.js → dist-B98oBzil.js} +642 -1359
- package/dist/tsdown/{dist-mVbiy67d.js → dist-Cqme3mtE.js} +3 -3
- package/dist/tsdown/dist-CxeZzY9B.js +848 -0
- package/dist/tsdown/{filename-UU7z2A9Z.js → filename-DQnUJlio-B_23lF2M.js} +1 -1
- package/dist/tsdown/index-types.d.ts +11629 -178
- package/dist/tsdown/index.js +4 -4
- package/dist/tsdown/{main-BgAbc3Rw.js → main-CYOGr7IM.js} +8 -11
- package/dist/tsdown/run.js +4 -4
- package/dist/tsdown/{tsc-ncSpKhL9.js → tsc-Cabpo8gE.js} +3 -3
- package/dist/tsdown/{tsc-context-BQtoHArj.js → tsc-context-CltQOpVo.js} +1 -1
- package/dist/vite/node/chunks/logger.js +1 -1
- package/package.json +8 -8
- package/dist/tsdown/build-D-zhBXEK-DEzF_gsh.js +0 -2
- /package/dist/tsdown/{dist-_l70jCqI.js → dist-D8aGMhnG.js} +0 -0
- /package/dist/tsdown/{resolver-BUWpVKW_-BR1glCep.js → resolver-DkvdaW3s-CCXGyGZ3.js} +0 -0
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { n as __exportAll, r as __toESM, t as __commonJSMin } from "./chunk-CSNpwdVU.js";
|
|
2
2
|
import { t as createDebug } from "./node-B3Gdtau1.js";
|
|
3
|
-
import { a as RE_JSON, c as RE_TS, d as filename_js_to_dts, f as filename_to_dts, i as RE_JS, l as RE_VUE, m as resolveTemplateFn, n as RE_DTS, o as RE_NODE_MODULES, p as replaceTemplateName, r as RE_DTS_MAP, s as RE_ROLLDOWN_RUNTIME, t as RE_CSS, u as filename_dts_to } from "./filename-
|
|
4
|
-
import { n as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { a as RE_JSON, c as RE_TS, d as filename_js_to_dts, f as filename_to_dts, i as RE_JS, l as RE_VUE, m as resolveTemplateFn, n as RE_DTS, o as RE_NODE_MODULES, p as replaceTemplateName, r as RE_DTS_MAP, s as RE_ROLLDOWN_RUNTIME, t as RE_CSS, u as filename_dts_to } from "./filename-DQnUJlio-B_23lF2M.js";
|
|
4
|
+
import { n as pe, t as Ge } from "./dist-CxeZzY9B.js";
|
|
5
|
+
import { n as globalContext, r as invalidateContextFile, t as createContext } from "./tsc-context-CltQOpVo.js";
|
|
6
|
+
import { createRequire } from "node:module";
|
|
7
|
+
import process from "node:process";
|
|
7
8
|
import { fork, spawn } from "node:child_process";
|
|
8
9
|
import path, { dirname, extname } from "node:path";
|
|
9
10
|
import { mkdtemp, readFile, rm } from "node:fs/promises";
|
|
10
11
|
import { importerId, include } from "@voidzero-dev/vite-plus-core/rolldown/filter";
|
|
11
|
-
import
|
|
12
|
-
import path$1 from "path";
|
|
12
|
+
import { existsSync } from "node:fs";
|
|
13
13
|
import { tmpdir } from "node:os";
|
|
14
|
-
import re, { existsSync } from "node:fs";
|
|
15
14
|
import { ResolverFactory, isolatedDeclarationSync } from "@voidzero-dev/vite-plus-core/rolldown/experimental";
|
|
16
|
-
import Be from "os";
|
|
17
15
|
//#region ../../node_modules/.pnpm/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
|
|
18
16
|
var comma = ",".charCodeAt(0);
|
|
19
17
|
var semicolon = ";".charCodeAt(0);
|
|
@@ -307,7 +305,7 @@ function normalizePath(url, type) {
|
|
|
307
305
|
/**
|
|
308
306
|
* Attempts to resolve `input` URL/path relative to `base`.
|
|
309
307
|
*/
|
|
310
|
-
function resolve$
|
|
308
|
+
function resolve$1(input, base) {
|
|
311
309
|
if (!input && !base) return "";
|
|
312
310
|
const url = parseUrl(input);
|
|
313
311
|
let inputType = url.type;
|
|
@@ -352,7 +350,7 @@ function stripFilename(path) {
|
|
|
352
350
|
function resolver(mapUrl, sourceRoot) {
|
|
353
351
|
const from = stripFilename(mapUrl);
|
|
354
352
|
const prefix = sourceRoot ? sourceRoot + "/" : "";
|
|
355
|
-
return (source) => resolve$
|
|
353
|
+
return (source) => resolve$1(prefix + (source || ""), from);
|
|
356
354
|
}
|
|
357
355
|
var COLUMN$1 = 0;
|
|
358
356
|
var SOURCES_INDEX$1 = 1;
|
|
@@ -660,12 +658,11 @@ function addMappingInternal(skipable, map, mapping) {
|
|
|
660
658
|
return addSegmentInternal(skipable, map, generated.line - 1, generated.column, source, original.line - 1, original.column, name, content);
|
|
661
659
|
}
|
|
662
660
|
//#endregion
|
|
663
|
-
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@8.0.0-rc.
|
|
664
|
-
|
|
665
|
-
|
|
661
|
+
//#region ../../node_modules/.pnpm/@babel+helper-validator-identifier@8.0.0-rc.3/node_modules/@babel/helper-validator-identifier/lib/index.js
|
|
662
|
+
const nonASCIIidentifierStartChars$1 = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
|
|
663
|
+
const nonASCIIidentifierChars$1 = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
|
|
666
664
|
const nonASCIIidentifierStart$1 = new RegExp("[" + nonASCIIidentifierStartChars$1 + "]");
|
|
667
665
|
const nonASCIIidentifier$1 = new RegExp("[" + nonASCIIidentifierStartChars$1 + nonASCIIidentifierChars$1 + "]");
|
|
668
|
-
nonASCIIidentifierStartChars$1 = nonASCIIidentifierChars$1 = null;
|
|
669
666
|
const astralIdentifierStartCodes$1 = [
|
|
670
667
|
0,
|
|
671
668
|
11,
|
|
@@ -1725,7 +1722,7 @@ function isKeyword$1(word) {
|
|
|
1725
1722
|
return keywords$2.has(word);
|
|
1726
1723
|
}
|
|
1727
1724
|
//#endregion
|
|
1728
|
-
//#region ../../node_modules/.pnpm/@babel+helper-string-parser@8.0.0-rc.
|
|
1725
|
+
//#region ../../node_modules/.pnpm/@babel+helper-string-parser@8.0.0-rc.3/node_modules/@babel/helper-string-parser/lib/index.js
|
|
1729
1726
|
var _isDigit$1 = function isDigit(code) {
|
|
1730
1727
|
return code >= 48 && code <= 57;
|
|
1731
1728
|
};
|
|
@@ -1945,7 +1942,7 @@ function readCodePoint$1(input, pos, lineStart, curLine, throwOnInvalid, errors)
|
|
|
1945
1942
|
};
|
|
1946
1943
|
}
|
|
1947
1944
|
//#endregion
|
|
1948
|
-
//#region ../../node_modules/.pnpm/@babel+types@8.0.0-rc.
|
|
1945
|
+
//#region ../../node_modules/.pnpm/@babel+types@8.0.0-rc.3/node_modules/@babel/types/lib/index.js
|
|
1949
1946
|
var lib_exports = /* @__PURE__ */ __exportAll({
|
|
1950
1947
|
ACCESSOR_TYPES: () => ACCESSOR_TYPES,
|
|
1951
1948
|
ALIAS_KEYS: () => ALIAS_KEYS,
|
|
@@ -1968,6 +1965,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
1968
1965
|
BOOLEAN_UNARY_OPERATORS: () => BOOLEAN_UNARY_OPERATORS,
|
|
1969
1966
|
BUILDER_KEYS: () => BUILDER_KEYS,
|
|
1970
1967
|
BigIntLiteral: () => BigIntLiteral$1,
|
|
1968
|
+
BigIntLiteralTypeAnnotation: () => BigIntLiteralTypeAnnotation,
|
|
1971
1969
|
BinaryExpression: () => BinaryExpression$2,
|
|
1972
1970
|
BindExpression: () => BindExpression$1,
|
|
1973
1971
|
BlockStatement: () => BlockStatement$1,
|
|
@@ -2297,6 +2295,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
2297
2295
|
assertAssignmentPattern: () => assertAssignmentPattern,
|
|
2298
2296
|
assertAwaitExpression: () => assertAwaitExpression,
|
|
2299
2297
|
assertBigIntLiteral: () => assertBigIntLiteral,
|
|
2298
|
+
assertBigIntLiteralTypeAnnotation: () => assertBigIntLiteralTypeAnnotation,
|
|
2300
2299
|
assertBinary: () => assertBinary,
|
|
2301
2300
|
assertBinaryExpression: () => assertBinaryExpression,
|
|
2302
2301
|
assertBindExpression: () => assertBindExpression,
|
|
@@ -2593,6 +2592,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
2593
2592
|
assignmentPattern: () => assignmentPattern,
|
|
2594
2593
|
awaitExpression: () => awaitExpression,
|
|
2595
2594
|
bigIntLiteral: () => bigIntLiteral,
|
|
2595
|
+
bigIntLiteralTypeAnnotation: () => bigIntLiteralTypeAnnotation,
|
|
2596
2596
|
binaryExpression: () => binaryExpression,
|
|
2597
2597
|
bindExpression: () => bindExpression,
|
|
2598
2598
|
blockStatement: () => blockStatement,
|
|
@@ -2707,6 +2707,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
2707
2707
|
isAssignmentPattern: () => isAssignmentPattern$1,
|
|
2708
2708
|
isAwaitExpression: () => isAwaitExpression,
|
|
2709
2709
|
isBigIntLiteral: () => isBigIntLiteral,
|
|
2710
|
+
isBigIntLiteralTypeAnnotation: () => isBigIntLiteralTypeAnnotation,
|
|
2710
2711
|
isBinary: () => isBinary,
|
|
2711
2712
|
isBinaryExpression: () => isBinaryExpression,
|
|
2712
2713
|
isBindExpression: () => isBindExpression,
|
|
@@ -3554,11 +3555,6 @@ function isImportSpecifier(node, opts) {
|
|
|
3554
3555
|
if (node.type !== "ImportSpecifier") return false;
|
|
3555
3556
|
return opts == null || shallowEqual(node, opts);
|
|
3556
3557
|
}
|
|
3557
|
-
function isImportExpression(node, opts) {
|
|
3558
|
-
if (!node) return false;
|
|
3559
|
-
if (node.type !== "ImportExpression") return false;
|
|
3560
|
-
return opts == null || shallowEqual(node, opts);
|
|
3561
|
-
}
|
|
3562
3558
|
function isMetaProperty(node, opts) {
|
|
3563
3559
|
if (!node) return false;
|
|
3564
3560
|
if (node.type !== "MetaProperty") return false;
|
|
@@ -3609,6 +3605,11 @@ function isAwaitExpression(node, opts) {
|
|
|
3609
3605
|
if (node.type !== "AwaitExpression") return false;
|
|
3610
3606
|
return opts == null || shallowEqual(node, opts);
|
|
3611
3607
|
}
|
|
3608
|
+
function isImportExpression(node, opts) {
|
|
3609
|
+
if (!node) return false;
|
|
3610
|
+
if (node.type !== "ImportExpression") return false;
|
|
3611
|
+
return opts == null || shallowEqual(node, opts);
|
|
3612
|
+
}
|
|
3612
3613
|
function isImport(node, opts) {
|
|
3613
3614
|
if (!node) return false;
|
|
3614
3615
|
if (node.type !== "Import") return false;
|
|
@@ -3814,6 +3815,11 @@ function isNumberLiteralTypeAnnotation(node, opts) {
|
|
|
3814
3815
|
if (node.type !== "NumberLiteralTypeAnnotation") return false;
|
|
3815
3816
|
return opts == null || shallowEqual(node, opts);
|
|
3816
3817
|
}
|
|
3818
|
+
function isBigIntLiteralTypeAnnotation(node, opts) {
|
|
3819
|
+
if (!node) return false;
|
|
3820
|
+
if (node.type !== "BigIntLiteralTypeAnnotation") return false;
|
|
3821
|
+
return opts == null || shallowEqual(node, opts);
|
|
3822
|
+
}
|
|
3817
3823
|
function isNumberTypeAnnotation(node, opts) {
|
|
3818
3824
|
if (!node) return false;
|
|
3819
3825
|
if (node.type !== "NumberTypeAnnotation") return false;
|
|
@@ -4528,7 +4534,6 @@ function isStandardized(node, opts) {
|
|
|
4528
4534
|
case "ImportDefaultSpecifier":
|
|
4529
4535
|
case "ImportNamespaceSpecifier":
|
|
4530
4536
|
case "ImportSpecifier":
|
|
4531
|
-
case "ImportExpression":
|
|
4532
4537
|
case "MetaProperty":
|
|
4533
4538
|
case "ClassMethod":
|
|
4534
4539
|
case "ObjectPattern":
|
|
@@ -4539,6 +4544,7 @@ function isStandardized(node, opts) {
|
|
|
4539
4544
|
case "TemplateLiteral":
|
|
4540
4545
|
case "YieldExpression":
|
|
4541
4546
|
case "AwaitExpression":
|
|
4547
|
+
case "ImportExpression":
|
|
4542
4548
|
case "Import":
|
|
4543
4549
|
case "BigIntLiteral":
|
|
4544
4550
|
case "ExportNamespaceSpecifier":
|
|
@@ -4589,13 +4595,12 @@ function isExpression$1(node, opts) {
|
|
|
4589
4595
|
case "UpdateExpression":
|
|
4590
4596
|
case "ArrowFunctionExpression":
|
|
4591
4597
|
case "ClassExpression":
|
|
4592
|
-
case "ImportExpression":
|
|
4593
4598
|
case "MetaProperty":
|
|
4594
4599
|
case "TaggedTemplateExpression":
|
|
4595
4600
|
case "TemplateLiteral":
|
|
4596
4601
|
case "YieldExpression":
|
|
4597
4602
|
case "AwaitExpression":
|
|
4598
|
-
case "
|
|
4603
|
+
case "ImportExpression":
|
|
4599
4604
|
case "BigIntLiteral":
|
|
4600
4605
|
case "OptionalMemberExpression":
|
|
4601
4606
|
case "OptionalCallExpression":
|
|
@@ -5158,6 +5163,7 @@ function isFlow(node, opts) {
|
|
|
5158
5163
|
case "EmptyTypeAnnotation":
|
|
5159
5164
|
case "NullableTypeAnnotation":
|
|
5160
5165
|
case "NumberLiteralTypeAnnotation":
|
|
5166
|
+
case "BigIntLiteralTypeAnnotation":
|
|
5161
5167
|
case "NumberTypeAnnotation":
|
|
5162
5168
|
case "ObjectTypeAnnotation":
|
|
5163
5169
|
case "ObjectTypeInternalSlot":
|
|
@@ -5214,6 +5220,7 @@ function isFlowType(node, opts) {
|
|
|
5214
5220
|
case "EmptyTypeAnnotation":
|
|
5215
5221
|
case "NullableTypeAnnotation":
|
|
5216
5222
|
case "NumberLiteralTypeAnnotation":
|
|
5223
|
+
case "BigIntLiteralTypeAnnotation":
|
|
5217
5224
|
case "NumberTypeAnnotation":
|
|
5218
5225
|
case "ObjectTypeAnnotation":
|
|
5219
5226
|
case "StringLiteralTypeAnnotation":
|
|
@@ -5950,6 +5957,18 @@ const classMethodOrPropertyUnionShapeCommon = (allowPrivateName = false) => ({ u
|
|
|
5950
5957
|
properties: { key: { validate: allowPrivateName ? assertNodeType("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "PrivateName") : assertNodeType("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral") } }
|
|
5951
5958
|
}]
|
|
5952
5959
|
} });
|
|
5960
|
+
const memberExpressionUnionShapeCommon = { unionShape: {
|
|
5961
|
+
discriminator: "computed",
|
|
5962
|
+
shapes: [{
|
|
5963
|
+
name: "computed",
|
|
5964
|
+
value: [true],
|
|
5965
|
+
properties: { property: { validate: assertNodeType("Expression") } }
|
|
5966
|
+
}, {
|
|
5967
|
+
name: "nonComputed",
|
|
5968
|
+
value: [false],
|
|
5969
|
+
properties: { property: { validate: assertNodeType("Identifier", "PrivateName") } }
|
|
5970
|
+
}]
|
|
5971
|
+
} };
|
|
5953
5972
|
const defineType$4 = defineAliasedType("Standardized");
|
|
5954
5973
|
defineType$4("ArrayExpression", {
|
|
5955
5974
|
fields: { elements: {
|
|
@@ -5996,6 +6015,18 @@ defineType$4("BinaryExpression", {
|
|
|
5996
6015
|
}() },
|
|
5997
6016
|
right: { validate: assertNodeType("Expression") }
|
|
5998
6017
|
},
|
|
6018
|
+
unionShape: {
|
|
6019
|
+
discriminator: "operator",
|
|
6020
|
+
shapes: [{
|
|
6021
|
+
name: "in",
|
|
6022
|
+
value: ["in"],
|
|
6023
|
+
properties: { left: { validate: assertNodeType("Expression", "PrivateName") } }
|
|
6024
|
+
}, {
|
|
6025
|
+
name: "notIn",
|
|
6026
|
+
value: BINARY_OPERATORS.filter((op) => op !== "in"),
|
|
6027
|
+
properties: { left: { validate: assertNodeType("Expression") } }
|
|
6028
|
+
}]
|
|
6029
|
+
},
|
|
5999
6030
|
visitor: ["left", "right"],
|
|
6000
6031
|
aliases: ["Binary", "Expression"]
|
|
6001
6032
|
});
|
|
@@ -6049,7 +6080,7 @@ defineType$4("CallExpression", {
|
|
|
6049
6080
|
builder: ["callee", "arguments"],
|
|
6050
6081
|
aliases: ["Expression"],
|
|
6051
6082
|
fields: {
|
|
6052
|
-
callee: { validate: assertNodeType("Expression", "Super", "V8IntrinsicIdentifier") },
|
|
6083
|
+
callee: { validate: assertNodeType("Expression", "Super", "Import", "V8IntrinsicIdentifier") },
|
|
6053
6084
|
arguments: validateArrayOfType("Expression", "SpreadElement", "ArgumentPlaceholder"),
|
|
6054
6085
|
typeArguments: {
|
|
6055
6086
|
validate: assertNodeType("TypeParameterInstantiation", "TSTypeParameterInstantiation"),
|
|
@@ -6231,7 +6262,7 @@ defineType$4("FunctionDeclaration", {
|
|
|
6231
6262
|
...functionTypeAnnotationCommon(),
|
|
6232
6263
|
body: { validate: assertNodeType("BlockStatement") },
|
|
6233
6264
|
predicate: {
|
|
6234
|
-
validate: assertNodeType("
|
|
6265
|
+
validate: assertNodeType("FlowPredicate"),
|
|
6235
6266
|
optional: true
|
|
6236
6267
|
}
|
|
6237
6268
|
},
|
|
@@ -6270,7 +6301,7 @@ defineType$4("FunctionExpression", {
|
|
|
6270
6301
|
},
|
|
6271
6302
|
body: { validate: assertNodeType("BlockStatement") },
|
|
6272
6303
|
predicate: {
|
|
6273
|
-
validate: assertNodeType("
|
|
6304
|
+
validate: assertNodeType("FlowPredicate"),
|
|
6274
6305
|
optional: true
|
|
6275
6306
|
}
|
|
6276
6307
|
}
|
|
@@ -6429,8 +6460,7 @@ defineType$4("MemberExpression", {
|
|
|
6429
6460
|
builder: [
|
|
6430
6461
|
"object",
|
|
6431
6462
|
"property",
|
|
6432
|
-
"computed"
|
|
6433
|
-
...[]
|
|
6463
|
+
"computed"
|
|
6434
6464
|
],
|
|
6435
6465
|
visitor: ["object", "property"],
|
|
6436
6466
|
aliases: [
|
|
@@ -6438,18 +6468,7 @@ defineType$4("MemberExpression", {
|
|
|
6438
6468
|
"LVal",
|
|
6439
6469
|
"PatternLike"
|
|
6440
6470
|
],
|
|
6441
|
-
|
|
6442
|
-
discriminator: "computed",
|
|
6443
|
-
shapes: [{
|
|
6444
|
-
name: "computed",
|
|
6445
|
-
value: [true],
|
|
6446
|
-
properties: { property: { validate: assertNodeType("Expression") } }
|
|
6447
|
-
}, {
|
|
6448
|
-
name: "nonComputed",
|
|
6449
|
-
value: [false],
|
|
6450
|
-
properties: { property: { validate: assertNodeType("Identifier", "PrivateName") } }
|
|
6451
|
-
}]
|
|
6452
|
-
},
|
|
6471
|
+
...memberExpressionUnionShapeCommon,
|
|
6453
6472
|
fields: {
|
|
6454
6473
|
object: { validate: assertNodeType("Expression", "Super") },
|
|
6455
6474
|
property: { validate: function() {
|
|
@@ -6564,21 +6583,9 @@ defineType$4("ObjectProperty", {
|
|
|
6564
6583
|
"key",
|
|
6565
6584
|
"value",
|
|
6566
6585
|
"computed",
|
|
6567
|
-
"shorthand"
|
|
6568
|
-
...[]
|
|
6586
|
+
"shorthand"
|
|
6569
6587
|
],
|
|
6570
|
-
|
|
6571
|
-
discriminator: "computed",
|
|
6572
|
-
shapes: [{
|
|
6573
|
-
name: "computed",
|
|
6574
|
-
value: [true],
|
|
6575
|
-
properties: { key: { validate: assertNodeType("Expression") } }
|
|
6576
|
-
}, {
|
|
6577
|
-
name: "nonComputed",
|
|
6578
|
-
value: [false],
|
|
6579
|
-
properties: { key: { validate: assertNodeType("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "PrivateName") } }
|
|
6580
|
-
}]
|
|
6581
|
-
},
|
|
6588
|
+
...classMethodOrPropertyUnionShapeCommon(true),
|
|
6582
6589
|
fields: {
|
|
6583
6590
|
computed: { default: false },
|
|
6584
6591
|
key: { validate: function() {
|
|
@@ -6880,7 +6887,7 @@ defineType$4("ArrowFunctionExpression", {
|
|
|
6880
6887
|
expression: { validate: assertValueType("boolean") },
|
|
6881
6888
|
body: { validate: assertNodeType("BlockStatement", "Expression") },
|
|
6882
6889
|
predicate: {
|
|
6883
|
-
validate: assertNodeType("
|
|
6890
|
+
validate: assertNodeType("FlowPredicate"),
|
|
6884
6891
|
optional: true
|
|
6885
6892
|
}
|
|
6886
6893
|
}
|
|
@@ -7024,7 +7031,7 @@ defineType$4("ExportDefaultDeclaration", {
|
|
|
7024
7031
|
"ExportDeclaration"
|
|
7025
7032
|
],
|
|
7026
7033
|
fields: {
|
|
7027
|
-
declaration: validateType("
|
|
7034
|
+
declaration: validateType("FunctionDeclaration", "ClassDeclaration", "Expression", "TSDeclareFunction", "TSInterfaceDeclaration", "EnumDeclaration"),
|
|
7028
7035
|
exportKind: validateOptional(assertOneOf("value"))
|
|
7029
7036
|
}
|
|
7030
7037
|
});
|
|
@@ -7053,7 +7060,21 @@ defineType$4("ExportNamedDeclaration", {
|
|
|
7053
7060
|
validate: chain(assertNodeType("Declaration"), Object.assign(function(node, key, val) {
|
|
7054
7061
|
if (val && node.specifiers.length) throw new TypeError("Only declaration or specifiers is allowed on ExportNamedDeclaration");
|
|
7055
7062
|
if (val && node.source) throw new TypeError("Cannot export a declaration from a source");
|
|
7056
|
-
}, { oneOfNodeTypes: [
|
|
7063
|
+
}, { oneOfNodeTypes: [
|
|
7064
|
+
"VariableDeclaration",
|
|
7065
|
+
"FunctionDeclaration",
|
|
7066
|
+
"ClassDeclaration",
|
|
7067
|
+
"TSDeclareFunction",
|
|
7068
|
+
"TSEnumDeclaration",
|
|
7069
|
+
"TSImportEqualsDeclaration",
|
|
7070
|
+
"TSInterfaceDeclaration",
|
|
7071
|
+
"TSModuleDeclaration",
|
|
7072
|
+
"TSTypeAliasDeclaration",
|
|
7073
|
+
"EnumDeclaration",
|
|
7074
|
+
"InterfaceDeclaration",
|
|
7075
|
+
"OpaqueType",
|
|
7076
|
+
"TypeAlias"
|
|
7077
|
+
] }))
|
|
7057
7078
|
},
|
|
7058
7079
|
...importAttributes,
|
|
7059
7080
|
specifiers: {
|
|
@@ -7190,21 +7211,6 @@ defineType$4("ImportSpecifier", {
|
|
|
7190
7211
|
}
|
|
7191
7212
|
}
|
|
7192
7213
|
});
|
|
7193
|
-
defineType$4("ImportExpression", {
|
|
7194
|
-
visitor: ["source", "options"],
|
|
7195
|
-
aliases: ["Expression"],
|
|
7196
|
-
fields: {
|
|
7197
|
-
phase: {
|
|
7198
|
-
default: null,
|
|
7199
|
-
validate: assertOneOf("source", "defer")
|
|
7200
|
-
},
|
|
7201
|
-
source: { validate: assertNodeType("Expression") },
|
|
7202
|
-
options: {
|
|
7203
|
-
validate: assertNodeType("Expression"),
|
|
7204
|
-
optional: true
|
|
7205
|
-
}
|
|
7206
|
-
}
|
|
7207
|
-
});
|
|
7208
7214
|
defineType$4("MetaProperty", {
|
|
7209
7215
|
visitor: ["meta", "property"],
|
|
7210
7216
|
aliases: ["Expression"],
|
|
@@ -7256,7 +7262,7 @@ const classMethodOrPropertyCommon = () => ({
|
|
|
7256
7262
|
};
|
|
7257
7263
|
}(), assertNodeType("Identifier", "StringLiteral", "NumericLiteral", "BigIntLiteral", "Expression")) }
|
|
7258
7264
|
});
|
|
7259
|
-
const classMethodOrDeclareMethodCommon = () => ({
|
|
7265
|
+
const classMethodOrDeclareMethodCommon = (allowDecorators = true) => ({
|
|
7260
7266
|
...functionCommon(),
|
|
7261
7267
|
...classMethodOrPropertyCommon(),
|
|
7262
7268
|
params: validateArrayOfType("FunctionParameter", "TSParameterProperty"),
|
|
@@ -7268,10 +7274,10 @@ const classMethodOrDeclareMethodCommon = () => ({
|
|
|
7268
7274
|
validate: chain(assertValueType("string"), assertOneOf("public", "private", "protected")),
|
|
7269
7275
|
optional: true
|
|
7270
7276
|
},
|
|
7271
|
-
decorators: {
|
|
7277
|
+
...allowDecorators ? { decorators: {
|
|
7272
7278
|
validate: arrayOfType("Decorator"),
|
|
7273
7279
|
optional: true
|
|
7274
|
-
}
|
|
7280
|
+
} } : {}
|
|
7275
7281
|
});
|
|
7276
7282
|
defineType$4("ClassMethod", {
|
|
7277
7283
|
aliases: [
|
|
@@ -7330,7 +7336,7 @@ defineType$4("SpreadElement", {
|
|
|
7330
7336
|
deprecatedAlias: "SpreadProperty",
|
|
7331
7337
|
fields: { argument: { validate: assertNodeType("Expression") } }
|
|
7332
7338
|
});
|
|
7333
|
-
defineType$4("Super"
|
|
7339
|
+
defineType$4("Super");
|
|
7334
7340
|
defineType$4("TaggedTemplateExpression", {
|
|
7335
7341
|
visitor: [
|
|
7336
7342
|
"tag",
|
|
@@ -7413,7 +7419,22 @@ defineType$4("AwaitExpression", {
|
|
|
7413
7419
|
aliases: ["Expression", "Terminatorless"],
|
|
7414
7420
|
fields: { argument: { validate: assertNodeType("Expression") } }
|
|
7415
7421
|
});
|
|
7416
|
-
defineType$4("
|
|
7422
|
+
defineType$4("ImportExpression", {
|
|
7423
|
+
visitor: ["source", "options"],
|
|
7424
|
+
aliases: ["Expression"],
|
|
7425
|
+
fields: {
|
|
7426
|
+
phase: {
|
|
7427
|
+
default: null,
|
|
7428
|
+
validate: assertOneOf("source", "defer")
|
|
7429
|
+
},
|
|
7430
|
+
source: { validate: assertNodeType("Expression") },
|
|
7431
|
+
options: {
|
|
7432
|
+
validate: assertNodeType("Expression"),
|
|
7433
|
+
optional: true
|
|
7434
|
+
}
|
|
7435
|
+
}
|
|
7436
|
+
});
|
|
7437
|
+
defineType$4("Import");
|
|
7417
7438
|
defineType$4("BigIntLiteral", {
|
|
7418
7439
|
builder: ["value"],
|
|
7419
7440
|
fields: { value: { validate: assertValueType("bigint") } },
|
|
@@ -7427,7 +7448,7 @@ defineType$4("BigIntLiteral", {
|
|
|
7427
7448
|
defineType$4("ExportNamespaceSpecifier", {
|
|
7428
7449
|
visitor: ["exported"],
|
|
7429
7450
|
aliases: ["ModuleSpecifier"],
|
|
7430
|
-
fields: { exported: { validate: assertNodeType("Identifier") } }
|
|
7451
|
+
fields: { exported: { validate: assertNodeType("Identifier", "StringLiteral") } }
|
|
7431
7452
|
});
|
|
7432
7453
|
defineType$4("OptionalMemberExpression", {
|
|
7433
7454
|
builder: [
|
|
@@ -7438,14 +7459,15 @@ defineType$4("OptionalMemberExpression", {
|
|
|
7438
7459
|
],
|
|
7439
7460
|
visitor: ["object", "property"],
|
|
7440
7461
|
aliases: ["Expression"],
|
|
7462
|
+
...memberExpressionUnionShapeCommon,
|
|
7441
7463
|
fields: {
|
|
7442
7464
|
object: { validate: assertNodeType("Expression") },
|
|
7443
7465
|
property: { validate: function() {
|
|
7444
|
-
const normal = assertNodeType("Identifier");
|
|
7466
|
+
const normal = assertNodeType("Identifier", "PrivateName");
|
|
7445
7467
|
const computed = assertNodeType("Expression");
|
|
7446
7468
|
return Object.assign(function(node, key, val) {
|
|
7447
7469
|
(node.computed ? computed : normal)(node, key, val);
|
|
7448
|
-
}, { oneOfNodeTypes: ["Expression", "
|
|
7470
|
+
}, { oneOfNodeTypes: ["Expression", "PrivateName"] });
|
|
7449
7471
|
}() },
|
|
7450
7472
|
computed: { default: false },
|
|
7451
7473
|
optional: { validate: chain(assertValueType("boolean"), assertOptionalChainStart()) }
|
|
@@ -7695,7 +7717,7 @@ defineType$3("DeclareFunction", {
|
|
|
7695
7717
|
],
|
|
7696
7718
|
fields: {
|
|
7697
7719
|
id: validateType("Identifier"),
|
|
7698
|
-
predicate: validateOptionalType("
|
|
7720
|
+
predicate: validateOptionalType("FlowPredicate")
|
|
7699
7721
|
}
|
|
7700
7722
|
});
|
|
7701
7723
|
defineInterfaceishType("DeclareInterface");
|
|
@@ -7806,7 +7828,7 @@ defineType$3("DeclareExportAllDeclaration", {
|
|
|
7806
7828
|
defineType$3("DeclaredPredicate", {
|
|
7807
7829
|
visitor: ["value"],
|
|
7808
7830
|
aliases: ["FlowPredicate"],
|
|
7809
|
-
fields: { value: validateType("
|
|
7831
|
+
fields: { value: validateType("Expression") }
|
|
7810
7832
|
});
|
|
7811
7833
|
defineType$3("ExistsTypeAnnotation", { aliases: ["FlowType"] });
|
|
7812
7834
|
defineType$3("FunctionTypeAnnotation", {
|
|
@@ -7882,6 +7904,11 @@ defineType$3("NumberLiteralTypeAnnotation", {
|
|
|
7882
7904
|
aliases: ["FlowType"],
|
|
7883
7905
|
fields: { value: validate$2(assertValueType("number")) }
|
|
7884
7906
|
});
|
|
7907
|
+
defineType$3("BigIntLiteralTypeAnnotation", {
|
|
7908
|
+
builder: ["value"],
|
|
7909
|
+
aliases: ["FlowType"],
|
|
7910
|
+
fields: { value: validate$2(assertValueType("bigint")) }
|
|
7911
|
+
});
|
|
7885
7912
|
defineType$3("NumberTypeAnnotation", { aliases: ["FlowType", "FlowBaseAnnotation"] });
|
|
7886
7913
|
defineType$3("ObjectTypeAnnotation", {
|
|
7887
7914
|
visitor: [
|
|
@@ -7978,7 +8005,7 @@ defineType$3("ObjectTypeProperty", {
|
|
|
7978
8005
|
],
|
|
7979
8006
|
aliases: ["UserWhitespacable"],
|
|
7980
8007
|
fields: {
|
|
7981
|
-
key: validateType("Identifier", "StringLiteral"),
|
|
8008
|
+
key: validateType("Identifier", "StringLiteral", "NumericLiteral"),
|
|
7982
8009
|
value: validateType("FlowType"),
|
|
7983
8010
|
kind: {
|
|
7984
8011
|
validate: assertOneOf("init", "get", "set"),
|
|
@@ -8360,7 +8387,7 @@ defineType$5("BindExpression", {
|
|
|
8360
8387
|
visitor: ["object", "callee"],
|
|
8361
8388
|
aliases: ["Expression"],
|
|
8362
8389
|
fields: {
|
|
8363
|
-
object: { validate:
|
|
8390
|
+
object: { validate: assertNodeOrValueType("null", "Expression") },
|
|
8364
8391
|
callee: { validate: assertNodeType("Expression") }
|
|
8365
8392
|
}
|
|
8366
8393
|
});
|
|
@@ -8502,7 +8529,6 @@ defineType("TSDeclareFunction", {
|
|
|
8502
8529
|
});
|
|
8503
8530
|
defineType("TSDeclareMethod", {
|
|
8504
8531
|
visitor: [
|
|
8505
|
-
"decorators",
|
|
8506
8532
|
"key",
|
|
8507
8533
|
"typeParameters",
|
|
8508
8534
|
"params",
|
|
@@ -8510,7 +8536,7 @@ defineType("TSDeclareMethod", {
|
|
|
8510
8536
|
],
|
|
8511
8537
|
...classMethodOrPropertyUnionShapeCommon(),
|
|
8512
8538
|
fields: {
|
|
8513
|
-
...classMethodOrDeclareMethodCommon(),
|
|
8539
|
+
...classMethodOrDeclareMethodCommon(false),
|
|
8514
8540
|
...tSFunctionTypeAnnotationCommon()
|
|
8515
8541
|
}
|
|
8516
8542
|
});
|
|
@@ -8834,7 +8860,7 @@ defineType("TSInterfaceDeclaration", {
|
|
|
8834
8860
|
declare: validateOptional(bool),
|
|
8835
8861
|
id: validateType("Identifier"),
|
|
8836
8862
|
typeParameters: validateOptionalType("TSTypeParameterDeclaration"),
|
|
8837
|
-
extends: validateOptional(arrayOfType("
|
|
8863
|
+
extends: validateOptional(arrayOfType("TSInterfaceHeritage")),
|
|
8838
8864
|
body: validateType("TSInterfaceBody")
|
|
8839
8865
|
}
|
|
8840
8866
|
});
|
|
@@ -8916,7 +8942,7 @@ defineType("TSModuleDeclaration", {
|
|
|
8916
8942
|
visitor: ["id", "body"],
|
|
8917
8943
|
fields: {
|
|
8918
8944
|
kind: {
|
|
8919
|
-
validate: assertOneOf("global", "namespace"),
|
|
8945
|
+
validate: assertOneOf("global", "namespace", "module"),
|
|
8920
8946
|
default: "namespace"
|
|
8921
8947
|
},
|
|
8922
8948
|
declare: validateOptional(bool),
|
|
@@ -9814,17 +9840,6 @@ function importSpecifier(local, imported) {
|
|
|
9814
9840
|
validate(defs.imported, node, "imported", imported, 1);
|
|
9815
9841
|
return node;
|
|
9816
9842
|
}
|
|
9817
|
-
function importExpression(source, options = null) {
|
|
9818
|
-
const node = {
|
|
9819
|
-
type: "ImportExpression",
|
|
9820
|
-
source,
|
|
9821
|
-
options
|
|
9822
|
-
};
|
|
9823
|
-
const defs = NODE_FIELDS.ImportExpression;
|
|
9824
|
-
validate(defs.source, node, "source", source, 1);
|
|
9825
|
-
validate(defs.options, node, "options", options, 1);
|
|
9826
|
-
return node;
|
|
9827
|
-
}
|
|
9828
9843
|
function metaProperty(meta, property) {
|
|
9829
9844
|
const node = {
|
|
9830
9845
|
type: "MetaProperty",
|
|
@@ -9933,6 +9948,17 @@ function awaitExpression(argument) {
|
|
|
9933
9948
|
validate(defs.argument, node, "argument", argument, 1);
|
|
9934
9949
|
return node;
|
|
9935
9950
|
}
|
|
9951
|
+
function importExpression(source, options = null) {
|
|
9952
|
+
const node = {
|
|
9953
|
+
type: "ImportExpression",
|
|
9954
|
+
source,
|
|
9955
|
+
options
|
|
9956
|
+
};
|
|
9957
|
+
const defs = NODE_FIELDS.ImportExpression;
|
|
9958
|
+
validate(defs.source, node, "source", source, 1);
|
|
9959
|
+
validate(defs.options, node, "options", options, 1);
|
|
9960
|
+
return node;
|
|
9961
|
+
}
|
|
9936
9962
|
function _import() {
|
|
9937
9963
|
return { type: "Import" };
|
|
9938
9964
|
}
|
|
@@ -10347,6 +10373,15 @@ function numberLiteralTypeAnnotation(value) {
|
|
|
10347
10373
|
validate(defs.value, node, "value", value);
|
|
10348
10374
|
return node;
|
|
10349
10375
|
}
|
|
10376
|
+
function bigIntLiteralTypeAnnotation(value) {
|
|
10377
|
+
const node = {
|
|
10378
|
+
type: "BigIntLiteralTypeAnnotation",
|
|
10379
|
+
value
|
|
10380
|
+
};
|
|
10381
|
+
const defs = NODE_FIELDS.BigIntLiteralTypeAnnotation;
|
|
10382
|
+
validate(defs.value, node, "value", value);
|
|
10383
|
+
return node;
|
|
10384
|
+
}
|
|
10350
10385
|
function numberTypeAnnotation() {
|
|
10351
10386
|
return { type: "NumberTypeAnnotation" };
|
|
10352
10387
|
}
|
|
@@ -10963,10 +10998,9 @@ function tsDeclareFunction(id = null, typeParameters = null, params, returnType
|
|
|
10963
10998
|
validate(defs.returnType, node, "returnType", returnType, 1);
|
|
10964
10999
|
return node;
|
|
10965
11000
|
}
|
|
10966
|
-
function tsDeclareMethod(
|
|
11001
|
+
function tsDeclareMethod(key, typeParameters = null, params, returnType = null) {
|
|
10967
11002
|
const node = {
|
|
10968
11003
|
type: "TSDeclareMethod",
|
|
10969
|
-
decorators,
|
|
10970
11004
|
key,
|
|
10971
11005
|
typeParameters,
|
|
10972
11006
|
params,
|
|
@@ -10978,7 +11012,6 @@ function tsDeclareMethod(decorators = null, key, typeParameters = null, params,
|
|
|
10978
11012
|
static: false
|
|
10979
11013
|
};
|
|
10980
11014
|
const defs = NODE_FIELDS.TSDeclareMethod;
|
|
10981
|
-
validate(defs.decorators, node, "decorators", decorators, 1);
|
|
10982
11015
|
validate(defs.key, node, "key", key, 1);
|
|
10983
11016
|
validate(defs.typeParameters, node, "typeParameters", typeParameters, 1);
|
|
10984
11017
|
validate(defs.params, node, "params", params, 1);
|
|
@@ -11614,6 +11647,7 @@ var b = /* @__PURE__ */ Object.freeze({
|
|
|
11614
11647
|
assignmentPattern,
|
|
11615
11648
|
awaitExpression,
|
|
11616
11649
|
bigIntLiteral,
|
|
11650
|
+
bigIntLiteralTypeAnnotation,
|
|
11617
11651
|
binaryExpression,
|
|
11618
11652
|
bindExpression,
|
|
11619
11653
|
blockStatement,
|
|
@@ -11862,7 +11896,7 @@ function alias(lowercase) {
|
|
|
11862
11896
|
return b[lowercase](...arguments);
|
|
11863
11897
|
};
|
|
11864
11898
|
}
|
|
11865
|
-
const ArrayExpression$1 = alias("arrayExpression"), AssignmentExpression$2 = alias("assignmentExpression"), BinaryExpression$2 = alias("binaryExpression"), InterpreterDirective$1 = alias("interpreterDirective"), Directive$1 = alias("directive"), DirectiveLiteral$1 = alias("directiveLiteral"), BlockStatement$1 = alias("blockStatement"), BreakStatement$1 = alias("breakStatement"), CallExpression$1 = alias("callExpression"), CatchClause$1 = alias("catchClause"), ConditionalExpression$2 = alias("conditionalExpression"), ContinueStatement$1 = alias("continueStatement"), DebuggerStatement$1 = alias("debuggerStatement"), DoWhileStatement$1 = alias("doWhileStatement"), EmptyStatement$1 = alias("emptyStatement"), ExpressionStatement$1 = alias("expressionStatement"), File$1 = alias("file"), ForInStatement$1 = alias("forInStatement"), ForStatement$1 = alias("forStatement"), FunctionDeclaration = alias("functionDeclaration"), FunctionExpression$2 = alias("functionExpression"), Identifier$2 = alias("identifier"), IfStatement$1 = alias("ifStatement"), LabeledStatement$1 = alias("labeledStatement"), StringLiteral$1 = alias("stringLiteral"), NumericLiteral$1 = alias("numericLiteral"), NullLiteral$1 = alias("nullLiteral"), BooleanLiteral$1 = alias("booleanLiteral"), RegExpLiteral$1 = alias("regExpLiteral"), LogicalExpression$1 = alias("logicalExpression"), MemberExpression$1 = alias("memberExpression"), NewExpression$1 = alias("newExpression"), Program$1 = alias("program"), ObjectExpression$2 = alias("objectExpression"), ObjectMethod$1 = alias("objectMethod"), ObjectProperty$1 = alias("objectProperty"), RestElement$1 = alias("restElement"), ReturnStatement$1 = alias("returnStatement"), SequenceExpression$2 = alias("sequenceExpression"), ParenthesizedExpression$1 = alias("parenthesizedExpression"), SwitchCase$1 = alias("switchCase"), SwitchStatement$1 = alias("switchStatement"), ThisExpression$1 = alias("thisExpression"), ThrowStatement$1 = alias("throwStatement"), TryStatement$1 = alias("tryStatement"), UnaryExpression$1 = alias("unaryExpression"), UpdateExpression$2 = alias("updateExpression"), VariableDeclaration$1 = alias("variableDeclaration"), VariableDeclarator$1 = alias("variableDeclarator"), WhileStatement$1 = alias("whileStatement"), WithStatement$1 = alias("withStatement"), AssignmentPattern$1 = alias("assignmentPattern"), ArrayPattern = alias("arrayPattern"), ArrowFunctionExpression$1 = alias("arrowFunctionExpression"), ClassBody$1 = alias("classBody"), ClassExpression$1 = alias("classExpression"), ClassDeclaration$1 = alias("classDeclaration"), ExportAllDeclaration$1 = alias("exportAllDeclaration"), ExportDefaultDeclaration$1 = alias("exportDefaultDeclaration"), ExportNamedDeclaration$1 = alias("exportNamedDeclaration"), ExportSpecifier$1 = alias("exportSpecifier"), ForOfStatement$1 = alias("forOfStatement"), ImportDeclaration$1 = alias("importDeclaration"), ImportDefaultSpecifier$1 = alias("importDefaultSpecifier"), ImportNamespaceSpecifier$1 = alias("importNamespaceSpecifier"), ImportSpecifier$1 = alias("importSpecifier"), ImportExpression$1 = alias("importExpression"), MetaProperty$1 = alias("metaProperty"), ClassMethod$1 = alias("classMethod"), ObjectPattern = alias("objectPattern"), SpreadElement = alias("spreadElement"), Super$1 = alias("super"), TaggedTemplateExpression$1 = alias("taggedTemplateExpression"), TemplateElement$1 = alias("templateElement"), TemplateLiteral$1 = alias("templateLiteral"), YieldExpression$2 = alias("yieldExpression"), AwaitExpression$1 = alias("awaitExpression"), Import$1 = alias("import"), BigIntLiteral$1 = alias("bigIntLiteral"), ExportNamespaceSpecifier$1 = alias("exportNamespaceSpecifier"), OptionalMemberExpression$2 = alias("optionalMemberExpression"), OptionalCallExpression$1 = alias("optionalCallExpression"), ClassProperty$1 = alias("classProperty"), ClassPrivateProperty$1 = alias("classPrivateProperty"), ClassPrivateMethod$1 = alias("classPrivateMethod"), PrivateName$1 = alias("privateName"), StaticBlock$1 = alias("staticBlock"), ImportAttribute$1 = alias("importAttribute"), AnyTypeAnnotation$1 = alias("anyTypeAnnotation"), ArrayTypeAnnotation$1 = alias("arrayTypeAnnotation"), BooleanTypeAnnotation$1 = alias("booleanTypeAnnotation"), BooleanLiteralTypeAnnotation$1 = alias("booleanLiteralTypeAnnotation"), NullLiteralTypeAnnotation$1 = alias("nullLiteralTypeAnnotation"), ClassImplements = alias("classImplements"), DeclareClass$1 = alias("declareClass"), DeclareFunction$1 = alias("declareFunction"), DeclareInterface$1 = alias("declareInterface"), DeclareModule$1 = alias("declareModule"), DeclareModuleExports$1 = alias("declareModuleExports"), DeclareTypeAlias$1 = alias("declareTypeAlias"), DeclareOpaqueType$1 = alias("declareOpaqueType"), DeclareVariable$1 = alias("declareVariable"), DeclareExportDeclaration$1 = alias("declareExportDeclaration"), DeclareExportAllDeclaration$1 = alias("declareExportAllDeclaration"), DeclaredPredicate$1 = alias("declaredPredicate"), ExistsTypeAnnotation$1 = alias("existsTypeAnnotation"), FunctionTypeAnnotation$2 = alias("functionTypeAnnotation"), FunctionTypeParam$1 = alias("functionTypeParam"), GenericTypeAnnotation = alias("genericTypeAnnotation"), InferredPredicate$1 = alias("inferredPredicate"), InterfaceExtends$1 = alias("interfaceExtends"), InterfaceDeclaration$1 = alias("interfaceDeclaration"), InterfaceTypeAnnotation$1 = alias("interfaceTypeAnnotation"), IntersectionTypeAnnotation$1 = alias("intersectionTypeAnnotation"), MixedTypeAnnotation$1 = alias("mixedTypeAnnotation"), EmptyTypeAnnotation$1 = alias("emptyTypeAnnotation"), NullableTypeAnnotation$2 = alias("nullableTypeAnnotation"), NumberLiteralTypeAnnotation = alias("numberLiteralTypeAnnotation"), NumberTypeAnnotation$1 = alias("numberTypeAnnotation"), ObjectTypeAnnotation$1 = alias("objectTypeAnnotation"), ObjectTypeInternalSlot$1 = alias("objectTypeInternalSlot"), ObjectTypeCallProperty$1 = alias("objectTypeCallProperty"), ObjectTypeIndexer$1 = alias("objectTypeIndexer"), ObjectTypeProperty$1 = alias("objectTypeProperty"), ObjectTypeSpreadProperty$1 = alias("objectTypeSpreadProperty"), OpaqueType$1 = alias("opaqueType"), QualifiedTypeIdentifier$1 = alias("qualifiedTypeIdentifier"), StringLiteralTypeAnnotation = alias("stringLiteralTypeAnnotation"), StringTypeAnnotation$1 = alias("stringTypeAnnotation"), SymbolTypeAnnotation$1 = alias("symbolTypeAnnotation"), ThisTypeAnnotation$1 = alias("thisTypeAnnotation"), TupleTypeAnnotation$1 = alias("tupleTypeAnnotation"), TypeofTypeAnnotation$1 = alias("typeofTypeAnnotation"), TypeAlias$1 = alias("typeAlias"), TypeAnnotation$1 = alias("typeAnnotation"), TypeCastExpression$1 = alias("typeCastExpression"), TypeParameter$1 = alias("typeParameter"), TypeParameterDeclaration = alias("typeParameterDeclaration"), TypeParameterInstantiation$1 = alias("typeParameterInstantiation"), UnionTypeAnnotation$2 = alias("unionTypeAnnotation"), Variance$1 = alias("variance"), VoidTypeAnnotation$1 = alias("voidTypeAnnotation"), EnumDeclaration$1 = alias("enumDeclaration"), EnumBooleanBody$1 = alias("enumBooleanBody"), EnumNumberBody$1 = alias("enumNumberBody"), EnumStringBody$1 = alias("enumStringBody"), EnumSymbolBody$1 = alias("enumSymbolBody"), EnumBooleanMember$1 = alias("enumBooleanMember"), EnumNumberMember$1 = alias("enumNumberMember"), EnumStringMember$1 = alias("enumStringMember"), EnumDefaultedMember$1 = alias("enumDefaultedMember"), IndexedAccessType$1 = alias("indexedAccessType"), OptionalIndexedAccessType$2 = alias("optionalIndexedAccessType"), JSXAttribute$1 = alias("jsxAttribute"), JSXClosingElement$1 = alias("jsxClosingElement"), JSXElement$1 = alias("jsxElement"), JSXEmptyExpression$1 = alias("jsxEmptyExpression"), JSXExpressionContainer$1 = alias("jsxExpressionContainer"), JSXSpreadChild$1 = alias("jsxSpreadChild"), JSXIdentifier$1 = alias("jsxIdentifier"), JSXMemberExpression$1 = alias("jsxMemberExpression"), JSXNamespacedName$1 = alias("jsxNamespacedName"), JSXOpeningElement$1 = alias("jsxOpeningElement"), JSXSpreadAttribute$1 = alias("jsxSpreadAttribute"), JSXText$1 = alias("jsxText"), JSXFragment$1 = alias("jsxFragment"), JSXOpeningFragment$1 = alias("jsxOpeningFragment"), JSXClosingFragment$1 = alias("jsxClosingFragment"), Placeholder$1 = alias("placeholder"), V8IntrinsicIdentifier$1 = alias("v8IntrinsicIdentifier"), ArgumentPlaceholder$1 = alias("argumentPlaceholder"), BindExpression$1 = alias("bindExpression"), ClassAccessorProperty$1 = alias("classAccessorProperty"), Decorator$1 = alias("decorator"), DoExpression$2 = alias("doExpression"), ExportDefaultSpecifier$1 = alias("exportDefaultSpecifier"), ModuleExpression$1 = alias("moduleExpression"), TopicReference$1 = alias("topicReference"), VoidPattern$1 = alias("voidPattern"), TSParameterProperty$1 = alias("tsParameterProperty"), TSDeclareFunction$1 = alias("tsDeclareFunction"), TSDeclareMethod$1 = alias("tsDeclareMethod"), TSQualifiedName$1 = alias("tsQualifiedName"), TSCallSignatureDeclaration$1 = alias("tsCallSignatureDeclaration"), TSConstructSignatureDeclaration$1 = alias("tsConstructSignatureDeclaration"), TSPropertySignature$1 = alias("tsPropertySignature"), TSMethodSignature$1 = alias("tsMethodSignature"), TSIndexSignature$1 = alias("tsIndexSignature"), TSAnyKeyword$1 = alias("tsAnyKeyword"), TSBooleanKeyword$1 = alias("tsBooleanKeyword"), TSBigIntKeyword$1 = alias("tsBigIntKeyword"), TSIntrinsicKeyword$1 = alias("tsIntrinsicKeyword"), TSNeverKeyword$1 = alias("tsNeverKeyword"), TSNullKeyword$1 = alias("tsNullKeyword"), TSNumberKeyword$1 = alias("tsNumberKeyword"), TSObjectKeyword$1 = alias("tsObjectKeyword"), TSStringKeyword$1 = alias("tsStringKeyword"), TSSymbolKeyword$1 = alias("tsSymbolKeyword"), TSUndefinedKeyword$1 = alias("tsUndefinedKeyword"), TSUnknownKeyword$1 = alias("tsUnknownKeyword"), TSVoidKeyword$1 = alias("tsVoidKeyword"), TSThisType$1 = alias("tsThisType"), TSFunctionType$2 = alias("tsFunctionType"), TSConstructorType$1 = alias("tsConstructorType"), TSTypeReference$1 = alias("tsTypeReference"), TSTypePredicate$1 = alias("tsTypePredicate"), TSTypeQuery$1 = alias("tsTypeQuery"), TSTypeLiteral$1 = alias("tsTypeLiteral"), TSArrayType$1 = alias("tsArrayType"), TSTupleType$1 = alias("tsTupleType"), TSOptionalType$1 = alias("tsOptionalType"), TSRestType$1 = alias("tsRestType"), TSNamedTupleMember$1 = alias("tsNamedTupleMember"), TSUnionType$2 = alias("tsUnionType"), TSIntersectionType$2 = alias("tsIntersectionType"), TSConditionalType$2 = alias("tsConditionalType"), TSInferType$2 = alias("tsInferType"), TSParenthesizedType$1 = alias("tsParenthesizedType"), TSTypeOperator$2 = alias("tsTypeOperator"), TSIndexedAccessType$1 = alias("tsIndexedAccessType"), TSMappedType$1 = alias("tsMappedType"), TSTemplateLiteralType$1 = alias("tsTemplateLiteralType"), TSLiteralType$1 = alias("tsLiteralType"), TSClassImplements$1 = alias("tsClassImplements"), TSInterfaceHeritage = alias("tsInterfaceHeritage"), TSInterfaceDeclaration$1 = alias("tsInterfaceDeclaration"), TSInterfaceBody$1 = alias("tsInterfaceBody"), TSTypeAliasDeclaration$1 = alias("tsTypeAliasDeclaration"), TSInstantiationExpression$2 = alias("tsInstantiationExpression"), TSAsExpression$2 = alias("tsAsExpression"), TSSatisfiesExpression$1 = alias("tsSatisfiesExpression"), TSTypeAssertion$1 = alias("tsTypeAssertion"), TSEnumBody$1 = alias("tsEnumBody"), TSEnumDeclaration$1 = alias("tsEnumDeclaration"), TSEnumMember$1 = alias("tsEnumMember"), TSModuleDeclaration$1 = alias("tsModuleDeclaration"), TSModuleBlock$1 = alias("tsModuleBlock"), TSImportType$1 = alias("tsImportType"), TSImportEqualsDeclaration$1 = alias("tsImportEqualsDeclaration"), TSExternalModuleReference$1 = alias("tsExternalModuleReference"), TSNonNullExpression$1 = alias("tsNonNullExpression"), TSExportAssignment$1 = alias("tsExportAssignment"), TSNamespaceExportDeclaration$1 = alias("tsNamespaceExportDeclaration"), TSTypeAnnotation$1 = alias("tsTypeAnnotation"), TSTypeParameterInstantiation$1 = alias("tsTypeParameterInstantiation"), TSTypeParameterDeclaration = alias("tsTypeParameterDeclaration"), TSTypeParameter$1 = alias("tsTypeParameter");
|
|
11899
|
+
const ArrayExpression$1 = alias("arrayExpression"), AssignmentExpression$2 = alias("assignmentExpression"), BinaryExpression$2 = alias("binaryExpression"), InterpreterDirective$1 = alias("interpreterDirective"), Directive$1 = alias("directive"), DirectiveLiteral$1 = alias("directiveLiteral"), BlockStatement$1 = alias("blockStatement"), BreakStatement$1 = alias("breakStatement"), CallExpression$1 = alias("callExpression"), CatchClause$1 = alias("catchClause"), ConditionalExpression$2 = alias("conditionalExpression"), ContinueStatement$1 = alias("continueStatement"), DebuggerStatement$1 = alias("debuggerStatement"), DoWhileStatement$1 = alias("doWhileStatement"), EmptyStatement$1 = alias("emptyStatement"), ExpressionStatement$1 = alias("expressionStatement"), File$1 = alias("file"), ForInStatement$1 = alias("forInStatement"), ForStatement$1 = alias("forStatement"), FunctionDeclaration = alias("functionDeclaration"), FunctionExpression$2 = alias("functionExpression"), Identifier$2 = alias("identifier"), IfStatement$1 = alias("ifStatement"), LabeledStatement$1 = alias("labeledStatement"), StringLiteral$1 = alias("stringLiteral"), NumericLiteral$1 = alias("numericLiteral"), NullLiteral$1 = alias("nullLiteral"), BooleanLiteral$1 = alias("booleanLiteral"), RegExpLiteral$1 = alias("regExpLiteral"), LogicalExpression$1 = alias("logicalExpression"), MemberExpression$1 = alias("memberExpression"), NewExpression$1 = alias("newExpression"), Program$1 = alias("program"), ObjectExpression$2 = alias("objectExpression"), ObjectMethod$1 = alias("objectMethod"), ObjectProperty$1 = alias("objectProperty"), RestElement$1 = alias("restElement"), ReturnStatement$1 = alias("returnStatement"), SequenceExpression$2 = alias("sequenceExpression"), ParenthesizedExpression$1 = alias("parenthesizedExpression"), SwitchCase$1 = alias("switchCase"), SwitchStatement$1 = alias("switchStatement"), ThisExpression$1 = alias("thisExpression"), ThrowStatement$1 = alias("throwStatement"), TryStatement$1 = alias("tryStatement"), UnaryExpression$1 = alias("unaryExpression"), UpdateExpression$2 = alias("updateExpression"), VariableDeclaration$1 = alias("variableDeclaration"), VariableDeclarator$1 = alias("variableDeclarator"), WhileStatement$1 = alias("whileStatement"), WithStatement$1 = alias("withStatement"), AssignmentPattern$1 = alias("assignmentPattern"), ArrayPattern = alias("arrayPattern"), ArrowFunctionExpression$1 = alias("arrowFunctionExpression"), ClassBody$1 = alias("classBody"), ClassExpression$1 = alias("classExpression"), ClassDeclaration$1 = alias("classDeclaration"), ExportAllDeclaration$1 = alias("exportAllDeclaration"), ExportDefaultDeclaration$1 = alias("exportDefaultDeclaration"), ExportNamedDeclaration$1 = alias("exportNamedDeclaration"), ExportSpecifier$1 = alias("exportSpecifier"), ForOfStatement$1 = alias("forOfStatement"), ImportDeclaration$1 = alias("importDeclaration"), ImportDefaultSpecifier$1 = alias("importDefaultSpecifier"), ImportNamespaceSpecifier$1 = alias("importNamespaceSpecifier"), ImportSpecifier$1 = alias("importSpecifier"), MetaProperty$1 = alias("metaProperty"), ClassMethod$1 = alias("classMethod"), ObjectPattern = alias("objectPattern"), SpreadElement = alias("spreadElement"), Super$1 = alias("super"), TaggedTemplateExpression$1 = alias("taggedTemplateExpression"), TemplateElement$1 = alias("templateElement"), TemplateLiteral$1 = alias("templateLiteral"), YieldExpression$2 = alias("yieldExpression"), AwaitExpression$1 = alias("awaitExpression"), ImportExpression$1 = alias("importExpression"), Import$1 = alias("import"), BigIntLiteral$1 = alias("bigIntLiteral"), ExportNamespaceSpecifier$1 = alias("exportNamespaceSpecifier"), OptionalMemberExpression$2 = alias("optionalMemberExpression"), OptionalCallExpression$1 = alias("optionalCallExpression"), ClassProperty$1 = alias("classProperty"), ClassPrivateProperty$1 = alias("classPrivateProperty"), ClassPrivateMethod$1 = alias("classPrivateMethod"), PrivateName$1 = alias("privateName"), StaticBlock$1 = alias("staticBlock"), ImportAttribute$1 = alias("importAttribute"), AnyTypeAnnotation$1 = alias("anyTypeAnnotation"), ArrayTypeAnnotation$1 = alias("arrayTypeAnnotation"), BooleanTypeAnnotation$1 = alias("booleanTypeAnnotation"), BooleanLiteralTypeAnnotation$1 = alias("booleanLiteralTypeAnnotation"), NullLiteralTypeAnnotation$1 = alias("nullLiteralTypeAnnotation"), ClassImplements = alias("classImplements"), DeclareClass$1 = alias("declareClass"), DeclareFunction$1 = alias("declareFunction"), DeclareInterface$1 = alias("declareInterface"), DeclareModule$1 = alias("declareModule"), DeclareModuleExports$1 = alias("declareModuleExports"), DeclareTypeAlias$1 = alias("declareTypeAlias"), DeclareOpaqueType$1 = alias("declareOpaqueType"), DeclareVariable$1 = alias("declareVariable"), DeclareExportDeclaration$1 = alias("declareExportDeclaration"), DeclareExportAllDeclaration$1 = alias("declareExportAllDeclaration"), DeclaredPredicate$1 = alias("declaredPredicate"), ExistsTypeAnnotation$1 = alias("existsTypeAnnotation"), FunctionTypeAnnotation$2 = alias("functionTypeAnnotation"), FunctionTypeParam$1 = alias("functionTypeParam"), GenericTypeAnnotation = alias("genericTypeAnnotation"), InferredPredicate$1 = alias("inferredPredicate"), InterfaceExtends$1 = alias("interfaceExtends"), InterfaceDeclaration$1 = alias("interfaceDeclaration"), InterfaceTypeAnnotation$1 = alias("interfaceTypeAnnotation"), IntersectionTypeAnnotation$1 = alias("intersectionTypeAnnotation"), MixedTypeAnnotation$1 = alias("mixedTypeAnnotation"), EmptyTypeAnnotation$1 = alias("emptyTypeAnnotation"), NullableTypeAnnotation$2 = alias("nullableTypeAnnotation"), NumberLiteralTypeAnnotation = alias("numberLiteralTypeAnnotation"), BigIntLiteralTypeAnnotation = alias("bigIntLiteralTypeAnnotation"), NumberTypeAnnotation$1 = alias("numberTypeAnnotation"), ObjectTypeAnnotation$1 = alias("objectTypeAnnotation"), ObjectTypeInternalSlot$1 = alias("objectTypeInternalSlot"), ObjectTypeCallProperty$1 = alias("objectTypeCallProperty"), ObjectTypeIndexer$1 = alias("objectTypeIndexer"), ObjectTypeProperty$1 = alias("objectTypeProperty"), ObjectTypeSpreadProperty$1 = alias("objectTypeSpreadProperty"), OpaqueType$1 = alias("opaqueType"), QualifiedTypeIdentifier$1 = alias("qualifiedTypeIdentifier"), StringLiteralTypeAnnotation = alias("stringLiteralTypeAnnotation"), StringTypeAnnotation$1 = alias("stringTypeAnnotation"), SymbolTypeAnnotation$1 = alias("symbolTypeAnnotation"), ThisTypeAnnotation$1 = alias("thisTypeAnnotation"), TupleTypeAnnotation$1 = alias("tupleTypeAnnotation"), TypeofTypeAnnotation$1 = alias("typeofTypeAnnotation"), TypeAlias$1 = alias("typeAlias"), TypeAnnotation$1 = alias("typeAnnotation"), TypeCastExpression$1 = alias("typeCastExpression"), TypeParameter$1 = alias("typeParameter"), TypeParameterDeclaration = alias("typeParameterDeclaration"), TypeParameterInstantiation$1 = alias("typeParameterInstantiation"), UnionTypeAnnotation$2 = alias("unionTypeAnnotation"), Variance$1 = alias("variance"), VoidTypeAnnotation$1 = alias("voidTypeAnnotation"), EnumDeclaration$1 = alias("enumDeclaration"), EnumBooleanBody$1 = alias("enumBooleanBody"), EnumNumberBody$1 = alias("enumNumberBody"), EnumStringBody$1 = alias("enumStringBody"), EnumSymbolBody$1 = alias("enumSymbolBody"), EnumBooleanMember$1 = alias("enumBooleanMember"), EnumNumberMember$1 = alias("enumNumberMember"), EnumStringMember$1 = alias("enumStringMember"), EnumDefaultedMember$1 = alias("enumDefaultedMember"), IndexedAccessType$1 = alias("indexedAccessType"), OptionalIndexedAccessType$2 = alias("optionalIndexedAccessType"), JSXAttribute$1 = alias("jsxAttribute"), JSXClosingElement$1 = alias("jsxClosingElement"), JSXElement$1 = alias("jsxElement"), JSXEmptyExpression$1 = alias("jsxEmptyExpression"), JSXExpressionContainer$1 = alias("jsxExpressionContainer"), JSXSpreadChild$1 = alias("jsxSpreadChild"), JSXIdentifier$1 = alias("jsxIdentifier"), JSXMemberExpression$1 = alias("jsxMemberExpression"), JSXNamespacedName$1 = alias("jsxNamespacedName"), JSXOpeningElement$1 = alias("jsxOpeningElement"), JSXSpreadAttribute$1 = alias("jsxSpreadAttribute"), JSXText$1 = alias("jsxText"), JSXFragment$1 = alias("jsxFragment"), JSXOpeningFragment$1 = alias("jsxOpeningFragment"), JSXClosingFragment$1 = alias("jsxClosingFragment"), Placeholder$1 = alias("placeholder"), V8IntrinsicIdentifier$1 = alias("v8IntrinsicIdentifier"), ArgumentPlaceholder$1 = alias("argumentPlaceholder"), BindExpression$1 = alias("bindExpression"), ClassAccessorProperty$1 = alias("classAccessorProperty"), Decorator$1 = alias("decorator"), DoExpression$2 = alias("doExpression"), ExportDefaultSpecifier$1 = alias("exportDefaultSpecifier"), ModuleExpression$1 = alias("moduleExpression"), TopicReference$1 = alias("topicReference"), VoidPattern$1 = alias("voidPattern"), TSParameterProperty$1 = alias("tsParameterProperty"), TSDeclareFunction$1 = alias("tsDeclareFunction"), TSDeclareMethod$1 = alias("tsDeclareMethod"), TSQualifiedName$1 = alias("tsQualifiedName"), TSCallSignatureDeclaration$1 = alias("tsCallSignatureDeclaration"), TSConstructSignatureDeclaration$1 = alias("tsConstructSignatureDeclaration"), TSPropertySignature$1 = alias("tsPropertySignature"), TSMethodSignature$1 = alias("tsMethodSignature"), TSIndexSignature$1 = alias("tsIndexSignature"), TSAnyKeyword$1 = alias("tsAnyKeyword"), TSBooleanKeyword$1 = alias("tsBooleanKeyword"), TSBigIntKeyword$1 = alias("tsBigIntKeyword"), TSIntrinsicKeyword$1 = alias("tsIntrinsicKeyword"), TSNeverKeyword$1 = alias("tsNeverKeyword"), TSNullKeyword$1 = alias("tsNullKeyword"), TSNumberKeyword$1 = alias("tsNumberKeyword"), TSObjectKeyword$1 = alias("tsObjectKeyword"), TSStringKeyword$1 = alias("tsStringKeyword"), TSSymbolKeyword$1 = alias("tsSymbolKeyword"), TSUndefinedKeyword$1 = alias("tsUndefinedKeyword"), TSUnknownKeyword$1 = alias("tsUnknownKeyword"), TSVoidKeyword$1 = alias("tsVoidKeyword"), TSThisType$1 = alias("tsThisType"), TSFunctionType$2 = alias("tsFunctionType"), TSConstructorType$1 = alias("tsConstructorType"), TSTypeReference$1 = alias("tsTypeReference"), TSTypePredicate$1 = alias("tsTypePredicate"), TSTypeQuery$1 = alias("tsTypeQuery"), TSTypeLiteral$1 = alias("tsTypeLiteral"), TSArrayType$1 = alias("tsArrayType"), TSTupleType$1 = alias("tsTupleType"), TSOptionalType$1 = alias("tsOptionalType"), TSRestType$1 = alias("tsRestType"), TSNamedTupleMember$1 = alias("tsNamedTupleMember"), TSUnionType$2 = alias("tsUnionType"), TSIntersectionType$2 = alias("tsIntersectionType"), TSConditionalType$2 = alias("tsConditionalType"), TSInferType$2 = alias("tsInferType"), TSParenthesizedType$1 = alias("tsParenthesizedType"), TSTypeOperator$2 = alias("tsTypeOperator"), TSIndexedAccessType$1 = alias("tsIndexedAccessType"), TSMappedType$1 = alias("tsMappedType"), TSTemplateLiteralType$1 = alias("tsTemplateLiteralType"), TSLiteralType$1 = alias("tsLiteralType"), TSClassImplements$1 = alias("tsClassImplements"), TSInterfaceHeritage = alias("tsInterfaceHeritage"), TSInterfaceDeclaration$1 = alias("tsInterfaceDeclaration"), TSInterfaceBody$1 = alias("tsInterfaceBody"), TSTypeAliasDeclaration$1 = alias("tsTypeAliasDeclaration"), TSInstantiationExpression$2 = alias("tsInstantiationExpression"), TSAsExpression$2 = alias("tsAsExpression"), TSSatisfiesExpression$1 = alias("tsSatisfiesExpression"), TSTypeAssertion$1 = alias("tsTypeAssertion"), TSEnumBody$1 = alias("tsEnumBody"), TSEnumDeclaration$1 = alias("tsEnumDeclaration"), TSEnumMember$1 = alias("tsEnumMember"), TSModuleDeclaration$1 = alias("tsModuleDeclaration"), TSModuleBlock$1 = alias("tsModuleBlock"), TSImportType$1 = alias("tsImportType"), TSImportEqualsDeclaration$1 = alias("tsImportEqualsDeclaration"), TSExternalModuleReference$1 = alias("tsExternalModuleReference"), TSNonNullExpression$1 = alias("tsNonNullExpression"), TSExportAssignment$1 = alias("tsExportAssignment"), TSNamespaceExportDeclaration$1 = alias("tsNamespaceExportDeclaration"), TSTypeAnnotation$1 = alias("tsTypeAnnotation"), TSTypeParameterInstantiation$1 = alias("tsTypeParameterInstantiation"), TSTypeParameterDeclaration = alias("tsTypeParameterDeclaration"), TSTypeParameter$1 = alias("tsTypeParameter");
|
|
11866
11900
|
function cleanJSXElementLiteralChild(child, args) {
|
|
11867
11901
|
const lines = child.value.split(/\r\n|\n|\r/);
|
|
11868
11902
|
let lastNonEmptyLine = 0;
|
|
@@ -12107,9 +12141,6 @@ function assertImportNamespaceSpecifier(node, opts) {
|
|
|
12107
12141
|
function assertImportSpecifier(node, opts) {
|
|
12108
12142
|
assert$1("ImportSpecifier", node, opts);
|
|
12109
12143
|
}
|
|
12110
|
-
function assertImportExpression(node, opts) {
|
|
12111
|
-
assert$1("ImportExpression", node, opts);
|
|
12112
|
-
}
|
|
12113
12144
|
function assertMetaProperty(node, opts) {
|
|
12114
12145
|
assert$1("MetaProperty", node, opts);
|
|
12115
12146
|
}
|
|
@@ -12140,6 +12171,9 @@ function assertYieldExpression(node, opts) {
|
|
|
12140
12171
|
function assertAwaitExpression(node, opts) {
|
|
12141
12172
|
assert$1("AwaitExpression", node, opts);
|
|
12142
12173
|
}
|
|
12174
|
+
function assertImportExpression(node, opts) {
|
|
12175
|
+
assert$1("ImportExpression", node, opts);
|
|
12176
|
+
}
|
|
12143
12177
|
function assertImport(node, opts) {
|
|
12144
12178
|
assert$1("Import", node, opts);
|
|
12145
12179
|
}
|
|
@@ -12263,6 +12297,9 @@ function assertNullableTypeAnnotation(node, opts) {
|
|
|
12263
12297
|
function assertNumberLiteralTypeAnnotation(node, opts) {
|
|
12264
12298
|
assert$1("NumberLiteralTypeAnnotation", node, opts);
|
|
12265
12299
|
}
|
|
12300
|
+
function assertBigIntLiteralTypeAnnotation(node, opts) {
|
|
12301
|
+
assert$1("BigIntLiteralTypeAnnotation", node, opts);
|
|
12302
|
+
}
|
|
12266
12303
|
function assertNumberTypeAnnotation(node, opts) {
|
|
12267
12304
|
assert$1("NumberTypeAnnotation", node, opts);
|
|
12268
12305
|
}
|
|
@@ -12861,13 +12898,13 @@ function removeTypeDuplicates$1(nodesIn) {
|
|
|
12861
12898
|
if (isGenericTypeAnnotation(node)) {
|
|
12862
12899
|
const name = getQualifiedName$1(node.id);
|
|
12863
12900
|
if (generics.has(name)) {
|
|
12864
|
-
|
|
12865
|
-
if (
|
|
12901
|
+
const existingTypeParameters = generics.get(name).typeParameters;
|
|
12902
|
+
if (existingTypeParameters) {
|
|
12866
12903
|
if (node.typeParameters) {
|
|
12867
|
-
|
|
12868
|
-
|
|
12904
|
+
existingTypeParameters.params.push(...node.typeParameters.params);
|
|
12905
|
+
existingTypeParameters.params = removeTypeDuplicates$1(existingTypeParameters.params);
|
|
12869
12906
|
}
|
|
12870
|
-
}
|
|
12907
|
+
}
|
|
12871
12908
|
} else generics.set(name, node);
|
|
12872
12909
|
continue;
|
|
12873
12910
|
}
|
|
@@ -12912,12 +12949,11 @@ function removeTypeDuplicates(nodesIn) {
|
|
|
12912
12949
|
const typeArguments = node[typeArgumentsKey];
|
|
12913
12950
|
const name = getQualifiedName(node.typeName);
|
|
12914
12951
|
if (generics.has(name)) {
|
|
12915
|
-
|
|
12916
|
-
const existingTypeArguments = existing[typeArgumentsKey];
|
|
12952
|
+
const existingTypeArguments = generics.get(name)[typeArgumentsKey];
|
|
12917
12953
|
if (existingTypeArguments) {
|
|
12918
12954
|
existingTypeArguments.params.push(...typeArguments.params);
|
|
12919
12955
|
existingTypeArguments.params = removeTypeDuplicates(existingTypeArguments.params);
|
|
12920
|
-
}
|
|
12956
|
+
}
|
|
12921
12957
|
} else generics.set(name, node);
|
|
12922
12958
|
continue;
|
|
12923
12959
|
}
|
|
@@ -12947,6 +12983,7 @@ function cloneIfNodeOrArray(obj, deep, withoutLoc, commentsCache) {
|
|
|
12947
12983
|
return cloneIfNode(obj, deep, withoutLoc, commentsCache);
|
|
12948
12984
|
}
|
|
12949
12985
|
function cloneNode(node, deep = true, withoutLoc = false) {
|
|
12986
|
+
if (!node) return node;
|
|
12950
12987
|
return cloneNodeInternal(node, deep, withoutLoc, /* @__PURE__ */ new Map());
|
|
12951
12988
|
}
|
|
12952
12989
|
function cloneNodeInternal(node, deep = true, withoutLoc = false, commentsCache) {
|
|
@@ -13088,7 +13125,7 @@ const TSBASETYPE_TYPES = FLIPPED_ALIAS_KEYS["TSBaseType"];
|
|
|
13088
13125
|
const MODULEDECLARATION_TYPES = IMPORTOREXPORTDECLARATION_TYPES;
|
|
13089
13126
|
function toBlock(node, parent) {
|
|
13090
13127
|
if (isBlockStatement(node)) return node;
|
|
13091
|
-
let blockNodes
|
|
13128
|
+
let blockNodes;
|
|
13092
13129
|
if (isEmptyStatement(node)) blockNodes = [];
|
|
13093
13130
|
else {
|
|
13094
13131
|
if (!isStatement$5(node)) if (isFunction$1(parent)) node = returnStatement(node);
|
|
@@ -13610,7 +13647,7 @@ const react = {
|
|
|
13610
13647
|
buildChildren
|
|
13611
13648
|
};
|
|
13612
13649
|
//#endregion
|
|
13613
|
-
//#region ../../node_modules/.pnpm/@babel+generator@8.0.0-rc.
|
|
13650
|
+
//#region ../../node_modules/.pnpm/@babel+generator@8.0.0-rc.3/node_modules/@babel/generator/lib/index.js
|
|
13614
13651
|
var import_jsesc = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
13615
13652
|
const object = {};
|
|
13616
13653
|
const hasOwnProperty = object.hasOwnProperty;
|
|
@@ -14103,20 +14140,20 @@ const PRECEDENCE = new Map([
|
|
|
14103
14140
|
["**", 11]
|
|
14104
14141
|
]);
|
|
14105
14142
|
function isTSTypeExpression(nodeId) {
|
|
14106
|
-
return nodeId ===
|
|
14143
|
+
return nodeId === 154 || nodeId === 199 || nodeId === 207;
|
|
14107
14144
|
}
|
|
14108
14145
|
const isClassExtendsClause = (node, parent, parentId) => {
|
|
14109
|
-
return (parentId ===
|
|
14146
|
+
return (parentId === 22 || parentId === 23) && parent.superClass === node;
|
|
14110
14147
|
};
|
|
14111
14148
|
const hasPostfixPart = (node, parent, parentId) => {
|
|
14112
14149
|
switch (parentId) {
|
|
14113
|
-
case
|
|
14114
|
-
case
|
|
14115
|
-
case
|
|
14116
|
-
case
|
|
14117
|
-
case
|
|
14118
|
-
case
|
|
14119
|
-
case
|
|
14150
|
+
case 109:
|
|
14151
|
+
case 133: return parent.object === node;
|
|
14152
|
+
case 18:
|
|
14153
|
+
case 131:
|
|
14154
|
+
case 113: return parent.callee === node;
|
|
14155
|
+
case 220: return parent.tag === node;
|
|
14156
|
+
case 189: return true;
|
|
14120
14157
|
}
|
|
14121
14158
|
return false;
|
|
14122
14159
|
};
|
|
@@ -14124,7 +14161,7 @@ function NullableTypeAnnotation$1(node, parent, parentId) {
|
|
|
14124
14161
|
return parentId === 4;
|
|
14125
14162
|
}
|
|
14126
14163
|
function FunctionTypeAnnotation$1(node, parent, parentId, tokenContext) {
|
|
14127
|
-
return parentId ===
|
|
14164
|
+
return parentId === 237 || parentId === 91 || parentId === 4 || (tokenContext & 8) > 0;
|
|
14128
14165
|
}
|
|
14129
14166
|
function UpdateExpression$1(node, parent, parentId) {
|
|
14130
14167
|
return hasPostfixPart(node, parent, parentId) || isClassExtendsClause(node, parent, parentId);
|
|
@@ -14140,92 +14177,92 @@ function DoExpression$1(node, parent, parentId, tokenContext) {
|
|
|
14140
14177
|
}
|
|
14141
14178
|
function BinaryLike(node, parent, parentId, nodeType) {
|
|
14142
14179
|
if (isClassExtendsClause(node, parent, parentId)) return true;
|
|
14143
|
-
if (hasPostfixPart(node, parent, parentId) || parentId ===
|
|
14180
|
+
if (hasPostfixPart(node, parent, parentId) || parentId === 236 || parentId === 143 || parentId === 8) return true;
|
|
14144
14181
|
let parentPos;
|
|
14145
14182
|
switch (parentId) {
|
|
14146
|
-
case
|
|
14147
|
-
case
|
|
14183
|
+
case 11:
|
|
14184
|
+
case 108:
|
|
14148
14185
|
parentPos = PRECEDENCE.get(parent.operator);
|
|
14149
14186
|
break;
|
|
14150
|
-
case
|
|
14151
|
-
case
|
|
14187
|
+
case 154:
|
|
14188
|
+
case 199: parentPos = 7;
|
|
14152
14189
|
}
|
|
14153
14190
|
if (parentPos !== void 0) {
|
|
14154
14191
|
const nodePos = nodeType === 2 ? 7 : PRECEDENCE.get(node.operator);
|
|
14155
14192
|
if (parentPos > nodePos) return true;
|
|
14156
|
-
if (parentPos === nodePos && parentId ===
|
|
14157
|
-
if (nodeType === 1 && parentId ===
|
|
14193
|
+
if (parentPos === nodePos && parentId === 11 && (nodePos === 11 ? parent.left === node : parent.right === node)) return true;
|
|
14194
|
+
if (nodeType === 1 && parentId === 108 && (nodePos === 1 && parentPos !== 1 || parentPos === 1 && nodePos !== 1)) return true;
|
|
14158
14195
|
}
|
|
14159
14196
|
return false;
|
|
14160
14197
|
}
|
|
14161
14198
|
function UnionTypeAnnotation$1(node, parent, parentId) {
|
|
14162
14199
|
switch (parentId) {
|
|
14163
14200
|
case 4:
|
|
14164
|
-
case
|
|
14165
|
-
case
|
|
14166
|
-
case
|
|
14201
|
+
case 116:
|
|
14202
|
+
case 91:
|
|
14203
|
+
case 237: return true;
|
|
14167
14204
|
}
|
|
14168
14205
|
return false;
|
|
14169
14206
|
}
|
|
14170
14207
|
function OptionalIndexedAccessType$1(node, parent, parentId) {
|
|
14171
|
-
return parentId ===
|
|
14208
|
+
return parentId === 85 && parent.objectType === node;
|
|
14172
14209
|
}
|
|
14173
14210
|
function TSAsExpression$1(node, parent, parentId) {
|
|
14174
14211
|
if ((parentId === 6 || parentId === 7) && parent.left === node) return true;
|
|
14175
|
-
if (parentId ===
|
|
14212
|
+
if (parentId === 11 && (parent.operator === "|" || parent.operator === "&") && node === parent.left) return true;
|
|
14176
14213
|
return BinaryLike(node, parent, parentId, 2);
|
|
14177
14214
|
}
|
|
14178
14215
|
function TSConditionalType$1(node, parent, parentId) {
|
|
14179
14216
|
switch (parentId) {
|
|
14180
|
-
case
|
|
14181
|
-
case
|
|
14182
|
-
case 208:
|
|
14217
|
+
case 153:
|
|
14218
|
+
case 193:
|
|
14183
14219
|
case 209:
|
|
14184
|
-
case
|
|
14185
|
-
case
|
|
14186
|
-
case
|
|
14187
|
-
case
|
|
14220
|
+
case 210:
|
|
14221
|
+
case 179:
|
|
14222
|
+
case 217: return true;
|
|
14223
|
+
case 173: return parent.objectType === node;
|
|
14224
|
+
case 159: return parent.checkType === node || parent.extendsType === node;
|
|
14188
14225
|
}
|
|
14189
14226
|
return false;
|
|
14190
14227
|
}
|
|
14191
14228
|
function TSUnionType$1(node, parent, parentId) {
|
|
14192
14229
|
switch (parentId) {
|
|
14193
|
-
case
|
|
14194
|
-
case
|
|
14195
|
-
case
|
|
14196
|
-
case
|
|
14197
|
-
case
|
|
14230
|
+
case 179:
|
|
14231
|
+
case 209:
|
|
14232
|
+
case 153:
|
|
14233
|
+
case 193: return true;
|
|
14234
|
+
case 173: return parent.objectType === node;
|
|
14198
14235
|
}
|
|
14199
14236
|
return false;
|
|
14200
14237
|
}
|
|
14201
14238
|
function TSIntersectionType$1(node, parent, parentId) {
|
|
14202
|
-
return parentId ===
|
|
14239
|
+
return parentId === 209 || TSTypeOperator$1(node, parent, parentId);
|
|
14203
14240
|
}
|
|
14204
14241
|
function TSInferType$1(node, parent, parentId) {
|
|
14205
14242
|
if (TSTypeOperator$1(node, parent, parentId)) return true;
|
|
14206
|
-
if ((parentId ===
|
|
14243
|
+
if ((parentId === 179 || parentId === 217) && node.typeParameter.constraint != null) return true;
|
|
14207
14244
|
return false;
|
|
14208
14245
|
}
|
|
14209
14246
|
function TSTypeOperator$1(node, parent, parentId) {
|
|
14210
14247
|
switch (parentId) {
|
|
14211
|
-
case
|
|
14212
|
-
case
|
|
14213
|
-
case
|
|
14248
|
+
case 153:
|
|
14249
|
+
case 193: return true;
|
|
14250
|
+
case 173: if (parent.objectType === node) return true;
|
|
14214
14251
|
}
|
|
14215
14252
|
return false;
|
|
14216
14253
|
}
|
|
14217
14254
|
function TSInstantiationExpression$1(node, parent, parentId) {
|
|
14218
14255
|
switch (parentId) {
|
|
14219
|
-
case
|
|
14220
|
-
case
|
|
14221
|
-
case
|
|
14222
|
-
case
|
|
14256
|
+
case 18:
|
|
14257
|
+
case 131:
|
|
14258
|
+
case 113:
|
|
14259
|
+
case 175: return parent.typeArguments != null;
|
|
14223
14260
|
}
|
|
14224
14261
|
return false;
|
|
14225
14262
|
}
|
|
14226
14263
|
function TSFunctionType$1(node, parent, parentId) {
|
|
14227
14264
|
if (TSUnionType$1(node, parent, parentId)) return true;
|
|
14228
|
-
return parentId ===
|
|
14265
|
+
return parentId === 217 || parentId === 159 && (parent.checkType === node || parent.extendsType === node);
|
|
14229
14266
|
}
|
|
14230
14267
|
function BinaryExpression$1(node, parent, parentId, tokenContext) {
|
|
14231
14268
|
if (BinaryLike(node, parent, parentId, 0)) return true;
|
|
@@ -14235,40 +14272,40 @@ function LogicalExpression(node, parent, parentId) {
|
|
|
14235
14272
|
return BinaryLike(node, parent, parentId, 1);
|
|
14236
14273
|
}
|
|
14237
14274
|
function SequenceExpression$1(node, parent, parentId) {
|
|
14238
|
-
if (parentId ===
|
|
14239
|
-
if (parentId ===
|
|
14240
|
-
if (parentId ===
|
|
14241
|
-
if (parentId ===
|
|
14275
|
+
if (parentId === 142 || parentId === 134 || parentId === 109 && parent.property === node || parentId === 133 && parent.property === node || parentId === 222) return false;
|
|
14276
|
+
if (parentId === 22) return true;
|
|
14277
|
+
if (parentId === 69) return parent.right === node;
|
|
14278
|
+
if (parentId === 61) return true;
|
|
14242
14279
|
return !isStatement$4(parent);
|
|
14243
14280
|
}
|
|
14244
14281
|
function YieldExpression$1(node, parent, parentId) {
|
|
14245
|
-
return parentId ===
|
|
14282
|
+
return parentId === 11 || parentId === 108 || parentId === 236 || parentId === 143 || hasPostfixPart(node, parent, parentId) || parentId === 8 && isYieldExpression(node) || parentId === 29 && node === parent.test || isClassExtendsClause(node, parent, parentId) || isTSTypeExpression(parentId);
|
|
14246
14283
|
}
|
|
14247
14284
|
function ClassExpression(node, parent, parentId, tokenContext) {
|
|
14248
14285
|
return (tokenContext & 5) > 0;
|
|
14249
14286
|
}
|
|
14250
14287
|
function UnaryLike(node, parent, parentId) {
|
|
14251
|
-
return hasPostfixPart(node, parent, parentId) || parentId ===
|
|
14288
|
+
return hasPostfixPart(node, parent, parentId) || parentId === 11 && parent.operator === "**" && parent.left === node || isClassExtendsClause(node, parent, parentId);
|
|
14252
14289
|
}
|
|
14253
14290
|
function FunctionExpression$1(node, parent, parentId, tokenContext) {
|
|
14254
14291
|
return (tokenContext & 5) > 0;
|
|
14255
14292
|
}
|
|
14256
14293
|
function ConditionalExpression$1(node, parent, parentId) {
|
|
14257
14294
|
switch (parentId) {
|
|
14258
|
-
case
|
|
14259
|
-
case
|
|
14260
|
-
case
|
|
14261
|
-
case
|
|
14295
|
+
case 236:
|
|
14296
|
+
case 143:
|
|
14297
|
+
case 11:
|
|
14298
|
+
case 108:
|
|
14262
14299
|
case 8: return true;
|
|
14263
|
-
case
|
|
14300
|
+
case 29: if (parent.test === node) return true;
|
|
14264
14301
|
}
|
|
14265
14302
|
if (isTSTypeExpression(parentId)) return true;
|
|
14266
14303
|
return UnaryLike(node, parent, parentId);
|
|
14267
14304
|
}
|
|
14268
14305
|
function OptionalMemberExpression$1(node, parent, parentId) {
|
|
14269
14306
|
switch (parentId) {
|
|
14270
|
-
case
|
|
14271
|
-
case
|
|
14307
|
+
case 18: return parent.callee === node;
|
|
14308
|
+
case 109: return parent.object === node;
|
|
14272
14309
|
}
|
|
14273
14310
|
return false;
|
|
14274
14311
|
}
|
|
@@ -14282,7 +14319,7 @@ function Identifier$1(node, parent, parentId, tokenContext, getRawIdentifier) {
|
|
|
14282
14319
|
const rightType = parent.right.type;
|
|
14283
14320
|
if ((rightType === "FunctionExpression" || rightType === "ClassExpression") && parent.right.id == null) return true;
|
|
14284
14321
|
}
|
|
14285
|
-
if (tokenContext & 64 || (parentId ===
|
|
14322
|
+
if (tokenContext & 64 || (parentId === 109 || parentId === 133) && tokenContext & 49) {
|
|
14286
14323
|
if (node.name === "let") {
|
|
14287
14324
|
if ((isMemberExpression$1(parent, {
|
|
14288
14325
|
object: node,
|
|
@@ -14295,7 +14332,7 @@ function Identifier$1(node, parent, parentId, tokenContext, getRawIdentifier) {
|
|
|
14295
14332
|
return (tokenContext & 64) > 0;
|
|
14296
14333
|
}
|
|
14297
14334
|
}
|
|
14298
|
-
return parentId ===
|
|
14335
|
+
return parentId === 69 && parent.left === node && node.name === "async" && !parent.await;
|
|
14299
14336
|
}
|
|
14300
14337
|
var parens = /* @__PURE__ */ Object.freeze({
|
|
14301
14338
|
__proto__: null,
|
|
@@ -15018,7 +15055,7 @@ function TSDeclareFunction(node, parent) {
|
|
|
15018
15055
|
this.semicolon();
|
|
15019
15056
|
}
|
|
15020
15057
|
function TSDeclareMethod(node) {
|
|
15021
|
-
_classMethodHead.call(this, node);
|
|
15058
|
+
_classMethodHead.call(this, node, false);
|
|
15022
15059
|
this.semicolon();
|
|
15023
15060
|
}
|
|
15024
15061
|
function TSQualifiedName(node) {
|
|
@@ -16552,8 +16589,8 @@ function ClassPrivateMethod(node) {
|
|
|
16552
16589
|
this.space();
|
|
16553
16590
|
this.print(node.body);
|
|
16554
16591
|
}
|
|
16555
|
-
function _classMethodHead(node) {
|
|
16556
|
-
this.printJoin(node.decorators);
|
|
16592
|
+
function _classMethodHead(node, allowDecorators = true) {
|
|
16593
|
+
if (allowDecorators) this.printJoin(node.decorators);
|
|
16557
16594
|
if (!this.format.preserveFormat) {
|
|
16558
16595
|
const endLine = node.key.loc?.end?.line;
|
|
16559
16596
|
if (endLine) this.catchUp(endLine);
|
|
@@ -16730,6 +16767,7 @@ var generatorFunctions = /* @__PURE__ */ Object.freeze({
|
|
|
16730
16767
|
AssignmentPattern,
|
|
16731
16768
|
AwaitExpression,
|
|
16732
16769
|
BigIntLiteral,
|
|
16770
|
+
BigIntLiteralTypeAnnotation: BigIntLiteral,
|
|
16733
16771
|
BinaryExpression,
|
|
16734
16772
|
BindExpression,
|
|
16735
16773
|
BlockStatement,
|
|
@@ -17007,12 +17045,12 @@ function isOrHasCallExpression(node) {
|
|
|
17007
17045
|
}
|
|
17008
17046
|
function parentNeedsParens(node, parent, parentId) {
|
|
17009
17047
|
switch (parentId) {
|
|
17010
|
-
case
|
|
17048
|
+
case 113:
|
|
17011
17049
|
if (parent.callee === node) {
|
|
17012
17050
|
if (isOrHasCallExpression(node)) return true;
|
|
17013
17051
|
}
|
|
17014
17052
|
break;
|
|
17015
|
-
case
|
|
17053
|
+
case 43: return !isDecoratorMemberExpression(node) && !(node.type === "CallExpression" && isDecoratorMemberExpression(node.callee)) && node.type !== "ParenthesizedExpression";
|
|
17016
17054
|
}
|
|
17017
17055
|
return false;
|
|
17018
17056
|
}
|
|
@@ -17476,15 +17514,15 @@ var Printer = class {
|
|
|
17476
17514
|
else oldTokenContext = 0;
|
|
17477
17515
|
}
|
|
17478
17516
|
const parenthesized = extra != null && extra.parenthesized;
|
|
17479
|
-
let shouldPrintParens = parenthesized && flags & 1 || parenthesized && flags & 16 && nodeId ===
|
|
17517
|
+
let shouldPrintParens = parenthesized && flags & 1 || parenthesized && flags & 16 && nodeId === 72 || parent && (parentNeedsParens(node, parent, parentId) || needsParens != null && needsParens(node, parent, parentId, this.tokenContext, flags & 1 ? this._boundGetRawIdentifier : void 0));
|
|
17480
17518
|
if (!shouldPrintParens && parenthesized && node.leadingComments?.length && node.leadingComments[0].type === "CommentBlock") switch (parentId) {
|
|
17481
|
-
case
|
|
17482
|
-
case
|
|
17519
|
+
case 66:
|
|
17520
|
+
case 241:
|
|
17483
17521
|
case 6:
|
|
17484
|
-
case
|
|
17485
|
-
case
|
|
17486
|
-
case
|
|
17487
|
-
case
|
|
17522
|
+
case 141: break;
|
|
17523
|
+
case 18:
|
|
17524
|
+
case 131:
|
|
17525
|
+
case 113: if (parent.callee !== node) break;
|
|
17488
17526
|
default: shouldPrintParens = true;
|
|
17489
17527
|
}
|
|
17490
17528
|
let indentParenthesized = false;
|
|
@@ -17512,7 +17550,7 @@ var Printer = class {
|
|
|
17512
17550
|
this._noLineTerminatorAfterNode = null;
|
|
17513
17551
|
}
|
|
17514
17552
|
this._printLeadingComments(node, parent);
|
|
17515
|
-
this.exactSource(nodeId ===
|
|
17553
|
+
this.exactSource(nodeId === 137 || nodeId === 67 ? null : loc, printMethod.bind(this, node, parent));
|
|
17516
17554
|
if (shouldPrintParens) {
|
|
17517
17555
|
this._printTrailingComments(node, parent);
|
|
17518
17556
|
if (indentParenthesized) {
|
|
@@ -17815,15 +17853,15 @@ function generate(ast, opts = {}, code) {
|
|
|
17815
17853
|
return new Printer(normalizeOptions(code, opts, ast), opts.sourceMaps ? new SourceMap(opts, code) : null, ast.tokens, typeof code === "string" ? code : null).generate(ast);
|
|
17816
17854
|
}
|
|
17817
17855
|
//#endregion
|
|
17818
|
-
//#region ../../node_modules/.pnpm/@babel+parser@8.0.0-rc.
|
|
17856
|
+
//#region ../../node_modules/.pnpm/@babel+parser@8.0.0-rc.3/node_modules/@babel/parser/lib/index.js
|
|
17819
17857
|
var Position = class {
|
|
17820
|
-
line;
|
|
17821
|
-
column;
|
|
17822
|
-
index;
|
|
17823
17858
|
constructor(line, col, index) {
|
|
17859
|
+
this.line = void 0;
|
|
17860
|
+
this.column = void 0;
|
|
17861
|
+
if (index !== void 0) this.index = void 0;
|
|
17824
17862
|
this.line = line;
|
|
17825
17863
|
this.column = col;
|
|
17826
|
-
this.index = index;
|
|
17864
|
+
if (index !== void 0) this.index = index;
|
|
17827
17865
|
}
|
|
17828
17866
|
};
|
|
17829
17867
|
var SourceLocation = class {
|
|
@@ -17895,6 +17933,7 @@ var StandardErrors = {
|
|
|
17895
17933
|
ConstructorIsAsync: "Constructor can't be an async function.",
|
|
17896
17934
|
ConstructorIsGenerator: "Constructor can't be a generator.",
|
|
17897
17935
|
DeclarationMissingInitializer: ({ kind }) => `Missing initializer in ${kind} declaration.`,
|
|
17936
|
+
DecoratorAbstractMethod: "Decorators can't be used with an abstract method.",
|
|
17898
17937
|
DecoratorArgumentsOutsideParentheses: "Decorator arguments must be moved inside parentheses: use '@(decorator(args))' instead of '@(decorator)(args)'.",
|
|
17899
17938
|
DecoratorsBeforeAfterExport: "Decorators can be placed *either* before or after the 'export' keyword, but not in both locations at the same time.",
|
|
17900
17939
|
DecoratorConstructor: "Decorators can't be used with a constructor. Did you mean '@dec class { ... }'?",
|
|
@@ -18042,7 +18081,8 @@ var PipelineOperatorErrors = {
|
|
|
18042
18081
|
PipeTopicUnbound: "Topic reference is unbound; it must be inside a pipe body.",
|
|
18043
18082
|
PipeTopicUnconfiguredToken: ({ token }) => `Invalid topic token ${token}. In order to use ${token} as a topic reference, the pipelineOperator plugin must be configured with { "proposal": "hack", "topicToken": "${token}" }.`,
|
|
18044
18083
|
PipeTopicUnused: "Hack-style pipe body does not contain a topic reference; Hack-style pipes must use topic at least once.",
|
|
18045
|
-
PipeUnparenthesizedBody: ({ type }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ type })}; please wrap it in parentheses
|
|
18084
|
+
PipeUnparenthesizedBody: ({ type }) => `Hack-style pipe body cannot be an unparenthesized ${toNodeDescription({ type })}; please wrap it in parentheses.`,
|
|
18085
|
+
PipelineUnparenthesized: "Cannot mix binary operator with solo-await F#-style pipeline. Please wrap the pipeline in parentheses."
|
|
18046
18086
|
};
|
|
18047
18087
|
function defineHidden(obj, key, value) {
|
|
18048
18088
|
Object.defineProperty(obj, key, {
|
|
@@ -18053,17 +18093,17 @@ function defineHidden(obj, key, value) {
|
|
|
18053
18093
|
}
|
|
18054
18094
|
function toParseErrorConstructor({ toMessage, code, reasonCode, syntaxPlugin }) {
|
|
18055
18095
|
const hasMissingPlugin = reasonCode === "MissingPlugin" || reasonCode === "MissingOneOfPlugins";
|
|
18056
|
-
return function constructor(loc, details) {
|
|
18096
|
+
return function constructor(loc, pos, details) {
|
|
18057
18097
|
const error = /* @__PURE__ */ new SyntaxError();
|
|
18058
18098
|
error.code = code;
|
|
18059
18099
|
error.reasonCode = reasonCode;
|
|
18060
18100
|
error.loc = loc;
|
|
18061
|
-
error.pos =
|
|
18101
|
+
error.pos = pos;
|
|
18062
18102
|
error.syntaxPlugin = syntaxPlugin;
|
|
18063
18103
|
if (hasMissingPlugin) error.missingPlugin = details.missingPlugin;
|
|
18064
18104
|
defineHidden(error, "clone", function clone(overrides = {}) {
|
|
18065
|
-
const { line, column, index } = overrides.loc ?? loc;
|
|
18066
|
-
return constructor(new Position(line, column, index
|
|
18105
|
+
const { line, column, index = pos } = overrides.loc ?? loc;
|
|
18106
|
+
return constructor(new Position(line, column), index, {
|
|
18067
18107
|
...details,
|
|
18068
18108
|
...overrides.details
|
|
18069
18109
|
});
|
|
@@ -18126,6 +18166,7 @@ function createDefaultOptions() {
|
|
|
18126
18166
|
plugins: [],
|
|
18127
18167
|
strictMode: void 0,
|
|
18128
18168
|
ranges: false,
|
|
18169
|
+
locations: true,
|
|
18129
18170
|
tokens: false,
|
|
18130
18171
|
createImportExpressions: true,
|
|
18131
18172
|
createParenthesizedExpressions: false,
|
|
@@ -18150,23 +18191,20 @@ function getOptions(opts) {
|
|
|
18150
18191
|
}
|
|
18151
18192
|
return options;
|
|
18152
18193
|
}
|
|
18153
|
-
const { defineProperty } = Object;
|
|
18154
|
-
const toUnenumerable = (object, key) => {
|
|
18155
|
-
if (object) defineProperty(object, key, {
|
|
18156
|
-
enumerable: false,
|
|
18157
|
-
value: object[key]
|
|
18158
|
-
});
|
|
18159
|
-
};
|
|
18160
18194
|
function toESTreeLocation(node) {
|
|
18161
|
-
|
|
18162
|
-
|
|
18195
|
+
const { start, end } = node.loc;
|
|
18196
|
+
node.loc.start = new Position(start.line, start.column);
|
|
18197
|
+
node.loc.end = new Position(end.line, end.column);
|
|
18163
18198
|
return node;
|
|
18164
18199
|
}
|
|
18165
18200
|
var estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
18201
|
+
createPosition(loc) {
|
|
18202
|
+
return new Position(loc.line, loc.column);
|
|
18203
|
+
}
|
|
18166
18204
|
parse() {
|
|
18167
|
-
const file =
|
|
18168
|
-
if (this.optionFlags &
|
|
18169
|
-
return file;
|
|
18205
|
+
const file = super.parse();
|
|
18206
|
+
if (this.optionFlags & 512) file.tokens = file.tokens.map(toESTreeLocation);
|
|
18207
|
+
return toESTreeLocation(file);
|
|
18170
18208
|
}
|
|
18171
18209
|
parseRegExpLiteral({ pattern, flags }) {
|
|
18172
18210
|
let regex = null;
|
|
@@ -18206,10 +18244,10 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
18206
18244
|
parseBooleanLiteral(value) {
|
|
18207
18245
|
return this.estreeParseLiteral(value);
|
|
18208
18246
|
}
|
|
18209
|
-
estreeParseChainExpression(node,
|
|
18247
|
+
estreeParseChainExpression(node, endNode) {
|
|
18210
18248
|
const chain = this.startNodeAtNode(node);
|
|
18211
18249
|
chain.expression = node;
|
|
18212
|
-
return this.
|
|
18250
|
+
return this.finishNodeAtNode(chain, "ChainExpression", endNode);
|
|
18213
18251
|
}
|
|
18214
18252
|
directiveToStmt(directive) {
|
|
18215
18253
|
const expression = directive.value;
|
|
@@ -18355,7 +18393,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
18355
18393
|
toAssignable(node, isLHS = false) {
|
|
18356
18394
|
if (node != null && this.isObjectProperty(node)) {
|
|
18357
18395
|
const { key, value } = node;
|
|
18358
|
-
if (this.isPrivateName(key)) this.classScope.usePrivateName(this.getPrivateNameSV(key), key.
|
|
18396
|
+
if (this.isPrivateName(key)) this.classScope.usePrivateName(this.getPrivateNameSV(key), key.start);
|
|
18359
18397
|
this.toAssignable(value, isLHS);
|
|
18360
18398
|
} else super.toAssignable(node, isLHS);
|
|
18361
18399
|
}
|
|
@@ -18399,7 +18437,7 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
18399
18437
|
}
|
|
18400
18438
|
stopParseSubscript(base, state) {
|
|
18401
18439
|
const node = super.stopParseSubscript(base, state);
|
|
18402
|
-
if (state.optionalChainMember) return this.estreeParseChainExpression(node, base
|
|
18440
|
+
if (state.optionalChainMember) return this.estreeParseChainExpression(node, base);
|
|
18403
18441
|
return node;
|
|
18404
18442
|
}
|
|
18405
18443
|
parseMember(base, startLoc, state, computed, optional) {
|
|
@@ -18439,6 +18477,9 @@ var estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
18439
18477
|
finishNodeAt(node, type, endLoc) {
|
|
18440
18478
|
return toESTreeLocation(super.finishNodeAt(node, type, endLoc));
|
|
18441
18479
|
}
|
|
18480
|
+
finishNodeAtNode(node, type, endNode) {
|
|
18481
|
+
return toESTreeLocation(super.finishNodeAtNode(node, type, endNode));
|
|
18482
|
+
}
|
|
18442
18483
|
finishNode(node, type) {
|
|
18443
18484
|
const result = super.finishNode(node, type);
|
|
18444
18485
|
this.fillOptionalPropertiesForTSESLint(result);
|
|
@@ -18825,11 +18866,10 @@ const types = {
|
|
|
18825
18866
|
j_cTag: new TokContext("</tag"),
|
|
18826
18867
|
j_expr: new TokContext("<tag>...</tag>", true)
|
|
18827
18868
|
};
|
|
18828
|
-
|
|
18829
|
-
|
|
18869
|
+
const nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽ-ೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-Ა-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ--ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ";
|
|
18870
|
+
const nonASCIIidentifierChars = "·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ--ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・";
|
|
18830
18871
|
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
|
|
18831
18872
|
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
|
|
18832
|
-
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
|
|
18833
18873
|
const astralIdentifierStartCodes = [
|
|
18834
18874
|
0,
|
|
18835
18875
|
11,
|
|
@@ -20038,7 +20078,7 @@ var ScopeHandler = class {
|
|
|
20038
20078
|
}
|
|
20039
20079
|
checkLocalExport(id) {
|
|
20040
20080
|
const { name } = id;
|
|
20041
|
-
if (!this.scopeStack[0].names.has(name)) this.undefinedExports.set(name, id.
|
|
20081
|
+
if (!this.scopeStack[0].names.has(name)) this.undefinedExports.set(name, id.start);
|
|
20042
20082
|
}
|
|
20043
20083
|
currentScope() {
|
|
20044
20084
|
return this.scopeStack[this.scopeStack.length - 1];
|
|
@@ -20254,7 +20294,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20254
20294
|
id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
|
|
20255
20295
|
this.resetEndLocation(id);
|
|
20256
20296
|
this.semicolon();
|
|
20257
|
-
this.scope.declareName(node.id.name, 2048, node.id.
|
|
20297
|
+
this.scope.declareName(node.id.name, 2048, node.id.start);
|
|
20258
20298
|
return this.finishNode(node, "DeclareFunction");
|
|
20259
20299
|
}
|
|
20260
20300
|
flowParseDeclare(node, insideModule) {
|
|
@@ -20275,7 +20315,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20275
20315
|
flowParseDeclareVariable(node) {
|
|
20276
20316
|
this.next();
|
|
20277
20317
|
node.id = this.flowParseTypeAnnotatableIdentifier(true);
|
|
20278
|
-
this.scope.declareName(node.id.name, 5, node.id.
|
|
20318
|
+
this.scope.declareName(node.id.name, 5, node.id.start);
|
|
20279
20319
|
this.semicolon();
|
|
20280
20320
|
return this.finishNode(node, "DeclareVariable");
|
|
20281
20321
|
}
|
|
@@ -20283,7 +20323,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20283
20323
|
this.scope.enter(0);
|
|
20284
20324
|
if (this.match(130)) node.id = super.parseExprAtom();
|
|
20285
20325
|
else node.id = this.parseIdentifier();
|
|
20286
|
-
const bodyNode =
|
|
20326
|
+
const bodyNode = this.startNode();
|
|
20287
20327
|
const body = bodyNode.body = [];
|
|
20288
20328
|
this.expect(2);
|
|
20289
20329
|
while (!this.match(4)) {
|
|
@@ -20299,7 +20339,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20299
20339
|
}
|
|
20300
20340
|
this.scope.exit();
|
|
20301
20341
|
this.expect(4);
|
|
20302
|
-
this.finishNode(bodyNode, "BlockStatement");
|
|
20342
|
+
node.body = this.finishNode(bodyNode, "BlockStatement");
|
|
20303
20343
|
let kind = null;
|
|
20304
20344
|
let hasModuleExport = false;
|
|
20305
20345
|
body.forEach((bodyElement) => {
|
|
@@ -20339,12 +20379,12 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20339
20379
|
node.default = false;
|
|
20340
20380
|
return this.finishNode(node, "DeclareExportDeclaration");
|
|
20341
20381
|
} else if (this.match(51) || this.match(2) || this.isContextual(125) || this.isContextual(126) || this.isContextual(127)) {
|
|
20342
|
-
|
|
20343
|
-
if (
|
|
20344
|
-
|
|
20345
|
-
delete
|
|
20346
|
-
return this.castNodeTo(
|
|
20347
|
-
} else return this.castNodeTo(
|
|
20382
|
+
const result = this.parseExport(node, null);
|
|
20383
|
+
if (result.type === "ExportNamedDeclaration") {
|
|
20384
|
+
result.default = false;
|
|
20385
|
+
delete result.exportKind;
|
|
20386
|
+
return this.castNodeTo(result, "DeclareExportDeclaration");
|
|
20387
|
+
} else return this.castNodeTo(result, "DeclareExportAllDeclaration");
|
|
20348
20388
|
}
|
|
20349
20389
|
}
|
|
20350
20390
|
throw this.unexpected();
|
|
@@ -20375,7 +20415,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20375
20415
|
}
|
|
20376
20416
|
flowParseInterfaceish(node, isClass) {
|
|
20377
20417
|
node.id = this.flowParseRestrictedIdentifier(!isClass, true);
|
|
20378
|
-
this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.
|
|
20418
|
+
this.scope.declareName(node.id.name, isClass ? 17 : 8201, node.id.start);
|
|
20379
20419
|
if (this.match(43)) node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
20380
20420
|
else node.typeParameters = null;
|
|
20381
20421
|
node.extends = [];
|
|
@@ -20383,14 +20423,16 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20383
20423
|
node.extends.push(this.flowParseInterfaceExtends());
|
|
20384
20424
|
while (!isClass && this.eat(8));
|
|
20385
20425
|
if (isClass) {
|
|
20386
|
-
|
|
20387
|
-
|
|
20426
|
+
const implementsList = [];
|
|
20427
|
+
const mixins = [];
|
|
20388
20428
|
if (this.eatContextual(113)) do
|
|
20389
|
-
|
|
20429
|
+
mixins.push(this.flowParseInterfaceExtends());
|
|
20390
20430
|
while (this.eat(8));
|
|
20391
20431
|
if (this.eatContextual(109)) do
|
|
20392
|
-
|
|
20432
|
+
implementsList.push(this.flowParseInterfaceExtends());
|
|
20393
20433
|
while (this.eat(8));
|
|
20434
|
+
node.mixins = mixins;
|
|
20435
|
+
node.implements = implementsList;
|
|
20394
20436
|
}
|
|
20395
20437
|
node.body = this.flowParseObjectType({
|
|
20396
20438
|
allowStatic: isClass,
|
|
@@ -20424,7 +20466,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20424
20466
|
}
|
|
20425
20467
|
flowParseTypeAlias(node) {
|
|
20426
20468
|
node.id = this.flowParseRestrictedIdentifier(false, true);
|
|
20427
|
-
this.scope.declareName(node.id.name, 8201, node.id.
|
|
20469
|
+
this.scope.declareName(node.id.name, 8201, node.id.start);
|
|
20428
20470
|
if (this.match(43)) node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
20429
20471
|
else node.typeParameters = null;
|
|
20430
20472
|
node.right = this.flowParseTypeInitialiser(25);
|
|
@@ -20434,7 +20476,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20434
20476
|
flowParseOpaqueType(node, declare) {
|
|
20435
20477
|
this.expectContextual(126);
|
|
20436
20478
|
node.id = this.flowParseRestrictedIdentifier(true, true);
|
|
20437
|
-
this.scope.declareName(node.id.name, 8201, node.id.
|
|
20479
|
+
this.scope.declareName(node.id.name, 8201, node.id.start);
|
|
20438
20480
|
if (this.match(43)) node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
20439
20481
|
else node.typeParameters = null;
|
|
20440
20482
|
node.supertype = null;
|
|
@@ -20567,7 +20609,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20567
20609
|
if (this.match(43) || this.match(6)) {
|
|
20568
20610
|
node.method = true;
|
|
20569
20611
|
node.optional = false;
|
|
20570
|
-
node.value = this.flowParseObjectTypeMethodish(this.
|
|
20612
|
+
node.value = this.flowParseObjectTypeMethodish(this.startNodeAtNode(node));
|
|
20571
20613
|
} else {
|
|
20572
20614
|
node.method = false;
|
|
20573
20615
|
if (this.eat(13)) node.optional = true;
|
|
@@ -20647,12 +20689,12 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20647
20689
|
if (this.eat(0)) {
|
|
20648
20690
|
if (protoStartLoc != null) this.unexpected(protoStartLoc);
|
|
20649
20691
|
if (this.eat(0)) {
|
|
20650
|
-
if (variance) this.unexpected(variance.
|
|
20692
|
+
if (variance) this.unexpected(variance.start);
|
|
20651
20693
|
nodeStart.internalSlots.push(this.flowParseObjectTypeInternalSlot(node, isStatic));
|
|
20652
20694
|
} else nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic, variance));
|
|
20653
20695
|
} else if (this.match(6) || this.match(43)) {
|
|
20654
20696
|
if (protoStartLoc != null) this.unexpected(protoStartLoc);
|
|
20655
|
-
if (variance) this.unexpected(variance.
|
|
20697
|
+
if (variance) this.unexpected(variance.start);
|
|
20656
20698
|
nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, isStatic));
|
|
20657
20699
|
} else {
|
|
20658
20700
|
let kind = "init";
|
|
@@ -20699,8 +20741,8 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20699
20741
|
if (this.match(43) || this.match(6)) {
|
|
20700
20742
|
node.method = true;
|
|
20701
20743
|
if (protoStartLoc != null) this.unexpected(protoStartLoc);
|
|
20702
|
-
if (variance) this.unexpected(variance.
|
|
20703
|
-
node.value = this.flowParseObjectTypeMethodish(this.
|
|
20744
|
+
if (variance) this.unexpected(variance.start);
|
|
20745
|
+
node.value = this.flowParseObjectTypeMethodish(this.startNodeAtNode(node));
|
|
20704
20746
|
if (kind === "get" || kind === "set") this.flowCheckGetterSetterParams(node);
|
|
20705
20747
|
if (!allowSpread && node.key.name === "constructor" && node.value.this) this.raise(FlowErrors.ThisParamBannedInConstructor, node.value.this);
|
|
20706
20748
|
} else {
|
|
@@ -20763,7 +20805,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20763
20805
|
flowParseFunctionTypeParam(first) {
|
|
20764
20806
|
let name = null;
|
|
20765
20807
|
let optional = false;
|
|
20766
|
-
let typeAnnotation
|
|
20808
|
+
let typeAnnotation;
|
|
20767
20809
|
const node = this.startNode();
|
|
20768
20810
|
const lh = this.lookahead();
|
|
20769
20811
|
const isThis = this.state.type === 74;
|
|
@@ -20782,7 +20824,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20782
20824
|
return this.finishNode(node, "FunctionTypeParam");
|
|
20783
20825
|
}
|
|
20784
20826
|
reinterpretTypeAsFunctionTypeParam(type) {
|
|
20785
|
-
const node = this.
|
|
20827
|
+
const node = this.startNodeAtNode(type);
|
|
20786
20828
|
node.name = null;
|
|
20787
20829
|
node.optional = false;
|
|
20788
20830
|
node.typeAnnotation = type;
|
|
@@ -20964,7 +21006,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
20964
21006
|
flowParseAnonFunctionWithoutParens() {
|
|
20965
21007
|
const param = this.flowParsePrefixType();
|
|
20966
21008
|
if (!this.state.noAnonFunctionType && this.eat(15)) {
|
|
20967
|
-
const node = this.
|
|
21009
|
+
const node = this.startNodeAtNode(param);
|
|
20968
21010
|
node.params = [this.reinterpretTypeAsFunctionTypeParam(param)];
|
|
20969
21011
|
node.rest = null;
|
|
20970
21012
|
node.this = null;
|
|
@@ -21019,7 +21061,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21019
21061
|
}
|
|
21020
21062
|
typeCastToParameter(node) {
|
|
21021
21063
|
node.expression.typeAnnotation = node.typeAnnotation;
|
|
21022
|
-
this.
|
|
21064
|
+
this.resetEndLocationFromNode(node.expression, node.typeAnnotation);
|
|
21023
21065
|
return node.expression;
|
|
21024
21066
|
}
|
|
21025
21067
|
flowParseVariance() {
|
|
@@ -21108,7 +21150,9 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21108
21150
|
const originalNoArrowAt = this.state.noArrowAt;
|
|
21109
21151
|
const node = this.startNodeAt(startLoc);
|
|
21110
21152
|
let { consequent, failed } = this.tryParseConditionalConsequent();
|
|
21111
|
-
|
|
21153
|
+
const result = this.getArrowLikeExpressions(consequent);
|
|
21154
|
+
let valid = result[0];
|
|
21155
|
+
const invalid = result[1];
|
|
21112
21156
|
if (failed || invalid.length > 0) {
|
|
21113
21157
|
const noArrowAt = [...originalNoArrowAt];
|
|
21114
21158
|
if (invalid.length > 0) {
|
|
@@ -21116,14 +21160,14 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21116
21160
|
this.state.noArrowAt = noArrowAt;
|
|
21117
21161
|
for (let i = 0; i < invalid.length; i++) noArrowAt.push(invalid[i].start);
|
|
21118
21162
|
({consequent, failed} = this.tryParseConditionalConsequent());
|
|
21119
|
-
[valid
|
|
21163
|
+
[valid] = this.getArrowLikeExpressions(consequent);
|
|
21120
21164
|
}
|
|
21121
21165
|
if (failed && valid.length > 1) this.raise(FlowErrors.AmbiguousConditionalArrow, state.startLoc);
|
|
21122
21166
|
if (failed && valid.length === 1) {
|
|
21123
21167
|
this.state = state;
|
|
21124
21168
|
noArrowAt.push(valid[0].start);
|
|
21125
21169
|
this.state.noArrowAt = noArrowAt;
|
|
21126
|
-
({consequent
|
|
21170
|
+
({consequent} = this.tryParseConditionalConsequent());
|
|
21127
21171
|
}
|
|
21128
21172
|
}
|
|
21129
21173
|
this.getArrowLikeExpressions(consequent, true);
|
|
@@ -21292,7 +21336,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21292
21336
|
toReferencedList(exprList, isParenthesizedExpr) {
|
|
21293
21337
|
for (let i = 0; i < exprList.length; i++) {
|
|
21294
21338
|
const expr = exprList[i];
|
|
21295
|
-
if (expr
|
|
21339
|
+
if (expr?.type === "TypeCastExpression" && !expr.extra?.parenthesized && (exprList.length > 1 || !isParenthesizedExpr)) this.raise(FlowErrors.TypeCastInPattern, expr.typeAnnotation);
|
|
21296
21340
|
}
|
|
21297
21341
|
return exprList;
|
|
21298
21342
|
}
|
|
@@ -21322,7 +21366,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21322
21366
|
return !this.match(10) && super.isNonstaticConstructor(method);
|
|
21323
21367
|
}
|
|
21324
21368
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
21325
|
-
if (method.variance) this.unexpected(method.variance.
|
|
21369
|
+
if (method.variance) this.unexpected(method.variance.start);
|
|
21326
21370
|
delete method.variance;
|
|
21327
21371
|
if (this.match(43)) method.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
21328
21372
|
super.pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper);
|
|
@@ -21335,7 +21379,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21335
21379
|
}
|
|
21336
21380
|
}
|
|
21337
21381
|
pushClassPrivateMethod(classBody, method, isGenerator, isAsync) {
|
|
21338
|
-
if (method.variance) this.unexpected(method.variance.
|
|
21382
|
+
if (method.variance) this.unexpected(method.variance.start);
|
|
21339
21383
|
delete method.variance;
|
|
21340
21384
|
if (this.match(43)) method.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
21341
21385
|
super.pushClassPrivateMethod(classBody, method, isGenerator, isAsync);
|
|
@@ -21368,7 +21412,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21368
21412
|
node.variance = this.flowParseVariance();
|
|
21369
21413
|
}
|
|
21370
21414
|
parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
|
|
21371
|
-
if (prop.variance) this.unexpected(prop.variance.
|
|
21415
|
+
if (prop.variance) this.unexpected(prop.variance.start);
|
|
21372
21416
|
delete prop.variance;
|
|
21373
21417
|
let typeParameters;
|
|
21374
21418
|
if (this.match(43) && !isAccessor) {
|
|
@@ -21455,8 +21499,8 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21455
21499
|
}
|
|
21456
21500
|
const specifierIsTypeImport = hasTypeImportKind(specifier);
|
|
21457
21501
|
if (isInTypeOnlyImport && specifierIsTypeImport) this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
|
|
21458
|
-
if (isInTypeOnlyImport || specifierIsTypeImport) this.checkReservedType(specifier.local.name, specifier.local.
|
|
21459
|
-
if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) this.checkReservedWord(specifier.local.name, specifier.
|
|
21502
|
+
if (isInTypeOnlyImport || specifierIsTypeImport) this.checkReservedType(specifier.local.name, specifier.local.start, true);
|
|
21503
|
+
if (isBinding && !isInTypeOnlyImport && !specifierIsTypeImport) this.checkReservedWord(specifier.local.name, specifier.start, true, true);
|
|
21460
21504
|
return this.finishImportSpecifier(specifier, "ImportSpecifier");
|
|
21461
21505
|
}
|
|
21462
21506
|
parseBindingAtom() {
|
|
@@ -21569,8 +21613,8 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21569
21613
|
for (let i = 0; i < node.params.length; i++) if (this.isThisParam(node.params[i]) && i > 0) this.raise(FlowErrors.ThisParamMustBeFirst, node.params[i]);
|
|
21570
21614
|
super.checkParams(node, allowDuplicates, isArrowFunction, strictModeChanged);
|
|
21571
21615
|
}
|
|
21572
|
-
parseParenAndDistinguishExpression(
|
|
21573
|
-
return super.parseParenAndDistinguishExpression(
|
|
21616
|
+
parseParenAndDistinguishExpression(canStartArrow) {
|
|
21617
|
+
return super.parseParenAndDistinguishExpression(canStartArrow && !this.state.noArrowAt.includes(this.sourceToOffsetPos(this.state.start)));
|
|
21574
21618
|
}
|
|
21575
21619
|
parseSubscripts(base, startLoc, noCalls) {
|
|
21576
21620
|
if (base.type === "Identifier" && base.name === "async" && this.state.noArrowAt.includes(startLoc.index)) {
|
|
@@ -21691,11 +21735,8 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21691
21735
|
hasFlowCommentCompletion() {
|
|
21692
21736
|
if (this.input.indexOf("*/", this.state.pos) === -1) throw this.raise(Errors.UnterminatedComment, this.state.curPosition());
|
|
21693
21737
|
}
|
|
21694
|
-
flowEnumErrorBooleanMemberNotInitialized(loc,
|
|
21695
|
-
this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc,
|
|
21696
|
-
memberName,
|
|
21697
|
-
enumName
|
|
21698
|
-
});
|
|
21738
|
+
flowEnumErrorBooleanMemberNotInitialized(loc, names) {
|
|
21739
|
+
this.raise(FlowErrors.EnumBooleanMemberNotInitialized, loc, names);
|
|
21699
21740
|
}
|
|
21700
21741
|
flowEnumErrorInvalidMemberInitializer(loc, enumContext) {
|
|
21701
21742
|
return this.raise(!enumContext.explicitType ? FlowErrors.EnumInvalidMemberInitializerUnknownType : enumContext.explicitType === "symbol" ? FlowErrors.EnumInvalidMemberInitializerSymbolType : FlowErrors.EnumInvalidMemberInitializerPrimaryType, loc, enumContext);
|
|
@@ -21714,44 +21755,34 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21714
21755
|
const literal = this.parseNumericLiteral(this.state.value);
|
|
21715
21756
|
if (endOfInit()) return {
|
|
21716
21757
|
type: "number",
|
|
21717
|
-
loc: literal.
|
|
21758
|
+
loc: literal.start,
|
|
21718
21759
|
value: literal
|
|
21719
21760
|
};
|
|
21720
|
-
|
|
21721
|
-
type: "invalid",
|
|
21722
|
-
loc: startLoc
|
|
21723
|
-
};
|
|
21761
|
+
break;
|
|
21724
21762
|
}
|
|
21725
21763
|
case 130: {
|
|
21726
21764
|
const literal = this.parseStringLiteral(this.state.value);
|
|
21727
21765
|
if (endOfInit()) return {
|
|
21728
21766
|
type: "string",
|
|
21729
|
-
loc: literal.
|
|
21767
|
+
loc: literal.start,
|
|
21730
21768
|
value: literal
|
|
21731
21769
|
};
|
|
21732
|
-
|
|
21733
|
-
type: "invalid",
|
|
21734
|
-
loc: startLoc
|
|
21735
|
-
};
|
|
21770
|
+
break;
|
|
21736
21771
|
}
|
|
21737
21772
|
case 81:
|
|
21738
21773
|
case 82: {
|
|
21739
21774
|
const literal = this.parseBooleanLiteral(this.match(81));
|
|
21740
21775
|
if (endOfInit()) return {
|
|
21741
21776
|
type: "boolean",
|
|
21742
|
-
loc: literal.
|
|
21777
|
+
loc: literal.start,
|
|
21743
21778
|
value: literal
|
|
21744
21779
|
};
|
|
21745
|
-
return {
|
|
21746
|
-
type: "invalid",
|
|
21747
|
-
loc: startLoc
|
|
21748
|
-
};
|
|
21749
21780
|
}
|
|
21750
|
-
default: return {
|
|
21751
|
-
type: "invalid",
|
|
21752
|
-
loc: startLoc
|
|
21753
|
-
};
|
|
21754
21781
|
}
|
|
21782
|
+
return {
|
|
21783
|
+
type: "invalid",
|
|
21784
|
+
loc: startLoc
|
|
21785
|
+
};
|
|
21755
21786
|
}
|
|
21756
21787
|
flowEnumMemberRaw() {
|
|
21757
21788
|
const loc = this.state.startLoc;
|
|
@@ -21860,7 +21891,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21860
21891
|
}
|
|
21861
21892
|
flowEnumBody(node, id) {
|
|
21862
21893
|
const enumName = id.name;
|
|
21863
|
-
const nameLoc = id.
|
|
21894
|
+
const nameLoc = id.start;
|
|
21864
21895
|
const explicitType = this.flowEnumParseExplicitType({ enumName });
|
|
21865
21896
|
this.expect(2);
|
|
21866
21897
|
const { members, hasUnknownMembers } = this.flowEnumMembers({
|
|
@@ -21905,7 +21936,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21905
21936
|
this.expect(4);
|
|
21906
21937
|
return this.finishNode(node, "EnumStringBody");
|
|
21907
21938
|
} else if (!numsLen && !strsLen && boolsLen >= defaultedLen) {
|
|
21908
|
-
for (const member of members.defaultedMembers) this.flowEnumErrorBooleanMemberNotInitialized(member.
|
|
21939
|
+
for (const member of members.defaultedMembers) this.flowEnumErrorBooleanMemberNotInitialized(member.start, {
|
|
21909
21940
|
enumName,
|
|
21910
21941
|
memberName: member.id.name
|
|
21911
21942
|
});
|
|
@@ -21913,7 +21944,7 @@ var flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
21913
21944
|
this.expect(4);
|
|
21914
21945
|
return this.finishNode(node, "EnumBooleanBody");
|
|
21915
21946
|
} else if (!boolsLen && !strsLen && numsLen >= defaultedLen) {
|
|
21916
|
-
for (const member of members.defaultedMembers) this.flowEnumErrorNumberMemberNotInitialized(member.
|
|
21947
|
+
for (const member of members.defaultedMembers) this.flowEnumErrorNumberMemberNotInitialized(member.start, {
|
|
21917
21948
|
enumName,
|
|
21918
21949
|
memberName: member.id.name
|
|
21919
21950
|
});
|
|
@@ -22461,8 +22492,8 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
22461
22492
|
return this.finishNode(node, "JSXExpressionContainer");
|
|
22462
22493
|
}
|
|
22463
22494
|
jsxParseAttribute() {
|
|
22464
|
-
const node = this.startNode();
|
|
22465
22495
|
if (this.match(2)) {
|
|
22496
|
+
const node = this.startNode();
|
|
22466
22497
|
this.setContext(types.brace);
|
|
22467
22498
|
this.next();
|
|
22468
22499
|
this.expect(17);
|
|
@@ -22472,13 +22503,17 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
22472
22503
|
this.expect(4);
|
|
22473
22504
|
return this.finishNode(node, "JSXSpreadAttribute");
|
|
22474
22505
|
}
|
|
22506
|
+
const node = this.startNode();
|
|
22475
22507
|
node.name = this.jsxParseNamespacedName();
|
|
22476
22508
|
node.value = this.eat(25) ? this.jsxParseAttributeValue() : null;
|
|
22477
22509
|
return this.finishNode(node, "JSXAttribute");
|
|
22478
22510
|
}
|
|
22479
22511
|
jsxParseOpeningElementAt(startLoc) {
|
|
22512
|
+
if (this.eat(139)) {
|
|
22513
|
+
const node = this.startNodeAt(startLoc);
|
|
22514
|
+
return this.finishNode(node, "JSXOpeningFragment");
|
|
22515
|
+
}
|
|
22480
22516
|
const node = this.startNodeAt(startLoc);
|
|
22481
|
-
if (this.eat(139)) return this.finishNode(node, "JSXOpeningFragment");
|
|
22482
22517
|
node.name = this.jsxParseElementName();
|
|
22483
22518
|
return this.jsxParseOpeningElementAfterName(node);
|
|
22484
22519
|
}
|
|
@@ -22491,8 +22526,11 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
22491
22526
|
return this.finishNode(node, "JSXOpeningElement");
|
|
22492
22527
|
}
|
|
22493
22528
|
jsxParseClosingElementAt(startLoc) {
|
|
22529
|
+
if (this.eat(139)) {
|
|
22530
|
+
const node = this.startNodeAt(startLoc);
|
|
22531
|
+
return this.finishNode(node, "JSXClosingFragment");
|
|
22532
|
+
}
|
|
22494
22533
|
const node = this.startNodeAt(startLoc);
|
|
22495
|
-
if (this.eat(139)) return this.finishNode(node, "JSXClosingFragment");
|
|
22496
22534
|
node.name = this.jsxParseElementName();
|
|
22497
22535
|
this.expect(139);
|
|
22498
22536
|
return this.finishNode(node, "JSXClosingElement");
|
|
@@ -22508,6 +22546,7 @@ var jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
22508
22546
|
startLoc = this.state.startLoc;
|
|
22509
22547
|
this.next();
|
|
22510
22548
|
if (this.eat(52)) {
|
|
22549
|
+
this.setLoc(startLoc);
|
|
22511
22550
|
closingElement = this.jsxParseClosingElementAt(startLoc);
|
|
22512
22551
|
break contents;
|
|
22513
22552
|
}
|
|
@@ -22705,6 +22744,9 @@ var ProductionParameterHandler = class {
|
|
|
22705
22744
|
get hasIn() {
|
|
22706
22745
|
return (this.currentFlags() & 8) > 0;
|
|
22707
22746
|
}
|
|
22747
|
+
get inFSharpPipelineDirectBody() {
|
|
22748
|
+
return (this.currentFlags() & 16) === 0;
|
|
22749
|
+
}
|
|
22708
22750
|
};
|
|
22709
22751
|
function functionFlags(isAsync, isGenerator) {
|
|
22710
22752
|
return (isAsync ? 2 : 0) | (isGenerator ? 1 : 0);
|
|
@@ -22769,7 +22811,7 @@ var CommentsParser = class extends BaseParser {
|
|
|
22769
22811
|
lastCommentWS.leadingNode = node;
|
|
22770
22812
|
i--;
|
|
22771
22813
|
}
|
|
22772
|
-
const
|
|
22814
|
+
const nodeStart = node.start;
|
|
22773
22815
|
for (; i >= 0; i--) {
|
|
22774
22816
|
const commentWS = commentStack[i];
|
|
22775
22817
|
const commentEnd = commentWS.end;
|
|
@@ -22797,6 +22839,7 @@ var CommentsParser = class extends BaseParser {
|
|
|
22797
22839
|
adjustInnerComments(node, node.properties, commentWS);
|
|
22798
22840
|
break;
|
|
22799
22841
|
case "CallExpression":
|
|
22842
|
+
case "NewExpression":
|
|
22800
22843
|
case "OptionalCallExpression":
|
|
22801
22844
|
adjustInnerComments(node, node.arguments, commentWS);
|
|
22802
22845
|
break;
|
|
@@ -22809,6 +22852,7 @@ var CommentsParser = class extends BaseParser {
|
|
|
22809
22852
|
case "ObjectMethod":
|
|
22810
22853
|
case "ClassMethod":
|
|
22811
22854
|
case "ClassPrivateMethod":
|
|
22855
|
+
case "TSTypeParameterDeclaration":
|
|
22812
22856
|
adjustInnerComments(node, node.params, commentWS);
|
|
22813
22857
|
break;
|
|
22814
22858
|
case "ArrayExpression":
|
|
@@ -22819,12 +22863,12 @@ var CommentsParser = class extends BaseParser {
|
|
|
22819
22863
|
case "ImportDeclaration":
|
|
22820
22864
|
adjustInnerComments(node, node.specifiers, commentWS);
|
|
22821
22865
|
break;
|
|
22822
|
-
case "TSEnumDeclaration":
|
|
22823
|
-
setInnerComments(node, comments);
|
|
22824
|
-
break;
|
|
22825
22866
|
case "TSEnumBody":
|
|
22826
22867
|
adjustInnerComments(node, node.members, commentWS);
|
|
22827
22868
|
break;
|
|
22869
|
+
case "TSInterfaceBody":
|
|
22870
|
+
adjustInnerComments(node, node.body, commentWS);
|
|
22871
|
+
break;
|
|
22828
22872
|
default: setInnerComments(node, comments);
|
|
22829
22873
|
}
|
|
22830
22874
|
else setInnerComments(node, comments);
|
|
@@ -22857,7 +22901,7 @@ var CommentsParser = class extends BaseParser {
|
|
|
22857
22901
|
}
|
|
22858
22902
|
};
|
|
22859
22903
|
var State = class State {
|
|
22860
|
-
flags =
|
|
22904
|
+
flags = 2048;
|
|
22861
22905
|
get strict() {
|
|
22862
22906
|
return (this.flags & 1) > 0;
|
|
22863
22907
|
}
|
|
@@ -22878,69 +22922,78 @@ var State = class State {
|
|
|
22878
22922
|
this.startLoc = this.endLoc = new Position(startLine, startColumn, startIndex);
|
|
22879
22923
|
}
|
|
22880
22924
|
errors = [];
|
|
22881
|
-
potentialArrowAt = -1;
|
|
22882
22925
|
noArrowAt = [];
|
|
22883
22926
|
noArrowParamsConversionAt = [];
|
|
22884
|
-
get
|
|
22927
|
+
get canStartArrow() {
|
|
22885
22928
|
return (this.flags & 2) > 0;
|
|
22886
22929
|
}
|
|
22887
|
-
set
|
|
22930
|
+
set canStartArrow(v) {
|
|
22888
22931
|
if (v) this.flags |= 2;
|
|
22889
22932
|
else this.flags &= -3;
|
|
22890
22933
|
}
|
|
22891
|
-
get
|
|
22934
|
+
get inType() {
|
|
22892
22935
|
return (this.flags & 4) > 0;
|
|
22893
22936
|
}
|
|
22894
|
-
set
|
|
22937
|
+
set inType(v) {
|
|
22895
22938
|
if (v) this.flags |= 4;
|
|
22896
22939
|
else this.flags &= -5;
|
|
22897
22940
|
}
|
|
22898
|
-
get
|
|
22941
|
+
get noAnonFunctionType() {
|
|
22899
22942
|
return (this.flags & 8) > 0;
|
|
22900
22943
|
}
|
|
22901
|
-
set
|
|
22944
|
+
set noAnonFunctionType(v) {
|
|
22902
22945
|
if (v) this.flags |= 8;
|
|
22903
22946
|
else this.flags &= -9;
|
|
22904
22947
|
}
|
|
22905
|
-
get
|
|
22948
|
+
get hasFlowComment() {
|
|
22906
22949
|
return (this.flags & 16) > 0;
|
|
22907
22950
|
}
|
|
22908
|
-
set
|
|
22951
|
+
set hasFlowComment(v) {
|
|
22909
22952
|
if (v) this.flags |= 16;
|
|
22910
22953
|
else this.flags &= -17;
|
|
22911
22954
|
}
|
|
22912
|
-
get
|
|
22955
|
+
get isAmbientContext() {
|
|
22913
22956
|
return (this.flags & 32) > 0;
|
|
22914
22957
|
}
|
|
22915
|
-
set
|
|
22958
|
+
set isAmbientContext(v) {
|
|
22916
22959
|
if (v) this.flags |= 32;
|
|
22917
22960
|
else this.flags &= -33;
|
|
22918
22961
|
}
|
|
22919
|
-
get
|
|
22962
|
+
get inAbstractClass() {
|
|
22920
22963
|
return (this.flags & 64) > 0;
|
|
22921
22964
|
}
|
|
22922
|
-
set
|
|
22965
|
+
set inAbstractClass(v) {
|
|
22923
22966
|
if (v) this.flags |= 64;
|
|
22924
22967
|
else this.flags &= -65;
|
|
22925
22968
|
}
|
|
22926
|
-
|
|
22927
|
-
maxNumOfResolvableTopics: 0,
|
|
22928
|
-
maxTopicIndex: null
|
|
22929
|
-
};
|
|
22930
|
-
get soloAwait() {
|
|
22969
|
+
get inDisallowConditionalTypesContext() {
|
|
22931
22970
|
return (this.flags & 128) > 0;
|
|
22932
22971
|
}
|
|
22933
|
-
set
|
|
22972
|
+
set inDisallowConditionalTypesContext(v) {
|
|
22934
22973
|
if (v) this.flags |= 128;
|
|
22935
22974
|
else this.flags &= -129;
|
|
22936
22975
|
}
|
|
22937
|
-
get
|
|
22976
|
+
get inConditionalConsequent() {
|
|
22938
22977
|
return (this.flags & 256) > 0;
|
|
22939
22978
|
}
|
|
22940
|
-
set
|
|
22979
|
+
set inConditionalConsequent(v) {
|
|
22941
22980
|
if (v) this.flags |= 256;
|
|
22942
22981
|
else this.flags &= -257;
|
|
22943
22982
|
}
|
|
22983
|
+
get inHackPipelineBody() {
|
|
22984
|
+
return (this.flags & 512) > 0;
|
|
22985
|
+
}
|
|
22986
|
+
set inHackPipelineBody(v) {
|
|
22987
|
+
if (v) this.flags |= 512;
|
|
22988
|
+
else this.flags &= -513;
|
|
22989
|
+
}
|
|
22990
|
+
get seenTopicReference() {
|
|
22991
|
+
return (this.flags & 1024) > 0;
|
|
22992
|
+
}
|
|
22993
|
+
set seenTopicReference(v) {
|
|
22994
|
+
if (v) this.flags |= 1024;
|
|
22995
|
+
else this.flags &= -1025;
|
|
22996
|
+
}
|
|
22944
22997
|
labels = [];
|
|
22945
22998
|
commentsLen = 0;
|
|
22946
22999
|
commentStack = [];
|
|
@@ -22953,26 +23006,26 @@ var State = class State {
|
|
|
22953
23006
|
lastTokStartLoc = null;
|
|
22954
23007
|
context = [types.brace];
|
|
22955
23008
|
get canStartJSXElement() {
|
|
22956
|
-
return (this.flags &
|
|
23009
|
+
return (this.flags & 2048) > 0;
|
|
22957
23010
|
}
|
|
22958
23011
|
set canStartJSXElement(v) {
|
|
22959
|
-
if (v) this.flags |=
|
|
22960
|
-
else this.flags &= -
|
|
23012
|
+
if (v) this.flags |= 2048;
|
|
23013
|
+
else this.flags &= -2049;
|
|
22961
23014
|
}
|
|
22962
23015
|
get containsEsc() {
|
|
22963
|
-
return (this.flags &
|
|
23016
|
+
return (this.flags & 4096) > 0;
|
|
22964
23017
|
}
|
|
22965
23018
|
set containsEsc(v) {
|
|
22966
|
-
if (v) this.flags |=
|
|
22967
|
-
else this.flags &= -
|
|
23019
|
+
if (v) this.flags |= 4096;
|
|
23020
|
+
else this.flags &= -4097;
|
|
22968
23021
|
}
|
|
22969
23022
|
firstInvalidTemplateEscapePos = null;
|
|
22970
23023
|
get hasTopLevelAwait() {
|
|
22971
|
-
return (this.flags &
|
|
23024
|
+
return (this.flags & 8192) > 0;
|
|
22972
23025
|
}
|
|
22973
23026
|
set hasTopLevelAwait(v) {
|
|
22974
|
-
if (v) this.flags |=
|
|
22975
|
-
else this.flags &= -
|
|
23027
|
+
if (v) this.flags |= 8192;
|
|
23028
|
+
else this.flags &= -8193;
|
|
22976
23029
|
}
|
|
22977
23030
|
strictErrors = /* @__PURE__ */ new Map();
|
|
22978
23031
|
tokensLength = 0;
|
|
@@ -22988,10 +23041,8 @@ var State = class State {
|
|
|
22988
23041
|
state.startLoc = this.startLoc;
|
|
22989
23042
|
state.endLoc = this.endLoc;
|
|
22990
23043
|
state.errors = this.errors.slice();
|
|
22991
|
-
state.potentialArrowAt = this.potentialArrowAt;
|
|
22992
23044
|
state.noArrowAt = this.noArrowAt.slice();
|
|
22993
23045
|
state.noArrowParamsConversionAt = this.noArrowParamsConversionAt.slice();
|
|
22994
|
-
state.topicContext = this.topicContext;
|
|
22995
23046
|
state.labels = this.labels.slice();
|
|
22996
23047
|
state.commentsLen = this.commentsLen;
|
|
22997
23048
|
state.commentStack = this.commentStack.slice();
|
|
@@ -23250,6 +23301,12 @@ var Token = class {
|
|
|
23250
23301
|
this.loc = new SourceLocation(state.startLoc, state.endLoc);
|
|
23251
23302
|
}
|
|
23252
23303
|
};
|
|
23304
|
+
let locDataCache;
|
|
23305
|
+
function resetLocData() {
|
|
23306
|
+
const data = locDataCache;
|
|
23307
|
+
locDataCache = void 0;
|
|
23308
|
+
return data;
|
|
23309
|
+
}
|
|
23253
23310
|
var Tokenizer = class extends CommentsParser {
|
|
23254
23311
|
isLookahead;
|
|
23255
23312
|
tokens = [];
|
|
@@ -23261,6 +23318,17 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23261
23318
|
this.length = input.length;
|
|
23262
23319
|
this.comments = [];
|
|
23263
23320
|
this.isLookahead = false;
|
|
23321
|
+
if (!locDataCache || locDataCache.length < (this.length + 1) * 2 || options.locations === "packed") locDataCache = new Uint32Array((this.length + 1) * 2);
|
|
23322
|
+
this.locData = locDataCache;
|
|
23323
|
+
}
|
|
23324
|
+
setLoc(loc) {
|
|
23325
|
+
const dataIndex = this.offsetToSourcePos(loc.index);
|
|
23326
|
+
this.locData[dataIndex * 2] = loc.line;
|
|
23327
|
+
this.locData[dataIndex * 2 + 1] = loc.column;
|
|
23328
|
+
}
|
|
23329
|
+
getLoc(locIndex) {
|
|
23330
|
+
const dataIndex = this.offsetToSourcePos(locIndex);
|
|
23331
|
+
return new Position(this.locData[dataIndex * 2], this.locData[dataIndex * 2 + 1], locIndex);
|
|
23264
23332
|
}
|
|
23265
23333
|
pushToken(token) {
|
|
23266
23334
|
this.tokens.length = this.state.tokensLength;
|
|
@@ -23269,7 +23337,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23269
23337
|
}
|
|
23270
23338
|
next() {
|
|
23271
23339
|
this.checkKeywordEscapes();
|
|
23272
|
-
if (this.optionFlags &
|
|
23340
|
+
if (this.optionFlags & 512) this.pushToken(new Token(this.state));
|
|
23273
23341
|
this.state.lastTokEndLoc = this.state.endLoc;
|
|
23274
23342
|
this.state.lastTokStartLoc = this.state.startLoc;
|
|
23275
23343
|
this.nextToken();
|
|
@@ -23380,7 +23448,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23380
23448
|
end: this.sourceToOffsetPos(end + commentEnd.length),
|
|
23381
23449
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
|
23382
23450
|
};
|
|
23383
|
-
if (this.optionFlags &
|
|
23451
|
+
if (this.optionFlags & 512) this.pushToken(comment);
|
|
23384
23452
|
return comment;
|
|
23385
23453
|
}
|
|
23386
23454
|
skipLineComment(startSkip) {
|
|
@@ -23398,12 +23466,12 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23398
23466
|
end: this.sourceToOffsetPos(end),
|
|
23399
23467
|
loc: new SourceLocation(startLoc, this.state.curPosition())
|
|
23400
23468
|
};
|
|
23401
|
-
if (this.optionFlags &
|
|
23469
|
+
if (this.optionFlags & 512) this.pushToken(comment);
|
|
23402
23470
|
return comment;
|
|
23403
23471
|
}
|
|
23404
23472
|
skipSpace() {
|
|
23405
23473
|
const spaceStart = this.state.pos;
|
|
23406
|
-
const comments = this.optionFlags &
|
|
23474
|
+
const comments = this.optionFlags & 8192 ? [] : null;
|
|
23407
23475
|
loop: while (this.state.pos < this.length) {
|
|
23408
23476
|
const ch = this.input.charCodeAt(this.state.pos);
|
|
23409
23477
|
switch (ch) {
|
|
@@ -23442,7 +23510,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23442
23510
|
}
|
|
23443
23511
|
break;
|
|
23444
23512
|
default: if (isWhitespace(ch)) ++this.state.pos;
|
|
23445
|
-
else if (ch === 45 && !this.inModule && this.optionFlags &
|
|
23513
|
+
else if (ch === 45 && !this.inModule && this.optionFlags & 16384) {
|
|
23446
23514
|
const pos = this.state.pos;
|
|
23447
23515
|
if (this.input.charCodeAt(pos + 1) === 45 && this.input.charCodeAt(pos + 2) === 62 && (spaceStart === 0 || this.state.lineStart > spaceStart)) {
|
|
23448
23516
|
const comment = this.skipLineComment(3);
|
|
@@ -23451,7 +23519,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23451
23519
|
comments?.push(comment);
|
|
23452
23520
|
}
|
|
23453
23521
|
} else break loop;
|
|
23454
|
-
} else if (ch === 60 && !this.inModule && this.optionFlags &
|
|
23522
|
+
} else if (ch === 60 && !this.inModule && this.optionFlags & 16384) {
|
|
23455
23523
|
const pos = this.state.pos;
|
|
23456
23524
|
if (this.input.charCodeAt(pos + 1) === 33 && this.input.charCodeAt(pos + 2) === 45 && this.input.charCodeAt(pos + 3) === 45) {
|
|
23457
23525
|
const comment = this.skipLineComment(4);
|
|
@@ -23881,13 +23949,13 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23881
23949
|
isFloat = true;
|
|
23882
23950
|
next = this.input.charCodeAt(this.state.pos);
|
|
23883
23951
|
}
|
|
23952
|
+
const str = this.input.slice(start, this.state.pos).replaceAll("_", "");
|
|
23884
23953
|
if (next === 110) {
|
|
23885
23954
|
if (isFloat || hasLeadingZero) this.raise(Errors.InvalidBigIntLiteral, startLoc);
|
|
23886
23955
|
++this.state.pos;
|
|
23887
23956
|
isBigInt = true;
|
|
23888
23957
|
}
|
|
23889
23958
|
if (isIdentifierStart(this.codePointAtPos(this.state.pos))) throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
|
23890
|
-
const str = this.input.slice(start, this.state.pos).replace(/[_mn]/g, "");
|
|
23891
23959
|
if (isBigInt) {
|
|
23892
23960
|
this.finishToken(132, str);
|
|
23893
23961
|
return;
|
|
@@ -23971,21 +24039,22 @@ var Tokenizer = class extends CommentsParser {
|
|
|
23971
24039
|
if (tokenIsKeyword(type) && this.state.containsEsc) this.raise(Errors.InvalidEscapedReservedWord, this.state.startLoc, { reservedWord: tokenLabelName(type) });
|
|
23972
24040
|
}
|
|
23973
24041
|
raise(toParseError, at, details = {}) {
|
|
23974
|
-
const
|
|
23975
|
-
|
|
24042
|
+
const loc = at instanceof Position ? at : typeof at === "number" ? this.getLoc(at) : this.optionFlags & 256 ? at.loc.start : this.getLoc(at.start);
|
|
24043
|
+
const error = toParseError(loc, at instanceof Position ? loc.index : typeof at === "number" ? at : at.start, details);
|
|
24044
|
+
if (!(this.optionFlags & 4096)) throw error;
|
|
23976
24045
|
if (!this.isLookahead) this.state.errors.push(error);
|
|
23977
24046
|
return error;
|
|
23978
24047
|
}
|
|
23979
24048
|
raiseOverwrite(toParseError, at, details = {}) {
|
|
23980
|
-
const loc = at instanceof Position ? at : at.loc.start;
|
|
23981
|
-
const pos = loc.index;
|
|
24049
|
+
const loc = at instanceof Position ? at : this.optionFlags & 256 ? at.loc.start : this.getLoc(at.start);
|
|
24050
|
+
const pos = at instanceof Position ? loc.index : at.start;
|
|
23982
24051
|
const errors = this.state.errors;
|
|
23983
24052
|
for (let i = errors.length - 1; i >= 0; i--) {
|
|
23984
24053
|
const error = errors[i];
|
|
23985
|
-
if (error.
|
|
23986
|
-
if (error.
|
|
24054
|
+
if (error.pos === pos) return errors[i] = toParseError(loc, pos, details);
|
|
24055
|
+
if (error.pos < pos) break;
|
|
23987
24056
|
}
|
|
23988
|
-
return this.raise(toParseError,
|
|
24057
|
+
return this.raise(toParseError, loc, details);
|
|
23989
24058
|
}
|
|
23990
24059
|
updateContext(prevType) {}
|
|
23991
24060
|
unexpected(loc, type) {
|
|
@@ -24005,7 +24074,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
24005
24074
|
}
|
|
24006
24075
|
errorHandlers_readInt = {
|
|
24007
24076
|
invalidDigit: (pos, lineStart, curLine, radix) => {
|
|
24008
|
-
if (!(this.optionFlags &
|
|
24077
|
+
if (!(this.optionFlags & 4096)) return false;
|
|
24009
24078
|
this.raise(Errors.InvalidDigit, buildPosition(pos, lineStart, curLine), { radix });
|
|
24010
24079
|
return true;
|
|
24011
24080
|
},
|
|
@@ -24042,7 +24111,6 @@ var ClassScope = class {
|
|
|
24042
24111
|
var ClassScopeHandler = class {
|
|
24043
24112
|
parser;
|
|
24044
24113
|
stack = [];
|
|
24045
|
-
undefinedPrivateNames = /* @__PURE__ */ new Map();
|
|
24046
24114
|
constructor(parser) {
|
|
24047
24115
|
this.parser = parser;
|
|
24048
24116
|
}
|
|
@@ -24098,9 +24166,8 @@ var ArrowHeadParsingScope = class extends ExpressionScope {
|
|
|
24098
24166
|
constructor(type) {
|
|
24099
24167
|
super(type);
|
|
24100
24168
|
}
|
|
24101
|
-
recordDeclarationError(ParsingErrorClass,
|
|
24102
|
-
|
|
24103
|
-
this.declarationErrors.set(index, [ParsingErrorClass, at]);
|
|
24169
|
+
recordDeclarationError(ParsingErrorClass, index) {
|
|
24170
|
+
this.declarationErrors.set(index, ParsingErrorClass);
|
|
24104
24171
|
}
|
|
24105
24172
|
clearDeclarationError(index) {
|
|
24106
24173
|
this.declarationErrors.delete(index);
|
|
@@ -24121,22 +24188,21 @@ var ExpressionScopeHandler = class {
|
|
|
24121
24188
|
exit() {
|
|
24122
24189
|
this.stack.pop();
|
|
24123
24190
|
}
|
|
24124
|
-
recordParameterInitializerError(toParseError,
|
|
24125
|
-
const origin = node.loc.start;
|
|
24191
|
+
recordParameterInitializerError(toParseError, loc) {
|
|
24126
24192
|
const { stack } = this;
|
|
24127
24193
|
let i = stack.length - 1;
|
|
24128
24194
|
let scope = stack[i];
|
|
24129
24195
|
while (!scope.isCertainlyParameterDeclaration()) {
|
|
24130
|
-
if (scope.canBeArrowParameterDeclaration()) scope.recordDeclarationError(toParseError,
|
|
24196
|
+
if (scope.canBeArrowParameterDeclaration()) scope.recordDeclarationError(toParseError, loc);
|
|
24131
24197
|
else return;
|
|
24132
24198
|
scope = stack[--i];
|
|
24133
24199
|
}
|
|
24134
|
-
this.parser.raise(toParseError,
|
|
24200
|
+
this.parser.raise(toParseError, loc);
|
|
24135
24201
|
}
|
|
24136
24202
|
recordArrowParameterBindingError(error, node) {
|
|
24137
24203
|
const { stack } = this;
|
|
24138
24204
|
const scope = stack[stack.length - 1];
|
|
24139
|
-
const origin = node.
|
|
24205
|
+
const origin = node.start;
|
|
24140
24206
|
if (scope.isCertainlyParameterDeclaration()) this.parser.raise(error, origin);
|
|
24141
24207
|
else if (scope.canBeArrowParameterDeclaration()) scope.recordDeclarationError(error, origin);
|
|
24142
24208
|
else return;
|
|
@@ -24154,12 +24220,12 @@ var ExpressionScopeHandler = class {
|
|
|
24154
24220
|
const { stack } = this;
|
|
24155
24221
|
const currentScope = stack[stack.length - 1];
|
|
24156
24222
|
if (!currentScope.canBeArrowParameterDeclaration()) return;
|
|
24157
|
-
currentScope.iterateErrors((
|
|
24158
|
-
this.parser.raise(toParseError,
|
|
24223
|
+
currentScope.iterateErrors((toParseError, key) => {
|
|
24224
|
+
this.parser.raise(toParseError, key);
|
|
24159
24225
|
let i = stack.length - 2;
|
|
24160
24226
|
let scope = stack[i];
|
|
24161
24227
|
while (scope.canBeArrowParameterDeclaration()) {
|
|
24162
|
-
scope.clearDeclarationError(
|
|
24228
|
+
scope.clearDeclarationError(key);
|
|
24163
24229
|
scope = stack[--i];
|
|
24164
24230
|
}
|
|
24165
24231
|
});
|
|
@@ -24362,51 +24428,79 @@ var ExpressionErrors = class {
|
|
|
24362
24428
|
voidPatternLoc = null;
|
|
24363
24429
|
};
|
|
24364
24430
|
var Node = class {
|
|
24365
|
-
constructor(
|
|
24431
|
+
constructor(optionFlags, filename, pos, loc) {
|
|
24366
24432
|
this.start = pos;
|
|
24367
24433
|
this.end = 0;
|
|
24368
|
-
this.loc = new SourceLocation(loc);
|
|
24369
|
-
if (
|
|
24370
|
-
if (
|
|
24434
|
+
if (loc !== void 0) this.loc = new SourceLocation(loc);
|
|
24435
|
+
if (optionFlags & 128) this.range = [pos, 0];
|
|
24436
|
+
if (loc !== void 0 && filename) this.loc.filename = filename;
|
|
24371
24437
|
}
|
|
24372
24438
|
type = "";
|
|
24373
24439
|
};
|
|
24374
24440
|
const NodePrototype = Node.prototype;
|
|
24375
24441
|
var NodeUtils = class extends UtilParser {
|
|
24442
|
+
createPosition(loc) {
|
|
24443
|
+
return loc;
|
|
24444
|
+
}
|
|
24376
24445
|
startNode() {
|
|
24377
|
-
const
|
|
24378
|
-
|
|
24446
|
+
const { startLoc } = this.state;
|
|
24447
|
+
this.setLoc(startLoc);
|
|
24448
|
+
return this.startNodeAt(startLoc);
|
|
24379
24449
|
}
|
|
24380
24450
|
startNodeAt(loc) {
|
|
24381
|
-
|
|
24451
|
+
const { optionFlags, filename } = this;
|
|
24452
|
+
if (!(optionFlags & 256)) return new Node(optionFlags, filename, loc.index);
|
|
24453
|
+
return new Node(optionFlags, filename, loc.index, this.createPosition(loc));
|
|
24382
24454
|
}
|
|
24383
24455
|
startNodeAtNode(type) {
|
|
24384
|
-
|
|
24456
|
+
const { optionFlags, filename } = this;
|
|
24457
|
+
if (!(optionFlags & 256)) return new Node(optionFlags, filename, type.start);
|
|
24458
|
+
return new Node(optionFlags, filename, type.start, type.loc.start);
|
|
24385
24459
|
}
|
|
24386
24460
|
finishNode(node, type) {
|
|
24387
24461
|
return this.finishNodeAt(node, type, this.state.lastTokEndLoc);
|
|
24388
24462
|
}
|
|
24389
24463
|
finishNodeAt(node, type, endLoc) {
|
|
24390
|
-
if (process.env.NODE_ENV !== "production" && node.end > 0) throw new Error("Do not call finishNode*() twice on the same node. Instead use resetEndLocation() or change type directly.");
|
|
24391
24464
|
node.type = type;
|
|
24392
24465
|
node.end = endLoc.index;
|
|
24393
|
-
|
|
24394
|
-
if (
|
|
24395
|
-
if (
|
|
24466
|
+
const { optionFlags } = this;
|
|
24467
|
+
if (optionFlags & 256) node.loc.end = this.createPosition(endLoc);
|
|
24468
|
+
if (optionFlags & 128) node.range[1] = endLoc.index;
|
|
24469
|
+
if (optionFlags & 8192) this.processComment(node);
|
|
24470
|
+
return node;
|
|
24471
|
+
}
|
|
24472
|
+
finishNodeAtNode(node, type, endNode) {
|
|
24473
|
+
node.type = type;
|
|
24474
|
+
node.end = endNode.end;
|
|
24475
|
+
const { optionFlags } = this;
|
|
24476
|
+
if (optionFlags & 256) node.loc.end = endNode.loc.end;
|
|
24477
|
+
if (optionFlags & 128) node.range[1] = node.end;
|
|
24478
|
+
if (optionFlags & 8192) this.processComment(node);
|
|
24396
24479
|
return node;
|
|
24397
24480
|
}
|
|
24398
24481
|
resetStartLocation(node, startLoc) {
|
|
24399
24482
|
node.start = startLoc.index;
|
|
24400
|
-
|
|
24401
|
-
if (
|
|
24483
|
+
const { optionFlags } = this;
|
|
24484
|
+
if (optionFlags & 256) node.loc.start = this.createPosition(startLoc);
|
|
24485
|
+
if (optionFlags & 128) node.range[0] = startLoc.index;
|
|
24402
24486
|
}
|
|
24403
24487
|
resetEndLocation(node, endLoc = this.state.lastTokEndLoc) {
|
|
24404
24488
|
node.end = endLoc.index;
|
|
24405
|
-
|
|
24406
|
-
if (
|
|
24489
|
+
const { optionFlags } = this;
|
|
24490
|
+
if (optionFlags & 256) node.loc.end = this.createPosition(endLoc);
|
|
24491
|
+
if (optionFlags & 128) node.range[1] = endLoc.index;
|
|
24407
24492
|
}
|
|
24408
24493
|
resetStartLocationFromNode(node, locationNode) {
|
|
24409
|
-
|
|
24494
|
+
node.start = locationNode.start;
|
|
24495
|
+
const { optionFlags } = this;
|
|
24496
|
+
if (optionFlags & 256) node.loc.start = locationNode.loc.start;
|
|
24497
|
+
if (optionFlags & 128) node.range[0] = locationNode.start;
|
|
24498
|
+
}
|
|
24499
|
+
resetEndLocationFromNode(node, locationNode) {
|
|
24500
|
+
node.end = locationNode.end;
|
|
24501
|
+
const { optionFlags } = this;
|
|
24502
|
+
if (optionFlags & 256) node.loc.end = locationNode.loc.end;
|
|
24503
|
+
if (optionFlags & 128) node.range[1] = locationNode.end;
|
|
24410
24504
|
}
|
|
24411
24505
|
castNodeTo(node, type) {
|
|
24412
24506
|
node.type = type;
|
|
@@ -24468,7 +24562,7 @@ var LValParser = class extends NodeUtils {
|
|
|
24468
24562
|
break;
|
|
24469
24563
|
case "ObjectProperty": {
|
|
24470
24564
|
const { key, value } = node;
|
|
24471
|
-
if (this.isPrivateName(key)) this.classScope.usePrivateName(this.getPrivateNameSV(key), key.
|
|
24565
|
+
if (this.isPrivateName(key)) this.classScope.usePrivateName(this.getPrivateNameSV(key), key.start);
|
|
24472
24566
|
this.toAssignable(value, isLHS);
|
|
24473
24567
|
break;
|
|
24474
24568
|
}
|
|
@@ -24478,7 +24572,7 @@ var LValParser = class extends NodeUtils {
|
|
|
24478
24572
|
this.toAssignableList(node.elements, node.extra?.trailingCommaLoc, isLHS);
|
|
24479
24573
|
break;
|
|
24480
24574
|
case "AssignmentExpression":
|
|
24481
|
-
if (node.operator !== "=") this.raise(Errors.MissingEqInAssignment, node.left.loc.end);
|
|
24575
|
+
if (node.operator !== "=") this.raise(Errors.MissingEqInAssignment, this.optionFlags & 256 ? node.left.loc.end : node.left);
|
|
24482
24576
|
this.castNodeTo(node, "AssignmentPattern");
|
|
24483
24577
|
delete node.operator;
|
|
24484
24578
|
if (node.left.type === "VoidPattern") this.raise(Errors.VoidPatternInitializer, node.left);
|
|
@@ -24624,13 +24718,14 @@ var LValParser = class extends NodeUtils {
|
|
|
24624
24718
|
return this.parseObjPropValue(prop, startLoc, false, false, true, false);
|
|
24625
24719
|
}
|
|
24626
24720
|
parseBindingElement(flags, decorators) {
|
|
24721
|
+
const { startLoc } = this.state;
|
|
24627
24722
|
const left = this.parseMaybeDefault();
|
|
24628
24723
|
if (flags & 2) this.parseFunctionParamType(left);
|
|
24629
24724
|
if (decorators.length) {
|
|
24630
24725
|
left.decorators = decorators;
|
|
24631
24726
|
this.resetStartLocationFromNode(left, decorators[0]);
|
|
24632
24727
|
}
|
|
24633
|
-
return this.parseMaybeDefault(
|
|
24728
|
+
return this.parseMaybeDefault(startLoc, left);
|
|
24634
24729
|
}
|
|
24635
24730
|
parseFunctionParamType(param) {
|
|
24636
24731
|
return param;
|
|
@@ -24654,7 +24749,7 @@ var LValParser = class extends NodeUtils {
|
|
|
24654
24749
|
case "ArrayPattern": return "elements";
|
|
24655
24750
|
case "ObjectPattern": return "properties";
|
|
24656
24751
|
case "VoidPattern": return true;
|
|
24657
|
-
case "CallExpression": if (!disallowCallExpression && !this.state.strict && this.optionFlags &
|
|
24752
|
+
case "CallExpression": if (!disallowCallExpression && !this.state.strict && this.optionFlags & 16384) return true;
|
|
24658
24753
|
}
|
|
24659
24754
|
return false;
|
|
24660
24755
|
}
|
|
@@ -24667,7 +24762,7 @@ var LValParser = class extends NodeUtils {
|
|
|
24667
24762
|
const isOptionalMemberExpression = this.isOptionalMemberExpression(expression);
|
|
24668
24763
|
if (isOptionalMemberExpression || type === "MemberExpression") {
|
|
24669
24764
|
if (isOptionalMemberExpression) {
|
|
24670
|
-
this.expectPlugin("optionalChainingAssign", expression.
|
|
24765
|
+
this.expectPlugin("optionalChainingAssign", expression.start);
|
|
24671
24766
|
if (ancestor.type !== "AssignmentExpression") this.raise(Errors.InvalidLhsOptionalChaining, expression, { ancestor });
|
|
24672
24767
|
}
|
|
24673
24768
|
if (binding !== 64) this.raise(Errors.InvalidPropertyBindingPattern, expression);
|
|
@@ -24707,7 +24802,7 @@ var LValParser = class extends NodeUtils {
|
|
|
24707
24802
|
if (!(bindingType & 64)) this.declareNameFromIdentifier(at, bindingType);
|
|
24708
24803
|
}
|
|
24709
24804
|
declareNameFromIdentifier(identifier, binding) {
|
|
24710
|
-
this.scope.declareName(identifier.name, binding, identifier.
|
|
24805
|
+
this.scope.declareName(identifier.name, binding, identifier.start);
|
|
24711
24806
|
}
|
|
24712
24807
|
checkToRestConversion(node, allowPattern) {
|
|
24713
24808
|
switch (node.type) {
|
|
@@ -25413,7 +25508,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25413
25508
|
case 2: return this.tsLookAhead(this.tsIsStartOfMappedType.bind(this)) ? this.tsParseMappedType() : this.tsParseTypeLiteral();
|
|
25414
25509
|
case 0: return this.tsParseTupleType();
|
|
25415
25510
|
case 6:
|
|
25416
|
-
if (!(this.optionFlags &
|
|
25511
|
+
if (!(this.optionFlags & 2048)) {
|
|
25417
25512
|
const startLoc = this.state.startLoc;
|
|
25418
25513
|
this.next();
|
|
25419
25514
|
const type = this.tsParseType();
|
|
@@ -25656,8 +25751,8 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25656
25751
|
tsParseHeritageClause(token) {
|
|
25657
25752
|
const originalStartLoc = this.state.startLoc;
|
|
25658
25753
|
const delimitedList = this.tsParseDelimitedList("HeritageClauseElement", () => {
|
|
25659
|
-
const expression = super.parseExprSubscripts();
|
|
25660
|
-
if (!tsIsEntityName(expression)) this.raise(TSErrors.InvalidHeritageClauseType, expression.
|
|
25754
|
+
const expression = (this.state.canStartArrow = false, super.parseExprSubscripts());
|
|
25755
|
+
if (!tsIsEntityName(expression)) this.raise(TSErrors.InvalidHeritageClauseType, expression.start, { token });
|
|
25661
25756
|
const nodeType = token === "extends" ? "TSInterfaceHeritage" : "TSClassImplements";
|
|
25662
25757
|
if (expression.type === "TSInstantiationExpression") {
|
|
25663
25758
|
expression.type = nodeType;
|
|
@@ -25973,7 +26068,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25973
26068
|
return super.isExportDefaultSpecifier();
|
|
25974
26069
|
}
|
|
25975
26070
|
parseBindingElement(flags, decorators) {
|
|
25976
|
-
const startLoc = decorators.length ?
|
|
26071
|
+
const startLoc = decorators.length ? null : this.state.startLoc;
|
|
25977
26072
|
const modified = {};
|
|
25978
26073
|
this.tsParseModifiers({ allowedModifiers: [
|
|
25979
26074
|
"public",
|
|
@@ -25985,17 +26080,18 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
25985
26080
|
const accessibility = modified.accessibility;
|
|
25986
26081
|
const override = modified.override;
|
|
25987
26082
|
const readonly = modified.readonly;
|
|
25988
|
-
if (!(flags & 4) && (accessibility || readonly || override)) this.raise(TSErrors.UnexpectedParameterModifier, startLoc);
|
|
25989
|
-
const
|
|
26083
|
+
if (!(flags & 4) && (accessibility || readonly || override)) this.raise(TSErrors.UnexpectedParameterModifier, startLoc || decorators[0]);
|
|
26084
|
+
const startLoc2 = this.state.startLoc;
|
|
26085
|
+
const left = this.parseMaybeDefault(startLoc2);
|
|
25990
26086
|
if (flags & 2) this.parseFunctionParamType(left);
|
|
25991
|
-
const elt = this.parseMaybeDefault(
|
|
26087
|
+
const elt = this.parseMaybeDefault(startLoc2, left);
|
|
25992
26088
|
if (accessibility || readonly || override) {
|
|
25993
|
-
const pp = this.startNodeAt(startLoc);
|
|
26089
|
+
const pp = startLoc ? this.startNodeAt(startLoc) : this.startNodeAtNode(decorators[0]);
|
|
25994
26090
|
if (decorators.length) pp.decorators = decorators;
|
|
25995
26091
|
if (accessibility) pp.accessibility = accessibility;
|
|
25996
26092
|
if (readonly) pp.readonly = readonly;
|
|
25997
26093
|
if (override) pp.override = override;
|
|
25998
|
-
if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") this.raise(TSErrors.UnsupportedParameterPropertyKind,
|
|
26094
|
+
if (elt.type !== "Identifier" && elt.type !== "AssignmentPattern") this.raise(TSErrors.UnsupportedParameterPropertyKind, startLoc || decorators[0]);
|
|
25999
26095
|
pp.parameter = elt;
|
|
26000
26096
|
return this.finishNode(pp, "TSParameterProperty");
|
|
26001
26097
|
}
|
|
@@ -26246,7 +26342,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26246
26342
|
if (token === 121) declaration.declare = true;
|
|
26247
26343
|
return declaration;
|
|
26248
26344
|
} else {
|
|
26249
|
-
node.expression = this.createIdentifier(this.
|
|
26345
|
+
node.expression = this.createIdentifier(this.startNodeAtNode(node), token === 121 ? "declare" : "abstract");
|
|
26250
26346
|
this.semicolon(false);
|
|
26251
26347
|
return this.finishNode(node, "ExpressionStatement");
|
|
26252
26348
|
}
|
|
@@ -26371,7 +26467,16 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26371
26467
|
return expr;
|
|
26372
26468
|
}
|
|
26373
26469
|
}
|
|
26374
|
-
|
|
26470
|
+
this.next();
|
|
26471
|
+
const node = this.startNodeAt(startLoc);
|
|
26472
|
+
node.test = expr;
|
|
26473
|
+
const oldInConditionalConsequent = this.state.inConditionalConsequent;
|
|
26474
|
+
this.state.inConditionalConsequent = true;
|
|
26475
|
+
node.consequent = this.parseMaybeAssignAllowIn();
|
|
26476
|
+
this.state.inConditionalConsequent = oldInConditionalConsequent;
|
|
26477
|
+
this.expect(10);
|
|
26478
|
+
node.alternate = this.parseMaybeAssign();
|
|
26479
|
+
return this.finishNode(node, "ConditionalExpression");
|
|
26375
26480
|
}
|
|
26376
26481
|
parseParenItem(node, startLoc) {
|
|
26377
26482
|
const newNode = super.parseParenItem(node, startLoc);
|
|
@@ -26514,7 +26619,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26514
26619
|
expr.typeParameters = typeParameters;
|
|
26515
26620
|
if (this.hasPlugin("jsx") && expr.typeParameters.params.length === 1 && !expr.typeParameters.extra?.trailingComma) {
|
|
26516
26621
|
const parameter = expr.typeParameters.params[0];
|
|
26517
|
-
if (!parameter.constraint) this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, createPositionWithColumnOffset(parameter.loc.end, 1), { typeParameterName: parameter.name.name });
|
|
26622
|
+
if (!parameter.constraint) this.raise(TSErrors.SingleTypeParameterWithoutTrailingComma, this.optionFlags & 256 ? createPositionWithColumnOffset(parameter.loc.end, 1) : parameter, { typeParameterName: parameter.name.name });
|
|
26518
26623
|
}
|
|
26519
26624
|
return expr;
|
|
26520
26625
|
}, state);
|
|
@@ -26702,7 +26807,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26702
26807
|
}
|
|
26703
26808
|
typeCastToParameter(node) {
|
|
26704
26809
|
node.expression.typeAnnotation = node.typeAnnotation;
|
|
26705
|
-
this.
|
|
26810
|
+
this.resetEndLocationFromNode(node.expression, node.typeAnnotation);
|
|
26706
26811
|
return node.expression;
|
|
26707
26812
|
}
|
|
26708
26813
|
shouldParseArrow(params) {
|
|
@@ -26710,7 +26815,18 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26710
26815
|
return super.shouldParseArrow(params);
|
|
26711
26816
|
}
|
|
26712
26817
|
shouldParseAsyncArrow() {
|
|
26713
|
-
|
|
26818
|
+
if (this.match(10)) {
|
|
26819
|
+
if (this.state.inConditionalConsequent) return false;
|
|
26820
|
+
return true;
|
|
26821
|
+
}
|
|
26822
|
+
return super.shouldParseAsyncArrow();
|
|
26823
|
+
}
|
|
26824
|
+
parseParenAndDistinguishExpression(canStartArrow) {
|
|
26825
|
+
const oldInConditionalConsequent = this.state.inConditionalConsequent;
|
|
26826
|
+
this.state.inConditionalConsequent = false;
|
|
26827
|
+
const result = super.parseParenAndDistinguishExpression(canStartArrow);
|
|
26828
|
+
this.state.inConditionalConsequent = oldInConditionalConsequent;
|
|
26829
|
+
return result;
|
|
26714
26830
|
}
|
|
26715
26831
|
canHaveLeadingDecorator() {
|
|
26716
26832
|
return super.canHaveLeadingDecorator() || this.isAbstractClass();
|
|
@@ -26814,7 +26930,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26814
26930
|
let rightOfAs;
|
|
26815
26931
|
let hasTypeSpecifier = false;
|
|
26816
26932
|
let canParseAsKeyword = true;
|
|
26817
|
-
const loc = leftOfAs.
|
|
26933
|
+
const loc = leftOfAs.start;
|
|
26818
26934
|
if (this.isContextual(89)) {
|
|
26819
26935
|
const firstAs = this.parseIdentifier();
|
|
26820
26936
|
if (this.isContextual(89)) {
|
|
@@ -26839,7 +26955,7 @@ var typescript = (superClass) => class TypeScriptParserMixin extends superClass
|
|
|
26839
26955
|
hasTypeSpecifier = true;
|
|
26840
26956
|
if (isImport) {
|
|
26841
26957
|
leftOfAs = this.parseIdentifier(true);
|
|
26842
|
-
if (!this.isContextual(89)) this.checkReservedWord(leftOfAs.name, leftOfAs.
|
|
26958
|
+
if (!this.isContextual(89)) this.checkReservedWord(leftOfAs.name, leftOfAs.start, true, true);
|
|
26843
26959
|
} else leftOfAs = this.parseModuleExportName();
|
|
26844
26960
|
}
|
|
26845
26961
|
if (hasTypeSpecifier && isInTypeOnlyImportExport) this.raise(isImport ? TSErrors.TypeModifierIsUsedInTypeImports : TSErrors.TypeModifierIsUsedInTypeExports, loc);
|
|
@@ -27253,14 +27369,14 @@ var ExpressionParser = class extends LValParser {
|
|
|
27253
27369
|
const key = prop.key;
|
|
27254
27370
|
if ((key.type === "Identifier" ? key.name : key.value) === "__proto__") {
|
|
27255
27371
|
if (sawProto) if (refExpressionErrors) {
|
|
27256
|
-
if (refExpressionErrors.doubleProtoLoc === null) refExpressionErrors.doubleProtoLoc = key.
|
|
27372
|
+
if (refExpressionErrors.doubleProtoLoc === null) refExpressionErrors.doubleProtoLoc = this.getLoc(key.start);
|
|
27257
27373
|
} else this.raise(Errors.DuplicateProto, key);
|
|
27258
27374
|
return true;
|
|
27259
27375
|
}
|
|
27260
27376
|
return sawProto;
|
|
27261
27377
|
}
|
|
27262
|
-
shouldExitDescending(expr
|
|
27263
|
-
return expr.type === "ArrowFunctionExpression" &&
|
|
27378
|
+
shouldExitDescending(expr) {
|
|
27379
|
+
return expr.type === "ArrowFunctionExpression" && !expr.extra?.parenthesized;
|
|
27264
27380
|
}
|
|
27265
27381
|
getExpression() {
|
|
27266
27382
|
this.enterInitialScopes();
|
|
@@ -27271,7 +27387,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
27271
27387
|
this.finalizeRemainingComments();
|
|
27272
27388
|
expr.comments = this.comments;
|
|
27273
27389
|
expr.errors = this.state.errors;
|
|
27274
|
-
if (this.optionFlags &
|
|
27390
|
+
if (this.optionFlags & 512) expr.tokens = createExportedTokens(this.tokens);
|
|
27391
|
+
if (this.options.locations === "packed") expr.locData = resetLocData();
|
|
27275
27392
|
return expr;
|
|
27276
27393
|
}
|
|
27277
27394
|
parseExpression(disallowIn, refExpressionErrors) {
|
|
@@ -27316,8 +27433,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27316
27433
|
refExpressionErrors = new ExpressionErrors();
|
|
27317
27434
|
ownExpressionErrors = true;
|
|
27318
27435
|
}
|
|
27319
|
-
|
|
27320
|
-
if (type === 6 || tokenIsIdentifier(type)) this.state.potentialArrowAt = this.state.start;
|
|
27436
|
+
this.state.canStartArrow = true;
|
|
27321
27437
|
let left = this.parseMaybeConditional(refExpressionErrors);
|
|
27322
27438
|
if (afterLeftParse) left = afterLeftParse.call(this, left, startLoc);
|
|
27323
27439
|
if (tokenIsAssignment(this.state.type)) {
|
|
@@ -27352,9 +27468,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
27352
27468
|
}
|
|
27353
27469
|
parseMaybeConditional(refExpressionErrors) {
|
|
27354
27470
|
const startLoc = this.state.startLoc;
|
|
27355
|
-
const potentialArrowAt = this.state.potentialArrowAt;
|
|
27356
27471
|
const expr = this.parseExprOps(refExpressionErrors);
|
|
27357
|
-
if (this.shouldExitDescending(expr
|
|
27472
|
+
if (this.shouldExitDescending(expr)) return expr;
|
|
27358
27473
|
return this.parseConditional(expr, startLoc, refExpressionErrors);
|
|
27359
27474
|
}
|
|
27360
27475
|
parseConditional(expr, startLoc, refExpressionErrors) {
|
|
@@ -27373,16 +27488,16 @@ var ExpressionParser = class extends LValParser {
|
|
|
27373
27488
|
}
|
|
27374
27489
|
parseExprOps(refExpressionErrors) {
|
|
27375
27490
|
const startLoc = this.state.startLoc;
|
|
27376
|
-
const potentialArrowAt = this.state.potentialArrowAt;
|
|
27377
27491
|
const expr = this.parseMaybeUnaryOrPrivate(refExpressionErrors);
|
|
27378
|
-
if (this.shouldExitDescending(expr
|
|
27492
|
+
if (this.shouldExitDescending(expr)) return expr;
|
|
27493
|
+
this.state.canStartArrow = false;
|
|
27379
27494
|
return this.parseExprOp(expr, startLoc, -1);
|
|
27380
27495
|
}
|
|
27381
27496
|
parseExprOp(left, leftStartLoc, minPrec) {
|
|
27382
27497
|
if (this.isPrivateName(left)) {
|
|
27383
27498
|
const value = this.getPrivateNameSV(left);
|
|
27384
|
-
if (minPrec >= tokenOperatorPrecedence(54) || !this.prodParam.hasIn || !this.match(54)) this.raise(Errors.PrivateInExpectedIn,
|
|
27385
|
-
this.classScope.usePrivateName(value,
|
|
27499
|
+
if (minPrec >= tokenOperatorPrecedence(54) || !this.prodParam.hasIn || !this.match(54)) this.raise(Errors.PrivateInExpectedIn, leftStartLoc, { identifierName: value });
|
|
27500
|
+
this.classScope.usePrivateName(value, leftStartLoc);
|
|
27386
27501
|
}
|
|
27387
27502
|
const op = this.state.type;
|
|
27388
27503
|
if (tokenIsOperator(op) && (this.prodParam.hasIn || !this.match(54))) {
|
|
@@ -27390,7 +27505,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27390
27505
|
if (prec > minPrec) {
|
|
27391
27506
|
if (op === 35) {
|
|
27392
27507
|
this.expectPlugin("pipelineOperator");
|
|
27393
|
-
if (this.
|
|
27508
|
+
if (this.prodParam.inFSharpPipelineDirectBody) return left;
|
|
27394
27509
|
}
|
|
27395
27510
|
const node = this.startNodeAt(leftStartLoc);
|
|
27396
27511
|
node.left = left;
|
|
@@ -27414,9 +27529,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27414
27529
|
case "hack": return this.withTopicBindingContext(() => {
|
|
27415
27530
|
return this.parseHackPipeBody();
|
|
27416
27531
|
});
|
|
27417
|
-
case "fsharp": return this.
|
|
27418
|
-
return this.parseFSharpPipelineBody(prec);
|
|
27419
|
-
});
|
|
27532
|
+
case "fsharp": return this.parseFSharpPipelineBody(prec);
|
|
27420
27533
|
}
|
|
27421
27534
|
default: return this.parseExprOpBaseRightExpr(op, prec);
|
|
27422
27535
|
}
|
|
@@ -27449,6 +27562,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27449
27562
|
if (tokenIsPrefix(this.state.type)) {
|
|
27450
27563
|
node.operator = this.state.value;
|
|
27451
27564
|
node.prefix = true;
|
|
27565
|
+
this.state.canStartArrow = false;
|
|
27452
27566
|
if (this.match(68)) this.expectPlugin("throwExpressions");
|
|
27453
27567
|
const isDelete = this.match(85);
|
|
27454
27568
|
this.next();
|
|
@@ -27476,9 +27590,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
27476
27590
|
}
|
|
27477
27591
|
parseUpdate(node, update, refExpressionErrors) {
|
|
27478
27592
|
if (update) {
|
|
27479
|
-
const
|
|
27480
|
-
this.checkLVal(
|
|
27481
|
-
return
|
|
27593
|
+
const result = this.finishNode(node, "UpdateExpression");
|
|
27594
|
+
this.checkLVal(result.argument, result);
|
|
27595
|
+
return result;
|
|
27482
27596
|
}
|
|
27483
27597
|
const startLoc = this.state.startLoc;
|
|
27484
27598
|
let expr = this.parseExprSubscripts(refExpressionErrors);
|
|
@@ -27495,9 +27609,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
27495
27609
|
}
|
|
27496
27610
|
parseExprSubscripts(refExpressionErrors) {
|
|
27497
27611
|
const startLoc = this.state.startLoc;
|
|
27498
|
-
|
|
27612
|
+
this.setLoc(startLoc);
|
|
27499
27613
|
const expr = this.parseExprAtom(refExpressionErrors);
|
|
27500
|
-
if (this.shouldExitDescending(expr
|
|
27614
|
+
if (this.shouldExitDescending(expr)) return expr;
|
|
27501
27615
|
return this.parseSubscripts(expr, startLoc);
|
|
27502
27616
|
}
|
|
27503
27617
|
parseSubscripts(base, startLoc, noCalls) {
|
|
@@ -27598,7 +27712,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27598
27712
|
return this.finishNode(node, "TaggedTemplateExpression");
|
|
27599
27713
|
}
|
|
27600
27714
|
atPossibleAsyncArrow(base) {
|
|
27601
|
-
return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.
|
|
27715
|
+
return base.type === "Identifier" && base.name === "async" && this.state.lastTokEndLoc.index === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 && this.state.canStartArrow;
|
|
27602
27716
|
}
|
|
27603
27717
|
finishCallExpression(node, optional) {
|
|
27604
27718
|
if (node.callee.type === "Import") {
|
|
@@ -27610,8 +27724,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
27610
27724
|
parseCallExpressionArguments(allowPlaceholder, nodeForExtra, refExpressionErrors) {
|
|
27611
27725
|
const elts = [];
|
|
27612
27726
|
let first = true;
|
|
27613
|
-
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
27614
|
-
this.state.inFSharpPipelineDirectBody = false;
|
|
27615
27727
|
while (!this.eat(7)) {
|
|
27616
27728
|
if (first) first = false;
|
|
27617
27729
|
else {
|
|
@@ -27624,7 +27736,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
27624
27736
|
}
|
|
27625
27737
|
elts.push(this.parseExprListItem(7, false, refExpressionErrors, allowPlaceholder));
|
|
27626
27738
|
}
|
|
27627
|
-
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
27628
27739
|
return elts;
|
|
27629
27740
|
}
|
|
27630
27741
|
shouldParseAsyncArrow() {
|
|
@@ -27652,7 +27763,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27652
27763
|
node = this.startNode();
|
|
27653
27764
|
this.next();
|
|
27654
27765
|
if (this.match(12)) return this.parseImportMetaPropertyOrPhaseCall(node);
|
|
27655
|
-
if (this.match(6)) if (this.optionFlags &
|
|
27766
|
+
if (this.match(6)) if (this.optionFlags & 1024) return this.parseImportCall(node);
|
|
27656
27767
|
else return this.finishNode(node, "Import");
|
|
27657
27768
|
else {
|
|
27658
27769
|
this.raise(Errors.UnsupportedImport, this.state.lastTokStartLoc);
|
|
@@ -27673,10 +27784,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27673
27784
|
case 80: return this.parseNullLiteral();
|
|
27674
27785
|
case 81: return this.parseBooleanLiteral(true);
|
|
27675
27786
|
case 82: return this.parseBooleanLiteral(false);
|
|
27676
|
-
case 6:
|
|
27677
|
-
const canBeArrow = this.state.potentialArrowAt === this.state.start;
|
|
27678
|
-
return this.parseParenAndDistinguishExpression(canBeArrow);
|
|
27679
|
-
}
|
|
27787
|
+
case 6: return this.parseParenAndDistinguishExpression(this.state.canStartArrow);
|
|
27680
27788
|
case 0: return this.parseArrayLike(1, refExpressionErrors);
|
|
27681
27789
|
case 2: return this.parseObjectLike(4, false, refExpressionErrors);
|
|
27682
27790
|
case 64: return this.parseFunctionOrFunctionSent();
|
|
@@ -27718,8 +27826,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27718
27826
|
}
|
|
27719
27827
|
default: if (tokenIsIdentifier(type)) {
|
|
27720
27828
|
if (this.isContextual(123) && this.lookaheadInLineCharCode() === 123) return this.parseModuleExpression();
|
|
27721
|
-
const
|
|
27722
|
-
const containsEsc = this.state.containsEsc;
|
|
27829
|
+
const { canStartArrow, containsEsc } = this.state;
|
|
27723
27830
|
const id = this.parseIdentifier();
|
|
27724
27831
|
if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) {
|
|
27725
27832
|
const { type } = this.state;
|
|
@@ -27727,14 +27834,14 @@ var ExpressionParser = class extends LValParser {
|
|
|
27727
27834
|
this.resetPreviousNodeTrailingComments(id);
|
|
27728
27835
|
this.next();
|
|
27729
27836
|
return this.parseAsyncFunctionExpression(this.startNodeAtNode(id));
|
|
27730
|
-
} else if (tokenIsIdentifier(type)) if (this.lookaheadCharCode() === 61) return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
|
|
27837
|
+
} else if (tokenIsIdentifier(type)) if (canStartArrow && this.lookaheadCharCode() === 61) return this.parseAsyncArrowUnaryFunction(this.startNodeAtNode(id));
|
|
27731
27838
|
else return id;
|
|
27732
27839
|
else if (type === 86) {
|
|
27733
27840
|
this.resetPreviousNodeTrailingComments(id);
|
|
27734
27841
|
return this.parseDo(this.startNodeAtNode(id), true);
|
|
27735
27842
|
}
|
|
27736
27843
|
}
|
|
27737
|
-
if (
|
|
27844
|
+
if (canStartArrow && this.match(15) && !this.canInsertSemicolon()) {
|
|
27738
27845
|
this.next();
|
|
27739
27846
|
return this.parseArrowExpression(this.startNodeAtNode(id), [id], false);
|
|
27740
27847
|
}
|
|
@@ -27897,13 +28004,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
27897
28004
|
this.next();
|
|
27898
28005
|
return this.finishNode(node, "NullLiteral");
|
|
27899
28006
|
}
|
|
27900
|
-
parseParenAndDistinguishExpression(
|
|
28007
|
+
parseParenAndDistinguishExpression(canStartArrow) {
|
|
27901
28008
|
const startLoc = this.state.startLoc;
|
|
27902
28009
|
let val;
|
|
27903
28010
|
this.next();
|
|
27904
28011
|
this.expressionScope.enter(newArrowHeadScope());
|
|
27905
|
-
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
27906
|
-
this.state.inFSharpPipelineDirectBody = false;
|
|
27907
28012
|
const innerStartLoc = this.state.startLoc;
|
|
27908
28013
|
const exprList = [];
|
|
27909
28014
|
const refExpressionErrors = new ExpressionErrors();
|
|
@@ -27928,9 +28033,8 @@ var ExpressionParser = class extends LValParser {
|
|
|
27928
28033
|
}
|
|
27929
28034
|
const innerEndLoc = this.state.lastTokEndLoc;
|
|
27930
28035
|
this.expect(7);
|
|
27931
|
-
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
27932
28036
|
let arrowNode = this.startNodeAt(startLoc);
|
|
27933
|
-
if (
|
|
28037
|
+
if (canStartArrow && this.shouldParseArrow(exprList) && (arrowNode = this.parseArrow(arrowNode))) {
|
|
27934
28038
|
this.checkDestructuringPrivate(refExpressionErrors);
|
|
27935
28039
|
this.expressionScope.validateAsPattern();
|
|
27936
28040
|
this.expressionScope.exit();
|
|
@@ -27952,7 +28056,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
27952
28056
|
return this.wrapParenthesis(startLoc, val);
|
|
27953
28057
|
}
|
|
27954
28058
|
wrapParenthesis(startLoc, expression) {
|
|
27955
|
-
if (!(this.optionFlags &
|
|
28059
|
+
if (!(this.optionFlags & 2048)) {
|
|
27956
28060
|
this.addExtra(expression, "parenthesized", true);
|
|
27957
28061
|
this.addExtra(expression, "parenStart", startLoc.index);
|
|
27958
28062
|
this.takeSurroundingComments(expression, startLoc.index, this.state.lastTokEndLoc.index);
|
|
@@ -28036,8 +28140,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
28036
28140
|
return this.parseExpression();
|
|
28037
28141
|
}
|
|
28038
28142
|
parseObjectLike(close, isPattern, refExpressionErrors) {
|
|
28039
|
-
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
28040
|
-
this.state.inFSharpPipelineDirectBody = false;
|
|
28041
28143
|
let sawProto = false;
|
|
28042
28144
|
let first = true;
|
|
28043
28145
|
const node = this.startNode();
|
|
@@ -28061,7 +28163,6 @@ var ExpressionParser = class extends LValParser {
|
|
|
28061
28163
|
node.properties.push(prop);
|
|
28062
28164
|
}
|
|
28063
28165
|
this.next();
|
|
28064
|
-
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
28065
28166
|
const type = isPattern ? "ObjectPattern" : "ObjectExpression";
|
|
28066
28167
|
return this.finishNode(node, type);
|
|
28067
28168
|
}
|
|
@@ -28073,7 +28174,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
28073
28174
|
return !prop.computed && prop.key.type === "Identifier" && (this.isLiteralPropertyName() || this.match(0) || this.match(51));
|
|
28074
28175
|
}
|
|
28075
28176
|
parsePropertyDefinition(refExpressionErrors) {
|
|
28076
|
-
|
|
28177
|
+
const decorators = [];
|
|
28077
28178
|
if (this.match(22)) {
|
|
28078
28179
|
if (this.hasPlugin("decorators")) this.raise(Errors.UnsupportedPropertyDecorator, this.state.startLoc);
|
|
28079
28180
|
while (this.match(22)) decorators.push(this.parseDecorator());
|
|
@@ -28086,10 +28187,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
28086
28187
|
if (decorators.length) this.unexpected();
|
|
28087
28188
|
return this.parseSpread();
|
|
28088
28189
|
}
|
|
28089
|
-
if (decorators.length)
|
|
28090
|
-
prop.decorators = decorators;
|
|
28091
|
-
decorators = [];
|
|
28092
|
-
}
|
|
28190
|
+
if (decorators.length) prop.decorators = decorators;
|
|
28093
28191
|
prop.method = false;
|
|
28094
28192
|
if (refExpressionErrors) startLoc = this.state.startLoc;
|
|
28095
28193
|
let isGenerator = this.eat(51);
|
|
@@ -28151,7 +28249,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
28151
28249
|
return this.finishObjectProperty(prop);
|
|
28152
28250
|
}
|
|
28153
28251
|
if (!prop.computed && prop.key.type === "Identifier") {
|
|
28154
|
-
this.checkReservedWord(prop.key.name, prop.key.
|
|
28252
|
+
this.checkReservedWord(prop.key.name, prop.key.start, true, false);
|
|
28155
28253
|
if (isPattern) prop.value = this.parseMaybeDefault(startLoc, this.cloneIdentifier(prop.key));
|
|
28156
28254
|
else if (this.match(25)) {
|
|
28157
28255
|
const shorthandAssignLoc = this.state.startLoc;
|
|
@@ -28222,18 +28320,15 @@ var ExpressionParser = class extends LValParser {
|
|
|
28222
28320
|
return finishedNode;
|
|
28223
28321
|
}
|
|
28224
28322
|
parseArrayLike(close, refExpressionErrors) {
|
|
28225
|
-
const oldInFSharpPipelineDirectBody = this.state.inFSharpPipelineDirectBody;
|
|
28226
|
-
this.state.inFSharpPipelineDirectBody = false;
|
|
28227
28323
|
const node = this.startNode();
|
|
28228
28324
|
this.next();
|
|
28229
28325
|
node.elements = this.parseExprList(close, true, refExpressionErrors, node);
|
|
28230
|
-
this.state.inFSharpPipelineDirectBody = oldInFSharpPipelineDirectBody;
|
|
28231
28326
|
return this.finishNode(node, "ArrayExpression");
|
|
28232
28327
|
}
|
|
28233
28328
|
parseArrowExpression(node, params, isAsync, trailingCommaLoc) {
|
|
28234
28329
|
this.scope.enter(518);
|
|
28235
28330
|
let flags = functionFlags(isAsync, false);
|
|
28236
|
-
if (!this.match(2)
|
|
28331
|
+
if (!this.match(2)) flags |= this.prodParam.currentFlags() & 24;
|
|
28237
28332
|
this.prodParam.enter(flags);
|
|
28238
28333
|
this.initFunction(node, isAsync);
|
|
28239
28334
|
if (params) this.setArrowFunctionParameters(node, params, trailingCommaLoc);
|
|
@@ -28263,7 +28358,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
28263
28358
|
this.prodParam.enter(this.prodParam.currentFlags() | 4);
|
|
28264
28359
|
node.body = this.parseBlock(true, false, (hasStrictModeDirective) => {
|
|
28265
28360
|
const nonSimple = !this.isSimpleParamList(node.params);
|
|
28266
|
-
if (hasStrictModeDirective && nonSimple) this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? node.key.loc.end : node);
|
|
28361
|
+
if (hasStrictModeDirective && nonSimple) this.raise(Errors.IllegalLanguageModeDirective, (node.kind === "method" || node.kind === "constructor") && !!node.key ? this.optionFlags & 256 ? node.key.loc.end : node.key : node);
|
|
28267
28362
|
const strictModeChanged = !oldStrict && this.state.strict;
|
|
28268
28363
|
this.checkParams(node, !this.state.strict && !allowExpression && !isMethod && !nonSimple, allowExpression, strictModeChanged);
|
|
28269
28364
|
if (this.state.strict && node.id) this.checkIdentifier(node.id, 65, strictModeChanged);
|
|
@@ -28326,23 +28421,23 @@ var ExpressionParser = class extends LValParser {
|
|
|
28326
28421
|
}
|
|
28327
28422
|
createIdentifier(node, name) {
|
|
28328
28423
|
node.name = name;
|
|
28329
|
-
node.loc.identifierName = name;
|
|
28424
|
+
if (this.optionFlags & 256) node.loc.identifierName = name;
|
|
28330
28425
|
return this.finishNode(node, "Identifier");
|
|
28331
28426
|
}
|
|
28332
28427
|
createIdentifierAt(node, name, endLoc) {
|
|
28333
28428
|
node.name = name;
|
|
28334
|
-
node.loc.identifierName = name;
|
|
28429
|
+
if (this.optionFlags & 256) node.loc.identifierName = name;
|
|
28335
28430
|
return this.finishNodeAt(node, "Identifier", endLoc);
|
|
28336
28431
|
}
|
|
28337
28432
|
parseIdentifierName(liberal) {
|
|
28338
28433
|
let name;
|
|
28339
|
-
const {
|
|
28434
|
+
const { start, type } = this.state;
|
|
28340
28435
|
if (tokenIsKeywordOrIdentifier(type)) name = this.state.value;
|
|
28341
28436
|
else this.unexpected();
|
|
28342
28437
|
const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type);
|
|
28343
28438
|
if (liberal) {
|
|
28344
28439
|
if (tokenIsKeyword) this.replaceToken(128);
|
|
28345
|
-
} else this.checkReservedWord(name,
|
|
28440
|
+
} else this.checkReservedWord(name, this.sourceToOffsetPos(start), tokenIsKeyword, false);
|
|
28346
28441
|
this.next();
|
|
28347
28442
|
return name;
|
|
28348
28443
|
}
|
|
@@ -28383,13 +28478,15 @@ var ExpressionParser = class extends LValParser {
|
|
|
28383
28478
|
if (isAwaitAllowed && !this.scope.inFunction) this.state.hasTopLevelAwait = true;
|
|
28384
28479
|
return isAwaitAllowed;
|
|
28385
28480
|
}
|
|
28386
|
-
parseAwait(startLoc) {
|
|
28481
|
+
parseAwait(startLoc, soloAwait) {
|
|
28482
|
+
const startIndex = startLoc.index;
|
|
28483
|
+
this.setLoc(startLoc);
|
|
28387
28484
|
const node = this.startNodeAt(startLoc);
|
|
28388
|
-
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter,
|
|
28389
|
-
if (this.eat(51)) this.raise(Errors.ObsoleteAwaitStar,
|
|
28485
|
+
this.expressionScope.recordParameterInitializerError(Errors.AwaitExpressionFormalParameter, startIndex);
|
|
28486
|
+
if (this.eat(51)) this.raise(Errors.ObsoleteAwaitStar, startLoc);
|
|
28390
28487
|
if (!this.scope.inFunction && !(this.optionFlags & 1)) if (this.isAmbiguousPrefixOrIdentifier()) this.ambiguousScriptDifferentAst = true;
|
|
28391
28488
|
else this.sawUnambiguousESM = true;
|
|
28392
|
-
if (!
|
|
28489
|
+
if (!soloAwait) node.argument = this.parseMaybeUnary(null, true);
|
|
28393
28490
|
return this.finishNode(node, "AwaitExpression");
|
|
28394
28491
|
}
|
|
28395
28492
|
isAmbiguousPrefixOrIdentifier() {
|
|
@@ -28398,8 +28495,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
28398
28495
|
return type === 49 || type === 6 || type === 0 || tokenIsTemplate(type) || type === 98 && !this.state.containsEsc || type === 133 || type === 52 || this.hasPlugin("v8intrinsic") && type === 50;
|
|
28399
28496
|
}
|
|
28400
28497
|
parseYield(startLoc) {
|
|
28498
|
+
this.setLoc(startLoc);
|
|
28401
28499
|
const node = this.startNodeAt(startLoc);
|
|
28402
|
-
this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter,
|
|
28500
|
+
this.expressionScope.recordParameterInitializerError(Errors.YieldInParameter, startLoc.index);
|
|
28403
28501
|
let delegating = false;
|
|
28404
28502
|
let argument = null;
|
|
28405
28503
|
if (!this.hasPrecedingLineBreak()) {
|
|
@@ -28440,30 +28538,21 @@ var ExpressionParser = class extends LValParser {
|
|
|
28440
28538
|
return this.finishNode(node, "ImportExpression");
|
|
28441
28539
|
}
|
|
28442
28540
|
withTopicBindingContext(callback) {
|
|
28443
|
-
const
|
|
28444
|
-
this.state.
|
|
28445
|
-
|
|
28446
|
-
|
|
28447
|
-
};
|
|
28448
|
-
try {
|
|
28449
|
-
return callback();
|
|
28450
|
-
} finally {
|
|
28451
|
-
this.state.topicContext = outerContextTopicState;
|
|
28452
|
-
}
|
|
28453
|
-
}
|
|
28454
|
-
withSoloAwaitPermittingContext(callback) {
|
|
28455
|
-
const outerContextSoloAwaitState = this.state.soloAwait;
|
|
28456
|
-
this.state.soloAwait = true;
|
|
28541
|
+
const oldInHackPipelineBody = this.state.inHackPipelineBody;
|
|
28542
|
+
this.state.inHackPipelineBody = true;
|
|
28543
|
+
const oldSeenTopicReference = this.state.seenTopicReference;
|
|
28544
|
+
this.state.seenTopicReference = false;
|
|
28457
28545
|
try {
|
|
28458
28546
|
return callback();
|
|
28459
28547
|
} finally {
|
|
28460
|
-
this.state.
|
|
28548
|
+
this.state.inHackPipelineBody = oldInHackPipelineBody;
|
|
28549
|
+
this.state.seenTopicReference = oldSeenTopicReference;
|
|
28461
28550
|
}
|
|
28462
28551
|
}
|
|
28463
28552
|
allowInAnd(callback) {
|
|
28464
28553
|
const flags = this.prodParam.currentFlags();
|
|
28465
|
-
if (
|
|
28466
|
-
this.prodParam.enter(flags |
|
|
28554
|
+
if (24 & ~flags) {
|
|
28555
|
+
this.prodParam.enter(flags | 24);
|
|
28467
28556
|
try {
|
|
28468
28557
|
return callback();
|
|
28469
28558
|
} finally {
|
|
@@ -28474,8 +28563,10 @@ var ExpressionParser = class extends LValParser {
|
|
|
28474
28563
|
}
|
|
28475
28564
|
disallowInAnd(callback) {
|
|
28476
28565
|
const flags = this.prodParam.currentFlags();
|
|
28477
|
-
|
|
28478
|
-
|
|
28566
|
+
const prodParamToClear = 8 & flags;
|
|
28567
|
+
const prodParamToSet = 16 & ~flags;
|
|
28568
|
+
if (prodParamToClear || prodParamToSet) {
|
|
28569
|
+
this.prodParam.enter(flags & -9 | 16);
|
|
28479
28570
|
try {
|
|
28480
28571
|
return callback();
|
|
28481
28572
|
} finally {
|
|
@@ -28485,21 +28576,28 @@ var ExpressionParser = class extends LValParser {
|
|
|
28485
28576
|
return callback();
|
|
28486
28577
|
}
|
|
28487
28578
|
registerTopicReference() {
|
|
28488
|
-
this.state.
|
|
28579
|
+
this.state.seenTopicReference = true;
|
|
28489
28580
|
}
|
|
28490
28581
|
topicReferenceIsAllowedInCurrentContext() {
|
|
28491
|
-
return this.state.
|
|
28582
|
+
return this.state.inHackPipelineBody;
|
|
28492
28583
|
}
|
|
28493
28584
|
topicReferenceWasUsedInCurrentContext() {
|
|
28494
|
-
return this.state.
|
|
28585
|
+
return this.state.seenTopicReference;
|
|
28495
28586
|
}
|
|
28496
28587
|
parseFSharpPipelineBody(prec) {
|
|
28497
28588
|
const startLoc = this.state.startLoc;
|
|
28498
|
-
this.
|
|
28499
|
-
|
|
28500
|
-
this.
|
|
28501
|
-
|
|
28502
|
-
|
|
28589
|
+
this.prodParam.enter(this.prodParam.currentFlags() & -17);
|
|
28590
|
+
let ret;
|
|
28591
|
+
if (this.isContextual(92) && this.recordAwaitIfAllowed()) {
|
|
28592
|
+
this.next();
|
|
28593
|
+
ret = this.parseAwait(startLoc, true);
|
|
28594
|
+
const nextOp = this.state.type;
|
|
28595
|
+
if (tokenIsOperator(nextOp) && nextOp !== 35 && (this.prodParam.hasIn || nextOp !== 54)) this.raise(Errors.PipelineUnparenthesized, startLoc);
|
|
28596
|
+
} else {
|
|
28597
|
+
this.state.canStartArrow = true;
|
|
28598
|
+
ret = this.parseExprOp(this.parseMaybeUnaryOrPrivate(), startLoc, prec);
|
|
28599
|
+
}
|
|
28600
|
+
this.prodParam.exit();
|
|
28503
28601
|
return ret;
|
|
28504
28602
|
}
|
|
28505
28603
|
parseModuleExpression() {
|
|
@@ -28549,7 +28647,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
28549
28647
|
parseTopLevel(file, program) {
|
|
28550
28648
|
file.program = this.parseProgram(program, 135, this.options.sourceType === "module" ? "module" : "script");
|
|
28551
28649
|
file.comments = this.comments;
|
|
28552
|
-
if (this.optionFlags &
|
|
28650
|
+
if (this.optionFlags & 512) file.tokens = createExportedTokens(this.tokens);
|
|
28553
28651
|
return this.finishNode(file, "File");
|
|
28554
28652
|
}
|
|
28555
28653
|
parseProgram(program, end, sourceType) {
|
|
@@ -28805,7 +28903,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
28805
28903
|
}
|
|
28806
28904
|
node.expression = this.parseMaybeDecoratorArguments(expr, startLoc);
|
|
28807
28905
|
}
|
|
28808
|
-
} else
|
|
28906
|
+
} else {
|
|
28907
|
+
this.state.canStartArrow = false;
|
|
28908
|
+
node.expression = this.parseExprSubscripts();
|
|
28909
|
+
}
|
|
28809
28910
|
return this.finishNode(node, "Decorator");
|
|
28810
28911
|
}
|
|
28811
28912
|
parseMaybeDecoratorArguments(expr, startLoc) {
|
|
@@ -29143,8 +29244,8 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29143
29244
|
parseVarId(decl, kind) {
|
|
29144
29245
|
const id = this.parseBindingAtom();
|
|
29145
29246
|
if (kind === "using" || kind === "await using") {
|
|
29146
|
-
if (id.type === "ArrayPattern" || id.type === "ObjectPattern") this.raise(Errors.UsingDeclarationHasBindingPattern, id
|
|
29147
|
-
} else if (id.type === "VoidPattern") this.raise(Errors.UnexpectedVoidPattern, id
|
|
29247
|
+
if (id.type === "ArrayPattern" || id.type === "ObjectPattern") this.raise(Errors.UsingDeclarationHasBindingPattern, id);
|
|
29248
|
+
} else if (id.type === "VoidPattern") this.raise(Errors.UnexpectedVoidPattern, id);
|
|
29148
29249
|
this.checkLVal(id, { type: "VariableDeclarator" }, kind === "var" ? 5 : 8201);
|
|
29149
29250
|
decl.id = id;
|
|
29150
29251
|
}
|
|
@@ -29184,7 +29285,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29184
29285
|
}
|
|
29185
29286
|
registerFunctionStatementId(node) {
|
|
29186
29287
|
if (!node.id) return;
|
|
29187
|
-
this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.
|
|
29288
|
+
this.scope.declareName(node.id.name, !this.options.annexB || this.state.strict || node.generator || node.async ? this.scope.treatFunctionsAsVar ? 5 : 8201 : 17, node.id.start);
|
|
29188
29289
|
}
|
|
29189
29290
|
parseClass(node, isStatement, optionalId) {
|
|
29190
29291
|
this.next();
|
|
@@ -29233,7 +29334,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29233
29334
|
decorators = [];
|
|
29234
29335
|
}
|
|
29235
29336
|
this.parseClassMember(classBody, member, state);
|
|
29236
|
-
if (member.
|
|
29337
|
+
if (member.decorators && member.decorators.length > 0) {
|
|
29338
|
+
if (this.hasPlugin("typescript") && (this.hasPlugin("estree") ? member.type === "TSAbstractMethodDefinition" : member.type === "TSDeclareMethod")) this.raise(Errors.DecoratorAbstractMethod, member);
|
|
29339
|
+
if (member.kind === "constructor") this.raise(Errors.DecoratorConstructor, member);
|
|
29340
|
+
}
|
|
29237
29341
|
}
|
|
29238
29342
|
this.state.strict = oldStrict;
|
|
29239
29343
|
this.next();
|
|
@@ -29386,13 +29490,13 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29386
29490
|
pushClassPrivateProperty(classBody, prop) {
|
|
29387
29491
|
const node = this.parseClassPrivateProperty(prop);
|
|
29388
29492
|
classBody.body.push(node);
|
|
29389
|
-
this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.
|
|
29493
|
+
this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.start);
|
|
29390
29494
|
}
|
|
29391
29495
|
pushClassAccessorProperty(classBody, prop, isPrivate) {
|
|
29392
29496
|
if (!isPrivate && !prop.computed && this.nameIsConstructor(prop.key)) this.raise(Errors.ConstructorClassField, prop.key);
|
|
29393
29497
|
const node = this.parseClassAccessorProperty(prop);
|
|
29394
29498
|
classBody.body.push(node);
|
|
29395
|
-
if (isPrivate) this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.
|
|
29499
|
+
if (isPrivate) this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), 0, node.key.start);
|
|
29396
29500
|
}
|
|
29397
29501
|
pushClassMethod(classBody, method, isGenerator, isAsync, isConstructor, allowsDirectSuper) {
|
|
29398
29502
|
classBody.body.push(this.parseMethod(method, isGenerator, isAsync, isConstructor, allowsDirectSuper, "ClassMethod", true));
|
|
@@ -29404,7 +29508,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29404
29508
|
this.declareClassPrivateMethodInScope(node, kind);
|
|
29405
29509
|
}
|
|
29406
29510
|
declareClassPrivateMethodInScope(node, kind) {
|
|
29407
|
-
this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.
|
|
29511
|
+
this.classScope.declarePrivateName(this.getPrivateNameSV(node.key), kind, node.key.start);
|
|
29408
29512
|
}
|
|
29409
29513
|
parsePostMemberNameModifiers(methodOrProp) {}
|
|
29410
29514
|
parseClassPrivateProperty(node) {
|
|
@@ -29439,7 +29543,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29439
29543
|
else throw this.raise(Errors.MissingClassName, this.state.startLoc);
|
|
29440
29544
|
}
|
|
29441
29545
|
parseClassSuper(node) {
|
|
29442
|
-
|
|
29546
|
+
if (this.eat(77)) {
|
|
29547
|
+
this.state.canStartArrow = false;
|
|
29548
|
+
node.superClass = this.parseExprSubscripts();
|
|
29549
|
+
} else node.superClass = null;
|
|
29443
29550
|
}
|
|
29444
29551
|
parseExport(node, decorators) {
|
|
29445
29552
|
const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true);
|
|
@@ -29490,7 +29597,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29490
29597
|
}
|
|
29491
29598
|
maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier) {
|
|
29492
29599
|
if (maybeDefaultIdentifier || this.isExportDefaultSpecifier()) {
|
|
29493
|
-
this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier?.
|
|
29600
|
+
this.expectPlugin("exportDefaultFrom", maybeDefaultIdentifier?.start);
|
|
29494
29601
|
const id = maybeDefaultIdentifier || this.parseIdentifier(true);
|
|
29495
29602
|
const specifier = this.startNodeAtNode(id);
|
|
29496
29603
|
specifier.exported = id;
|
|
@@ -29624,7 +29731,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29624
29731
|
exportName
|
|
29625
29732
|
});
|
|
29626
29733
|
else {
|
|
29627
|
-
this.checkReservedWord(local.name, local.
|
|
29734
|
+
this.checkReservedWord(local.name, local.start, true, false);
|
|
29628
29735
|
this.scope.checkLocalExport(local);
|
|
29629
29736
|
}
|
|
29630
29737
|
}
|
|
@@ -29690,9 +29797,9 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29690
29797
|
const { specifiers } = node;
|
|
29691
29798
|
const singleBindingType = specifiers.length === 1 ? specifiers[0].type : null;
|
|
29692
29799
|
if (node.phase === "source") {
|
|
29693
|
-
if (singleBindingType !== "ImportDefaultSpecifier") this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0]
|
|
29800
|
+
if (singleBindingType !== "ImportDefaultSpecifier") this.raise(Errors.SourcePhaseImportRequiresDefault, specifiers[0]);
|
|
29694
29801
|
} else if (node.phase === "defer") {
|
|
29695
|
-
if (singleBindingType !== "ImportNamespaceSpecifier") this.raise(Errors.DeferImportRequiresNamespace, specifiers[0]
|
|
29802
|
+
if (singleBindingType !== "ImportNamespaceSpecifier") this.raise(Errors.DeferImportRequiresNamespace, specifiers[0]);
|
|
29696
29803
|
}
|
|
29697
29804
|
}
|
|
29698
29805
|
isPotentialImportPhase(isExport) {
|
|
@@ -29718,7 +29825,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29718
29825
|
const phaseIdentifierName = this.parseIdentifierName(true);
|
|
29719
29826
|
const { type } = this.state;
|
|
29720
29827
|
if (tokenIsKeywordOrIdentifier(type) ? type !== 94 || this.lookaheadCharCode() === 102 : type !== 8) {
|
|
29721
|
-
this.applyImportPhase(node, isExport, phaseIdentifierName, phaseIdentifier.
|
|
29828
|
+
this.applyImportPhase(node, isExport, phaseIdentifierName, phaseIdentifier.start);
|
|
29722
29829
|
return null;
|
|
29723
29830
|
} else {
|
|
29724
29831
|
this.applyImportPhase(node, isExport, null);
|
|
@@ -29836,7 +29943,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
29836
29943
|
else {
|
|
29837
29944
|
const { imported } = specifier;
|
|
29838
29945
|
if (importedIsString) throw this.raise(Errors.ImportBindingIsString, specifier, { importName: imported.value });
|
|
29839
|
-
this.checkReservedWord(imported.name, specifier.
|
|
29946
|
+
this.checkReservedWord(imported.name, specifier.start, true, true);
|
|
29840
29947
|
if (!specifier.local) specifier.local = this.cloneIdentifier(imported);
|
|
29841
29948
|
}
|
|
29842
29949
|
return this.finishImportSpecifier(specifier, "ImportSpecifier", bindingType);
|
|
@@ -29863,12 +29970,13 @@ var Parser = class extends StatementParser {
|
|
|
29863
29970
|
if (normalizedOptions.allowNewTargetOutsideFunction) optionFlags |= 4;
|
|
29864
29971
|
if (normalizedOptions.allowYieldOutsideFunction) optionFlags |= 32;
|
|
29865
29972
|
if (normalizedOptions.ranges) optionFlags |= 128;
|
|
29866
|
-
if (normalizedOptions.
|
|
29867
|
-
if (normalizedOptions.
|
|
29868
|
-
if (normalizedOptions.
|
|
29869
|
-
if (normalizedOptions.
|
|
29870
|
-
if (normalizedOptions.
|
|
29871
|
-
if (normalizedOptions.
|
|
29973
|
+
if (normalizedOptions.locations === true) optionFlags |= 256;
|
|
29974
|
+
if (normalizedOptions.tokens) optionFlags |= 512;
|
|
29975
|
+
if (normalizedOptions.createImportExpressions) optionFlags |= 1024;
|
|
29976
|
+
if (normalizedOptions.createParenthesizedExpressions) optionFlags |= 2048;
|
|
29977
|
+
if (normalizedOptions.errorRecovery) optionFlags |= 4096;
|
|
29978
|
+
if (normalizedOptions.attachComment) optionFlags |= 8192;
|
|
29979
|
+
if (normalizedOptions.annexB) optionFlags |= 16384;
|
|
29872
29980
|
this.optionFlags = optionFlags;
|
|
29873
29981
|
}
|
|
29874
29982
|
getScopeHandler() {
|
|
@@ -29883,6 +29991,7 @@ var Parser = class extends StatementParser {
|
|
|
29883
29991
|
const result = this.parseTopLevel(file, program);
|
|
29884
29992
|
result.errors = this.state.errors;
|
|
29885
29993
|
result.comments.length = this.state.commentsLen;
|
|
29994
|
+
if (this.options.locations === "packed") result.locData = resetLocData();
|
|
29886
29995
|
return result;
|
|
29887
29996
|
}
|
|
29888
29997
|
};
|
|
@@ -30298,849 +30407,11 @@ function resolveTemplateLiteral(node) {
|
|
|
30298
30407
|
* @param {WalkHandlers<T, void>} hooks - The handlers to be applied during the walk.
|
|
30299
30408
|
* @returns {T | null} - The modified AST node or null if the node is removed.
|
|
30300
30409
|
*/
|
|
30301
|
-
const walkAST = walk
|
|
30302
|
-
var h$1 = ((r) => (r.Export = "exports", r.Import = "imports", r))(h$1 || {});
|
|
30303
|
-
const f = (r, t, e, o, c) => {
|
|
30304
|
-
if (t == null) return [];
|
|
30305
|
-
if (typeof t == "string") {
|
|
30306
|
-
const [n, ...i] = t.split(w);
|
|
30307
|
-
if (n === ".." || i.some((l) => O$1.test(l))) throw a(E$1, `Invalid "${r}" target "${t}" defined in the package config`);
|
|
30308
|
-
return [c ? t.replace(/\*/g, c) : t];
|
|
30309
|
-
}
|
|
30310
|
-
if (Array.isArray(t)) return t.flatMap((n) => f(r, n, e, o, c));
|
|
30311
|
-
if (A(t)) {
|
|
30312
|
-
for (const n of Object.keys(t)) {
|
|
30313
|
-
if (R.test(n)) throw a(_, "Cannot contain numeric property keys");
|
|
30314
|
-
if (n === "default" || o.includes(n)) return f(r, t[n], e, o, c);
|
|
30315
|
-
}
|
|
30316
|
-
return [];
|
|
30317
|
-
}
|
|
30318
|
-
throw a(E$1, `Invalid "${r}" target "${t}"`);
|
|
30319
|
-
}, s = "*", m = (r, t) => {
|
|
30320
|
-
const e = r.indexOf(s), o = t.indexOf(s);
|
|
30321
|
-
return e === o ? t.length > r.length : o > e;
|
|
30322
|
-
};
|
|
30323
|
-
function d(r, t) {
|
|
30324
|
-
if (!t.includes(s) && r.hasOwnProperty(t)) return [t];
|
|
30325
|
-
let e, o;
|
|
30326
|
-
for (const c of Object.keys(r)) if (c.includes(s)) {
|
|
30327
|
-
const [n, i, l] = c.split(s);
|
|
30328
|
-
if (l === void 0 && t.startsWith(n) && t.endsWith(i)) {
|
|
30329
|
-
const g = t.slice(n.length, -i.length || void 0);
|
|
30330
|
-
g && (!e || m(e, c)) && (e = c, o = g);
|
|
30331
|
-
}
|
|
30332
|
-
}
|
|
30333
|
-
return [e, o];
|
|
30334
|
-
}
|
|
30335
|
-
const p = (r) => Object.keys(r).reduce((t, e) => {
|
|
30336
|
-
const o = e === "" || e[0] !== ".";
|
|
30337
|
-
if (t === void 0 || t === o) return o;
|
|
30338
|
-
throw a(_, "\"exports\" cannot contain some keys starting with \".\" and some not");
|
|
30339
|
-
}, void 0), u = /^\w+:/, v = (r, t, e) => {
|
|
30340
|
-
if (!r) throw new Error("\"exports\" is required");
|
|
30341
|
-
t = t === "" ? "." : `./${t}`, (typeof r == "string" || Array.isArray(r) || A(r) && p(r)) && (r = { ".": r });
|
|
30342
|
-
const [o, c] = d(r, t), n = f(h$1.Export, r[o], t, e, c);
|
|
30343
|
-
if (n.length === 0) throw a(I$1, t === "." ? "No \"exports\" main defined" : `Package subpath '${t}' is not defined by "exports"`);
|
|
30344
|
-
for (const i of n) if (!i.startsWith("./") && !u.test(i)) throw a(E$1, `Invalid "exports" target "${i}" defined in the package config`);
|
|
30345
|
-
return n;
|
|
30346
|
-
};
|
|
30347
|
-
//#endregion
|
|
30348
|
-
//#region ../../node_modules/.pnpm/get-tsconfig@4.13.6/node_modules/get-tsconfig/dist/index.mjs
|
|
30349
|
-
var Le = Object.defineProperty;
|
|
30350
|
-
var i = (e, t) => Le(e, "name", {
|
|
30351
|
-
value: t,
|
|
30352
|
-
configurable: !0
|
|
30353
|
-
});
|
|
30354
|
-
function h(e) {
|
|
30355
|
-
return e.startsWith("\\\\?\\") ? e : e.replace(/\\/g, "/");
|
|
30356
|
-
}
|
|
30357
|
-
i(h, "slash");
|
|
30358
|
-
const Z = i((e) => {
|
|
30359
|
-
const t = re[e];
|
|
30360
|
-
return (s, ...n) => {
|
|
30361
|
-
const o = `${e}:${n.join(":")}`;
|
|
30362
|
-
let l = s == null ? void 0 : s.get(o);
|
|
30363
|
-
return l === void 0 && (l = Reflect.apply(t, re, n), s?.set(o, l)), l;
|
|
30364
|
-
};
|
|
30365
|
-
}, "cacheFs"), E = Z("existsSync"), $e = Z("readFileSync"), G = Z("statSync"), fe = i((e, t, s) => {
|
|
30366
|
-
for (;;) {
|
|
30367
|
-
const n = path.posix.join(e, t);
|
|
30368
|
-
if (E(s, n)) return n;
|
|
30369
|
-
const o = path.dirname(e);
|
|
30370
|
-
if (o === e) return;
|
|
30371
|
-
e = o;
|
|
30372
|
-
}
|
|
30373
|
-
}, "findUp"), q = /^\.{1,2}(\/.*)?$/, K = i((e) => {
|
|
30374
|
-
const t = h(e);
|
|
30375
|
-
return q.test(t) ? t : `./${t}`;
|
|
30376
|
-
}, "normalizeRelativePath");
|
|
30377
|
-
function Ue(e, t = !1) {
|
|
30378
|
-
const s = e.length;
|
|
30379
|
-
let n = 0, o = "", l = 0, u = 16, a = 0, r = 0, g = 0, v = 0, d = 0;
|
|
30380
|
-
function _(c, y) {
|
|
30381
|
-
let A = 0, b = 0;
|
|
30382
|
-
for (; A < c;) {
|
|
30383
|
-
let k = e.charCodeAt(n);
|
|
30384
|
-
if (k >= 48 && k <= 57) b = b * 16 + k - 48;
|
|
30385
|
-
else if (k >= 65 && k <= 70) b = b * 16 + k - 65 + 10;
|
|
30386
|
-
else if (k >= 97 && k <= 102) b = b * 16 + k - 97 + 10;
|
|
30387
|
-
else break;
|
|
30388
|
-
n++, A++;
|
|
30389
|
-
}
|
|
30390
|
-
return A < c && (b = -1), b;
|
|
30391
|
-
}
|
|
30392
|
-
i(_, "scanHexDigits");
|
|
30393
|
-
function p(c) {
|
|
30394
|
-
n = c, o = "", l = 0, u = 16, d = 0;
|
|
30395
|
-
}
|
|
30396
|
-
i(p, "setPosition");
|
|
30397
|
-
function D() {
|
|
30398
|
-
let c = n;
|
|
30399
|
-
if (e.charCodeAt(n) === 48) n++;
|
|
30400
|
-
else for (n++; n < e.length && N(e.charCodeAt(n));) n++;
|
|
30401
|
-
if (n < e.length && e.charCodeAt(n) === 46) if (n++, n < e.length && N(e.charCodeAt(n))) for (n++; n < e.length && N(e.charCodeAt(n));) n++;
|
|
30402
|
-
else return d = 3, e.substring(c, n);
|
|
30403
|
-
let y = n;
|
|
30404
|
-
if (n < e.length && (e.charCodeAt(n) === 69 || e.charCodeAt(n) === 101)) if (n++, (n < e.length && e.charCodeAt(n) === 43 || e.charCodeAt(n) === 45) && n++, n < e.length && N(e.charCodeAt(n))) {
|
|
30405
|
-
for (n++; n < e.length && N(e.charCodeAt(n));) n++;
|
|
30406
|
-
y = n;
|
|
30407
|
-
} else d = 3;
|
|
30408
|
-
return e.substring(c, y);
|
|
30409
|
-
}
|
|
30410
|
-
i(D, "scanNumber");
|
|
30411
|
-
function L() {
|
|
30412
|
-
let c = "", y = n;
|
|
30413
|
-
for (;;) {
|
|
30414
|
-
if (n >= s) {
|
|
30415
|
-
c += e.substring(y, n), d = 2;
|
|
30416
|
-
break;
|
|
30417
|
-
}
|
|
30418
|
-
const A = e.charCodeAt(n);
|
|
30419
|
-
if (A === 34) {
|
|
30420
|
-
c += e.substring(y, n), n++;
|
|
30421
|
-
break;
|
|
30422
|
-
}
|
|
30423
|
-
if (A === 92) {
|
|
30424
|
-
if (c += e.substring(y, n), n++, n >= s) {
|
|
30425
|
-
d = 2;
|
|
30426
|
-
break;
|
|
30427
|
-
}
|
|
30428
|
-
switch (e.charCodeAt(n++)) {
|
|
30429
|
-
case 34:
|
|
30430
|
-
c += "\"";
|
|
30431
|
-
break;
|
|
30432
|
-
case 92:
|
|
30433
|
-
c += "\\";
|
|
30434
|
-
break;
|
|
30435
|
-
case 47:
|
|
30436
|
-
c += "/";
|
|
30437
|
-
break;
|
|
30438
|
-
case 98:
|
|
30439
|
-
c += "\b";
|
|
30440
|
-
break;
|
|
30441
|
-
case 102:
|
|
30442
|
-
c += "\f";
|
|
30443
|
-
break;
|
|
30444
|
-
case 110:
|
|
30445
|
-
c += `
|
|
30446
|
-
`;
|
|
30447
|
-
break;
|
|
30448
|
-
case 114:
|
|
30449
|
-
c += "\r";
|
|
30450
|
-
break;
|
|
30451
|
-
case 116:
|
|
30452
|
-
c += " ";
|
|
30453
|
-
break;
|
|
30454
|
-
case 117:
|
|
30455
|
-
const k = _(4);
|
|
30456
|
-
k >= 0 ? c += String.fromCharCode(k) : d = 4;
|
|
30457
|
-
break;
|
|
30458
|
-
default: d = 5;
|
|
30459
|
-
}
|
|
30460
|
-
y = n;
|
|
30461
|
-
continue;
|
|
30462
|
-
}
|
|
30463
|
-
if (A >= 0 && A <= 31) if (J(A)) {
|
|
30464
|
-
c += e.substring(y, n), d = 2;
|
|
30465
|
-
break;
|
|
30466
|
-
} else d = 6;
|
|
30467
|
-
n++;
|
|
30468
|
-
}
|
|
30469
|
-
return c;
|
|
30470
|
-
}
|
|
30471
|
-
i(L, "scanString");
|
|
30472
|
-
function T() {
|
|
30473
|
-
if (o = "", d = 0, l = n, r = a, v = g, n >= s) return l = s, u = 17;
|
|
30474
|
-
let c = e.charCodeAt(n);
|
|
30475
|
-
if (O(c)) {
|
|
30476
|
-
do
|
|
30477
|
-
n++, o += String.fromCharCode(c), c = e.charCodeAt(n);
|
|
30478
|
-
while (O(c));
|
|
30479
|
-
return u = 15;
|
|
30480
|
-
}
|
|
30481
|
-
if (J(c)) return n++, o += String.fromCharCode(c), c === 13 && e.charCodeAt(n) === 10 && (n++, o += `
|
|
30482
|
-
`), a++, g = n, u = 14;
|
|
30483
|
-
switch (c) {
|
|
30484
|
-
case 123: return n++, u = 1;
|
|
30485
|
-
case 125: return n++, u = 2;
|
|
30486
|
-
case 91: return n++, u = 3;
|
|
30487
|
-
case 93: return n++, u = 4;
|
|
30488
|
-
case 58: return n++, u = 6;
|
|
30489
|
-
case 44: return n++, u = 5;
|
|
30490
|
-
case 34: return n++, o = L(), u = 10;
|
|
30491
|
-
case 47:
|
|
30492
|
-
const y = n - 1;
|
|
30493
|
-
if (e.charCodeAt(n + 1) === 47) {
|
|
30494
|
-
for (n += 2; n < s && !J(e.charCodeAt(n));) n++;
|
|
30495
|
-
return o = e.substring(y, n), u = 12;
|
|
30496
|
-
}
|
|
30497
|
-
if (e.charCodeAt(n + 1) === 42) {
|
|
30498
|
-
n += 2;
|
|
30499
|
-
const A = s - 1;
|
|
30500
|
-
let b = !1;
|
|
30501
|
-
for (; n < A;) {
|
|
30502
|
-
const k = e.charCodeAt(n);
|
|
30503
|
-
if (k === 42 && e.charCodeAt(n + 1) === 47) {
|
|
30504
|
-
n += 2, b = !0;
|
|
30505
|
-
break;
|
|
30506
|
-
}
|
|
30507
|
-
n++, J(k) && (k === 13 && e.charCodeAt(n) === 10 && n++, a++, g = n);
|
|
30508
|
-
}
|
|
30509
|
-
return b || (n++, d = 1), o = e.substring(y, n), u = 13;
|
|
30510
|
-
}
|
|
30511
|
-
return o += String.fromCharCode(c), n++, u = 16;
|
|
30512
|
-
case 45: if (o += String.fromCharCode(c), n++, n === s || !N(e.charCodeAt(n))) return u = 16;
|
|
30513
|
-
case 48:
|
|
30514
|
-
case 49:
|
|
30515
|
-
case 50:
|
|
30516
|
-
case 51:
|
|
30517
|
-
case 52:
|
|
30518
|
-
case 53:
|
|
30519
|
-
case 54:
|
|
30520
|
-
case 55:
|
|
30521
|
-
case 56:
|
|
30522
|
-
case 57: return o += D(), u = 11;
|
|
30523
|
-
default:
|
|
30524
|
-
for (; n < s && F(c);) n++, c = e.charCodeAt(n);
|
|
30525
|
-
if (l !== n) {
|
|
30526
|
-
switch (o = e.substring(l, n), o) {
|
|
30527
|
-
case "true": return u = 8;
|
|
30528
|
-
case "false": return u = 9;
|
|
30529
|
-
case "null": return u = 7;
|
|
30530
|
-
}
|
|
30531
|
-
return u = 16;
|
|
30532
|
-
}
|
|
30533
|
-
return o += String.fromCharCode(c), n++, u = 16;
|
|
30534
|
-
}
|
|
30535
|
-
}
|
|
30536
|
-
i(T, "scanNext");
|
|
30537
|
-
function F(c) {
|
|
30538
|
-
if (O(c) || J(c)) return !1;
|
|
30539
|
-
switch (c) {
|
|
30540
|
-
case 125:
|
|
30541
|
-
case 93:
|
|
30542
|
-
case 123:
|
|
30543
|
-
case 91:
|
|
30544
|
-
case 34:
|
|
30545
|
-
case 58:
|
|
30546
|
-
case 44:
|
|
30547
|
-
case 47: return !1;
|
|
30548
|
-
}
|
|
30549
|
-
return !0;
|
|
30550
|
-
}
|
|
30551
|
-
i(F, "isUnknownContentCharacter");
|
|
30552
|
-
function x() {
|
|
30553
|
-
let c;
|
|
30554
|
-
do
|
|
30555
|
-
c = T();
|
|
30556
|
-
while (c >= 12 && c <= 15);
|
|
30557
|
-
return c;
|
|
30558
|
-
}
|
|
30559
|
-
return i(x, "scanNextNonTrivia"), {
|
|
30560
|
-
setPosition: p,
|
|
30561
|
-
getPosition: i(() => n, "getPosition"),
|
|
30562
|
-
scan: t ? x : T,
|
|
30563
|
-
getToken: i(() => u, "getToken"),
|
|
30564
|
-
getTokenValue: i(() => o, "getTokenValue"),
|
|
30565
|
-
getTokenOffset: i(() => l, "getTokenOffset"),
|
|
30566
|
-
getTokenLength: i(() => n - l, "getTokenLength"),
|
|
30567
|
-
getTokenStartLine: i(() => r, "getTokenStartLine"),
|
|
30568
|
-
getTokenStartCharacter: i(() => l - v, "getTokenStartCharacter"),
|
|
30569
|
-
getTokenError: i(() => d, "getTokenError")
|
|
30570
|
-
};
|
|
30571
|
-
}
|
|
30572
|
-
i(Ue, "createScanner");
|
|
30573
|
-
function O(e) {
|
|
30574
|
-
return e === 32 || e === 9;
|
|
30575
|
-
}
|
|
30576
|
-
i(O, "isWhiteSpace");
|
|
30577
|
-
function J(e) {
|
|
30578
|
-
return e === 10 || e === 13;
|
|
30579
|
-
}
|
|
30580
|
-
i(J, "isLineBreak");
|
|
30581
|
-
function N(e) {
|
|
30582
|
-
return e >= 48 && e <= 57;
|
|
30583
|
-
}
|
|
30584
|
-
i(N, "isDigit");
|
|
30585
|
-
var ae;
|
|
30586
|
-
(function(e) {
|
|
30587
|
-
e[e.lineFeed = 10] = "lineFeed", e[e.carriageReturn = 13] = "carriageReturn", e[e.space = 32] = "space", e[e._0 = 48] = "_0", e[e._1 = 49] = "_1", e[e._2 = 50] = "_2", e[e._3 = 51] = "_3", e[e._4 = 52] = "_4", e[e._5 = 53] = "_5", e[e._6 = 54] = "_6", e[e._7 = 55] = "_7", e[e._8 = 56] = "_8", e[e._9 = 57] = "_9", e[e.a = 97] = "a", e[e.b = 98] = "b", e[e.c = 99] = "c", e[e.d = 100] = "d", e[e.e = 101] = "e", e[e.f = 102] = "f", e[e.g = 103] = "g", e[e.h = 104] = "h", e[e.i = 105] = "i", e[e.j = 106] = "j", e[e.k = 107] = "k", e[e.l = 108] = "l", e[e.m = 109] = "m", e[e.n = 110] = "n", e[e.o = 111] = "o", e[e.p = 112] = "p", e[e.q = 113] = "q", e[e.r = 114] = "r", e[e.s = 115] = "s", e[e.t = 116] = "t", e[e.u = 117] = "u", e[e.v = 118] = "v", e[e.w = 119] = "w", e[e.x = 120] = "x", e[e.y = 121] = "y", e[e.z = 122] = "z", e[e.A = 65] = "A", e[e.B = 66] = "B", e[e.C = 67] = "C", e[e.D = 68] = "D", e[e.E = 69] = "E", e[e.F = 70] = "F", e[e.G = 71] = "G", e[e.H = 72] = "H", e[e.I = 73] = "I", e[e.J = 74] = "J", e[e.K = 75] = "K", e[e.L = 76] = "L", e[e.M = 77] = "M", e[e.N = 78] = "N", e[e.O = 79] = "O", e[e.P = 80] = "P", e[e.Q = 81] = "Q", e[e.R = 82] = "R", e[e.S = 83] = "S", e[e.T = 84] = "T", e[e.U = 85] = "U", e[e.V = 86] = "V", e[e.W = 87] = "W", e[e.X = 88] = "X", e[e.Y = 89] = "Y", e[e.Z = 90] = "Z", e[e.asterisk = 42] = "asterisk", e[e.backslash = 92] = "backslash", e[e.closeBrace = 125] = "closeBrace", e[e.closeBracket = 93] = "closeBracket", e[e.colon = 58] = "colon", e[e.comma = 44] = "comma", e[e.dot = 46] = "dot", e[e.doubleQuote = 34] = "doubleQuote", e[e.minus = 45] = "minus", e[e.openBrace = 123] = "openBrace", e[e.openBracket = 91] = "openBracket", e[e.plus = 43] = "plus", e[e.slash = 47] = "slash", e[e.formFeed = 12] = "formFeed", e[e.tab = 9] = "tab";
|
|
30588
|
-
})(ae || (ae = {})), new Array(20).fill(0).map((e, t) => " ".repeat(t));
|
|
30589
|
-
const P = 200;
|
|
30590
|
-
new Array(P).fill(0).map((e, t) => `
|
|
30591
|
-
` + " ".repeat(t)), new Array(P).fill(0).map((e, t) => "\r" + " ".repeat(t)), new Array(P).fill(0).map((e, t) => `\r
|
|
30592
|
-
` + " ".repeat(t)), new Array(P).fill(0).map((e, t) => `
|
|
30593
|
-
` + " ".repeat(t)), new Array(P).fill(0).map((e, t) => "\r" + " ".repeat(t)), new Array(P).fill(0).map((e, t) => `\r
|
|
30594
|
-
` + " ".repeat(t));
|
|
30595
|
-
var Q;
|
|
30596
|
-
(function(e) {
|
|
30597
|
-
e.DEFAULT = { allowTrailingComma: !1 };
|
|
30598
|
-
})(Q || (Q = {}));
|
|
30599
|
-
function Ne(e, t = [], s = Q.DEFAULT) {
|
|
30600
|
-
let n = null, o = [];
|
|
30601
|
-
const l = [];
|
|
30602
|
-
function u(r) {
|
|
30603
|
-
Array.isArray(o) ? o.push(r) : n !== null && (o[n] = r);
|
|
30604
|
-
}
|
|
30605
|
-
return i(u, "onValue"), Pe(e, {
|
|
30606
|
-
onObjectBegin: i(() => {
|
|
30607
|
-
const r = {};
|
|
30608
|
-
u(r), l.push(o), o = r, n = null;
|
|
30609
|
-
}, "onObjectBegin"),
|
|
30610
|
-
onObjectProperty: i((r) => {
|
|
30611
|
-
n = r;
|
|
30612
|
-
}, "onObjectProperty"),
|
|
30613
|
-
onObjectEnd: i(() => {
|
|
30614
|
-
o = l.pop();
|
|
30615
|
-
}, "onObjectEnd"),
|
|
30616
|
-
onArrayBegin: i(() => {
|
|
30617
|
-
const r = [];
|
|
30618
|
-
u(r), l.push(o), o = r, n = null;
|
|
30619
|
-
}, "onArrayBegin"),
|
|
30620
|
-
onArrayEnd: i(() => {
|
|
30621
|
-
o = l.pop();
|
|
30622
|
-
}, "onArrayEnd"),
|
|
30623
|
-
onLiteralValue: u,
|
|
30624
|
-
onError: i((r, g, v) => {
|
|
30625
|
-
t.push({
|
|
30626
|
-
error: r,
|
|
30627
|
-
offset: g,
|
|
30628
|
-
length: v
|
|
30629
|
-
});
|
|
30630
|
-
}, "onError")
|
|
30631
|
-
}, s), o[0];
|
|
30632
|
-
}
|
|
30633
|
-
i(Ne, "parse$1");
|
|
30634
|
-
function Pe(e, t, s = Q.DEFAULT) {
|
|
30635
|
-
const n = Ue(e, !1), o = [];
|
|
30636
|
-
let l = 0;
|
|
30637
|
-
function u(w) {
|
|
30638
|
-
return w ? () => l === 0 && w(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
|
|
30639
|
-
}
|
|
30640
|
-
i(u, "toNoArgVisit");
|
|
30641
|
-
function a(w) {
|
|
30642
|
-
return w ? (j) => l === 0 && w(j, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter()) : () => !0;
|
|
30643
|
-
}
|
|
30644
|
-
i(a, "toOneArgVisit");
|
|
30645
|
-
function r(w) {
|
|
30646
|
-
return w ? (j) => l === 0 && w(j, n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => o.slice()) : () => !0;
|
|
30647
|
-
}
|
|
30648
|
-
i(r, "toOneArgVisitWithPath");
|
|
30649
|
-
function g(w) {
|
|
30650
|
-
return w ? () => {
|
|
30651
|
-
l > 0 ? l++ : w(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter(), () => o.slice()) === !1 && (l = 1);
|
|
30652
|
-
} : () => !0;
|
|
30653
|
-
}
|
|
30654
|
-
i(g, "toBeginVisit");
|
|
30655
|
-
function v(w) {
|
|
30656
|
-
return w ? () => {
|
|
30657
|
-
l > 0 && l--, l === 0 && w(n.getTokenOffset(), n.getTokenLength(), n.getTokenStartLine(), n.getTokenStartCharacter());
|
|
30658
|
-
} : () => !0;
|
|
30659
|
-
}
|
|
30660
|
-
i(v, "toEndVisit");
|
|
30661
|
-
const d = g(t.onObjectBegin), _ = r(t.onObjectProperty), p = v(t.onObjectEnd), D = g(t.onArrayBegin), L = v(t.onArrayEnd), T = r(t.onLiteralValue), F = a(t.onSeparator), x = u(t.onComment), c = a(t.onError), y = s && s.disallowComments, A = s && s.allowTrailingComma;
|
|
30662
|
-
function b() {
|
|
30663
|
-
for (;;) {
|
|
30664
|
-
const w = n.scan();
|
|
30665
|
-
switch (n.getTokenError()) {
|
|
30666
|
-
case 4:
|
|
30667
|
-
k(14);
|
|
30668
|
-
break;
|
|
30669
|
-
case 5:
|
|
30670
|
-
k(15);
|
|
30671
|
-
break;
|
|
30672
|
-
case 3:
|
|
30673
|
-
k(13);
|
|
30674
|
-
break;
|
|
30675
|
-
case 1:
|
|
30676
|
-
y || k(11);
|
|
30677
|
-
break;
|
|
30678
|
-
case 2:
|
|
30679
|
-
k(12);
|
|
30680
|
-
break;
|
|
30681
|
-
case 6:
|
|
30682
|
-
k(16);
|
|
30683
|
-
break;
|
|
30684
|
-
}
|
|
30685
|
-
switch (w) {
|
|
30686
|
-
case 12:
|
|
30687
|
-
case 13:
|
|
30688
|
-
y ? k(10) : x();
|
|
30689
|
-
break;
|
|
30690
|
-
case 16:
|
|
30691
|
-
k(1);
|
|
30692
|
-
break;
|
|
30693
|
-
case 15:
|
|
30694
|
-
case 14: break;
|
|
30695
|
-
default: return w;
|
|
30696
|
-
}
|
|
30697
|
-
}
|
|
30698
|
-
}
|
|
30699
|
-
i(b, "scanNext");
|
|
30700
|
-
function k(w, j = [], S = []) {
|
|
30701
|
-
if (c(w), j.length + S.length > 0) {
|
|
30702
|
-
let $ = n.getToken();
|
|
30703
|
-
for (; $ !== 17;) {
|
|
30704
|
-
if (j.indexOf($) !== -1) {
|
|
30705
|
-
b();
|
|
30706
|
-
break;
|
|
30707
|
-
} else if (S.indexOf($) !== -1) break;
|
|
30708
|
-
$ = b();
|
|
30709
|
-
}
|
|
30710
|
-
}
|
|
30711
|
-
}
|
|
30712
|
-
i(k, "handleError");
|
|
30713
|
-
function R(w) {
|
|
30714
|
-
const j = n.getTokenValue();
|
|
30715
|
-
return w ? T(j) : (_(j), o.push(j)), b(), !0;
|
|
30716
|
-
}
|
|
30717
|
-
i(R, "parseString");
|
|
30718
|
-
function W() {
|
|
30719
|
-
switch (n.getToken()) {
|
|
30720
|
-
case 11:
|
|
30721
|
-
const w = n.getTokenValue();
|
|
30722
|
-
let j = Number(w);
|
|
30723
|
-
isNaN(j) && (k(2), j = 0), T(j);
|
|
30724
|
-
break;
|
|
30725
|
-
case 7:
|
|
30726
|
-
T(null);
|
|
30727
|
-
break;
|
|
30728
|
-
case 8:
|
|
30729
|
-
T(!0);
|
|
30730
|
-
break;
|
|
30731
|
-
case 9:
|
|
30732
|
-
T(!1);
|
|
30733
|
-
break;
|
|
30734
|
-
default: return !1;
|
|
30735
|
-
}
|
|
30736
|
-
return b(), !0;
|
|
30737
|
-
}
|
|
30738
|
-
i(W, "parseLiteral");
|
|
30739
|
-
function V() {
|
|
30740
|
-
return n.getToken() !== 10 ? (k(3, [], [2, 5]), !1) : (R(!1), n.getToken() === 6 ? (F(":"), b(), U() || k(4, [], [2, 5])) : k(5, [], [2, 5]), o.pop(), !0);
|
|
30741
|
-
}
|
|
30742
|
-
i(V, "parseProperty");
|
|
30743
|
-
function M() {
|
|
30744
|
-
d(), b();
|
|
30745
|
-
let w = !1;
|
|
30746
|
-
for (; n.getToken() !== 2 && n.getToken() !== 17;) {
|
|
30747
|
-
if (n.getToken() === 5) {
|
|
30748
|
-
if (w || k(4, [], []), F(","), b(), n.getToken() === 2 && A) break;
|
|
30749
|
-
} else w && k(6, [], []);
|
|
30750
|
-
V() || k(4, [], [2, 5]), w = !0;
|
|
30751
|
-
}
|
|
30752
|
-
return p(), n.getToken() !== 2 ? k(7, [2], []) : b(), !0;
|
|
30753
|
-
}
|
|
30754
|
-
i(M, "parseObject");
|
|
30755
|
-
function z() {
|
|
30756
|
-
D(), b();
|
|
30757
|
-
let w = !0, j = !1;
|
|
30758
|
-
for (; n.getToken() !== 4 && n.getToken() !== 17;) {
|
|
30759
|
-
if (n.getToken() === 5) {
|
|
30760
|
-
if (j || k(4, [], []), F(","), b(), n.getToken() === 4 && A) break;
|
|
30761
|
-
} else j && k(6, [], []);
|
|
30762
|
-
w ? (o.push(0), w = !1) : o[o.length - 1]++, U() || k(4, [], [4, 5]), j = !0;
|
|
30763
|
-
}
|
|
30764
|
-
return L(), w || o.pop(), n.getToken() !== 4 ? k(8, [4], []) : b(), !0;
|
|
30765
|
-
}
|
|
30766
|
-
i(z, "parseArray");
|
|
30767
|
-
function U() {
|
|
30768
|
-
switch (n.getToken()) {
|
|
30769
|
-
case 3: return z();
|
|
30770
|
-
case 1: return M();
|
|
30771
|
-
case 10: return R(!0);
|
|
30772
|
-
default: return W();
|
|
30773
|
-
}
|
|
30774
|
-
}
|
|
30775
|
-
return i(U, "parseValue"), b(), n.getToken() === 17 ? s.allowEmptyContent ? !0 : (k(4, [], []), !1) : U() ? (n.getToken() !== 17 && k(9, [], []), !0) : (k(4, [], []), !1);
|
|
30776
|
-
}
|
|
30777
|
-
i(Pe, "visit");
|
|
30778
|
-
var ce;
|
|
30779
|
-
(function(e) {
|
|
30780
|
-
e[e.None = 0] = "None", e[e.UnexpectedEndOfComment = 1] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 2] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 3] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 4] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 5] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 6] = "InvalidCharacter";
|
|
30781
|
-
})(ce || (ce = {}));
|
|
30782
|
-
var ge;
|
|
30783
|
-
(function(e) {
|
|
30784
|
-
e[e.OpenBraceToken = 1] = "OpenBraceToken", e[e.CloseBraceToken = 2] = "CloseBraceToken", e[e.OpenBracketToken = 3] = "OpenBracketToken", e[e.CloseBracketToken = 4] = "CloseBracketToken", e[e.CommaToken = 5] = "CommaToken", e[e.ColonToken = 6] = "ColonToken", e[e.NullKeyword = 7] = "NullKeyword", e[e.TrueKeyword = 8] = "TrueKeyword", e[e.FalseKeyword = 9] = "FalseKeyword", e[e.StringLiteral = 10] = "StringLiteral", e[e.NumericLiteral = 11] = "NumericLiteral", e[e.LineCommentTrivia = 12] = "LineCommentTrivia", e[e.BlockCommentTrivia = 13] = "BlockCommentTrivia", e[e.LineBreakTrivia = 14] = "LineBreakTrivia", e[e.Trivia = 15] = "Trivia", e[e.Unknown = 16] = "Unknown", e[e.EOF = 17] = "EOF";
|
|
30785
|
-
})(ge || (ge = {}));
|
|
30786
|
-
const Re = Ne;
|
|
30787
|
-
var ke;
|
|
30788
|
-
(function(e) {
|
|
30789
|
-
e[e.InvalidSymbol = 1] = "InvalidSymbol", e[e.InvalidNumberFormat = 2] = "InvalidNumberFormat", e[e.PropertyNameExpected = 3] = "PropertyNameExpected", e[e.ValueExpected = 4] = "ValueExpected", e[e.ColonExpected = 5] = "ColonExpected", e[e.CommaExpected = 6] = "CommaExpected", e[e.CloseBraceExpected = 7] = "CloseBraceExpected", e[e.CloseBracketExpected = 8] = "CloseBracketExpected", e[e.EndOfFileExpected = 9] = "EndOfFileExpected", e[e.InvalidCommentToken = 10] = "InvalidCommentToken", e[e.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e[e.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e[e.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e[e.InvalidUnicode = 14] = "InvalidUnicode", e[e.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e[e.InvalidCharacter = 16] = "InvalidCharacter";
|
|
30790
|
-
})(ke || (ke = {}));
|
|
30791
|
-
const me = i((e, t) => Re($e(t, e, "utf8")), "readJsonc"), C = Symbol("implicitBaseUrl"), I = "${configDir}", Se = i(() => {
|
|
30792
|
-
const { findPnpApi: e } = module$1;
|
|
30793
|
-
return e && e(process.cwd());
|
|
30794
|
-
}, "getPnpApi"), ee = i((e, t, s, n) => {
|
|
30795
|
-
const o = `resolveFromPackageJsonPath:${e}:${t}:${s}`;
|
|
30796
|
-
if (n != null && n.has(o)) return n.get(o);
|
|
30797
|
-
const l = me(e, n);
|
|
30798
|
-
if (!l) return;
|
|
30799
|
-
let u = t || "tsconfig.json";
|
|
30800
|
-
if (!s && l.exports) try {
|
|
30801
|
-
const [a] = v(l.exports, t, ["require", "types"]);
|
|
30802
|
-
u = a;
|
|
30803
|
-
} catch {
|
|
30804
|
-
return !1;
|
|
30805
|
-
}
|
|
30806
|
-
else !t && l.tsconfig && (u = l.tsconfig);
|
|
30807
|
-
return u = path.join(e, "..", u), n?.set(o, u), u;
|
|
30808
|
-
}, "resolveFromPackageJsonPath"), ne = "package.json", te = "tsconfig.json", Je = i((e, t, s) => {
|
|
30809
|
-
let n = e;
|
|
30810
|
-
if (e === ".." && (n = path.join(n, te)), e[0] === "." && (n = path.resolve(t, n)), path.isAbsolute(n)) {
|
|
30811
|
-
if (E(s, n)) {
|
|
30812
|
-
if (G(s, n).isFile()) return n;
|
|
30813
|
-
} else if (!n.endsWith(".json")) {
|
|
30814
|
-
const p = `${n}.json`;
|
|
30815
|
-
if (E(s, p)) return p;
|
|
30816
|
-
}
|
|
30817
|
-
return;
|
|
30818
|
-
}
|
|
30819
|
-
const [o, ...l] = e.split("/"), u = o[0] === "@" ? `${o}/${l.shift()}` : o, a = l.join("/"), r = Se();
|
|
30820
|
-
if (r) {
|
|
30821
|
-
const { resolveRequest: p } = r;
|
|
30822
|
-
try {
|
|
30823
|
-
if (u === e) {
|
|
30824
|
-
const D = p(path.join(u, ne), t);
|
|
30825
|
-
if (D) {
|
|
30826
|
-
const L = ee(D, a, !1, s);
|
|
30827
|
-
if (L && E(s, L)) return L;
|
|
30828
|
-
}
|
|
30829
|
-
} else {
|
|
30830
|
-
let D;
|
|
30831
|
-
try {
|
|
30832
|
-
D = p(e, t, { extensions: [".json"] });
|
|
30833
|
-
} catch {
|
|
30834
|
-
D = p(path.join(e, te), t);
|
|
30835
|
-
}
|
|
30836
|
-
if (D) return D;
|
|
30837
|
-
}
|
|
30838
|
-
} catch {}
|
|
30839
|
-
}
|
|
30840
|
-
const g = fe(path.resolve(t), path.join("node_modules", u), s);
|
|
30841
|
-
if (!g || !G(s, g).isDirectory()) return;
|
|
30842
|
-
const v = path.join(g, ne);
|
|
30843
|
-
if (E(s, v)) {
|
|
30844
|
-
const p = ee(v, a, !1, s);
|
|
30845
|
-
if (p === !1) return;
|
|
30846
|
-
if (p && E(s, p) && G(s, p).isFile()) return p;
|
|
30847
|
-
}
|
|
30848
|
-
const d = path.join(g, a), _ = d.endsWith(".json");
|
|
30849
|
-
if (!_) {
|
|
30850
|
-
const p = `${d}.json`;
|
|
30851
|
-
if (E(s, p)) return p;
|
|
30852
|
-
}
|
|
30853
|
-
if (E(s, d)) {
|
|
30854
|
-
if (G(s, d).isDirectory()) {
|
|
30855
|
-
const p = path.join(d, ne);
|
|
30856
|
-
if (E(s, p)) {
|
|
30857
|
-
const L = ee(p, "", !0, s);
|
|
30858
|
-
if (L && E(s, L)) return L;
|
|
30859
|
-
}
|
|
30860
|
-
const D = path.join(d, te);
|
|
30861
|
-
if (E(s, D)) return D;
|
|
30862
|
-
} else if (_) return d;
|
|
30863
|
-
}
|
|
30864
|
-
}, "resolveExtendsPath"), se = i((e, t) => K(path.relative(e, t)), "pathRelative"), we = [
|
|
30865
|
-
"files",
|
|
30866
|
-
"include",
|
|
30867
|
-
"exclude"
|
|
30868
|
-
], de = i((e, t, s) => {
|
|
30869
|
-
const n = path.join(t, s);
|
|
30870
|
-
return h(path.relative(e, n)) || "./";
|
|
30871
|
-
}, "resolveAndRelativize"), We = i((e, t, s) => {
|
|
30872
|
-
const n = path.relative(e, t);
|
|
30873
|
-
if (!n) return s;
|
|
30874
|
-
return h(`${n}/${s.startsWith("./") ? s.slice(2) : s}`);
|
|
30875
|
-
}, "prefixPattern"), Ve = i((e, t, s, n) => {
|
|
30876
|
-
const o = Je(e, t, n);
|
|
30877
|
-
if (!o) throw new Error(`File '${e}' not found.`);
|
|
30878
|
-
if (s.has(o)) throw new Error(`Circularity detected while resolving configuration: ${o}`);
|
|
30879
|
-
s.add(o);
|
|
30880
|
-
const l = path.dirname(o), u = ve(o, n, s);
|
|
30881
|
-
delete u.references;
|
|
30882
|
-
const { compilerOptions: a } = u;
|
|
30883
|
-
if (a) {
|
|
30884
|
-
const { baseUrl: r } = a;
|
|
30885
|
-
r && !r.startsWith(I) && (a.baseUrl = de(t, l, r));
|
|
30886
|
-
const { outDir: g } = a;
|
|
30887
|
-
g && !g.startsWith(I) && (a.outDir = de(t, l, g));
|
|
30888
|
-
}
|
|
30889
|
-
for (const r of we) {
|
|
30890
|
-
const g = u[r];
|
|
30891
|
-
g && (u[r] = g.map((v) => v.startsWith(I) ? v : We(t, l, v)));
|
|
30892
|
-
}
|
|
30893
|
-
return u;
|
|
30894
|
-
}, "resolveExtends"), be = ["outDir", "declarationDir"], ve = i((e, t, s = /* @__PURE__ */ new Set()) => {
|
|
30895
|
-
let n;
|
|
30896
|
-
try {
|
|
30897
|
-
n = me(e, t) || {};
|
|
30898
|
-
} catch {
|
|
30899
|
-
throw new Error(`Cannot resolve tsconfig at path: ${e}`);
|
|
30900
|
-
}
|
|
30901
|
-
if (typeof n != "object") throw new SyntaxError(`Failed to parse tsconfig at: ${e}`);
|
|
30902
|
-
const o = path.dirname(e);
|
|
30903
|
-
if (n.compilerOptions) {
|
|
30904
|
-
const { compilerOptions: l } = n;
|
|
30905
|
-
l.paths && !l.baseUrl && (l[C] = o);
|
|
30906
|
-
}
|
|
30907
|
-
if (n.extends) {
|
|
30908
|
-
const l = Array.isArray(n.extends) ? n.extends : [n.extends];
|
|
30909
|
-
delete n.extends;
|
|
30910
|
-
for (const u of l.reverse()) {
|
|
30911
|
-
const a = Ve(u, o, new Set(s), t), r = {
|
|
30912
|
-
...a,
|
|
30913
|
-
...n,
|
|
30914
|
-
compilerOptions: {
|
|
30915
|
-
...a.compilerOptions,
|
|
30916
|
-
...n.compilerOptions
|
|
30917
|
-
}
|
|
30918
|
-
};
|
|
30919
|
-
a.watchOptions && (r.watchOptions = {
|
|
30920
|
-
...a.watchOptions,
|
|
30921
|
-
...n.watchOptions
|
|
30922
|
-
}), n = r;
|
|
30923
|
-
}
|
|
30924
|
-
}
|
|
30925
|
-
if (n.compilerOptions) {
|
|
30926
|
-
const { compilerOptions: l } = n;
|
|
30927
|
-
for (const a of ["baseUrl", "rootDir"]) {
|
|
30928
|
-
const r = l[a];
|
|
30929
|
-
if (r && !r.startsWith(I)) l[a] = se(o, path.resolve(o, r));
|
|
30930
|
-
}
|
|
30931
|
-
for (const a of be) {
|
|
30932
|
-
let r = l[a];
|
|
30933
|
-
r && (Array.isArray(n.exclude) || (n.exclude = be.map((g) => l[g]).filter(Boolean)), r.startsWith(I) || (r = K(r)), l[a] = r);
|
|
30934
|
-
}
|
|
30935
|
-
} else n.compilerOptions = {};
|
|
30936
|
-
if (n.include ? (n.include = n.include.map(h), n.files && delete n.files) : n.files && (n.files = n.files.map((l) => l.startsWith(I) ? l : K(l))), n.watchOptions) {
|
|
30937
|
-
const { watchOptions: l } = n;
|
|
30938
|
-
l.excludeDirectories && (l.excludeDirectories = l.excludeDirectories.map((u) => h(path.resolve(o, u)))), l.excludeFiles && (l.excludeFiles = l.excludeFiles.map((u) => h(path.resolve(o, u)))), l.watchFile && (l.watchFile = l.watchFile.toLowerCase()), l.watchDirectory && (l.watchDirectory = l.watchDirectory.toLowerCase()), l.fallbackPolling && (l.fallbackPolling = l.fallbackPolling.toLowerCase());
|
|
30939
|
-
}
|
|
30940
|
-
return n;
|
|
30941
|
-
}, "_parseTsconfig"), H = i((e, t) => {
|
|
30942
|
-
if (e.startsWith(I)) return h(path.join(t, e.slice(12)));
|
|
30943
|
-
}, "interpolateConfigDir"), Me = [
|
|
30944
|
-
"outDir",
|
|
30945
|
-
"declarationDir",
|
|
30946
|
-
"outFile",
|
|
30947
|
-
"rootDir",
|
|
30948
|
-
"baseUrl",
|
|
30949
|
-
"tsBuildInfoFile"
|
|
30950
|
-
], ze = i((e) => {
|
|
30951
|
-
if (e.strict) for (const B of [
|
|
30952
|
-
"noImplicitAny",
|
|
30953
|
-
"noImplicitThis",
|
|
30954
|
-
"strictNullChecks",
|
|
30955
|
-
"strictFunctionTypes",
|
|
30956
|
-
"strictBindCallApply",
|
|
30957
|
-
"strictPropertyInitialization",
|
|
30958
|
-
"strictBuiltinIteratorReturn",
|
|
30959
|
-
"alwaysStrict",
|
|
30960
|
-
"useUnknownInCatchVariables"
|
|
30961
|
-
]) e[B] === void 0 && (e[B] = !0);
|
|
30962
|
-
if (e.composite && (e.declaration ??= !0, e.incremental ??= !0), e.target) {
|
|
30963
|
-
let f = e.target.toLowerCase();
|
|
30964
|
-
f === "es2015" && (f = "es6"), e.target = f, f === "esnext" && (e.module ??= "es6", e.useDefineForClassFields ??= !0), (f === "es6" || f === "es2016" || f === "es2017" || f === "es2018" || f === "es2019" || f === "es2020" || f === "es2021" || f === "es2022" || f === "es2023" || f === "es2024") && (e.module ??= "es6"), (f === "es2022" || f === "es2023" || f === "es2024") && (e.useDefineForClassFields ??= !0);
|
|
30965
|
-
}
|
|
30966
|
-
if (e.module) {
|
|
30967
|
-
let f = e.module.toLowerCase();
|
|
30968
|
-
if (f === "es2015" && (f = "es6"), e.module = f, (f === "es6" || f === "es2020" || f === "es2022" || f === "esnext" || f === "none" || f === "system" || f === "umd" || f === "amd") && (e.moduleResolution ??= "classic"), f === "system" && (e.allowSyntheticDefaultImports ??= !0), (f === "node16" || f === "node18" || f === "node20" || f === "nodenext" || f === "preserve") && (e.esModuleInterop ??= !0, e.allowSyntheticDefaultImports ??= !0), (f === "node16" || f === "node18" || f === "node20" || f === "nodenext") && (e.moduleDetection ??= "force"), f === "node16" && (e.target ??= "es2022", e.moduleResolution ??= "node16"), f === "node18" && (e.target ??= "es2022", e.moduleResolution ??= "node16"), f === "node20" && (e.target ??= "es2023", e.moduleResolution ??= "node16", e.resolveJsonModule ??= !0), f === "nodenext" && (e.target ??= "esnext", e.moduleResolution ??= "nodenext", e.resolveJsonModule ??= !0), f === "node16" || f === "node18" || f === "node20" || f === "nodenext") {
|
|
30969
|
-
const B = e.target;
|
|
30970
|
-
(B === "es3" || B === "es2022" || B === "es2023" || B === "es2024" || B === "esnext") && (e.useDefineForClassFields ??= !0);
|
|
30971
|
-
}
|
|
30972
|
-
f === "preserve" && (e.moduleResolution ??= "bundler");
|
|
30973
|
-
}
|
|
30974
|
-
if (e.moduleResolution) {
|
|
30975
|
-
let f = e.moduleResolution.toLowerCase();
|
|
30976
|
-
f === "node" && (f = "node10"), e.moduleResolution = f, (f === "node16" || f === "nodenext" || f === "bundler") && (e.resolvePackageJsonExports ??= !0, e.resolvePackageJsonImports ??= !0), f === "bundler" && (e.allowSyntheticDefaultImports ??= !0, e.resolveJsonModule ??= !0);
|
|
30977
|
-
}
|
|
30978
|
-
e.jsx && (e.jsx = e.jsx.toLowerCase()), e.moduleDetection && (e.moduleDetection = e.moduleDetection.toLowerCase()), e.importsNotUsedAsValues && (e.importsNotUsedAsValues = e.importsNotUsedAsValues.toLowerCase()), e.newLine && (e.newLine = e.newLine.toLowerCase()), e.esModuleInterop && (e.allowSyntheticDefaultImports ??= !0), e.verbatimModuleSyntax && (e.isolatedModules ??= !0, e.preserveConstEnums ??= !0), e.isolatedModules && (e.preserveConstEnums ??= !0), e.rewriteRelativeImportExtensions && (e.allowImportingTsExtensions ??= !0), e.lib && (e.lib = e.lib.map((f) => f.toLowerCase())), e.checkJs && (e.allowJs ??= !0);
|
|
30979
|
-
}, "normalizeCompilerOptions"), pe = i((e, t = /* @__PURE__ */ new Map()) => {
|
|
30980
|
-
const s = path.resolve(e), n = ve(s, t), o = path.dirname(s), { compilerOptions: l } = n;
|
|
30981
|
-
if (l) {
|
|
30982
|
-
for (const a of Me) {
|
|
30983
|
-
const r = l[a];
|
|
30984
|
-
if (r) {
|
|
30985
|
-
const g = H(r, o);
|
|
30986
|
-
l[a] = g ? se(o, g) : r;
|
|
30987
|
-
}
|
|
30988
|
-
}
|
|
30989
|
-
for (const a of ["rootDirs", "typeRoots"]) {
|
|
30990
|
-
const r = l[a];
|
|
30991
|
-
r && (l[a] = r.map((g) => {
|
|
30992
|
-
const v = H(g, o);
|
|
30993
|
-
return v ? se(o, v) : g;
|
|
30994
|
-
}));
|
|
30995
|
-
}
|
|
30996
|
-
const { paths: u } = l;
|
|
30997
|
-
if (u) for (const a of Object.keys(u)) u[a] = u[a].map((r) => {
|
|
30998
|
-
var g;
|
|
30999
|
-
return (g = H(r, o)) != null ? g : r;
|
|
31000
|
-
});
|
|
31001
|
-
ze(l);
|
|
31002
|
-
}
|
|
31003
|
-
for (const u of we) {
|
|
31004
|
-
const a = n[u];
|
|
31005
|
-
a && (n[u] = a.map((r) => {
|
|
31006
|
-
var g;
|
|
31007
|
-
return (g = H(r, o)) != null ? g : r;
|
|
31008
|
-
}));
|
|
31009
|
-
}
|
|
31010
|
-
return n;
|
|
31011
|
-
}, "parseTsconfig"), Ge = i((e = process.cwd(), t = "tsconfig.json", s = /* @__PURE__ */ new Map()) => {
|
|
31012
|
-
const n = fe(h(e), t, s);
|
|
31013
|
-
if (!n) return null;
|
|
31014
|
-
return {
|
|
31015
|
-
path: n,
|
|
31016
|
-
config: pe(n, s)
|
|
31017
|
-
};
|
|
31018
|
-
}, "getTsconfig"), Qe = /\*/g, Te = i((e, t) => {
|
|
31019
|
-
const s = e.match(Qe);
|
|
31020
|
-
if (s && s.length > 1) throw new Error(t);
|
|
31021
|
-
}, "assertStarCount"), He = i((e) => {
|
|
31022
|
-
if (e.includes("*")) {
|
|
31023
|
-
const [t, s] = e.split("*");
|
|
31024
|
-
return {
|
|
31025
|
-
prefix: t,
|
|
31026
|
-
suffix: s
|
|
31027
|
-
};
|
|
31028
|
-
}
|
|
31029
|
-
return e;
|
|
31030
|
-
}, "parsePattern"), Xe = i(({ prefix: e, suffix: t }, s) => s.startsWith(e) && s.endsWith(t), "isPatternMatch"), Ye = i((e, t, s) => Object.entries(e).map(([n, o]) => (Te(n, `Pattern '${n}' can have at most one '*' character.`), {
|
|
31031
|
-
pattern: He(n),
|
|
31032
|
-
substitutions: o.map((l) => {
|
|
31033
|
-
if (Te(l, `Substitution '${l}' in pattern '${n}' can have at most one '*' character.`), !t && !q.test(l) && !path.isAbsolute(l)) throw new Error("Non-relative paths are not allowed when 'baseUrl' is not set. Did you forget a leading './'?");
|
|
31034
|
-
return path.resolve(s, l);
|
|
31035
|
-
})
|
|
31036
|
-
})), "parsePaths");
|
|
31037
|
-
i((e) => {
|
|
31038
|
-
const { compilerOptions: t } = e.config;
|
|
31039
|
-
if (!t) return null;
|
|
31040
|
-
const { baseUrl: s, paths: n } = t;
|
|
31041
|
-
if (!s && !n) return null;
|
|
31042
|
-
const o = C in t && t[C], l = path.resolve(path.dirname(e.path), s || o || "."), u = n ? Ye(n, s, l) : [];
|
|
31043
|
-
return (a) => {
|
|
31044
|
-
if (q.test(a)) return [];
|
|
31045
|
-
const r = [];
|
|
31046
|
-
for (const _ of u) {
|
|
31047
|
-
if (_.pattern === a) return _.substitutions.map(h);
|
|
31048
|
-
typeof _.pattern != "string" && r.push(_);
|
|
31049
|
-
}
|
|
31050
|
-
let g, v = -1;
|
|
31051
|
-
for (const _ of r) Xe(_.pattern, a) && _.pattern.prefix.length > v && (v = _.pattern.prefix.length, g = _);
|
|
31052
|
-
if (!g) return s ? [h(path.join(l, a))] : [];
|
|
31053
|
-
const d = a.slice(g.pattern.prefix.length, a.length - g.pattern.suffix.length);
|
|
31054
|
-
return g.substitutions.map((_) => h(_.replace("*", d)));
|
|
31055
|
-
};
|
|
31056
|
-
}, "createPathsMatcher");
|
|
31057
|
-
var qe = Object.defineProperty, X = i((e, t) => qe(e, "name", {
|
|
31058
|
-
value: t,
|
|
31059
|
-
configurable: !0
|
|
31060
|
-
}), "s");
|
|
31061
|
-
const Ae = X((e) => {
|
|
31062
|
-
let t = "";
|
|
31063
|
-
for (let s = 0; s < e.length; s += 1) {
|
|
31064
|
-
const n = e[s], o = n.toUpperCase();
|
|
31065
|
-
t += n === o ? n.toLowerCase() : o;
|
|
31066
|
-
}
|
|
31067
|
-
return t;
|
|
31068
|
-
}, "invertCase"), le = /* @__PURE__ */ new Map(), _e = X((e, t) => {
|
|
31069
|
-
const s = path$1.join(e, `.is-fs-case-sensitive-test-${process.pid}`);
|
|
31070
|
-
try {
|
|
31071
|
-
return t.writeFileSync(s, ""), !t.existsSync(Ae(s));
|
|
31072
|
-
} finally {
|
|
31073
|
-
try {
|
|
31074
|
-
t.unlinkSync(s);
|
|
31075
|
-
} catch {}
|
|
31076
|
-
}
|
|
31077
|
-
}, "checkDirectoryCaseWithWrite"), Ke = X((e, t, s) => {
|
|
31078
|
-
try {
|
|
31079
|
-
return _e(e, s);
|
|
31080
|
-
} catch (n) {
|
|
31081
|
-
if (t === void 0) return _e(Be.tmpdir(), s);
|
|
31082
|
-
throw n;
|
|
31083
|
-
}
|
|
31084
|
-
}, "checkDirectoryCaseWithFallback"), Oe = X((e, t = nativeFs, s = !0) => {
|
|
31085
|
-
const n = e != null ? e : process.cwd();
|
|
31086
|
-
if (s && le.has(n)) return le.get(n);
|
|
31087
|
-
let o;
|
|
31088
|
-
const l = Ae(n);
|
|
31089
|
-
return l !== n && t.existsSync(n) ? o = !t.existsSync(l) : o = Ke(n, e, t), s && le.set(n, o), o;
|
|
31090
|
-
}, "isFsCaseSensitive"), { join: ye } = path.posix, oe = {
|
|
31091
|
-
ts: [
|
|
31092
|
-
".ts",
|
|
31093
|
-
".tsx",
|
|
31094
|
-
".d.ts"
|
|
31095
|
-
],
|
|
31096
|
-
cts: [".cts", ".d.cts"],
|
|
31097
|
-
mts: [".mts", ".d.mts"]
|
|
31098
|
-
}, Ce = i((e) => {
|
|
31099
|
-
const t = [...oe.ts], s = [...oe.cts], n = [...oe.mts];
|
|
31100
|
-
return e != null && e.allowJs && (t.push(".js", ".jsx"), s.push(".cjs"), n.push(".mjs")), [
|
|
31101
|
-
...t,
|
|
31102
|
-
...s,
|
|
31103
|
-
...n
|
|
31104
|
-
];
|
|
31105
|
-
}, "getSupportedExtensions"), en = i((e) => {
|
|
31106
|
-
const t = [];
|
|
31107
|
-
if (!e) return t;
|
|
31108
|
-
const { outDir: s, declarationDir: n } = e;
|
|
31109
|
-
return s && t.push(s), n && t.push(n), t;
|
|
31110
|
-
}, "getDefaultExcludeSpec"), je = i((e) => e.replaceAll(/[.*+?^${}()|[\]\\]/g, String.raw`\$&`), "escapeForRegexp"), ie = `(?!(${[
|
|
31111
|
-
"node_modules",
|
|
31112
|
-
"bower_components",
|
|
31113
|
-
"jspm_packages"
|
|
31114
|
-
].join("|")})(/|$))`, tn = /(?:^|\/)[^.*?]+$/, Fe = "**/*", Y = "[^/]", ue = "[^./]", De = process.platform === "win32";
|
|
31115
|
-
i(({ config: e, path: t }, s = Oe()) => {
|
|
31116
|
-
if ("extends" in e) throw new Error("tsconfig#extends must be resolved. Use getTsconfig or parseTsconfig to resolve it.");
|
|
31117
|
-
if (!path.isAbsolute(t)) throw new Error("The tsconfig path must be absolute");
|
|
31118
|
-
De && (t = h(t));
|
|
31119
|
-
const n = path.dirname(t), { files: o, include: l, exclude: u, compilerOptions: a } = e, r = i((T) => path.isAbsolute(T) ? T : ye(n, T), "resolvePattern"), g = o == null ? void 0 : o.map(r), v = Ce(a), d = s ? "" : "i", p = (u || en(a)).map((T) => {
|
|
31120
|
-
const x = je(r(T)).replaceAll(String.raw`\*\*/`, "(.+/)?").replaceAll(String.raw`\*`, `${Y}*`).replaceAll(String.raw`\?`, Y);
|
|
31121
|
-
return new RegExp(`^${x}($|/)`, d);
|
|
31122
|
-
}), D = o || l ? l : [Fe], L = D ? D.map((T) => {
|
|
31123
|
-
let F = r(T);
|
|
31124
|
-
tn.test(F) && (F = ye(F, Fe));
|
|
31125
|
-
const x = je(F).replaceAll(String.raw`/\*\*`, `(/${ie}${ue}${Y}*)*?`).replaceAll(/(\/)?\\\*/g, (c, y) => {
|
|
31126
|
-
const A = `(${ue}|(\\.(?!min\\.js$))?)*`;
|
|
31127
|
-
return y ? `/${ie}${ue}${A}` : A;
|
|
31128
|
-
}).replaceAll(/(\/)?\\\?/g, (c, y) => {
|
|
31129
|
-
const A = Y;
|
|
31130
|
-
return y ? `/${ie}${A}` : A;
|
|
31131
|
-
});
|
|
31132
|
-
return new RegExp(`^${x}$`, d);
|
|
31133
|
-
}) : void 0;
|
|
31134
|
-
return (T) => {
|
|
31135
|
-
if (!path.isAbsolute(T)) throw new Error("filePath must be absolute");
|
|
31136
|
-
if (De && (T = h(T)), g != null && g.includes(T)) return e;
|
|
31137
|
-
if (!(!v.some((F) => T.endsWith(F)) || p.some((F) => F.test(T))) && L && L.some((F) => F.test(T))) return e;
|
|
31138
|
-
};
|
|
31139
|
-
}, "createFilesMatcher");
|
|
30410
|
+
const walkAST = walk;
|
|
31140
30411
|
//#endregion
|
|
31141
30412
|
//#region ../../node_modules/.pnpm/dts-resolver@2.1.3_oxc-resolver@11.14.0/node_modules/dts-resolver/dist/index.mjs
|
|
31142
30413
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
31143
|
-
function createResolver({ tsconfig, cwd = process
|
|
30414
|
+
function createResolver({ tsconfig, cwd = process.cwd(), resolveNodeModules = false, ResolverFactory } = {}) {
|
|
31144
30415
|
ResolverFactory ||= __require("oxc-resolver").ResolverFactory;
|
|
31145
30416
|
const resolver = new ResolverFactory({
|
|
31146
30417
|
mainFields: [
|
|
@@ -31249,8 +30520,7 @@ const ALLOW_EXTENSIONS = new Set([
|
|
|
31249
30520
|
function ensureValue(value) {
|
|
31250
30521
|
return value && ALLOW_EXTENSIONS.has(extname(value)) ? value.replaceAll("\\", "/") : null;
|
|
31251
30522
|
}
|
|
31252
|
-
|
|
31253
|
-
//#region ../../node_modules/.pnpm/rolldown-plugin-dts@0.22.5_@typescript+native-preview@7.0.0-dev.20260122.2_oxc-resolver_ee01c189cef60d67143f173de4d10478/node_modules/rolldown-plugin-dts/dist/index.mjs
|
|
30523
|
+
const picomatch = createRequire(import.meta.url)("./npm_entry_picomatch.cjs");
|
|
31254
30524
|
function createDtsInputPlugin({ sideEffects }) {
|
|
31255
30525
|
return {
|
|
31256
30526
|
name: "rolldown-plugin-dts:dts-input",
|
|
@@ -31326,12 +30596,17 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
31326
30596
|
}
|
|
31327
30597
|
};
|
|
31328
30598
|
function transform(code, id) {
|
|
31329
|
-
|
|
31330
|
-
|
|
31331
|
-
|
|
31332
|
-
|
|
31333
|
-
|
|
31334
|
-
|
|
30599
|
+
let file;
|
|
30600
|
+
try {
|
|
30601
|
+
file = parse$1(code, {
|
|
30602
|
+
plugins: [["typescript", { dts: true }], "decoratorAutoAccessors"],
|
|
30603
|
+
sourceType: "module",
|
|
30604
|
+
errorRecovery: true,
|
|
30605
|
+
createParenthesizedExpressions: true
|
|
30606
|
+
});
|
|
30607
|
+
} catch (error) {
|
|
30608
|
+
throw new Error(`Failed to parse ${id}. This may be caused by a syntax error in the declaration file or a bug in the plugin. Please report this issue to https://github.com/sxzz/rolldown-plugin-dts\n${error}`, { cause: error });
|
|
30609
|
+
}
|
|
31335
30610
|
const { program, comments } = file;
|
|
31336
30611
|
const typeOnlyIds = [];
|
|
31337
30612
|
const identifierMap = Object.create(null);
|
|
@@ -31447,7 +30722,12 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
31447
30722
|
const ids = typeOnlyMap.get(module);
|
|
31448
30723
|
if (ids) typeOnlyIds.push(...ids);
|
|
31449
30724
|
}
|
|
31450
|
-
|
|
30725
|
+
let file;
|
|
30726
|
+
try {
|
|
30727
|
+
file = parse$1(code, { sourceType: "module" });
|
|
30728
|
+
} catch (error) {
|
|
30729
|
+
throw new Error(`Failed to parse generated code for chunk ${chunk.fileName}. This may be caused by a bug in the plugin. Please report this issue to https://github.com/sxzz/rolldown-plugin-dts\n${error}`, { cause: error });
|
|
30730
|
+
}
|
|
31451
30731
|
const { program } = file;
|
|
31452
30732
|
program.body = patchTsNamespace(program.body);
|
|
31453
30733
|
program.body = patchReExport(program.body);
|
|
@@ -31622,7 +30902,7 @@ function createFakeJsPlugin({ sourcemap, cjsDefault, sideEffects }) {
|
|
|
31622
30902
|
}
|
|
31623
30903
|
function importNamespace(node, imported, source, namespaceStmts, identifierMap) {
|
|
31624
30904
|
const sourceText = source.value.replaceAll(/\W/g, "_");
|
|
31625
|
-
let local = identifier(isIdentifierName(source.value) ? source.value : `${sourceText}${getIdentifierIndex(identifierMap, sourceText)}`);
|
|
30905
|
+
let local = identifier(`_$${isIdentifierName(source.value) ? source.value : `${sourceText}${getIdentifierIndex(identifierMap, sourceText)}`}`);
|
|
31626
30906
|
if (namespaceStmts.has(source.value)) local = namespaceStmts.get(source.value).local;
|
|
31627
30907
|
else namespaceStmts.set(source.value, {
|
|
31628
30908
|
stmt: importDeclaration([importNamespaceSpecifier(local)], source),
|
|
@@ -31906,7 +31186,8 @@ async function runTsgo(rootDir, tsconfig, sourcemap, tsgoPath) {
|
|
|
31906
31186
|
}
|
|
31907
31187
|
const debug$2 = createDebug("rolldown-plugin-dts:generate");
|
|
31908
31188
|
const WORKER_URL = "./tsc-worker.mjs";
|
|
31909
|
-
function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd, oxc, emitDtsOnly, vue, tsMacro, parallel, eager, tsgo, newContext, emitJs, sourcemap }) {
|
|
31189
|
+
function createGeneratePlugin({ entry, tsconfig, tsconfigRaw, build, incremental, cwd, oxc, emitDtsOnly, vue, tsMacro, parallel, eager, tsgo, newContext, emitJs, sourcemap }) {
|
|
31190
|
+
const entryMatcher = entry ? picomatch(entry, { ignore: entry.filter((p) => p.startsWith("!")).map((p) => p.slice(1)) }) : void 0;
|
|
31910
31191
|
const dtsMap = /* @__PURE__ */ new Map();
|
|
31911
31192
|
/**
|
|
31912
31193
|
* A map of input id to output file name
|
|
@@ -31930,12 +31211,12 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
|
|
|
31930
31211
|
if (tsgo) tsgoDist = await runTsgo(rootDir, tsconfig, sourcemap, tsgo.path);
|
|
31931
31212
|
else if (!oxc) if (parallel) {
|
|
31932
31213
|
childProcess = fork(new URL(WORKER_URL, import.meta.url), { stdio: "inherit" });
|
|
31933
|
-
rpc = (await import("./dist-
|
|
31214
|
+
rpc = (await import("./dist-D8aGMhnG.js")).createBirpc({}, {
|
|
31934
31215
|
post: (data) => childProcess.send(data),
|
|
31935
31216
|
on: (fn) => childProcess.on("message", fn)
|
|
31936
31217
|
});
|
|
31937
31218
|
} else {
|
|
31938
|
-
tscModule = await import("./tsc-
|
|
31219
|
+
tscModule = await import("./tsc-Cabpo8gE.js");
|
|
31939
31220
|
if (newContext) tscContext = createContext();
|
|
31940
31221
|
}
|
|
31941
31222
|
if (!Array.isArray(options.input)) for (const [name, id] of Object.entries(options.input)) {
|
|
@@ -31984,7 +31265,8 @@ function createGeneratePlugin({ tsconfig, tsconfigRaw, build, incremental, cwd,
|
|
|
31984
31265
|
} },
|
|
31985
31266
|
handler(code, id) {
|
|
31986
31267
|
if (!RE_JS.test(id) || emitJs) {
|
|
31987
|
-
const
|
|
31268
|
+
const mod = this.getModuleInfo(id);
|
|
31269
|
+
const isEntry = entryMatcher ? entryMatcher(path.relative(cwd, id)) : !!mod?.isEntry;
|
|
31988
31270
|
const dtsId = filename_to_dts(id);
|
|
31989
31271
|
dtsMap.set(dtsId, {
|
|
31990
31272
|
code,
|
|
@@ -32141,7 +31423,7 @@ function collectJsonExports(code) {
|
|
|
32141
31423
|
return exports;
|
|
32142
31424
|
}
|
|
32143
31425
|
let warnedTsgo = false;
|
|
32144
|
-
function resolveOptions({ cwd = process
|
|
31426
|
+
function resolveOptions({ entry, cwd = process.cwd(), dtsInput = false, emitDtsOnly = false, tsconfig, tsconfigRaw: overriddenTsconfigRaw = {}, compilerOptions = {}, sourcemap, resolver = "oxc", cjsDefault = false, sideEffects = false, build = false, incremental = false, vue = false, tsMacro = false, parallel = false, eager = false, newContext = false, emitJs, oxc, tsgo = false }) {
|
|
32145
31427
|
if (tsgo === true) tsgo = {};
|
|
32146
31428
|
else if (typeof tsgo === "object" && tsgo.enabled === false) tsgo = false;
|
|
32147
31429
|
let resolvedTsconfig;
|
|
@@ -32150,7 +31432,7 @@ function resolveOptions({ cwd = process$1.cwd(), dtsInput = false, emitDtsOnly =
|
|
|
32150
31432
|
tsconfig = path;
|
|
32151
31433
|
resolvedTsconfig = config;
|
|
32152
31434
|
} else if (typeof tsconfig === "string") {
|
|
32153
|
-
tsconfig = path.resolve(cwd || process
|
|
31435
|
+
tsconfig = path.resolve(cwd || process.cwd(), tsconfig);
|
|
32154
31436
|
resolvedTsconfig = pe(tsconfig);
|
|
32155
31437
|
} else tsconfig = void 0;
|
|
32156
31438
|
compilerOptions = {
|
|
@@ -32184,6 +31466,7 @@ function resolveOptions({ cwd = process$1.cwd(), dtsInput = false, emitDtsOnly =
|
|
|
32184
31466
|
warnedTsgo = true;
|
|
32185
31467
|
}
|
|
32186
31468
|
return {
|
|
31469
|
+
entry: entry ? Array.isArray(entry) ? entry : [entry] : void 0,
|
|
32187
31470
|
cwd,
|
|
32188
31471
|
dtsInput,
|
|
32189
31472
|
emitDtsOnly,
|
|
@@ -32232,7 +31515,7 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolver, sideEffe
|
|
|
32232
31515
|
debug$1("Rolldown resolution for dts import %O from %O: %O", id, importer, rolldownResolution);
|
|
32233
31516
|
if (rolldownResolution?.external) {
|
|
32234
31517
|
debug$1("Rolldown marked dts import as external:", id);
|
|
32235
|
-
return
|
|
31518
|
+
return rolldownResolution;
|
|
32236
31519
|
}
|
|
32237
31520
|
const dtsResolution = await resolveDtsPath(id, importer, rolldownResolution);
|
|
32238
31521
|
debug$1("Dts resolution for dts import %O from %O: %O", id, importer, dtsResolution);
|
|
@@ -32265,7 +31548,7 @@ function createDtsResolvePlugin({ cwd, tsconfig, tsconfigRaw, resolver, sideEffe
|
|
|
32265
31548
|
async function resolveDtsPath(id, importer, rolldownResolution) {
|
|
32266
31549
|
let dtsPath;
|
|
32267
31550
|
if (resolver === "tsc") {
|
|
32268
|
-
const { tscResolve } = await import("./resolver-
|
|
31551
|
+
const { tscResolve } = await import("./resolver-DkvdaW3s-CCXGyGZ3.js");
|
|
32269
31552
|
dtsPath = tscResolve(id, importer, cwd, tsconfig, tsconfigRaw);
|
|
32270
31553
|
} else dtsPath = baseDtsResolver(id, importer);
|
|
32271
31554
|
debug$1("Using %s for dts import: %O -> %O", resolver, id, dtsPath);
|