typescript 4.5.0-dev.20211023 → 4.5.0-dev.20211027
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/cs/diagnosticMessages.generated.json +1 -0
- package/lib/de/diagnosticMessages.generated.json +1 -0
- package/lib/es/diagnosticMessages.generated.json +1 -0
- package/lib/fr/diagnosticMessages.generated.json +1 -0
- package/lib/it/diagnosticMessages.generated.json +1 -0
- package/lib/ja/diagnosticMessages.generated.json +1 -0
- package/lib/ko/diagnosticMessages.generated.json +1 -0
- package/lib/pl/diagnosticMessages.generated.json +1 -0
- package/lib/pt-br/diagnosticMessages.generated.json +1 -0
- package/lib/ru/diagnosticMessages.generated.json +1 -0
- package/lib/tr/diagnosticMessages.generated.json +1 -0
- package/lib/tsc.js +56 -45
- package/lib/tsserver.js +59 -48
- package/lib/tsserverlibrary.js +59 -48
- package/lib/typescript.js +59 -48
- package/lib/typescriptServices.js +59 -48
- package/lib/typingsInstaller.js +57 -48
- package/lib/zh-cn/diagnosticMessages.generated.json +1 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -0
- package/package.json +1 -1
package/lib/typescript.js
CHANGED
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211027";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -49602,21 +49602,28 @@ var ts;
|
|
|
49602
49602
|
var namespaceName = getFullyQualifiedName(namespace);
|
|
49603
49603
|
var declarationName = ts.declarationNameToString(right);
|
|
49604
49604
|
var suggestionForNonexistentModule = getSuggestedSymbolForNonexistentModule(right, namespace);
|
|
49605
|
-
var exportedTypeSymbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, 788968 /* Type */));
|
|
49606
|
-
var containingQualifiedName = ts.isQualifiedName(name) && getContainingQualifiedNameNode(name);
|
|
49607
|
-
var canSuggestTypeof = containingQualifiedName && !ts.isTypeOfExpression(containingQualifiedName.parent) && tryGetQualifiedNameAsValue(containingQualifiedName);
|
|
49608
49605
|
if (suggestionForNonexistentModule) {
|
|
49609
49606
|
error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestionForNonexistentModule));
|
|
49607
|
+
return undefined;
|
|
49610
49608
|
}
|
|
49611
|
-
|
|
49609
|
+
var containingQualifiedName = ts.isQualifiedName(name) && getContainingQualifiedNameNode(name);
|
|
49610
|
+
var canSuggestTypeof = globalObjectType // <-- can't pull on types if global types aren't initialized yet
|
|
49611
|
+
&& (meaning & 788968 /* Type */)
|
|
49612
|
+
&& containingQualifiedName
|
|
49613
|
+
&& !ts.isTypeOfExpression(containingQualifiedName.parent)
|
|
49614
|
+
&& tryGetQualifiedNameAsValue(containingQualifiedName);
|
|
49615
|
+
if (canSuggestTypeof) {
|
|
49612
49616
|
error(containingQualifiedName, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.entityNameToString(containingQualifiedName));
|
|
49617
|
+
return undefined;
|
|
49613
49618
|
}
|
|
49614
|
-
|
|
49615
|
-
|
|
49616
|
-
|
|
49617
|
-
|
|
49618
|
-
|
|
49619
|
+
if (meaning & 1920 /* Namespace */ && ts.isQualifiedName(name.parent)) {
|
|
49620
|
+
var exportedTypeSymbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, 788968 /* Type */));
|
|
49621
|
+
if (exportedTypeSymbol) {
|
|
49622
|
+
error(name.parent.right, ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, symbolToString(exportedTypeSymbol), ts.unescapeLeadingUnderscores(name.parent.right.escapedText));
|
|
49623
|
+
return undefined;
|
|
49624
|
+
}
|
|
49619
49625
|
}
|
|
49626
|
+
error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName);
|
|
49620
49627
|
}
|
|
49621
49628
|
return undefined;
|
|
49622
49629
|
}
|
|
@@ -59529,7 +59536,7 @@ var ts;
|
|
|
59529
59536
|
var _loop_16 = function () {
|
|
59530
59537
|
i--;
|
|
59531
59538
|
var t = types[i];
|
|
59532
|
-
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return
|
|
59539
|
+
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
59533
59540
|
ts.orderedRemoveItemAt(types, i);
|
|
59534
59541
|
}
|
|
59535
59542
|
};
|
|
@@ -63262,13 +63269,12 @@ var ts;
|
|
|
63262
63269
|
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
63263
63270
|
var result = 0 /* False */;
|
|
63264
63271
|
var saveErrorInfo = captureErrorCalculationState();
|
|
63265
|
-
|
|
63266
|
-
|
|
63267
|
-
|
|
63268
|
-
|
|
63269
|
-
|
|
63270
|
-
|
|
63271
|
-
structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63272
|
+
if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
63273
|
+
// We skip caching when source or target is a union with no more than three constituents.
|
|
63274
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63275
|
+
}
|
|
63276
|
+
else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
|
|
63277
|
+
result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
|
|
63272
63278
|
}
|
|
63273
63279
|
if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
|
|
63274
63280
|
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
@@ -63725,19 +63731,19 @@ var ts;
|
|
|
63725
63731
|
var maybeStart = maybeCount;
|
|
63726
63732
|
maybeKeys[maybeCount] = id;
|
|
63727
63733
|
maybeCount++;
|
|
63734
|
+
var saveExpandingFlags = expandingFlags;
|
|
63728
63735
|
if (recursionFlags & 1 /* Source */) {
|
|
63729
63736
|
sourceStack[sourceDepth] = source;
|
|
63730
63737
|
sourceDepth++;
|
|
63738
|
+
if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
63739
|
+
expandingFlags |= 1 /* Source */;
|
|
63731
63740
|
}
|
|
63732
63741
|
if (recursionFlags & 2 /* Target */) {
|
|
63733
63742
|
targetStack[targetDepth] = target;
|
|
63734
63743
|
targetDepth++;
|
|
63744
|
+
if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
63745
|
+
expandingFlags |= 2 /* Target */;
|
|
63735
63746
|
}
|
|
63736
|
-
var saveExpandingFlags = expandingFlags;
|
|
63737
|
-
if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
63738
|
-
expandingFlags |= 1 /* Source */;
|
|
63739
|
-
if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
63740
|
-
expandingFlags |= 2 /* Target */;
|
|
63741
63747
|
var originalHandler;
|
|
63742
63748
|
var propagatingVarianceFlags = 0;
|
|
63743
63749
|
if (outofbandVarianceMarkerHandler) {
|
|
@@ -63761,13 +63767,13 @@ var ts;
|
|
|
63761
63767
|
if (outofbandVarianceMarkerHandler) {
|
|
63762
63768
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
63763
63769
|
}
|
|
63764
|
-
expandingFlags = saveExpandingFlags;
|
|
63765
63770
|
if (recursionFlags & 1 /* Source */) {
|
|
63766
63771
|
sourceDepth--;
|
|
63767
63772
|
}
|
|
63768
63773
|
if (recursionFlags & 2 /* Target */) {
|
|
63769
63774
|
targetDepth--;
|
|
63770
63775
|
}
|
|
63776
|
+
expandingFlags = saveExpandingFlags;
|
|
63771
63777
|
if (result) {
|
|
63772
63778
|
if (result === -1 /* True */ || (sourceDepth === 0 && targetDepth === 0)) {
|
|
63773
63779
|
if (result === -1 /* True */ || result === 3 /* Maybe */) {
|
|
@@ -64105,8 +64111,7 @@ var ts;
|
|
|
64105
64111
|
// For example, `foo-${number}` is related to `foo-${string}` even though number isn't related to string.
|
|
64106
64112
|
instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
|
|
64107
64113
|
}
|
|
64108
|
-
|
|
64109
|
-
if (result_9 && ts.every(result_9, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); })) {
|
|
64114
|
+
if (isTypeMatchedByTemplateLiteralType(source, target)) {
|
|
64110
64115
|
return -1 /* True */;
|
|
64111
64116
|
}
|
|
64112
64117
|
}
|
|
@@ -64301,9 +64306,9 @@ var ts;
|
|
|
64301
64306
|
if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
|
|
64302
64307
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
|
|
64303
64308
|
if (objectOnlyTarget.flags & 1048576 /* Union */) {
|
|
64304
|
-
var
|
|
64305
|
-
if (
|
|
64306
|
-
return
|
|
64309
|
+
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
64310
|
+
if (result_9) {
|
|
64311
|
+
return result_9;
|
|
64307
64312
|
}
|
|
64308
64313
|
}
|
|
64309
64314
|
}
|
|
@@ -64375,13 +64380,13 @@ var ts;
|
|
|
64375
64380
|
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
|
|
64376
64381
|
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
|
|
64377
64382
|
if (modifiersRelated) {
|
|
64378
|
-
var
|
|
64383
|
+
var result_10;
|
|
64379
64384
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
64380
64385
|
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
|
|
64381
|
-
if (
|
|
64386
|
+
if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
|
|
64382
64387
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
64383
64388
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
64384
|
-
return
|
|
64389
|
+
return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
|
|
64385
64390
|
}
|
|
64386
64391
|
}
|
|
64387
64392
|
}
|
|
@@ -66464,6 +66469,10 @@ var ts;
|
|
|
66464
66469
|
inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) :
|
|
66465
66470
|
undefined;
|
|
66466
66471
|
}
|
|
66472
|
+
function isTypeMatchedByTemplateLiteralType(source, target) {
|
|
66473
|
+
var inferences = inferTypesFromTemplateLiteralType(source, target);
|
|
66474
|
+
return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
|
|
66475
|
+
}
|
|
66467
66476
|
function getStringLikeTypeForType(type) {
|
|
66468
66477
|
return type.flags & (1 /* Any */ | 402653316 /* StringLike */) ? type : getTemplateLiteralType(["", ""], [type]);
|
|
66469
66478
|
}
|
|
@@ -67999,7 +68008,7 @@ var ts;
|
|
|
67999
68008
|
mapType(type, mapper);
|
|
68000
68009
|
}
|
|
68001
68010
|
function getConstituentCount(type) {
|
|
68002
|
-
return type.flags &
|
|
68011
|
+
return type.flags & 1048576 /* Union */ ? type.types.length : 1;
|
|
68003
68012
|
}
|
|
68004
68013
|
function extractTypesOfKind(type, kind) {
|
|
68005
68014
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
@@ -69497,7 +69506,7 @@ var ts;
|
|
|
69497
69506
|
return parent.kind === 205 /* PropertyAccessExpression */ ||
|
|
69498
69507
|
parent.kind === 207 /* CallExpression */ && parent.expression === node ||
|
|
69499
69508
|
parent.kind === 206 /* ElementAccessExpression */ && parent.expression === node &&
|
|
69500
|
-
!(
|
|
69509
|
+
!(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
|
|
69501
69510
|
}
|
|
69502
69511
|
function isGenericTypeWithUnionConstraint(type) {
|
|
69503
69512
|
return !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
|
|
@@ -78926,12 +78935,12 @@ var ts;
|
|
|
78926
78935
|
case 264 /* ImportEqualsDeclaration */:
|
|
78927
78936
|
case 267 /* NamespaceImport */:
|
|
78928
78937
|
case 266 /* ImportClause */:
|
|
78929
|
-
var
|
|
78938
|
+
var result_11 = 0 /* None */;
|
|
78930
78939
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
78931
78940
|
ts.forEach(target.declarations, function (d) {
|
|
78932
|
-
|
|
78941
|
+
result_11 |= getDeclarationSpaces(d);
|
|
78933
78942
|
});
|
|
78934
|
-
return
|
|
78943
|
+
return result_11;
|
|
78935
78944
|
case 253 /* VariableDeclaration */:
|
|
78936
78945
|
case 202 /* BindingElement */:
|
|
78937
78946
|
case 255 /* FunctionDeclaration */:
|
|
@@ -95104,8 +95113,8 @@ var ts;
|
|
|
95104
95113
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
95105
95114
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
95106
95115
|
if (ts.length(nonWhitespaceChildren) === 1) {
|
|
95107
|
-
var
|
|
95108
|
-
return
|
|
95116
|
+
var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
95117
|
+
return result_12 && factory.createPropertyAssignment("children", result_12);
|
|
95109
95118
|
}
|
|
95110
95119
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
95111
95120
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -113905,15 +113914,15 @@ var ts;
|
|
|
113905
113914
|
// which per above occurred during the current program creation.
|
|
113906
113915
|
// Since we assume the filesystem does not change during program creation,
|
|
113907
113916
|
// it is safe to reuse resolutions from the earlier call.
|
|
113908
|
-
var
|
|
113917
|
+
var result_13 = [];
|
|
113909
113918
|
var i = 0;
|
|
113910
113919
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
113911
113920
|
var moduleName = moduleNames_1[_i];
|
|
113912
113921
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
113913
113922
|
i++;
|
|
113914
|
-
|
|
113923
|
+
result_13.push(resolvedModule);
|
|
113915
113924
|
}
|
|
113916
|
-
return
|
|
113925
|
+
return result_13;
|
|
113917
113926
|
}
|
|
113918
113927
|
// At this point, we know at least one of the following hold:
|
|
113919
113928
|
// - file has local declarations for ambient modules
|
|
@@ -118975,9 +118984,9 @@ var ts;
|
|
|
118975
118984
|
if (!preferSymlinks) {
|
|
118976
118985
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
118977
118986
|
// so we only need to remove them from the realpath filenames.
|
|
118978
|
-
var
|
|
118979
|
-
if (
|
|
118980
|
-
return
|
|
118987
|
+
var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
118988
|
+
if (result_14)
|
|
118989
|
+
return result_14;
|
|
118981
118990
|
}
|
|
118982
118991
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
118983
118992
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -118997,10 +119006,10 @@ var ts;
|
|
|
118997
119006
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
118998
119007
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
118999
119008
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
119000
|
-
var
|
|
119009
|
+
var result_15 = cb(option, target === referenceRedirect);
|
|
119001
119010
|
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
119002
|
-
if (
|
|
119003
|
-
return
|
|
119011
|
+
if (result_15)
|
|
119012
|
+
return result_15;
|
|
119004
119013
|
}
|
|
119005
119014
|
});
|
|
119006
119015
|
});
|
|
@@ -130193,6 +130202,8 @@ var ts;
|
|
|
130193
130202
|
case 131 /* AsyncKeyword */:
|
|
130194
130203
|
return containingNodeKind === 168 /* MethodDeclaration */ // const obj = { async c|()
|
|
130195
130204
|
|| containingNodeKind === 295 /* ShorthandPropertyAssignment */; // const obj = { async c|
|
|
130205
|
+
case 41 /* AsteriskToken */:
|
|
130206
|
+
return containingNodeKind === 168 /* MethodDeclaration */; // const obj = { * c|
|
|
130196
130207
|
}
|
|
130197
130208
|
if (isClassMemberCompletionKeyword(tokenKind)) {
|
|
130198
130209
|
return true;
|
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20211027";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -49602,21 +49602,28 @@ var ts;
|
|
|
49602
49602
|
var namespaceName = getFullyQualifiedName(namespace);
|
|
49603
49603
|
var declarationName = ts.declarationNameToString(right);
|
|
49604
49604
|
var suggestionForNonexistentModule = getSuggestedSymbolForNonexistentModule(right, namespace);
|
|
49605
|
-
var exportedTypeSymbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, 788968 /* Type */));
|
|
49606
|
-
var containingQualifiedName = ts.isQualifiedName(name) && getContainingQualifiedNameNode(name);
|
|
49607
|
-
var canSuggestTypeof = containingQualifiedName && !ts.isTypeOfExpression(containingQualifiedName.parent) && tryGetQualifiedNameAsValue(containingQualifiedName);
|
|
49608
49605
|
if (suggestionForNonexistentModule) {
|
|
49609
49606
|
error(right, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, namespaceName, declarationName, symbolToString(suggestionForNonexistentModule));
|
|
49607
|
+
return undefined;
|
|
49610
49608
|
}
|
|
49611
|
-
|
|
49609
|
+
var containingQualifiedName = ts.isQualifiedName(name) && getContainingQualifiedNameNode(name);
|
|
49610
|
+
var canSuggestTypeof = globalObjectType // <-- can't pull on types if global types aren't initialized yet
|
|
49611
|
+
&& (meaning & 788968 /* Type */)
|
|
49612
|
+
&& containingQualifiedName
|
|
49613
|
+
&& !ts.isTypeOfExpression(containingQualifiedName.parent)
|
|
49614
|
+
&& tryGetQualifiedNameAsValue(containingQualifiedName);
|
|
49615
|
+
if (canSuggestTypeof) {
|
|
49612
49616
|
error(containingQualifiedName, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.entityNameToString(containingQualifiedName));
|
|
49617
|
+
return undefined;
|
|
49613
49618
|
}
|
|
49614
|
-
|
|
49615
|
-
|
|
49616
|
-
|
|
49617
|
-
|
|
49618
|
-
|
|
49619
|
+
if (meaning & 1920 /* Namespace */ && ts.isQualifiedName(name.parent)) {
|
|
49620
|
+
var exportedTypeSymbol = getMergedSymbol(getSymbol(getExportsOfSymbol(namespace), right.escapedText, 788968 /* Type */));
|
|
49621
|
+
if (exportedTypeSymbol) {
|
|
49622
|
+
error(name.parent.right, ts.Diagnostics.Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1, symbolToString(exportedTypeSymbol), ts.unescapeLeadingUnderscores(name.parent.right.escapedText));
|
|
49623
|
+
return undefined;
|
|
49624
|
+
}
|
|
49619
49625
|
}
|
|
49626
|
+
error(right, ts.Diagnostics.Namespace_0_has_no_exported_member_1, namespaceName, declarationName);
|
|
49620
49627
|
}
|
|
49621
49628
|
return undefined;
|
|
49622
49629
|
}
|
|
@@ -59529,7 +59536,7 @@ var ts;
|
|
|
59529
59536
|
var _loop_16 = function () {
|
|
59530
59537
|
i--;
|
|
59531
59538
|
var t = types[i];
|
|
59532
|
-
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return
|
|
59539
|
+
if (t.flags & 128 /* StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
|
|
59533
59540
|
ts.orderedRemoveItemAt(types, i);
|
|
59534
59541
|
}
|
|
59535
59542
|
};
|
|
@@ -63262,13 +63269,12 @@ var ts;
|
|
|
63262
63269
|
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
63263
63270
|
var result = 0 /* False */;
|
|
63264
63271
|
var saveErrorInfo = captureErrorCalculationState();
|
|
63265
|
-
|
|
63266
|
-
|
|
63267
|
-
|
|
63268
|
-
|
|
63269
|
-
|
|
63270
|
-
|
|
63271
|
-
structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63272
|
+
if ((source.flags & 1048576 /* Union */ || target.flags & 1048576 /* Union */) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
63273
|
+
// We skip caching when source or target is a union with no more than three constituents.
|
|
63274
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */);
|
|
63275
|
+
}
|
|
63276
|
+
else if (source.flags & 3145728 /* UnionOrIntersection */ || target.flags & 3145728 /* UnionOrIntersection */) {
|
|
63277
|
+
result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8 /* UnionIntersectionCheck */, recursionFlags);
|
|
63272
63278
|
}
|
|
63273
63279
|
if (!result && !(source.flags & 1048576 /* Union */) && (source.flags & (469499904 /* StructuredOrInstantiable */) || target.flags & 469499904 /* StructuredOrInstantiable */)) {
|
|
63274
63280
|
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
@@ -63725,19 +63731,19 @@ var ts;
|
|
|
63725
63731
|
var maybeStart = maybeCount;
|
|
63726
63732
|
maybeKeys[maybeCount] = id;
|
|
63727
63733
|
maybeCount++;
|
|
63734
|
+
var saveExpandingFlags = expandingFlags;
|
|
63728
63735
|
if (recursionFlags & 1 /* Source */) {
|
|
63729
63736
|
sourceStack[sourceDepth] = source;
|
|
63730
63737
|
sourceDepth++;
|
|
63738
|
+
if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
63739
|
+
expandingFlags |= 1 /* Source */;
|
|
63731
63740
|
}
|
|
63732
63741
|
if (recursionFlags & 2 /* Target */) {
|
|
63733
63742
|
targetStack[targetDepth] = target;
|
|
63734
63743
|
targetDepth++;
|
|
63744
|
+
if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
63745
|
+
expandingFlags |= 2 /* Target */;
|
|
63735
63746
|
}
|
|
63736
|
-
var saveExpandingFlags = expandingFlags;
|
|
63737
|
-
if (!(expandingFlags & 1 /* Source */) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
63738
|
-
expandingFlags |= 1 /* Source */;
|
|
63739
|
-
if (!(expandingFlags & 2 /* Target */) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
63740
|
-
expandingFlags |= 2 /* Target */;
|
|
63741
63747
|
var originalHandler;
|
|
63742
63748
|
var propagatingVarianceFlags = 0;
|
|
63743
63749
|
if (outofbandVarianceMarkerHandler) {
|
|
@@ -63761,13 +63767,13 @@ var ts;
|
|
|
63761
63767
|
if (outofbandVarianceMarkerHandler) {
|
|
63762
63768
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
63763
63769
|
}
|
|
63764
|
-
expandingFlags = saveExpandingFlags;
|
|
63765
63770
|
if (recursionFlags & 1 /* Source */) {
|
|
63766
63771
|
sourceDepth--;
|
|
63767
63772
|
}
|
|
63768
63773
|
if (recursionFlags & 2 /* Target */) {
|
|
63769
63774
|
targetDepth--;
|
|
63770
63775
|
}
|
|
63776
|
+
expandingFlags = saveExpandingFlags;
|
|
63771
63777
|
if (result) {
|
|
63772
63778
|
if (result === -1 /* True */ || (sourceDepth === 0 && targetDepth === 0)) {
|
|
63773
63779
|
if (result === -1 /* True */ || result === 3 /* Maybe */) {
|
|
@@ -64105,8 +64111,7 @@ var ts;
|
|
|
64105
64111
|
// For example, `foo-${number}` is related to `foo-${string}` even though number isn't related to string.
|
|
64106
64112
|
instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
|
|
64107
64113
|
}
|
|
64108
|
-
|
|
64109
|
-
if (result_9 && ts.every(result_9, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); })) {
|
|
64114
|
+
if (isTypeMatchedByTemplateLiteralType(source, target)) {
|
|
64110
64115
|
return -1 /* True */;
|
|
64111
64116
|
}
|
|
64112
64117
|
}
|
|
@@ -64301,9 +64306,9 @@ var ts;
|
|
|
64301
64306
|
if (source.flags & (524288 /* Object */ | 2097152 /* Intersection */) && target.flags & 1048576 /* Union */) {
|
|
64302
64307
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 /* Object */ | 2097152 /* Intersection */ | 33554432 /* Substitution */);
|
|
64303
64308
|
if (objectOnlyTarget.flags & 1048576 /* Union */) {
|
|
64304
|
-
var
|
|
64305
|
-
if (
|
|
64306
|
-
return
|
|
64309
|
+
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
64310
|
+
if (result_9) {
|
|
64311
|
+
return result_9;
|
|
64307
64312
|
}
|
|
64308
64313
|
}
|
|
64309
64314
|
}
|
|
@@ -64375,13 +64380,13 @@ var ts;
|
|
|
64375
64380
|
var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) :
|
|
64376
64381
|
getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target));
|
|
64377
64382
|
if (modifiersRelated) {
|
|
64378
|
-
var
|
|
64383
|
+
var result_10;
|
|
64379
64384
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
64380
64385
|
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
|
|
64381
|
-
if (
|
|
64386
|
+
if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* Both */, reportErrors)) {
|
|
64382
64387
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
64383
64388
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
64384
|
-
return
|
|
64389
|
+
return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* Both */, reportErrors);
|
|
64385
64390
|
}
|
|
64386
64391
|
}
|
|
64387
64392
|
}
|
|
@@ -66464,6 +66469,10 @@ var ts;
|
|
|
66464
66469
|
inferFromLiteralPartsToTemplateLiteral(source.texts, source.types, target) :
|
|
66465
66470
|
undefined;
|
|
66466
66471
|
}
|
|
66472
|
+
function isTypeMatchedByTemplateLiteralType(source, target) {
|
|
66473
|
+
var inferences = inferTypesFromTemplateLiteralType(source, target);
|
|
66474
|
+
return !!inferences && ts.every(inferences, function (r, i) { return isValidTypeForTemplateLiteralPlaceholder(r, target.types[i]); });
|
|
66475
|
+
}
|
|
66467
66476
|
function getStringLikeTypeForType(type) {
|
|
66468
66477
|
return type.flags & (1 /* Any */ | 402653316 /* StringLike */) ? type : getTemplateLiteralType(["", ""], [type]);
|
|
66469
66478
|
}
|
|
@@ -67999,7 +68008,7 @@ var ts;
|
|
|
67999
68008
|
mapType(type, mapper);
|
|
68000
68009
|
}
|
|
68001
68010
|
function getConstituentCount(type) {
|
|
68002
|
-
return type.flags &
|
|
68011
|
+
return type.flags & 1048576 /* Union */ ? type.types.length : 1;
|
|
68003
68012
|
}
|
|
68004
68013
|
function extractTypesOfKind(type, kind) {
|
|
68005
68014
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
@@ -69497,7 +69506,7 @@ var ts;
|
|
|
69497
69506
|
return parent.kind === 205 /* PropertyAccessExpression */ ||
|
|
69498
69507
|
parent.kind === 207 /* CallExpression */ && parent.expression === node ||
|
|
69499
69508
|
parent.kind === 206 /* ElementAccessExpression */ && parent.expression === node &&
|
|
69500
|
-
!(
|
|
69509
|
+
!(someType(type, isGenericTypeWithoutNullableConstraint) && isGenericIndexType(getTypeOfExpression(parent.argumentExpression)));
|
|
69501
69510
|
}
|
|
69502
69511
|
function isGenericTypeWithUnionConstraint(type) {
|
|
69503
69512
|
return !!(type.flags & 465829888 /* Instantiable */ && getBaseConstraintOrType(type).flags & (98304 /* Nullable */ | 1048576 /* Union */));
|
|
@@ -78926,12 +78935,12 @@ var ts;
|
|
|
78926
78935
|
case 264 /* ImportEqualsDeclaration */:
|
|
78927
78936
|
case 267 /* NamespaceImport */:
|
|
78928
78937
|
case 266 /* ImportClause */:
|
|
78929
|
-
var
|
|
78938
|
+
var result_11 = 0 /* None */;
|
|
78930
78939
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
78931
78940
|
ts.forEach(target.declarations, function (d) {
|
|
78932
|
-
|
|
78941
|
+
result_11 |= getDeclarationSpaces(d);
|
|
78933
78942
|
});
|
|
78934
|
-
return
|
|
78943
|
+
return result_11;
|
|
78935
78944
|
case 253 /* VariableDeclaration */:
|
|
78936
78945
|
case 202 /* BindingElement */:
|
|
78937
78946
|
case 255 /* FunctionDeclaration */:
|
|
@@ -95104,8 +95113,8 @@ var ts;
|
|
|
95104
95113
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
95105
95114
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
95106
95115
|
if (ts.length(nonWhitespaceChildren) === 1) {
|
|
95107
|
-
var
|
|
95108
|
-
return
|
|
95116
|
+
var result_12 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
95117
|
+
return result_12 && factory.createPropertyAssignment("children", result_12);
|
|
95109
95118
|
}
|
|
95110
95119
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
95111
95120
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -113905,15 +113914,15 @@ var ts;
|
|
|
113905
113914
|
// which per above occurred during the current program creation.
|
|
113906
113915
|
// Since we assume the filesystem does not change during program creation,
|
|
113907
113916
|
// it is safe to reuse resolutions from the earlier call.
|
|
113908
|
-
var
|
|
113917
|
+
var result_13 = [];
|
|
113909
113918
|
var i = 0;
|
|
113910
113919
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
113911
113920
|
var moduleName = moduleNames_1[_i];
|
|
113912
113921
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
113913
113922
|
i++;
|
|
113914
|
-
|
|
113923
|
+
result_13.push(resolvedModule);
|
|
113915
113924
|
}
|
|
113916
|
-
return
|
|
113925
|
+
return result_13;
|
|
113917
113926
|
}
|
|
113918
113927
|
// At this point, we know at least one of the following hold:
|
|
113919
113928
|
// - file has local declarations for ambient modules
|
|
@@ -118975,9 +118984,9 @@ var ts;
|
|
|
118975
118984
|
if (!preferSymlinks) {
|
|
118976
118985
|
// Symlinks inside ignored paths are already filtered out of the symlink cache,
|
|
118977
118986
|
// so we only need to remove them from the realpath filenames.
|
|
118978
|
-
var
|
|
118979
|
-
if (
|
|
118980
|
-
return
|
|
118987
|
+
var result_14 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
118988
|
+
if (result_14)
|
|
118989
|
+
return result_14;
|
|
118981
118990
|
}
|
|
118982
118991
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
118983
118992
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -118997,10 +119006,10 @@ var ts;
|
|
|
118997
119006
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
118998
119007
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
118999
119008
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
119000
|
-
var
|
|
119009
|
+
var result_15 = cb(option, target === referenceRedirect);
|
|
119001
119010
|
shouldFilterIgnoredPaths = true; // We found a non-ignored path in symlinks, so we can reject ignored-path realpaths
|
|
119002
|
-
if (
|
|
119003
|
-
return
|
|
119011
|
+
if (result_15)
|
|
119012
|
+
return result_15;
|
|
119004
119013
|
}
|
|
119005
119014
|
});
|
|
119006
119015
|
});
|
|
@@ -130193,6 +130202,8 @@ var ts;
|
|
|
130193
130202
|
case 131 /* AsyncKeyword */:
|
|
130194
130203
|
return containingNodeKind === 168 /* MethodDeclaration */ // const obj = { async c|()
|
|
130195
130204
|
|| containingNodeKind === 295 /* ShorthandPropertyAssignment */; // const obj = { async c|
|
|
130205
|
+
case 41 /* AsteriskToken */:
|
|
130206
|
+
return containingNodeKind === 168 /* MethodDeclaration */; // const obj = { * c|
|
|
130196
130207
|
}
|
|
130197
130208
|
if (isClassMemberCompletionKeyword(tokenKind)) {
|
|
130198
130209
|
return true;
|