@typescript-deploys/pr-build 5.4.0-pr-57207-3 → 5.4.0-pr-57293-15
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/lib/tsc.js +352 -368
- package/lib/tsserver.js +518 -490
- package/lib/typescript.d.ts +22 -43
- package/lib/typescript.js +518 -489
- package/lib/typingsInstaller.js +71 -124
- package/package.json +2 -2
package/lib/tsserver.js
CHANGED
|
@@ -1475,7 +1475,6 @@ __export(server_exports, {
|
|
|
1475
1475
|
isJSDocEnumTag: () => isJSDocEnumTag,
|
|
1476
1476
|
isJSDocFunctionType: () => isJSDocFunctionType,
|
|
1477
1477
|
isJSDocImplementsTag: () => isJSDocImplementsTag,
|
|
1478
|
-
isJSDocImportTypeTag: () => isJSDocImportTypeTag,
|
|
1479
1478
|
isJSDocIndexSignature: () => isJSDocIndexSignature,
|
|
1480
1479
|
isJSDocLikeText: () => isJSDocLikeText,
|
|
1481
1480
|
isJSDocLink: () => isJSDocLink,
|
|
@@ -2341,7 +2340,7 @@ module.exports = __toCommonJS(server_exports);
|
|
|
2341
2340
|
|
|
2342
2341
|
// src/compiler/corePublic.ts
|
|
2343
2342
|
var versionMajorMinor = "5.4";
|
|
2344
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2343
|
+
var version = `${versionMajorMinor}.0-insiders.20240205`;
|
|
2345
2344
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2346
2345
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2347
2346
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -4482,8 +4481,8 @@ Node ${formatSyntaxKind(node.kind)} was unexpected.`,
|
|
|
4482
4481
|
// for use with vscode-js-debug's new customDescriptionGenerator in launch.json
|
|
4483
4482
|
__tsDebuggerDisplay: {
|
|
4484
4483
|
value() {
|
|
4485
|
-
const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags &
|
|
4486
|
-
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~
|
|
4484
|
+
const typeHeader = this.flags & 67359327 /* Intrinsic */ ? `IntrinsicType ${this.intrinsicName}${this.debugIntrinsicName ? ` (${this.debugIntrinsicName})` : ""}` : this.flags & 98304 /* Nullable */ ? "NullableType" : this.flags & 384 /* StringOrNumberLiteral */ ? `LiteralType ${JSON.stringify(this.value)}` : this.flags & 2048 /* BigIntLiteral */ ? `LiteralType ${this.value.negative ? "-" : ""}${this.value.base10Value}n` : this.flags & 8192 /* UniqueESSymbol */ ? "UniqueESSymbolType" : this.flags & 32 /* Enum */ ? "EnumType" : this.flags & 1048576 /* Union */ ? "UnionType" : this.flags & 2097152 /* Intersection */ ? "IntersectionType" : this.flags & 4194304 /* Index */ ? "IndexType" : this.flags & 8388608 /* IndexedAccess */ ? "IndexedAccessType" : this.flags & 16777216 /* Conditional */ ? "ConditionalType" : this.flags & 33554432 /* Substitution */ ? "SubstitutionType" : this.flags & 262144 /* TypeParameter */ ? "TypeParameter" : this.flags & 524288 /* Object */ ? this.objectFlags & 3 /* ClassOrInterface */ ? "InterfaceType" : this.objectFlags & 4 /* Reference */ ? "TypeReference" : this.objectFlags & 8 /* Tuple */ ? "TupleType" : this.objectFlags & 16 /* Anonymous */ ? "AnonymousType" : this.objectFlags & 32 /* Mapped */ ? "MappedType" : this.objectFlags & 2048 /* ReverseMapped */ ? "ReverseMappedType" : this.objectFlags & 512 /* EvolvingArray */ ? "EvolvingArrayType" : "ObjectType" : "Type";
|
|
4485
|
+
const remainingObjectFlags = this.flags & 524288 /* Object */ ? this.objectFlags & ~2623 /* ObjectTypeKindMask */ : 0;
|
|
4487
4486
|
return `${typeHeader}${this.symbol ? ` '${symbolName(this.symbol)}'` : ""}${remainingObjectFlags ? ` (${formatObjectFlags(remainingObjectFlags)})` : ""}`;
|
|
4488
4487
|
}
|
|
4489
4488
|
},
|
|
@@ -5681,7 +5680,7 @@ var tracingEnabled;
|
|
|
5681
5680
|
};
|
|
5682
5681
|
}
|
|
5683
5682
|
let reverseMappedProperties = {};
|
|
5684
|
-
if (objectFlags &
|
|
5683
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
5685
5684
|
const reverseMappedType = type;
|
|
5686
5685
|
reverseMappedProperties = {
|
|
5687
5686
|
reverseMappedSourceType: (_l = reverseMappedType.source) == null ? void 0 : _l.id,
|
|
@@ -5690,7 +5689,7 @@ var tracingEnabled;
|
|
|
5690
5689
|
};
|
|
5691
5690
|
}
|
|
5692
5691
|
let evolvingArrayProperties = {};
|
|
5693
|
-
if (objectFlags &
|
|
5692
|
+
if (objectFlags & 512 /* EvolvingArray */) {
|
|
5694
5693
|
const evolvingArrayType = type;
|
|
5695
5694
|
evolvingArrayProperties = {
|
|
5696
5695
|
evolvingArrayElementType: evolvingArrayType.elementType.id,
|
|
@@ -6111,13 +6110,12 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6111
6110
|
SyntaxKind5[SyntaxKind5["JSDocPropertyTag"] = 355] = "JSDocPropertyTag";
|
|
6112
6111
|
SyntaxKind5[SyntaxKind5["JSDocThrowsTag"] = 356] = "JSDocThrowsTag";
|
|
6113
6112
|
SyntaxKind5[SyntaxKind5["JSDocSatisfiesTag"] = 357] = "JSDocSatisfiesTag";
|
|
6114
|
-
SyntaxKind5[SyntaxKind5["
|
|
6115
|
-
SyntaxKind5[SyntaxKind5["
|
|
6116
|
-
SyntaxKind5[SyntaxKind5["
|
|
6117
|
-
SyntaxKind5[SyntaxKind5["
|
|
6118
|
-
SyntaxKind5[SyntaxKind5["
|
|
6119
|
-
SyntaxKind5[SyntaxKind5["
|
|
6120
|
-
SyntaxKind5[SyntaxKind5["Count"] = 364] = "Count";
|
|
6113
|
+
SyntaxKind5[SyntaxKind5["SyntaxList"] = 358] = "SyntaxList";
|
|
6114
|
+
SyntaxKind5[SyntaxKind5["NotEmittedStatement"] = 359] = "NotEmittedStatement";
|
|
6115
|
+
SyntaxKind5[SyntaxKind5["PartiallyEmittedExpression"] = 360] = "PartiallyEmittedExpression";
|
|
6116
|
+
SyntaxKind5[SyntaxKind5["CommaListExpression"] = 361] = "CommaListExpression";
|
|
6117
|
+
SyntaxKind5[SyntaxKind5["SyntheticReferenceExpression"] = 362] = "SyntheticReferenceExpression";
|
|
6118
|
+
SyntaxKind5[SyntaxKind5["Count"] = 363] = "Count";
|
|
6121
6119
|
SyntaxKind5[SyntaxKind5["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
|
|
6122
6120
|
SyntaxKind5[SyntaxKind5["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
|
|
6123
6121
|
SyntaxKind5[SyntaxKind5["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
|
|
@@ -6146,9 +6144,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind5) => {
|
|
|
6146
6144
|
SyntaxKind5[SyntaxKind5["LastStatement"] = 259 /* DebuggerStatement */] = "LastStatement";
|
|
6147
6145
|
SyntaxKind5[SyntaxKind5["FirstNode"] = 166 /* QualifiedName */] = "FirstNode";
|
|
6148
6146
|
SyntaxKind5[SyntaxKind5["FirstJSDocNode"] = 316 /* JSDocTypeExpression */] = "FirstJSDocNode";
|
|
6149
|
-
SyntaxKind5[SyntaxKind5["LastJSDocNode"] =
|
|
6147
|
+
SyntaxKind5[SyntaxKind5["LastJSDocNode"] = 357 /* JSDocSatisfiesTag */] = "LastJSDocNode";
|
|
6150
6148
|
SyntaxKind5[SyntaxKind5["FirstJSDocTagNode"] = 334 /* JSDocTag */] = "FirstJSDocTagNode";
|
|
6151
|
-
SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] =
|
|
6149
|
+
SyntaxKind5[SyntaxKind5["LastJSDocTagNode"] = 357 /* JSDocSatisfiesTag */] = "LastJSDocTagNode";
|
|
6152
6150
|
SyntaxKind5[SyntaxKind5["FirstContextualKeyword"] = 128 /* AbstractKeyword */] = "FirstContextualKeyword";
|
|
6153
6151
|
SyntaxKind5[SyntaxKind5["LastContextualKeyword"] = 165 /* OfKeyword */] = "LastContextualKeyword";
|
|
6154
6152
|
return SyntaxKind5;
|
|
@@ -6711,42 +6709,43 @@ var ObjectFlags = /* @__PURE__ */ ((ObjectFlags3) => {
|
|
|
6711
6709
|
ObjectFlags3[ObjectFlags3["Tuple"] = 8] = "Tuple";
|
|
6712
6710
|
ObjectFlags3[ObjectFlags3["Anonymous"] = 16] = "Anonymous";
|
|
6713
6711
|
ObjectFlags3[ObjectFlags3["Mapped"] = 32] = "Mapped";
|
|
6714
|
-
ObjectFlags3[ObjectFlags3["
|
|
6715
|
-
ObjectFlags3[ObjectFlags3["
|
|
6716
|
-
ObjectFlags3[ObjectFlags3["
|
|
6717
|
-
ObjectFlags3[ObjectFlags3["
|
|
6718
|
-
ObjectFlags3[ObjectFlags3["
|
|
6719
|
-
ObjectFlags3[ObjectFlags3["
|
|
6720
|
-
ObjectFlags3[ObjectFlags3["
|
|
6721
|
-
ObjectFlags3[ObjectFlags3["
|
|
6722
|
-
ObjectFlags3[ObjectFlags3["
|
|
6723
|
-
ObjectFlags3[ObjectFlags3["
|
|
6724
|
-
ObjectFlags3[ObjectFlags3["
|
|
6725
|
-
ObjectFlags3[ObjectFlags3["
|
|
6726
|
-
ObjectFlags3[ObjectFlags3["
|
|
6727
|
-
ObjectFlags3[ObjectFlags3["
|
|
6728
|
-
ObjectFlags3[ObjectFlags3["
|
|
6712
|
+
ObjectFlags3[ObjectFlags3["TypeAliasInstantiation"] = 64] = "TypeAliasInstantiation";
|
|
6713
|
+
ObjectFlags3[ObjectFlags3["Instantiated"] = 128] = "Instantiated";
|
|
6714
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteral"] = 256] = "ObjectLiteral";
|
|
6715
|
+
ObjectFlags3[ObjectFlags3["EvolvingArray"] = 512] = "EvolvingArray";
|
|
6716
|
+
ObjectFlags3[ObjectFlags3["ObjectLiteralPatternWithComputedProperties"] = 1024] = "ObjectLiteralPatternWithComputedProperties";
|
|
6717
|
+
ObjectFlags3[ObjectFlags3["ReverseMapped"] = 2048] = "ReverseMapped";
|
|
6718
|
+
ObjectFlags3[ObjectFlags3["JsxAttributes"] = 4096] = "JsxAttributes";
|
|
6719
|
+
ObjectFlags3[ObjectFlags3["JSLiteral"] = 8192] = "JSLiteral";
|
|
6720
|
+
ObjectFlags3[ObjectFlags3["FreshLiteral"] = 16384] = "FreshLiteral";
|
|
6721
|
+
ObjectFlags3[ObjectFlags3["ArrayLiteral"] = 32768] = "ArrayLiteral";
|
|
6722
|
+
ObjectFlags3[ObjectFlags3["PrimitiveUnion"] = 65536] = "PrimitiveUnion";
|
|
6723
|
+
ObjectFlags3[ObjectFlags3["ContainsWideningType"] = 131072] = "ContainsWideningType";
|
|
6724
|
+
ObjectFlags3[ObjectFlags3["ContainsObjectOrArrayLiteral"] = 262144] = "ContainsObjectOrArrayLiteral";
|
|
6725
|
+
ObjectFlags3[ObjectFlags3["NonInferrableType"] = 524288] = "NonInferrableType";
|
|
6726
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariablesComputed"] = 1048576] = "CouldContainTypeVariablesComputed";
|
|
6727
|
+
ObjectFlags3[ObjectFlags3["CouldContainTypeVariables"] = 2097152] = "CouldContainTypeVariables";
|
|
6729
6728
|
ObjectFlags3[ObjectFlags3["ClassOrInterface"] = 3] = "ClassOrInterface";
|
|
6730
|
-
ObjectFlags3[ObjectFlags3["RequiresWidening"] =
|
|
6731
|
-
ObjectFlags3[ObjectFlags3["PropagatingFlags"] =
|
|
6732
|
-
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] =
|
|
6733
|
-
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] =
|
|
6734
|
-
ObjectFlags3[ObjectFlags3["ContainsSpread"] =
|
|
6735
|
-
ObjectFlags3[ObjectFlags3["ObjectRestType"] =
|
|
6736
|
-
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] =
|
|
6737
|
-
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] =
|
|
6738
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] =
|
|
6739
|
-
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] =
|
|
6740
|
-
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] =
|
|
6741
|
-
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] =
|
|
6742
|
-
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] =
|
|
6743
|
-
ObjectFlags3[ObjectFlags3["IsGenericType"] =
|
|
6744
|
-
ObjectFlags3[ObjectFlags3["ContainsIntersections"] =
|
|
6745
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] =
|
|
6746
|
-
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] =
|
|
6747
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] =
|
|
6748
|
-
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] =
|
|
6749
|
-
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] =
|
|
6729
|
+
ObjectFlags3[ObjectFlags3["RequiresWidening"] = 393216] = "RequiresWidening";
|
|
6730
|
+
ObjectFlags3[ObjectFlags3["PropagatingFlags"] = 917504] = "PropagatingFlags";
|
|
6731
|
+
ObjectFlags3[ObjectFlags3["InstantiatedMapped"] = 160] = "InstantiatedMapped";
|
|
6732
|
+
ObjectFlags3[ObjectFlags3["ObjectTypeKindMask"] = 2623] = "ObjectTypeKindMask";
|
|
6733
|
+
ObjectFlags3[ObjectFlags3["ContainsSpread"] = 4194304] = "ContainsSpread";
|
|
6734
|
+
ObjectFlags3[ObjectFlags3["ObjectRestType"] = 8388608] = "ObjectRestType";
|
|
6735
|
+
ObjectFlags3[ObjectFlags3["InstantiationExpressionType"] = 16777216] = "InstantiationExpressionType";
|
|
6736
|
+
ObjectFlags3[ObjectFlags3["IsClassInstanceClone"] = 33554432] = "IsClassInstanceClone";
|
|
6737
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeCalculated"] = 67108864] = "IdenticalBaseTypeCalculated";
|
|
6738
|
+
ObjectFlags3[ObjectFlags3["IdenticalBaseTypeExists"] = 134217728] = "IdenticalBaseTypeExists";
|
|
6739
|
+
ObjectFlags3[ObjectFlags3["IsGenericTypeComputed"] = 4194304] = "IsGenericTypeComputed";
|
|
6740
|
+
ObjectFlags3[ObjectFlags3["IsGenericObjectType"] = 8388608] = "IsGenericObjectType";
|
|
6741
|
+
ObjectFlags3[ObjectFlags3["IsGenericIndexType"] = 16777216] = "IsGenericIndexType";
|
|
6742
|
+
ObjectFlags3[ObjectFlags3["IsGenericType"] = 25165824] = "IsGenericType";
|
|
6743
|
+
ObjectFlags3[ObjectFlags3["ContainsIntersections"] = 33554432] = "ContainsIntersections";
|
|
6744
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnionComputed"] = 67108864] = "IsUnknownLikeUnionComputed";
|
|
6745
|
+
ObjectFlags3[ObjectFlags3["IsUnknownLikeUnion"] = 134217728] = "IsUnknownLikeUnion";
|
|
6746
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersectionComputed"] = 33554432] = "IsNeverIntersectionComputed";
|
|
6747
|
+
ObjectFlags3[ObjectFlags3["IsNeverIntersection"] = 67108864] = "IsNeverIntersection";
|
|
6748
|
+
ObjectFlags3[ObjectFlags3["IsConstrainedTypeVariable"] = 134217728] = "IsConstrainedTypeVariable";
|
|
6750
6749
|
return ObjectFlags3;
|
|
6751
6750
|
})(ObjectFlags || {});
|
|
6752
6751
|
var VarianceFlags = /* @__PURE__ */ ((VarianceFlags2) => {
|
|
@@ -10492,7 +10491,6 @@ var Diagnostics = {
|
|
|
10492
10491
|
Disallow_inconsistently_cased_references_to_the_same_file: diag(6078, 3 /* Message */, "Disallow_inconsistently_cased_references_to_the_same_file_6078", "Disallow inconsistently-cased references to the same file."),
|
|
10493
10492
|
Specify_library_files_to_be_included_in_the_compilation: diag(6079, 3 /* Message */, "Specify_library_files_to_be_included_in_the_compilation_6079", "Specify library files to be included in the compilation."),
|
|
10494
10493
|
Specify_JSX_code_generation: diag(6080, 3 /* Message */, "Specify_JSX_code_generation_6080", "Specify JSX code generation."),
|
|
10495
|
-
File_0_has_an_unsupported_extension_so_skipping_it: diag(6081, 3 /* Message */, "File_0_has_an_unsupported_extension_so_skipping_it_6081", "File '{0}' has an unsupported extension, so skipping it."),
|
|
10496
10494
|
Only_amd_and_system_modules_are_supported_alongside_0: diag(6082, 1 /* Error */, "Only_amd_and_system_modules_are_supported_alongside_0_6082", "Only 'amd' and 'system' modules are supported alongside --{0}."),
|
|
10497
10495
|
Base_directory_to_resolve_non_absolute_module_names: diag(6083, 3 /* Message */, "Base_directory_to_resolve_non_absolute_module_names_6083", "Base directory to resolve non-absolute module names."),
|
|
10498
10496
|
Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: diag(6084, 3 /* Message */, "Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react__6084", "[Deprecated] Use '--jsxFactory' instead. Specify the object invoked for createElement when targeting 'react' JSX emit"),
|
|
@@ -14815,8 +14813,8 @@ function isExpressionKind(kind) {
|
|
|
14815
14813
|
case 230 /* SpreadElement */:
|
|
14816
14814
|
case 234 /* AsExpression */:
|
|
14817
14815
|
case 232 /* OmittedExpression */:
|
|
14818
|
-
case
|
|
14819
|
-
case
|
|
14816
|
+
case 361 /* CommaListExpression */:
|
|
14817
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
14820
14818
|
case 238 /* SatisfiesExpression */:
|
|
14821
14819
|
return true;
|
|
14822
14820
|
default:
|
|
@@ -15001,7 +14999,7 @@ function isDeclarationStatementKind(kind) {
|
|
|
15001
14999
|
return kind === 262 /* FunctionDeclaration */ || kind === 282 /* MissingDeclaration */ || kind === 263 /* ClassDeclaration */ || kind === 264 /* InterfaceDeclaration */ || kind === 265 /* TypeAliasDeclaration */ || kind === 266 /* EnumDeclaration */ || kind === 267 /* ModuleDeclaration */ || kind === 272 /* ImportDeclaration */ || kind === 271 /* ImportEqualsDeclaration */ || kind === 278 /* ExportDeclaration */ || kind === 277 /* ExportAssignment */ || kind === 270 /* NamespaceExportDeclaration */;
|
|
15002
15000
|
}
|
|
15003
15001
|
function isStatementKindButNotDeclarationKind(kind) {
|
|
15004
|
-
return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind ===
|
|
15002
|
+
return kind === 252 /* BreakStatement */ || kind === 251 /* ContinueStatement */ || kind === 259 /* DebuggerStatement */ || kind === 246 /* DoStatement */ || kind === 244 /* ExpressionStatement */ || kind === 242 /* EmptyStatement */ || kind === 249 /* ForInStatement */ || kind === 250 /* ForOfStatement */ || kind === 248 /* ForStatement */ || kind === 245 /* IfStatement */ || kind === 256 /* LabeledStatement */ || kind === 253 /* ReturnStatement */ || kind === 255 /* SwitchStatement */ || kind === 257 /* ThrowStatement */ || kind === 258 /* TryStatement */ || kind === 243 /* VariableStatement */ || kind === 247 /* WhileStatement */ || kind === 254 /* WithStatement */ || kind === 359 /* NotEmittedStatement */;
|
|
15005
15003
|
}
|
|
15006
15004
|
function isDeclaration(node) {
|
|
15007
15005
|
if (node.kind === 168 /* TypeParameter */) {
|
|
@@ -15062,13 +15060,13 @@ function isCaseOrDefaultClause(node) {
|
|
|
15062
15060
|
return kind === 296 /* CaseClause */ || kind === 297 /* DefaultClause */;
|
|
15063
15061
|
}
|
|
15064
15062
|
function isJSDocNode(node) {
|
|
15065
|
-
return node.kind >= 316 /* FirstJSDocNode */ && node.kind <=
|
|
15063
|
+
return node.kind >= 316 /* FirstJSDocNode */ && node.kind <= 357 /* LastJSDocNode */;
|
|
15066
15064
|
}
|
|
15067
15065
|
function isJSDocCommentContainingNode(node) {
|
|
15068
15066
|
return node.kind === 327 /* JSDoc */ || node.kind === 326 /* JSDocNamepathType */ || node.kind === 328 /* JSDocText */ || isJSDocLinkLike(node) || isJSDocTag(node) || isJSDocTypeLiteral(node) || isJSDocSignature(node);
|
|
15069
15067
|
}
|
|
15070
15068
|
function isJSDocTag(node) {
|
|
15071
|
-
return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <=
|
|
15069
|
+
return node.kind >= 334 /* FirstJSDocTagNode */ && node.kind <= 357 /* LastJSDocTagNode */;
|
|
15072
15070
|
}
|
|
15073
15071
|
function isSetAccessor(node) {
|
|
15074
15072
|
return node.kind === 178 /* SetAccessor */;
|
|
@@ -15566,7 +15564,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
|
|
|
15566
15564
|
if (includeJsDoc && hasJSDocNodes(node)) {
|
|
15567
15565
|
return getTokenPosOfNode(node.jsDoc[0], sourceFile);
|
|
15568
15566
|
}
|
|
15569
|
-
if (node.kind ===
|
|
15567
|
+
if (node.kind === 358 /* SyntaxList */ && node._children.length > 0) {
|
|
15570
15568
|
return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
|
|
15571
15569
|
}
|
|
15572
15570
|
return skipTrivia(
|
|
@@ -17602,7 +17600,6 @@ function tryGetModuleSpecifierFromDeclaration(node) {
|
|
|
17602
17600
|
))) == null ? void 0 : _a.arguments[0];
|
|
17603
17601
|
case 272 /* ImportDeclaration */:
|
|
17604
17602
|
case 278 /* ExportDeclaration */:
|
|
17605
|
-
case 358 /* JSDocImportTypeTag */:
|
|
17606
17603
|
return tryCast(node.moduleSpecifier, isStringLiteralLike);
|
|
17607
17604
|
case 271 /* ImportEqualsDeclaration */:
|
|
17608
17605
|
return tryCast((_b = tryCast(node.moduleReference, isExternalModuleReference)) == null ? void 0 : _b.expression, isStringLiteralLike);
|
|
@@ -17627,7 +17624,6 @@ function tryGetImportFromModuleSpecifier(node) {
|
|
|
17627
17624
|
switch (node.parent.kind) {
|
|
17628
17625
|
case 272 /* ImportDeclaration */:
|
|
17629
17626
|
case 278 /* ExportDeclaration */:
|
|
17630
|
-
case 358 /* JSDocImportTypeTag */:
|
|
17631
17627
|
return node.parent;
|
|
17632
17628
|
case 283 /* ExternalModuleReference */:
|
|
17633
17629
|
return node.parent.parent;
|
|
@@ -17648,7 +17644,6 @@ function getExternalModuleName(node) {
|
|
|
17648
17644
|
switch (node.kind) {
|
|
17649
17645
|
case 272 /* ImportDeclaration */:
|
|
17650
17646
|
case 278 /* ExportDeclaration */:
|
|
17651
|
-
case 358 /* JSDocImportTypeTag */:
|
|
17652
17647
|
return node.moduleSpecifier;
|
|
17653
17648
|
case 271 /* ImportEqualsDeclaration */:
|
|
17654
17649
|
return node.moduleReference.kind === 283 /* ExternalModuleReference */ ? node.moduleReference.expression : void 0;
|
|
@@ -18565,7 +18560,7 @@ var OperatorPrecedence = /* @__PURE__ */ ((OperatorPrecedence2) => {
|
|
|
18565
18560
|
})(OperatorPrecedence || {});
|
|
18566
18561
|
function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
|
|
18567
18562
|
switch (nodeKind) {
|
|
18568
|
-
case
|
|
18563
|
+
case 361 /* CommaListExpression */:
|
|
18569
18564
|
return 0 /* Comma */;
|
|
18570
18565
|
case 230 /* SpreadElement */:
|
|
18571
18566
|
return 1 /* Spread */;
|
|
@@ -20278,7 +20273,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
|
|
|
20278
20273
|
case 212 /* ElementAccessExpression */:
|
|
20279
20274
|
case 211 /* PropertyAccessExpression */:
|
|
20280
20275
|
case 235 /* NonNullExpression */:
|
|
20281
|
-
case
|
|
20276
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
20282
20277
|
case 238 /* SatisfiesExpression */:
|
|
20283
20278
|
node = node.expression;
|
|
20284
20279
|
continue;
|
|
@@ -21718,7 +21713,7 @@ function getContainingNodeArray(node) {
|
|
|
21718
21713
|
return parent2.types;
|
|
21719
21714
|
case 189 /* TupleType */:
|
|
21720
21715
|
case 209 /* ArrayLiteralExpression */:
|
|
21721
|
-
case
|
|
21716
|
+
case 361 /* CommaListExpression */:
|
|
21722
21717
|
case 275 /* NamedImports */:
|
|
21723
21718
|
case 279 /* NamedExports */:
|
|
21724
21719
|
return parent2.elements;
|
|
@@ -22925,8 +22920,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22925
22920
|
updateJSDocImplementsTag,
|
|
22926
22921
|
createJSDocSeeTag,
|
|
22927
22922
|
updateJSDocSeeTag,
|
|
22928
|
-
createJSDocImportTypeTag,
|
|
22929
|
-
updateJSDocImportTypeTag,
|
|
22930
22923
|
createJSDocNameReference,
|
|
22931
22924
|
updateJSDocNameReference,
|
|
22932
22925
|
createJSDocMemberName,
|
|
@@ -25705,16 +25698,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
25705
25698
|
function updateJSDocEnumTag(node, tagName = getDefaultTagName(node), typeExpression, comment) {
|
|
25706
25699
|
return node.tagName !== tagName || node.typeExpression !== typeExpression || node.comment !== comment ? update(createJSDocEnumTag(tagName, typeExpression, comment), node) : node;
|
|
25707
25700
|
}
|
|
25708
|
-
function createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comment) {
|
|
25709
|
-
const node = createBaseJSDocTag(358 /* JSDocImportTypeTag */, tagName ?? createIdentifier("importType"), comment);
|
|
25710
|
-
node.importClause = importClause;
|
|
25711
|
-
node.moduleSpecifier = moduleSpecifier;
|
|
25712
|
-
node.comment = comment;
|
|
25713
|
-
return node;
|
|
25714
|
-
}
|
|
25715
|
-
function updateJSDocImportTypeTag(node, tagName, importClause, moduleSpecifier, comment) {
|
|
25716
|
-
return node.tagName !== tagName || node.comment !== comment || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier ? update(createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comment), node) : node;
|
|
25717
|
-
}
|
|
25718
25701
|
function createJSDocText(text) {
|
|
25719
25702
|
const node = createBaseNode(328 /* JSDocText */);
|
|
25720
25703
|
node.text = text;
|
|
@@ -26153,18 +26136,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26153
26136
|
return node;
|
|
26154
26137
|
}
|
|
26155
26138
|
function createSyntaxList3(children) {
|
|
26156
|
-
const node = createBaseNode(
|
|
26139
|
+
const node = createBaseNode(358 /* SyntaxList */);
|
|
26157
26140
|
node._children = children;
|
|
26158
26141
|
return node;
|
|
26159
26142
|
}
|
|
26160
26143
|
function createNotEmittedStatement(original) {
|
|
26161
|
-
const node = createBaseNode(
|
|
26144
|
+
const node = createBaseNode(359 /* NotEmittedStatement */);
|
|
26162
26145
|
node.original = original;
|
|
26163
26146
|
setTextRange(node, original);
|
|
26164
26147
|
return node;
|
|
26165
26148
|
}
|
|
26166
26149
|
function createPartiallyEmittedExpression(expression, original) {
|
|
26167
|
-
const node = createBaseNode(
|
|
26150
|
+
const node = createBaseNode(360 /* PartiallyEmittedExpression */);
|
|
26168
26151
|
node.expression = expression;
|
|
26169
26152
|
node.original = original;
|
|
26170
26153
|
node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
|
|
@@ -26186,7 +26169,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26186
26169
|
return node;
|
|
26187
26170
|
}
|
|
26188
26171
|
function createCommaListExpression(elements) {
|
|
26189
|
-
const node = createBaseNode(
|
|
26172
|
+
const node = createBaseNode(361 /* CommaListExpression */);
|
|
26190
26173
|
node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
|
|
26191
26174
|
node.transformFlags |= propagateChildrenFlags(node.elements);
|
|
26192
26175
|
return node;
|
|
@@ -26195,7 +26178,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26195
26178
|
return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
|
|
26196
26179
|
}
|
|
26197
26180
|
function createSyntheticReferenceExpression(expression, thisArg) {
|
|
26198
|
-
const node = createBaseNode(
|
|
26181
|
+
const node = createBaseNode(362 /* SyntheticReferenceExpression */);
|
|
26199
26182
|
node.expression = expression;
|
|
26200
26183
|
node.thisArg = thisArg;
|
|
26201
26184
|
node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
|
|
@@ -26441,7 +26424,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
26441
26424
|
return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
|
|
26442
26425
|
case 235 /* NonNullExpression */:
|
|
26443
26426
|
return updateNonNullExpression(outerExpression, expression);
|
|
26444
|
-
case
|
|
26427
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
26445
26428
|
return updatePartiallyEmittedExpression(outerExpression, expression);
|
|
26446
26429
|
}
|
|
26447
26430
|
}
|
|
@@ -26851,8 +26834,6 @@ function getDefaultTagNameForKind(kind) {
|
|
|
26851
26834
|
return "augments";
|
|
26852
26835
|
case 336 /* JSDocImplementsTag */:
|
|
26853
26836
|
return "implements";
|
|
26854
|
-
case 358 /* JSDocImportTypeTag */:
|
|
26855
|
-
return "importType";
|
|
26856
26837
|
default:
|
|
26857
26838
|
return Debug.fail(`Unsupported kind: ${Debug.formatSyntaxKind(kind)}`);
|
|
26858
26839
|
}
|
|
@@ -26993,7 +26974,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
|
|
|
26993
26974
|
case 216 /* TypeAssertionExpression */:
|
|
26994
26975
|
case 238 /* SatisfiesExpression */:
|
|
26995
26976
|
case 234 /* AsExpression */:
|
|
26996
|
-
case
|
|
26977
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
26997
26978
|
case 217 /* ParenthesizedExpression */:
|
|
26998
26979
|
case 108 /* SuperKeyword */:
|
|
26999
26980
|
return -2147483648 /* OuterExpressionExcludes */;
|
|
@@ -28992,10 +28973,10 @@ function isSyntheticExpression(node) {
|
|
|
28992
28973
|
return node.kind === 237 /* SyntheticExpression */;
|
|
28993
28974
|
}
|
|
28994
28975
|
function isPartiallyEmittedExpression(node) {
|
|
28995
|
-
return node.kind ===
|
|
28976
|
+
return node.kind === 360 /* PartiallyEmittedExpression */;
|
|
28996
28977
|
}
|
|
28997
28978
|
function isCommaListExpression(node) {
|
|
28998
|
-
return node.kind ===
|
|
28979
|
+
return node.kind === 361 /* CommaListExpression */;
|
|
28999
28980
|
}
|
|
29000
28981
|
function isTemplateSpan(node) {
|
|
29001
28982
|
return node.kind === 239 /* TemplateSpan */;
|
|
@@ -29145,10 +29126,10 @@ function isMissingDeclaration(node) {
|
|
|
29145
29126
|
return node.kind === 282 /* MissingDeclaration */;
|
|
29146
29127
|
}
|
|
29147
29128
|
function isNotEmittedStatement(node) {
|
|
29148
|
-
return node.kind ===
|
|
29129
|
+
return node.kind === 359 /* NotEmittedStatement */;
|
|
29149
29130
|
}
|
|
29150
29131
|
function isSyntheticReference(node) {
|
|
29151
|
-
return node.kind ===
|
|
29132
|
+
return node.kind === 362 /* SyntheticReferenceExpression */;
|
|
29152
29133
|
}
|
|
29153
29134
|
function isExternalModuleReference(node) {
|
|
29154
29135
|
return node.kind === 283 /* ExternalModuleReference */;
|
|
@@ -29348,11 +29329,8 @@ function isJSDocSatisfiesTag(node) {
|
|
|
29348
29329
|
function isJSDocThrowsTag(node) {
|
|
29349
29330
|
return node.kind === 356 /* JSDocThrowsTag */;
|
|
29350
29331
|
}
|
|
29351
|
-
function isJSDocImportTypeTag(node) {
|
|
29352
|
-
return node.kind === 358 /* JSDocImportTypeTag */;
|
|
29353
|
-
}
|
|
29354
29332
|
function isSyntaxList(n) {
|
|
29355
|
-
return n.kind ===
|
|
29333
|
+
return n.kind === 358 /* SyntaxList */;
|
|
29356
29334
|
}
|
|
29357
29335
|
|
|
29358
29336
|
// src/compiler/factory/utilities.ts
|
|
@@ -29747,7 +29725,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
|
|
|
29747
29725
|
return (kinds & 2 /* TypeAssertions */) !== 0;
|
|
29748
29726
|
case 235 /* NonNullExpression */:
|
|
29749
29727
|
return (kinds & 4 /* NonNullAssertions */) !== 0;
|
|
29750
|
-
case
|
|
29728
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
29751
29729
|
return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
|
|
29752
29730
|
}
|
|
29753
29731
|
return false;
|
|
@@ -30838,7 +30816,7 @@ var forEachChildTable = {
|
|
|
30838
30816
|
[282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
|
|
30839
30817
|
return visitNodes(cbNode, cbNodes, node.modifiers);
|
|
30840
30818
|
},
|
|
30841
|
-
[
|
|
30819
|
+
[361 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
|
|
30842
30820
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
30843
30821
|
},
|
|
30844
30822
|
[284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
|
|
@@ -30933,8 +30911,7 @@ var forEachChildTable = {
|
|
|
30933
30911
|
[343 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
|
|
30934
30912
|
[338 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
|
|
30935
30913
|
[344 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
|
|
30936
|
-
[
|
|
30937
|
-
[361 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
30914
|
+
[360 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
|
|
30938
30915
|
};
|
|
30939
30916
|
function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
|
|
30940
30917
|
return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
|
|
@@ -30985,9 +30962,6 @@ function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
|
|
|
30985
30962
|
function forEachChildInJSDocTag(node, cbNode, cbNodes) {
|
|
30986
30963
|
return visitNode2(cbNode, node.tagName) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
30987
30964
|
}
|
|
30988
|
-
function forEachChildInJSDocImportTypeTag(node, cbNode, cbNodes) {
|
|
30989
|
-
return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
|
|
30990
|
-
}
|
|
30991
30965
|
function forEachChildInPartiallyEmittedExpression(node, cbNode, _cbNodes) {
|
|
30992
30966
|
return visitNode2(cbNode, node.expression);
|
|
30993
30967
|
}
|
|
@@ -37238,9 +37212,6 @@ var Parser;
|
|
|
37238
37212
|
case "throws":
|
|
37239
37213
|
tag = parseThrowsTag(start3, tagName, margin, indentText);
|
|
37240
37214
|
break;
|
|
37241
|
-
case "importType":
|
|
37242
|
-
tag = parseImportTypeTag(start3, tagName, margin, indentText);
|
|
37243
|
-
break;
|
|
37244
37215
|
default:
|
|
37245
37216
|
tag = parseUnknownTag(start3, tagName, margin, indentText);
|
|
37246
37217
|
break;
|
|
@@ -37560,27 +37531,6 @@ var Parser;
|
|
|
37560
37531
|
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start3, getNodePos(), margin, indentText) : void 0;
|
|
37561
37532
|
return finishNode(factory2.createJSDocSatisfiesTag(tagName, typeExpression, comments2), start3);
|
|
37562
37533
|
}
|
|
37563
|
-
function parseImportTypeTag(start3, tagName, margin, indentText) {
|
|
37564
|
-
const afterImportTypeTagPos = scanner2.getTokenFullStart();
|
|
37565
|
-
let identifier;
|
|
37566
|
-
if (isIdentifier2()) {
|
|
37567
|
-
identifier = parseIdentifier();
|
|
37568
|
-
}
|
|
37569
|
-
let importClause;
|
|
37570
|
-
if (identifier || token() === 42 /* AsteriskToken */ || token() === 19 /* OpenBraceToken */) {
|
|
37571
|
-
importClause = parseImportClause(
|
|
37572
|
-
identifier,
|
|
37573
|
-
afterImportTypeTagPos,
|
|
37574
|
-
/*isTypeOnly*/
|
|
37575
|
-
true
|
|
37576
|
-
);
|
|
37577
|
-
parseExpected(161 /* FromKeyword */);
|
|
37578
|
-
}
|
|
37579
|
-
Debug.assert(importClause);
|
|
37580
|
-
const moduleSpecifier = parseModuleSpecifier();
|
|
37581
|
-
const comments2 = margin !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start3, getNodePos(), margin, indentText) : void 0;
|
|
37582
|
-
return finishNode(factory2.createJSDocImportTypeTag(tagName, importClause, moduleSpecifier, comments2), start3);
|
|
37583
|
-
}
|
|
37584
37534
|
function parseExpressionWithTypeArgumentsForAugments() {
|
|
37585
37535
|
const usedBrace = parseOptional(19 /* OpenBraceToken */);
|
|
37586
37536
|
const pos = getNodePos();
|
|
@@ -43443,15 +43393,9 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
43443
43393
|
}
|
|
43444
43394
|
}
|
|
43445
43395
|
const loader = (extensions2, candidate2, onlyRecordFailures2, state2) => {
|
|
43446
|
-
const fromFile =
|
|
43396
|
+
const fromFile = loadFileNameFromPackageJsonField(extensions2, candidate2, onlyRecordFailures2, state2);
|
|
43447
43397
|
if (fromFile) {
|
|
43448
|
-
|
|
43449
|
-
if (resolved) {
|
|
43450
|
-
return noPackageId(resolved);
|
|
43451
|
-
}
|
|
43452
|
-
if (state2.traceEnabled) {
|
|
43453
|
-
trace(state2.host, Diagnostics.File_0_has_an_unsupported_extension_so_skipping_it, fromFile);
|
|
43454
|
-
}
|
|
43398
|
+
return noPackageId(fromFile);
|
|
43455
43399
|
}
|
|
43456
43400
|
const expandedExtensions = extensions2 === 4 /* Declaration */ ? 1 /* TypeScript */ | 4 /* Declaration */ : extensions2;
|
|
43457
43401
|
const features = state2.features;
|
|
@@ -43507,10 +43451,6 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
|
|
|
43507
43451
|
return loadModuleFromFile(extensions, indexPath, onlyRecordFailuresForIndex, state);
|
|
43508
43452
|
}
|
|
43509
43453
|
}
|
|
43510
|
-
function resolvedIfExtensionMatches(extensions, path, resolvedUsingTsExtension) {
|
|
43511
|
-
const ext = tryGetExtensionFromPath2(path);
|
|
43512
|
-
return ext !== void 0 && extensionIsOk(extensions, ext) ? { path, ext, resolvedUsingTsExtension } : void 0;
|
|
43513
|
-
}
|
|
43514
43454
|
function extensionIsOk(extensions, extension) {
|
|
43515
43455
|
return extensions & 2 /* JavaScript */ && (extension === ".js" /* Js */ || extension === ".jsx" /* Jsx */ || extension === ".mjs" /* Mjs */ || extension === ".cjs" /* Cjs */) || extensions & 1 /* TypeScript */ && (extension === ".ts" /* Ts */ || extension === ".tsx" /* Tsx */ || extension === ".mts" /* Mts */ || extension === ".cts" /* Cts */) || extensions & 4 /* Declaration */ && (extension === ".d.ts" /* Dts */ || extension === ".d.mts" /* Dmts */ || extension === ".d.cts" /* Dcts */) || extensions & 8 /* Json */ && extension === ".json" /* Json */ || false;
|
|
43516
43456
|
}
|
|
@@ -48439,7 +48379,7 @@ function createTypeChecker(host) {
|
|
|
48439
48379
|
var useUnknownInCatchVariables = getStrictOptionValue(compilerOptions, "useUnknownInCatchVariables");
|
|
48440
48380
|
var keyofStringsOnly = !!compilerOptions.keyofStringsOnly;
|
|
48441
48381
|
var defaultIndexFlags = keyofStringsOnly ? 1 /* StringsOnly */ : 0 /* None */;
|
|
48442
|
-
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 :
|
|
48382
|
+
var freshObjectLiteralFlag = compilerOptions.suppressExcessPropertyErrors ? 0 : 16384 /* FreshLiteral */;
|
|
48443
48383
|
var exactOptionalPropertyTypes = compilerOptions.exactOptionalPropertyTypes;
|
|
48444
48384
|
var checkBinaryExpression = createCheckBinaryExpression();
|
|
48445
48385
|
var emitResolver = createResolver();
|
|
@@ -48942,7 +48882,7 @@ function createTypeChecker(host) {
|
|
|
48942
48882
|
var errorTypes = /* @__PURE__ */ new Map();
|
|
48943
48883
|
var seenIntrinsicNames = /* @__PURE__ */ new Set();
|
|
48944
48884
|
var anyType = createIntrinsicType(1 /* Any */, "any");
|
|
48945
|
-
var autoType = createIntrinsicType(1 /* Any */, "any",
|
|
48885
|
+
var autoType = createIntrinsicType(1 /* Any */, "any", 524288 /* NonInferrableType */, "auto");
|
|
48946
48886
|
var wildcardType = createIntrinsicType(
|
|
48947
48887
|
1 /* Any */,
|
|
48948
48888
|
"any",
|
|
@@ -48959,7 +48899,7 @@ function createTypeChecker(host) {
|
|
|
48959
48899
|
);
|
|
48960
48900
|
var errorType = createIntrinsicType(1 /* Any */, "error");
|
|
48961
48901
|
var unresolvedType = createIntrinsicType(1 /* Any */, "unresolved");
|
|
48962
|
-
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any",
|
|
48902
|
+
var nonInferrableAnyType = createIntrinsicType(1 /* Any */, "any", 131072 /* ContainsWideningType */, "non-inferrable");
|
|
48963
48903
|
var intrinsicMarkerType = createIntrinsicType(1 /* Any */, "intrinsic");
|
|
48964
48904
|
var unknownType = createIntrinsicType(2 /* Unknown */, "unknown");
|
|
48965
48905
|
var nonNullUnknownType = createIntrinsicType(
|
|
@@ -48970,7 +48910,7 @@ function createTypeChecker(host) {
|
|
|
48970
48910
|
"non-null"
|
|
48971
48911
|
);
|
|
48972
48912
|
var undefinedType = createIntrinsicType(32768 /* Undefined */, "undefined");
|
|
48973
|
-
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined",
|
|
48913
|
+
var undefinedWideningType = strictNullChecks ? undefinedType : createIntrinsicType(32768 /* Undefined */, "undefined", 131072 /* ContainsWideningType */, "widening");
|
|
48974
48914
|
var missingType = createIntrinsicType(
|
|
48975
48915
|
32768 /* Undefined */,
|
|
48976
48916
|
"undefined",
|
|
@@ -48987,7 +48927,7 @@ function createTypeChecker(host) {
|
|
|
48987
48927
|
"optional"
|
|
48988
48928
|
);
|
|
48989
48929
|
var nullType = createIntrinsicType(65536 /* Null */, "null");
|
|
48990
|
-
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null",
|
|
48930
|
+
var nullWideningType = strictNullChecks ? nullType : createIntrinsicType(65536 /* Null */, "null", 131072 /* ContainsWideningType */, "widening");
|
|
48991
48931
|
var stringType = createIntrinsicType(4 /* String */, "string");
|
|
48992
48932
|
var numberType = createIntrinsicType(8 /* Number */, "number");
|
|
48993
48933
|
var bigintType = createIntrinsicType(64 /* BigInt */, "bigint");
|
|
@@ -49019,7 +48959,7 @@ function createTypeChecker(host) {
|
|
|
49019
48959
|
var esSymbolType = createIntrinsicType(4096 /* ESSymbol */, "symbol");
|
|
49020
48960
|
var voidType = createIntrinsicType(16384 /* Void */, "void");
|
|
49021
48961
|
var neverType = createIntrinsicType(131072 /* Never */, "never");
|
|
49022
|
-
var silentNeverType = createIntrinsicType(131072 /* Never */, "never",
|
|
48962
|
+
var silentNeverType = createIntrinsicType(131072 /* Never */, "never", 524288 /* NonInferrableType */, "silent");
|
|
49023
48963
|
var implicitNeverType = createIntrinsicType(
|
|
49024
48964
|
131072 /* Never */,
|
|
49025
48965
|
"never",
|
|
@@ -49086,7 +49026,7 @@ function createTypeChecker(host) {
|
|
|
49086
49026
|
emptyArray,
|
|
49087
49027
|
emptyArray
|
|
49088
49028
|
);
|
|
49089
|
-
emptyJsxObjectType.objectFlags |=
|
|
49029
|
+
emptyJsxObjectType.objectFlags |= 4096 /* JsxAttributes */;
|
|
49090
49030
|
var emptyTypeLiteralSymbol = createSymbol(2048 /* TypeLiteral */, "__type" /* Type */);
|
|
49091
49031
|
emptyTypeLiteralSymbol.members = createSymbolTable();
|
|
49092
49032
|
var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, emptyArray, emptyArray, emptyArray);
|
|
@@ -49116,7 +49056,7 @@ function createTypeChecker(host) {
|
|
|
49116
49056
|
emptyArray,
|
|
49117
49057
|
emptyArray
|
|
49118
49058
|
);
|
|
49119
|
-
anyFunctionType.objectFlags |=
|
|
49059
|
+
anyFunctionType.objectFlags |= 524288 /* NonInferrableType */;
|
|
49120
49060
|
var noConstraintType = createAnonymousType(
|
|
49121
49061
|
/*symbol*/
|
|
49122
49062
|
void 0,
|
|
@@ -51706,7 +51646,7 @@ function createTypeChecker(host) {
|
|
|
51706
51646
|
return ambientModule;
|
|
51707
51647
|
}
|
|
51708
51648
|
const currentSourceFile = getSourceFileOfNode(location);
|
|
51709
|
-
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (
|
|
51649
|
+
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _a.name) || ((_b = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _b.argument.literal) || (isVariableDeclaration(location) && location.initializer && isRequireCall(
|
|
51710
51650
|
location.initializer,
|
|
51711
51651
|
/*requireStringLiteralLikeArgument*/
|
|
51712
51652
|
true
|
|
@@ -52354,7 +52294,7 @@ function createTypeChecker(host) {
|
|
|
52354
52294
|
const type = createType(kind);
|
|
52355
52295
|
type.intrinsicName = intrinsicName;
|
|
52356
52296
|
type.debugIntrinsicName = debugIntrinsicName;
|
|
52357
|
-
type.objectFlags = objectFlags |
|
|
52297
|
+
type.objectFlags = objectFlags | 1048576 /* CouldContainTypeVariablesComputed */ | 4194304 /* IsGenericTypeComputed */ | 67108864 /* IsUnknownLikeUnionComputed */ | 33554432 /* IsNeverIntersectionComputed */;
|
|
52358
52298
|
return type;
|
|
52359
52299
|
}
|
|
52360
52300
|
function checkIntrinsicName(name, debug) {
|
|
@@ -52943,7 +52883,7 @@ function createTypeChecker(host) {
|
|
|
52943
52883
|
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
52944
52884
|
}
|
|
52945
52885
|
function isClassInstanceSide(type) {
|
|
52946
|
-
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) &
|
|
52886
|
+
return !!type.symbol && !!(type.symbol.flags & 32 /* Class */) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || !!(type.flags & 524288 /* Object */) && !!(getObjectFlags(type) & 33554432 /* IsClassInstanceClone */));
|
|
52947
52887
|
}
|
|
52948
52888
|
function createNodeBuilder() {
|
|
52949
52889
|
return {
|
|
@@ -53032,9 +52972,7 @@ function createTypeChecker(host) {
|
|
|
53032
52972
|
context.approximateLength += 3;
|
|
53033
52973
|
return factory.createKeywordTypeNode(133 /* AnyKeyword */);
|
|
53034
52974
|
}
|
|
53035
|
-
|
|
53036
|
-
type = getReducedType(type);
|
|
53037
|
-
}
|
|
52975
|
+
type = context.flags & 536870912 /* NoTypeReduction */ ? getResolvedType(type) : getReducedType(type);
|
|
53038
52976
|
if (type.flags & 1 /* Any */) {
|
|
53039
52977
|
if (type.aliasSymbol) {
|
|
53040
52978
|
return factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
@@ -53406,7 +53344,7 @@ function createTypeChecker(host) {
|
|
|
53406
53344
|
const typeId = type2.id;
|
|
53407
53345
|
const symbol = type2.symbol;
|
|
53408
53346
|
if (symbol) {
|
|
53409
|
-
const isInstantiationExpressionType = !!(getObjectFlags(type2) &
|
|
53347
|
+
const isInstantiationExpressionType = !!(getObjectFlags(type2) & 16777216 /* InstantiationExpressionType */);
|
|
53410
53348
|
if (isInstantiationExpressionType) {
|
|
53411
53349
|
const instantiationExpressionType = type2;
|
|
53412
53350
|
const existing = instantiationExpressionType.node;
|
|
@@ -53744,7 +53682,7 @@ function createTypeChecker(host) {
|
|
|
53744
53682
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
53745
53683
|
}
|
|
53746
53684
|
for (const info of resolvedType.indexInfos) {
|
|
53747
|
-
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags &
|
|
53685
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 2048 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
53748
53686
|
}
|
|
53749
53687
|
const properties = resolvedType.properties;
|
|
53750
53688
|
if (!properties) {
|
|
@@ -56007,7 +55945,6 @@ function createTypeChecker(host) {
|
|
|
56007
55945
|
case 273 /* ImportClause */: {
|
|
56008
55946
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
56009
55947
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.moduleSpecifier;
|
|
56010
|
-
const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
|
|
56011
55948
|
addResult(
|
|
56012
55949
|
factory.createImportDeclaration(
|
|
56013
55950
|
/*modifiers*/
|
|
@@ -56020,7 +55957,7 @@ function createTypeChecker(host) {
|
|
|
56020
55957
|
void 0
|
|
56021
55958
|
),
|
|
56022
55959
|
specifier2,
|
|
56023
|
-
attributes
|
|
55960
|
+
node.parent.attributes
|
|
56024
55961
|
),
|
|
56025
55962
|
0 /* None */
|
|
56026
55963
|
);
|
|
@@ -56029,7 +55966,6 @@ function createTypeChecker(host) {
|
|
|
56029
55966
|
case 274 /* NamespaceImport */: {
|
|
56030
55967
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
56031
55968
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.moduleSpecifier;
|
|
56032
|
-
const attributes = isImportDeclaration(node.parent) ? node.parent.attributes : void 0;
|
|
56033
55969
|
addResult(
|
|
56034
55970
|
factory.createImportDeclaration(
|
|
56035
55971
|
/*modifiers*/
|
|
@@ -56042,7 +55978,7 @@ function createTypeChecker(host) {
|
|
|
56042
55978
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
56043
55979
|
),
|
|
56044
55980
|
specifier2,
|
|
56045
|
-
attributes
|
|
55981
|
+
node.parent.attributes
|
|
56046
55982
|
),
|
|
56047
55983
|
0 /* None */
|
|
56048
55984
|
);
|
|
@@ -56064,7 +56000,6 @@ function createTypeChecker(host) {
|
|
|
56064
56000
|
case 276 /* ImportSpecifier */: {
|
|
56065
56001
|
const generatedSpecifier = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
56066
56002
|
const specifier2 = bundled ? factory.createStringLiteral(generatedSpecifier) : node.parent.parent.parent.moduleSpecifier;
|
|
56067
|
-
const attributes = isImportDeclaration(node.parent.parent.parent) ? node.parent.parent.parent.attributes : void 0;
|
|
56068
56003
|
addResult(
|
|
56069
56004
|
factory.createImportDeclaration(
|
|
56070
56005
|
/*modifiers*/
|
|
@@ -56084,7 +56019,7 @@ function createTypeChecker(host) {
|
|
|
56084
56019
|
])
|
|
56085
56020
|
),
|
|
56086
56021
|
specifier2,
|
|
56087
|
-
attributes
|
|
56022
|
+
node.parent.parent.parent.attributes
|
|
56088
56023
|
),
|
|
56089
56024
|
0 /* None */
|
|
56090
56025
|
);
|
|
@@ -56991,7 +56926,7 @@ function createTypeChecker(host) {
|
|
|
56991
56926
|
));
|
|
56992
56927
|
}
|
|
56993
56928
|
const result = createAnonymousType(symbol, members, emptyArray, emptyArray, getIndexInfosOfType(source));
|
|
56994
|
-
result.objectFlags |=
|
|
56929
|
+
result.objectFlags |= 8388608 /* ObjectRestType */;
|
|
56995
56930
|
return result;
|
|
56996
56931
|
}
|
|
56997
56932
|
function isGenericTypeWithUndefinedConstraint(type) {
|
|
@@ -57421,7 +57356,7 @@ function createTypeChecker(host) {
|
|
|
57421
57356
|
mergeSymbolTable(exports2, s.exports);
|
|
57422
57357
|
}
|
|
57423
57358
|
const type = createAnonymousType(symbol, exports2, emptyArray, emptyArray, emptyArray);
|
|
57424
|
-
type.objectFlags |=
|
|
57359
|
+
type.objectFlags |= 8192 /* JSLiteral */;
|
|
57425
57360
|
return type;
|
|
57426
57361
|
}
|
|
57427
57362
|
function getAnnotatedTypeForAssignmentDeclaration(declaredType, expression, symbol, declaration) {
|
|
@@ -57542,9 +57477,9 @@ function createTypeChecker(host) {
|
|
|
57542
57477
|
result.aliasTypeArguments = length(args) ? args : void 0;
|
|
57543
57478
|
}
|
|
57544
57479
|
}
|
|
57545
|
-
result.objectFlags |= getObjectFlags(type) &
|
|
57480
|
+
result.objectFlags |= getObjectFlags(type) & 8192 /* JSLiteral */;
|
|
57546
57481
|
if (result.symbol && result.symbol.flags & 32 /* Class */ && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
57547
|
-
result.objectFlags |=
|
|
57482
|
+
result.objectFlags |= 33554432 /* IsClassInstanceClone */;
|
|
57548
57483
|
}
|
|
57549
57484
|
return result;
|
|
57550
57485
|
}
|
|
@@ -57597,7 +57532,7 @@ function createTypeChecker(host) {
|
|
|
57597
57532
|
function getTypeFromObjectBindingPattern(pattern, includePatternInType, reportErrors2) {
|
|
57598
57533
|
const members = createSymbolTable();
|
|
57599
57534
|
let stringIndexInfo;
|
|
57600
|
-
let objectFlags =
|
|
57535
|
+
let objectFlags = 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
57601
57536
|
forEach(pattern.elements, (e) => {
|
|
57602
57537
|
const name = e.propertyName || e.name;
|
|
57603
57538
|
if (e.dotDotDotToken) {
|
|
@@ -57611,7 +57546,7 @@ function createTypeChecker(host) {
|
|
|
57611
57546
|
}
|
|
57612
57547
|
const exprType = getLiteralTypeFromPropertyName(name);
|
|
57613
57548
|
if (!isTypeUsableAsPropertyName(exprType)) {
|
|
57614
|
-
objectFlags |=
|
|
57549
|
+
objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
57615
57550
|
return;
|
|
57616
57551
|
}
|
|
57617
57552
|
const text = getPropertyNameFromType(exprType);
|
|
@@ -57632,7 +57567,7 @@ function createTypeChecker(host) {
|
|
|
57632
57567
|
result.objectFlags |= objectFlags;
|
|
57633
57568
|
if (includePatternInType) {
|
|
57634
57569
|
result.pattern = pattern;
|
|
57635
|
-
result.objectFlags |=
|
|
57570
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
57636
57571
|
}
|
|
57637
57572
|
return result;
|
|
57638
57573
|
}
|
|
@@ -57650,7 +57585,7 @@ function createTypeChecker(host) {
|
|
|
57650
57585
|
if (includePatternInType) {
|
|
57651
57586
|
result = cloneTypeReference(result);
|
|
57652
57587
|
result.pattern = pattern;
|
|
57653
|
-
result.objectFlags |=
|
|
57588
|
+
result.objectFlags |= 262144 /* ContainsObjectOrArrayLiteral */;
|
|
57654
57589
|
}
|
|
57655
57590
|
return result;
|
|
57656
57591
|
}
|
|
@@ -57678,7 +57613,7 @@ function createTypeChecker(host) {
|
|
|
57678
57613
|
members.set(member.escapedName, member);
|
|
57679
57614
|
});
|
|
57680
57615
|
const type = createAnonymousType(symbol, members, emptyArray, emptyArray, emptyArray);
|
|
57681
|
-
type.objectFlags |=
|
|
57616
|
+
type.objectFlags |= 256 /* ObjectLiteral */ | 524288 /* NonInferrableType */;
|
|
57682
57617
|
links.resolvedType = type;
|
|
57683
57618
|
}
|
|
57684
57619
|
return links.resolvedType;
|
|
@@ -59466,6 +59401,14 @@ function createTypeChecker(host) {
|
|
|
59466
59401
|
type.constructSignatures = constructSignatures;
|
|
59467
59402
|
}
|
|
59468
59403
|
}
|
|
59404
|
+
function resolveTypeAliasInstantiationMembers(type) {
|
|
59405
|
+
const resolved = resolveStructuredTypeMembers(getResolvedTypeAliasInstantiation(type));
|
|
59406
|
+
type.members = resolved.members;
|
|
59407
|
+
type.properties = resolved.properties;
|
|
59408
|
+
type.callSignatures = resolved.callSignatures;
|
|
59409
|
+
type.constructSignatures = resolved.constructSignatures;
|
|
59410
|
+
type.indexInfos = resolved.indexInfos;
|
|
59411
|
+
}
|
|
59469
59412
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
59470
59413
|
return instantiateType(instantiable, createTypeMapper([type.indexType, type.objectType], [getNumberLiteralType(0), createTupleType([replacement])]));
|
|
59471
59414
|
}
|
|
@@ -59732,12 +59675,14 @@ function createTypeChecker(host) {
|
|
|
59732
59675
|
resolveTypeReferenceMembers(type);
|
|
59733
59676
|
} else if (type.objectFlags & 3 /* ClassOrInterface */) {
|
|
59734
59677
|
resolveClassOrInterfaceMembers(type);
|
|
59735
|
-
} else if (type.objectFlags &
|
|
59678
|
+
} else if (type.objectFlags & 2048 /* ReverseMapped */) {
|
|
59736
59679
|
resolveReverseMappedTypeMembers(type);
|
|
59737
59680
|
} else if (type.objectFlags & 16 /* Anonymous */) {
|
|
59738
59681
|
resolveAnonymousTypeMembers(type);
|
|
59739
59682
|
} else if (type.objectFlags & 32 /* Mapped */) {
|
|
59740
59683
|
resolveMappedTypeMembers(type);
|
|
59684
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
59685
|
+
resolveTypeAliasInstantiationMembers(type);
|
|
59741
59686
|
} else {
|
|
59742
59687
|
Debug.fail("Unhandled object type " + Debug.formatObjectFlags(type.objectFlags));
|
|
59743
59688
|
}
|
|
@@ -60183,7 +60128,7 @@ function createTypeChecker(host) {
|
|
|
60183
60128
|
if (indexInfo) {
|
|
60184
60129
|
checkFlags |= 32 /* WritePartial */ | (indexInfo.isReadonly ? 8 /* Readonly */ : 0);
|
|
60185
60130
|
indexTypes = append(indexTypes, isTupleType(type) ? getRestTypeOfTupleType(type) || undefinedType : indexInfo.type);
|
|
60186
|
-
} else if (isObjectLiteralType2(type) && !(getObjectFlags(type) &
|
|
60131
|
+
} else if (isObjectLiteralType2(type) && !(getObjectFlags(type) & 4194304 /* ContainsSpread */)) {
|
|
60187
60132
|
checkFlags |= 32 /* WritePartial */;
|
|
60188
60133
|
indexTypes = append(indexTypes, undefinedType);
|
|
60189
60134
|
} else {
|
|
@@ -60309,22 +60254,22 @@ function createTypeChecker(host) {
|
|
|
60309
60254
|
return property && !(getCheckFlags(property) & 16 /* ReadPartial */) ? property : void 0;
|
|
60310
60255
|
}
|
|
60311
60256
|
function getReducedType(type) {
|
|
60312
|
-
if (type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
60257
|
+
if (type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */) {
|
|
60313
60258
|
return type.resolvedReducedType || (type.resolvedReducedType = getReducedUnionType(type));
|
|
60314
60259
|
} else if (type.flags & 2097152 /* Intersection */) {
|
|
60315
|
-
if (!(type.objectFlags &
|
|
60316
|
-
type.objectFlags |=
|
|
60260
|
+
if (!(type.objectFlags & 33554432 /* IsNeverIntersectionComputed */)) {
|
|
60261
|
+
type.objectFlags |= 33554432 /* IsNeverIntersectionComputed */ | (some(getPropertiesOfUnionOrIntersectionType(type), isNeverReducedProperty) ? 67108864 /* IsNeverIntersection */ : 0);
|
|
60317
60262
|
}
|
|
60318
|
-
return type.objectFlags &
|
|
60263
|
+
return type.objectFlags & 67108864 /* IsNeverIntersection */ ? neverType : type;
|
|
60319
60264
|
}
|
|
60320
|
-
return type;
|
|
60265
|
+
return getResolvedType(type);
|
|
60321
60266
|
}
|
|
60322
60267
|
function getReducedUnionType(unionType) {
|
|
60323
60268
|
const reducedTypes = sameMap(unionType.types, getReducedType);
|
|
60324
60269
|
if (reducedTypes === unionType.types) {
|
|
60325
60270
|
return unionType;
|
|
60326
60271
|
}
|
|
60327
|
-
const reduced = getUnionType(reducedTypes);
|
|
60272
|
+
const reduced = getResolvedType(getUnionType(reducedTypes));
|
|
60328
60273
|
if (reduced.flags & 1048576 /* Union */) {
|
|
60329
60274
|
reduced.resolvedReducedType = reduced;
|
|
60330
60275
|
}
|
|
@@ -60340,14 +60285,14 @@ function createTypeChecker(host) {
|
|
|
60340
60285
|
return !prop.valueDeclaration && !!(getCheckFlags(prop) & 1024 /* ContainsPrivate */);
|
|
60341
60286
|
}
|
|
60342
60287
|
function isGenericReducibleType(type) {
|
|
60343
|
-
return !!(type.flags & 1048576 /* Union */ && type.objectFlags &
|
|
60288
|
+
return !!(type.flags & 1048576 /* Union */ && type.objectFlags & 33554432 /* ContainsIntersections */ && some(type.types, isGenericReducibleType) || type.flags & 2097152 /* Intersection */ && isReducibleIntersection(type));
|
|
60344
60289
|
}
|
|
60345
60290
|
function isReducibleIntersection(type) {
|
|
60346
60291
|
const uniqueFilled = type.uniqueLiteralFilledInstantiation || (type.uniqueLiteralFilledInstantiation = instantiateType(type, uniqueLiteralMapper));
|
|
60347
60292
|
return getReducedType(uniqueFilled) !== uniqueFilled;
|
|
60348
60293
|
}
|
|
60349
60294
|
function elaborateNeverIntersection(errorInfo, type) {
|
|
60350
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
60295
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 67108864 /* IsNeverIntersection */) {
|
|
60351
60296
|
const neverProp = find(getPropertiesOfUnionOrIntersectionType(type), isDiscriminantWithNeverType);
|
|
60352
60297
|
if (neverProp) {
|
|
60353
60298
|
return chainDiagnosticMessages(errorInfo, Diagnostics.The_intersection_0_was_reduced_to_never_because_property_1_has_conflicting_types_in_some_constituents, typeToString(
|
|
@@ -61133,7 +61078,7 @@ function createTypeChecker(host) {
|
|
|
61133
61078
|
result |= getObjectFlags(type);
|
|
61134
61079
|
}
|
|
61135
61080
|
}
|
|
61136
|
-
return result &
|
|
61081
|
+
return result & 917504 /* PropagatingFlags */;
|
|
61137
61082
|
}
|
|
61138
61083
|
function tryCreateTypeReference(target, typeArguments) {
|
|
61139
61084
|
if (some(typeArguments) && target === emptyGenericType) {
|
|
@@ -61220,7 +61165,7 @@ function createTypeChecker(host) {
|
|
|
61220
61165
|
return errorType;
|
|
61221
61166
|
}
|
|
61222
61167
|
}
|
|
61223
|
-
if (node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
61168
|
+
if (node.kind === 183 /* TypeReference */ && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length))) {
|
|
61224
61169
|
return createDeferredTypeReference(
|
|
61225
61170
|
type,
|
|
61226
61171
|
node,
|
|
@@ -61233,23 +61178,6 @@ function createTypeChecker(host) {
|
|
|
61233
61178
|
}
|
|
61234
61179
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
61235
61180
|
}
|
|
61236
|
-
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
61237
|
-
const type = getDeclaredTypeOfSymbol(symbol);
|
|
61238
|
-
if (type === intrinsicMarkerType) {
|
|
61239
|
-
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
61240
|
-
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
61241
|
-
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
61242
|
-
}
|
|
61243
|
-
}
|
|
61244
|
-
const links = getSymbolLinks(symbol);
|
|
61245
|
-
const typeParameters = links.typeParameters;
|
|
61246
|
-
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
61247
|
-
let instantiation = links.instantiations.get(id);
|
|
61248
|
-
if (!instantiation) {
|
|
61249
|
-
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
61250
|
-
}
|
|
61251
|
-
return instantiation;
|
|
61252
|
-
}
|
|
61253
61181
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
61254
61182
|
if (getCheckFlags(symbol) & 1048576 /* Unresolved */) {
|
|
61255
61183
|
const typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
@@ -61300,10 +61228,13 @@ function createTypeChecker(host) {
|
|
|
61300
61228
|
const resolved = resolveAlias(aliasSymbol2);
|
|
61301
61229
|
if (resolved && resolved.flags & 524288 /* TypeAlias */) {
|
|
61302
61230
|
newAliasSymbol = resolved;
|
|
61303
|
-
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node)
|
|
61231
|
+
aliasTypeArguments = typeArgumentsFromTypeReferenceNode(node) ?? [];
|
|
61304
61232
|
}
|
|
61305
61233
|
}
|
|
61306
61234
|
}
|
|
61235
|
+
if (getObjectFlags(type) & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */) && node.kind === 183 /* TypeReference */ && isDeferredTypeReferenceNode(node, length(node.typeArguments) !== typeParameters.length)) {
|
|
61236
|
+
return createDeferredTypeAliasInstantiation(symbol, node, newAliasSymbol, aliasTypeArguments);
|
|
61237
|
+
}
|
|
61307
61238
|
return getTypeAliasInstantiation(symbol, typeArgumentsFromTypeReferenceNode(node), newAliasSymbol, aliasTypeArguments);
|
|
61308
61239
|
}
|
|
61309
61240
|
return checkNoTypeArguments(node, symbol) ? type : errorType;
|
|
@@ -61313,6 +61244,43 @@ function createTypeChecker(host) {
|
|
|
61313
61244
|
const declaration = (_a = symbol.declarations) == null ? void 0 : _a.find(isTypeAlias);
|
|
61314
61245
|
return !!(declaration && getContainingFunction(declaration));
|
|
61315
61246
|
}
|
|
61247
|
+
function getTypeAliasInstantiation(symbol, typeArguments, aliasSymbol, aliasTypeArguments) {
|
|
61248
|
+
const type = getDeclaredTypeOfSymbol(symbol);
|
|
61249
|
+
if (type === intrinsicMarkerType) {
|
|
61250
|
+
const typeKind = intrinsicTypeKinds.get(symbol.escapedName);
|
|
61251
|
+
if (typeKind !== void 0 && typeArguments && typeArguments.length === 1) {
|
|
61252
|
+
return typeKind === 4 /* NoInfer */ ? getNoInferType(typeArguments[0]) : getStringMappingType(symbol, typeArguments[0]);
|
|
61253
|
+
}
|
|
61254
|
+
}
|
|
61255
|
+
const links = getSymbolLinks(symbol);
|
|
61256
|
+
const typeParameters = links.typeParameters;
|
|
61257
|
+
const id = getTypeListId(typeArguments) + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
61258
|
+
let instantiation = links.instantiations.get(id);
|
|
61259
|
+
if (!instantiation) {
|
|
61260
|
+
links.instantiations.set(id, instantiation = instantiateTypeWithAlias(type, createTypeMapper(typeParameters, fillMissingTypeArguments(typeArguments, typeParameters, getMinTypeArgumentCount(typeParameters), isInJSFile(symbol.valueDeclaration))), aliasSymbol, aliasTypeArguments));
|
|
61261
|
+
}
|
|
61262
|
+
return instantiation;
|
|
61263
|
+
}
|
|
61264
|
+
function createDeferredTypeAliasInstantiation(typeAlias, node, aliasSymbol, aliasTypeArguments) {
|
|
61265
|
+
const type = getDeclaredTypeOfSymbol(typeAlias);
|
|
61266
|
+
const result = createObjectType(64 /* TypeAliasInstantiation */, type.symbol);
|
|
61267
|
+
result.typeAlias = typeAlias;
|
|
61268
|
+
result.node = node;
|
|
61269
|
+
result.aliasSymbol = aliasSymbol;
|
|
61270
|
+
result.aliasTypeArguments = aliasTypeArguments;
|
|
61271
|
+
return result;
|
|
61272
|
+
}
|
|
61273
|
+
function getResolvedType(type) {
|
|
61274
|
+
return type.flags & 524288 /* Object */ && type.objectFlags & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(type) : type;
|
|
61275
|
+
}
|
|
61276
|
+
function getResolvedTypeAliasInstantiation(type) {
|
|
61277
|
+
if (!type.resolvedType) {
|
|
61278
|
+
const typeArguments = typeArgumentsFromTypeReferenceNode(type.node);
|
|
61279
|
+
const mappedTypeArguments = type.mapper ? instantiateTypes(typeArguments, type.mapper) : typeArguments;
|
|
61280
|
+
type.resolvedType = getTypeAliasInstantiation(type.typeAlias, mappedTypeArguments, type.aliasSymbol, type.aliasTypeArguments);
|
|
61281
|
+
}
|
|
61282
|
+
return type.resolvedType;
|
|
61283
|
+
}
|
|
61316
61284
|
function getTypeReferenceName(node) {
|
|
61317
61285
|
switch (node.kind) {
|
|
61318
61286
|
case 183 /* TypeReference */:
|
|
@@ -62004,7 +61972,7 @@ function createTypeChecker(host) {
|
|
|
62004
61972
|
return isNamedTupleMember(member) || isParameter(member) ? member : void 0;
|
|
62005
61973
|
}
|
|
62006
61974
|
function isDeferredTypeReferenceNode(node, hasDefaultTypeArguments) {
|
|
62007
|
-
return
|
|
61975
|
+
return isResolvedByTypeAlias(node) && (node.kind === 188 /* ArrayType */ ? mayResolveTypeAlias(node.elementType) : node.kind === 189 /* TupleType */ ? some(node.elements, mayResolveTypeAlias) : hasDefaultTypeArguments || some(node.typeArguments, mayResolveTypeAlias));
|
|
62008
61976
|
}
|
|
62009
61977
|
function isResolvedByTypeAlias(node) {
|
|
62010
61978
|
const parent2 = node.parent;
|
|
@@ -62059,7 +62027,7 @@ function createTypeChecker(host) {
|
|
|
62059
62027
|
const target = getArrayOrTupleTargetType(node);
|
|
62060
62028
|
if (target === emptyGenericType) {
|
|
62061
62029
|
links.resolvedType = emptyObjectType;
|
|
62062
|
-
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && isDeferredTypeReferenceNode(node)) {
|
|
62030
|
+
} else if (!(node.kind === 189 /* TupleType */ && some(node.elements, (e) => !!(getTupleElementFlags(e) & 8 /* Variadic */))) && (getAliasSymbolForTypeNode(node) || isDeferredTypeReferenceNode(node))) {
|
|
62063
62031
|
links.resolvedType = node.kind === 189 /* TupleType */ && node.elements.length === 0 ? target : createDeferredTypeReference(
|
|
62064
62032
|
target,
|
|
62065
62033
|
node,
|
|
@@ -62279,12 +62247,12 @@ function createTypeChecker(host) {
|
|
|
62279
62247
|
includes |= flags & 473694207 /* IncludesMask */;
|
|
62280
62248
|
if (flags & 465829888 /* Instantiable */)
|
|
62281
62249
|
includes |= 33554432 /* IncludesInstantiable */;
|
|
62282
|
-
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62250
|
+
if (flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */)
|
|
62283
62251
|
includes |= 536870912 /* IncludesConstrainedTypeVariable */;
|
|
62284
62252
|
if (type === wildcardType)
|
|
62285
62253
|
includes |= 8388608 /* IncludesWildcard */;
|
|
62286
62254
|
if (!strictNullChecks && flags & 98304 /* Nullable */) {
|
|
62287
|
-
if (!(getObjectFlags(type) &
|
|
62255
|
+
if (!(getObjectFlags(type) & 131072 /* ContainsWideningType */))
|
|
62288
62256
|
includes |= 4194304 /* IncludesNonWideningType */;
|
|
62289
62257
|
} else {
|
|
62290
62258
|
const len = typeSet.length;
|
|
@@ -62391,7 +62359,7 @@ function createTypeChecker(host) {
|
|
|
62391
62359
|
function removeConstrainedTypeVariables(types) {
|
|
62392
62360
|
const typeVariables = [];
|
|
62393
62361
|
for (const type of types) {
|
|
62394
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62362
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
62395
62363
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62396
62364
|
pushIfUnique(typeVariables, type.types[index]);
|
|
62397
62365
|
}
|
|
@@ -62399,7 +62367,7 @@ function createTypeChecker(host) {
|
|
|
62399
62367
|
for (const typeVariable of typeVariables) {
|
|
62400
62368
|
const primitives = [];
|
|
62401
62369
|
for (const type of types) {
|
|
62402
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62370
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
62403
62371
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62404
62372
|
if (type.types[index] === typeVariable) {
|
|
62405
62373
|
insertType(primitives, type.types[1 - index]);
|
|
@@ -62412,7 +62380,7 @@ function createTypeChecker(host) {
|
|
|
62412
62380
|
while (i > 0) {
|
|
62413
62381
|
i--;
|
|
62414
62382
|
const type = types[i];
|
|
62415
|
-
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) &
|
|
62383
|
+
if (type.flags & 2097152 /* Intersection */ && getObjectFlags(type) & 134217728 /* IsConstrainedTypeVariable */) {
|
|
62416
62384
|
const index = type.types[0].flags & 8650752 /* TypeVariable */ ? 0 : 1;
|
|
62417
62385
|
if (type.types[index] === typeVariable && containsType(primitives, type.types[1 - index])) {
|
|
62418
62386
|
orderedRemoveItemAt(types, i);
|
|
@@ -62521,7 +62489,7 @@ function createTypeChecker(host) {
|
|
|
62521
62489
|
origin = createOriginUnionOrIntersectionType(1048576 /* Union */, reducedTypes);
|
|
62522
62490
|
}
|
|
62523
62491
|
}
|
|
62524
|
-
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 :
|
|
62492
|
+
const objectFlags = (includes & 36323331 /* NotPrimitiveUnion */ ? 0 : 65536 /* PrimitiveUnion */) | (includes & 2097152 /* Intersection */ ? 33554432 /* ContainsIntersections */ : 0);
|
|
62525
62493
|
return getUnionTypeFromSortedList(typeSet, objectFlags, aliasSymbol, aliasTypeArguments, origin);
|
|
62526
62494
|
}
|
|
62527
62495
|
function getUnionOrIntersectionTypePredicate(signatures, kind) {
|
|
@@ -62672,14 +62640,14 @@ function createTypeChecker(host) {
|
|
|
62672
62640
|
}
|
|
62673
62641
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
62674
62642
|
let unionTypes2;
|
|
62675
|
-
const index = findIndex(types, (t) => !!(getObjectFlags(t) &
|
|
62643
|
+
const index = findIndex(types, (t) => !!(getObjectFlags(t) & 65536 /* PrimitiveUnion */));
|
|
62676
62644
|
if (index < 0) {
|
|
62677
62645
|
return false;
|
|
62678
62646
|
}
|
|
62679
62647
|
let i = index + 1;
|
|
62680
62648
|
while (i < types.length) {
|
|
62681
62649
|
const t = types[i];
|
|
62682
|
-
if (getObjectFlags(t) &
|
|
62650
|
+
if (getObjectFlags(t) & 65536 /* PrimitiveUnion */) {
|
|
62683
62651
|
(unionTypes2 || (unionTypes2 = [types[index]])).push(t);
|
|
62684
62652
|
orderedRemoveItemAt(types, i);
|
|
62685
62653
|
} else {
|
|
@@ -62700,7 +62668,7 @@ function createTypeChecker(host) {
|
|
|
62700
62668
|
}
|
|
62701
62669
|
}
|
|
62702
62670
|
}
|
|
62703
|
-
types[index] = getUnionTypeFromSortedList(result,
|
|
62671
|
+
types[index] = getUnionTypeFromSortedList(result, 65536 /* PrimitiveUnion */);
|
|
62704
62672
|
return true;
|
|
62705
62673
|
}
|
|
62706
62674
|
function createIntersectionType(types, objectFlags, aliasSymbol, aliasTypeArguments) {
|
|
@@ -62763,7 +62731,7 @@ function createTypeChecker(host) {
|
|
|
62763
62731
|
return neverType;
|
|
62764
62732
|
}
|
|
62765
62733
|
}
|
|
62766
|
-
objectFlags =
|
|
62734
|
+
objectFlags = 134217728 /* IsConstrainedTypeVariable */;
|
|
62767
62735
|
}
|
|
62768
62736
|
}
|
|
62769
62737
|
}
|
|
@@ -63116,7 +63084,7 @@ function createTypeChecker(host) {
|
|
|
63116
63084
|
if (noImplicitAny) {
|
|
63117
63085
|
return false;
|
|
63118
63086
|
}
|
|
63119
|
-
if (getObjectFlags(type) &
|
|
63087
|
+
if (getObjectFlags(type) & 8192 /* JSLiteral */) {
|
|
63120
63088
|
return true;
|
|
63121
63089
|
}
|
|
63122
63090
|
if (type.flags & 1048576 /* Union */) {
|
|
@@ -63364,28 +63332,28 @@ function createTypeChecker(host) {
|
|
|
63364
63332
|
return !!getGenericObjectFlags(type);
|
|
63365
63333
|
}
|
|
63366
63334
|
function isGenericObjectType(type) {
|
|
63367
|
-
return !!(getGenericObjectFlags(type) &
|
|
63335
|
+
return !!(getGenericObjectFlags(type) & 8388608 /* IsGenericObjectType */);
|
|
63368
63336
|
}
|
|
63369
63337
|
function isGenericIndexType(type) {
|
|
63370
|
-
return !!(getGenericObjectFlags(type) &
|
|
63338
|
+
return !!(getGenericObjectFlags(type) & 16777216 /* IsGenericIndexType */);
|
|
63371
63339
|
}
|
|
63372
63340
|
function getGenericObjectFlags(type) {
|
|
63373
63341
|
if (type.flags & 3145728 /* UnionOrIntersection */) {
|
|
63374
|
-
if (!(type.objectFlags &
|
|
63375
|
-
type.objectFlags |=
|
|
63342
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
63343
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | reduceLeft(type.types, (flags, t) => flags | getGenericObjectFlags(t), 0);
|
|
63376
63344
|
}
|
|
63377
|
-
return type.objectFlags &
|
|
63345
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
63378
63346
|
}
|
|
63379
63347
|
if (type.flags & 33554432 /* Substitution */) {
|
|
63380
|
-
if (!(type.objectFlags &
|
|
63381
|
-
type.objectFlags |=
|
|
63348
|
+
if (!(type.objectFlags & 4194304 /* IsGenericTypeComputed */)) {
|
|
63349
|
+
type.objectFlags |= 4194304 /* IsGenericTypeComputed */ | getGenericObjectFlags(type.baseType) | getGenericObjectFlags(type.constraint);
|
|
63382
63350
|
}
|
|
63383
|
-
return type.objectFlags &
|
|
63351
|
+
return type.objectFlags & 25165824 /* IsGenericType */;
|
|
63384
63352
|
}
|
|
63385
|
-
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(type) || isGenericTupleType(type) ?
|
|
63353
|
+
return (type.flags & 58982400 /* InstantiableNonPrimitive */ || isGenericMappedType(getResolvedType(type)) || isGenericTupleType(type) ? 8388608 /* IsGenericObjectType */ : 0) | (type.flags & (58982400 /* InstantiableNonPrimitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */) && !isPatternLiteralType(type) ? 16777216 /* IsGenericIndexType */ : 0);
|
|
63386
63354
|
}
|
|
63387
63355
|
function getSimplifiedType(type, writing) {
|
|
63388
|
-
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : type;
|
|
63356
|
+
return type.flags & 8388608 /* IndexedAccess */ ? getSimplifiedIndexedAccessType(type, writing) : type.flags & 16777216 /* Conditional */ ? getSimplifiedConditionalType(type, writing) : getResolvedType(type);
|
|
63389
63357
|
}
|
|
63390
63358
|
function distributeIndexOverObjectType(objectType, indexType, writing) {
|
|
63391
63359
|
if (objectType.flags & 1048576 /* Union */ || objectType.flags & 2097152 /* Intersection */ && !shouldDeferIndexType(objectType)) {
|
|
@@ -63885,7 +63853,7 @@ function createTypeChecker(host) {
|
|
|
63885
63853
|
}
|
|
63886
63854
|
}
|
|
63887
63855
|
const spread = createAnonymousType(type2.symbol, members, emptyArray, emptyArray, getIndexInfosOfType(type2));
|
|
63888
|
-
spread.objectFlags |=
|
|
63856
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
63889
63857
|
return spread;
|
|
63890
63858
|
}
|
|
63891
63859
|
}
|
|
@@ -63962,7 +63930,7 @@ function createTypeChecker(host) {
|
|
|
63962
63930
|
}
|
|
63963
63931
|
}
|
|
63964
63932
|
const spread = createAnonymousType(symbol, members, emptyArray, emptyArray, sameMap(indexInfos, (info) => getIndexInfoWithReadonly(info, readonly)));
|
|
63965
|
-
spread.objectFlags |=
|
|
63933
|
+
spread.objectFlags |= 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */ | 4194304 /* ContainsSpread */ | objectFlags;
|
|
63966
63934
|
return spread;
|
|
63967
63935
|
}
|
|
63968
63936
|
function isSpreadableProperty(prop) {
|
|
@@ -64383,9 +64351,9 @@ function createTypeChecker(host) {
|
|
|
64383
64351
|
return result;
|
|
64384
64352
|
}
|
|
64385
64353
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
64386
|
-
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags &
|
|
64354
|
+
const declaration = type.objectFlags & 4 /* Reference */ ? type.node : type.objectFlags & 16777216 /* InstantiationExpressionType */ ? type.node : type.objectFlags & 64 /* TypeAliasInstantiation */ ? type.node : type.symbol.declarations[0];
|
|
64387
64355
|
const links = getNodeLinks(declaration);
|
|
64388
|
-
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags &
|
|
64356
|
+
const target = type.objectFlags & 4 /* Reference */ ? links.resolvedType : type.objectFlags & 128 /* Instantiated */ ? type.target : type;
|
|
64389
64357
|
let typeParameters = links.outerTypeParameters;
|
|
64390
64358
|
if (!typeParameters) {
|
|
64391
64359
|
let outerTypeParameters = getOuterTypeParameters(
|
|
@@ -64398,8 +64366,8 @@ function createTypeChecker(host) {
|
|
|
64398
64366
|
outerTypeParameters = addRange(outerTypeParameters, templateTagParameters);
|
|
64399
64367
|
}
|
|
64400
64368
|
typeParameters = outerTypeParameters || emptyArray;
|
|
64401
|
-
const allDeclarations = type.objectFlags & (4 /* Reference */ |
|
|
64402
|
-
typeParameters = (target.objectFlags & (4 /* Reference */ |
|
|
64369
|
+
const allDeclarations = type.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */) ? [declaration] : type.symbol.declarations;
|
|
64370
|
+
typeParameters = (target.objectFlags & (4 /* Reference */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */) || target.symbol.flags & 8192 /* Method */ || target.symbol.flags & 2048 /* TypeLiteral */) && !target.aliasTypeArguments ? filter(typeParameters, (tp) => some(allDeclarations, (d) => isTypeParameterPossiblyReferenced(tp, d))) : typeParameters;
|
|
64403
64371
|
links.outerTypeParameters = typeParameters;
|
|
64404
64372
|
}
|
|
64405
64373
|
if (typeParameters.length) {
|
|
@@ -64418,13 +64386,13 @@ function createTypeChecker(host) {
|
|
|
64418
64386
|
result = target.objectFlags & 4 /* Reference */ ? createDeferredTypeReference(type.target, type.node, newMapper, newAliasSymbol, newAliasTypeArguments) : target.objectFlags & 32 /* Mapped */ ? instantiateMappedType(target, newMapper, newAliasSymbol, newAliasTypeArguments) : instantiateAnonymousType(target, newMapper, newAliasSymbol, newAliasTypeArguments);
|
|
64419
64387
|
target.instantiations.set(id, result);
|
|
64420
64388
|
const resultObjectFlags = getObjectFlags(result);
|
|
64421
|
-
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags &
|
|
64389
|
+
if (result.flags & 3899393 /* ObjectFlagsType */ && !(resultObjectFlags & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
64422
64390
|
const resultCouldContainTypeVariables = some(typeArguments, couldContainTypeVariables);
|
|
64423
|
-
if (!(getObjectFlags(result) &
|
|
64391
|
+
if (!(getObjectFlags(result) & 1048576 /* CouldContainTypeVariablesComputed */)) {
|
|
64424
64392
|
if (resultObjectFlags & (32 /* Mapped */ | 16 /* Anonymous */ | 4 /* Reference */)) {
|
|
64425
|
-
result.objectFlags |=
|
|
64393
|
+
result.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (resultCouldContainTypeVariables ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
64426
64394
|
} else {
|
|
64427
|
-
result.objectFlags |= !resultCouldContainTypeVariables ?
|
|
64395
|
+
result.objectFlags |= !resultCouldContainTypeVariables ? 1048576 /* CouldContainTypeVariablesComputed */ : 0;
|
|
64428
64396
|
}
|
|
64429
64397
|
}
|
|
64430
64398
|
}
|
|
@@ -64554,8 +64522,7 @@ function createTypeChecker(host) {
|
|
|
64554
64522
|
) : strictNullChecks && modifiers & 8 /* ExcludeOptional */ && isOptional ? getTypeWithFacts(propType, 524288 /* NEUndefined */) : propType;
|
|
64555
64523
|
}
|
|
64556
64524
|
function instantiateAnonymousType(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
64557
|
-
|
|
64558
|
-
const result = createObjectType(type.objectFlags & ~(524288 /* CouldContainTypeVariablesComputed */ | 1048576 /* CouldContainTypeVariables */) | 64 /* Instantiated */, type.symbol);
|
|
64525
|
+
const result = createObjectType(type.objectFlags & ~(1048576 /* CouldContainTypeVariablesComputed */ | 2097152 /* CouldContainTypeVariables */) | 128 /* Instantiated */, type.symbol);
|
|
64559
64526
|
if (type.objectFlags & 32 /* Mapped */) {
|
|
64560
64527
|
result.declaration = type.declaration;
|
|
64561
64528
|
const origTypeParameter = getTypeParameterFromMappedType(type);
|
|
@@ -64563,8 +64530,10 @@ function createTypeChecker(host) {
|
|
|
64563
64530
|
result.typeParameter = freshTypeParameter;
|
|
64564
64531
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
64565
64532
|
freshTypeParameter.mapper = mapper;
|
|
64566
|
-
}
|
|
64567
|
-
|
|
64533
|
+
} else if (type.objectFlags & 16777216 /* InstantiationExpressionType */) {
|
|
64534
|
+
result.node = type.node;
|
|
64535
|
+
} else if (type.objectFlags & 64 /* TypeAliasInstantiation */) {
|
|
64536
|
+
result.typeAlias = type.typeAlias;
|
|
64568
64537
|
result.node = type.node;
|
|
64569
64538
|
}
|
|
64570
64539
|
result.target = type;
|
|
@@ -64625,13 +64594,13 @@ function createTypeChecker(host) {
|
|
|
64625
64594
|
}
|
|
64626
64595
|
if (flags & 524288 /* Object */) {
|
|
64627
64596
|
const objectFlags = type.objectFlags;
|
|
64628
|
-
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */)) {
|
|
64597
|
+
if (objectFlags & (4 /* Reference */ | 16 /* Anonymous */ | 32 /* Mapped */ | 64 /* TypeAliasInstantiation */)) {
|
|
64629
64598
|
if (objectFlags & 4 /* Reference */ && !type.node) {
|
|
64630
64599
|
const resolvedTypeArguments = type.resolvedTypeArguments;
|
|
64631
64600
|
const newTypeArguments = instantiateTypes(resolvedTypeArguments, mapper);
|
|
64632
64601
|
return newTypeArguments !== resolvedTypeArguments ? createNormalizedTypeReference(type.target, newTypeArguments) : type;
|
|
64633
64602
|
}
|
|
64634
|
-
if (objectFlags &
|
|
64603
|
+
if (objectFlags & 2048 /* ReverseMapped */) {
|
|
64635
64604
|
return instantiateReverseMappedType(type, mapper);
|
|
64636
64605
|
}
|
|
64637
64606
|
return getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
@@ -65567,11 +65536,11 @@ function createTypeChecker(host) {
|
|
|
65567
65536
|
}
|
|
65568
65537
|
function isUnknownLikeUnionType(type) {
|
|
65569
65538
|
if (strictNullChecks && type.flags & 1048576 /* Union */) {
|
|
65570
|
-
if (!(type.objectFlags &
|
|
65539
|
+
if (!(type.objectFlags & 67108864 /* IsUnknownLikeUnionComputed */)) {
|
|
65571
65540
|
const types = type.types;
|
|
65572
|
-
type.objectFlags |=
|
|
65541
|
+
type.objectFlags |= 67108864 /* IsUnknownLikeUnionComputed */ | (types.length >= 3 && types[0].flags & 32768 /* Undefined */ && types[1].flags & 65536 /* Null */ && some(types, isEmptyAnonymousObjectType) ? 134217728 /* IsUnknownLikeUnion */ : 0);
|
|
65573
65542
|
}
|
|
65574
|
-
return !!(type.objectFlags &
|
|
65543
|
+
return !!(type.objectFlags & 134217728 /* IsUnknownLikeUnion */);
|
|
65575
65544
|
}
|
|
65576
65545
|
return false;
|
|
65577
65546
|
}
|
|
@@ -65682,7 +65651,7 @@ function createTypeChecker(host) {
|
|
|
65682
65651
|
return true;
|
|
65683
65652
|
if (s & 65536 /* Null */ && (!strictNullChecks && !(t & 3145728 /* UnionOrIntersection */) || t & 65536 /* Null */))
|
|
65684
65653
|
return true;
|
|
65685
|
-
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) &
|
|
65654
|
+
if (s & 524288 /* Object */ && t & 67108864 /* NonPrimitive */ && !(relation === strictSubtypeRelation && isEmptyAnonymousObjectType(source) && !(getObjectFlags(source) & 16384 /* FreshLiteral */)))
|
|
65686
65655
|
return true;
|
|
65687
65656
|
if (relation === assignableRelation || relation === comparableRelation) {
|
|
65688
65657
|
if (s & 1 /* Any */)
|
|
@@ -65741,11 +65710,11 @@ function createTypeChecker(host) {
|
|
|
65741
65710
|
return false;
|
|
65742
65711
|
}
|
|
65743
65712
|
function isIgnoredJsxProperty(source, sourceProp) {
|
|
65744
|
-
return getObjectFlags(source) &
|
|
65713
|
+
return getObjectFlags(source) & 4096 /* JsxAttributes */ && isHyphenatedJsxName(sourceProp.escapedName);
|
|
65745
65714
|
}
|
|
65746
65715
|
function getNormalizedType(type, writing) {
|
|
65747
65716
|
while (true) {
|
|
65748
|
-
const t = isFreshLiteralType(type) ? type.regularType : isGenericTupleType(type) ? getNormalizedTupleType(type, writing) : getObjectFlags(type) & 4 /* Reference */ ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type : type.flags & 3145728 /* UnionOrIntersection */ ? getNormalizedUnionOrIntersectionType(type, writing) : type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : getSubstitutionIntersection(type) : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type;
|
|
65717
|
+
const t = isFreshLiteralType(type) ? type.regularType : isGenericTupleType(type) ? getNormalizedTupleType(type, writing) : getObjectFlags(type) & 4 /* Reference */ ? type.node ? createTypeReference(type.target, getTypeArguments(type)) : getSingleBaseForNonAugmentingSubtype(type) || type : getObjectFlags(type) & 64 /* TypeAliasInstantiation */ ? getResolvedTypeAliasInstantiation(type) : type.flags & 3145728 /* UnionOrIntersection */ ? getNormalizedUnionOrIntersectionType(type, writing) : type.flags & 33554432 /* Substitution */ ? writing ? type.baseType : getSubstitutionIntersection(type) : type.flags & 25165824 /* Simplifiable */ ? getSimplifiedType(type, writing) : type;
|
|
65749
65718
|
if (t === type)
|
|
65750
65719
|
return t;
|
|
65751
65720
|
type = t;
|
|
@@ -66135,7 +66104,7 @@ function createTypeChecker(host) {
|
|
|
66135
66104
|
if (relation === comparableRelation && !(target2.flags & 131072 /* Never */) && isSimpleTypeRelatedTo(target2, source2, relation) || isSimpleTypeRelatedTo(source2, target2, relation, reportErrors2 ? reportError : void 0))
|
|
66136
66105
|
return -1 /* True */;
|
|
66137
66106
|
if (source2.flags & 469499904 /* StructuredOrInstantiable */ || target2.flags & 469499904 /* StructuredOrInstantiable */) {
|
|
66138
|
-
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) &
|
|
66107
|
+
const isPerformingExcessPropertyChecks = !(intersectionState & 2 /* Target */) && (isObjectLiteralType2(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */);
|
|
66139
66108
|
if (isPerformingExcessPropertyChecks) {
|
|
66140
66109
|
if (hasExcessProperties(source2, target2, reportErrors2)) {
|
|
66141
66110
|
if (reportErrors2) {
|
|
@@ -66145,7 +66114,7 @@ function createTypeChecker(host) {
|
|
|
66145
66114
|
}
|
|
66146
66115
|
}
|
|
66147
66116
|
const isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source2)) && !(intersectionState & 2 /* Target */) && source2.flags & (402784252 /* Primitive */ | 524288 /* Object */ | 2097152 /* Intersection */) && source2 !== globalObjectType && target2.flags & (524288 /* Object */ | 2097152 /* Intersection */) && isWeakType(target2) && (getPropertiesOfType(source2).length > 0 || typeHasCallOrConstructSignatures(source2));
|
|
66148
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
66117
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
66149
66118
|
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source2, target2, isComparingJsxAttributes)) {
|
|
66150
66119
|
if (reportErrors2) {
|
|
66151
66120
|
const sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source2);
|
|
@@ -66210,7 +66179,7 @@ function createTypeChecker(host) {
|
|
|
66210
66179
|
tryElaborateErrorsForPrimitivesAndObjects(source2, target2);
|
|
66211
66180
|
} else if (source2.symbol && source2.flags & 524288 /* Object */ && globalObjectType === source2) {
|
|
66212
66181
|
reportError(Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
66213
|
-
} else if (getObjectFlags(source2) &
|
|
66182
|
+
} else if (getObjectFlags(source2) & 4096 /* JsxAttributes */ && target2.flags & 2097152 /* Intersection */) {
|
|
66214
66183
|
const targetTypes = target2.types;
|
|
66215
66184
|
const intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
66216
66185
|
const intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
@@ -66241,7 +66210,7 @@ function createTypeChecker(host) {
|
|
|
66241
66210
|
if (source2.flags & 3145728 /* UnionOrIntersection */ && target2.flags & 3145728 /* UnionOrIntersection */) {
|
|
66242
66211
|
const sourceUnionOrIntersection = source2;
|
|
66243
66212
|
const targetUnionOrIntersection = target2;
|
|
66244
|
-
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags &
|
|
66213
|
+
if (sourceUnionOrIntersection.objectFlags & targetUnionOrIntersection.objectFlags & 65536 /* PrimitiveUnion */) {
|
|
66245
66214
|
return;
|
|
66246
66215
|
}
|
|
66247
66216
|
const sourceSize = sourceUnionOrIntersection.types.length;
|
|
@@ -66275,10 +66244,10 @@ function createTypeChecker(host) {
|
|
|
66275
66244
|
}
|
|
66276
66245
|
function hasExcessProperties(source2, target2, reportErrors2) {
|
|
66277
66246
|
var _a2;
|
|
66278
|
-
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) &
|
|
66247
|
+
if (!isExcessPropertyCheckTarget(target2) || !noImplicitAny && getObjectFlags(target2) & 8192 /* JSLiteral */) {
|
|
66279
66248
|
return false;
|
|
66280
66249
|
}
|
|
66281
|
-
const isComparingJsxAttributes = !!(getObjectFlags(source2) &
|
|
66250
|
+
const isComparingJsxAttributes = !!(getObjectFlags(source2) & 4096 /* JsxAttributes */);
|
|
66282
66251
|
if ((relation === assignableRelation || relation === comparableRelation) && (isTypeSubsetOf(globalObjectType, target2) || !isComparingJsxAttributes && isEmptyObjectType(target2))) {
|
|
66283
66252
|
return false;
|
|
66284
66253
|
}
|
|
@@ -66417,7 +66386,7 @@ function createTypeChecker(host) {
|
|
|
66417
66386
|
if (containsType(targetTypes, source2)) {
|
|
66418
66387
|
return -1 /* True */;
|
|
66419
66388
|
}
|
|
66420
|
-
if (relation !== comparableRelation && getObjectFlags(target2) &
|
|
66389
|
+
if (relation !== comparableRelation && getObjectFlags(target2) & 65536 /* PrimitiveUnion */ && !(source2.flags & 1024 /* EnumLiteral */) && (source2.flags & (128 /* StringLiteral */ | 512 /* BooleanLiteral */ | 2048 /* BigIntLiteral */) || (relation === subtypeRelation || relation === strictSubtypeRelation) && source2.flags & 256 /* NumberLiteral */)) {
|
|
66421
66390
|
const alternateForm = source2 === source2.regularType ? source2.freshType : source2.regularType;
|
|
66422
66391
|
const primitive = source2.flags & 128 /* StringLiteral */ ? stringType : source2.flags & 256 /* NumberLiteral */ ? numberType : source2.flags & 2048 /* BigIntLiteral */ ? bigintType : void 0;
|
|
66423
66392
|
return primitive && containsType(targetTypes, primitive) || alternateForm && containsType(targetTypes, alternateForm) ? -1 /* True */ : 0 /* False */;
|
|
@@ -66821,7 +66790,7 @@ function createTypeChecker(host) {
|
|
|
66821
66790
|
false,
|
|
66822
66791
|
0 /* None */
|
|
66823
66792
|
);
|
|
66824
|
-
if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) &
|
|
66793
|
+
if (result2 && isObjectLiteralType2(source2) && getObjectFlags(source2) & 16384 /* FreshLiteral */) {
|
|
66825
66794
|
result2 &= indexSignaturesRelatedTo(
|
|
66826
66795
|
source2,
|
|
66827
66796
|
target2,
|
|
@@ -66831,7 +66800,7 @@ function createTypeChecker(host) {
|
|
|
66831
66800
|
0 /* None */
|
|
66832
66801
|
);
|
|
66833
66802
|
}
|
|
66834
|
-
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) &
|
|
66803
|
+
} else if (result2 && isNonGenericObjectType(target2) && !isArrayOrTupleType(target2) && source2.flags & 2097152 /* Intersection */ && getApparentType(source2).flags & 3670016 /* StructuredType */ && !some(source2.types, (t) => t === target2 || !!(getObjectFlags(t) & 524288 /* NonInferrableType */))) {
|
|
66835
66804
|
result2 &= propertiesRelatedTo(
|
|
66836
66805
|
source2,
|
|
66837
66806
|
target2,
|
|
@@ -67332,7 +67301,7 @@ function createTypeChecker(host) {
|
|
|
67332
67301
|
if (constraint !== source2) {
|
|
67333
67302
|
return isRelatedTo(constraint, target2, 1 /* Source */, reportErrors2);
|
|
67334
67303
|
}
|
|
67335
|
-
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) &
|
|
67304
|
+
} else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target2) && getObjectFlags(target2) & 16384 /* FreshLiteral */ && !isEmptyObjectType(source2)) {
|
|
67336
67305
|
return 0 /* False */;
|
|
67337
67306
|
}
|
|
67338
67307
|
if (sourceFlags & (524288 /* Object */ | 2097152 /* Intersection */) && targetFlags & 524288 /* Object */) {
|
|
@@ -67864,7 +67833,7 @@ function createTypeChecker(host) {
|
|
|
67864
67833
|
const incompatibleReporter = kind === 1 /* Construct */ ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
67865
67834
|
const sourceObjectFlags = getObjectFlags(source2);
|
|
67866
67835
|
const targetObjectFlags = getObjectFlags(target2);
|
|
67867
|
-
if (sourceObjectFlags &
|
|
67836
|
+
if (sourceObjectFlags & 128 /* Instantiated */ && targetObjectFlags & 128 /* Instantiated */ && source2.symbol === target2.symbol || sourceObjectFlags & 4 /* Reference */ && targetObjectFlags & 4 /* Reference */ && source2.target === target2.target) {
|
|
67868
67837
|
Debug.assertEqual(sourceSignatures.length, targetSignatures.length);
|
|
67869
67838
|
for (let i = 0; i < targetSignatures.length; i++) {
|
|
67870
67839
|
const related = signatureRelatedTo(
|
|
@@ -68080,7 +68049,7 @@ function createTypeChecker(host) {
|
|
|
68080
68049
|
if (sourceInfo) {
|
|
68081
68050
|
return indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors2, intersectionState);
|
|
68082
68051
|
}
|
|
68083
|
-
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) &
|
|
68052
|
+
if (!(intersectionState & 1 /* Source */) && (relation !== strictSubtypeRelation || getObjectFlags(source2) & 16384 /* FreshLiteral */) && isObjectTypeWithInferableIndex(source2)) {
|
|
68084
68053
|
return membersRelatedToIndexInfo(source2, targetInfo, reportErrors2, intersectionState);
|
|
68085
68054
|
}
|
|
68086
68055
|
if (reportErrors2) {
|
|
@@ -68354,11 +68323,11 @@ function createTypeChecker(host) {
|
|
|
68354
68323
|
}
|
|
68355
68324
|
function isDeeplyNestedType(type, stack, depth, maxDepth = 3) {
|
|
68356
68325
|
if (depth >= maxDepth) {
|
|
68357
|
-
if ((getObjectFlags(type) &
|
|
68326
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
68358
68327
|
type = getMappedTargetWithSymbol(type);
|
|
68359
68328
|
}
|
|
68360
68329
|
if (type.flags & 2097152 /* Intersection */) {
|
|
68361
|
-
return some(type.types, (t) => isDeeplyNestedType(t, stack, depth, maxDepth));
|
|
68330
|
+
return some(type.types, (t) => isDeeplyNestedType(getResolvedType(t), stack, depth, maxDepth));
|
|
68362
68331
|
}
|
|
68363
68332
|
const identity2 = getRecursionIdentity(type);
|
|
68364
68333
|
let count = 0;
|
|
@@ -68380,17 +68349,17 @@ function createTypeChecker(host) {
|
|
|
68380
68349
|
}
|
|
68381
68350
|
function getMappedTargetWithSymbol(type) {
|
|
68382
68351
|
let target;
|
|
68383
|
-
while ((getObjectFlags(type) &
|
|
68352
|
+
while ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */ && (target = getModifiersTypeFromMappedType(type)) && (target.symbol || target.flags & 2097152 /* Intersection */ && some(target.types, (t) => !!t.symbol))) {
|
|
68384
68353
|
type = target;
|
|
68385
68354
|
}
|
|
68386
68355
|
return type;
|
|
68387
68356
|
}
|
|
68388
68357
|
function hasMatchingRecursionIdentity(type, identity2) {
|
|
68389
|
-
if ((getObjectFlags(type) &
|
|
68358
|
+
if ((getObjectFlags(type) & 160 /* InstantiatedMapped */) === 160 /* InstantiatedMapped */) {
|
|
68390
68359
|
type = getMappedTargetWithSymbol(type);
|
|
68391
68360
|
}
|
|
68392
68361
|
if (type.flags & 2097152 /* Intersection */) {
|
|
68393
|
-
return some(type.types, (t) => hasMatchingRecursionIdentity(t, identity2));
|
|
68362
|
+
return some(type.types, (t) => hasMatchingRecursionIdentity(getResolvedType(t), identity2));
|
|
68394
68363
|
}
|
|
68395
68364
|
return getRecursionIdentity(type) === identity2;
|
|
68396
68365
|
}
|
|
@@ -68573,10 +68542,10 @@ function createTypeChecker(host) {
|
|
|
68573
68542
|
if (!(getObjectFlags(type) & 4 /* Reference */) || !(getObjectFlags(type.target) & 3 /* ClassOrInterface */)) {
|
|
68574
68543
|
return void 0;
|
|
68575
68544
|
}
|
|
68576
|
-
if (getObjectFlags(type) &
|
|
68577
|
-
return getObjectFlags(type) &
|
|
68545
|
+
if (getObjectFlags(type) & 67108864 /* IdenticalBaseTypeCalculated */) {
|
|
68546
|
+
return getObjectFlags(type) & 134217728 /* IdenticalBaseTypeExists */ ? type.cachedEquivalentBaseType : void 0;
|
|
68578
68547
|
}
|
|
68579
|
-
type.objectFlags |=
|
|
68548
|
+
type.objectFlags |= 67108864 /* IdenticalBaseTypeCalculated */;
|
|
68580
68549
|
const target = type.target;
|
|
68581
68550
|
if (getObjectFlags(target) & 1 /* Class */) {
|
|
68582
68551
|
const baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -68595,7 +68564,7 @@ function createTypeChecker(host) {
|
|
|
68595
68564
|
if (length(getTypeArguments(type)) > length(target.typeParameters)) {
|
|
68596
68565
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, last(getTypeArguments(type)));
|
|
68597
68566
|
}
|
|
68598
|
-
type.objectFlags |=
|
|
68567
|
+
type.objectFlags |= 134217728 /* IdenticalBaseTypeExists */;
|
|
68599
68568
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
68600
68569
|
}
|
|
68601
68570
|
function isEmptyLiteralType(type) {
|
|
@@ -68780,7 +68749,7 @@ function createTypeChecker(host) {
|
|
|
68780
68749
|
}
|
|
68781
68750
|
function isObjectTypeWithInferableIndex(type) {
|
|
68782
68751
|
const objectFlags = getObjectFlags(type);
|
|
68783
|
-
return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags &
|
|
68752
|
+
return type.flags & 2097152 /* Intersection */ ? every(type.types, isObjectTypeWithInferableIndex) : !!(type.symbol && (type.symbol.flags & (4096 /* ObjectLiteral */ | 2048 /* TypeLiteral */ | 384 /* Enum */ | 512 /* ValueModule */)) !== 0 && !(type.symbol.flags & 32 /* Class */) && !typeHasCallOrConstructSignatures(type)) || !!(objectFlags & 8388608 /* ObjectRestType */) || !!(objectFlags & 2048 /* ReverseMapped */ && isObjectTypeWithInferableIndex(type.source));
|
|
68784
68753
|
}
|
|
68785
68754
|
function createSymbolWithType(source, type) {
|
|
68786
68755
|
const symbol = createSymbol(source.flags, source.escapedName, getCheckFlags(source) & 8 /* Readonly */);
|
|
@@ -68807,7 +68776,7 @@ function createTypeChecker(host) {
|
|
|
68807
68776
|
return members;
|
|
68808
68777
|
}
|
|
68809
68778
|
function getRegularTypeOfObjectLiteral(type) {
|
|
68810
|
-
if (!(isObjectLiteralType2(type) && getObjectFlags(type) &
|
|
68779
|
+
if (!(isObjectLiteralType2(type) && getObjectFlags(type) & 16384 /* FreshLiteral */)) {
|
|
68811
68780
|
return type;
|
|
68812
68781
|
}
|
|
68813
68782
|
const regularType = type.regularType;
|
|
@@ -68818,7 +68787,7 @@ function createTypeChecker(host) {
|
|
|
68818
68787
|
const members = transformTypeOfMembers(type, getRegularTypeOfObjectLiteral);
|
|
68819
68788
|
const regularNew = createAnonymousType(resolved.symbol, members, resolved.callSignatures, resolved.constructSignatures, resolved.indexInfos);
|
|
68820
68789
|
regularNew.flags = resolved.flags;
|
|
68821
|
-
regularNew.objectFlags |= resolved.objectFlags & ~
|
|
68790
|
+
regularNew.objectFlags |= resolved.objectFlags & ~16384 /* FreshLiteral */;
|
|
68822
68791
|
type.regularType = regularNew;
|
|
68823
68792
|
return regularNew;
|
|
68824
68793
|
}
|
|
@@ -68846,7 +68815,7 @@ function createTypeChecker(host) {
|
|
|
68846
68815
|
if (!context.resolvedProperties) {
|
|
68847
68816
|
const names = /* @__PURE__ */ new Map();
|
|
68848
68817
|
for (const t of getSiblingsOfContext(context)) {
|
|
68849
|
-
if (isObjectLiteralType2(t) && !(getObjectFlags(t) &
|
|
68818
|
+
if (isObjectLiteralType2(t) && !(getObjectFlags(t) & 4194304 /* ContainsSpread */)) {
|
|
68850
68819
|
for (const prop of getPropertiesOfType(t)) {
|
|
68851
68820
|
names.set(prop.escapedName, prop);
|
|
68852
68821
|
}
|
|
@@ -68893,7 +68862,7 @@ function createTypeChecker(host) {
|
|
|
68893
68862
|
}
|
|
68894
68863
|
}
|
|
68895
68864
|
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
68896
|
-
result.objectFlags |= getObjectFlags(type) & (
|
|
68865
|
+
result.objectFlags |= getObjectFlags(type) & (8192 /* JSLiteral */ | 524288 /* NonInferrableType */);
|
|
68897
68866
|
return result;
|
|
68898
68867
|
}
|
|
68899
68868
|
function getWidenedType(type) {
|
|
@@ -68904,7 +68873,7 @@ function createTypeChecker(host) {
|
|
|
68904
68873
|
);
|
|
68905
68874
|
}
|
|
68906
68875
|
function getWidenedTypeWithContext(type, context) {
|
|
68907
|
-
if (getObjectFlags(type) &
|
|
68876
|
+
if (getObjectFlags(type) & 393216 /* RequiresWidening */) {
|
|
68908
68877
|
if (context === void 0 && type.widened) {
|
|
68909
68878
|
return type.widened;
|
|
68910
68879
|
}
|
|
@@ -68937,7 +68906,7 @@ function createTypeChecker(host) {
|
|
|
68937
68906
|
}
|
|
68938
68907
|
function reportWideningErrorsInType(type) {
|
|
68939
68908
|
let errorReported = false;
|
|
68940
|
-
if (getObjectFlags(type) &
|
|
68909
|
+
if (getObjectFlags(type) & 131072 /* ContainsWideningType */) {
|
|
68941
68910
|
if (type.flags & 1048576 /* Union */) {
|
|
68942
68911
|
if (some(type.types, isEmptyObjectType)) {
|
|
68943
68912
|
errorReported = true;
|
|
@@ -68959,7 +68928,7 @@ function createTypeChecker(host) {
|
|
|
68959
68928
|
if (isObjectLiteralType2(type)) {
|
|
68960
68929
|
for (const p of getPropertiesOfObjectType(type)) {
|
|
68961
68930
|
const t = getTypeOfSymbol(p);
|
|
68962
|
-
if (getObjectFlags(t) &
|
|
68931
|
+
if (getObjectFlags(t) & 131072 /* ContainsWideningType */) {
|
|
68963
68932
|
if (!reportWideningErrorsInType(t)) {
|
|
68964
68933
|
error2(p.valueDeclaration, Diagnostics.Object_literal_s_property_0_implicitly_has_an_1_type, symbolToString(p), typeToString(getWidenedType(t)));
|
|
68965
68934
|
}
|
|
@@ -69047,7 +69016,7 @@ function createTypeChecker(host) {
|
|
|
69047
69016
|
}
|
|
69048
69017
|
function reportErrorsFromWidening(declaration, type, wideningKind) {
|
|
69049
69018
|
addLazyDiagnostic(() => {
|
|
69050
|
-
if (noImplicitAny && getObjectFlags(type) &
|
|
69019
|
+
if (noImplicitAny && getObjectFlags(type) & 131072 /* ContainsWideningType */ && (!wideningKind || !getContextualSignatureForFunctionLikeDeclaration(declaration))) {
|
|
69051
69020
|
if (!reportWideningErrorsInType(type)) {
|
|
69052
69021
|
reportImplicitAny(declaration, type, wideningKind);
|
|
69053
69022
|
}
|
|
@@ -69184,12 +69153,12 @@ function createTypeChecker(host) {
|
|
|
69184
69153
|
}
|
|
69185
69154
|
function couldContainTypeVariables(type) {
|
|
69186
69155
|
const objectFlags = getObjectFlags(type);
|
|
69187
|
-
if (objectFlags &
|
|
69188
|
-
return !!(objectFlags &
|
|
69156
|
+
if (objectFlags & 1048576 /* CouldContainTypeVariablesComputed */) {
|
|
69157
|
+
return !!(objectFlags & 2097152 /* CouldContainTypeVariables */);
|
|
69189
69158
|
}
|
|
69190
|
-
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ |
|
|
69159
|
+
const result = !!(type.flags & 465829888 /* Instantiable */ || type.flags & 524288 /* Object */ && !isNonGenericTopLevelType(type) && (objectFlags & 4 /* Reference */ && (type.node || some(getTypeArguments(type), couldContainTypeVariables)) || objectFlags & 16 /* Anonymous */ && type.symbol && type.symbol.flags & (16 /* Function */ | 8192 /* Method */ | 32 /* Class */ | 2048 /* TypeLiteral */ | 4096 /* ObjectLiteral */) && type.symbol.declarations || objectFlags & (32 /* Mapped */ | 2048 /* ReverseMapped */ | 8388608 /* ObjectRestType */ | 16777216 /* InstantiationExpressionType */ | 64 /* TypeAliasInstantiation */)) || type.flags & 3145728 /* UnionOrIntersection */ && !(type.flags & 1024 /* EnumLiteral */) && !isNonGenericTopLevelType(type) && some(type.types, couldContainTypeVariables));
|
|
69191
69160
|
if (type.flags & 3899393 /* ObjectFlagsType */) {
|
|
69192
|
-
type.objectFlags |=
|
|
69161
|
+
type.objectFlags |= 1048576 /* CouldContainTypeVariablesComputed */ | (result ? 2097152 /* CouldContainTypeVariables */ : 0);
|
|
69193
69162
|
}
|
|
69194
69163
|
return result;
|
|
69195
69164
|
}
|
|
@@ -69253,7 +69222,7 @@ function createTypeChecker(host) {
|
|
|
69253
69222
|
return type;
|
|
69254
69223
|
}
|
|
69255
69224
|
function isPartiallyInferableType(type) {
|
|
69256
|
-
return !(getObjectFlags(type) &
|
|
69225
|
+
return !(getObjectFlags(type) & 524288 /* NonInferrableType */) || isObjectLiteralType2(type) && some(getPropertiesOfType(type), (prop) => isPartiallyInferableType(getTypeOfSymbol(prop))) || isTupleType(type) && some(getElementTypes(type), isPartiallyInferableType);
|
|
69257
69226
|
}
|
|
69258
69227
|
function createReverseMappedType(source, target, constraint) {
|
|
69259
69228
|
if (!(getIndexInfoOfType(source, stringType) || getPropertiesOfType(source).length !== 0 && isPartiallyInferableType(source))) {
|
|
@@ -69268,7 +69237,7 @@ function createTypeChecker(host) {
|
|
|
69268
69237
|
return createTupleType(elementTypes, elementFlags, source.target.readonly, source.target.labeledElementDeclarations);
|
|
69269
69238
|
}
|
|
69270
69239
|
const reversed = createObjectType(
|
|
69271
|
-
|
|
69240
|
+
2048 /* ReverseMapped */ | 16 /* Anonymous */,
|
|
69272
69241
|
/*symbol*/
|
|
69273
69242
|
void 0
|
|
69274
69243
|
);
|
|
@@ -69489,6 +69458,8 @@ function createTypeChecker(host) {
|
|
|
69489
69458
|
propagationType = savePropagationType;
|
|
69490
69459
|
return;
|
|
69491
69460
|
}
|
|
69461
|
+
source = getResolvedType(source);
|
|
69462
|
+
target = getResolvedType(target);
|
|
69492
69463
|
if (source.aliasSymbol && source.aliasSymbol === target.aliasSymbol) {
|
|
69493
69464
|
if (source.aliasTypeArguments) {
|
|
69494
69465
|
const params = getSymbolLinks(source.aliasSymbol).typeParameters;
|
|
@@ -69539,7 +69510,7 @@ function createTypeChecker(host) {
|
|
|
69539
69510
|
}
|
|
69540
69511
|
const inference = getInferenceInfoForType(target);
|
|
69541
69512
|
if (inference) {
|
|
69542
|
-
if (getObjectFlags(source) &
|
|
69513
|
+
if (getObjectFlags(source) & 524288 /* NonInferrableType */ || source === nonInferrableAnyType) {
|
|
69543
69514
|
return;
|
|
69544
69515
|
}
|
|
69545
69516
|
if (!inference.isFixed) {
|
|
@@ -69823,7 +69794,7 @@ function createTypeChecker(host) {
|
|
|
69823
69794
|
inferWithPriority(
|
|
69824
69795
|
inferredType,
|
|
69825
69796
|
inference.typeParameter,
|
|
69826
|
-
getObjectFlags(source) &
|
|
69797
|
+
getObjectFlags(source) & 524288 /* NonInferrableType */ ? 16 /* PartialHomomorphicMappedType */ : 8 /* HomomorphicMappedType */
|
|
69827
69798
|
);
|
|
69828
69799
|
}
|
|
69829
69800
|
}
|
|
@@ -70078,10 +70049,10 @@ function createTypeChecker(host) {
|
|
|
70078
70049
|
return !!constraint && maybeTypeOfKind(constraint.flags & 16777216 /* Conditional */ ? getDefaultConstraintOfConditionalType(constraint) : constraint, 402784252 /* Primitive */ | 4194304 /* Index */ | 134217728 /* TemplateLiteral */ | 268435456 /* StringMapping */);
|
|
70079
70050
|
}
|
|
70080
70051
|
function isObjectLiteralType2(type) {
|
|
70081
|
-
return !!(getObjectFlags(type) &
|
|
70052
|
+
return !!(getObjectFlags(type) & 256 /* ObjectLiteral */);
|
|
70082
70053
|
}
|
|
70083
70054
|
function isObjectOrArrayLiteralType(type) {
|
|
70084
|
-
return !!(getObjectFlags(type) & (
|
|
70055
|
+
return !!(getObjectFlags(type) & (256 /* ObjectLiteral */ | 32768 /* ArrayLiteral */));
|
|
70085
70056
|
}
|
|
70086
70057
|
function unionObjectAndArrayLiteralCandidates(candidates) {
|
|
70087
70058
|
if (candidates.length > 1) {
|
|
@@ -70409,7 +70380,7 @@ function createTypeChecker(host) {
|
|
|
70409
70380
|
}
|
|
70410
70381
|
function getKeyPropertyName(unionType) {
|
|
70411
70382
|
const types = unionType.types;
|
|
70412
|
-
if (types.length < 10 || getObjectFlags(unionType) &
|
|
70383
|
+
if (types.length < 10 || getObjectFlags(unionType) & 65536 /* PrimitiveUnion */ || countWhere(types, (t) => !!(t.flags & (524288 /* Object */ | 58982400 /* InstantiableNonPrimitive */))) < 10) {
|
|
70413
70384
|
return void 0;
|
|
70414
70385
|
}
|
|
70415
70386
|
if (unionType.keyPropertyName === void 0) {
|
|
@@ -70798,7 +70769,7 @@ function createTypeChecker(host) {
|
|
|
70798
70769
|
}
|
|
70799
70770
|
return getUnionTypeFromSortedList(
|
|
70800
70771
|
filtered,
|
|
70801
|
-
type.objectFlags & (
|
|
70772
|
+
type.objectFlags & (65536 /* PrimitiveUnion */ | 33554432 /* ContainsIntersections */),
|
|
70802
70773
|
/*aliasSymbol*/
|
|
70803
70774
|
void 0,
|
|
70804
70775
|
/*aliasTypeArguments*/
|
|
@@ -70860,7 +70831,7 @@ function createTypeChecker(host) {
|
|
|
70860
70831
|
return incomplete ? { flags: 0, type: type.flags & 131072 /* Never */ ? silentNeverType : type } : type;
|
|
70861
70832
|
}
|
|
70862
70833
|
function createEvolvingArrayType(elementType) {
|
|
70863
|
-
const result = createObjectType(
|
|
70834
|
+
const result = createObjectType(512 /* EvolvingArray */);
|
|
70864
70835
|
result.elementType = elementType;
|
|
70865
70836
|
return result;
|
|
70866
70837
|
}
|
|
@@ -70880,16 +70851,16 @@ function createTypeChecker(host) {
|
|
|
70880
70851
|
return evolvingArrayType.finalArrayType || (evolvingArrayType.finalArrayType = createFinalArrayType(evolvingArrayType.elementType));
|
|
70881
70852
|
}
|
|
70882
70853
|
function finalizeEvolvingArrayType(type) {
|
|
70883
|
-
return getObjectFlags(type) &
|
|
70854
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? getFinalArrayType(type) : type;
|
|
70884
70855
|
}
|
|
70885
70856
|
function getElementTypeOfEvolvingArrayType(type) {
|
|
70886
|
-
return getObjectFlags(type) &
|
|
70857
|
+
return getObjectFlags(type) & 512 /* EvolvingArray */ ? type.elementType : neverType;
|
|
70887
70858
|
}
|
|
70888
70859
|
function isEvolvingArrayTypeList(types) {
|
|
70889
70860
|
let hasEvolvingArrayType = false;
|
|
70890
70861
|
for (const t of types) {
|
|
70891
70862
|
if (!(t.flags & 131072 /* Never */)) {
|
|
70892
|
-
if (!(getObjectFlags(t) &
|
|
70863
|
+
if (!(getObjectFlags(t) & 512 /* EvolvingArray */)) {
|
|
70893
70864
|
return false;
|
|
70894
70865
|
}
|
|
70895
70866
|
hasEvolvingArrayType = true;
|
|
@@ -71193,7 +71164,7 @@ function createTypeChecker(host) {
|
|
|
71193
71164
|
const sharedFlowStart = sharedFlowCount;
|
|
71194
71165
|
const evolvedType = getTypeFromFlowType(getTypeAtFlowNode(flowNode));
|
|
71195
71166
|
sharedFlowCount = sharedFlowStart;
|
|
71196
|
-
const resultType = getObjectFlags(evolvedType) &
|
|
71167
|
+
const resultType = getObjectFlags(evolvedType) & 512 /* EvolvingArray */ && isEvolvingArrayOperationTarget(reference) ? autoArrayType : finalizeEvolvingArrayType(evolvedType);
|
|
71197
71168
|
if (resultType === unreachableNeverType || reference.parent && reference.parent.kind === 235 /* NonNullExpression */ && !(resultType.flags & 131072 /* Never */) && getTypeWithFacts(resultType, 2097152 /* NEUndefinedOrNull */).flags & 131072 /* Never */) {
|
|
71198
71169
|
return declaredType;
|
|
71199
71170
|
}
|
|
@@ -71380,7 +71351,7 @@ function createTypeChecker(host) {
|
|
|
71380
71351
|
if (isMatchingReference(reference, getReferenceCandidate(expr))) {
|
|
71381
71352
|
const flowType = getTypeAtFlowNode(flow.antecedent);
|
|
71382
71353
|
const type = getTypeFromFlowType(flowType);
|
|
71383
|
-
if (getObjectFlags(type) &
|
|
71354
|
+
if (getObjectFlags(type) & 512 /* EvolvingArray */) {
|
|
71384
71355
|
let evolvedType2 = type;
|
|
71385
71356
|
if (node.kind === 213 /* CallExpression */) {
|
|
71386
71357
|
for (const arg of node.arguments) {
|
|
@@ -72233,7 +72204,7 @@ function createTypeChecker(host) {
|
|
|
72233
72204
|
location = location.parent;
|
|
72234
72205
|
}
|
|
72235
72206
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
72236
|
-
const type = removeOptionalTypeMarker(
|
|
72207
|
+
const type = getResolvedType(removeOptionalTypeMarker(
|
|
72237
72208
|
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
72238
72209
|
location,
|
|
72239
72210
|
/*checkMode*/
|
|
@@ -72241,7 +72212,7 @@ function createTypeChecker(host) {
|
|
|
72241
72212
|
/*writeOnly*/
|
|
72242
72213
|
true
|
|
72243
72214
|
) : getTypeOfExpression(location)
|
|
72244
|
-
);
|
|
72215
|
+
));
|
|
72245
72216
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
72246
72217
|
return type;
|
|
72247
72218
|
}
|
|
@@ -74289,7 +74260,7 @@ function createTypeChecker(host) {
|
|
|
74289
74260
|
let literalType = type.literalType;
|
|
74290
74261
|
if (!literalType) {
|
|
74291
74262
|
literalType = type.literalType = cloneTypeReference(type);
|
|
74292
|
-
literalType.objectFlags |=
|
|
74263
|
+
literalType.objectFlags |= 32768 /* ArrayLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
74293
74264
|
}
|
|
74294
74265
|
return literalType;
|
|
74295
74266
|
}
|
|
@@ -74417,7 +74388,7 @@ function createTypeChecker(host) {
|
|
|
74417
74388
|
checkTypeAssignableTo(type, getTypeFromTypeNode(enumTag.typeExpression), memberDecl);
|
|
74418
74389
|
}
|
|
74419
74390
|
}
|
|
74420
|
-
objectFlags |= getObjectFlags(type) &
|
|
74391
|
+
objectFlags |= getObjectFlags(type) & 917504 /* PropagatingFlags */;
|
|
74421
74392
|
const nameType = computedNameType && isTypeUsableAsPropertyName(computedNameType) ? computedNameType : void 0;
|
|
74422
74393
|
const prop = nameType ? createSymbol(4 /* Property */ | member.flags, getPropertyNameFromType(nameType), checkFlags | 4096 /* Late */) : createSymbol(4 /* Property */ | member.flags, member.escapedName, checkFlags);
|
|
74423
74394
|
if (nameType) {
|
|
@@ -74428,7 +74399,7 @@ function createTypeChecker(host) {
|
|
|
74428
74399
|
if (isOptional) {
|
|
74429
74400
|
prop.flags |= 16777216 /* Optional */;
|
|
74430
74401
|
}
|
|
74431
|
-
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) &
|
|
74402
|
+
} else if (contextualTypeHasPattern && !(getObjectFlags(contextualType) & 1024 /* ObjectLiteralPatternWithComputedProperties */)) {
|
|
74432
74403
|
const impliedProp = getPropertyOfType(contextualType, member.escapedName);
|
|
74433
74404
|
if (impliedProp) {
|
|
74434
74405
|
prop.flags |= impliedProp.flags & 16777216 /* Optional */;
|
|
@@ -74540,12 +74511,12 @@ function createTypeChecker(host) {
|
|
|
74540
74511
|
if (hasComputedSymbolProperty)
|
|
74541
74512
|
indexInfos.push(getObjectLiteralIndexInfo(node, offset, propertiesArray, esSymbolType));
|
|
74542
74513
|
const result = createAnonymousType(node.symbol, propertiesTable, emptyArray, emptyArray, indexInfos);
|
|
74543
|
-
result.objectFlags |= objectFlags |
|
|
74514
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
74544
74515
|
if (isJSObjectLiteral) {
|
|
74545
|
-
result.objectFlags |=
|
|
74516
|
+
result.objectFlags |= 8192 /* JSLiteral */;
|
|
74546
74517
|
}
|
|
74547
74518
|
if (patternWithComputedProperties) {
|
|
74548
|
-
result.objectFlags |=
|
|
74519
|
+
result.objectFlags |= 1024 /* ObjectLiteralPatternWithComputedProperties */;
|
|
74549
74520
|
}
|
|
74550
74521
|
if (inDestructuringPattern) {
|
|
74551
74522
|
result.pattern = node;
|
|
@@ -74607,13 +74578,13 @@ function createTypeChecker(host) {
|
|
|
74607
74578
|
let hasSpreadAnyType = false;
|
|
74608
74579
|
let typeToIntersect;
|
|
74609
74580
|
let explicitlySpecifyChildrenAttribute = false;
|
|
74610
|
-
let objectFlags =
|
|
74581
|
+
let objectFlags = 4096 /* JsxAttributes */;
|
|
74611
74582
|
const jsxChildrenPropertyName = getJsxElementChildrenPropertyName(getJsxNamespaceAt(openingLikeElement));
|
|
74612
74583
|
for (const attributeDecl of attributes.properties) {
|
|
74613
74584
|
const member = attributeDecl.symbol;
|
|
74614
74585
|
if (isJsxAttribute(attributeDecl)) {
|
|
74615
74586
|
const exprType = checkJsxAttribute(attributeDecl, checkMode);
|
|
74616
|
-
objectFlags |= getObjectFlags(exprType) &
|
|
74587
|
+
objectFlags |= getObjectFlags(exprType) & 917504 /* PropagatingFlags */;
|
|
74617
74588
|
const attributeSymbol = createSymbol(4 /* Property */ | member.flags, member.escapedName);
|
|
74618
74589
|
attributeSymbol.declarations = member.declarations;
|
|
74619
74590
|
attributeSymbol.parent = member.parent;
|
|
@@ -74734,7 +74705,7 @@ function createTypeChecker(host) {
|
|
|
74734
74705
|
function createJsxAttributesType() {
|
|
74735
74706
|
objectFlags |= freshObjectLiteralFlag;
|
|
74736
74707
|
const result = createAnonymousType(attributes.symbol, attributesTable, emptyArray, emptyArray, emptyArray);
|
|
74737
|
-
result.objectFlags |= objectFlags |
|
|
74708
|
+
result.objectFlags |= objectFlags | 256 /* ObjectLiteral */ | 262144 /* ContainsObjectOrArrayLiteral */;
|
|
74738
74709
|
return result;
|
|
74739
74710
|
}
|
|
74740
74711
|
}
|
|
@@ -75127,7 +75098,7 @@ function createTypeChecker(host) {
|
|
|
75127
75098
|
return false;
|
|
75128
75099
|
}
|
|
75129
75100
|
function isExcessPropertyCheckTarget(type) {
|
|
75130
|
-
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) &
|
|
75101
|
+
return !!(type.flags & 524288 /* Object */ && !(getObjectFlags(type) & 1024 /* ObjectLiteralPatternWithComputedProperties */) || type.flags & 67108864 /* NonPrimitive */ || type.flags & 1048576 /* Union */ && some(type.types, isExcessPropertyCheckTarget) || type.flags & 2097152 /* Intersection */ && every(type.types, isExcessPropertyCheckTarget));
|
|
75131
75102
|
}
|
|
75132
75103
|
function checkJsxExpression(node, checkMode) {
|
|
75133
75104
|
checkGrammarJsxExpression(node);
|
|
@@ -77895,7 +77866,7 @@ function createTypeChecker(host) {
|
|
|
77895
77866
|
);
|
|
77896
77867
|
if ((_c = jsSymbol == null ? void 0 : jsSymbol.exports) == null ? void 0 : _c.size) {
|
|
77897
77868
|
const jsAssignmentType = createAnonymousType(jsSymbol, jsSymbol.exports, emptyArray, emptyArray, emptyArray);
|
|
77898
|
-
jsAssignmentType.objectFlags |=
|
|
77869
|
+
jsAssignmentType.objectFlags |= 8192 /* JSLiteral */;
|
|
77899
77870
|
return getIntersectionType([returnType, jsAssignmentType]);
|
|
77900
77871
|
}
|
|
77901
77872
|
}
|
|
@@ -78241,7 +78212,7 @@ function createTypeChecker(host) {
|
|
|
78241
78212
|
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
78242
78213
|
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
78243
78214
|
const result3 = createAnonymousType(createSymbol(0 /* None */, "__instantiationExpression" /* InstantiationExpression */), resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
78244
|
-
result3.objectFlags |=
|
|
78215
|
+
result3.objectFlags |= 16777216 /* InstantiationExpressionType */;
|
|
78245
78216
|
result3.node = node;
|
|
78246
78217
|
return result3;
|
|
78247
78218
|
}
|
|
@@ -79282,7 +79253,7 @@ function createTypeChecker(host) {
|
|
|
79282
79253
|
64 /* IsNonInferrable */
|
|
79283
79254
|
);
|
|
79284
79255
|
const returnOnlyType = createAnonymousType(node.symbol, emptySymbols, [returnOnlySignature], emptyArray, emptyArray);
|
|
79285
|
-
returnOnlyType.objectFlags |=
|
|
79256
|
+
returnOnlyType.objectFlags |= 524288 /* NonInferrableType */;
|
|
79286
79257
|
return links.contextFreeType = returnOnlyType;
|
|
79287
79258
|
}
|
|
79288
79259
|
}
|
|
@@ -87345,7 +87316,7 @@ function createTypeChecker(host) {
|
|
|
87345
87316
|
return void 0;
|
|
87346
87317
|
case 11 /* StringLiteral */:
|
|
87347
87318
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
87348
|
-
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node ||
|
|
87319
|
+
if (isExternalModuleImportEqualsDeclaration(node.parent.parent) && getExternalModuleImportEqualsDeclarationExpression(node.parent.parent) === node || (node.parent.kind === 272 /* ImportDeclaration */ || node.parent.kind === 278 /* ExportDeclaration */) && node.parent.moduleSpecifier === node || (isInJSFile(node) && isRequireCall(
|
|
87349
87320
|
node.parent,
|
|
87350
87321
|
/*requireStringLiteralLikeArgument*/
|
|
87351
87322
|
false
|
|
@@ -87895,7 +87866,7 @@ function createTypeChecker(host) {
|
|
|
87895
87866
|
true,
|
|
87896
87867
|
location
|
|
87897
87868
|
);
|
|
87898
|
-
const
|
|
87869
|
+
const resolvedValueSymbol = valueSymbol && valueSymbol.flags & 2097152 /* Alias */ ? resolveAlias(valueSymbol) : valueSymbol;
|
|
87899
87870
|
isTypeOnly || (isTypeOnly = !!(valueSymbol && getTypeOnlyAliasDeclaration(valueSymbol, 111551 /* Value */)));
|
|
87900
87871
|
const typeSymbol = resolveEntityName(
|
|
87901
87872
|
typeName,
|
|
@@ -87903,26 +87874,30 @@ function createTypeChecker(host) {
|
|
|
87903
87874
|
/*ignoreErrors*/
|
|
87904
87875
|
true,
|
|
87905
87876
|
/*dontResolveAlias*/
|
|
87906
|
-
|
|
87877
|
+
true,
|
|
87907
87878
|
location
|
|
87908
87879
|
);
|
|
87909
|
-
|
|
87880
|
+
const resolvedTypeSymbol = typeSymbol && typeSymbol.flags & 2097152 /* Alias */ ? resolveAlias(typeSymbol) : typeSymbol;
|
|
87881
|
+
if (!valueSymbol) {
|
|
87882
|
+
isTypeOnly || (isTypeOnly = !!(typeSymbol && getTypeOnlyAliasDeclaration(typeSymbol, 788968 /* Type */)));
|
|
87883
|
+
}
|
|
87884
|
+
if (resolvedValueSymbol && resolvedValueSymbol === resolvedTypeSymbol) {
|
|
87910
87885
|
const globalPromiseSymbol = getGlobalPromiseConstructorSymbol(
|
|
87911
87886
|
/*reportErrors*/
|
|
87912
87887
|
false
|
|
87913
87888
|
);
|
|
87914
|
-
if (globalPromiseSymbol &&
|
|
87889
|
+
if (globalPromiseSymbol && resolvedValueSymbol === globalPromiseSymbol) {
|
|
87915
87890
|
return 9 /* Promise */;
|
|
87916
87891
|
}
|
|
87917
|
-
const constructorType = getTypeOfSymbol(
|
|
87892
|
+
const constructorType = getTypeOfSymbol(resolvedValueSymbol);
|
|
87918
87893
|
if (constructorType && isConstructorType(constructorType)) {
|
|
87919
87894
|
return isTypeOnly ? 10 /* TypeWithCallSignature */ : 1 /* TypeWithConstructSignatureAndValue */;
|
|
87920
87895
|
}
|
|
87921
87896
|
}
|
|
87922
|
-
if (!
|
|
87897
|
+
if (!resolvedTypeSymbol) {
|
|
87923
87898
|
return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */;
|
|
87924
87899
|
}
|
|
87925
|
-
const type = getDeclaredTypeOfSymbol(
|
|
87900
|
+
const type = getDeclaredTypeOfSymbol(resolvedTypeSymbol);
|
|
87926
87901
|
if (isErrorType(type)) {
|
|
87927
87902
|
return isTypeOnly ? 11 /* ObjectType */ : 0 /* Unknown */;
|
|
87928
87903
|
} else if (type.flags & 3 /* AnyOrUnknown */) {
|
|
@@ -90054,7 +90029,7 @@ function createTypeChecker(host) {
|
|
|
90054
90029
|
}
|
|
90055
90030
|
}
|
|
90056
90031
|
function findBestTypeForObjectLiteral(source, unionTarget) {
|
|
90057
|
-
if (getObjectFlags(source) &
|
|
90032
|
+
if (getObjectFlags(source) & 256 /* ObjectLiteral */ && someType(unionTarget, isArrayLikeType)) {
|
|
90058
90033
|
return find(unionTarget.types, (t) => !isArrayLikeType(t));
|
|
90059
90034
|
}
|
|
90060
90035
|
}
|
|
@@ -91580,13 +91555,13 @@ var visitEachChildTable = {
|
|
|
91580
91555
|
);
|
|
91581
91556
|
},
|
|
91582
91557
|
// Transformation nodes
|
|
91583
|
-
[
|
|
91558
|
+
[360 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
91584
91559
|
return context.factory.updatePartiallyEmittedExpression(
|
|
91585
91560
|
node,
|
|
91586
91561
|
Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
|
|
91587
91562
|
);
|
|
91588
91563
|
},
|
|
91589
|
-
[
|
|
91564
|
+
[361 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
91590
91565
|
return context.factory.updateCommaListExpression(
|
|
91591
91566
|
node,
|
|
91592
91567
|
nodesVisitor(node.elements, visitor, isExpression)
|
|
@@ -93563,9 +93538,50 @@ function transformTypeScript(context) {
|
|
|
93563
93538
|
return visitorWorker(node);
|
|
93564
93539
|
}
|
|
93565
93540
|
}
|
|
93566
|
-
function
|
|
93541
|
+
function isElisionBlocked(node) {
|
|
93567
93542
|
const parsed = getParseTreeNode(node);
|
|
93568
|
-
if (parsed
|
|
93543
|
+
if (parsed === node || isExportAssignment(node)) {
|
|
93544
|
+
return false;
|
|
93545
|
+
}
|
|
93546
|
+
if (!parsed || parsed.kind !== node.kind) {
|
|
93547
|
+
return true;
|
|
93548
|
+
}
|
|
93549
|
+
switch (node.kind) {
|
|
93550
|
+
case 272 /* ImportDeclaration */:
|
|
93551
|
+
Debug.assertNode(parsed, isImportDeclaration);
|
|
93552
|
+
if (node.importClause !== parsed.importClause) {
|
|
93553
|
+
return true;
|
|
93554
|
+
}
|
|
93555
|
+
if (node.attributes !== parsed.attributes) {
|
|
93556
|
+
return true;
|
|
93557
|
+
}
|
|
93558
|
+
break;
|
|
93559
|
+
case 271 /* ImportEqualsDeclaration */:
|
|
93560
|
+
Debug.assertNode(parsed, isImportEqualsDeclaration);
|
|
93561
|
+
if (node.name !== parsed.name) {
|
|
93562
|
+
return true;
|
|
93563
|
+
}
|
|
93564
|
+
if (node.isTypeOnly !== parsed.isTypeOnly) {
|
|
93565
|
+
return true;
|
|
93566
|
+
}
|
|
93567
|
+
if (node.moduleReference !== parsed.moduleReference && (isEntityName(node.moduleReference) || isEntityName(parsed.moduleReference))) {
|
|
93568
|
+
return true;
|
|
93569
|
+
}
|
|
93570
|
+
break;
|
|
93571
|
+
case 278 /* ExportDeclaration */:
|
|
93572
|
+
Debug.assertNode(parsed, isExportDeclaration);
|
|
93573
|
+
if (node.exportClause !== parsed.exportClause) {
|
|
93574
|
+
return true;
|
|
93575
|
+
}
|
|
93576
|
+
if (node.attributes !== parsed.attributes) {
|
|
93577
|
+
return true;
|
|
93578
|
+
}
|
|
93579
|
+
break;
|
|
93580
|
+
}
|
|
93581
|
+
return false;
|
|
93582
|
+
}
|
|
93583
|
+
function visitElidableStatement(node) {
|
|
93584
|
+
if (isElisionBlocked(node)) {
|
|
93569
93585
|
if (node.transformFlags & 1 /* ContainsTypeScript */) {
|
|
93570
93586
|
return visitEachChild(node, visitor, context);
|
|
93571
93587
|
}
|
|
@@ -95410,7 +95426,7 @@ function transformClassFields(context) {
|
|
|
95410
95426
|
/*discarded*/
|
|
95411
95427
|
true
|
|
95412
95428
|
);
|
|
95413
|
-
case
|
|
95429
|
+
case 361 /* CommaListExpression */:
|
|
95414
95430
|
return visitCommaListExpression(
|
|
95415
95431
|
node,
|
|
95416
95432
|
/*discarded*/
|
|
@@ -98503,7 +98519,7 @@ function transformESDecorators(context) {
|
|
|
98503
98519
|
return visitForStatement(node);
|
|
98504
98520
|
case 244 /* ExpressionStatement */:
|
|
98505
98521
|
return visitExpressionStatement(node);
|
|
98506
|
-
case
|
|
98522
|
+
case 361 /* CommaListExpression */:
|
|
98507
98523
|
return visitCommaListExpression(
|
|
98508
98524
|
node,
|
|
98509
98525
|
/*discarded*/
|
|
@@ -98515,7 +98531,7 @@ function transformESDecorators(context) {
|
|
|
98515
98531
|
/*discarded*/
|
|
98516
98532
|
false
|
|
98517
98533
|
);
|
|
98518
|
-
case
|
|
98534
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
98519
98535
|
return visitPartiallyEmittedExpression(
|
|
98520
98536
|
node,
|
|
98521
98537
|
/*discarded*/
|
|
@@ -98601,7 +98617,7 @@ function transformESDecorators(context) {
|
|
|
98601
98617
|
/*discarded*/
|
|
98602
98618
|
true
|
|
98603
98619
|
);
|
|
98604
|
-
case
|
|
98620
|
+
case 361 /* CommaListExpression */:
|
|
98605
98621
|
return visitCommaListExpression(
|
|
98606
98622
|
node,
|
|
98607
98623
|
/*discarded*/
|
|
@@ -101192,7 +101208,7 @@ function transformES2018(context) {
|
|
|
101192
101208
|
return visitObjectLiteralExpression(node);
|
|
101193
101209
|
case 226 /* BinaryExpression */:
|
|
101194
101210
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
101195
|
-
case
|
|
101211
|
+
case 361 /* CommaListExpression */:
|
|
101196
101212
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
101197
101213
|
case 299 /* CatchClause */:
|
|
101198
101214
|
return visitCatchClause(node);
|
|
@@ -104415,7 +104431,7 @@ function transformES2015(context) {
|
|
|
104415
104431
|
return visitParenthesizedExpression(node, expressionResultIsUnused2);
|
|
104416
104432
|
case 226 /* BinaryExpression */:
|
|
104417
104433
|
return visitBinaryExpression(node, expressionResultIsUnused2);
|
|
104418
|
-
case
|
|
104434
|
+
case 361 /* CommaListExpression */:
|
|
104419
104435
|
return visitCommaListExpression(node, expressionResultIsUnused2);
|
|
104420
104436
|
case 15 /* NoSubstitutionTemplateLiteral */:
|
|
104421
104437
|
case 16 /* TemplateHead */:
|
|
@@ -107781,7 +107797,7 @@ function transformGenerators(context) {
|
|
|
107781
107797
|
switch (node.kind) {
|
|
107782
107798
|
case 226 /* BinaryExpression */:
|
|
107783
107799
|
return visitBinaryExpression(node);
|
|
107784
|
-
case
|
|
107800
|
+
case 361 /* CommaListExpression */:
|
|
107785
107801
|
return visitCommaListExpression(node);
|
|
107786
107802
|
case 227 /* ConditionalExpression */:
|
|
107787
107803
|
return visitConditionalExpression(node);
|
|
@@ -110161,7 +110177,7 @@ function transformModule(context) {
|
|
|
110161
110177
|
return visitExpressionStatement(node);
|
|
110162
110178
|
case 217 /* ParenthesizedExpression */:
|
|
110163
110179
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
110164
|
-
case
|
|
110180
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
110165
110181
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
110166
110182
|
case 213 /* CallExpression */:
|
|
110167
110183
|
if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
|
|
@@ -112565,7 +112581,7 @@ function transformSystemModule(context) {
|
|
|
112565
112581
|
return visitExpressionStatement(node);
|
|
112566
112582
|
case 217 /* ParenthesizedExpression */:
|
|
112567
112583
|
return visitParenthesizedExpression(node, valueIsDiscarded);
|
|
112568
|
-
case
|
|
112584
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
112569
112585
|
return visitPartiallyEmittedExpression(node, valueIsDiscarded);
|
|
112570
112586
|
case 226 /* BinaryExpression */:
|
|
112571
112587
|
if (isDestructuringAssignment(node)) {
|
|
@@ -114681,8 +114697,6 @@ function transformDeclarations(context) {
|
|
|
114681
114697
|
}
|
|
114682
114698
|
if (isDeclaration(input) && isDeclarationAndNotVisible(input))
|
|
114683
114699
|
return;
|
|
114684
|
-
if (isJSDocImportTypeTag(input))
|
|
114685
|
-
return;
|
|
114686
114700
|
if (isFunctionLike(input) && resolver.isImplementationOfOverload(input))
|
|
114687
114701
|
return;
|
|
114688
114702
|
let previousEnclosingDeclaration;
|
|
@@ -115333,7 +115347,7 @@ function noEmitNotification(hint, node, callback) {
|
|
|
115333
115347
|
}
|
|
115334
115348
|
function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
|
|
115335
115349
|
var _a, _b;
|
|
115336
|
-
const enabledSyntaxKindFeatures = new Array(
|
|
115350
|
+
const enabledSyntaxKindFeatures = new Array(363 /* Count */);
|
|
115337
115351
|
let lexicalEnvironmentVariableDeclarations;
|
|
115338
115352
|
let lexicalEnvironmentFunctionDeclarations;
|
|
115339
115353
|
let lexicalEnvironmentStatements;
|
|
@@ -117235,9 +117249,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117235
117249
|
return emitJSDocTypedefTag(node);
|
|
117236
117250
|
case 354 /* JSDocSeeTag */:
|
|
117237
117251
|
return emitJSDocSeeTag(node);
|
|
117238
|
-
case
|
|
117239
|
-
return emitJSDocImportTypeTag(node);
|
|
117240
|
-
case 360 /* NotEmittedStatement */:
|
|
117252
|
+
case 359 /* NotEmittedStatement */:
|
|
117241
117253
|
return;
|
|
117242
117254
|
}
|
|
117243
117255
|
if (isExpression(node)) {
|
|
@@ -117338,15 +117350,15 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
117338
117350
|
return emitJsxSelfClosingElement(node);
|
|
117339
117351
|
case 288 /* JsxFragment */:
|
|
117340
117352
|
return emitJsxFragment(node);
|
|
117341
|
-
case
|
|
117353
|
+
case 358 /* SyntaxList */:
|
|
117342
117354
|
return Debug.fail("SyntaxList should not be printed");
|
|
117343
|
-
case
|
|
117355
|
+
case 359 /* NotEmittedStatement */:
|
|
117344
117356
|
return;
|
|
117345
|
-
case
|
|
117357
|
+
case 360 /* PartiallyEmittedExpression */:
|
|
117346
117358
|
return emitPartiallyEmittedExpression(node);
|
|
117347
|
-
case
|
|
117359
|
+
case 361 /* CommaListExpression */:
|
|
117348
117360
|
return emitCommaList(node);
|
|
117349
|
-
case
|
|
117361
|
+
case 362 /* SyntheticReferenceExpression */:
|
|
117350
117362
|
return Debug.fail("SyntheticReferenceExpression should not be printed");
|
|
117351
117363
|
}
|
|
117352
117364
|
}
|
|
@@ -119244,16 +119256,6 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
119244
119256
|
emit(tag.name);
|
|
119245
119257
|
emitJSDocComment(tag.comment);
|
|
119246
119258
|
}
|
|
119247
|
-
function emitJSDocImportTypeTag(tag) {
|
|
119248
|
-
emitJSDocTagName(tag.tagName);
|
|
119249
|
-
writeSpace();
|
|
119250
|
-
emit(tag.importClause);
|
|
119251
|
-
writeSpace();
|
|
119252
|
-
emitTokenWithComment(161 /* FromKeyword */, tag.importClause.end, writeKeyword, tag);
|
|
119253
|
-
writeSpace();
|
|
119254
|
-
emitExpression(tag.moduleSpecifier);
|
|
119255
|
-
emitJSDocComment(tag.comment);
|
|
119256
|
-
}
|
|
119257
119259
|
function emitJSDocNameReference(node) {
|
|
119258
119260
|
writeSpace();
|
|
119259
119261
|
writePunctuation("{");
|
|
@@ -120753,7 +120755,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
120753
120755
|
emitLeadingComments(
|
|
120754
120756
|
pos,
|
|
120755
120757
|
/*isEmittedNode*/
|
|
120756
|
-
node.kind !==
|
|
120758
|
+
node.kind !== 359 /* NotEmittedStatement */
|
|
120757
120759
|
);
|
|
120758
120760
|
}
|
|
120759
120761
|
if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
|
|
@@ -120777,7 +120779,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
120777
120779
|
containerPos = savedContainerPos;
|
|
120778
120780
|
containerEnd = savedContainerEnd;
|
|
120779
120781
|
declarationListContainerEnd = savedDeclarationListContainerEnd;
|
|
120780
|
-
if (!skipTrailingComments && node.kind !==
|
|
120782
|
+
if (!skipTrailingComments && node.kind !== 359 /* NotEmittedStatement */) {
|
|
120781
120783
|
emitTrailingComments(end);
|
|
120782
120784
|
}
|
|
120783
120785
|
}
|
|
@@ -121049,7 +121051,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
121049
121051
|
}
|
|
121050
121052
|
} else {
|
|
121051
121053
|
const source = sourceMapRange.source || sourceMapSource;
|
|
121052
|
-
if (node.kind !==
|
|
121054
|
+
if (node.kind !== 359 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
|
|
121053
121055
|
emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
|
|
121054
121056
|
}
|
|
121055
121057
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
@@ -121064,7 +121066,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
121064
121066
|
if (emitFlags & 128 /* NoNestedSourceMaps */) {
|
|
121065
121067
|
sourceMapsDisabled = false;
|
|
121066
121068
|
}
|
|
121067
|
-
if (node.kind !==
|
|
121069
|
+
if (node.kind !== 359 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
|
|
121068
121070
|
emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
|
|
121069
121071
|
}
|
|
121070
121072
|
}
|
|
@@ -124008,9 +124010,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124008
124010
|
if (file.flags & 4194304 /* PossiblyContainsDynamicImport */ || isJavaScriptFile) {
|
|
124009
124011
|
collectDynamicImportOrRequireCalls(file);
|
|
124010
124012
|
}
|
|
124011
|
-
if (isJavaScriptFile) {
|
|
124012
|
-
collectJsDocImportTypeReferences(file);
|
|
124013
|
-
}
|
|
124014
124013
|
file.imports = imports || emptyArray;
|
|
124015
124014
|
file.moduleAugmentations = moduleAugmentations || emptyArray;
|
|
124016
124015
|
file.ambientModuleNames = ambientModules || emptyArray;
|
|
@@ -124085,23 +124084,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
124085
124084
|
}
|
|
124086
124085
|
}
|
|
124087
124086
|
}
|
|
124088
|
-
function collectJsDocImportTypeReferences(file2) {
|
|
124089
|
-
const r = /@importType/g;
|
|
124090
|
-
while (r.exec(file2.text) !== null) {
|
|
124091
|
-
const node = getNodeAtPosition(file2, r.lastIndex);
|
|
124092
|
-
if (isJSDocImportTypeTag(node)) {
|
|
124093
|
-
const moduleNameExpr = getExternalModuleName(node);
|
|
124094
|
-
if (moduleNameExpr && isStringLiteral(moduleNameExpr) && moduleNameExpr.text) {
|
|
124095
|
-
setParentRecursive(
|
|
124096
|
-
node,
|
|
124097
|
-
/*incremental*/
|
|
124098
|
-
false
|
|
124099
|
-
);
|
|
124100
|
-
imports = append(imports, moduleNameExpr);
|
|
124101
|
-
}
|
|
124102
|
-
}
|
|
124103
|
-
}
|
|
124104
|
-
}
|
|
124105
124087
|
function getNodeAtPosition(sourceFile, position) {
|
|
124106
124088
|
let current = sourceFile;
|
|
124107
124089
|
const getContainingChild = (child) => {
|
|
@@ -134250,7 +134232,7 @@ function symbolEscapedNameNoDefault(symbol) {
|
|
|
134250
134232
|
});
|
|
134251
134233
|
}
|
|
134252
134234
|
function isModuleSpecifierLike(node) {
|
|
134253
|
-
return isStringLiteralLike(node) && (isExternalModuleReference(node.parent) || isImportDeclaration(node.parent) ||
|
|
134235
|
+
return isStringLiteralLike(node) && (isExternalModuleReference(node.parent) || isImportDeclaration(node.parent) || isRequireCall(
|
|
134254
134236
|
node.parent,
|
|
134255
134237
|
/*requireStringLiteralLikeArgument*/
|
|
134256
134238
|
false
|
|
@@ -140115,8 +140097,7 @@ function doChangeNamespaceToNamed(sourceFile, checker, changes, toConvert, allow
|
|
|
140115
140097
|
factory.createIdentifier(name)
|
|
140116
140098
|
));
|
|
140117
140099
|
});
|
|
140118
|
-
const importDecl =
|
|
140119
|
-
Debug.assert(importDecl, "Unexpected declaration");
|
|
140100
|
+
const importDecl = toConvert.parent.parent;
|
|
140120
140101
|
if (usedAsNamespaceOrDefault && !allowSyntheticDefaultImports) {
|
|
140121
140102
|
changes.insertNodeAfter(sourceFile, importDecl, updateImport(
|
|
140122
140103
|
importDecl,
|
|
@@ -140136,10 +140117,7 @@ function getLeftOfPropertyAccessOrQualifiedName(propertyAccessOrQualifiedName) {
|
|
|
140136
140117
|
}
|
|
140137
140118
|
function doChangeNamedToNamespaceOrDefault(sourceFile, program, changes, toConvert, shouldUseDefault = getShouldUseDefault(program, toConvert.parent)) {
|
|
140138
140119
|
const checker = program.getTypeChecker();
|
|
140139
|
-
const importDecl =
|
|
140140
|
-
if (importDecl === void 0) {
|
|
140141
|
-
Debug.assert(importDecl, "Unexpected declaration");
|
|
140142
|
-
}
|
|
140120
|
+
const importDecl = toConvert.parent.parent;
|
|
140143
140121
|
const { moduleSpecifier } = importDecl;
|
|
140144
140122
|
const toConvertSymbols = /* @__PURE__ */ new Set();
|
|
140145
140123
|
toConvert.elements.forEach((namedImport) => {
|
|
@@ -145416,7 +145394,7 @@ var NodeObject = class {
|
|
|
145416
145394
|
if (!children.length) {
|
|
145417
145395
|
return void 0;
|
|
145418
145396
|
}
|
|
145419
|
-
const child = find(children, (kid) => kid.kind < 316 /* FirstJSDocNode */ || kid.kind >
|
|
145397
|
+
const child = find(children, (kid) => kid.kind < 316 /* FirstJSDocNode */ || kid.kind > 357 /* LastJSDocNode */);
|
|
145420
145398
|
return child.kind < 166 /* FirstNode */ ? child : child.getFirstToken(sourceFile);
|
|
145421
145399
|
}
|
|
145422
145400
|
getLastToken(sourceFile) {
|
|
@@ -145483,7 +145461,7 @@ function addSyntheticNodes(nodes, pos, end, parent2) {
|
|
|
145483
145461
|
}
|
|
145484
145462
|
}
|
|
145485
145463
|
function createSyntaxList(nodes, parent2) {
|
|
145486
|
-
const list = createNode(
|
|
145464
|
+
const list = createNode(358 /* SyntaxList */, nodes.pos, nodes.end, parent2);
|
|
145487
145465
|
list._children = [];
|
|
145488
145466
|
let pos = nodes.pos;
|
|
145489
145467
|
for (const node of nodes) {
|
|
@@ -151083,7 +151061,7 @@ registerCodeFix({
|
|
|
151083
151061
|
const declaration = getDeclaration2(context.sourceFile, context.span.start);
|
|
151084
151062
|
if (declaration) {
|
|
151085
151063
|
const changes = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration));
|
|
151086
|
-
const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ &&
|
|
151064
|
+
const importDeclarationChanges = declaration.kind === 276 /* ImportSpecifier */ && canConvertImportDeclarationForSpecifier(declaration, context.sourceFile, context.program) ? ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange11(t, context.sourceFile, declaration.parent.parent.parent)) : void 0;
|
|
151087
151065
|
const mainAction = createCodeFixAction(
|
|
151088
151066
|
fixId13,
|
|
151089
151067
|
changes,
|
|
@@ -151109,7 +151087,7 @@ registerCodeFix({
|
|
|
151109
151087
|
if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 272 /* ImportDeclaration */ && !fixedImportDeclarations.has(errorDeclaration)) {
|
|
151110
151088
|
doChange11(changes, diag2.file, errorDeclaration);
|
|
151111
151089
|
fixedImportDeclarations.add(errorDeclaration);
|
|
151112
|
-
} else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ &&
|
|
151090
|
+
} else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */ && !fixedImportDeclarations.has(errorDeclaration.parent.parent.parent) && canConvertImportDeclarationForSpecifier(errorDeclaration, diag2.file, context.program)) {
|
|
151113
151091
|
doChange11(changes, diag2.file, errorDeclaration.parent.parent.parent);
|
|
151114
151092
|
fixedImportDeclarations.add(errorDeclaration.parent.parent.parent);
|
|
151115
151093
|
} else if ((errorDeclaration == null ? void 0 : errorDeclaration.kind) === 276 /* ImportSpecifier */) {
|
|
@@ -154364,7 +154342,7 @@ function createUndefined() {
|
|
|
154364
154342
|
return factory.createIdentifier("undefined");
|
|
154365
154343
|
}
|
|
154366
154344
|
function isObjectLiteralType(type) {
|
|
154367
|
-
return type.flags & 524288 /* Object */ && (getObjectFlags(type) &
|
|
154345
|
+
return type.flags & 524288 /* Object */ && (getObjectFlags(type) & 256 /* ObjectLiteral */ || type.symbol && tryCast(singleOrUndefined(type.symbol.declarations), isTypeLiteralNode));
|
|
154368
154346
|
}
|
|
154369
154347
|
function getUnmatchedAttributes(checker, target, source) {
|
|
154370
154348
|
const attrsType = checker.getContextualType(source.attributes);
|
|
@@ -158317,7 +158295,7 @@ function getInfo19(sourceFile, pos) {
|
|
|
158317
158295
|
const { parent: parent2 } = name;
|
|
158318
158296
|
if (isImportEqualsDeclaration(parent2) && isExternalModuleReference(parent2.moduleReference)) {
|
|
158319
158297
|
return { importNode: parent2, name, moduleSpecifier: parent2.moduleReference.expression };
|
|
158320
|
-
} else if (isNamespaceImport(parent2)
|
|
158298
|
+
} else if (isNamespaceImport(parent2)) {
|
|
158321
158299
|
const importNode = parent2.parent.parent;
|
|
158322
158300
|
return { importNode, name, moduleSpecifier: importNode.moduleSpecifier };
|
|
158323
158301
|
}
|
|
@@ -160793,7 +160771,6 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160793
160771
|
const insideComment = isInComment(sourceFile, position, currentToken);
|
|
160794
160772
|
log("getCompletionData: Is inside comment: " + (timestamp() - start2));
|
|
160795
160773
|
let insideJsDocTagTypeExpression = false;
|
|
160796
|
-
let insideJsDocImportTypeTag = false;
|
|
160797
160774
|
let isInSnippetScope = false;
|
|
160798
160775
|
if (insideComment) {
|
|
160799
160776
|
if (hasDocComment(sourceFile, position)) {
|
|
@@ -160811,28 +160788,24 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
160811
160788
|
if (tag.tagName.pos <= position && position <= tag.tagName.end) {
|
|
160812
160789
|
return { kind: 1 /* JsDocTagName */ };
|
|
160813
160790
|
}
|
|
160814
|
-
|
|
160815
|
-
|
|
160816
|
-
|
|
160817
|
-
|
|
160818
|
-
|
|
160819
|
-
currentToken = getTokenAtPosition(sourceFile, position);
|
|
160820
|
-
if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 355 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
|
|
160821
|
-
insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
|
|
160822
|
-
}
|
|
160823
|
-
}
|
|
160824
|
-
if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) {
|
|
160825
|
-
return { kind: 3 /* JsDocParameterName */, tag };
|
|
160791
|
+
const typeExpression = tryGetTypeExpressionFromTag(tag);
|
|
160792
|
+
if (typeExpression) {
|
|
160793
|
+
currentToken = getTokenAtPosition(sourceFile, position);
|
|
160794
|
+
if (!currentToken || !isDeclarationName(currentToken) && (currentToken.parent.kind !== 355 /* JSDocPropertyTag */ || currentToken.parent.name !== currentToken)) {
|
|
160795
|
+
insideJsDocTagTypeExpression = isCurrentlyEditingNode(typeExpression);
|
|
160826
160796
|
}
|
|
160827
160797
|
}
|
|
160798
|
+
if (!insideJsDocTagTypeExpression && isJSDocParameterTag(tag) && (nodeIsMissing(tag.name) || tag.name.pos <= position && position <= tag.name.end)) {
|
|
160799
|
+
return { kind: 3 /* JsDocParameterName */, tag };
|
|
160800
|
+
}
|
|
160828
160801
|
}
|
|
160829
|
-
if (!insideJsDocTagTypeExpression
|
|
160802
|
+
if (!insideJsDocTagTypeExpression) {
|
|
160830
160803
|
log("Returning an empty list because completion was inside a regular comment or plain text part of a JsDoc comment.");
|
|
160831
160804
|
return void 0;
|
|
160832
160805
|
}
|
|
160833
160806
|
}
|
|
160834
160807
|
start2 = timestamp();
|
|
160835
|
-
const isJsOnlyLocation = !insideJsDocTagTypeExpression &&
|
|
160808
|
+
const isJsOnlyLocation = !insideJsDocTagTypeExpression && isSourceFileJS(sourceFile);
|
|
160836
160809
|
const tokens = getRelevantTokens(position, sourceFile);
|
|
160837
160810
|
const previousToken = tokens.previousToken;
|
|
160838
160811
|
let contextToken = tokens.contextToken;
|
|
@@ -161345,7 +161318,7 @@ function getCompletionData(program, log, sourceFile, compilerOptions, position,
|
|
|
161345
161318
|
}
|
|
161346
161319
|
}
|
|
161347
161320
|
function isTypeOnlyCompletion() {
|
|
161348
|
-
return insideJsDocTagTypeExpression ||
|
|
161321
|
+
return insideJsDocTagTypeExpression || !!importStatementCompletion && isTypeOnlyImportOrExportDeclaration(location.parent) || !isContextTokenValueLocation(contextToken) && (isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker) || isPartOfTypeNode(location) || isContextTokenTypeLocation(contextToken));
|
|
161349
161322
|
}
|
|
161350
161323
|
function isContextTokenValueLocation(contextToken2) {
|
|
161351
161324
|
return contextToken2 && (contextToken2.kind === 114 /* TypeOfKeyword */ && (contextToken2.parent.kind === 186 /* TypeQuery */ || isTypeOfExpression(contextToken2.parent)) || contextToken2.kind === 131 /* AssertsKeyword */ && contextToken2.parent.kind === 182 /* TypePredicate */);
|
|
@@ -162367,7 +162340,7 @@ function getPropertiesForCompletion(type, checker) {
|
|
|
162367
162340
|
}
|
|
162368
162341
|
function tryGetObjectTypeDeclarationCompletionContainer(sourceFile, contextToken, location, position) {
|
|
162369
162342
|
switch (location.kind) {
|
|
162370
|
-
case
|
|
162343
|
+
case 358 /* SyntaxList */:
|
|
162371
162344
|
return tryCast(location.parent, isObjectTypeDeclaration);
|
|
162372
162345
|
case 1 /* EndOfFileToken */:
|
|
162373
162346
|
const cls = tryCast(lastOrUndefined(cast(location.parent, isSourceFile).statements), isObjectTypeDeclaration);
|
|
@@ -162598,13 +162571,13 @@ function getSingleLineReplacementSpanForImportCompletionNode(node) {
|
|
|
162598
162571
|
var _a;
|
|
162599
162572
|
if (!node)
|
|
162600
162573
|
return void 0;
|
|
162601
|
-
const top = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration
|
|
162574
|
+
const top = findAncestor(node, or(isImportDeclaration, isImportEqualsDeclaration)) ?? node;
|
|
162602
162575
|
const sourceFile = top.getSourceFile();
|
|
162603
162576
|
if (rangeIsOnSingleLine(top, sourceFile)) {
|
|
162604
162577
|
return createTextSpanFromNode(top, sourceFile);
|
|
162605
162578
|
}
|
|
162606
162579
|
Debug.assert(top.kind !== 102 /* ImportKeyword */ && top.kind !== 276 /* ImportSpecifier */);
|
|
162607
|
-
const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */
|
|
162580
|
+
const potentialSplitPoint = top.kind === 272 /* ImportDeclaration */ ? getPotentiallyInvalidImportSpecifier((_a = top.importClause) == null ? void 0 : _a.namedBindings) ?? top.moduleSpecifier : top.moduleReference;
|
|
162608
162581
|
const withoutModuleSpecifier = {
|
|
162609
162582
|
pos: top.getFirstToken().getStart(),
|
|
162610
162583
|
end: potentialSplitPoint.pos
|
|
@@ -162900,7 +162873,6 @@ function getStringLiteralCompletionEntries(sourceFile, node, position, program,
|
|
|
162900
162873
|
case 272 /* ImportDeclaration */:
|
|
162901
162874
|
case 278 /* ExportDeclaration */:
|
|
162902
162875
|
case 283 /* ExternalModuleReference */:
|
|
162903
|
-
case 358 /* JSDocImportTypeTag */:
|
|
162904
162876
|
return { kind: 0 /* Paths */, paths: getStringLiteralCompletionsFromModuleNames(sourceFile, node, program, host, preferences) };
|
|
162905
162877
|
case 296 /* CaseClause */:
|
|
162906
162878
|
const tracker = newCaseClauseTracker(typeChecker, parent2.parent.clauses);
|
|
@@ -163668,7 +163640,6 @@ function getImportersForExport(sourceFiles, sourceFilesSet, allDirectImports, {
|
|
|
163668
163640
|
);
|
|
163669
163641
|
break;
|
|
163670
163642
|
case 272 /* ImportDeclaration */:
|
|
163671
|
-
case 358 /* JSDocImportTypeTag */:
|
|
163672
163643
|
directImports.push(direct);
|
|
163673
163644
|
const namedBindings = direct.importClause && direct.importClause.namedBindings;
|
|
163674
163645
|
if (namedBindings && namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -167402,7 +167373,6 @@ var jsDocTagNames = [
|
|
|
167402
167373
|
"host",
|
|
167403
167374
|
"ignore",
|
|
167404
167375
|
"implements",
|
|
167405
|
-
"importType",
|
|
167406
167376
|
"inheritdoc",
|
|
167407
167377
|
"inner",
|
|
167408
167378
|
"instance",
|
|
@@ -167963,84 +167933,98 @@ function coalesceImportsWorker(importGroup, comparer, sourceFile, preferences) {
|
|
|
167963
167933
|
if (importGroup.length === 0) {
|
|
167964
167934
|
return importGroup;
|
|
167965
167935
|
}
|
|
167966
|
-
const
|
|
167967
|
-
|
|
167968
|
-
|
|
167969
|
-
|
|
167970
|
-
|
|
167971
|
-
|
|
167972
|
-
|
|
167973
|
-
|
|
167974
|
-
if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {
|
|
167975
|
-
const defaultImport = defaultImports[0];
|
|
167976
|
-
coalescedImports.push(
|
|
167977
|
-
updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)
|
|
167978
|
-
);
|
|
167979
|
-
continue;
|
|
167980
|
-
}
|
|
167981
|
-
const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
|
|
167982
|
-
for (const namespaceImport of sortedNamespaceImports) {
|
|
167983
|
-
coalescedImports.push(
|
|
167984
|
-
updateImportDeclarationAndClause(
|
|
167985
|
-
namespaceImport,
|
|
167986
|
-
/*name*/
|
|
167987
|
-
void 0,
|
|
167988
|
-
namespaceImport.importClause.namedBindings
|
|
167989
|
-
)
|
|
167990
|
-
);
|
|
167991
|
-
}
|
|
167992
|
-
const firstDefaultImport = firstOrUndefined(defaultImports);
|
|
167993
|
-
const firstNamedImport = firstOrUndefined(namedImports);
|
|
167994
|
-
const importDecl = firstDefaultImport ?? firstNamedImport;
|
|
167995
|
-
if (!importDecl) {
|
|
167996
|
-
continue;
|
|
167936
|
+
const importGroupsByAttributes = groupBy(importGroup, (decl) => {
|
|
167937
|
+
if (decl.attributes) {
|
|
167938
|
+
let attrs = decl.attributes.token + " ";
|
|
167939
|
+
for (const x of sort(decl.attributes.elements, (x2, y) => compareStringsCaseSensitive(x2.name.text, y.name.text))) {
|
|
167940
|
+
attrs += x.name.text + ":";
|
|
167941
|
+
attrs += isStringLiteralLike(x.value) ? `"${x.value.text}"` : x.value.getText() + " ";
|
|
167942
|
+
}
|
|
167943
|
+
return attrs;
|
|
167997
167944
|
}
|
|
167998
|
-
|
|
167999
|
-
|
|
168000
|
-
|
|
168001
|
-
|
|
168002
|
-
|
|
168003
|
-
|
|
168004
|
-
|
|
168005
|
-
|
|
168006
|
-
|
|
168007
|
-
|
|
168008
|
-
|
|
168009
|
-
|
|
167945
|
+
return "";
|
|
167946
|
+
});
|
|
167947
|
+
const coalescedImports = [];
|
|
167948
|
+
for (const attribute in importGroupsByAttributes) {
|
|
167949
|
+
const importGroupSameAttrs = importGroupsByAttributes[attribute];
|
|
167950
|
+
const { importWithoutClause, typeOnlyImports, regularImports } = getCategorizedImports(importGroupSameAttrs);
|
|
167951
|
+
if (importWithoutClause) {
|
|
167952
|
+
coalescedImports.push(importWithoutClause);
|
|
167953
|
+
}
|
|
167954
|
+
for (const group2 of [regularImports, typeOnlyImports]) {
|
|
167955
|
+
const isTypeOnly = group2 === typeOnlyImports;
|
|
167956
|
+
const { defaultImports, namespaceImports, namedImports } = group2;
|
|
167957
|
+
if (!isTypeOnly && defaultImports.length === 1 && namespaceImports.length === 1 && namedImports.length === 0) {
|
|
167958
|
+
const defaultImport = defaultImports[0];
|
|
167959
|
+
coalescedImports.push(
|
|
167960
|
+
updateImportDeclarationAndClause(defaultImport, defaultImport.importClause.name, namespaceImports[0].importClause.namedBindings)
|
|
167961
|
+
);
|
|
167962
|
+
continue;
|
|
167963
|
+
}
|
|
167964
|
+
const sortedNamespaceImports = stableSort(namespaceImports, (i1, i2) => comparer(i1.importClause.namedBindings.name.text, i2.importClause.namedBindings.name.text));
|
|
167965
|
+
for (const namespaceImport of sortedNamespaceImports) {
|
|
167966
|
+
coalescedImports.push(
|
|
167967
|
+
updateImportDeclarationAndClause(
|
|
167968
|
+
namespaceImport,
|
|
167969
|
+
/*name*/
|
|
167970
|
+
void 0,
|
|
167971
|
+
namespaceImport.importClause.namedBindings
|
|
168010
167972
|
)
|
|
168011
167973
|
);
|
|
168012
167974
|
}
|
|
168013
|
-
|
|
168014
|
-
|
|
168015
|
-
|
|
168016
|
-
|
|
168017
|
-
|
|
168018
|
-
|
|
168019
|
-
|
|
168020
|
-
|
|
168021
|
-
|
|
168022
|
-
|
|
168023
|
-
|
|
168024
|
-
|
|
168025
|
-
|
|
168026
|
-
|
|
168027
|
-
|
|
168028
|
-
|
|
168029
|
-
|
|
168030
|
-
|
|
168031
|
-
|
|
168032
|
-
|
|
168033
|
-
|
|
168034
|
-
|
|
168035
|
-
|
|
168036
|
-
|
|
168037
|
-
|
|
168038
|
-
|
|
168039
|
-
);
|
|
168040
|
-
} else {
|
|
168041
|
-
coalescedImports.push(
|
|
168042
|
-
updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)
|
|
167975
|
+
const firstDefaultImport = firstOrUndefined(defaultImports);
|
|
167976
|
+
const firstNamedImport = firstOrUndefined(namedImports);
|
|
167977
|
+
const importDecl = firstDefaultImport ?? firstNamedImport;
|
|
167978
|
+
if (!importDecl) {
|
|
167979
|
+
continue;
|
|
167980
|
+
}
|
|
167981
|
+
let newDefaultImport;
|
|
167982
|
+
const newImportSpecifiers = [];
|
|
167983
|
+
if (defaultImports.length === 1) {
|
|
167984
|
+
newDefaultImport = defaultImports[0].importClause.name;
|
|
167985
|
+
} else {
|
|
167986
|
+
for (const defaultImport of defaultImports) {
|
|
167987
|
+
newImportSpecifiers.push(
|
|
167988
|
+
factory.createImportSpecifier(
|
|
167989
|
+
/*isTypeOnly*/
|
|
167990
|
+
false,
|
|
167991
|
+
factory.createIdentifier("default"),
|
|
167992
|
+
defaultImport.importClause.name
|
|
167993
|
+
)
|
|
167994
|
+
);
|
|
167995
|
+
}
|
|
167996
|
+
}
|
|
167997
|
+
newImportSpecifiers.push(...getNewImportSpecifiers(namedImports));
|
|
167998
|
+
const sortedImportSpecifiers = factory.createNodeArray(
|
|
167999
|
+
sortSpecifiers(newImportSpecifiers, comparer, preferences),
|
|
168000
|
+
firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings.elements.hasTrailingComma
|
|
168043
168001
|
);
|
|
168002
|
+
const newNamedImports = sortedImportSpecifiers.length === 0 ? newDefaultImport ? void 0 : factory.createNamedImports(emptyArray) : firstNamedImport ? factory.updateNamedImports(firstNamedImport.importClause.namedBindings, sortedImportSpecifiers) : factory.createNamedImports(sortedImportSpecifiers);
|
|
168003
|
+
if (sourceFile && newNamedImports && (firstNamedImport == null ? void 0 : firstNamedImport.importClause.namedBindings) && !rangeIsOnSingleLine(firstNamedImport.importClause.namedBindings, sourceFile)) {
|
|
168004
|
+
setEmitFlags(newNamedImports, 2 /* MultiLine */);
|
|
168005
|
+
}
|
|
168006
|
+
if (isTypeOnly && newDefaultImport && newNamedImports) {
|
|
168007
|
+
coalescedImports.push(
|
|
168008
|
+
updateImportDeclarationAndClause(
|
|
168009
|
+
importDecl,
|
|
168010
|
+
newDefaultImport,
|
|
168011
|
+
/*namedBindings*/
|
|
168012
|
+
void 0
|
|
168013
|
+
)
|
|
168014
|
+
);
|
|
168015
|
+
coalescedImports.push(
|
|
168016
|
+
updateImportDeclarationAndClause(
|
|
168017
|
+
firstNamedImport ?? importDecl,
|
|
168018
|
+
/*name*/
|
|
168019
|
+
void 0,
|
|
168020
|
+
newNamedImports
|
|
168021
|
+
)
|
|
168022
|
+
);
|
|
168023
|
+
} else {
|
|
168024
|
+
coalescedImports.push(
|
|
168025
|
+
updateImportDeclarationAndClause(importDecl, newDefaultImport, newNamedImports)
|
|
168026
|
+
);
|
|
168027
|
+
}
|
|
168044
168028
|
}
|
|
168045
168029
|
}
|
|
168046
168030
|
return coalescedImports;
|
|
@@ -175888,7 +175872,6 @@ __export(ts_exports2, {
|
|
|
175888
175872
|
isJSDocEnumTag: () => isJSDocEnumTag,
|
|
175889
175873
|
isJSDocFunctionType: () => isJSDocFunctionType,
|
|
175890
175874
|
isJSDocImplementsTag: () => isJSDocImplementsTag,
|
|
175891
|
-
isJSDocImportTypeTag: () => isJSDocImportTypeTag,
|
|
175892
175875
|
isJSDocIndexSignature: () => isJSDocIndexSignature,
|
|
175893
175876
|
isJSDocLikeText: () => isJSDocLikeText,
|
|
175894
175877
|
isJSDocLink: () => isJSDocLink,
|
|
@@ -178534,6 +178517,7 @@ var Project3 = class _Project {
|
|
|
178534
178517
|
/**
|
|
178535
178518
|
* Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one)
|
|
178536
178519
|
* This property is changed in 'updateGraph' based on the set of files in program
|
|
178520
|
+
* @internal
|
|
178537
178521
|
*/
|
|
178538
178522
|
this.projectProgramVersion = 0;
|
|
178539
178523
|
/**
|
|
@@ -178541,6 +178525,7 @@ var Project3 = class _Project {
|
|
|
178541
178525
|
* - new root file was added/removed
|
|
178542
178526
|
* - edit happen in some file that is currently included in the project.
|
|
178543
178527
|
* This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project
|
|
178528
|
+
* @internal
|
|
178544
178529
|
*/
|
|
178545
178530
|
this.projectStateVersion = 0;
|
|
178546
178531
|
this.isInitialLoadPending = returnFalse;
|
|
@@ -179578,7 +179563,7 @@ var Project3 = class _Project {
|
|
|
179578
179563
|
);
|
|
179579
179564
|
const elapsed = timestamp() - start2;
|
|
179580
179565
|
this.sendPerformanceEvent("UpdateGraph", elapsed);
|
|
179581
|
-
this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()}
|
|
179566
|
+
this.writeLog(`Finishing updateGraphWorker: Project: ${this.getProjectName()} projectStateVersion: ${this.projectStateVersion} projectProgramVersion: ${this.projectProgramVersion} structureChanged: ${hasNewProgram}${this.program ? ` structureIsReused:: ${StructureIsReused[this.program.structureIsReused]}` : ""} Elapsed: ${elapsed}ms`);
|
|
179582
179567
|
if (this.projectService.logger.isTestLogger) {
|
|
179583
179568
|
if (this.program !== oldProgram) {
|
|
179584
179569
|
this.print(
|
|
@@ -179741,6 +179726,7 @@ var Project3 = class _Project {
|
|
|
179741
179726
|
}
|
|
179742
179727
|
/** @internal */
|
|
179743
179728
|
print(writeProjectFileNames, writeFileExplaination, writeFileVersionAndText) {
|
|
179729
|
+
var _a;
|
|
179744
179730
|
this.writeLog(`Project '${this.projectName}' (${ProjectKind[this.projectKind]})`);
|
|
179745
179731
|
this.writeLog(this.filesToStringWorker(
|
|
179746
179732
|
writeProjectFileNames && this.projectService.logger.hasLevel(3 /* verbose */),
|
|
@@ -179758,6 +179744,14 @@ var Project3 = class _Project {
|
|
|
179758
179744
|
false
|
|
179759
179745
|
);
|
|
179760
179746
|
}
|
|
179747
|
+
(_a = this.noDtsResolutionProject) == null ? void 0 : _a.print(
|
|
179748
|
+
/*writeProjectFileNames*/
|
|
179749
|
+
false,
|
|
179750
|
+
/*writeFileExplaination*/
|
|
179751
|
+
false,
|
|
179752
|
+
/*writeFileVersionAndText*/
|
|
179753
|
+
false
|
|
179754
|
+
);
|
|
179761
179755
|
}
|
|
179762
179756
|
setCompilerOptions(compilerOptions) {
|
|
179763
179757
|
var _a;
|
|
@@ -181198,6 +181192,8 @@ var _ProjectService = class _ProjectService {
|
|
|
181198
181192
|
/** @internal */
|
|
181199
181193
|
this.extendedConfigCache = /* @__PURE__ */ new Map();
|
|
181200
181194
|
/** @internal */
|
|
181195
|
+
this.baseline = noop;
|
|
181196
|
+
/** @internal */
|
|
181201
181197
|
this.verifyDocumentRegistry = noop;
|
|
181202
181198
|
/** @internal */
|
|
181203
181199
|
this.verifyProgram = noop;
|
|
@@ -183187,6 +183183,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
183187
183183
|
});
|
|
183188
183184
|
this.inferredProjects.forEach((project) => this.clearSemanticCache(project));
|
|
183189
183185
|
this.ensureProjectForOpenFiles();
|
|
183186
|
+
this.logger.info("After reloading projects..");
|
|
183187
|
+
this.printProjects();
|
|
183190
183188
|
}
|
|
183191
183189
|
/**
|
|
183192
183190
|
* This function goes through all the openFiles and tries to file the config file for them.
|
|
@@ -183712,7 +183710,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
183712
183710
|
}
|
|
183713
183711
|
}
|
|
183714
183712
|
}
|
|
183715
|
-
closeExternalProject(uncheckedFileName) {
|
|
183713
|
+
closeExternalProject(uncheckedFileName, print) {
|
|
183716
183714
|
const fileName = toNormalizedPath(uncheckedFileName);
|
|
183717
183715
|
const configFiles = this.externalProjectToConfiguredProjectMap.get(fileName);
|
|
183718
183716
|
if (configFiles) {
|
|
@@ -183726,6 +183724,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
183726
183724
|
this.removeProject(externalProject);
|
|
183727
183725
|
}
|
|
183728
183726
|
}
|
|
183727
|
+
if (print)
|
|
183728
|
+
this.printProjects();
|
|
183729
183729
|
}
|
|
183730
183730
|
openExternalProjects(projects) {
|
|
183731
183731
|
const projectsToClose = arrayToMap(this.externalProjects, (p) => p.getProjectName(), (_) => true);
|
|
@@ -183733,12 +183733,21 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
183733
183733
|
projectsToClose.set(externalProjectName, true);
|
|
183734
183734
|
});
|
|
183735
183735
|
for (const externalProject of projects) {
|
|
183736
|
-
this.openExternalProject(
|
|
183736
|
+
this.openExternalProject(
|
|
183737
|
+
externalProject,
|
|
183738
|
+
/*print*/
|
|
183739
|
+
false
|
|
183740
|
+
);
|
|
183737
183741
|
projectsToClose.delete(externalProject.projectFileName);
|
|
183738
183742
|
}
|
|
183739
183743
|
forEachKey(projectsToClose, (externalProjectName) => {
|
|
183740
|
-
this.closeExternalProject(
|
|
183744
|
+
this.closeExternalProject(
|
|
183745
|
+
externalProjectName,
|
|
183746
|
+
/*print*/
|
|
183747
|
+
false
|
|
183748
|
+
);
|
|
183741
183749
|
});
|
|
183750
|
+
this.printProjects();
|
|
183742
183751
|
}
|
|
183743
183752
|
static escapeFilenameForRegex(filename) {
|
|
183744
183753
|
return filename.replace(this.filenameEscapeRegexp, "\\$&");
|
|
@@ -183831,7 +183840,7 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
183831
183840
|
proj.rootFiles = filesToKeep;
|
|
183832
183841
|
return excludedFiles;
|
|
183833
183842
|
}
|
|
183834
|
-
openExternalProject(proj) {
|
|
183843
|
+
openExternalProject(proj, print) {
|
|
183835
183844
|
proj.typeAcquisition = proj.typeAcquisition || {};
|
|
183836
183845
|
proj.typeAcquisition.include = proj.typeAcquisition.include || [];
|
|
183837
183846
|
proj.typeAcquisition.exclude = proj.typeAcquisition.exclude || [];
|
|
@@ -183870,12 +183879,22 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
183870
183879
|
externalProject.setProjectErrors(watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.errors);
|
|
183871
183880
|
this.updateRootAndOptionsOfNonInferredProject(externalProject, proj.rootFiles, externalFilePropertyReader, compilerOptions, proj.typeAcquisition, proj.options.compileOnSave, watchOptionsAndErrors == null ? void 0 : watchOptionsAndErrors.watchOptions);
|
|
183872
183881
|
externalProject.updateGraph();
|
|
183882
|
+
if (print)
|
|
183883
|
+
this.printProjects();
|
|
183873
183884
|
return;
|
|
183874
183885
|
}
|
|
183875
|
-
this.closeExternalProject(
|
|
183886
|
+
this.closeExternalProject(
|
|
183887
|
+
proj.projectFileName,
|
|
183888
|
+
/*print*/
|
|
183889
|
+
false
|
|
183890
|
+
);
|
|
183876
183891
|
} else if (this.externalProjectToConfiguredProjectMap.get(proj.projectFileName)) {
|
|
183877
183892
|
if (!tsConfigFiles) {
|
|
183878
|
-
this.closeExternalProject(
|
|
183893
|
+
this.closeExternalProject(
|
|
183894
|
+
proj.projectFileName,
|
|
183895
|
+
/*print*/
|
|
183896
|
+
false
|
|
183897
|
+
);
|
|
183879
183898
|
} else {
|
|
183880
183899
|
const oldConfigFiles = this.externalProjectToConfiguredProjectMap.get(proj.projectFileName);
|
|
183881
183900
|
let iNew = 0;
|
|
@@ -183915,6 +183934,8 @@ Dynamic files must always be opened with service's current directory or service
|
|
|
183915
183934
|
const project = this.createExternalProject(proj.projectFileName, rootFiles, proj.options, proj.typeAcquisition, excludedFiles);
|
|
183916
183935
|
project.updateGraph();
|
|
183917
183936
|
}
|
|
183937
|
+
if (print)
|
|
183938
|
+
this.printProjects();
|
|
183918
183939
|
}
|
|
183919
183940
|
hasDeferredExtension() {
|
|
183920
183941
|
for (const extension of this.hostConfiguration.extraFileExtensions) {
|
|
@@ -184841,7 +184862,11 @@ var Session3 = class _Session {
|
|
|
184841
184862
|
return this.requiredResponse(response);
|
|
184842
184863
|
},
|
|
184843
184864
|
["openExternalProject" /* OpenExternalProject */]: (request) => {
|
|
184844
|
-
this.projectService.openExternalProject(
|
|
184865
|
+
this.projectService.openExternalProject(
|
|
184866
|
+
request.arguments,
|
|
184867
|
+
/*print*/
|
|
184868
|
+
true
|
|
184869
|
+
);
|
|
184845
184870
|
return this.requiredResponse(
|
|
184846
184871
|
/*response*/
|
|
184847
184872
|
true
|
|
@@ -184855,7 +184880,11 @@ var Session3 = class _Session {
|
|
|
184855
184880
|
);
|
|
184856
184881
|
},
|
|
184857
184882
|
["closeExternalProject" /* CloseExternalProject */]: (request) => {
|
|
184858
|
-
this.projectService.closeExternalProject(
|
|
184883
|
+
this.projectService.closeExternalProject(
|
|
184884
|
+
request.arguments.projectFileName,
|
|
184885
|
+
/*print*/
|
|
184886
|
+
true
|
|
184887
|
+
);
|
|
184859
184888
|
return this.requiredResponse(
|
|
184860
184889
|
/*response*/
|
|
184861
184890
|
true
|
|
@@ -190696,7 +190725,6 @@ start(initializeNodeSystem(), require("os").platform());
|
|
|
190696
190725
|
isJSDocEnumTag,
|
|
190697
190726
|
isJSDocFunctionType,
|
|
190698
190727
|
isJSDocImplementsTag,
|
|
190699
|
-
isJSDocImportTypeTag,
|
|
190700
190728
|
isJSDocIndexSignature,
|
|
190701
190729
|
isJSDocLikeText,
|
|
190702
190730
|
isJSDocLink,
|