@jbpark/live-editor 6.1.0 → 6.1.1
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/README.ko.md +8 -0
- package/README.md +8 -0
- package/dist/{boundary-CySnDUs2.js → boundary-CLMNMZFa.js} +4 -4
- package/dist/boundary-CLMNMZFa.js.map +1 -0
- package/dist/{cn-CAnad2vL.js → compile-BWZ5U59y.js} +135 -2
- package/dist/compile-BWZ5U59y.js.map +1 -0
- package/dist/{context-Bjq0CvBE.js → context-DJxX9epB.js} +2 -3
- package/dist/context-DJxX9epB.js.map +1 -0
- package/dist/{core-BNVuH8-l.js → core-BfJwD8Jx.js} +3 -6
- package/dist/core-BfJwD8Jx.js.map +1 -0
- package/dist/dnd/index.js +2 -2
- package/dist/{dnd-COjjjuD7.js → dnd-DAGjlJ0_.js} +206 -167
- package/dist/dnd-DAGjlJ0_.js.map +1 -0
- package/dist/{document-BkGWDZGc.js → document-MkQGxfry.js} +710 -318
- package/dist/document-MkQGxfry.js.map +1 -0
- package/dist/editor/index.js +2 -2
- package/dist/{editor-CvnzrM9J.js → editor-B_VOz3Q0.js} +2 -2
- package/dist/{editor-CvnzrM9J.js.map → editor-B_VOz3Q0.js.map} +1 -1
- package/dist/editor-caches-DXYXgWeD.js +63 -0
- package/dist/editor-caches-DXYXgWeD.js.map +1 -0
- package/dist/error/index.d.ts +1 -1
- package/dist/error/index.js +2 -2
- package/dist/{error-CFzvnLCf.js → error-E3T5CS3m.js} +13 -12
- package/dist/error-E3T5CS3m.js.map +1 -0
- package/dist/{index-DfIvkht8.d.ts → index-BC9hY7dI.d.ts} +5 -5
- package/dist/{index-CqsS207F.d.ts → index-D-Dfv65w.d.ts} +3 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +5 -5
- package/dist/preview/index.d.ts +1 -1
- package/dist/preview/index.js +1 -1
- package/dist/{preview-8ejC5VP2.js → preview-DFb1pOqJ.js} +30 -11
- package/dist/preview-DFb1pOqJ.js.map +1 -0
- package/dist/provider/index.js +1 -1
- package/dist/{sections-rD8NuRI8.js → sections-CnG7OLr8.js} +3 -3
- package/dist/{sections-rD8NuRI8.js.map → sections-CnG7OLr8.js.map} +1 -1
- package/dist/states-Ci1AvoQ9.js.map +1 -1
- package/dist/style.css +74 -74
- package/dist/ui-kit/index.js +2 -2
- package/dist/ui-kit/style.css +22 -6
- package/dist/{update-DyFnX8yE.js → update-DnX2ibYn.js} +162 -43
- package/dist/update-DnX2ibYn.js.map +1 -0
- package/dist/{use-dynamic-tailwind-0nuRN57N.js → use-dynamic-tailwind-CjXeHjsr.js} +107 -25
- package/dist/use-dynamic-tailwind-CjXeHjsr.js.map +1 -0
- package/dist/{use-field-state-iQGW0vc6.js → use-field-state-B1VLhWfr.js} +2 -2
- package/dist/{use-field-state-iQGW0vc6.js.map → use-field-state-B1VLhWfr.js.map} +1 -1
- package/dist/utils/ast/index.js +1 -86
- package/dist/utils/index.js +3 -4
- package/package.json +2 -3
- package/dist/boundary-CySnDUs2.js.map +0 -1
- package/dist/cn-CAnad2vL.js.map +0 -1
- package/dist/compile-my0AjsCw.js +0 -136
- package/dist/compile-my0AjsCw.js.map +0 -1
- package/dist/constants-st9gnJ5g.js +0 -55
- package/dist/constants-st9gnJ5g.js.map +0 -1
- package/dist/context-Bjq0CvBE.js.map +0 -1
- package/dist/core-BNVuH8-l.js.map +0 -1
- package/dist/detect-typescript-CMF0FVKD.js +0 -10
- package/dist/detect-typescript-CMF0FVKD.js.map +0 -1
- package/dist/dnd-COjjjuD7.js.map +0 -1
- package/dist/document-BkGWDZGc.js.map +0 -1
- package/dist/editor-caches-ClMvdcQF.js +0 -23
- package/dist/editor-caches-ClMvdcQF.js.map +0 -1
- package/dist/error-CFzvnLCf.js.map +0 -1
- package/dist/preview-8ejC5VP2.js.map +0 -1
- package/dist/update-DyFnX8yE.js.map +0 -1
- package/dist/use-dynamic-tailwind-0nuRN57N.js.map +0 -1
- package/dist/utils/ast/index.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as registerEditorCache } from "./editor-caches-ClMvdcQF.js";
|
|
1
|
+
import { a as CONFIG, n as registerEditorCache, o as DATA_ATTR, s as DEFAULT_CONTAINER_ID } from "./editor-caches-DXYXgWeD.js";
|
|
3
2
|
import { t as createBoundedCache } from "./cache-B0-XcIxJ.js";
|
|
4
3
|
//#region \0rolldown/runtime.js
|
|
5
4
|
var __create = Object.create;
|
|
@@ -33,7 +32,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
33
32
|
enumerable: true
|
|
34
33
|
}) : target, mod));
|
|
35
34
|
//#endregion
|
|
36
|
-
//#region node_modules/.pnpm/@babel+parser@8.0
|
|
35
|
+
//#region node_modules/.pnpm/@babel+parser@8.1.0/node_modules/@babel/parser/lib/index.js
|
|
37
36
|
var Position = class {
|
|
38
37
|
constructor(line, col, index) {
|
|
39
38
|
this.line = void 0;
|
|
@@ -119,6 +118,7 @@ const StandardErrors = {
|
|
|
119
118
|
DecoratorSemicolon: "Decorators must not be followed by a semicolon.",
|
|
120
119
|
DecoratorStaticBlock: "Decorators can't be used with a static block.",
|
|
121
120
|
DeferImportRequiresNamespace: "Only `import defer * as x from \"./module\"` is valid.",
|
|
121
|
+
DeferExportInvalidAll: "`export defer * from \"./module\"` is invalid. Explicitly list the re-exported names.",
|
|
122
122
|
DeletePrivateField: "Deleting a private field is not allowed.",
|
|
123
123
|
DestructureNamedImport: "ES2015 named imports do not destructure. Use another statement for destructuring after the import.",
|
|
124
124
|
DuplicateConstructor: "Duplicate constructor in the same class.",
|
|
@@ -130,6 +130,9 @@ const StandardErrors = {
|
|
|
130
130
|
EscapedCharNotAnIdentifier: "Invalid Unicode escape.",
|
|
131
131
|
ExportBindingIsString: ({ localName, exportName }) => `A string literal cannot be used as an exported binding without \`from\`.\n- Did you mean \`export { '${localName}' as '${exportName}' } from 'some-module'\`?`,
|
|
132
132
|
ExportDefaultFromAsIdentifier: "'from' is not allowed as an identifier after 'export default'.",
|
|
133
|
+
FilteredNamespaceDuplicateName: ({ name }) => `Duplicate name '${name}' in filtered namespace.`,
|
|
134
|
+
FilteredNamespaceRename: "Names in a filtered namespace cannot be renamed using `as`.",
|
|
135
|
+
FilteredNamespaceTypeModifier: "Names in a filtered namespace cannot have a type modifier.",
|
|
133
136
|
ForInOfLoopInitializer: ({ type }) => `'${type === "ForInStatement" ? "for-in" : "for-of"}' loop variable declaration may not have an initializer.`,
|
|
134
137
|
ForInUsing: "For-in loop may not start with 'using' declaration.",
|
|
135
138
|
ForOfAsync: "The left-hand side of a for-of loop may not be 'async'.",
|
|
@@ -139,9 +142,9 @@ const StandardErrors = {
|
|
|
139
142
|
IllegalLanguageModeDirective: "Illegal 'use strict' directive in function with non-simple parameter list.",
|
|
140
143
|
IllegalReturn: "'return' outside of function.",
|
|
141
144
|
ImportBindingIsString: ({ importName }) => `A string literal cannot be used as an imported binding.\n- Did you mean \`import { "${importName}" as foo }\`?`,
|
|
142
|
-
ImportCallArity: ({ phase }) => `\`import${phase ? `.${phase}` : ""}()\` requires exactly one or two arguments.`,
|
|
143
|
-
ImportCallNotNewExpression: ({ phase }) => `Cannot use new with import${phase ? `.${phase}` : ""}().`,
|
|
144
|
-
ImportCallSpreadArgument: ({ phase }) => `\`...\` is not allowed in \`import${phase ? `.${phase}` : ""}()\`.`,
|
|
145
|
+
ImportCallArity: ({ phase, sync }) => `\`import${phase ? `.${phase}` : sync ? ".sync" : ""}()\` requires exactly one or two arguments.`,
|
|
146
|
+
ImportCallNotNewExpression: ({ phase, sync }) => `Cannot use new with import${phase ? `.${phase}` : sync ? ".sync" : ""}().`,
|
|
147
|
+
ImportCallSpreadArgument: ({ phase, sync }) => `\`...\` is not allowed in \`import${phase ? `.${phase}` : sync ? ".sync" : ""}()\`.`,
|
|
145
148
|
IncompatibleRegExpUVFlags: "The 'u' and 'v' regular expression flags cannot be enabled at the same time.",
|
|
146
149
|
InvalidBigIntLiteral: "Invalid BigIntLiteral.",
|
|
147
150
|
InvalidCodePoint: "Code point out of bounds.",
|
|
@@ -606,7 +609,7 @@ const estree = (superClass) => class ESTreeParserMixin extends superClass {
|
|
|
606
609
|
case "ExportAllDeclaration":
|
|
607
610
|
node.exported = null;
|
|
608
611
|
break;
|
|
609
|
-
case "ExportNamedDeclaration": if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier") {
|
|
612
|
+
case "ExportNamedDeclaration": if (node.specifiers.length === 1 && node.specifiers[0].type === "ExportNamespaceSpecifier" && !node.specifiers[0].exportsFilter) {
|
|
610
613
|
this.castNodeTo(node, "ExportAllDeclaration");
|
|
611
614
|
node.exported = node.specifiers[0].exported;
|
|
612
615
|
delete node.specifiers;
|
|
@@ -938,6 +941,8 @@ const tt = {
|
|
|
938
941
|
_set: createKeywordLike("set", { startsExpr }),
|
|
939
942
|
_source: createKeywordLike("source", { startsExpr }),
|
|
940
943
|
_static: createKeywordLike("static", { startsExpr }),
|
|
944
|
+
_struct: createKeywordLike("struct", { startsExpr }),
|
|
945
|
+
_sync: createKeywordLike("sync", { startsExpr }),
|
|
941
946
|
_using: createKeywordLike("using", { startsExpr }),
|
|
942
947
|
_yield: createKeywordLike("yield", { startsExpr }),
|
|
943
948
|
_asserts: createKeywordLike("asserts", { startsExpr }),
|
|
@@ -977,16 +982,16 @@ const tt = {
|
|
|
977
982
|
jsxTagEnd: createToken("jsxTagEnd")
|
|
978
983
|
};
|
|
979
984
|
function tokenIsIdentifier(token) {
|
|
980
|
-
return token >= 89 && token <=
|
|
985
|
+
return token >= 89 && token <= 132;
|
|
981
986
|
}
|
|
982
987
|
function tokenKeywordOrIdentifierIsKeyword(token) {
|
|
983
988
|
return token <= 88;
|
|
984
989
|
}
|
|
985
990
|
function tokenIsKeywordOrIdentifier(token) {
|
|
986
|
-
return token >= 54 && token <=
|
|
991
|
+
return token >= 54 && token <= 132;
|
|
987
992
|
}
|
|
988
993
|
function tokenIsLiteralPropertyName(token) {
|
|
989
|
-
return token >= 54 && token <=
|
|
994
|
+
return token >= 54 && token <= 135;
|
|
990
995
|
}
|
|
991
996
|
function tokenComesBeforeExpression(token) {
|
|
992
997
|
return tokenBeforeExprs[token];
|
|
@@ -998,7 +1003,7 @@ function tokenIsAssignment(token) {
|
|
|
998
1003
|
return token >= 25 && token <= 29;
|
|
999
1004
|
}
|
|
1000
1005
|
function tokenIsFlowInterfaceOrTypeOrOpaque(token) {
|
|
1001
|
-
return token >=
|
|
1006
|
+
return token >= 128 && token <= 130;
|
|
1002
1007
|
}
|
|
1003
1008
|
function tokenIsLoop(token) {
|
|
1004
1009
|
return token >= 86 && token <= 88;
|
|
@@ -1016,10 +1021,10 @@ function tokenIsPrefix(token) {
|
|
|
1016
1021
|
return tokenPrefixes[token];
|
|
1017
1022
|
}
|
|
1018
1023
|
function tokenIsTSTypeOperator(token) {
|
|
1019
|
-
return token >=
|
|
1024
|
+
return token >= 120 && token <= 122;
|
|
1020
1025
|
}
|
|
1021
1026
|
function tokenIsTSDeclarationStart(token) {
|
|
1022
|
-
return token >=
|
|
1027
|
+
return token >= 123 && token <= 129;
|
|
1023
1028
|
}
|
|
1024
1029
|
function tokenLabelName(token) {
|
|
1025
1030
|
return tokenLabels[token];
|
|
@@ -1556,7 +1561,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1556
1561
|
return this.getPluginOption("flow", "all") || this.flowPragma === "flow";
|
|
1557
1562
|
}
|
|
1558
1563
|
finishToken(type, val) {
|
|
1559
|
-
if (type !==
|
|
1564
|
+
if (type !== 133 && type !== 9 && type !== 24) {
|
|
1560
1565
|
if (this.flowPragma === void 0) this.flowPragma = null;
|
|
1561
1566
|
}
|
|
1562
1567
|
super.finishToken(type, val);
|
|
@@ -1583,7 +1588,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1583
1588
|
const node = this.startNode();
|
|
1584
1589
|
const moduloLoc = this.state.startLoc;
|
|
1585
1590
|
this.next();
|
|
1586
|
-
this.expectContextual(
|
|
1591
|
+
this.expectContextual(109);
|
|
1587
1592
|
if (this.state.lastTokStartLoc.index > moduloLoc.index + 1) this.raise(FlowErrors.UnexpectedSpaceBetweenModuloChecks, moduloLoc);
|
|
1588
1593
|
if (this.eat(6)) {
|
|
1589
1594
|
node.value = super.parseExpression();
|
|
@@ -1637,15 +1642,15 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1637
1642
|
if (this.match(76)) return this.flowParseDeclareClass(node);
|
|
1638
1643
|
else if (this.match(64)) return this.flowParseDeclareFunction(node);
|
|
1639
1644
|
else if (this.match(70)) return this.flowParseDeclareVariable(node);
|
|
1640
|
-
else if (this.eatContextual(
|
|
1645
|
+
else if (this.eatContextual(126)) {
|
|
1641
1646
|
if (this.match(12)) return this.flowParseDeclareModuleExports(node);
|
|
1642
1647
|
else {
|
|
1643
1648
|
if (insideModule) this.raise(FlowErrors.NestedDeclareModule, this.state.lastTokStartLoc);
|
|
1644
1649
|
return this.flowParseDeclareModule(node);
|
|
1645
1650
|
}
|
|
1646
|
-
} else if (this.isContextual(
|
|
1647
|
-
else if (this.isContextual(
|
|
1648
|
-
else if (this.isContextual(
|
|
1651
|
+
} else if (this.isContextual(129)) return this.flowParseDeclareTypeAlias(node);
|
|
1652
|
+
else if (this.isContextual(130)) return this.flowParseDeclareOpaqueType(node);
|
|
1653
|
+
else if (this.isContextual(128)) return this.flowParseDeclareInterface(node);
|
|
1649
1654
|
else if (this.match(78)) return this.flowParseDeclareExportDeclaration(node, insideModule);
|
|
1650
1655
|
throw this.unexpected();
|
|
1651
1656
|
}
|
|
@@ -1658,7 +1663,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1658
1663
|
}
|
|
1659
1664
|
flowParseDeclareModule(node) {
|
|
1660
1665
|
this.scope.enter(0);
|
|
1661
|
-
if (this.match(
|
|
1666
|
+
if (this.match(133)) node.id = super.parseExprAtom();
|
|
1662
1667
|
else node.id = this.parseIdentifier();
|
|
1663
1668
|
const bodyNode = this.startNode();
|
|
1664
1669
|
const body = bodyNode.body = [];
|
|
@@ -1667,10 +1672,10 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1667
1672
|
const bodyNode = this.startNode();
|
|
1668
1673
|
if (this.match(79)) {
|
|
1669
1674
|
this.next();
|
|
1670
|
-
if (!this.isContextual(
|
|
1675
|
+
if (!this.isContextual(129) && !this.match(83)) this.raise(FlowErrors.InvalidNonTypeImportInDeclareModule, this.state.lastTokStartLoc);
|
|
1671
1676
|
body.push(super.parseImport(bodyNode));
|
|
1672
1677
|
} else {
|
|
1673
|
-
this.expectContextual(
|
|
1678
|
+
this.expectContextual(124, FlowErrors.UnsupportedStatementInDeclareModule);
|
|
1674
1679
|
body.push(this.flowParseDeclare(bodyNode, true));
|
|
1675
1680
|
}
|
|
1676
1681
|
}
|
|
@@ -1704,18 +1709,18 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1704
1709
|
node.default = true;
|
|
1705
1710
|
return this.finishNode(node, "DeclareExportDeclaration");
|
|
1706
1711
|
} else {
|
|
1707
|
-
if (this.match(71) || this.isLet() || (this.isContextual(
|
|
1712
|
+
if (this.match(71) || this.isLet() || (this.isContextual(129) || this.isContextual(128)) && !insideModule) {
|
|
1708
1713
|
const label = this.state.value;
|
|
1709
1714
|
throw this.raise(FlowErrors.UnsupportedDeclareExportKind, this.state.startLoc, {
|
|
1710
1715
|
unsupportedExportKind: label,
|
|
1711
1716
|
suggestion: exportSuggestions[label]
|
|
1712
1717
|
});
|
|
1713
1718
|
}
|
|
1714
|
-
if (this.match(70) || this.match(64) || this.match(76) || this.isContextual(
|
|
1719
|
+
if (this.match(70) || this.match(64) || this.match(76) || this.isContextual(130)) {
|
|
1715
1720
|
node.declaration = this.flowParseDeclare(this.startNode());
|
|
1716
1721
|
node.default = false;
|
|
1717
1722
|
return this.finishNode(node, "DeclareExportDeclaration");
|
|
1718
|
-
} else if (this.match(51) || this.match(2) || this.isContextual(
|
|
1723
|
+
} else if (this.match(51) || this.match(2) || this.isContextual(128) || this.isContextual(129) || this.isContextual(130)) {
|
|
1719
1724
|
const result = this.parseExport(node, null);
|
|
1720
1725
|
if (result.type === "ExportNamedDeclaration") {
|
|
1721
1726
|
result.default = false;
|
|
@@ -1728,7 +1733,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1728
1733
|
}
|
|
1729
1734
|
flowParseDeclareModuleExports(node) {
|
|
1730
1735
|
this.next();
|
|
1731
|
-
this.expectContextual(
|
|
1736
|
+
this.expectContextual(110);
|
|
1732
1737
|
node.typeAnnotation = this.flowParseTypeAnnotation();
|
|
1733
1738
|
this.semicolon();
|
|
1734
1739
|
return this.finishNode(node, "DeclareModuleExports");
|
|
@@ -1760,10 +1765,10 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1760
1765
|
if (isClass) {
|
|
1761
1766
|
const implemented = [];
|
|
1762
1767
|
const mixins = [];
|
|
1763
|
-
if (this.eatContextual(
|
|
1768
|
+
if (this.eatContextual(116)) do
|
|
1764
1769
|
mixins.push(this.flowParseInterfaceExtends());
|
|
1765
1770
|
while (this.eat(8));
|
|
1766
|
-
if (this.eatContextual(
|
|
1771
|
+
if (this.eatContextual(112)) do
|
|
1767
1772
|
implemented.push(this.flowParseClassImplements());
|
|
1768
1773
|
while (this.eat(8));
|
|
1769
1774
|
node.implements = implemented;
|
|
@@ -1814,7 +1819,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1814
1819
|
return this.finishNode(node, "TypeAlias");
|
|
1815
1820
|
}
|
|
1816
1821
|
flowParseOpaqueType(node, declare) {
|
|
1817
|
-
this.expectContextual(
|
|
1822
|
+
this.expectContextual(129);
|
|
1818
1823
|
node.id = this.flowParseRestrictedIdentifier(true, true);
|
|
1819
1824
|
this.scope.declareName(node.id.name, 8201, node.id.start);
|
|
1820
1825
|
if (this.match(43)) node.typeParameters = this.flowParseTypeParameterDeclaration();
|
|
@@ -1852,7 +1857,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1852
1857
|
const node = this.startNode();
|
|
1853
1858
|
node.params = [];
|
|
1854
1859
|
this.state.inType = true;
|
|
1855
|
-
if (this.match(43) || this.match(
|
|
1860
|
+
if (this.match(43) || this.match(141)) this.next();
|
|
1856
1861
|
else this.unexpected();
|
|
1857
1862
|
let defaultRequired = false;
|
|
1858
1863
|
do {
|
|
@@ -1917,7 +1922,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1917
1922
|
}
|
|
1918
1923
|
flowParseInterfaceType() {
|
|
1919
1924
|
const node = this.startNode();
|
|
1920
|
-
this.expectContextual(
|
|
1925
|
+
this.expectContextual(128);
|
|
1921
1926
|
node.extends = [];
|
|
1922
1927
|
if (this.eat(77)) do
|
|
1923
1928
|
node.extends.push(this.flowParseInterfaceExtends());
|
|
@@ -1932,7 +1937,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
1932
1937
|
return this.finishNode(node, "InterfaceTypeAnnotation");
|
|
1933
1938
|
}
|
|
1934
1939
|
flowParseObjectPropertyKey() {
|
|
1935
|
-
return this.match(
|
|
1940
|
+
return this.match(134) || this.match(133) ? super.parseExprAtom() : this.parseIdentifier(true);
|
|
1936
1941
|
}
|
|
1937
1942
|
flowParseObjectTypeIndexer(node, isStatic, variance) {
|
|
1938
1943
|
node.static = isStatic;
|
|
@@ -2017,7 +2022,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2017
2022
|
let protoStartLoc = null;
|
|
2018
2023
|
let inexactStartLoc = null;
|
|
2019
2024
|
const node = this.startNode();
|
|
2020
|
-
if (allowProto && this.isContextual(
|
|
2025
|
+
if (allowProto && this.isContextual(117)) {
|
|
2021
2026
|
const lookahead = this.lookahead();
|
|
2022
2027
|
if (lookahead.type !== 10 && lookahead.type !== 13) {
|
|
2023
2028
|
this.next();
|
|
@@ -2281,7 +2286,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2281
2286
|
node.typeParameters = null;
|
|
2282
2287
|
return this.finishNode(node, "FunctionTypeAnnotation");
|
|
2283
2288
|
}
|
|
2284
|
-
case
|
|
2289
|
+
case 133: return this.parseLiteral(this.state.value, "StringLiteralTypeAnnotation");
|
|
2285
2290
|
case 81:
|
|
2286
2291
|
case 82:
|
|
2287
2292
|
node.value = this.match(81);
|
|
@@ -2290,13 +2295,13 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2290
2295
|
case 49:
|
|
2291
2296
|
if (this.state.value === "-") {
|
|
2292
2297
|
this.next();
|
|
2293
|
-
if (this.match(
|
|
2294
|
-
if (this.match(
|
|
2298
|
+
if (this.match(134)) return this.parseLiteralAtNode(-this.state.value, "NumberLiteralTypeAnnotation", node);
|
|
2299
|
+
if (this.match(135)) return this.parseLiteralAtNode(-this.state.value, "BigIntLiteralTypeAnnotation", node);
|
|
2295
2300
|
throw this.raise(FlowErrors.UnexpectedSubtractionOperand, this.state.startLoc);
|
|
2296
2301
|
}
|
|
2297
2302
|
throw this.unexpected();
|
|
2298
|
-
case
|
|
2299
|
-
case
|
|
2303
|
+
case 134: return this.parseLiteral(this.state.value, "NumberLiteralTypeAnnotation");
|
|
2304
|
+
case 135: return this.parseLiteral(this.state.value, "BigIntLiteralTypeAnnotation");
|
|
2300
2305
|
case 84:
|
|
2301
2306
|
this.next();
|
|
2302
2307
|
return this.finishNode(node, "VoidTypeAnnotation");
|
|
@@ -2315,7 +2320,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2315
2320
|
this.next();
|
|
2316
2321
|
return super.createIdentifier(node, label);
|
|
2317
2322
|
} else if (tokenIsIdentifier(this.state.type)) {
|
|
2318
|
-
if (this.isContextual(
|
|
2323
|
+
if (this.isContextual(128)) return this.flowParseInterfaceType();
|
|
2319
2324
|
return this.flowIdentToTypeAnnotation(startLoc, node, this.parseIdentifier());
|
|
2320
2325
|
}
|
|
2321
2326
|
}
|
|
@@ -2390,7 +2395,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2390
2395
|
return type;
|
|
2391
2396
|
}
|
|
2392
2397
|
flowParseTypeOrImplicitInstantiation() {
|
|
2393
|
-
if (this.state.type ===
|
|
2398
|
+
if (this.state.type === 131 && this.state.value === "_") {
|
|
2394
2399
|
const startLoc = this.state.startLoc;
|
|
2395
2400
|
const node = this.parseIdentifier();
|
|
2396
2401
|
return this.flowParseGenericType(startLoc, node);
|
|
@@ -2440,13 +2445,13 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2440
2445
|
return super.parseFunctionBodyAndFinish(node, type, isMethod);
|
|
2441
2446
|
}
|
|
2442
2447
|
parseStatementLike(flags) {
|
|
2443
|
-
if (this.state.strict && this.isContextual(
|
|
2448
|
+
if (this.state.strict && this.isContextual(128)) {
|
|
2444
2449
|
if (tokenIsKeywordOrIdentifier(this.lookahead().type)) {
|
|
2445
2450
|
const node = this.startNode();
|
|
2446
2451
|
this.next();
|
|
2447
2452
|
return this.flowParseInterface(node);
|
|
2448
2453
|
}
|
|
2449
|
-
} else if (this.isContextual(
|
|
2454
|
+
} else if (this.isContextual(125)) {
|
|
2450
2455
|
const node = this.startNode();
|
|
2451
2456
|
this.next();
|
|
2452
2457
|
return this.flowParseEnumDeclaration(node);
|
|
@@ -2469,16 +2474,16 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2469
2474
|
}
|
|
2470
2475
|
shouldParseExportDeclaration() {
|
|
2471
2476
|
const { type } = this.state;
|
|
2472
|
-
if (type ===
|
|
2477
|
+
if (type === 125 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) return !this.state.containsEsc;
|
|
2473
2478
|
return super.shouldParseExportDeclaration();
|
|
2474
2479
|
}
|
|
2475
2480
|
isExportDefaultSpecifier() {
|
|
2476
2481
|
const { type } = this.state;
|
|
2477
|
-
if (type ===
|
|
2482
|
+
if (type === 125 || tokenIsFlowInterfaceOrTypeOrOpaque(type)) return this.state.containsEsc;
|
|
2478
2483
|
return super.isExportDefaultSpecifier();
|
|
2479
2484
|
}
|
|
2480
2485
|
parseExportDefaultExpression() {
|
|
2481
|
-
if (this.isContextual(
|
|
2486
|
+
if (this.isContextual(125)) {
|
|
2482
2487
|
const node = this.startNode();
|
|
2483
2488
|
this.next();
|
|
2484
2489
|
return this.flowParseEnumDeclaration(node);
|
|
@@ -2591,7 +2596,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2591
2596
|
super.assertModuleNodeAllowed(node);
|
|
2592
2597
|
}
|
|
2593
2598
|
parseExportDeclaration(node) {
|
|
2594
|
-
if (this.isContextual(
|
|
2599
|
+
if (this.isContextual(129)) {
|
|
2595
2600
|
node.exportKind = "type";
|
|
2596
2601
|
const declarationNode = this.startNode();
|
|
2597
2602
|
this.next();
|
|
@@ -2600,17 +2605,17 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2600
2605
|
super.parseExportFrom(node);
|
|
2601
2606
|
return null;
|
|
2602
2607
|
} else return this.flowParseTypeAlias(declarationNode);
|
|
2603
|
-
} else if (this.isContextual(
|
|
2608
|
+
} else if (this.isContextual(130)) {
|
|
2604
2609
|
node.exportKind = "type";
|
|
2605
2610
|
const declarationNode = this.startNode();
|
|
2606
2611
|
this.next();
|
|
2607
2612
|
return this.flowParseOpaqueType(declarationNode, false);
|
|
2608
|
-
} else if (this.isContextual(
|
|
2613
|
+
} else if (this.isContextual(128)) {
|
|
2609
2614
|
node.exportKind = "type";
|
|
2610
2615
|
const declarationNode = this.startNode();
|
|
2611
2616
|
this.next();
|
|
2612
2617
|
return this.flowParseInterface(declarationNode);
|
|
2613
|
-
} else if (this.isContextual(
|
|
2618
|
+
} else if (this.isContextual(125)) {
|
|
2614
2619
|
node.exportKind = "value";
|
|
2615
2620
|
const declarationNode = this.startNode();
|
|
2616
2621
|
this.next();
|
|
@@ -2619,7 +2624,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2619
2624
|
}
|
|
2620
2625
|
eatExportStar(node) {
|
|
2621
2626
|
if (super.eatExportStar(node)) return true;
|
|
2622
|
-
if (this.isContextual(
|
|
2627
|
+
if (this.isContextual(129) && this.lookahead().type === 51) {
|
|
2623
2628
|
node.exportKind = "type";
|
|
2624
2629
|
this.next();
|
|
2625
2630
|
this.next();
|
|
@@ -2633,8 +2638,14 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2633
2638
|
if (hasNamespace && node.exportKind === "type") this.unexpected(startLoc);
|
|
2634
2639
|
return hasNamespace;
|
|
2635
2640
|
}
|
|
2641
|
+
maybeParseExportNamedSpecifiers(node) {
|
|
2642
|
+
if (!super.maybeParseExportNamedSpecifiers(node)) return false;
|
|
2643
|
+
const specifier = node.specifiers[node.specifiers.length - 1];
|
|
2644
|
+
if (node.exportKind === "type" && specifier?.type === "ExportNamespaceSpecifier") this.unexpected(specifier.start);
|
|
2645
|
+
return true;
|
|
2646
|
+
}
|
|
2636
2647
|
parseClassId(node, isStatement, optionalId) {
|
|
2637
|
-
if ((!isStatement || optionalId) && this.isContextual(
|
|
2648
|
+
if ((!isStatement || optionalId) && this.isContextual(112)) {
|
|
2638
2649
|
node.id = null;
|
|
2639
2650
|
return;
|
|
2640
2651
|
}
|
|
@@ -2643,7 +2654,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2643
2654
|
}
|
|
2644
2655
|
parseClassMember(classBody, member, state) {
|
|
2645
2656
|
const { startLoc } = this.state;
|
|
2646
|
-
if (this.isContextual(
|
|
2657
|
+
if (this.isContextual(124)) {
|
|
2647
2658
|
if (super.parseClassMemberFromModifier(classBody, member)) return;
|
|
2648
2659
|
member.declare = true;
|
|
2649
2660
|
}
|
|
@@ -2660,7 +2671,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2660
2671
|
const word = super.readWord1();
|
|
2661
2672
|
const fullWord = "@@" + word;
|
|
2662
2673
|
if (!this.isIterator(word) || !this.state.inType) this.raise(Errors.InvalidIdentifier, this.state.curPosition(), { identifierName: fullWord });
|
|
2663
|
-
this.finishToken(
|
|
2674
|
+
this.finishToken(131, fullWord);
|
|
2664
2675
|
}
|
|
2665
2676
|
getTokenFromCode(code) {
|
|
2666
2677
|
const next = this.input.charCodeAt(this.state.pos + 1);
|
|
@@ -2748,7 +2759,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2748
2759
|
parseClassSuper(node) {
|
|
2749
2760
|
super.parseClassSuper(node);
|
|
2750
2761
|
if (node.superClass && (this.match(43) || this.match(47))) node.superTypeArguments = this.flowParseTypeParameterInstantiationInExpression();
|
|
2751
|
-
if (this.eatContextual(
|
|
2762
|
+
if (this.eatContextual(112)) {
|
|
2752
2763
|
const implemented = node.implements = [];
|
|
2753
2764
|
do
|
|
2754
2765
|
implemented.push(this.flowParseClassImplements());
|
|
@@ -2802,7 +2813,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2802
2813
|
}
|
|
2803
2814
|
isPotentialImportPhase(isExport) {
|
|
2804
2815
|
if (super.isPotentialImportPhase(isExport)) return true;
|
|
2805
|
-
if (this.isContextual(
|
|
2816
|
+
if (this.isContextual(129)) {
|
|
2806
2817
|
if (!isExport) return true;
|
|
2807
2818
|
const ch = this.lookaheadCharCode();
|
|
2808
2819
|
return ch === 123 || ch === 42;
|
|
@@ -2819,14 +2830,18 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2819
2830
|
node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
|
|
2820
2831
|
}
|
|
2821
2832
|
}
|
|
2822
|
-
|
|
2833
|
+
parseNamedOrFilteredImportSpecifiers(node) {
|
|
2834
|
+
super.parseNamedOrFilteredImportSpecifiers(node);
|
|
2835
|
+
const specifier = node.specifiers[node.specifiers.length - 1];
|
|
2836
|
+
if (hasTypeImportKind(node) && specifier?.type === "ImportNamespaceSpecifier") this.unexpected(specifier.start);
|
|
2837
|
+
}
|
|
2838
|
+
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
|
|
2823
2839
|
const firstIdent = specifier.imported;
|
|
2824
2840
|
let specifierTypeKind = null;
|
|
2825
2841
|
if (firstIdent.type === "Identifier") {
|
|
2826
2842
|
if (firstIdent.name === "type") specifierTypeKind = "type";
|
|
2827
2843
|
else if (firstIdent.name === "typeof") specifierTypeKind = "typeof";
|
|
2828
2844
|
}
|
|
2829
|
-
let isBinding = false;
|
|
2830
2845
|
if (this.isContextual(90) && !this.isLookaheadContextual("as")) {
|
|
2831
2846
|
const as_ident = this.parseIdentifier(true);
|
|
2832
2847
|
if (specifierTypeKind !== null && !tokenIsKeywordOrIdentifier(this.state.type)) {
|
|
@@ -2843,21 +2858,23 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2843
2858
|
specifier.imported = this.parseIdentifier(true);
|
|
2844
2859
|
specifier.importKind = specifierTypeKind;
|
|
2845
2860
|
} else {
|
|
2846
|
-
if (importedIsString) throw this.raise(Errors.ImportBindingIsString, specifier, { importName: firstIdent.value });
|
|
2847
2861
|
specifier.imported = firstIdent;
|
|
2848
2862
|
specifier.importKind = null;
|
|
2849
2863
|
}
|
|
2850
2864
|
if (this.eatContextual(90)) specifier.local = this.parseIdentifier();
|
|
2851
|
-
else
|
|
2852
|
-
isBinding = true;
|
|
2853
|
-
specifier.local = this.cloneIdentifier(specifier.imported);
|
|
2854
|
-
}
|
|
2865
|
+
else specifier.local = this.cloneIdentifier(specifier.imported);
|
|
2855
2866
|
}
|
|
2867
|
+
return this.finishNode(specifier, "ImportSpecifier");
|
|
2868
|
+
}
|
|
2869
|
+
checkImportSpecifier(specifier, isInTypeOnlyImport) {
|
|
2856
2870
|
const specifierIsTypeImport = hasTypeImportKind(specifier);
|
|
2857
|
-
|
|
2858
|
-
if (
|
|
2859
|
-
|
|
2860
|
-
|
|
2871
|
+
const isTypeImport = isInTypeOnlyImport || specifierIsTypeImport;
|
|
2872
|
+
if (isTypeImport) {
|
|
2873
|
+
if (isInTypeOnlyImport && specifierIsTypeImport) this.raise(FlowErrors.ImportTypeShorthandOnlyInPureImport, specifier);
|
|
2874
|
+
const { local } = specifier;
|
|
2875
|
+
this.checkReservedType(local.name, local.start, true);
|
|
2876
|
+
}
|
|
2877
|
+
super.checkImportSpecifier(specifier, isInTypeOnlyImport, 8201, !isTypeImport);
|
|
2861
2878
|
}
|
|
2862
2879
|
parseBindingAtom() {
|
|
2863
2880
|
switch (this.state.type) {
|
|
@@ -2892,7 +2909,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
2892
2909
|
parseMaybeAssign(refExpressionErrors, isParenItem) {
|
|
2893
2910
|
let state = null;
|
|
2894
2911
|
let jsx;
|
|
2895
|
-
if (this.hasPlugin("jsx") && (this.match(
|
|
2912
|
+
if (this.hasPlugin("jsx") && (this.match(141) || this.match(43))) {
|
|
2896
2913
|
state = this.state.clone();
|
|
2897
2914
|
jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, isParenItem), state);
|
|
2898
2915
|
if (!jsx.error) return jsx.node;
|
|
@@ -3107,7 +3124,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
3107
3124
|
const startLoc = this.state.startLoc;
|
|
3108
3125
|
const endOfInit = () => this.match(8) || this.match(4);
|
|
3109
3126
|
switch (this.state.type) {
|
|
3110
|
-
case
|
|
3127
|
+
case 134: {
|
|
3111
3128
|
const literal = this.parseNumericLiteral(this.state.value);
|
|
3112
3129
|
if (endOfInit()) return {
|
|
3113
3130
|
type: "number",
|
|
@@ -3116,7 +3133,7 @@ const flow = (superClass) => class FlowParserMixin extends superClass {
|
|
|
3116
3133
|
};
|
|
3117
3134
|
break;
|
|
3118
3135
|
}
|
|
3119
|
-
case
|
|
3136
|
+
case 133: {
|
|
3120
3137
|
const literal = this.parseStringLiteral(this.state.value);
|
|
3121
3138
|
if (endOfInit()) return {
|
|
3122
3139
|
type: "string",
|
|
@@ -3688,12 +3705,12 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3688
3705
|
if (this.state.pos === this.state.start) {
|
|
3689
3706
|
if (ch === 60 && this.state.canStartJSXElement) {
|
|
3690
3707
|
++this.state.pos;
|
|
3691
|
-
this.finishToken(
|
|
3708
|
+
this.finishToken(141);
|
|
3692
3709
|
} else super.getTokenFromCode(ch);
|
|
3693
3710
|
return;
|
|
3694
3711
|
}
|
|
3695
3712
|
out += this.input.slice(chunkStart, this.state.pos);
|
|
3696
|
-
this.finishToken(
|
|
3713
|
+
this.finishToken(140, out);
|
|
3697
3714
|
return;
|
|
3698
3715
|
case 38:
|
|
3699
3716
|
out += this.input.slice(chunkStart, this.state.pos);
|
|
@@ -3743,7 +3760,7 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3743
3760
|
} else ++this.state.pos;
|
|
3744
3761
|
}
|
|
3745
3762
|
out += this.input.slice(chunkStart, this.state.pos++);
|
|
3746
|
-
this.finishToken(
|
|
3763
|
+
this.finishToken(133, out);
|
|
3747
3764
|
}
|
|
3748
3765
|
jsxReadEntity() {
|
|
3749
3766
|
const startPos = ++this.state.pos;
|
|
@@ -3779,11 +3796,11 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3779
3796
|
do
|
|
3780
3797
|
ch = this.input.charCodeAt(++this.state.pos);
|
|
3781
3798
|
while (isIdentifierChar$1(ch) || ch === 45);
|
|
3782
|
-
this.finishToken(
|
|
3799
|
+
this.finishToken(139, this.input.slice(start, this.state.pos));
|
|
3783
3800
|
}
|
|
3784
3801
|
jsxParseIdentifier() {
|
|
3785
3802
|
const node = this.startNode();
|
|
3786
|
-
if (this.match(
|
|
3803
|
+
if (this.match(139)) node.name = this.state.value;
|
|
3787
3804
|
else if (tokenIsKeyword(this.state.type)) node.name = tokenLabelName(this.state.type);
|
|
3788
3805
|
else this.unexpected();
|
|
3789
3806
|
this.next();
|
|
@@ -3820,8 +3837,8 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3820
3837
|
node = this.jsxParseExpressionContainer(node, types.j_oTag);
|
|
3821
3838
|
if (node.expression.type === "JSXEmptyExpression") this.raise(JsxErrors.AttributeIsEmpty, node);
|
|
3822
3839
|
return node;
|
|
3823
|
-
case
|
|
3824
|
-
case
|
|
3840
|
+
case 141:
|
|
3841
|
+
case 133: return this.parseExprAtom();
|
|
3825
3842
|
default: throw this.raise(JsxErrors.UnsupportedJsxValue, this.state.startLoc);
|
|
3826
3843
|
}
|
|
3827
3844
|
}
|
|
@@ -3867,7 +3884,7 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3867
3884
|
return this.finishNode(node, "JSXAttribute");
|
|
3868
3885
|
}
|
|
3869
3886
|
jsxParseOpeningElementAt(startLoc) {
|
|
3870
|
-
if (this.eat(
|
|
3887
|
+
if (this.eat(142)) {
|
|
3871
3888
|
const node = this.startNodeAt(startLoc);
|
|
3872
3889
|
return this.finishNode(node, "JSXOpeningFragment");
|
|
3873
3890
|
}
|
|
@@ -3877,20 +3894,20 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3877
3894
|
}
|
|
3878
3895
|
jsxParseOpeningElementAfterName(node) {
|
|
3879
3896
|
const attributes = [];
|
|
3880
|
-
while (!this.match(52) && !this.match(
|
|
3897
|
+
while (!this.match(52) && !this.match(142)) attributes.push(this.jsxParseAttribute());
|
|
3881
3898
|
node.attributes = attributes;
|
|
3882
3899
|
node.selfClosing = this.eat(52);
|
|
3883
|
-
this.expect(
|
|
3900
|
+
this.expect(142);
|
|
3884
3901
|
return this.finishNode(node, "JSXOpeningElement");
|
|
3885
3902
|
}
|
|
3886
3903
|
jsxParseClosingElementAt(startLoc) {
|
|
3887
|
-
if (this.eat(
|
|
3904
|
+
if (this.eat(142)) {
|
|
3888
3905
|
const node = this.startNodeAt(startLoc);
|
|
3889
3906
|
return this.finishNode(node, "JSXClosingFragment");
|
|
3890
3907
|
}
|
|
3891
3908
|
const node = this.startNodeAt(startLoc);
|
|
3892
3909
|
node.name = this.jsxParseElementName();
|
|
3893
|
-
this.expect(
|
|
3910
|
+
this.expect(142);
|
|
3894
3911
|
return this.finishNode(node, "JSXClosingElement");
|
|
3895
3912
|
}
|
|
3896
3913
|
jsxParseElementAt(startLoc) {
|
|
@@ -3900,7 +3917,7 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3900
3917
|
let closingElement = null;
|
|
3901
3918
|
if (!openingElement.selfClosing) {
|
|
3902
3919
|
contents: for (;;) switch (this.state.type) {
|
|
3903
|
-
case
|
|
3920
|
+
case 141:
|
|
3904
3921
|
startLoc = this.state.startLoc;
|
|
3905
3922
|
this.next();
|
|
3906
3923
|
if (this.eat(52)) {
|
|
@@ -3909,7 +3926,7 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3909
3926
|
}
|
|
3910
3927
|
children.push(this.jsxParseElementAt(startLoc));
|
|
3911
3928
|
break;
|
|
3912
|
-
case
|
|
3929
|
+
case 140:
|
|
3913
3930
|
children.push(this.parseLiteral(this.state.value, "JSXText"));
|
|
3914
3931
|
break;
|
|
3915
3932
|
case 2: {
|
|
@@ -3949,9 +3966,9 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3949
3966
|
context[context.length - 1] = newContext;
|
|
3950
3967
|
}
|
|
3951
3968
|
parseExprAtom(refExpressionErrors) {
|
|
3952
|
-
if (this.match(
|
|
3969
|
+
if (this.match(141)) return this.jsxParseElement();
|
|
3953
3970
|
else if (this.match(43) && this.input.charCodeAt(this.state.pos) !== 33) {
|
|
3954
|
-
this.replaceToken(
|
|
3971
|
+
this.replaceToken(141);
|
|
3955
3972
|
return this.jsxParseElement();
|
|
3956
3973
|
} else return super.parseExprAtom(refExpressionErrors);
|
|
3957
3974
|
}
|
|
@@ -3971,7 +3988,7 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3971
3988
|
}
|
|
3972
3989
|
if (code === 62) {
|
|
3973
3990
|
++this.state.pos;
|
|
3974
|
-
this.finishToken(
|
|
3991
|
+
this.finishToken(142);
|
|
3975
3992
|
return;
|
|
3976
3993
|
}
|
|
3977
3994
|
if ((code === 34 || code === 39) && context === types.j_oTag) {
|
|
@@ -3981,18 +3998,18 @@ const jsx = (superClass) => class JSXParserMixin extends superClass {
|
|
|
3981
3998
|
}
|
|
3982
3999
|
if (code === 60 && this.state.canStartJSXElement && this.input.charCodeAt(this.state.pos + 1) !== 33) {
|
|
3983
4000
|
++this.state.pos;
|
|
3984
|
-
this.finishToken(
|
|
4001
|
+
this.finishToken(141);
|
|
3985
4002
|
return;
|
|
3986
4003
|
}
|
|
3987
4004
|
super.getTokenFromCode(code);
|
|
3988
4005
|
}
|
|
3989
4006
|
updateContext(prevType) {
|
|
3990
4007
|
const { context, type } = this.state;
|
|
3991
|
-
if (type === 52 && prevType ===
|
|
4008
|
+
if (type === 52 && prevType === 141) {
|
|
3992
4009
|
context.splice(-2, 2, types.j_cTag);
|
|
3993
4010
|
this.state.canStartJSXElement = false;
|
|
3994
|
-
} else if (type ===
|
|
3995
|
-
else if (type ===
|
|
4011
|
+
} else if (type === 141) context.push(types.j_oTag);
|
|
4012
|
+
else if (type === 142) {
|
|
3996
4013
|
const out = context[context.length - 1];
|
|
3997
4014
|
if (out === types.j_oTag && prevType === 52 || out === types.j_cTag) {
|
|
3998
4015
|
context.pop();
|
|
@@ -4196,6 +4213,10 @@ var CommentsParser = class extends BaseParser {
|
|
|
4196
4213
|
case "ImportDeclaration":
|
|
4197
4214
|
adjustInnerComments(node, node.specifiers, commentWS);
|
|
4198
4215
|
break;
|
|
4216
|
+
case "ImportNamespaceSpecifier":
|
|
4217
|
+
case "ExportNamespaceSpecifier":
|
|
4218
|
+
adjustInnerComments(node, node.exportsFilter ?? [], commentWS);
|
|
4219
|
+
break;
|
|
4199
4220
|
case "TSEnumBody":
|
|
4200
4221
|
adjustInnerComments(node, node.members, commentWS);
|
|
4201
4222
|
break;
|
|
@@ -4219,6 +4240,12 @@ var CommentsParser = class extends BaseParser {
|
|
|
4219
4240
|
const commentWS = commentStack[length - 1];
|
|
4220
4241
|
if (commentWS.leadingNode === node) commentWS.leadingNode = null;
|
|
4221
4242
|
}
|
|
4243
|
+
replaceNodeInPendingComments(oldNode, newNode) {
|
|
4244
|
+
for (const commentWS of this.state.commentStack) {
|
|
4245
|
+
if (commentWS.leadingNode === oldNode) commentWS.leadingNode = newNode;
|
|
4246
|
+
if (commentWS.trailingNode === oldNode) commentWS.trailingNode = newNode;
|
|
4247
|
+
}
|
|
4248
|
+
}
|
|
4222
4249
|
takeSurroundingComments(node, start, end) {
|
|
4223
4250
|
const { commentStack } = this.state;
|
|
4224
4251
|
const commentStackLength = commentStack.length;
|
|
@@ -4332,7 +4359,7 @@ var State = class State {
|
|
|
4332
4359
|
commentsLen = 0;
|
|
4333
4360
|
commentStack = [];
|
|
4334
4361
|
pos = 0;
|
|
4335
|
-
type =
|
|
4362
|
+
type = 138;
|
|
4336
4363
|
value = null;
|
|
4337
4364
|
start = 0;
|
|
4338
4365
|
end = 0;
|
|
@@ -4768,7 +4795,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
4768
4795
|
this.state.start = this.state.pos;
|
|
4769
4796
|
if (!this.isLookahead) this.state.startLoc = this.state.curPosition();
|
|
4770
4797
|
if (this.state.pos >= this.length) {
|
|
4771
|
-
this.finishToken(
|
|
4798
|
+
this.finishToken(138);
|
|
4772
4799
|
return;
|
|
4773
4800
|
}
|
|
4774
4801
|
this.getTokenFromCode(this.codePointAtPos(this.state.pos));
|
|
@@ -4909,10 +4936,10 @@ var Tokenizer = class extends CommentsParser {
|
|
|
4909
4936
|
if (next >= 48 && next <= 57) throw this.raise(Errors.UnexpectedDigitAfterHash, this.state.curPosition());
|
|
4910
4937
|
if (isIdentifierStart$1(next)) {
|
|
4911
4938
|
++this.state.pos;
|
|
4912
|
-
this.finishToken(
|
|
4939
|
+
this.finishToken(137, this.readWord1(next));
|
|
4913
4940
|
} else if (next === 92) {
|
|
4914
4941
|
++this.state.pos;
|
|
4915
|
-
this.finishToken(
|
|
4942
|
+
this.finishToken(137, this.readWord1());
|
|
4916
4943
|
} else this.finishOp(23, 1);
|
|
4917
4944
|
}
|
|
4918
4945
|
readToken_dot() {
|
|
@@ -5236,7 +5263,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
5236
5263
|
mods += char;
|
|
5237
5264
|
}
|
|
5238
5265
|
this.state.pos = pos;
|
|
5239
|
-
this.finishToken(
|
|
5266
|
+
this.finishToken(136, {
|
|
5240
5267
|
pattern: content,
|
|
5241
5268
|
flags: mods
|
|
5242
5269
|
});
|
|
@@ -5281,12 +5308,12 @@ var Tokenizer = class extends CommentsParser {
|
|
|
5281
5308
|
if (isBigInt || val !== null && val > Number.MAX_SAFE_INTEGER) {
|
|
5282
5309
|
const str = this.input.slice(start, end).replaceAll("_", "");
|
|
5283
5310
|
if (isBigInt) {
|
|
5284
|
-
this.finishToken(
|
|
5311
|
+
this.finishToken(135, str);
|
|
5285
5312
|
return;
|
|
5286
5313
|
}
|
|
5287
5314
|
val = Number(radix !== 16 && this.optionFlags & 4096 ? str.replace(radix === 2 ? /[2-9]/g : /[89]/g, "0") : str);
|
|
5288
5315
|
}
|
|
5289
|
-
this.finishToken(
|
|
5316
|
+
this.finishToken(134, val);
|
|
5290
5317
|
}
|
|
5291
5318
|
readNumber(startsWithDot) {
|
|
5292
5319
|
const start = this.state.pos;
|
|
@@ -5326,16 +5353,16 @@ var Tokenizer = class extends CommentsParser {
|
|
|
5326
5353
|
}
|
|
5327
5354
|
if (isIdentifierStart$1(this.codePointAtPos(this.state.pos))) throw this.raise(Errors.NumberIdentifier, this.state.curPosition());
|
|
5328
5355
|
if (!isFloat && !isBigInt && !hasLeadingZero && integerValue <= Number.MAX_SAFE_INTEGER) {
|
|
5329
|
-
this.finishToken(
|
|
5356
|
+
this.finishToken(134, integerValue);
|
|
5330
5357
|
return;
|
|
5331
5358
|
}
|
|
5332
5359
|
const str = this.input.slice(start, end).replaceAll("_", "");
|
|
5333
5360
|
if (isBigInt) {
|
|
5334
|
-
this.finishToken(
|
|
5361
|
+
this.finishToken(135, str);
|
|
5335
5362
|
return;
|
|
5336
5363
|
}
|
|
5337
5364
|
const val = isOctal ? parseInt(str, 8) : parseFloat(str);
|
|
5338
|
-
this.finishToken(
|
|
5365
|
+
this.finishToken(134, val);
|
|
5339
5366
|
}
|
|
5340
5367
|
readCodePoint(throwOnInvalid) {
|
|
5341
5368
|
const { code, pos } = readCodePoint$1(this.input, this.state.pos, this.state.lineStart, this.state.curLine, throwOnInvalid, this.errorHandlers_readCodePoint);
|
|
@@ -5347,7 +5374,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
5347
5374
|
this.state.pos = pos + 1;
|
|
5348
5375
|
this.state.lineStart = lineStart;
|
|
5349
5376
|
this.state.curLine = curLine;
|
|
5350
|
-
this.finishToken(
|
|
5377
|
+
this.finishToken(133, str);
|
|
5351
5378
|
}
|
|
5352
5379
|
readTemplateContinuation() {
|
|
5353
5380
|
if (!this.match(4)) this.unexpected(null, 4);
|
|
@@ -5407,7 +5434,7 @@ var Tokenizer = class extends CommentsParser {
|
|
|
5407
5434
|
const word = this.readWord1(firstCode);
|
|
5408
5435
|
const type = keywords$1.get(word);
|
|
5409
5436
|
if (type !== void 0) this.finishToken(type, tokenLabelName(type));
|
|
5410
|
-
else this.finishToken(
|
|
5437
|
+
else this.finishToken(131, word);
|
|
5411
5438
|
}
|
|
5412
5439
|
checkKeywordEscapes() {
|
|
5413
5440
|
const { type } = this.state;
|
|
@@ -5669,7 +5696,7 @@ var UtilParser = class extends Tokenizer {
|
|
|
5669
5696
|
isUnparsedContextual(nameStart, name) {
|
|
5670
5697
|
if (this.input.startsWith(name, nameStart)) {
|
|
5671
5698
|
const nextCh = this.input.charCodeAt(nameStart + name.length);
|
|
5672
|
-
return !(isIdentifierChar$1(nextCh) || (nextCh & 64512) === 55296);
|
|
5699
|
+
return !(isIdentifierChar$1(nextCh) || nextCh === 92 || (nextCh & 64512) === 55296);
|
|
5673
5700
|
}
|
|
5674
5701
|
return false;
|
|
5675
5702
|
}
|
|
@@ -5691,7 +5718,7 @@ var UtilParser = class extends Tokenizer {
|
|
|
5691
5718
|
}
|
|
5692
5719
|
}
|
|
5693
5720
|
canInsertSemicolon() {
|
|
5694
|
-
return this.match(
|
|
5721
|
+
return this.match(138) || this.match(4) || this.hasPrecedingLineBreak();
|
|
5695
5722
|
}
|
|
5696
5723
|
hasPrecedingLineBreak() {
|
|
5697
5724
|
return hasNewLine(this.input, this.offsetToSourcePos(this.state.lastTokEndLoc.index), this.state.start);
|
|
@@ -6140,7 +6167,7 @@ var LValParser = class extends NodeUtils {
|
|
|
6140
6167
|
const { type, startLoc } = this.state;
|
|
6141
6168
|
if (type === 17) return this.parseBindingRestProperty(this.startNode());
|
|
6142
6169
|
const prop = this.startNode();
|
|
6143
|
-
if (type ===
|
|
6170
|
+
if (type === 137) {
|
|
6144
6171
|
this.expectPlugin("destructuringPrivate", startLoc);
|
|
6145
6172
|
this.classScope.usePrivateName(this.state.value, startLoc);
|
|
6146
6173
|
prop.key = this.parsePrivateName();
|
|
@@ -6280,9 +6307,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
6280
6307
|
getExpression() {
|
|
6281
6308
|
this.enterInitialScopes();
|
|
6282
6309
|
this.nextToken();
|
|
6283
|
-
if (this.match(
|
|
6310
|
+
if (this.match(138)) throw this.raise(Errors.ParseExpressionEmptyInput, this.state.startLoc);
|
|
6284
6311
|
const expr = this.parseExpression();
|
|
6285
|
-
if (!this.match(
|
|
6312
|
+
if (!this.match(138)) throw this.raise(Errors.ParseExpressionExpectsEOF, this.state.startLoc, { unexpected: this.input.codePointAt(this.state.start) });
|
|
6286
6313
|
this.finalizeRemainingComments();
|
|
6287
6314
|
expr.comments = this.comments;
|
|
6288
6315
|
expr.errors = this.state.errors;
|
|
@@ -6316,7 +6343,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
6316
6343
|
}
|
|
6317
6344
|
parseMaybeAssign(refExpressionErrors, isParenItem) {
|
|
6318
6345
|
const startLoc = this.state.startLoc;
|
|
6319
|
-
const isYield = this.isContextual(
|
|
6346
|
+
const isYield = this.isContextual(107);
|
|
6320
6347
|
if (isYield) {
|
|
6321
6348
|
if (this.prodParam.hasYield) {
|
|
6322
6349
|
this.next();
|
|
@@ -6391,7 +6418,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
6391
6418
|
return expr;
|
|
6392
6419
|
}
|
|
6393
6420
|
parseMaybeUnaryOrPrivate(refExpressionErrors) {
|
|
6394
|
-
return this.match(
|
|
6421
|
+
return this.match(137) ? this.parsePrivateName() : this.parseMaybeUnary(refExpressionErrors);
|
|
6395
6422
|
}
|
|
6396
6423
|
parseExprOps(refExpressionErrors) {
|
|
6397
6424
|
const startLoc = this.state.startLoc;
|
|
@@ -6584,7 +6611,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
6584
6611
|
if (computed) {
|
|
6585
6612
|
node.property = this.parseExpression();
|
|
6586
6613
|
this.expect(1);
|
|
6587
|
-
} else if (this.match(
|
|
6614
|
+
} else if (this.match(137)) {
|
|
6588
6615
|
if (base.type === "Super") this.raise(Errors.SuperPrivateField, startLoc);
|
|
6589
6616
|
this.classScope.usePrivateName(this.state.value, this.state.startLoc);
|
|
6590
6617
|
node.property = this.parsePrivateName();
|
|
@@ -6697,7 +6724,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
6697
6724
|
case 79:
|
|
6698
6725
|
node = this.startNode();
|
|
6699
6726
|
this.next();
|
|
6700
|
-
if (this.match(12)) return this.
|
|
6727
|
+
if (this.match(12)) return this.parseImportMetaPropertyOrPhaseCallOrSyncCall(node);
|
|
6701
6728
|
if (this.match(6)) {
|
|
6702
6729
|
if (this.optionFlags & 1024) return this.parseImportCall(node);
|
|
6703
6730
|
else return this.finishNode(node, "Import");
|
|
@@ -6714,9 +6741,9 @@ var ExpressionParser = class extends LValParser {
|
|
|
6714
6741
|
case 27:
|
|
6715
6742
|
this.readRegexp();
|
|
6716
6743
|
return this.parseRegExpLiteral(this.state.value);
|
|
6717
|
-
case
|
|
6718
|
-
case
|
|
6719
|
-
case
|
|
6744
|
+
case 134: return this.parseNumericLiteral(this.state.value);
|
|
6745
|
+
case 135: return this.parseBigIntLiteral(this.state.value);
|
|
6746
|
+
case 133: return this.parseStringLiteral(this.state.value);
|
|
6720
6747
|
case 80: return this.parseNullLiteral();
|
|
6721
6748
|
case 81: return this.parseBooleanLiteral(true);
|
|
6722
6749
|
case 82: return this.parseBooleanLiteral(false);
|
|
@@ -6739,7 +6766,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
6739
6766
|
if (callee.type === "MemberExpression") return this.finishNode(node, "BindExpression");
|
|
6740
6767
|
else throw this.raise(Errors.UnsupportedBind, callee);
|
|
6741
6768
|
}
|
|
6742
|
-
case
|
|
6769
|
+
case 137:
|
|
6743
6770
|
this.raise(Errors.PrivateInExpectedIn, this.state.startLoc, { identifierName: this.state.value });
|
|
6744
6771
|
return this.parsePrivateName();
|
|
6745
6772
|
case 29: return this.parseTopicReferenceThenEqualsSign(50, "%");
|
|
@@ -6763,7 +6790,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
6763
6790
|
throw this.unexpected();
|
|
6764
6791
|
}
|
|
6765
6792
|
default: if (tokenIsIdentifier(type)) {
|
|
6766
|
-
if (this.isContextual(
|
|
6793
|
+
if (this.isContextual(126) && this.lookaheadInLineCharCode() === 123) return this.parseModuleExpression();
|
|
6767
6794
|
const { canStartArrow, containsEsc } = this.state;
|
|
6768
6795
|
const id = this.parseIdentifier();
|
|
6769
6796
|
if (!containsEsc && id.name === "async" && !this.canInsertSemicolon()) {
|
|
@@ -6881,7 +6908,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
6881
6908
|
});
|
|
6882
6909
|
return this.finishNode(node, "MetaProperty");
|
|
6883
6910
|
}
|
|
6884
|
-
|
|
6911
|
+
parseImportMetaPropertyOrPhaseCallOrSyncCall(node) {
|
|
6885
6912
|
this.next();
|
|
6886
6913
|
if (this.isContextual(102) || this.isContextual(94)) {
|
|
6887
6914
|
const isSource = this.isContextual(102);
|
|
@@ -6889,6 +6916,11 @@ var ExpressionParser = class extends LValParser {
|
|
|
6889
6916
|
this.next();
|
|
6890
6917
|
node.phase = isSource ? "source" : "defer";
|
|
6891
6918
|
return this.parseImportCall(node);
|
|
6919
|
+
} else if (this.isContextual(105)) {
|
|
6920
|
+
this.expectPlugin("importSync");
|
|
6921
|
+
this.next();
|
|
6922
|
+
node.sync = true;
|
|
6923
|
+
return this.parseImportCall(node);
|
|
6892
6924
|
} else {
|
|
6893
6925
|
const id = this.createIdentifierAt(this.startNodeAtNode(node), "import", this.state.lastTokStartLoc);
|
|
6894
6926
|
if (this.isContextual(98)) {
|
|
@@ -7221,16 +7253,16 @@ var ExpressionParser = class extends LValParser {
|
|
|
7221
7253
|
let key;
|
|
7222
7254
|
if (tokenIsKeywordOrIdentifier(type)) key = this.parseIdentifier(true);
|
|
7223
7255
|
else switch (type) {
|
|
7224
|
-
case
|
|
7256
|
+
case 134:
|
|
7225
7257
|
key = this.parseNumericLiteral(value);
|
|
7226
7258
|
break;
|
|
7227
|
-
case
|
|
7259
|
+
case 133:
|
|
7228
7260
|
key = this.parseStringLiteral(value);
|
|
7229
7261
|
break;
|
|
7230
|
-
case
|
|
7262
|
+
case 135:
|
|
7231
7263
|
key = this.parseBigIntLiteral(value);
|
|
7232
7264
|
break;
|
|
7233
|
-
case
|
|
7265
|
+
case 137: {
|
|
7234
7266
|
const privateKeyLoc = this.state.startLoc;
|
|
7235
7267
|
if (refExpressionErrors != null) {
|
|
7236
7268
|
if (refExpressionErrors.privateKeyLoc === null) refExpressionErrors.privateKeyLoc = privateKeyLoc;
|
|
@@ -7241,7 +7273,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
7241
7273
|
default: throw this.unexpected();
|
|
7242
7274
|
}
|
|
7243
7275
|
prop.key = key;
|
|
7244
|
-
if (type !==
|
|
7276
|
+
if (type !== 137) prop.computed = false;
|
|
7245
7277
|
}
|
|
7246
7278
|
}
|
|
7247
7279
|
initFunction(node, isAsync) {
|
|
@@ -7379,7 +7411,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
7379
7411
|
else this.unexpected();
|
|
7380
7412
|
const tokenIsKeyword = tokenKeywordOrIdentifierIsKeyword(type);
|
|
7381
7413
|
if (liberal) {
|
|
7382
|
-
if (tokenIsKeyword) this.replaceToken(
|
|
7414
|
+
if (tokenIsKeyword) this.replaceToken(131);
|
|
7383
7415
|
} else this.checkReservedWord(name, this.sourceToOffsetPos(start), tokenIsKeyword, false);
|
|
7384
7416
|
this.next();
|
|
7385
7417
|
return name;
|
|
@@ -7439,7 +7471,7 @@ var ExpressionParser = class extends LValParser {
|
|
|
7439
7471
|
isAmbiguousPrefixOrIdentifier() {
|
|
7440
7472
|
if (this.hasPrecedingLineBreak()) return true;
|
|
7441
7473
|
const { type } = this.state;
|
|
7442
|
-
return type === 49 || type === 6 || type === 0 || tokenIsTemplate(type) || type === 99 && !this.state.containsEsc || type ===
|
|
7474
|
+
return type === 49 || type === 6 || type === 0 || tokenIsTemplate(type) || type === 99 && !this.state.containsEsc || type === 136 || type === 52 || this.hasPlugin("v8intrinsic") && type === 50;
|
|
7443
7475
|
}
|
|
7444
7476
|
parseYield(startLoc) {
|
|
7445
7477
|
const node = this.startNodeAt(startLoc);
|
|
@@ -7450,13 +7482,14 @@ var ExpressionParser = class extends LValParser {
|
|
|
7450
7482
|
delegating = this.eat(51);
|
|
7451
7483
|
switch (this.state.type) {
|
|
7452
7484
|
case 9:
|
|
7453
|
-
case
|
|
7485
|
+
case 138:
|
|
7454
7486
|
case 4:
|
|
7455
7487
|
case 7:
|
|
7456
7488
|
case 1:
|
|
7457
7489
|
case 5:
|
|
7458
7490
|
case 10:
|
|
7459
7491
|
case 8: if (!delegating) break;
|
|
7492
|
+
case 54: if (this.options.annexB && !delegating) break;
|
|
7460
7493
|
default: argument = this.parseMaybeAssign();
|
|
7461
7494
|
}
|
|
7462
7495
|
}
|
|
@@ -7584,7 +7617,7 @@ function createExportedTokens(tokens) {
|
|
|
7584
7617
|
}
|
|
7585
7618
|
var StatementParser = class extends ExpressionParser {
|
|
7586
7619
|
parseTopLevel(file, program) {
|
|
7587
|
-
file.program = this.parseProgram(program,
|
|
7620
|
+
file.program = this.parseProgram(program, 138, this.options.sourceType === "module" ? "module" : "script");
|
|
7588
7621
|
file.comments = this.comments;
|
|
7589
7622
|
if (this.optionFlags & 512) file.tokens = createExportedTokens(this.tokens);
|
|
7590
7623
|
return this.finishNode(file, "File");
|
|
@@ -7598,7 +7631,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
7598
7631
|
this.addExtra(program, "topLevelAwait", this.state.hasTopLevelAwait);
|
|
7599
7632
|
}
|
|
7600
7633
|
let finishedProgram;
|
|
7601
|
-
if (end ===
|
|
7634
|
+
if (end === 138) finishedProgram = this.finishNode(program, "Program");
|
|
7602
7635
|
else finishedProgram = this.finishNodeAt(program, "Program", createPositionWithColumnOffset(this.state.startLoc, -1));
|
|
7603
7636
|
return finishedProgram;
|
|
7604
7637
|
}
|
|
@@ -7627,11 +7660,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
7627
7660
|
return this.hasFollowingBindingAtom();
|
|
7628
7661
|
}
|
|
7629
7662
|
isUsing() {
|
|
7630
|
-
if (!this.isContextual(
|
|
7663
|
+
if (!this.isContextual(106)) return false;
|
|
7631
7664
|
return this.nextTokenIsIdentifierOnSameLine();
|
|
7632
7665
|
}
|
|
7633
7666
|
isForUsing() {
|
|
7634
|
-
if (!this.isContextual(
|
|
7667
|
+
if (!this.isContextual(106)) return false;
|
|
7635
7668
|
const next = this.nextTokenInLineStart();
|
|
7636
7669
|
const nextCh = this.codePointAtPos(next);
|
|
7637
7670
|
if (this.isUnparsedContextual(next, "of")) {
|
|
@@ -7734,6 +7767,13 @@ var StatementParser = class extends ExpressionParser {
|
|
|
7734
7767
|
case 76:
|
|
7735
7768
|
if (!allowDeclaration) this.unexpected();
|
|
7736
7769
|
return this.parseClass(this.maybeTakeDecorators(decorators, node), true);
|
|
7770
|
+
case 104:
|
|
7771
|
+
if (!this.state.containsEsc && this.nextTokenIsIdentifierOnSameLine()) {
|
|
7772
|
+
this.expectPlugin("structs");
|
|
7773
|
+
if (!allowDeclaration) this.unexpected();
|
|
7774
|
+
return this.parseStructDeclaration(node, false);
|
|
7775
|
+
}
|
|
7776
|
+
break;
|
|
7737
7777
|
case 65: return this.parseIfStatement(node);
|
|
7738
7778
|
case 66: return this.parseReturnStatement(node);
|
|
7739
7779
|
case 67: return this.parseSwitchStatement(node);
|
|
@@ -7748,7 +7788,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
7748
7788
|
return this.parseVarStatement(node, "await using");
|
|
7749
7789
|
}
|
|
7750
7790
|
break;
|
|
7751
|
-
case
|
|
7791
|
+
case 106:
|
|
7752
7792
|
if (this.state.containsEsc || !this.hasInLineFollowingBindingIdentifierOrBrace()) break;
|
|
7753
7793
|
if (!this.allowsUsing()) this.raise(Errors.UnexpectedUsingDeclaration, this.state.startLoc);
|
|
7754
7794
|
else if (!allowDeclaration) this.raise(Errors.UnexpectedLexicalDeclaration, this.state.startLoc);
|
|
@@ -7849,7 +7889,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
7849
7889
|
while (this.eat(12)) {
|
|
7850
7890
|
const node = this.startNodeAt(startLoc);
|
|
7851
7891
|
node.object = expr;
|
|
7852
|
-
if (this.match(
|
|
7892
|
+
if (this.match(137)) {
|
|
7853
7893
|
this.classScope.usePrivateName(this.state.value, this.state.startLoc);
|
|
7854
7894
|
node.property = this.parsePrivateName();
|
|
7855
7895
|
} else node.property = this.parseIdentifier(true);
|
|
@@ -8348,7 +8388,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8348
8388
|
this.parsePropertyNamePrefixOperator(member);
|
|
8349
8389
|
if (this.eat(51)) {
|
|
8350
8390
|
method.kind = "method";
|
|
8351
|
-
const isPrivateName = this.match(
|
|
8391
|
+
const isPrivateName = this.match(137);
|
|
8352
8392
|
this.parseClassElementName(method);
|
|
8353
8393
|
this.parsePostMemberNameModifiers(method);
|
|
8354
8394
|
if (isPrivateName) {
|
|
@@ -8390,7 +8430,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8390
8430
|
const isGenerator = this.eat(51);
|
|
8391
8431
|
if (publicMember.optional) this.unexpected(maybeQuestionTokenStartLoc);
|
|
8392
8432
|
method.kind = "method";
|
|
8393
|
-
const isPrivate = this.match(
|
|
8433
|
+
const isPrivate = this.match(137);
|
|
8394
8434
|
this.parseClassElementName(method);
|
|
8395
8435
|
this.parsePostMemberNameModifiers(publicMember);
|
|
8396
8436
|
if (isPrivate) this.pushClassPrivateMethod(classBody, privateMethod, isGenerator, true);
|
|
@@ -8401,7 +8441,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8401
8441
|
} else if ((maybeContextualKw === "get" || maybeContextualKw === "set") && !(this.match(51) && this.isLineTerminator())) {
|
|
8402
8442
|
this.resetPreviousNodeTrailingComments(key);
|
|
8403
8443
|
method.kind = maybeContextualKw;
|
|
8404
|
-
const isPrivate = this.match(
|
|
8444
|
+
const isPrivate = this.match(137);
|
|
8405
8445
|
this.parseClassElementName(publicMethod);
|
|
8406
8446
|
if (isPrivate) this.pushClassPrivateMethod(classBody, privateMethod, false, false);
|
|
8407
8447
|
else {
|
|
@@ -8412,7 +8452,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8412
8452
|
} else if (maybeContextualKw === "accessor" && !this.isLineTerminator()) {
|
|
8413
8453
|
this.expectPlugin("decoratorAutoAccessors");
|
|
8414
8454
|
this.resetPreviousNodeTrailingComments(key);
|
|
8415
|
-
const isPrivate = this.match(
|
|
8455
|
+
const isPrivate = this.match(137);
|
|
8416
8456
|
this.parseClassElementName(publicProp);
|
|
8417
8457
|
this.pushClassAccessorProperty(classBody, accessorProp, isPrivate);
|
|
8418
8458
|
} else if (this.isLineTerminator()) {
|
|
@@ -8422,8 +8462,8 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8422
8462
|
}
|
|
8423
8463
|
parseClassElementName(member) {
|
|
8424
8464
|
const { type, value } = this.state;
|
|
8425
|
-
if ((type ===
|
|
8426
|
-
if (type ===
|
|
8465
|
+
if ((type === 131 || type === 133) && member.static && value === "prototype") this.raise(Errors.StaticPrototype, this.state.startLoc);
|
|
8466
|
+
if (type === 137) {
|
|
8427
8467
|
if (value === "constructor") this.raise(Errors.ConstructorClassPrivateField, this.state.startLoc);
|
|
8428
8468
|
const key = this.parsePrivateName();
|
|
8429
8469
|
member.key = key;
|
|
@@ -8511,6 +8551,34 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8511
8551
|
node.superClass = this.parseExprSubscripts();
|
|
8512
8552
|
} else node.superClass = null;
|
|
8513
8553
|
}
|
|
8554
|
+
parseStructDeclaration(node, optionalId) {
|
|
8555
|
+
this.next();
|
|
8556
|
+
const oldStrict = this.state.strict;
|
|
8557
|
+
this.state.strict = true;
|
|
8558
|
+
this.parseClassId(node, true, optionalId);
|
|
8559
|
+
this.parseClassSuper(node);
|
|
8560
|
+
node.body = this.parseStructBody(!!node.superClass, oldStrict);
|
|
8561
|
+
return this.finishNode(node, "StructDeclaration");
|
|
8562
|
+
}
|
|
8563
|
+
parseStructBody(hadSuperClass, oldStrict) {
|
|
8564
|
+
this.classScope.enter();
|
|
8565
|
+
const state = {
|
|
8566
|
+
hadConstructor: false,
|
|
8567
|
+
hadSuperClass
|
|
8568
|
+
};
|
|
8569
|
+
const structBody = this.startNode();
|
|
8570
|
+
structBody.body = [];
|
|
8571
|
+
this.expect(2);
|
|
8572
|
+
while (!this.match(4)) {
|
|
8573
|
+
if (this.eat(9)) continue;
|
|
8574
|
+
const member = this.startNode();
|
|
8575
|
+
this.parseClassMember(structBody, member, state);
|
|
8576
|
+
}
|
|
8577
|
+
this.state.strict = oldStrict;
|
|
8578
|
+
this.next();
|
|
8579
|
+
this.classScope.exit();
|
|
8580
|
+
return this.finishNode(structBody, "StructBody");
|
|
8581
|
+
}
|
|
8514
8582
|
parseExport(node, decorators) {
|
|
8515
8583
|
const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, true);
|
|
8516
8584
|
const hasDefault = this.maybeParseExportDefaultSpecifier(node, maybeDefaultIdentifier);
|
|
@@ -8518,15 +8586,16 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8518
8586
|
const hasStar = parseAfterDefault && this.eatExportStar(node);
|
|
8519
8587
|
const hasNamespace = hasStar && this.maybeParseExportNamespaceSpecifier(node);
|
|
8520
8588
|
const parseAfterNamespace = parseAfterDefault && !hasNamespace;
|
|
8521
|
-
const isFromRequired = hasDefault || hasStar;
|
|
8522
8589
|
if (hasStar && !hasNamespace) {
|
|
8523
8590
|
if (hasDefault) this.unexpected();
|
|
8524
8591
|
if (decorators) throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
8592
|
+
if (node.phase === "defer") this.raise(Errors.DeferExportInvalidAll, node);
|
|
8525
8593
|
this.parseExportFrom(node, true);
|
|
8526
8594
|
this.sawUnambiguousESM = true;
|
|
8527
8595
|
return this.finishNode(node, "ExportAllDeclaration");
|
|
8528
8596
|
}
|
|
8529
8597
|
const hasSpecifiers = parseAfterNamespace && this.maybeParseExportNamedSpecifiers(node);
|
|
8598
|
+
const isFromRequired = hasDefault || hasStar || node.phase === "defer" || hasSpecifiers && node.specifiers[0]?.type === "ExportNamespaceSpecifier";
|
|
8530
8599
|
if (hasDefault && parseAfterDefault && !hasStar && !hasSpecifiers) this.unexpected(null, 2);
|
|
8531
8600
|
let hasDeclaration;
|
|
8532
8601
|
if (isFromRequired || hasSpecifiers) {
|
|
@@ -8539,6 +8608,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8539
8608
|
this.checkNamedExport(node2, !!node2.source);
|
|
8540
8609
|
if (node2.declaration?.type === "ClassDeclaration") this.maybeTakeDecorators(decorators, node2.declaration, node2);
|
|
8541
8610
|
else if (decorators) throw this.raise(Errors.UnsupportedDecoratorExport, node);
|
|
8611
|
+
if (this.hasPlugin("deferredReexports")) node2.phase ??= null;
|
|
8542
8612
|
this.sawUnambiguousESM = true;
|
|
8543
8613
|
return this.finishNode(node2, "ExportNamedDeclaration");
|
|
8544
8614
|
}
|
|
@@ -8587,7 +8657,17 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8587
8657
|
const node2 = node;
|
|
8588
8658
|
if (!node2.specifiers) node2.specifiers = [];
|
|
8589
8659
|
const isTypeExport = node2.exportKind === "type";
|
|
8590
|
-
|
|
8660
|
+
const startLoc = this.state.startLoc;
|
|
8661
|
+
this.setLoc(startLoc);
|
|
8662
|
+
const specifiers = this.parseExportSpecifiers(isTypeExport);
|
|
8663
|
+
if (this.isContextual(90) && !this.hasPrecedingLineBreak()) {
|
|
8664
|
+
this.expectPlugin("namespaceImportFilter");
|
|
8665
|
+
const specifier = this.startNodeAt(startLoc);
|
|
8666
|
+
specifier.exportsFilter = this.toNamespaceExportsFilter(specifiers);
|
|
8667
|
+
this.next();
|
|
8668
|
+
specifier.exported = this.parseModuleExportName();
|
|
8669
|
+
node2.specifiers.push(this.finishNode(specifier, "ExportNamespaceSpecifier"));
|
|
8670
|
+
} else node2.specifiers.push(...specifiers);
|
|
8591
8671
|
node2.source = null;
|
|
8592
8672
|
node2.attributes = [];
|
|
8593
8673
|
node2.declaration = null;
|
|
@@ -8621,6 +8701,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8621
8701
|
return this.parseFunction(expr, 13);
|
|
8622
8702
|
}
|
|
8623
8703
|
if (this.match(76)) return this.parseClass(expr, true, true);
|
|
8704
|
+
if (this.isContextual(104)) {
|
|
8705
|
+
const next = this.nextTokenInLineStart();
|
|
8706
|
+
const nextCh = this.codePointAtPos(next);
|
|
8707
|
+
if (nextCh === 123 || this.chStartsBindingIdentifier(nextCh, next)) {
|
|
8708
|
+
this.expectPlugin("structs");
|
|
8709
|
+
return this.parseStructDeclaration(expr, true);
|
|
8710
|
+
}
|
|
8711
|
+
}
|
|
8624
8712
|
if (this.match(22)) return this.parseClass(this.maybeTakeDecorators(this.parseDecorators(false), this.startNode()), true, true);
|
|
8625
8713
|
if (this.match(71) || this.match(70) || this.isLet() && !this.isReservedWordOnNewLineAfterLet(this.nextTokenStart()) || this.isUsing() || this.isAwaitUsing()) throw this.raise(Errors.UnsupportedDefaultExport, this.state.startLoc);
|
|
8626
8714
|
const res = this.parseMaybeAssignAllowIn();
|
|
@@ -8629,6 +8717,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8629
8717
|
}
|
|
8630
8718
|
parseExportDeclaration(node) {
|
|
8631
8719
|
if (this.match(76)) return this.parseClass(this.startNode(), true, false);
|
|
8720
|
+
if (this.isContextual(104) && this.nextTokenIsIdentifierOnSameLine()) {
|
|
8721
|
+
this.expectPlugin("structs");
|
|
8722
|
+
return this.parseStructDeclaration(this.startNode(), false);
|
|
8723
|
+
}
|
|
8632
8724
|
if (this.isContextual(97)) return this.parseVarStatement(this.startNode(), "let");
|
|
8633
8725
|
return this.parseStatementListItem();
|
|
8634
8726
|
}
|
|
@@ -8636,11 +8728,11 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8636
8728
|
const { type } = this.state;
|
|
8637
8729
|
if (tokenIsIdentifier(type)) {
|
|
8638
8730
|
if (type === 92 && !this.state.containsEsc || type === 97) return false;
|
|
8639
|
-
if ((type ===
|
|
8731
|
+
if ((type === 129 || type === 128 || type === 104) && !this.state.containsEsc) {
|
|
8640
8732
|
const next = this.nextTokenStart();
|
|
8641
8733
|
const nextChar = this.input.charCodeAt(next);
|
|
8642
|
-
if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next) && !this.
|
|
8643
|
-
this.expectOnePlugin(["flow", "typescript"]);
|
|
8734
|
+
if (nextChar === 123 || this.chStartsBindingIdentifier(nextChar, next) && !this.isUnparsedContextual(next, "from")) {
|
|
8735
|
+
if (type !== 104) this.expectOnePlugin(["flow", "typescript"]);
|
|
8644
8736
|
return false;
|
|
8645
8737
|
}
|
|
8646
8738
|
}
|
|
@@ -8675,7 +8767,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8675
8767
|
this.raise(Errors.UsingDeclarationExport, this.state.startLoc);
|
|
8676
8768
|
return true;
|
|
8677
8769
|
}
|
|
8678
|
-
return type === 70 || type === 71 || type === 64 || type === 76 || this.isLet() || this.isAsyncFunction();
|
|
8770
|
+
return type === 70 || type === 71 || type === 64 || type === 76 || this.isLet() || this.isAsyncFunction() || this.isContextual(104) && this.nextTokenIsIdentifierOnSameLine();
|
|
8679
8771
|
}
|
|
8680
8772
|
checkNamedExport(node, isFrom) {
|
|
8681
8773
|
if (node.specifiers?.length) for (const specifier of node.specifiers) {
|
|
@@ -8696,7 +8788,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8696
8788
|
}
|
|
8697
8789
|
else if (node.declaration) {
|
|
8698
8790
|
const decl = node.declaration;
|
|
8699
|
-
if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") {
|
|
8791
|
+
if (decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration" || decl.type === "StructDeclaration") {
|
|
8700
8792
|
const { id } = decl;
|
|
8701
8793
|
if (!id) throw new Error("Assertion failure");
|
|
8702
8794
|
this.checkDuplicateExports(node, id.name);
|
|
@@ -8729,8 +8821,8 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8729
8821
|
this.expect(8);
|
|
8730
8822
|
if (this.eat(4)) break;
|
|
8731
8823
|
}
|
|
8732
|
-
const isMaybeTypeOnly = this.isContextual(
|
|
8733
|
-
const isString = this.match(
|
|
8824
|
+
const isMaybeTypeOnly = this.isContextual(129);
|
|
8825
|
+
const isString = this.match(133);
|
|
8734
8826
|
const node = this.startNode();
|
|
8735
8827
|
node.local = this.parseModuleExportName();
|
|
8736
8828
|
nodes.push(this.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly));
|
|
@@ -8744,7 +8836,7 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8744
8836
|
return this.finishNode(node, "ExportSpecifier");
|
|
8745
8837
|
}
|
|
8746
8838
|
parseModuleExportName() {
|
|
8747
|
-
if (this.match(
|
|
8839
|
+
if (this.match(133)) {
|
|
8748
8840
|
const result = this.parseStringLiteral(this.state.value);
|
|
8749
8841
|
const surrogate = loneSurrogate.exec(result.value);
|
|
8750
8842
|
if (surrogate) this.raise(Errors.ModuleExportNameHasLoneSurrogate, result, { surrogateCharCode: surrogate[0].charCodeAt(0) });
|
|
@@ -8752,6 +8844,31 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8752
8844
|
}
|
|
8753
8845
|
return this.parseIdentifier(true);
|
|
8754
8846
|
}
|
|
8847
|
+
toNamespaceExportsFilter(specifiers) {
|
|
8848
|
+
const seen = /* @__PURE__ */ new Set();
|
|
8849
|
+
return specifiers.map((specifier) => {
|
|
8850
|
+
let name, alias, kind;
|
|
8851
|
+
if (specifier.type === "ImportSpecifier") ({imported: name, local: alias, importKind: kind} = specifier);
|
|
8852
|
+
else ({local: name, exported: alias, exportKind: kind} = specifier);
|
|
8853
|
+
const nameString = name.type === "Identifier" ? name.name : this.isStringModuleExportName(name) ? name.value : null;
|
|
8854
|
+
if (nameString !== null) {
|
|
8855
|
+
if (seen.has(nameString)) this.raise(Errors.FilteredNamespaceDuplicateName, name, { name: nameString });
|
|
8856
|
+
seen.add(nameString);
|
|
8857
|
+
}
|
|
8858
|
+
let invalid = false;
|
|
8859
|
+
if (alias.start !== name.start) {
|
|
8860
|
+
this.raise(Errors.FilteredNamespaceRename, alias);
|
|
8861
|
+
invalid = true;
|
|
8862
|
+
}
|
|
8863
|
+
if (kind === "type" || kind === "typeof") {
|
|
8864
|
+
this.raise(Errors.FilteredNamespaceTypeModifier, specifier);
|
|
8865
|
+
invalid = true;
|
|
8866
|
+
}
|
|
8867
|
+
if (invalid) return specifier;
|
|
8868
|
+
this.replaceNodeInPendingComments(specifier, name);
|
|
8869
|
+
return name;
|
|
8870
|
+
});
|
|
8871
|
+
}
|
|
8755
8872
|
checkImportPhase(node) {
|
|
8756
8873
|
if (node.phase == null) return;
|
|
8757
8874
|
const { specifiers } = node;
|
|
@@ -8763,11 +8880,21 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8763
8880
|
}
|
|
8764
8881
|
}
|
|
8765
8882
|
isPotentialImportPhase(isExport) {
|
|
8766
|
-
if (isExport)
|
|
8883
|
+
if (isExport) {
|
|
8884
|
+
if (!this.isContextual(94)) return false;
|
|
8885
|
+
const ch = this.lookaheadCharCode();
|
|
8886
|
+
return ch === 123 || ch === 42;
|
|
8887
|
+
}
|
|
8767
8888
|
return this.isContextual(102) || this.isContextual(94);
|
|
8768
8889
|
}
|
|
8769
8890
|
applyImportPhase(node, isExport, phase, loc) {
|
|
8770
|
-
if (isExport)
|
|
8891
|
+
if (isExport) {
|
|
8892
|
+
if (phase === "defer") {
|
|
8893
|
+
this.expectPlugin("deferredReexports", loc);
|
|
8894
|
+
node.phase = "defer";
|
|
8895
|
+
}
|
|
8896
|
+
return;
|
|
8897
|
+
}
|
|
8771
8898
|
if (phase === "source") {
|
|
8772
8899
|
this.expectPlugin("sourcePhaseImports", loc);
|
|
8773
8900
|
node.phase = "source";
|
|
@@ -8797,14 +8924,14 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8797
8924
|
return tokenIsIdentifier(type) ? type !== 95 || this.lookaheadCharCode() === 102 : type !== 8;
|
|
8798
8925
|
}
|
|
8799
8926
|
parseImport(node) {
|
|
8800
|
-
if (this.match(
|
|
8927
|
+
if (this.match(133)) return this.parseImportSourceAndAttributes(node);
|
|
8801
8928
|
return this.parseImportSpecifiersAndAfter(node, this.parseMaybeImportPhase(node, false));
|
|
8802
8929
|
}
|
|
8803
8930
|
parseImportSpecifiersAndAfter(node, maybeDefaultIdentifier) {
|
|
8804
8931
|
node.specifiers = [];
|
|
8805
8932
|
const parseNext = !this.maybeParseDefaultImportSpecifier(node, maybeDefaultIdentifier) || this.eat(8);
|
|
8806
8933
|
const hasStar = parseNext && this.maybeParseStarImportSpecifier(node);
|
|
8807
|
-
if (parseNext && !hasStar) this.
|
|
8934
|
+
if (parseNext && !hasStar) this.parseNamedOrFilteredImportSpecifiers(node);
|
|
8808
8935
|
this.expectContextual(95);
|
|
8809
8936
|
return this.parseImportSourceAndAttributes(node);
|
|
8810
8937
|
}
|
|
@@ -8818,15 +8945,15 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8818
8945
|
return this.finishNode(node, "ImportDeclaration");
|
|
8819
8946
|
}
|
|
8820
8947
|
parseImportSource() {
|
|
8821
|
-
if (!this.match(
|
|
8948
|
+
if (!this.match(133)) this.unexpected();
|
|
8822
8949
|
return this.parseExprAtom();
|
|
8823
8950
|
}
|
|
8824
8951
|
parseImportSpecifierLocal(node, specifier, type) {
|
|
8825
8952
|
specifier.local = this.parseIdentifier();
|
|
8826
8953
|
node.specifiers.push(this.finishImportSpecifier(specifier, type));
|
|
8827
8954
|
}
|
|
8828
|
-
finishImportSpecifier(specifier, type
|
|
8829
|
-
this.checkLVal(specifier.local, { type },
|
|
8955
|
+
finishImportSpecifier(specifier, type) {
|
|
8956
|
+
this.checkLVal(specifier.local, { type }, 8201);
|
|
8830
8957
|
return this.finishNode(specifier, type);
|
|
8831
8958
|
}
|
|
8832
8959
|
parseImportAttributes() {
|
|
@@ -8839,10 +8966,10 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8839
8966
|
const keyName = this.state.value;
|
|
8840
8967
|
if (attrNames.has(keyName)) this.raise(Errors.ModuleAttributesWithDuplicateKeys, this.state.startLoc, { key: keyName });
|
|
8841
8968
|
attrNames.add(keyName);
|
|
8842
|
-
if (this.match(
|
|
8969
|
+
if (this.match(133)) node.key = this.parseStringLiteral(keyName);
|
|
8843
8970
|
else node.key = this.parseIdentifier(true);
|
|
8844
8971
|
this.expect(10);
|
|
8845
|
-
if (!this.match(
|
|
8972
|
+
if (!this.match(133)) throw this.raise(Errors.ModuleAttributeInvalidValue, this.state.startLoc);
|
|
8846
8973
|
node.value = this.parseStringLiteral(this.state.value);
|
|
8847
8974
|
attrs.push(this.finishNode(node, "ImportAttribute"));
|
|
8848
8975
|
} while (this.eat(8));
|
|
@@ -8880,6 +9007,22 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8880
9007
|
}
|
|
8881
9008
|
return false;
|
|
8882
9009
|
}
|
|
9010
|
+
parseNamedOrFilteredImportSpecifiers(node) {
|
|
9011
|
+
const startLoc = this.state.startLoc;
|
|
9012
|
+
this.setLoc(startLoc);
|
|
9013
|
+
const specifiersStart = node.specifiers.length;
|
|
9014
|
+
this.parseNamedImportSpecifiers(node);
|
|
9015
|
+
if (this.isContextual(90)) {
|
|
9016
|
+
this.expectPlugin("namespaceImportFilter");
|
|
9017
|
+
const specifier = this.startNodeAt(startLoc);
|
|
9018
|
+
specifier.exportsFilter = this.toNamespaceExportsFilter(node.specifiers.splice(specifiersStart));
|
|
9019
|
+
this.next();
|
|
9020
|
+
this.parseImportSpecifierLocal(node, specifier, "ImportNamespaceSpecifier");
|
|
9021
|
+
return;
|
|
9022
|
+
}
|
|
9023
|
+
const isInTypeOnlyImport = node.importKind === "type" || node.importKind === "typeof";
|
|
9024
|
+
for (let i = specifiersStart; i < node.specifiers.length; i++) this.checkImportSpecifier(node.specifiers[i], isInTypeOnlyImport);
|
|
9025
|
+
}
|
|
8883
9026
|
parseNamedImportSpecifiers(node) {
|
|
8884
9027
|
let first = true;
|
|
8885
9028
|
this.expect(2);
|
|
@@ -8891,22 +9034,26 @@ var StatementParser = class extends ExpressionParser {
|
|
|
8891
9034
|
if (this.eat(4)) break;
|
|
8892
9035
|
}
|
|
8893
9036
|
const specifier = this.startNode();
|
|
8894
|
-
const importedIsString = this.match(
|
|
8895
|
-
const isMaybeTypeOnly = this.isContextual(
|
|
9037
|
+
const importedIsString = this.match(133);
|
|
9038
|
+
const isMaybeTypeOnly = this.isContextual(129);
|
|
8896
9039
|
specifier.imported = this.parseModuleExportName();
|
|
8897
|
-
const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly
|
|
9040
|
+
const importSpecifier = this.parseImportSpecifier(specifier, importedIsString, node.importKind === "type" || node.importKind === "typeof", isMaybeTypeOnly);
|
|
8898
9041
|
node.specifiers.push(importSpecifier);
|
|
8899
9042
|
}
|
|
8900
9043
|
}
|
|
8901
|
-
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly
|
|
9044
|
+
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
|
|
8902
9045
|
if (this.eatContextual(90)) specifier.local = this.parseIdentifier();
|
|
8903
|
-
else
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
}
|
|
8909
|
-
|
|
9046
|
+
else specifier.local ??= this.cloneIdentifier(specifier.imported);
|
|
9047
|
+
return this.finishNode(specifier, "ImportSpecifier");
|
|
9048
|
+
}
|
|
9049
|
+
checkImportSpecifier(specifier, isInTypeOnlyImport, bindingType = 8201, checkReservedWord = true) {
|
|
9050
|
+
const { imported, local } = specifier;
|
|
9051
|
+
if (this.isStringModuleExportName(local)) throw this.raise(Errors.ImportBindingIsString, specifier, { importName: imported.value });
|
|
9052
|
+
if (checkReservedWord && local.start === imported.start) this.checkReservedWord(local.name, local.start, true, true);
|
|
9053
|
+
this.checkLVal(local, { type: "ImportSpecifier" }, bindingType);
|
|
9054
|
+
}
|
|
9055
|
+
isStringModuleExportName(node) {
|
|
9056
|
+
return node.type === "StringLiteral" || node.type === "Literal";
|
|
8910
9057
|
}
|
|
8911
9058
|
isThisParam(param) {
|
|
8912
9059
|
return param.type === "Identifier" && param.name === "this";
|
|
@@ -9076,7 +9223,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9076
9223
|
return tokenIsIdentifier(this.state.type);
|
|
9077
9224
|
}
|
|
9078
9225
|
tsTokenCanFollowModifier() {
|
|
9079
|
-
return this.match(0) || this.match(2) || this.match(51) || this.match(17) || this.match(
|
|
9226
|
+
return this.match(0) || this.match(2) || this.match(51) || this.match(17) || this.match(137) || this.isLiteralPropertyName();
|
|
9080
9227
|
}
|
|
9081
9228
|
tsNextTokenOnSameLineAndCanFollowModifier() {
|
|
9082
9229
|
this.next();
|
|
@@ -9194,7 +9341,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9194
9341
|
const node = this.startNode();
|
|
9195
9342
|
this.expect(79);
|
|
9196
9343
|
this.expect(6);
|
|
9197
|
-
if (!this.match(
|
|
9344
|
+
if (!this.match(133)) {
|
|
9198
9345
|
this.raise(TSErrors.UnsupportedImportTypeArgument, this.state.startLoc);
|
|
9199
9346
|
node.source = this.tsParseNonConditionalType();
|
|
9200
9347
|
} else node.source = this.parseStringLiteral(this.state.value);
|
|
@@ -9228,7 +9375,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9228
9375
|
this.expect(2);
|
|
9229
9376
|
while (!this.match(4)) {
|
|
9230
9377
|
const type = this.state.type;
|
|
9231
|
-
if (tokenIsIdentifier(type) || type ===
|
|
9378
|
+
if (tokenIsIdentifier(type) || type === 133) properties.push(super.parsePropertyDefinition(null));
|
|
9232
9379
|
else this.unexpected();
|
|
9233
9380
|
this.eat(8);
|
|
9234
9381
|
}
|
|
@@ -9318,7 +9465,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9318
9465
|
}
|
|
9319
9466
|
tsParseTypeParameters(parseModifiers) {
|
|
9320
9467
|
const node = this.startNode();
|
|
9321
|
-
if (this.match(43) || this.match(
|
|
9468
|
+
if (this.match(43) || this.match(141)) this.next();
|
|
9322
9469
|
else this.unexpected();
|
|
9323
9470
|
const refTrailingCommaPos = { value: -1 };
|
|
9324
9471
|
node.params = this.tsParseBracketedList("TypeParametersOrArguments", this.tsParseTypeParameter.bind(this, parseModifiers), false, true, refTrailingCommaPos);
|
|
@@ -9442,8 +9589,8 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9442
9589
|
}
|
|
9443
9590
|
tsIsStartOfMappedType() {
|
|
9444
9591
|
this.next();
|
|
9445
|
-
if (this.eat(49)) return this.isContextual(
|
|
9446
|
-
if (this.isContextual(
|
|
9592
|
+
if (this.eat(49)) return this.isContextual(121);
|
|
9593
|
+
if (this.isContextual(121)) this.next();
|
|
9447
9594
|
if (!this.match(0)) return false;
|
|
9448
9595
|
this.next();
|
|
9449
9596
|
if (!this.tsIsIdentifier()) return false;
|
|
@@ -9456,8 +9603,8 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9456
9603
|
if (this.match(49)) {
|
|
9457
9604
|
node.readonly = this.state.value;
|
|
9458
9605
|
this.next();
|
|
9459
|
-
this.expectContextual(
|
|
9460
|
-
} else if (this.eatContextual(
|
|
9606
|
+
this.expectContextual(121);
|
|
9607
|
+
} else if (this.eatContextual(121)) node.readonly = true;
|
|
9461
9608
|
this.expect(0);
|
|
9462
9609
|
node.key = this.tsParseTypeParameterName();
|
|
9463
9610
|
node.constraint = this.tsExpectThenParseType(54);
|
|
@@ -9570,9 +9717,9 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9570
9717
|
tsParseLiteralTypeNode() {
|
|
9571
9718
|
const node = this.startNode();
|
|
9572
9719
|
switch (this.state.type) {
|
|
9573
|
-
case
|
|
9720
|
+
case 134:
|
|
9721
|
+
case 135:
|
|
9574
9722
|
case 133:
|
|
9575
|
-
case 131:
|
|
9576
9723
|
case 81:
|
|
9577
9724
|
case 82:
|
|
9578
9725
|
node.literal = super.parseExprAtom();
|
|
@@ -9611,21 +9758,21 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9611
9758
|
}
|
|
9612
9759
|
tsParseThisTypeOrThisTypePredicate() {
|
|
9613
9760
|
const thisKeyword = this.tsParseThisTypeNode();
|
|
9614
|
-
if (this.isContextual(
|
|
9761
|
+
if (this.isContextual(115) && !this.hasPrecedingLineBreak()) return this.tsParseThisTypePredicate(thisKeyword);
|
|
9615
9762
|
else return thisKeyword;
|
|
9616
9763
|
}
|
|
9617
9764
|
tsParseNonArrayType() {
|
|
9618
9765
|
switch (this.state.type) {
|
|
9619
|
-
case 131:
|
|
9620
|
-
case 132:
|
|
9621
9766
|
case 133:
|
|
9767
|
+
case 134:
|
|
9768
|
+
case 135:
|
|
9622
9769
|
case 81:
|
|
9623
9770
|
case 82: return this.tsParseLiteralTypeNode();
|
|
9624
9771
|
case 49:
|
|
9625
9772
|
if (this.state.value === "-") {
|
|
9626
9773
|
const node = this.startNode();
|
|
9627
9774
|
const nextToken = this.lookahead();
|
|
9628
|
-
if (nextToken.type !==
|
|
9775
|
+
if (nextToken.type !== 134 && nextToken.type !== 135) this.unexpected();
|
|
9629
9776
|
node.literal = this.parseMaybeUnary();
|
|
9630
9777
|
return this.finishNode(node, "TSLiteralType");
|
|
9631
9778
|
}
|
|
@@ -9698,7 +9845,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9698
9845
|
}
|
|
9699
9846
|
tsParseInferType() {
|
|
9700
9847
|
const node = this.startNode();
|
|
9701
|
-
this.expectContextual(
|
|
9848
|
+
this.expectContextual(114);
|
|
9702
9849
|
const typeParameter = this.startNode();
|
|
9703
9850
|
typeParameter.name = this.tsParseTypeParameterName();
|
|
9704
9851
|
typeParameter.constraint = this.tsTryParse(() => this.tsParseConstraintForInferType());
|
|
@@ -9712,7 +9859,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9712
9859
|
}
|
|
9713
9860
|
}
|
|
9714
9861
|
tsParseTypeOperatorOrHigher() {
|
|
9715
|
-
return tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc ? this.tsParseTypeOperator() : this.isContextual(
|
|
9862
|
+
return tokenIsTSTypeOperator(this.state.type) && !this.state.containsEsc ? this.tsParseTypeOperator() : this.isContextual(114) ? this.tsParseInferType() : this.tsInAllowConditionalTypesContext(() => this.tsParseArrayTypeOrHigher());
|
|
9716
9863
|
}
|
|
9717
9864
|
tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
|
|
9718
9865
|
const node = this.startNode();
|
|
@@ -9817,13 +9964,13 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9817
9964
|
}
|
|
9818
9965
|
tsParseTypePredicatePrefix() {
|
|
9819
9966
|
const id = this.parseIdentifier();
|
|
9820
|
-
if (this.isContextual(
|
|
9967
|
+
if (this.isContextual(115) && !this.hasPrecedingLineBreak()) {
|
|
9821
9968
|
this.next();
|
|
9822
9969
|
return id;
|
|
9823
9970
|
}
|
|
9824
9971
|
}
|
|
9825
9972
|
tsParseTypePredicateAsserts() {
|
|
9826
|
-
if (this.state.type !==
|
|
9973
|
+
if (this.state.type !== 108) return false;
|
|
9827
9974
|
const containsEsc = this.state.containsEsc;
|
|
9828
9975
|
this.next();
|
|
9829
9976
|
if (!tokenIsIdentifier(this.state.type) && !this.match(74)) return false;
|
|
@@ -9851,7 +9998,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9851
9998
|
return this.finishNode(node, "TSConditionalType");
|
|
9852
9999
|
}
|
|
9853
10000
|
isAbstractConstructorSignature() {
|
|
9854
|
-
return this.isContextual(
|
|
10001
|
+
return this.isContextual(123) && this.isLookaheadContextual("new");
|
|
9855
10002
|
}
|
|
9856
10003
|
tsParseNonConditionalType() {
|
|
9857
10004
|
if (this.tsIsStartOfFunctionType()) return this.tsParseFunctionOrConstructorType("TSFunctionType");
|
|
@@ -9891,7 +10038,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9891
10038
|
}
|
|
9892
10039
|
tsParseInterfaceDeclaration(node, properties = {}) {
|
|
9893
10040
|
if (this.hasFollowingLineBreak()) return null;
|
|
9894
|
-
this.expectContextual(
|
|
10041
|
+
this.expectContextual(128);
|
|
9895
10042
|
if (properties.declare) node.declare = true;
|
|
9896
10043
|
if (tokenIsIdentifier(this.state.type)) {
|
|
9897
10044
|
node.id = this.parseIdentifier();
|
|
@@ -9913,7 +10060,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9913
10060
|
node.typeAnnotation = this.tsInType(() => {
|
|
9914
10061
|
node.typeParameters = this.tsTryParseTypeParameters(this.tsParseInOutModifiers);
|
|
9915
10062
|
this.expect(25);
|
|
9916
|
-
if (this.isContextual(
|
|
10063
|
+
if (this.isContextual(113) && this.lookaheadCharCode() !== 46) {
|
|
9917
10064
|
const node = this.startNode();
|
|
9918
10065
|
this.next();
|
|
9919
10066
|
return this.finishNode(node, "TSIntrinsicKeyword");
|
|
@@ -9978,14 +10125,14 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
9978
10125
|
}
|
|
9979
10126
|
tsParseEnumMember() {
|
|
9980
10127
|
const node = this.startNode();
|
|
9981
|
-
node.id = this.match(
|
|
10128
|
+
node.id = this.match(133) ? super.parseStringLiteral(this.state.value) : this.parseIdentifier(true);
|
|
9982
10129
|
if (this.eat(25)) node.initializer = super.parseMaybeAssignAllowIn();
|
|
9983
10130
|
return this.finishNode(node, "TSEnumMember");
|
|
9984
10131
|
}
|
|
9985
10132
|
tsParseEnumDeclaration(node, properties = {}) {
|
|
9986
10133
|
if (properties.const) node.const = true;
|
|
9987
10134
|
if (properties.declare) node.declare = true;
|
|
9988
|
-
this.expectContextual(
|
|
10135
|
+
this.expectContextual(125);
|
|
9989
10136
|
node.id = this.parseIdentifier();
|
|
9990
10137
|
this.checkIdentifier(node.id, node.const ? 8971 : 8459);
|
|
9991
10138
|
node.body = this.tsParseEnumBody();
|
|
@@ -10017,14 +10164,14 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10017
10164
|
return this.finishNode(node, "TSModuleDeclaration");
|
|
10018
10165
|
}
|
|
10019
10166
|
tsParseAmbientExternalModuleDeclaration(node) {
|
|
10020
|
-
const isGlobal = this.isContextual(
|
|
10167
|
+
const isGlobal = this.isContextual(111);
|
|
10021
10168
|
if (isGlobal) {
|
|
10022
10169
|
node.kind = "global";
|
|
10023
10170
|
node.id = this.parseIdentifier();
|
|
10024
10171
|
} else {
|
|
10025
10172
|
node.kind = "module";
|
|
10026
10173
|
const { type, value } = this.state;
|
|
10027
|
-
if (type ===
|
|
10174
|
+
if (type === 133) node.id = super.parseStringLiteral(value);
|
|
10028
10175
|
else if (tokenIsIdentifier(type)) {
|
|
10029
10176
|
this.raise(TSErrors.InlineModuleDeclarationMustUseString, this.state.startLoc);
|
|
10030
10177
|
node.id = this.tsParseEntityName(0);
|
|
@@ -10054,16 +10201,16 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10054
10201
|
return this.finishNode(node, "TSImportEqualsDeclaration");
|
|
10055
10202
|
}
|
|
10056
10203
|
tsIsExternalModuleReference() {
|
|
10057
|
-
return this.isContextual(
|
|
10204
|
+
return this.isContextual(118) && this.lookaheadCharCode() === 40;
|
|
10058
10205
|
}
|
|
10059
10206
|
tsParseModuleReference() {
|
|
10060
10207
|
return this.tsIsExternalModuleReference() ? this.tsParseExternalModuleReference() : this.tsParseEntityName(0);
|
|
10061
10208
|
}
|
|
10062
10209
|
tsParseExternalModuleReference() {
|
|
10063
10210
|
const node = this.startNode();
|
|
10064
|
-
this.expectContextual(
|
|
10211
|
+
this.expectContextual(118);
|
|
10065
10212
|
this.expect(6);
|
|
10066
|
-
if (!this.match(
|
|
10213
|
+
if (!this.match(133)) this.unexpected();
|
|
10067
10214
|
node.expression = super.parseExprAtom();
|
|
10068
10215
|
this.expect(7);
|
|
10069
10216
|
this.sawUnambiguousESM = true;
|
|
@@ -10098,8 +10245,8 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10098
10245
|
case 76:
|
|
10099
10246
|
node.declare = true;
|
|
10100
10247
|
return this.parseClass(node, true, false);
|
|
10101
|
-
case
|
|
10102
|
-
case
|
|
10248
|
+
case 125: return this.tsParseEnumDeclaration(node, { declare: true });
|
|
10249
|
+
case 111: return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
10103
10250
|
case 97: if (this.state.containsEsc) return;
|
|
10104
10251
|
case 71:
|
|
10105
10252
|
case 70:
|
|
@@ -10112,7 +10259,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10112
10259
|
const: true,
|
|
10113
10260
|
declare: true
|
|
10114
10261
|
});
|
|
10115
|
-
case
|
|
10262
|
+
case 106:
|
|
10116
10263
|
if (this.isUsing()) {
|
|
10117
10264
|
this.raise(TSErrors.InvalidModifierOnUsingDeclaration, this.state.startLoc, "declare");
|
|
10118
10265
|
node.declare = true;
|
|
@@ -10127,7 +10274,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10127
10274
|
return this.parseVarStatement(node, "await using", true);
|
|
10128
10275
|
}
|
|
10129
10276
|
break;
|
|
10130
|
-
case
|
|
10277
|
+
case 128: {
|
|
10131
10278
|
const result = this.tsParseInterfaceDeclaration(node, { declare: true });
|
|
10132
10279
|
if (result) return result;
|
|
10133
10280
|
}
|
|
@@ -10140,19 +10287,19 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10140
10287
|
}
|
|
10141
10288
|
tsParseDeclaration(node, type, next, decorators) {
|
|
10142
10289
|
switch (type) {
|
|
10143
|
-
case
|
|
10290
|
+
case 123:
|
|
10144
10291
|
if (this.tsCheckLineTerminator(next) && (this.match(76) || tokenIsIdentifier(this.state.type))) return this.tsParseAbstractDeclaration(node, decorators);
|
|
10145
10292
|
break;
|
|
10146
|
-
case
|
|
10293
|
+
case 126:
|
|
10147
10294
|
if (this.tsCheckLineTerminator(next)) return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
10148
10295
|
break;
|
|
10149
|
-
case
|
|
10296
|
+
case 127:
|
|
10150
10297
|
if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) {
|
|
10151
10298
|
node.kind = "namespace";
|
|
10152
10299
|
return this.tsParseNamespaceDeclaration(node);
|
|
10153
10300
|
}
|
|
10154
10301
|
break;
|
|
10155
|
-
case
|
|
10302
|
+
case 129: if (this.tsCheckLineTerminator(next) && tokenIsIdentifier(this.state.type)) return this.tsParseTypeAliasDeclaration(node);
|
|
10156
10303
|
}
|
|
10157
10304
|
}
|
|
10158
10305
|
tsCheckLineTerminator(next) {
|
|
@@ -10316,7 +10463,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10316
10463
|
return this.finishCallExpression(node, state.optionalChainMember);
|
|
10317
10464
|
}
|
|
10318
10465
|
const tokenType = this.state.type;
|
|
10319
|
-
if (tokenType === 44 || tokenType === 48 || tokenType !== 6 && tokenType !== 90 && tokenType !==
|
|
10466
|
+
if (tokenType === 44 || tokenType === 48 || tokenType !== 6 && tokenType !== 90 && tokenType !== 119 && tokenCanStartExpression(tokenType) && !this.hasPrecedingLineBreak()) return;
|
|
10320
10467
|
const node = this.startNodeAt(startLoc);
|
|
10321
10468
|
node.expression = base;
|
|
10322
10469
|
node.typeArguments = typeArguments;
|
|
@@ -10343,7 +10490,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10343
10490
|
}
|
|
10344
10491
|
parseExprOp(left, leftStartLoc, minPrec) {
|
|
10345
10492
|
let isSatisfies;
|
|
10346
|
-
if (tokenOperatorPrecedence(54) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(90) || (isSatisfies = this.isContextual(
|
|
10493
|
+
if (tokenOperatorPrecedence(54) > minPrec && !this.hasPrecedingLineBreak() && (this.isContextual(90) || (isSatisfies = this.isContextual(119)))) {
|
|
10347
10494
|
const node = this.startNodeAt(leftStartLoc);
|
|
10348
10495
|
node.expression = left;
|
|
10349
10496
|
node.typeAnnotation = this.tsInType(() => {
|
|
@@ -10366,7 +10513,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10366
10513
|
checkDuplicateExports() {}
|
|
10367
10514
|
isPotentialImportPhase(isExport) {
|
|
10368
10515
|
if (super.isPotentialImportPhase(isExport)) return true;
|
|
10369
|
-
if (this.isContextual(
|
|
10516
|
+
if (this.isContextual(129)) {
|
|
10370
10517
|
const ch = this.lookaheadCharCode();
|
|
10371
10518
|
return isExport ? ch === 123 || ch === 42 : ch !== 61;
|
|
10372
10519
|
}
|
|
@@ -10378,7 +10525,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10378
10525
|
else node.importKind = phase === "type" || phase === "typeof" ? phase : "value";
|
|
10379
10526
|
}
|
|
10380
10527
|
parseImport(node) {
|
|
10381
|
-
if (this.match(
|
|
10528
|
+
if (this.match(133)) {
|
|
10382
10529
|
node.importKind = "value";
|
|
10383
10530
|
if (this.scope.inTSNamespace) this.raise(TSErrors.ImportInTSNamespace, node);
|
|
10384
10531
|
return super.parseImport(node);
|
|
@@ -10389,7 +10536,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10389
10536
|
const result = this.tsParseImportEqualsDeclaration(node);
|
|
10390
10537
|
if (this.scope.inTSNamespace && result.moduleReference.type === "TSExternalModuleReference") this.raise(TSErrors.ImportInTSNamespace, node);
|
|
10391
10538
|
return result;
|
|
10392
|
-
} else if (this.isContextual(
|
|
10539
|
+
} else if (this.isContextual(129)) {
|
|
10393
10540
|
const maybeDefaultIdentifier = this.parseMaybeImportPhase(node, false);
|
|
10394
10541
|
if (this.lookaheadCharCode() === 61) {
|
|
10395
10542
|
if (this.scope.inTSNamespace) this.raise(TSErrors.ImportInTSNamespace, node);
|
|
@@ -10405,7 +10552,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10405
10552
|
const nodeImportEquals = this.startNode();
|
|
10406
10553
|
this.next();
|
|
10407
10554
|
let maybeDefaultIdentifier = null;
|
|
10408
|
-
if (this.isContextual(
|
|
10555
|
+
if (this.isContextual(129) && this.isPotentialImportPhase(false)) maybeDefaultIdentifier = this.parseMaybeImportPhase(nodeImportEquals, false);
|
|
10409
10556
|
else nodeImportEquals.importKind = "value";
|
|
10410
10557
|
const declaration = this.tsParseImportEqualsDeclaration(nodeImportEquals, maybeDefaultIdentifier);
|
|
10411
10558
|
node.attributes = [];
|
|
@@ -10423,7 +10570,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10423
10570
|
return this.finishNode(assign, "TSExportAssignment");
|
|
10424
10571
|
} else if (this.eatContextual(90)) {
|
|
10425
10572
|
const decl = node;
|
|
10426
|
-
this.expectContextual(
|
|
10573
|
+
this.expectContextual(127);
|
|
10427
10574
|
decl.id = this.parseIdentifier();
|
|
10428
10575
|
this.checkIdentifier(decl.id, 8201);
|
|
10429
10576
|
this.semicolon();
|
|
@@ -10436,7 +10583,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10436
10583
|
}
|
|
10437
10584
|
}
|
|
10438
10585
|
isAbstractClass() {
|
|
10439
|
-
return this.isContextual(
|
|
10586
|
+
return this.isContextual(123) && this.isLookaheadContextual("class");
|
|
10440
10587
|
}
|
|
10441
10588
|
parseExportDefaultExpression() {
|
|
10442
10589
|
if (this.isAbstractClass()) {
|
|
@@ -10445,7 +10592,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10445
10592
|
cls.abstract = true;
|
|
10446
10593
|
return this.parseClass(cls, true, true);
|
|
10447
10594
|
}
|
|
10448
|
-
if (this.match(
|
|
10595
|
+
if (this.match(128)) {
|
|
10449
10596
|
const result = this.tsParseInterfaceDeclaration(this.startNode());
|
|
10450
10597
|
if (result) return result;
|
|
10451
10598
|
}
|
|
@@ -10481,31 +10628,31 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10481
10628
|
return this.tsParseEnumDeclaration(node, { const: true });
|
|
10482
10629
|
}
|
|
10483
10630
|
break;
|
|
10484
|
-
case
|
|
10485
|
-
case
|
|
10631
|
+
case 123:
|
|
10632
|
+
case 124:
|
|
10486
10633
|
if (this.nextTokenIsIdentifierAndNotTSRelationalOperatorOnSameLine()) {
|
|
10487
10634
|
const token = this.state.type;
|
|
10488
10635
|
const node = this.startNode();
|
|
10489
10636
|
this.next();
|
|
10490
|
-
const declaration = token ===
|
|
10637
|
+
const declaration = token === 124 ? this.tsTryParseDeclare(node) : this.tsParseAbstractDeclaration(node, decorators);
|
|
10491
10638
|
if (declaration) {
|
|
10492
|
-
if (token ===
|
|
10639
|
+
if (token === 124) declaration.declare = true;
|
|
10493
10640
|
return declaration;
|
|
10494
10641
|
} else {
|
|
10495
|
-
node.expression = this.createIdentifier(this.startNodeAtNode(node), token ===
|
|
10642
|
+
node.expression = this.createIdentifier(this.startNodeAtNode(node), token === 124 ? "declare" : "abstract");
|
|
10496
10643
|
this.semicolon(false);
|
|
10497
10644
|
return this.finishNode(node, "ExpressionStatement");
|
|
10498
10645
|
}
|
|
10499
10646
|
}
|
|
10500
10647
|
break;
|
|
10501
|
-
case
|
|
10502
|
-
case
|
|
10648
|
+
case 125: return this.tsParseEnumDeclaration(this.startNode());
|
|
10649
|
+
case 111:
|
|
10503
10650
|
if (this.lookaheadCharCode() === 123) {
|
|
10504
10651
|
const node = this.startNode();
|
|
10505
10652
|
return this.tsParseAmbientExternalModuleDeclaration(node);
|
|
10506
10653
|
}
|
|
10507
10654
|
break;
|
|
10508
|
-
case
|
|
10655
|
+
case 128: {
|
|
10509
10656
|
const result = this.tsParseInterfaceDeclaration(this.startNode());
|
|
10510
10657
|
if (result) {
|
|
10511
10658
|
if (!allowDeclaration) this.raise(TSErrors.UnexpectedTypeDeclaration, result, "interface");
|
|
@@ -10513,26 +10660,26 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10513
10660
|
}
|
|
10514
10661
|
break;
|
|
10515
10662
|
}
|
|
10516
|
-
case
|
|
10663
|
+
case 126:
|
|
10517
10664
|
if (this.nextTokenIsStringLiteralOnSameLine()) {
|
|
10518
10665
|
const node = this.startNode();
|
|
10519
10666
|
this.next();
|
|
10520
|
-
return this.tsParseDeclaration(node,
|
|
10667
|
+
return this.tsParseDeclaration(node, 126, false, decorators);
|
|
10521
10668
|
} else if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
10522
10669
|
this.raise(TSErrors.InlineModuleDeclarationMustUseString, this.state.startLoc);
|
|
10523
10670
|
const node = this.startNode();
|
|
10524
10671
|
this.next();
|
|
10525
|
-
return this.tsParseDeclaration(node,
|
|
10672
|
+
return this.tsParseDeclaration(node, 127, false, decorators);
|
|
10526
10673
|
}
|
|
10527
10674
|
break;
|
|
10528
|
-
case
|
|
10675
|
+
case 127:
|
|
10529
10676
|
if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
10530
10677
|
const node = this.startNode();
|
|
10531
10678
|
this.next();
|
|
10532
|
-
return this.tsParseDeclaration(node,
|
|
10679
|
+
return this.tsParseDeclaration(node, 127, false, decorators);
|
|
10533
10680
|
}
|
|
10534
10681
|
break;
|
|
10535
|
-
case
|
|
10682
|
+
case 129: if (this.nextTokenIsIdentifierOnSameLine()) {
|
|
10536
10683
|
const node = this.startNode();
|
|
10537
10684
|
if (!allowDeclaration) this.raise(TSErrors.UnexpectedTypeDeclaration, node, "type");
|
|
10538
10685
|
this.next();
|
|
@@ -10639,10 +10786,10 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10639
10786
|
return node;
|
|
10640
10787
|
}
|
|
10641
10788
|
parseExportDeclaration(node) {
|
|
10642
|
-
if (!this.state.isAmbientContext && this.isContextual(
|
|
10789
|
+
if (!this.state.isAmbientContext && this.isContextual(124)) return this.tsInAmbientContext(() => this.parseExportDeclaration(node));
|
|
10643
10790
|
const startLoc = this.state.startLoc;
|
|
10644
|
-
const isDeclare = this.eatContextual(
|
|
10645
|
-
if (isDeclare && (this.isContextual(
|
|
10791
|
+
const isDeclare = this.eatContextual(124);
|
|
10792
|
+
if (isDeclare && (this.isContextual(124) || !this.shouldParseExportDeclaration())) throw this.raise(TSErrors.ExpectedAmbientAfterExportDeclare, this.state.startLoc);
|
|
10646
10793
|
const declaration = tokenIsIdentifier(this.state.type) && this.tsTryParseExportDeclaration() || super.parseExportDeclaration(node);
|
|
10647
10794
|
if (!declaration) return null;
|
|
10648
10795
|
if (declaration.type === "TSInterfaceDeclaration" || declaration.type === "TSTypeAliasDeclaration" || isDeclare) node.exportKind = "type";
|
|
@@ -10653,7 +10800,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10653
10800
|
return declaration;
|
|
10654
10801
|
}
|
|
10655
10802
|
parseClassId(node, isStatement, optionalId, bindingType) {
|
|
10656
|
-
if ((!isStatement || optionalId) && this.isContextual(
|
|
10803
|
+
if ((!isStatement || optionalId) && this.isContextual(112)) {
|
|
10657
10804
|
node.id = null;
|
|
10658
10805
|
return;
|
|
10659
10806
|
}
|
|
@@ -10724,7 +10871,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10724
10871
|
node.superTypeArguments = superTypeArguments;
|
|
10725
10872
|
} else if (this.match(43) || this.match(47)) node.superTypeArguments = this.tsParseTypeArgumentsInExpression();
|
|
10726
10873
|
}
|
|
10727
|
-
if (this.eatContextual(
|
|
10874
|
+
if (this.eatContextual(112)) node.implements = this.tsParseHeritageClause("implements");
|
|
10728
10875
|
}
|
|
10729
10876
|
parseObjPropValue(prop, startLoc, isGenerator, isAsync, isPattern, isAccessor, refExpressionErrors) {
|
|
10730
10877
|
const typeParameters = this.tsTryParseTypeParameters(this.tsParseConstModifier);
|
|
@@ -10753,7 +10900,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
10753
10900
|
let state;
|
|
10754
10901
|
let jsx;
|
|
10755
10902
|
let typeCast;
|
|
10756
|
-
if (this.hasPlugin("jsx") && (this.match(
|
|
10903
|
+
if (this.hasPlugin("jsx") && (this.match(141) || this.match(43))) {
|
|
10757
10904
|
state = this.state.clone();
|
|
10758
10905
|
jsx = this.tryParse(() => super.parseMaybeAssign(refExpressionErrors, isParenItem), state);
|
|
10759
10906
|
if (!jsx.error) return jsx.node;
|
|
@@ -11012,7 +11159,7 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
11012
11159
|
if (this.match(76)) {
|
|
11013
11160
|
node.abstract = true;
|
|
11014
11161
|
return this.maybeTakeDecorators(decorators, this.parseClass(node, true, false));
|
|
11015
|
-
} else if (this.isContextual(
|
|
11162
|
+
} else if (this.isContextual(128)) {
|
|
11016
11163
|
if (!this.hasFollowingLineBreak()) {
|
|
11017
11164
|
node.abstract = true;
|
|
11018
11165
|
this.raise(TSErrors.NonClassMethodPropertyHasAbstractModifier, node);
|
|
@@ -11053,15 +11200,20 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
11053
11200
|
node.exportKind = "value";
|
|
11054
11201
|
return super.parseExportSpecifier(node, isString, isInTypeExport, isMaybeTypeOnly);
|
|
11055
11202
|
}
|
|
11056
|
-
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly
|
|
11203
|
+
parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly) {
|
|
11057
11204
|
if (!importedIsString && isMaybeTypeOnly) {
|
|
11058
|
-
this.parseTypeOnlyImportSpecifier(specifier
|
|
11205
|
+
this.parseTypeOnlyImportSpecifier(specifier);
|
|
11059
11206
|
return this.finishNode(specifier, "ImportSpecifier");
|
|
11060
11207
|
}
|
|
11061
11208
|
specifier.importKind = "value";
|
|
11062
|
-
return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly
|
|
11209
|
+
return super.parseImportSpecifier(specifier, importedIsString, isInTypeOnlyImport, isMaybeTypeOnly);
|
|
11063
11210
|
}
|
|
11064
|
-
|
|
11211
|
+
checkImportSpecifier(specifier, isInTypeOnlyImport) {
|
|
11212
|
+
const hasTypeSpecifier = specifier.importKind === "type";
|
|
11213
|
+
if (hasTypeSpecifier && isInTypeOnlyImport) this.raise(TSErrors.TypeModifierIsUsedInTypeImports, specifier);
|
|
11214
|
+
super.checkImportSpecifier(specifier, isInTypeOnlyImport, hasTypeSpecifier || isInTypeOnlyImport ? 4098 : 4096);
|
|
11215
|
+
}
|
|
11216
|
+
parseTypeOnlyImportSpecifier(node) {
|
|
11065
11217
|
let leftOfAs = node.imported;
|
|
11066
11218
|
let hasTypeSpecifier = false;
|
|
11067
11219
|
if (this.isContextual(90)) {
|
|
@@ -11081,12 +11233,10 @@ const typescript = (superClass) => class TypeScriptParserMixin extends superClas
|
|
|
11081
11233
|
} else if (tokenIsKeywordOrIdentifier(this.state.type)) {
|
|
11082
11234
|
hasTypeSpecifier = true;
|
|
11083
11235
|
leftOfAs = this.parseIdentifier(true);
|
|
11084
|
-
if (!this.isContextual(90)) this.checkReservedWord(leftOfAs.name, leftOfAs.start, true, true);
|
|
11085
11236
|
}
|
|
11086
|
-
if (hasTypeSpecifier && isInTypeOnly) this.raise(TSErrors.TypeModifierIsUsedInTypeImports, node.imported);
|
|
11087
11237
|
node.imported = leftOfAs;
|
|
11088
11238
|
node.importKind = hasTypeSpecifier ? "type" : "value";
|
|
11089
|
-
|
|
11239
|
+
node.local ??= this.eatContextual(90) ? this.parseIdentifier() : this.cloneIdentifier(node.imported);
|
|
11090
11240
|
}
|
|
11091
11241
|
parseTypeOnlyExportSpecifier(node, isInTypeOnly) {
|
|
11092
11242
|
const local = node.local;
|
|
@@ -11289,13 +11439,13 @@ const PlaceholderErrors = ParseErrorEnum`placeholders`({
|
|
|
11289
11439
|
});
|
|
11290
11440
|
const placeholders = (superClass) => class PlaceholdersParserMixin extends superClass {
|
|
11291
11441
|
parsePlaceholder(expectedNode) {
|
|
11292
|
-
if (this.match(
|
|
11442
|
+
if (this.match(132)) {
|
|
11293
11443
|
const node = this.startNode();
|
|
11294
11444
|
this.next();
|
|
11295
11445
|
this.assertNoSpace();
|
|
11296
11446
|
node.name = super.parseIdentifier(true);
|
|
11297
11447
|
this.assertNoSpace();
|
|
11298
|
-
this.expect(
|
|
11448
|
+
this.expect(132);
|
|
11299
11449
|
return this.finishPlaceholder(node, expectedNode);
|
|
11300
11450
|
}
|
|
11301
11451
|
}
|
|
@@ -11306,7 +11456,7 @@ const placeholders = (superClass) => class PlaceholdersParserMixin extends super
|
|
|
11306
11456
|
return placeholder;
|
|
11307
11457
|
}
|
|
11308
11458
|
getTokenFromCode(code) {
|
|
11309
|
-
if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) this.finishOp(
|
|
11459
|
+
if (code === 37 && this.input.charCodeAt(this.state.pos + 1) === 37) this.finishOp(132, 2);
|
|
11310
11460
|
else super.getTokenFromCode(code);
|
|
11311
11461
|
}
|
|
11312
11462
|
parseExprAtom(refExpressionErrors) {
|
|
@@ -11373,7 +11523,7 @@ const placeholders = (superClass) => class PlaceholdersParserMixin extends super
|
|
|
11373
11523
|
const oldStrict = this.state.strict;
|
|
11374
11524
|
const placeholder = this.parsePlaceholder("Identifier");
|
|
11375
11525
|
if (placeholder) {
|
|
11376
|
-
if (this.match(77) || this.match(
|
|
11526
|
+
if (this.match(77) || this.match(132) || this.match(2)) node.id = placeholder;
|
|
11377
11527
|
else if (optionalId || !isStatement) {
|
|
11378
11528
|
node.id = null;
|
|
11379
11529
|
node.body = this.finishPlaceholder(placeholder, "ClassBody");
|
|
@@ -11404,7 +11554,7 @@ const placeholders = (superClass) => class PlaceholdersParserMixin extends super
|
|
|
11404
11554
|
if (this.match(61)) {
|
|
11405
11555
|
const next = this.nextTokenStart();
|
|
11406
11556
|
if (this.isUnparsedContextual(next, "from")) {
|
|
11407
|
-
if (this.input.startsWith(tokenLabelName(
|
|
11557
|
+
if (this.input.startsWith(tokenLabelName(132), this.hasPlugin("exportDefaultFrom") ? this.nextTokenStartSince(next + 4) : this.nextTokenInLineStartSince(next + 4))) return true;
|
|
11408
11558
|
}
|
|
11409
11559
|
}
|
|
11410
11560
|
return super.isExportDefaultSpecifier();
|
|
@@ -11427,7 +11577,7 @@ const placeholders = (superClass) => class PlaceholdersParserMixin extends super
|
|
|
11427
11577
|
specifier.local = placeholder;
|
|
11428
11578
|
node.specifiers.push(this.finishNode(specifier, "ImportDefaultSpecifier"));
|
|
11429
11579
|
if (this.eat(8)) {
|
|
11430
|
-
if (!this.maybeParseStarImportSpecifier(node)) this.
|
|
11580
|
+
if (!this.maybeParseStarImportSpecifier(node)) this.parseNamedOrFilteredImportSpecifiers(node);
|
|
11431
11581
|
}
|
|
11432
11582
|
this.expectContextual(95);
|
|
11433
11583
|
node.source = this.parseImportSource();
|
|
@@ -11505,6 +11655,7 @@ function validatePlugins(pluginsMap) {
|
|
|
11505
11655
|
if (pluginsMap.has("discardBinding") && pluginsMap.get("discardBinding").syntaxType !== "void") throw new Error("The 'discardBinding' plugin requires a 'syntaxType' option. Currently the only supported value is 'void'.");
|
|
11506
11656
|
if (pluginsMap.has("decimal")) throw new Error("The 'decimal' plugin has been removed in Babel 8. Please remove it from your configuration.");
|
|
11507
11657
|
if (pluginsMap.has("importReflection")) throw new Error("The 'importReflection' plugin has been removed in Babel 8. Use 'sourcePhaseImports' instead, and replace 'import module' with 'import source' in your code.");
|
|
11658
|
+
if (pluginsMap.has("deferredReexports") && !pluginsMap.has("deferredImportEvaluation")) throw new Error("The 'deferredReexports' plugin requires 'deferredImportEvaluation'.");
|
|
11508
11659
|
}
|
|
11509
11660
|
const mixinPlugins = {
|
|
11510
11661
|
estree,
|
|
@@ -13218,7 +13369,7 @@ function readCodePoint(input, pos, lineStart, curLine, throwOnInvalid, errors) {
|
|
|
13218
13369
|
};
|
|
13219
13370
|
}
|
|
13220
13371
|
//#endregion
|
|
13221
|
-
//#region node_modules/.pnpm/@babel+types@8.0
|
|
13372
|
+
//#region node_modules/.pnpm/@babel+types@8.1.0/node_modules/@babel/types/lib/index.js
|
|
13222
13373
|
var lib_exports = /* @__PURE__ */ __exportAll({
|
|
13223
13374
|
ACCESSOR_TYPES: () => ACCESSOR_TYPES,
|
|
13224
13375
|
ALIAS_KEYS: () => ALIAS_KEYS,
|
|
@@ -13437,6 +13588,8 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
13437
13588
|
StringLiteral: () => StringLiteral$2,
|
|
13438
13589
|
StringLiteralTypeAnnotation: () => StringLiteralTypeAnnotation,
|
|
13439
13590
|
StringTypeAnnotation: () => StringTypeAnnotation$1,
|
|
13591
|
+
StructBody: () => StructBody,
|
|
13592
|
+
StructDeclaration: () => StructDeclaration$1,
|
|
13440
13593
|
Super: () => Super$1,
|
|
13441
13594
|
SwitchCase: () => SwitchCase$1,
|
|
13442
13595
|
SwitchStatement: () => SwitchStatement$1,
|
|
@@ -13755,6 +13908,8 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
13755
13908
|
assertStringLiteral: () => assertStringLiteral,
|
|
13756
13909
|
assertStringLiteralTypeAnnotation: () => assertStringLiteralTypeAnnotation,
|
|
13757
13910
|
assertStringTypeAnnotation: () => assertStringTypeAnnotation,
|
|
13911
|
+
assertStructBody: () => assertStructBody,
|
|
13912
|
+
assertStructDeclaration: () => assertStructDeclaration,
|
|
13758
13913
|
assertSuper: () => assertSuper,
|
|
13759
13914
|
assertSwitchCase: () => assertSwitchCase,
|
|
13760
13915
|
assertSwitchStatement: () => assertSwitchStatement,
|
|
@@ -14049,7 +14204,7 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
14049
14204
|
isExportDefaultDeclaration: () => isExportDefaultDeclaration$2,
|
|
14050
14205
|
isExportDefaultSpecifier: () => isExportDefaultSpecifier$1,
|
|
14051
14206
|
isExportNamedDeclaration: () => isExportNamedDeclaration$3,
|
|
14052
|
-
isExportNamespaceSpecifier: () => isExportNamespaceSpecifier$
|
|
14207
|
+
isExportNamespaceSpecifier: () => isExportNamespaceSpecifier$2,
|
|
14053
14208
|
isExportSpecifier: () => isExportSpecifier,
|
|
14054
14209
|
isExpression: () => isExpression$5,
|
|
14055
14210
|
isExpressionStatement: () => isExpressionStatement$2,
|
|
@@ -14175,6 +14330,8 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
14175
14330
|
isStringLiteral: () => isStringLiteral$3,
|
|
14176
14331
|
isStringLiteralTypeAnnotation: () => isStringLiteralTypeAnnotation,
|
|
14177
14332
|
isStringTypeAnnotation: () => isStringTypeAnnotation$1,
|
|
14333
|
+
isStructBody: () => isStructBody,
|
|
14334
|
+
isStructDeclaration: () => isStructDeclaration,
|
|
14178
14335
|
isSuper: () => isSuper$2,
|
|
14179
14336
|
isSwitchCase: () => isSwitchCase,
|
|
14180
14337
|
isSwitchStatement: () => isSwitchStatement,
|
|
@@ -14356,6 +14513,8 @@ var lib_exports = /* @__PURE__ */ __exportAll({
|
|
|
14356
14513
|
stringLiteral: () => stringLiteral$2,
|
|
14357
14514
|
stringLiteralTypeAnnotation: () => stringLiteralTypeAnnotation,
|
|
14358
14515
|
stringTypeAnnotation: () => stringTypeAnnotation$2,
|
|
14516
|
+
structBody: () => structBody,
|
|
14517
|
+
structDeclaration: () => structDeclaration,
|
|
14359
14518
|
super: () => _super$1,
|
|
14360
14519
|
switchCase: () => switchCase,
|
|
14361
14520
|
switchStatement: () => switchStatement,
|
|
@@ -14741,7 +14900,7 @@ function isImport(node, opts) {
|
|
|
14741
14900
|
function isBigIntLiteral(node, opts) {
|
|
14742
14901
|
return isType$1("BigIntLiteral", node, opts);
|
|
14743
14902
|
}
|
|
14744
|
-
function isExportNamespaceSpecifier$
|
|
14903
|
+
function isExportNamespaceSpecifier$2(node, opts) {
|
|
14745
14904
|
return isType$1("ExportNamespaceSpecifier", node, opts);
|
|
14746
14905
|
}
|
|
14747
14906
|
function isOptionalMemberExpression$1(node, opts) {
|
|
@@ -15044,6 +15203,12 @@ function isTopicReference$1(node, opts) {
|
|
|
15044
15203
|
function isVoidPattern$1(node, opts) {
|
|
15045
15204
|
return isType$1("VoidPattern", node, opts);
|
|
15046
15205
|
}
|
|
15206
|
+
function isStructDeclaration(node, opts) {
|
|
15207
|
+
return isType$1("StructDeclaration", node, opts);
|
|
15208
|
+
}
|
|
15209
|
+
function isStructBody(node, opts) {
|
|
15210
|
+
return isType$1("StructBody", node, opts);
|
|
15211
|
+
}
|
|
15047
15212
|
function isTSParameterProperty(node, opts) {
|
|
15048
15213
|
return isType$1("TSParameterProperty", node, opts);
|
|
15049
15214
|
}
|
|
@@ -15441,6 +15606,7 @@ function isScopable(node, opts) {
|
|
|
15441
15606
|
case "ClassMethod":
|
|
15442
15607
|
case "ClassPrivateMethod":
|
|
15443
15608
|
case "StaticBlock":
|
|
15609
|
+
case "StructDeclaration":
|
|
15444
15610
|
case "TSModuleBlock": break;
|
|
15445
15611
|
case "Placeholder": if (node.expectedNode === "BlockStatement") break;
|
|
15446
15612
|
default: return false;
|
|
@@ -15525,6 +15691,7 @@ function isStatement$6(node, opts) {
|
|
|
15525
15691
|
case "OpaqueType":
|
|
15526
15692
|
case "TypeAlias":
|
|
15527
15693
|
case "EnumDeclaration":
|
|
15694
|
+
case "StructDeclaration":
|
|
15528
15695
|
case "TSDeclareFunction":
|
|
15529
15696
|
case "TSInterfaceDeclaration":
|
|
15530
15697
|
case "TSTypeAliasDeclaration":
|
|
@@ -15697,6 +15864,7 @@ function isDeclaration(node, opts) {
|
|
|
15697
15864
|
case "OpaqueType":
|
|
15698
15865
|
case "TypeAlias":
|
|
15699
15866
|
case "EnumDeclaration":
|
|
15867
|
+
case "StructDeclaration":
|
|
15700
15868
|
case "TSDeclareFunction":
|
|
15701
15869
|
case "TSInterfaceDeclaration":
|
|
15702
15870
|
case "TSTypeAliasDeclaration":
|
|
@@ -17817,7 +17985,7 @@ defineType$4("ExportDefaultDeclaration", {
|
|
|
17817
17985
|
"ExportDeclaration"
|
|
17818
17986
|
],
|
|
17819
17987
|
fields: {
|
|
17820
|
-
declaration: validateType("FunctionDeclaration", "ClassDeclaration", "Expression", "TSDeclareFunction", "TSInterfaceDeclaration", "EnumDeclaration"),
|
|
17988
|
+
declaration: validateType("FunctionDeclaration", "ClassDeclaration", "Expression", "StructDeclaration", "TSDeclareFunction", "TSInterfaceDeclaration", "EnumDeclaration"),
|
|
17821
17989
|
exportKind: validateOptional(assertOneOf("value"))
|
|
17822
17990
|
}
|
|
17823
17991
|
});
|
|
@@ -17850,6 +18018,7 @@ defineType$4("ExportNamedDeclaration", {
|
|
|
17850
18018
|
"VariableDeclaration",
|
|
17851
18019
|
"FunctionDeclaration",
|
|
17852
18020
|
"ClassDeclaration",
|
|
18021
|
+
"StructDeclaration",
|
|
17853
18022
|
"TSDeclareFunction",
|
|
17854
18023
|
"TSEnumDeclaration",
|
|
17855
18024
|
"TSImportEqualsDeclaration",
|
|
@@ -17863,6 +18032,10 @@ defineType$4("ExportNamedDeclaration", {
|
|
|
17863
18032
|
] }))
|
|
17864
18033
|
},
|
|
17865
18034
|
...importAttributes,
|
|
18035
|
+
phase: {
|
|
18036
|
+
default: null,
|
|
18037
|
+
validate: assertOneOf("defer")
|
|
18038
|
+
},
|
|
17866
18039
|
specifiers: {
|
|
17867
18040
|
default: [],
|
|
17868
18041
|
validate: arrayOf(function() {
|
|
@@ -17980,9 +18153,16 @@ defineType$4("ImportDefaultSpecifier", {
|
|
|
17980
18153
|
fields: { local: { validate: assertNodeType("Identifier") } }
|
|
17981
18154
|
});
|
|
17982
18155
|
defineType$4("ImportNamespaceSpecifier", {
|
|
17983
|
-
visitor: ["local"],
|
|
18156
|
+
visitor: ["exportsFilter", "local"],
|
|
18157
|
+
builder: ["local"],
|
|
17984
18158
|
aliases: ["ModuleSpecifier"],
|
|
17985
|
-
fields: {
|
|
18159
|
+
fields: {
|
|
18160
|
+
local: { validate: assertNodeType("Identifier") },
|
|
18161
|
+
exportsFilter: {
|
|
18162
|
+
optional: true,
|
|
18163
|
+
validate: arrayOfType("Identifier", "StringLiteral")
|
|
18164
|
+
}
|
|
18165
|
+
}
|
|
17986
18166
|
});
|
|
17987
18167
|
defineType$4("ImportSpecifier", {
|
|
17988
18168
|
visitor: ["imported", "local"],
|
|
@@ -18211,6 +18391,10 @@ defineType$4("ImportExpression", {
|
|
|
18211
18391
|
default: null,
|
|
18212
18392
|
validate: assertOneOf("source", "defer")
|
|
18213
18393
|
},
|
|
18394
|
+
sync: {
|
|
18395
|
+
optional: true,
|
|
18396
|
+
validate: assertValueType("boolean")
|
|
18397
|
+
},
|
|
18214
18398
|
source: { validate: assertNodeType("Expression") },
|
|
18215
18399
|
options: {
|
|
18216
18400
|
validate: assertNodeType("Expression"),
|
|
@@ -18230,9 +18414,16 @@ defineType$4("BigIntLiteral", {
|
|
|
18230
18414
|
]
|
|
18231
18415
|
});
|
|
18232
18416
|
defineType$4("ExportNamespaceSpecifier", {
|
|
18233
|
-
visitor: ["exported"],
|
|
18417
|
+
visitor: ["exportsFilter", "exported"],
|
|
18418
|
+
builder: ["exported"],
|
|
18234
18419
|
aliases: ["ModuleSpecifier"],
|
|
18235
|
-
fields: {
|
|
18420
|
+
fields: {
|
|
18421
|
+
exported: { validate: assertNodeType("Identifier", "StringLiteral") },
|
|
18422
|
+
exportsFilter: {
|
|
18423
|
+
optional: true,
|
|
18424
|
+
validate: arrayOfType("Identifier", "StringLiteral")
|
|
18425
|
+
}
|
|
18426
|
+
}
|
|
18236
18427
|
});
|
|
18237
18428
|
defineType$4("OptionalMemberExpression", {
|
|
18238
18429
|
builder: [
|
|
@@ -19263,6 +19454,33 @@ defineType$5("VoidPattern", { aliases: [
|
|
|
19263
19454
|
"PatternLike",
|
|
19264
19455
|
"FunctionParameter"
|
|
19265
19456
|
] });
|
|
19457
|
+
defineType$5("StructDeclaration", {
|
|
19458
|
+
visitor: [
|
|
19459
|
+
"id",
|
|
19460
|
+
"superClass",
|
|
19461
|
+
"body"
|
|
19462
|
+
],
|
|
19463
|
+
aliases: [
|
|
19464
|
+
"Scopable",
|
|
19465
|
+
"Statement",
|
|
19466
|
+
"Declaration"
|
|
19467
|
+
],
|
|
19468
|
+
fields: {
|
|
19469
|
+
id: {
|
|
19470
|
+
validate: assertNodeType("Identifier"),
|
|
19471
|
+
optional: true
|
|
19472
|
+
},
|
|
19473
|
+
body: { validate: assertNodeType("StructBody") },
|
|
19474
|
+
superClass: {
|
|
19475
|
+
optional: true,
|
|
19476
|
+
validate: assertNodeType("Expression")
|
|
19477
|
+
}
|
|
19478
|
+
}
|
|
19479
|
+
});
|
|
19480
|
+
defineType$5("StructBody", {
|
|
19481
|
+
visitor: ["body"],
|
|
19482
|
+
fields: { body: validateArrayOfType("ClassMethod", "ClassPrivateMethod", "ClassProperty", "ClassPrivateProperty", "StaticBlock", "ClassAccessorProperty") }
|
|
19483
|
+
});
|
|
19266
19484
|
const defineType = defineAliasedType("TypeScript");
|
|
19267
19485
|
const bool = assertValueType("boolean");
|
|
19268
19486
|
const tSFunctionTypeAnnotationCommon = () => ({
|
|
@@ -21755,6 +21973,28 @@ function topicReference() {
|
|
|
21755
21973
|
function voidPattern() {
|
|
21756
21974
|
return { type: "VoidPattern" };
|
|
21757
21975
|
}
|
|
21976
|
+
function structDeclaration(id = null, superClass = null, body) {
|
|
21977
|
+
const node = {
|
|
21978
|
+
type: "StructDeclaration",
|
|
21979
|
+
id,
|
|
21980
|
+
superClass,
|
|
21981
|
+
body
|
|
21982
|
+
};
|
|
21983
|
+
const defs = NODE_FIELDS.StructDeclaration;
|
|
21984
|
+
validate$3(defs.id, node, "id", id, 1);
|
|
21985
|
+
validate$3(defs.superClass, node, "superClass", superClass, 1);
|
|
21986
|
+
validate$3(defs.body, node, "body", body, 1);
|
|
21987
|
+
return node;
|
|
21988
|
+
}
|
|
21989
|
+
function structBody(body) {
|
|
21990
|
+
const node = {
|
|
21991
|
+
type: "StructBody",
|
|
21992
|
+
body
|
|
21993
|
+
};
|
|
21994
|
+
const defs = NODE_FIELDS.StructBody;
|
|
21995
|
+
validate$3(defs.body, node, "body", body, 1);
|
|
21996
|
+
return node;
|
|
21997
|
+
}
|
|
21758
21998
|
function tsParameterProperty(parameter) {
|
|
21759
21999
|
const node = {
|
|
21760
22000
|
type: "TSParameterProperty",
|
|
@@ -22572,6 +22812,8 @@ const b = /*#__PURE__*/ Object.defineProperty({
|
|
|
22572
22812
|
stringLiteral: stringLiteral$2,
|
|
22573
22813
|
stringLiteralTypeAnnotation,
|
|
22574
22814
|
stringTypeAnnotation: stringTypeAnnotation$2,
|
|
22815
|
+
structBody,
|
|
22816
|
+
structDeclaration,
|
|
22575
22817
|
super: _super$1,
|
|
22576
22818
|
switchCase,
|
|
22577
22819
|
switchStatement,
|
|
@@ -22859,6 +23101,8 @@ const ExportDefaultSpecifier$1 = alias("exportDefaultSpecifier");
|
|
|
22859
23101
|
const ModuleExpression$1 = alias("moduleExpression");
|
|
22860
23102
|
const TopicReference$1 = alias("topicReference");
|
|
22861
23103
|
const VoidPattern$1 = alias("voidPattern");
|
|
23104
|
+
const StructDeclaration$1 = alias("structDeclaration");
|
|
23105
|
+
const StructBody = alias("structBody");
|
|
22862
23106
|
const TSParameterProperty$1 = alias("tsParameterProperty");
|
|
22863
23107
|
const TSDeclareFunction$1 = alias("tsDeclareFunction");
|
|
22864
23108
|
const TSDeclareMethod$1 = alias("tsDeclareMethod");
|
|
@@ -23513,6 +23757,12 @@ function assertTopicReference(node, opts) {
|
|
|
23513
23757
|
function assertVoidPattern(node, opts) {
|
|
23514
23758
|
assert("VoidPattern", node, opts);
|
|
23515
23759
|
}
|
|
23760
|
+
function assertStructDeclaration(node, opts) {
|
|
23761
|
+
assert("StructDeclaration", node, opts);
|
|
23762
|
+
}
|
|
23763
|
+
function assertStructBody(node, opts) {
|
|
23764
|
+
assert("StructBody", node, opts);
|
|
23765
|
+
}
|
|
23516
23766
|
function assertTSParameterProperty(node, opts) {
|
|
23517
23767
|
assert("TSParameterProperty", node, opts);
|
|
23518
23768
|
}
|
|
@@ -25486,7 +25736,7 @@ function addMappingInternal(skipable, map, mapping) {
|
|
|
25486
25736
|
if (isRange) setRangeSegment(map, generated.line - 1, generated.column);
|
|
25487
25737
|
}
|
|
25488
25738
|
//#endregion
|
|
25489
|
-
//#region node_modules/.pnpm/@babel+generator@8.0
|
|
25739
|
+
//#region node_modules/.pnpm/@babel+generator@8.1.0/node_modules/@babel/generator/lib/index.js
|
|
25490
25740
|
var import_jsesc = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
25491
25741
|
const object = {};
|
|
25492
25742
|
const hasOwnProperty = object.hasOwnProperty;
|
|
@@ -25695,15 +25945,22 @@ var SourceMap = class {
|
|
|
25695
25945
|
_map;
|
|
25696
25946
|
_rawMappings;
|
|
25697
25947
|
_sourceFileName;
|
|
25698
|
-
_lastGenLine = 0;
|
|
25699
|
-
_lastSourceLine = 0;
|
|
25700
|
-
_lastSourceColumn = 0;
|
|
25701
25948
|
_inputMap = null;
|
|
25949
|
+
#mappingsBuffer0 = null;
|
|
25950
|
+
#mappingsBuffer1 = null;
|
|
25951
|
+
#mappingsBuffer2 = null;
|
|
25952
|
+
#droppedMappingForRange = false;
|
|
25953
|
+
#allowRangeMappings;
|
|
25702
25954
|
constructor(opts, code) {
|
|
25703
25955
|
const map = this._map = new GenMapping({ sourceRoot: opts.sourceRoot });
|
|
25704
25956
|
this._sourceFileName = opts.sourceFileName?.replace(/\\/g, "/");
|
|
25705
25957
|
this._rawMappings = void 0;
|
|
25958
|
+
this.#allowRangeMappings = opts.sourceMapRanges ?? false;
|
|
25706
25959
|
if (opts.inputSourceMap) {
|
|
25960
|
+
if (this.#allowRangeMappings) {
|
|
25961
|
+
this.#allowRangeMappings = false;
|
|
25962
|
+
console.warn(`[BABEL] Note: The code generator has disabled source map ranges for ${opts.filename ?? "the generated code"}, because they cannot be used together with \`inputSourceMap\` yet.`);
|
|
25963
|
+
}
|
|
25707
25964
|
this._inputMap = new TraceMap(opts.inputSourceMap);
|
|
25708
25965
|
const resolvedSources = this._inputMap.resolvedSources;
|
|
25709
25966
|
if (resolvedSources.length) for (let i = 0; i < resolvedSources.length; i++) setSourceContent(map, resolvedSources[i], this._inputMap.sourcesContent?.[i]);
|
|
@@ -25712,16 +25969,19 @@ var SourceMap = class {
|
|
|
25712
25969
|
else if (typeof code === "object") for (const sourceFileName of Object.keys(code)) setSourceContent(map, sourceFileName.replace(/\\/g, "/"), code[sourceFileName]);
|
|
25713
25970
|
}
|
|
25714
25971
|
get() {
|
|
25972
|
+
this.#flushBuffer();
|
|
25715
25973
|
const encoded = toEncodedMap(this._map);
|
|
25716
25974
|
encoded.ignoreList ??= [];
|
|
25717
25975
|
return encoded;
|
|
25718
25976
|
}
|
|
25719
25977
|
getDecoded() {
|
|
25978
|
+
this.#flushBuffer();
|
|
25720
25979
|
const decoded = toDecodedMap(this._map);
|
|
25721
25980
|
decoded.ignoreList ??= [];
|
|
25722
25981
|
return decoded;
|
|
25723
25982
|
}
|
|
25724
25983
|
getRawMappings() {
|
|
25984
|
+
this.#flushBuffer();
|
|
25725
25985
|
return this._rawMappings ||= allMappings(this._map);
|
|
25726
25986
|
}
|
|
25727
25987
|
mark(generated, generatedIdentifierName, line, column, identifierName, identifierNamePos, filename) {
|
|
@@ -25746,12 +26006,92 @@ var SourceMap = class {
|
|
|
25746
26006
|
};
|
|
25747
26007
|
}
|
|
25748
26008
|
if (identifierName != null && identifierName === generatedIdentifierName) identifierName = null;
|
|
25749
|
-
|
|
25750
|
-
name: identifierName,
|
|
25751
|
-
generated
|
|
26009
|
+
const newMapping = {
|
|
26010
|
+
name: identifierName ?? null,
|
|
26011
|
+
generated: {
|
|
26012
|
+
line: generated.line,
|
|
26013
|
+
column: generated.column
|
|
26014
|
+
},
|
|
25752
26015
|
source: originalMapping?.source,
|
|
25753
|
-
original: originalMapping
|
|
25754
|
-
|
|
26016
|
+
original: originalMapping,
|
|
26017
|
+
isRange: false
|
|
26018
|
+
};
|
|
26019
|
+
if (newMapping.name !== null) {
|
|
26020
|
+
this.#flushBuffer();
|
|
26021
|
+
maybeAddMapping(this._map, newMapping);
|
|
26022
|
+
return;
|
|
26023
|
+
}
|
|
26024
|
+
if (this.#allowRangeMappings) {
|
|
26025
|
+
if (this.#mappingsBuffer2 !== null) {
|
|
26026
|
+
const buf2 = this.#mappingsBuffer2;
|
|
26027
|
+
this.#mappingsBuffer2 = null;
|
|
26028
|
+
const prev = this.#mappingsBuffer1 ?? this.#mappingsBuffer0;
|
|
26029
|
+
if (this.#isRangeCandidate(prev, newMapping)) this.#droppedMappingForRange = true;
|
|
26030
|
+
else this.#bufferMapping(buf2);
|
|
26031
|
+
}
|
|
26032
|
+
const prev = this.#mappingsBuffer1 ?? this.#mappingsBuffer0;
|
|
26033
|
+
const prevOriginal = prev?.original;
|
|
26034
|
+
if (prevOriginal && prev.source === newMapping.source && prevOriginal.line === newMapping.original?.line && prevOriginal.column === newMapping.original.column) {
|
|
26035
|
+
if (prev.generated.line === newMapping.generated.line) return;
|
|
26036
|
+
this.#mappingsBuffer2 = newMapping;
|
|
26037
|
+
return;
|
|
26038
|
+
}
|
|
26039
|
+
}
|
|
26040
|
+
this.#bufferMapping(newMapping);
|
|
26041
|
+
}
|
|
26042
|
+
#bufferMapping(newMapping) {
|
|
26043
|
+
if (this.#mappingsBuffer0 === null) {
|
|
26044
|
+
this.#mappingsBuffer0 = newMapping;
|
|
26045
|
+
return;
|
|
26046
|
+
}
|
|
26047
|
+
if (this.#mappingsBuffer1 === null) {
|
|
26048
|
+
if (this.#isRangeCandidate(this.#mappingsBuffer0, newMapping)) this.#mappingsBuffer1 = newMapping;
|
|
26049
|
+
else {
|
|
26050
|
+
maybeAddMapping(this._map, this.#mappingsBuffer0);
|
|
26051
|
+
this.#mappingsBuffer0 = newMapping;
|
|
26052
|
+
}
|
|
26053
|
+
return;
|
|
26054
|
+
}
|
|
26055
|
+
if (this.#isRangeCandidate(this.#mappingsBuffer1, newMapping)) {
|
|
26056
|
+
this.#mappingsBuffer1 = newMapping;
|
|
26057
|
+
this.#droppedMappingForRange = true;
|
|
26058
|
+
} else {
|
|
26059
|
+
if (this.#droppedMappingForRange) this.#mappingsBuffer0.isRange = true;
|
|
26060
|
+
maybeAddMapping(this._map, this.#mappingsBuffer0);
|
|
26061
|
+
maybeAddMapping(this._map, this.#mappingsBuffer1);
|
|
26062
|
+
this.#mappingsBuffer0 = newMapping;
|
|
26063
|
+
this.#mappingsBuffer1 = null;
|
|
26064
|
+
this.#droppedMappingForRange = false;
|
|
26065
|
+
}
|
|
26066
|
+
}
|
|
26067
|
+
#flushBuffer() {
|
|
26068
|
+
if (this.#mappingsBuffer2 !== null) {
|
|
26069
|
+
this.#bufferMapping(this.#mappingsBuffer2);
|
|
26070
|
+
this.#mappingsBuffer2 = null;
|
|
26071
|
+
}
|
|
26072
|
+
const buf0 = this.#mappingsBuffer0;
|
|
26073
|
+
const buf1 = this.#mappingsBuffer1;
|
|
26074
|
+
if (buf0 !== null) {
|
|
26075
|
+
if (buf1 !== null && this.#droppedMappingForRange) buf0.isRange = true;
|
|
26076
|
+
maybeAddMapping(this._map, buf0);
|
|
26077
|
+
this.#mappingsBuffer0 = null;
|
|
26078
|
+
}
|
|
26079
|
+
if (buf1 !== null) {
|
|
26080
|
+
maybeAddMapping(this._map, buf1);
|
|
26081
|
+
this.#mappingsBuffer1 = null;
|
|
26082
|
+
}
|
|
26083
|
+
}
|
|
26084
|
+
#isRangeCandidate(prev, next) {
|
|
26085
|
+
if (!this.#allowRangeMappings) return false;
|
|
26086
|
+
const prevOriginal = prev.original;
|
|
26087
|
+
const nextOriginal = next.original;
|
|
26088
|
+
if (!prevOriginal || !nextOriginal) return false;
|
|
26089
|
+
if (prev.source !== next.source) return false;
|
|
26090
|
+
const generatedLineDelta = next.generated.line - prev.generated.line;
|
|
26091
|
+
const generatedColumnDelta = generatedLineDelta === 0 ? next.generated.column - prev.generated.column : next.generated.column;
|
|
26092
|
+
const originalLineDelta = nextOriginal.line - prevOriginal.line;
|
|
26093
|
+
const originalColumnDelta = originalLineDelta === 0 ? nextOriginal.column - prevOriginal.column : nextOriginal.column;
|
|
26094
|
+
return generatedLineDelta >= 0 && originalColumnDelta >= 0 && generatedLineDelta === originalLineDelta && generatedColumnDelta === originalColumnDelta;
|
|
25755
26095
|
}
|
|
25756
26096
|
};
|
|
25757
26097
|
const spaceIndents = [];
|
|
@@ -25990,10 +26330,10 @@ const PRECEDENCE = /* @__PURE__ */ new Map([
|
|
|
25990
26330
|
["**", 11]
|
|
25991
26331
|
]);
|
|
25992
26332
|
function isTSTypeExpression(nodeId) {
|
|
25993
|
-
return nodeId ===
|
|
26333
|
+
return nodeId === 156 || nodeId === 201 || nodeId === 209;
|
|
25994
26334
|
}
|
|
25995
26335
|
const isClassExtendsClause = (node, parent, parentId) => {
|
|
25996
|
-
return (parentId === 22 || parentId === 23) && parent.superClass === node;
|
|
26336
|
+
return (parentId === 22 || parentId === 23 || parentId === 149) && parent.superClass === node;
|
|
25997
26337
|
};
|
|
25998
26338
|
const hasPostfixPart$1 = (node, parent, parentId) => {
|
|
25999
26339
|
switch (parentId) {
|
|
@@ -26002,9 +26342,9 @@ const hasPostfixPart$1 = (node, parent, parentId) => {
|
|
|
26002
26342
|
case 18:
|
|
26003
26343
|
case 131:
|
|
26004
26344
|
case 113: return parent.callee === node;
|
|
26005
|
-
case
|
|
26006
|
-
case
|
|
26007
|
-
case
|
|
26345
|
+
case 222: return parent.tag === node;
|
|
26346
|
+
case 191: return true;
|
|
26347
|
+
case 177: return parent.expression === node;
|
|
26008
26348
|
}
|
|
26009
26349
|
return false;
|
|
26010
26350
|
};
|
|
@@ -26012,7 +26352,7 @@ function NullableTypeAnnotation$1(node, parent, parentId) {
|
|
|
26012
26352
|
return parentId === 4;
|
|
26013
26353
|
}
|
|
26014
26354
|
function FunctionTypeAnnotation$1(node, parent, parentId, tokenContext) {
|
|
26015
|
-
return parentId ===
|
|
26355
|
+
return parentId === 239 || parentId === 91 || parentId === 4 || (tokenContext & 8) > 0;
|
|
26016
26356
|
}
|
|
26017
26357
|
function UpdateExpression$1(node, parent, parentId) {
|
|
26018
26358
|
return hasPostfixPart$1(node, parent, parentId) || isClassExtendsClause(node, parent, parentId);
|
|
@@ -26028,15 +26368,15 @@ function DoExpression$1(node, parent, parentId, tokenContext) {
|
|
|
26028
26368
|
}
|
|
26029
26369
|
function BinaryLike(node, parent, parentId, nodeType) {
|
|
26030
26370
|
if (isClassExtendsClause(node, parent, parentId)) return true;
|
|
26031
|
-
if (hasPostfixPart$1(node, parent, parentId) || parentId ===
|
|
26371
|
+
if (hasPostfixPart$1(node, parent, parentId) || parentId === 238 || parentId === 143 || parentId === 8) return true;
|
|
26032
26372
|
let parentPos;
|
|
26033
26373
|
switch (parentId) {
|
|
26034
26374
|
case 11:
|
|
26035
26375
|
case 108:
|
|
26036
26376
|
parentPos = PRECEDENCE.get(parent.operator);
|
|
26037
26377
|
break;
|
|
26038
|
-
case
|
|
26039
|
-
case
|
|
26378
|
+
case 156:
|
|
26379
|
+
case 201: parentPos = 7;
|
|
26040
26380
|
}
|
|
26041
26381
|
if (parentPos !== void 0) {
|
|
26042
26382
|
const nodePos = nodeType === 2 ? 7 : PRECEDENCE.get(node.operator);
|
|
@@ -26051,7 +26391,7 @@ function UnionTypeAnnotation$1(node, parent, parentId) {
|
|
|
26051
26391
|
case 4:
|
|
26052
26392
|
case 116:
|
|
26053
26393
|
case 91:
|
|
26054
|
-
case
|
|
26394
|
+
case 239: return true;
|
|
26055
26395
|
}
|
|
26056
26396
|
return false;
|
|
26057
26397
|
}
|
|
@@ -26059,49 +26399,49 @@ function OptionalIndexedAccessType$1(node, parent, parentId) {
|
|
|
26059
26399
|
return parentId === 85 && parent.objectType === node;
|
|
26060
26400
|
}
|
|
26061
26401
|
function TSAsExpression$1(node, parent, parentId) {
|
|
26062
|
-
if (parentId ===
|
|
26402
|
+
if (parentId === 240 || (parentId === 6 || parentId === 7) && parent.left === node) return true;
|
|
26063
26403
|
if (parentId === 11 && (parent.operator === "|" || parent.operator === "&") && node === parent.left) return true;
|
|
26064
26404
|
return BinaryLike(node, parent, parentId, 2);
|
|
26065
26405
|
}
|
|
26066
26406
|
function TSTypeAssertion$1(node, parent, parentId) {
|
|
26067
|
-
return parentId ===
|
|
26407
|
+
return parentId === 240 || (parentId === 6 || parentId === 7) && parent.left === node || UnaryLike(node, parent, parentId);
|
|
26068
26408
|
}
|
|
26069
26409
|
function TSConditionalType$1(node, parent, parentId) {
|
|
26070
26410
|
switch (parentId) {
|
|
26071
|
-
case
|
|
26072
|
-
case
|
|
26073
|
-
case
|
|
26074
|
-
case
|
|
26075
|
-
case
|
|
26076
|
-
case
|
|
26077
|
-
case
|
|
26078
|
-
case
|
|
26411
|
+
case 155:
|
|
26412
|
+
case 195:
|
|
26413
|
+
case 211:
|
|
26414
|
+
case 212:
|
|
26415
|
+
case 181:
|
|
26416
|
+
case 219: return true;
|
|
26417
|
+
case 175: return parent.objectType === node;
|
|
26418
|
+
case 161: return parent.checkType === node || parent.extendsType === node;
|
|
26079
26419
|
}
|
|
26080
26420
|
return false;
|
|
26081
26421
|
}
|
|
26082
26422
|
function TSUnionType$1(node, parent, parentId) {
|
|
26083
26423
|
switch (parentId) {
|
|
26084
|
-
case
|
|
26085
|
-
case
|
|
26086
|
-
case
|
|
26087
|
-
case
|
|
26088
|
-
case
|
|
26424
|
+
case 181:
|
|
26425
|
+
case 211:
|
|
26426
|
+
case 155:
|
|
26427
|
+
case 195: return true;
|
|
26428
|
+
case 175: return parent.objectType === node;
|
|
26089
26429
|
}
|
|
26090
26430
|
return false;
|
|
26091
26431
|
}
|
|
26092
26432
|
function TSIntersectionType$1(node, parent, parentId) {
|
|
26093
|
-
return parentId ===
|
|
26433
|
+
return parentId === 211 || TSTypeOperator$1(node, parent, parentId);
|
|
26094
26434
|
}
|
|
26095
26435
|
function TSInferType$1(node, parent, parentId) {
|
|
26096
26436
|
if (TSTypeOperator$1(node, parent, parentId)) return true;
|
|
26097
|
-
if ((parentId ===
|
|
26437
|
+
if ((parentId === 181 || parentId === 219) && node.typeParameter.constraint != null) return true;
|
|
26098
26438
|
return false;
|
|
26099
26439
|
}
|
|
26100
26440
|
function TSTypeOperator$1(node, parent, parentId) {
|
|
26101
26441
|
switch (parentId) {
|
|
26102
|
-
case
|
|
26103
|
-
case
|
|
26104
|
-
case
|
|
26442
|
+
case 155:
|
|
26443
|
+
case 195: return true;
|
|
26444
|
+
case 175: if (parent.objectType === node) return true;
|
|
26105
26445
|
}
|
|
26106
26446
|
return false;
|
|
26107
26447
|
}
|
|
@@ -26110,16 +26450,16 @@ function TSInstantiationExpression$1(node, parent, parentId) {
|
|
|
26110
26450
|
case 18:
|
|
26111
26451
|
case 131:
|
|
26112
26452
|
case 113:
|
|
26113
|
-
case
|
|
26453
|
+
case 177: return parent.typeArguments != null;
|
|
26114
26454
|
case 109:
|
|
26115
26455
|
case 133: return parent.object === node;
|
|
26116
|
-
case
|
|
26456
|
+
case 191: return true;
|
|
26117
26457
|
}
|
|
26118
26458
|
return false;
|
|
26119
26459
|
}
|
|
26120
26460
|
function TSFunctionType$1(node, parent, parentId) {
|
|
26121
26461
|
if (TSUnionType$1(node, parent, parentId)) return true;
|
|
26122
|
-
return parentId ===
|
|
26462
|
+
return parentId === 219 || parentId === 161 && (parent.checkType === node || parent.extendsType === node);
|
|
26123
26463
|
}
|
|
26124
26464
|
function BinaryExpression$1(node, parent, parentId, tokenContext) {
|
|
26125
26465
|
if (BinaryLike(node, parent, parentId, 0)) return true;
|
|
@@ -26129,14 +26469,14 @@ function LogicalExpression$1(node, parent, parentId) {
|
|
|
26129
26469
|
return BinaryLike(node, parent, parentId, 1);
|
|
26130
26470
|
}
|
|
26131
26471
|
function SequenceExpression$1(node, parent, parentId) {
|
|
26132
|
-
if (parentId === 142 || parentId === 134 || parentId === 109 && parent.property === node || parentId === 133 && parent.property === node || parentId ===
|
|
26133
|
-
if (parentId === 22) return true;
|
|
26472
|
+
if (parentId === 142 || parentId === 134 || parentId === 109 && parent.property === node || parentId === 133 && parent.property === node || parentId === 224) return false;
|
|
26473
|
+
if (parentId === 22 || parentId === 149) return true;
|
|
26134
26474
|
if (parentId === 69) return parent.right === node;
|
|
26135
26475
|
if (parentId === 61) return true;
|
|
26136
26476
|
return !isStatement$4(parent);
|
|
26137
26477
|
}
|
|
26138
26478
|
function YieldExpression$1(node, parent, parentId) {
|
|
26139
|
-
return parentId === 11 || parentId === 108 || parentId ===
|
|
26479
|
+
return parentId === 11 || parentId === 108 || parentId === 238 || parentId === 143 || hasPostfixPart$1(node, parent, parentId) || parentId === 8 && isYieldExpression(node) || parentId === 29 && node === parent.test || isClassExtendsClause(node, parent, parentId) || isTSTypeExpression(parentId);
|
|
26140
26480
|
}
|
|
26141
26481
|
function ClassExpression(node, parent, parentId, tokenContext) {
|
|
26142
26482
|
return (tokenContext & 5) > 0;
|
|
@@ -26149,7 +26489,7 @@ function FunctionExpression$1(node, parent, parentId, tokenContext) {
|
|
|
26149
26489
|
}
|
|
26150
26490
|
function ConditionalExpression$1(node, parent, parentId) {
|
|
26151
26491
|
switch (parentId) {
|
|
26152
|
-
case
|
|
26492
|
+
case 238:
|
|
26153
26493
|
case 143:
|
|
26154
26494
|
case 11:
|
|
26155
26495
|
case 108:
|
|
@@ -27434,7 +27774,7 @@ function printModifiersList(printer, node, modifiers) {
|
|
|
27434
27774
|
printer.space();
|
|
27435
27775
|
}
|
|
27436
27776
|
}
|
|
27437
|
-
const { isClassDeclaration: isClassDeclaration$1, isExportDefaultSpecifier, isExportNamespaceSpecifier, isImportDefaultSpecifier, isImportNamespaceSpecifier, isStatement: isStatement$2$1 } = lib_exports;
|
|
27777
|
+
const { isClassDeclaration: isClassDeclaration$1, isExportDefaultSpecifier, isExportNamespaceSpecifier: isExportNamespaceSpecifier$1, isImportDefaultSpecifier, isImportNamespaceSpecifier, isStatement: isStatement$2$1 } = lib_exports;
|
|
27438
27778
|
function isSameModuleExportName(a, b) {
|
|
27439
27779
|
if (a.type === "Identifier") return b.type === "Identifier" && a.name === b.name;
|
|
27440
27780
|
return b.type === "StringLiteral" && a.value === b.value;
|
|
@@ -27476,8 +27816,19 @@ function ExportSpecifier(node) {
|
|
|
27476
27816
|
this.print(node.exported);
|
|
27477
27817
|
}
|
|
27478
27818
|
}
|
|
27819
|
+
function _printNamespaceFilter(exportsFilter) {
|
|
27820
|
+
if (exportsFilter) {
|
|
27821
|
+
this.tokenChar(123);
|
|
27822
|
+
if (exportsFilter.length) {
|
|
27823
|
+
this.space();
|
|
27824
|
+
this.printList(exportsFilter, this.shouldPrintTrailingComma("}"));
|
|
27825
|
+
this.space();
|
|
27826
|
+
}
|
|
27827
|
+
this.tokenChar(125);
|
|
27828
|
+
} else this.tokenChar(42);
|
|
27829
|
+
}
|
|
27479
27830
|
function ExportNamespaceSpecifier(node) {
|
|
27480
|
-
this.
|
|
27831
|
+
_printNamespaceFilter.call(this, node.exportsFilter);
|
|
27481
27832
|
this.space();
|
|
27482
27833
|
this.word("as");
|
|
27483
27834
|
this.space();
|
|
@@ -27501,6 +27852,10 @@ function ExportAllDeclaration(node) {
|
|
|
27501
27852
|
this.word("type");
|
|
27502
27853
|
this.space();
|
|
27503
27854
|
}
|
|
27855
|
+
if (node.phase === "defer") {
|
|
27856
|
+
this.word("defer");
|
|
27857
|
+
this.space();
|
|
27858
|
+
}
|
|
27504
27859
|
this.tokenChar(42);
|
|
27505
27860
|
this.space();
|
|
27506
27861
|
this.word("from");
|
|
@@ -27528,11 +27883,15 @@ function ExportNamedDeclaration(node) {
|
|
|
27528
27883
|
this.word("type");
|
|
27529
27884
|
this.space();
|
|
27530
27885
|
}
|
|
27886
|
+
if (node.phase === "defer") {
|
|
27887
|
+
this.word("defer");
|
|
27888
|
+
this.space();
|
|
27889
|
+
}
|
|
27531
27890
|
const specifiers = node.specifiers.slice(0);
|
|
27532
27891
|
let hasSpecial = false;
|
|
27533
27892
|
for (;;) {
|
|
27534
27893
|
const first = specifiers[0];
|
|
27535
|
-
if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier(first)) {
|
|
27894
|
+
if (isExportDefaultSpecifier(first) || isExportNamespaceSpecifier$1(first)) {
|
|
27536
27895
|
hasSpecial = true;
|
|
27537
27896
|
this.print(specifiers.shift());
|
|
27538
27897
|
if (specifiers.length) {
|
|
@@ -27638,7 +27997,7 @@ function ImportAttribute(node) {
|
|
|
27638
27997
|
this.print(node.value);
|
|
27639
27998
|
}
|
|
27640
27999
|
function ImportNamespaceSpecifier(node) {
|
|
27641
|
-
this.
|
|
28000
|
+
_printNamespaceFilter.call(this, node.exportsFilter);
|
|
27642
28001
|
this.space();
|
|
27643
28002
|
this.word("as");
|
|
27644
28003
|
this.space();
|
|
@@ -27649,6 +28008,9 @@ function ImportExpression(node) {
|
|
|
27649
28008
|
if (node.phase) {
|
|
27650
28009
|
this.tokenChar(46);
|
|
27651
28010
|
this.word(node.phase);
|
|
28011
|
+
} else if (node.sync) {
|
|
28012
|
+
this.tokenChar(46);
|
|
28013
|
+
this.word("sync");
|
|
27652
28014
|
}
|
|
27653
28015
|
this.tokenChar(40);
|
|
27654
28016
|
const shouldPrintTrailingComma = this.shouldPrintTrailingComma(")");
|
|
@@ -27790,7 +28152,7 @@ function TopicReference() {
|
|
|
27790
28152
|
function VoidPattern() {
|
|
27791
28153
|
this.word("void");
|
|
27792
28154
|
}
|
|
27793
|
-
const { isDeclareExportDeclaration, isStatement: isStatement$1$3 } = lib_exports;
|
|
28155
|
+
const { isDeclareExportDeclaration, isExportNamespaceSpecifier, isStatement: isStatement$1$3 } = lib_exports;
|
|
27794
28156
|
function AnyTypeAnnotation() {
|
|
27795
28157
|
this.word("any");
|
|
27796
28158
|
}
|
|
@@ -27983,13 +28345,17 @@ function FlowExportDeclaration(node) {
|
|
|
27983
28345
|
this.print(declar);
|
|
27984
28346
|
if (!isStatement$1$3(declar)) this.semicolon();
|
|
27985
28347
|
} else {
|
|
27986
|
-
|
|
27987
|
-
if (
|
|
27988
|
-
|
|
27989
|
-
this.
|
|
27990
|
-
|
|
28348
|
+
const specifiers = node.specifiers;
|
|
28349
|
+
if (specifiers.length === 1 && isExportNamespaceSpecifier(specifiers[0])) this.print(specifiers[0]);
|
|
28350
|
+
else {
|
|
28351
|
+
this.tokenChar(123);
|
|
28352
|
+
if (specifiers.length) {
|
|
28353
|
+
this.space();
|
|
28354
|
+
this.printList(specifiers);
|
|
28355
|
+
this.space();
|
|
28356
|
+
}
|
|
28357
|
+
this.tokenChar(125);
|
|
27991
28358
|
}
|
|
27992
|
-
this.tokenChar(125);
|
|
27993
28359
|
if (node.source) {
|
|
27994
28360
|
this.space();
|
|
27995
28361
|
this.word("from");
|
|
@@ -28493,6 +28859,21 @@ function StaticBlock(node) {
|
|
|
28493
28859
|
this.rightBrace(node);
|
|
28494
28860
|
}
|
|
28495
28861
|
}
|
|
28862
|
+
function StructDeclaration(node) {
|
|
28863
|
+
this.word("struct", true);
|
|
28864
|
+
if (node.id) {
|
|
28865
|
+
this.space();
|
|
28866
|
+
this.print(node.id);
|
|
28867
|
+
}
|
|
28868
|
+
if (node.superClass) {
|
|
28869
|
+
this.space();
|
|
28870
|
+
this.word("extends");
|
|
28871
|
+
this.space();
|
|
28872
|
+
this.print(node.superClass);
|
|
28873
|
+
}
|
|
28874
|
+
this.space();
|
|
28875
|
+
this.print(node.body);
|
|
28876
|
+
}
|
|
28496
28877
|
function File(node) {
|
|
28497
28878
|
if (node.program) this.print(node.program.interpreter);
|
|
28498
28879
|
this.print(node.program);
|
|
@@ -28789,6 +29170,8 @@ const generatorFunctions = /*#__PURE__*/ Object.defineProperty({
|
|
|
28789
29170
|
StringLiteral: StringLiteral$1,
|
|
28790
29171
|
StringLiteralTypeAnnotation: StringLiteral$1,
|
|
28791
29172
|
StringTypeAnnotation,
|
|
29173
|
+
StructBody: ClassBody,
|
|
29174
|
+
StructDeclaration,
|
|
28792
29175
|
Super,
|
|
28793
29176
|
SwitchCase,
|
|
28794
29177
|
SwitchStatement,
|
|
@@ -28960,7 +29343,7 @@ function parentNeedsParens(node, parent, parentId) {
|
|
|
28960
29343
|
case 113:
|
|
28961
29344
|
if (parent.callee === node) return newCalleeNeedsParens(node);
|
|
28962
29345
|
break;
|
|
28963
|
-
case
|
|
29346
|
+
case 222:
|
|
28964
29347
|
if (parent.tag === node) return templateTagNeedsParens(node);
|
|
28965
29348
|
break;
|
|
28966
29349
|
case 43: return !isDecoratorMemberExpression(node) && !(node.type === "CallExpression" && isDecoratorMemberExpression(node.callee)) && node.type !== "ParenthesizedExpression";
|
|
@@ -29431,7 +29814,7 @@ var Printer = class {
|
|
|
29431
29814
|
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));
|
|
29432
29815
|
if (!shouldPrintParens && parenthesized && node.leadingComments?.length && node.leadingComments[0].type === "CommentBlock") switch (parentId) {
|
|
29433
29816
|
case 66:
|
|
29434
|
-
case
|
|
29817
|
+
case 243:
|
|
29435
29818
|
case 6:
|
|
29436
29819
|
case 141: break;
|
|
29437
29820
|
case 18:
|
|
@@ -30231,7 +30614,7 @@ const index = Object.assign(smart.bind(void 0), {
|
|
|
30231
30614
|
ast: smart.ast
|
|
30232
30615
|
});
|
|
30233
30616
|
//#endregion
|
|
30234
|
-
//#region node_modules/.pnpm/@babel+traverse@8.0
|
|
30617
|
+
//#region node_modules/.pnpm/@babel+traverse@8.1.0/node_modules/@babel/traverse/lib/index.js
|
|
30235
30618
|
const virtualTypes = /*#__PURE__*/ Object.defineProperty({
|
|
30236
30619
|
__proto__: null,
|
|
30237
30620
|
BindingIdentifier: ["Identifier"],
|
|
@@ -30527,7 +30910,7 @@ function verify$1(visitor) {
|
|
|
30527
30910
|
for (const nodeType of Object.keys(visitor)) {
|
|
30528
30911
|
if (nodeType === "enter" || nodeType === "exit") validateVisitorMethods(nodeType, visitor[nodeType]);
|
|
30529
30912
|
if (shouldIgnoreKey(nodeType)) continue;
|
|
30530
|
-
if (!TYPES.includes(nodeType)) throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse 8.0
|
|
30913
|
+
if (!TYPES.includes(nodeType)) throw new Error(`You gave us a visitor for the node type ${nodeType} but it's not a valid type in @babel/traverse 8.1.0`);
|
|
30531
30914
|
const visitors = visitor[nodeType];
|
|
30532
30915
|
if (typeof visitors === "object") for (const visitorKey of Object.keys(visitors)) if (visitorKey === "enter" || visitorKey === "exit") validateVisitorMethods(`${nodeType}.${visitorKey}`, visitors[visitorKey]);
|
|
30533
30916
|
else throw new Error(`You passed \`traverse()\` a visitor object with the property ${nodeType} that has the invalid property ${visitorKey}`);
|
|
@@ -33022,7 +33405,13 @@ function referencesImport(moduleSource, importName) {
|
|
|
33022
33405
|
if (!this.isReferencedIdentifier()) {
|
|
33023
33406
|
if (this.isJSXMemberExpression() && this.node.property.name === importName || (this.isMemberExpression() || this.isOptionalMemberExpression()) && (this.node.computed ? isStringLiteral(this.node.property, { value: importName }) : this.node.property.name === importName)) {
|
|
33024
33407
|
const object = this.get("object");
|
|
33025
|
-
|
|
33408
|
+
if (!object.isReferencedIdentifier()) return false;
|
|
33409
|
+
const binding = object.scope.getBinding(object.node.name);
|
|
33410
|
+
if (binding?.kind !== "module") return false;
|
|
33411
|
+
const { path } = binding;
|
|
33412
|
+
if (!path.isImportNamespaceSpecifier() || path.parent.source.value !== moduleSource) return false;
|
|
33413
|
+
const { exportsFilter } = path.node;
|
|
33414
|
+
return !exportsFilter || isInExportsFilter(exportsFilter, importName);
|
|
33026
33415
|
}
|
|
33027
33416
|
return false;
|
|
33028
33417
|
}
|
|
@@ -33035,10 +33424,13 @@ function referencesImport(moduleSource, importName) {
|
|
|
33035
33424
|
if (!importName) return true;
|
|
33036
33425
|
} else return false;
|
|
33037
33426
|
if (path.isImportDefaultSpecifier() && importName === "default") return true;
|
|
33038
|
-
if (path.isImportNamespaceSpecifier() && importName === "*"
|
|
33427
|
+
if (path.isImportNamespaceSpecifier()) return !path.node.exportsFilter && importName === "*";
|
|
33039
33428
|
if (path.isImportSpecifier() && isIdentifier(path.node.imported, { name: importName })) return true;
|
|
33040
33429
|
return false;
|
|
33041
33430
|
}
|
|
33431
|
+
function isInExportsFilter(exportsFilter, importName) {
|
|
33432
|
+
return exportsFilter.some((name) => isIdentifier(name, { name: importName }) || isStringLiteral(name, { value: importName }));
|
|
33433
|
+
}
|
|
33042
33434
|
function getSource() {
|
|
33043
33435
|
const node = this.node;
|
|
33044
33436
|
if (node.end) {
|
|
@@ -34228,4 +34620,4 @@ const createSectionPreviewCache = () => {
|
|
|
34228
34620
|
//#endregion
|
|
34229
34621
|
export { jsxOpeningFragment as $, isJSXText as A, isTSSatisfiesExpression as B, isJSXElement as C, isJSXIdentifier$2 as D, isJSXFragment as E, isParenthesizedExpression as F, jsxClosingElement as G, isTemplateLiteral$1 as H, isSpreadElement as I, jsxExpressionContainer as J, jsxClosingFragment as K, isStringLiteral$3 as L, isNumericLiteral as M, isObjectExpression$1 as N, isJSXOpeningElement as O, isObjectProperty$1 as P, jsxOpeningElement as Q, isTSAsExpression as R, isJSXAttribute as S, isJSXExpressionContainer as T, isUnaryExpression$1 as U, isTSTypeAssertion as V, jsxAttribute as W, jsxIdentifier$1 as X, jsxFragment as Y, jsxMemberExpression as Z, identifier$5 as _, inspectDocument as a, stringLiteral$2 as at, isExpression$5 as b, traverse as c, traverseFast$2 as ct, applyEdits as d, parseExpression as dt, jsxText as et, getJSXTagName as f, booleanLiteral as g, arrayExpression as h, getSections as i, objectProperty as it, isNullLiteral$1 as j, isJSXSpreadAttribute as k, fillIdsFrom as l, unaryExpression$1 as lt, generate as m, fillSectionIds as n, numericLiteral$1 as nt, parseDocument as o, templateElement as ot, nanoid as p, jsxElement as q, generateSectionPreview as r, objectExpression$1 as rt, replaceDocumentSections as s, templateLiteral as st, createSectionPreviewCache as t, nullLiteral as tt, replaceIds as u, parse$1 as ut, isArrayExpression$1 as v, isJSXEmptyExpression as w, isIdentifier$7 as x, isBooleanLiteral as y, isTSNonNullExpression as z };
|
|
34230
34622
|
|
|
34231
|
-
//# sourceMappingURL=document-
|
|
34623
|
+
//# sourceMappingURL=document-MkQGxfry.js.map
|