@typescript-deploys/pr-build 5.9.0-pr-61505-58 → 5.9.0-pr-54183-44
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 +111 -90
- package/lib/lib.dom.d.ts +2150 -793
- package/lib/lib.dom.iterable.d.ts +4 -4
- package/lib/lib.es5.d.ts +3 -0
- package/lib/lib.webworker.d.ts +916 -347
- package/lib/lib.webworker.iterable.d.ts +4 -4
- package/lib/typescript.d.ts +8 -1
- package/lib/typescript.js +155 -108
- package/package.json +1 -1
package/lib/_tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.9";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20250519`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -18018,8 +18018,8 @@ var _computedOptions = createComputedCompilerOptions({
|
|
|
18018
18018
|
if (!moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
18019
18019
|
return false;
|
|
18020
18020
|
}
|
|
18021
|
-
if (compilerOptions.
|
|
18022
|
-
return compilerOptions.
|
|
18021
|
+
if (compilerOptions.resolvePackageJsonImports !== void 0) {
|
|
18022
|
+
return compilerOptions.resolvePackageJsonImports;
|
|
18023
18023
|
}
|
|
18024
18024
|
switch (moduleResolution) {
|
|
18025
18025
|
case 3 /* Node16 */:
|
|
@@ -46452,11 +46452,11 @@ function createTypeChecker(host) {
|
|
|
46452
46452
|
typePredicateToString: (predicate, enclosingDeclaration, flags) => {
|
|
46453
46453
|
return typePredicateToString(predicate, getParseTreeNode(enclosingDeclaration), flags);
|
|
46454
46454
|
},
|
|
46455
|
-
writeSignature: (signature, enclosingDeclaration, flags, kind, writer, verbosityLevel, out) => {
|
|
46456
|
-
return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer, verbosityLevel, out);
|
|
46455
|
+
writeSignature: (signature, enclosingDeclaration, flags, kind, writer, maximumLength, verbosityLevel, out) => {
|
|
46456
|
+
return signatureToString(signature, getParseTreeNode(enclosingDeclaration), flags, kind, writer, maximumLength, verbosityLevel, out);
|
|
46457
46457
|
},
|
|
46458
|
-
writeType: (type, enclosingDeclaration, flags, writer, verbosityLevel, out) => {
|
|
46459
|
-
return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer, verbosityLevel, out);
|
|
46458
|
+
writeType: (type, enclosingDeclaration, flags, writer, maximumLength, verbosityLevel, out) => {
|
|
46459
|
+
return typeToString(type, getParseTreeNode(enclosingDeclaration), flags, writer, maximumLength, verbosityLevel, out);
|
|
46460
46460
|
},
|
|
46461
46461
|
writeSymbol: (symbol, enclosingDeclaration, meaning, flags, writer) => {
|
|
46462
46462
|
return symbolToString(symbol, getParseTreeNode(enclosingDeclaration), meaning, flags, writer);
|
|
@@ -46497,7 +46497,7 @@ function createTypeChecker(host) {
|
|
|
46497
46497
|
void 0
|
|
46498
46498
|
);
|
|
46499
46499
|
},
|
|
46500
|
-
|
|
46500
|
+
containsContextSensitive,
|
|
46501
46501
|
getTypeOfPropertyOfContextualType,
|
|
46502
46502
|
getFullyQualifiedName,
|
|
46503
46503
|
getResolvedSignature: (node, candidatesOutArray, argumentCount) => getResolvedSignatureWorker(node, candidatesOutArray, argumentCount, 0 /* Normal */),
|
|
@@ -47204,9 +47204,6 @@ function createTypeChecker(host) {
|
|
|
47204
47204
|
var inferenceContextNodes = [];
|
|
47205
47205
|
var inferenceContexts = [];
|
|
47206
47206
|
var inferenceContextCount = 0;
|
|
47207
|
-
var activeTypeMappers = [];
|
|
47208
|
-
var activeTypeMappersCaches = [];
|
|
47209
|
-
var activeTypeMappersCount = 0;
|
|
47210
47207
|
var emptyStringType = getStringLiteralType("");
|
|
47211
47208
|
var zeroType = getNumberLiteralType(0);
|
|
47212
47209
|
var zeroBigIntType = getBigIntLiteralType({ negative: false, base10Value: "0" });
|
|
@@ -47791,12 +47788,15 @@ function createTypeChecker(host) {
|
|
|
47791
47788
|
return isForInOrOfStatement(grandparent) && isSameScopeDescendentOf(usage2, grandparent.expression, declContainer);
|
|
47792
47789
|
}
|
|
47793
47790
|
function isUsedInFunctionOrInstanceProperty(usage2, declaration2) {
|
|
47791
|
+
return isUsedInFunctionOrInstancePropertyWorker(usage2, declaration2);
|
|
47792
|
+
}
|
|
47793
|
+
function isUsedInFunctionOrInstancePropertyWorker(usage2, declaration2) {
|
|
47794
47794
|
return !!findAncestor(usage2, (current) => {
|
|
47795
47795
|
if (current === declContainer) {
|
|
47796
47796
|
return "quit";
|
|
47797
47797
|
}
|
|
47798
47798
|
if (isFunctionLike(current)) {
|
|
47799
|
-
return
|
|
47799
|
+
return !getImmediatelyInvokedFunctionExpression(current);
|
|
47800
47800
|
}
|
|
47801
47801
|
if (isClassStaticBlockDeclaration(current)) {
|
|
47802
47802
|
return declaration2.pos < usage2.pos;
|
|
@@ -47827,6 +47827,15 @@ function createTypeChecker(host) {
|
|
|
47827
47827
|
}
|
|
47828
47828
|
}
|
|
47829
47829
|
}
|
|
47830
|
+
const decorator = tryCast(current.parent, isDecorator);
|
|
47831
|
+
if (decorator && decorator.expression === current) {
|
|
47832
|
+
if (isParameter(decorator.parent)) {
|
|
47833
|
+
return isUsedInFunctionOrInstancePropertyWorker(decorator.parent.parent.parent, declaration2) ? true : "quit";
|
|
47834
|
+
}
|
|
47835
|
+
if (isMethodDeclaration(decorator.parent)) {
|
|
47836
|
+
return isUsedInFunctionOrInstancePropertyWorker(decorator.parent.parent, declaration2) ? true : "quit";
|
|
47837
|
+
}
|
|
47838
|
+
}
|
|
47830
47839
|
return false;
|
|
47831
47840
|
});
|
|
47832
47841
|
}
|
|
@@ -50372,7 +50381,7 @@ function createTypeChecker(host) {
|
|
|
50372
50381
|
return writer2;
|
|
50373
50382
|
}
|
|
50374
50383
|
}
|
|
50375
|
-
function signatureToString(signature, enclosingDeclaration, flags = 0 /* None */, kind, writer, verbosityLevel, out) {
|
|
50384
|
+
function signatureToString(signature, enclosingDeclaration, flags = 0 /* None */, kind, writer, maximumLength, verbosityLevel, out) {
|
|
50376
50385
|
return writer ? signatureToStringWorker(writer).getText() : usingSingleLineStringWriter(signatureToStringWorker);
|
|
50377
50386
|
function signatureToStringWorker(writer2) {
|
|
50378
50387
|
let sigOutput;
|
|
@@ -50390,6 +50399,7 @@ function createTypeChecker(host) {
|
|
|
50390
50399
|
void 0,
|
|
50391
50400
|
/*tracker*/
|
|
50392
50401
|
void 0,
|
|
50402
|
+
maximumLength,
|
|
50393
50403
|
verbosityLevel,
|
|
50394
50404
|
out
|
|
50395
50405
|
);
|
|
@@ -50405,7 +50415,7 @@ function createTypeChecker(host) {
|
|
|
50405
50415
|
return writer2;
|
|
50406
50416
|
}
|
|
50407
50417
|
}
|
|
50408
|
-
function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter(""), verbosityLevel, out) {
|
|
50418
|
+
function typeToString(type, enclosingDeclaration, flags = 1048576 /* AllowUniqueESSymbolType */ | 16384 /* UseAliasDefinedOutsideCurrentScope */, writer = createTextWriter(""), maximumLength, verbosityLevel, out) {
|
|
50409
50419
|
const noTruncation = compilerOptions.noErrorTruncation || flags & 1 /* NoTruncation */;
|
|
50410
50420
|
const typeNode = nodeBuilder.typeToTypeNode(
|
|
50411
50421
|
type,
|
|
@@ -50415,6 +50425,7 @@ function createTypeChecker(host) {
|
|
|
50415
50425
|
void 0,
|
|
50416
50426
|
/*tracker*/
|
|
50417
50427
|
void 0,
|
|
50428
|
+
maximumLength,
|
|
50418
50429
|
verbosityLevel,
|
|
50419
50430
|
out
|
|
50420
50431
|
);
|
|
@@ -50429,7 +50440,7 @@ function createTypeChecker(host) {
|
|
|
50429
50440
|
writer
|
|
50430
50441
|
);
|
|
50431
50442
|
const result = writer.getText();
|
|
50432
|
-
const maxLength = noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2;
|
|
50443
|
+
const maxLength = maximumLength || (noTruncation ? noTruncationMaximumTruncationLength * 2 : defaultMaximumTruncationLength * 2);
|
|
50433
50444
|
if (maxLength && result && result.length >= maxLength) {
|
|
50434
50445
|
return result.substr(0, maxLength - "...".length) + "...";
|
|
50435
50446
|
}
|
|
@@ -50453,7 +50464,7 @@ function createTypeChecker(host) {
|
|
|
50453
50464
|
);
|
|
50454
50465
|
}
|
|
50455
50466
|
function symbolValueDeclarationIsContextSensitive(symbol) {
|
|
50456
|
-
return symbol && !!symbol.valueDeclaration && isExpression(symbol.valueDeclaration) && !
|
|
50467
|
+
return symbol && !!symbol.valueDeclaration && isExpression(symbol.valueDeclaration) && !containsContextSensitive(symbol.valueDeclaration);
|
|
50457
50468
|
}
|
|
50458
50469
|
function toNodeBuilderFlags(flags = 0 /* None */) {
|
|
50459
50470
|
return flags & 848330095 /* NodeBuilderFlagsMask */;
|
|
@@ -50646,12 +50657,14 @@ function createTypeChecker(host) {
|
|
|
50646
50657
|
};
|
|
50647
50658
|
return {
|
|
50648
50659
|
syntacticBuilderResolver,
|
|
50649
|
-
typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, out) => withContext(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, (context) => typeToTypeNodeHelper(type, context), out),
|
|
50660
|
+
typeToTypeNode: (type, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => typeToTypeNodeHelper(type, context), out),
|
|
50650
50661
|
typePredicateToTypePredicateNode: (typePredicate, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
|
50651
50662
|
enclosingDeclaration,
|
|
50652
50663
|
flags,
|
|
50653
50664
|
internalFlags,
|
|
50654
50665
|
tracker,
|
|
50666
|
+
/*maximumLength*/
|
|
50667
|
+
void 0,
|
|
50655
50668
|
/*verbosityLevel*/
|
|
50656
50669
|
void 0,
|
|
50657
50670
|
(context) => typePredicateToTypePredicateNodeHelper(typePredicate, context)
|
|
@@ -50661,6 +50674,8 @@ function createTypeChecker(host) {
|
|
|
50661
50674
|
flags,
|
|
50662
50675
|
internalFlags,
|
|
50663
50676
|
tracker,
|
|
50677
|
+
/*maximumLength*/
|
|
50678
|
+
void 0,
|
|
50664
50679
|
/*verbosityLevel*/
|
|
50665
50680
|
void 0,
|
|
50666
50681
|
(context) => syntacticNodeBuilder.serializeTypeOfDeclaration(declaration, symbol, context)
|
|
@@ -50670,6 +50685,8 @@ function createTypeChecker(host) {
|
|
|
50670
50685
|
flags,
|
|
50671
50686
|
internalFlags,
|
|
50672
50687
|
tracker,
|
|
50688
|
+
/*maximumLength*/
|
|
50689
|
+
void 0,
|
|
50673
50690
|
/*verbosityLevel*/
|
|
50674
50691
|
void 0,
|
|
50675
50692
|
(context) => syntacticNodeBuilder.serializeReturnTypeForSignature(signature, getSymbolOfDeclaration(signature), context)
|
|
@@ -50679,6 +50696,8 @@ function createTypeChecker(host) {
|
|
|
50679
50696
|
flags,
|
|
50680
50697
|
internalFlags,
|
|
50681
50698
|
tracker,
|
|
50699
|
+
/*maximumLength*/
|
|
50700
|
+
void 0,
|
|
50682
50701
|
/*verbosityLevel*/
|
|
50683
50702
|
void 0,
|
|
50684
50703
|
(context) => syntacticNodeBuilder.serializeTypeOfExpression(expr, context)
|
|
@@ -50688,6 +50707,8 @@ function createTypeChecker(host) {
|
|
|
50688
50707
|
flags,
|
|
50689
50708
|
internalFlags,
|
|
50690
50709
|
tracker,
|
|
50710
|
+
/*maximumLength*/
|
|
50711
|
+
void 0,
|
|
50691
50712
|
/*verbosityLevel*/
|
|
50692
50713
|
void 0,
|
|
50693
50714
|
(context) => indexInfoToIndexSignatureDeclarationHelper(
|
|
@@ -50697,12 +50718,14 @@ function createTypeChecker(host) {
|
|
|
50697
50718
|
void 0
|
|
50698
50719
|
)
|
|
50699
50720
|
),
|
|
50700
|
-
signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, out) => withContext(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, (context) => signatureToSignatureDeclarationHelper(signature, kind, context), out),
|
|
50721
|
+
signatureToSignatureDeclaration: (signature, kind, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => signatureToSignatureDeclarationHelper(signature, kind, context), out),
|
|
50701
50722
|
symbolToEntityName: (symbol, meaning, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
|
50702
50723
|
enclosingDeclaration,
|
|
50703
50724
|
flags,
|
|
50704
50725
|
internalFlags,
|
|
50705
50726
|
tracker,
|
|
50727
|
+
/*maximumLength*/
|
|
50728
|
+
void 0,
|
|
50706
50729
|
/*verbosityLevel*/
|
|
50707
50730
|
void 0,
|
|
50708
50731
|
(context) => symbolToName(
|
|
@@ -50718,6 +50741,8 @@ function createTypeChecker(host) {
|
|
|
50718
50741
|
flags,
|
|
50719
50742
|
internalFlags,
|
|
50720
50743
|
tracker,
|
|
50744
|
+
/*maximumLength*/
|
|
50745
|
+
void 0,
|
|
50721
50746
|
/*verbosityLevel*/
|
|
50722
50747
|
void 0,
|
|
50723
50748
|
(context) => symbolToExpression(symbol, context, meaning)
|
|
@@ -50727,6 +50752,8 @@ function createTypeChecker(host) {
|
|
|
50727
50752
|
flags,
|
|
50728
50753
|
internalFlags,
|
|
50729
50754
|
tracker,
|
|
50755
|
+
/*maximumLength*/
|
|
50756
|
+
void 0,
|
|
50730
50757
|
/*verbosityLevel*/
|
|
50731
50758
|
void 0,
|
|
50732
50759
|
(context) => typeParametersToTypeParameterDeclarations(symbol, context)
|
|
@@ -50736,16 +50763,20 @@ function createTypeChecker(host) {
|
|
|
50736
50763
|
flags,
|
|
50737
50764
|
internalFlags,
|
|
50738
50765
|
tracker,
|
|
50766
|
+
/*maximumLength*/
|
|
50767
|
+
void 0,
|
|
50739
50768
|
/*verbosityLevel*/
|
|
50740
50769
|
void 0,
|
|
50741
50770
|
(context) => symbolToParameterDeclaration(symbol, context)
|
|
50742
50771
|
),
|
|
50743
|
-
typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, out) => withContext(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, (context) => typeParameterToDeclaration(parameter, context), out),
|
|
50772
|
+
typeParameterToDeclaration: (parameter, enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, out) => withContext(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, (context) => typeParameterToDeclaration(parameter, context), out),
|
|
50744
50773
|
symbolTableToDeclarationStatements: (symbolTable, enclosingDeclaration, flags, internalFlags, tracker) => withContext(
|
|
50745
50774
|
enclosingDeclaration,
|
|
50746
50775
|
flags,
|
|
50747
50776
|
internalFlags,
|
|
50748
50777
|
tracker,
|
|
50778
|
+
/*maximumLength*/
|
|
50779
|
+
void 0,
|
|
50749
50780
|
/*verbosityLevel*/
|
|
50750
50781
|
void 0,
|
|
50751
50782
|
(context) => symbolTableToDeclarationStatements(symbolTable, context)
|
|
@@ -50755,6 +50786,8 @@ function createTypeChecker(host) {
|
|
|
50755
50786
|
flags,
|
|
50756
50787
|
internalFlags,
|
|
50757
50788
|
tracker,
|
|
50789
|
+
/*maximumLength*/
|
|
50790
|
+
void 0,
|
|
50758
50791
|
/*verbosityLevel*/
|
|
50759
50792
|
void 0,
|
|
50760
50793
|
(context) => symbolToNode(symbol, context, meaning)
|
|
@@ -50801,7 +50834,7 @@ function createTypeChecker(host) {
|
|
|
50801
50834
|
}
|
|
50802
50835
|
return symbolToExpression(symbol, context, meaning);
|
|
50803
50836
|
}
|
|
50804
|
-
function symbolToDeclarations(symbol, meaning, flags, verbosityLevel, out) {
|
|
50837
|
+
function symbolToDeclarations(symbol, meaning, flags, maximumLength, verbosityLevel, out) {
|
|
50805
50838
|
const nodes = withContext(
|
|
50806
50839
|
/*enclosingDeclaration*/
|
|
50807
50840
|
void 0,
|
|
@@ -50810,6 +50843,7 @@ function createTypeChecker(host) {
|
|
|
50810
50843
|
void 0,
|
|
50811
50844
|
/*tracker*/
|
|
50812
50845
|
void 0,
|
|
50846
|
+
maximumLength,
|
|
50813
50847
|
verbosityLevel,
|
|
50814
50848
|
(context) => symbolToDeclarationsWorker(symbol, context),
|
|
50815
50849
|
out
|
|
@@ -50869,14 +50903,17 @@ function createTypeChecker(host) {
|
|
|
50869
50903
|
context.typeStack.pop();
|
|
50870
50904
|
return statements;
|
|
50871
50905
|
}
|
|
50872
|
-
function withContext(enclosingDeclaration, flags, internalFlags, tracker, verbosityLevel, cb, out) {
|
|
50906
|
+
function withContext(enclosingDeclaration, flags, internalFlags, tracker, maximumLength, verbosityLevel, cb, out) {
|
|
50873
50907
|
const moduleResolverHost = (tracker == null ? void 0 : tracker.trackSymbol) ? tracker.moduleResolverHost : (internalFlags || 0 /* None */) & 4 /* DoNotIncludeSymbolChain */ ? createBasicNodeBuilderModuleSpecifierResolutionHost(host) : void 0;
|
|
50908
|
+
flags = flags || 0 /* None */;
|
|
50909
|
+
const maxTruncationLength = maximumLength || (flags & 1 /* NoTruncation */ ? noTruncationMaximumTruncationLength : defaultMaximumTruncationLength);
|
|
50874
50910
|
const context = {
|
|
50875
50911
|
enclosingDeclaration,
|
|
50876
50912
|
enclosingFile: enclosingDeclaration && getSourceFileOfNode(enclosingDeclaration),
|
|
50877
|
-
flags
|
|
50913
|
+
flags,
|
|
50878
50914
|
internalFlags: internalFlags || 0 /* None */,
|
|
50879
50915
|
tracker: void 0,
|
|
50916
|
+
maxTruncationLength,
|
|
50880
50917
|
maxExpansionDepth: verbosityLevel ?? -1,
|
|
50881
50918
|
encounteredError: false,
|
|
50882
50919
|
suppressReportInferenceFallback: false,
|
|
@@ -50947,7 +50984,7 @@ function createTypeChecker(host) {
|
|
|
50947
50984
|
}
|
|
50948
50985
|
function checkTruncationLength(context) {
|
|
50949
50986
|
if (context.truncating) return context.truncating;
|
|
50950
|
-
return context.truncating = context.approximateLength >
|
|
50987
|
+
return context.truncating = context.approximateLength > context.maxTruncationLength;
|
|
50951
50988
|
}
|
|
50952
50989
|
function canPossiblyExpandType(type, context) {
|
|
50953
50990
|
for (let i = 0; i < context.typeStack.length - 1; i++) {
|
|
@@ -51338,12 +51375,19 @@ function createTypeChecker(host) {
|
|
|
51338
51375
|
const questionToken = type2.declaration.questionToken ? factory.createToken(type2.declaration.questionToken.kind) : void 0;
|
|
51339
51376
|
let appropriateConstraintTypeNode;
|
|
51340
51377
|
let newTypeVariable;
|
|
51378
|
+
let templateType = getTemplateTypeFromMappedType(type2);
|
|
51379
|
+
const typeParameter = getTypeParameterFromMappedType(type2);
|
|
51341
51380
|
const needsModifierPreservingWrapper = !isMappedTypeWithKeyofConstraintDeclaration(type2) && !(getModifiersTypeFromMappedType(type2).flags & 2 /* Unknown */) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && !(getConstraintTypeFromMappedType(type2).flags & 262144 /* TypeParameter */ && ((_a2 = getConstraintOfTypeParameter(getConstraintTypeFromMappedType(type2))) == null ? void 0 : _a2.flags) & 4194304 /* Index */);
|
|
51342
51381
|
if (isMappedTypeWithKeyofConstraintDeclaration(type2)) {
|
|
51343
51382
|
if (isHomomorphicMappedTypeWithNonHomomorphicInstantiation(type2) && context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
51344
|
-
const
|
|
51345
|
-
const name = typeParameterToName(
|
|
51383
|
+
const newConstraintParam = createTypeParameter(createSymbol(262144 /* TypeParameter */, "T"));
|
|
51384
|
+
const name = typeParameterToName(newConstraintParam, context);
|
|
51385
|
+
const target = type2.target;
|
|
51346
51386
|
newTypeVariable = factory.createTypeReferenceNode(name);
|
|
51387
|
+
templateType = instantiateType(
|
|
51388
|
+
getTemplateTypeFromMappedType(target),
|
|
51389
|
+
makeArrayTypeMapper([getTypeParameterFromMappedType(target), getModifiersTypeFromMappedType(target)], [typeParameter, newConstraintParam])
|
|
51390
|
+
);
|
|
51347
51391
|
}
|
|
51348
51392
|
appropriateConstraintTypeNode = factory.createTypeOperatorNode(143 /* KeyOfKeyword */, newTypeVariable || typeToTypeNodeHelper(getModifiersTypeFromMappedType(type2), context));
|
|
51349
51393
|
} else if (needsModifierPreservingWrapper) {
|
|
@@ -51354,9 +51398,17 @@ function createTypeChecker(host) {
|
|
|
51354
51398
|
} else {
|
|
51355
51399
|
appropriateConstraintTypeNode = typeToTypeNodeHelper(getConstraintTypeFromMappedType(type2), context);
|
|
51356
51400
|
}
|
|
51357
|
-
const typeParameterNode = typeParameterToDeclarationWithConstraint(
|
|
51401
|
+
const typeParameterNode = typeParameterToDeclarationWithConstraint(typeParameter, context, appropriateConstraintTypeNode);
|
|
51402
|
+
const cleanup = enterNewScope(
|
|
51403
|
+
context,
|
|
51404
|
+
type2.declaration,
|
|
51405
|
+
/*expandedParams*/
|
|
51406
|
+
void 0,
|
|
51407
|
+
[getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(type2.declaration.typeParameter))]
|
|
51408
|
+
);
|
|
51358
51409
|
const nameTypeNode = type2.declaration.nameType ? typeToTypeNodeHelper(getNameTypeFromMappedType(type2), context) : void 0;
|
|
51359
|
-
const templateTypeNode = typeToTypeNodeHelper(removeMissingType(
|
|
51410
|
+
const templateTypeNode = typeToTypeNodeHelper(removeMissingType(templateType, !!(getMappedTypeModifiers(type2) & 4 /* IncludeOptional */)), context);
|
|
51411
|
+
cleanup();
|
|
51360
51412
|
const mappedTypeNode = factory.createMappedTypeNode(
|
|
51361
51413
|
readonlyToken,
|
|
51362
51414
|
typeParameterNode,
|
|
@@ -56639,7 +56691,7 @@ function createTypeChecker(host) {
|
|
|
56639
56691
|
case 200 /* MappedType */:
|
|
56640
56692
|
case 194 /* ConditionalType */: {
|
|
56641
56693
|
const outerTypeParameters = getOuterTypeParameters(node, includeThisTypes);
|
|
56642
|
-
if ((kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || isObjectLiteralMethod(node)) &&
|
|
56694
|
+
if ((kind === 218 /* FunctionExpression */ || kind === 219 /* ArrowFunction */ || isObjectLiteralMethod(node)) && containsContextSensitive(node)) {
|
|
56643
56695
|
const signature = firstOrUndefined(getSignaturesOfType(getTypeOfSymbol(getSymbolOfDeclaration(node)), 0 /* Call */));
|
|
56644
56696
|
if (signature && signature.typeParameters) {
|
|
56645
56697
|
return [...outerTypeParameters || emptyArray, ...signature.typeParameters];
|
|
@@ -57243,9 +57295,7 @@ function createTypeChecker(host) {
|
|
|
57243
57295
|
symbol.declarations.push(member);
|
|
57244
57296
|
}
|
|
57245
57297
|
if (symbolFlags & 111551 /* Value */) {
|
|
57246
|
-
|
|
57247
|
-
symbol.valueDeclaration = member;
|
|
57248
|
-
}
|
|
57298
|
+
setValueDeclaration(symbol, member);
|
|
57249
57299
|
}
|
|
57250
57300
|
}
|
|
57251
57301
|
function lateBindMember(parent, earlySymbols, lateSymbols, decl) {
|
|
@@ -63286,25 +63336,10 @@ function createTypeChecker(host) {
|
|
|
63286
63336
|
error(currentNode, Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
|
|
63287
63337
|
return errorType;
|
|
63288
63338
|
}
|
|
63289
|
-
const index = findActiveMapper(mapper);
|
|
63290
|
-
if (index === -1) {
|
|
63291
|
-
pushActiveMapper(mapper);
|
|
63292
|
-
}
|
|
63293
|
-
const key = type.id + getAliasId(aliasSymbol, aliasTypeArguments);
|
|
63294
|
-
const mapperCache = activeTypeMappersCaches[index !== -1 ? index : activeTypeMappersCount - 1];
|
|
63295
|
-
const cached = mapperCache.get(key);
|
|
63296
|
-
if (cached) {
|
|
63297
|
-
return cached;
|
|
63298
|
-
}
|
|
63299
63339
|
totalInstantiationCount++;
|
|
63300
63340
|
instantiationCount++;
|
|
63301
63341
|
instantiationDepth++;
|
|
63302
63342
|
const result = instantiateTypeWorker(type, mapper, aliasSymbol, aliasTypeArguments);
|
|
63303
|
-
if (index === -1) {
|
|
63304
|
-
popActiveMapper();
|
|
63305
|
-
} else {
|
|
63306
|
-
mapperCache.set(key, result);
|
|
63307
|
-
}
|
|
63308
63343
|
instantiationDepth--;
|
|
63309
63344
|
return result;
|
|
63310
63345
|
}
|
|
@@ -63423,39 +63458,47 @@ function createTypeChecker(host) {
|
|
|
63423
63458
|
function instantiateIndexInfo(info, mapper) {
|
|
63424
63459
|
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components);
|
|
63425
63460
|
}
|
|
63426
|
-
function
|
|
63461
|
+
function containsContextRelatedNode(node, predicate) {
|
|
63427
63462
|
Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
|
|
63428
63463
|
switch (node.kind) {
|
|
63429
63464
|
case 218 /* FunctionExpression */:
|
|
63430
63465
|
case 219 /* ArrowFunction */:
|
|
63431
63466
|
case 174 /* MethodDeclaration */:
|
|
63432
63467
|
case 262 /* FunctionDeclaration */:
|
|
63433
|
-
|
|
63468
|
+
case 213 /* CallExpression */:
|
|
63469
|
+
case 214 /* NewExpression */:
|
|
63470
|
+
return predicate(node);
|
|
63434
63471
|
case 210 /* ObjectLiteralExpression */:
|
|
63435
|
-
return some(node.properties,
|
|
63472
|
+
return some(node.properties, (p) => containsContextRelatedNode(p, predicate));
|
|
63436
63473
|
case 209 /* ArrayLiteralExpression */:
|
|
63437
|
-
return some(node.elements,
|
|
63474
|
+
return some(node.elements, (e) => containsContextRelatedNode(e, predicate));
|
|
63438
63475
|
case 227 /* ConditionalExpression */:
|
|
63439
|
-
return
|
|
63476
|
+
return containsContextRelatedNode(node.whenTrue, predicate) || containsContextRelatedNode(node.whenFalse, predicate);
|
|
63440
63477
|
case 226 /* BinaryExpression */:
|
|
63441
|
-
return (node.operatorToken.kind === 57 /* BarBarToken */ || node.operatorToken.kind === 61 /* QuestionQuestionToken */) && (
|
|
63478
|
+
return (node.operatorToken.kind === 57 /* BarBarToken */ || node.operatorToken.kind === 61 /* QuestionQuestionToken */) && (containsContextRelatedNode(node.left, predicate) || containsContextRelatedNode(node.right, predicate));
|
|
63442
63479
|
case 303 /* PropertyAssignment */:
|
|
63443
|
-
return
|
|
63480
|
+
return containsContextRelatedNode(node.initializer, predicate);
|
|
63444
63481
|
case 217 /* ParenthesizedExpression */:
|
|
63445
|
-
return
|
|
63482
|
+
return containsContextRelatedNode(node.expression, predicate);
|
|
63446
63483
|
case 292 /* JsxAttributes */:
|
|
63447
|
-
return some(node.properties,
|
|
63484
|
+
return some(node.properties, (p) => containsContextRelatedNode(p, predicate)) || isJsxOpeningElement(node.parent) && some(node.parent.parent.children, (c) => containsContextRelatedNode(c, predicate));
|
|
63448
63485
|
case 291 /* JsxAttribute */: {
|
|
63449
63486
|
const { initializer } = node;
|
|
63450
|
-
return !!initializer &&
|
|
63487
|
+
return !!initializer && containsContextRelatedNode(initializer, predicate);
|
|
63451
63488
|
}
|
|
63452
63489
|
case 294 /* JsxExpression */: {
|
|
63453
63490
|
const { expression } = node;
|
|
63454
|
-
return !!expression &&
|
|
63491
|
+
return !!expression && containsContextRelatedNode(expression, predicate);
|
|
63455
63492
|
}
|
|
63456
63493
|
}
|
|
63457
63494
|
return false;
|
|
63458
63495
|
}
|
|
63496
|
+
function containsContextSensitive(node) {
|
|
63497
|
+
return containsContextRelatedNode(node, isContextSensitiveFunctionOrObjectLiteralMethod);
|
|
63498
|
+
}
|
|
63499
|
+
function containsContextSensitiveOrCallOrNewExpression(node) {
|
|
63500
|
+
return containsContextRelatedNode(node, (n) => isContextSensitiveFunctionOrObjectLiteralMethod(n) || isCallOrNewExpression(n));
|
|
63501
|
+
}
|
|
63459
63502
|
function isContextSensitiveFunctionLikeDeclaration(node) {
|
|
63460
63503
|
return hasContextSensitiveParameters(node) || hasContextSensitiveReturnExpression(node);
|
|
63461
63504
|
}
|
|
@@ -63464,9 +63507,9 @@ function createTypeChecker(host) {
|
|
|
63464
63507
|
return false;
|
|
63465
63508
|
}
|
|
63466
63509
|
if (node.body.kind !== 241 /* Block */) {
|
|
63467
|
-
return
|
|
63510
|
+
return containsContextSensitive(node.body);
|
|
63468
63511
|
}
|
|
63469
|
-
return !!forEachReturnStatement(node.body, (statement) => !!statement.expression &&
|
|
63512
|
+
return !!forEachReturnStatement(node.body, (statement) => !!statement.expression && containsContextSensitive(statement.expression));
|
|
63470
63513
|
}
|
|
63471
63514
|
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
|
|
63472
63515
|
return (isFunctionExpressionOrArrowFunction(func) || isObjectLiteralMethod(func)) && isContextSensitiveFunctionLikeDeclaration(func);
|
|
@@ -68881,7 +68924,6 @@ function createTypeChecker(host) {
|
|
|
68881
68924
|
inference.inferredType = fallbackType && context.compareTypes(fallbackType, getTypeWithThisArgument(instantiatedConstraint, fallbackType)) ? fallbackType : instantiatedConstraint;
|
|
68882
68925
|
}
|
|
68883
68926
|
}
|
|
68884
|
-
clearActiveMapperCaches();
|
|
68885
68927
|
}
|
|
68886
68928
|
return inference.inferredType;
|
|
68887
68929
|
}
|
|
@@ -73147,27 +73189,6 @@ function createTypeChecker(host) {
|
|
|
73147
73189
|
}
|
|
73148
73190
|
}
|
|
73149
73191
|
}
|
|
73150
|
-
function pushActiveMapper(mapper) {
|
|
73151
|
-
activeTypeMappers[activeTypeMappersCount] = mapper;
|
|
73152
|
-
activeTypeMappersCaches[activeTypeMappersCount] = /* @__PURE__ */ new Map();
|
|
73153
|
-
activeTypeMappersCount++;
|
|
73154
|
-
}
|
|
73155
|
-
function popActiveMapper() {
|
|
73156
|
-
activeTypeMappersCount--;
|
|
73157
|
-
}
|
|
73158
|
-
function findActiveMapper(mapper) {
|
|
73159
|
-
for (let i = activeTypeMappersCount - 1; i >= 0; i--) {
|
|
73160
|
-
if (mapper === activeTypeMappers[i]) {
|
|
73161
|
-
return i;
|
|
73162
|
-
}
|
|
73163
|
-
}
|
|
73164
|
-
return -1;
|
|
73165
|
-
}
|
|
73166
|
-
function clearActiveMapperCaches() {
|
|
73167
|
-
for (let i = activeTypeMappersCount - 1; i >= 0; i--) {
|
|
73168
|
-
activeTypeMappersCaches[i].clear();
|
|
73169
|
-
}
|
|
73170
|
-
}
|
|
73171
73192
|
function getContextualImportAttributeType(node) {
|
|
73172
73193
|
return getTypeOfPropertyOfContextualType(getGlobalImportAttributesType(
|
|
73173
73194
|
/*reportErrors*/
|
|
@@ -73549,7 +73570,7 @@ function createTypeChecker(host) {
|
|
|
73549
73570
|
hasOmittedExpression
|
|
73550
73571
|
));
|
|
73551
73572
|
elementFlags.push(hasOmittedExpression ? 2 /* Optional */ : 1 /* Required */);
|
|
73552
|
-
if (inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) &&
|
|
73573
|
+
if (inTupleContext && checkMode && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && containsContextSensitiveOrCallOrNewExpression(e)) {
|
|
73553
73574
|
const inferenceContext = getInferenceContext(node);
|
|
73554
73575
|
Debug.assert(inferenceContext);
|
|
73555
73576
|
addIntraExpressionInferenceSite(inferenceContext, e, type);
|
|
@@ -73748,7 +73769,7 @@ function createTypeChecker(host) {
|
|
|
73748
73769
|
prop.links.target = member;
|
|
73749
73770
|
member = prop;
|
|
73750
73771
|
allPropertiesTable == null ? void 0 : allPropertiesTable.set(prop.escapedName, prop);
|
|
73751
|
-
if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 303 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) &&
|
|
73772
|
+
if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && (memberDecl.kind === 303 /* PropertyAssignment */ || memberDecl.kind === 174 /* MethodDeclaration */) && containsContextSensitiveOrCallOrNewExpression(memberDecl)) {
|
|
73752
73773
|
const inferenceContext = getInferenceContext(node);
|
|
73753
73774
|
Debug.assert(inferenceContext);
|
|
73754
73775
|
const inferenceNode = memberDecl.kind === 303 /* PropertyAssignment */ ? memberDecl.initializer : memberDecl;
|
|
@@ -73926,7 +73947,7 @@ function createTypeChecker(host) {
|
|
|
73926
73947
|
addDeprecatedSuggestion(attributeDecl.name, prop.declarations, attributeDecl.name.escapedText);
|
|
73927
73948
|
}
|
|
73928
73949
|
}
|
|
73929
|
-
if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) &&
|
|
73950
|
+
if (contextualType && checkMode & 2 /* Inferential */ && !(checkMode & 4 /* SkipContextSensitive */) && containsContextSensitiveOrCallOrNewExpression(attributeDecl)) {
|
|
73930
73951
|
const inferenceContext = getInferenceContext(attributes);
|
|
73931
73952
|
Debug.assert(inferenceContext);
|
|
73932
73953
|
const inferenceNode = attributeDecl.initializer.expression;
|
|
@@ -76160,7 +76181,7 @@ function createTypeChecker(host) {
|
|
|
76160
76181
|
}
|
|
76161
76182
|
const args = getEffectiveCallArguments(node);
|
|
76162
76183
|
const isSingleNonGenericCandidate = candidates.length === 1 && !candidates[0].typeParameters;
|
|
76163
|
-
if (!isDecorator2 && !isSingleNonGenericCandidate && some(args,
|
|
76184
|
+
if (!isDecorator2 && !isSingleNonGenericCandidate && some(args, containsContextSensitive)) {
|
|
76164
76185
|
argCheckMode = 4 /* SkipContextSensitive */;
|
|
76165
76186
|
}
|
|
76166
76187
|
const signatureHelpTrailingComma = !!(checkMode & 16 /* IsForSignatureHelp */) && node.kind === 213 /* CallExpression */ && node.arguments.hasTrailingComma;
|
|
@@ -78660,7 +78681,7 @@ function createTypeChecker(host) {
|
|
|
78660
78681
|
if (isFunctionExpression(node)) {
|
|
78661
78682
|
checkCollisionsForDeclarationName(node, node.name);
|
|
78662
78683
|
}
|
|
78663
|
-
if (checkMode && checkMode & 4 /* SkipContextSensitive */ &&
|
|
78684
|
+
if (checkMode && checkMode & 4 /* SkipContextSensitive */ && containsContextSensitive(node)) {
|
|
78664
78685
|
if (!getEffectiveReturnTypeNode(node) && !hasContextSensitiveParameters(node)) {
|
|
78665
78686
|
const contextualSignature = getContextualSignature(node);
|
|
78666
78687
|
if (contextualSignature && couldContainTypeVariables(getReturnTypeOfSignature(contextualSignature))) {
|
|
@@ -78707,7 +78728,7 @@ function createTypeChecker(host) {
|
|
|
78707
78728
|
if (!signature) {
|
|
78708
78729
|
return;
|
|
78709
78730
|
}
|
|
78710
|
-
if (
|
|
78731
|
+
if (containsContextSensitive(node)) {
|
|
78711
78732
|
if (contextualSignature) {
|
|
78712
78733
|
const inferenceContext = getInferenceContext(node);
|
|
78713
78734
|
let instantiatedContextualSignature;
|
|
@@ -88078,8 +88099,8 @@ function createTypeChecker(host) {
|
|
|
88078
88099
|
}
|
|
88079
88100
|
}
|
|
88080
88101
|
},
|
|
88081
|
-
symbolToDeclarations: (symbol, meaning, flags, verbosityLevel, out) => {
|
|
88082
|
-
return nodeBuilder.symbolToDeclarations(symbol, meaning, flags, verbosityLevel, out);
|
|
88102
|
+
symbolToDeclarations: (symbol, meaning, flags, maximumLength, verbosityLevel, out) => {
|
|
88103
|
+
return nodeBuilder.symbolToDeclarations(symbol, meaning, flags, maximumLength, verbosityLevel, out);
|
|
88083
88104
|
}
|
|
88084
88105
|
};
|
|
88085
88106
|
function isImportRequiredByAugmentation(node) {
|
|
@@ -127009,7 +127030,7 @@ function canWatchAtTypes(atTypes) {
|
|
|
127009
127030
|
return canWatchAffectedPackageJsonOrNodeModulesOfAtTypes(getDirectoryPath(atTypes));
|
|
127010
127031
|
}
|
|
127011
127032
|
function isInDirectoryPath(dirComponents, fileOrDirComponents) {
|
|
127012
|
-
if (fileOrDirComponents.length <
|
|
127033
|
+
if (fileOrDirComponents.length < dirComponents.length) return false;
|
|
127013
127034
|
for (let i = 0; i < dirComponents.length; i++) {
|
|
127014
127035
|
if (fileOrDirComponents[i] !== dirComponents[i]) return false;
|
|
127015
127036
|
}
|