@typescript-deploys/pr-build 5.3.0-pr-55273-3 → 5.3.0-pr-55020-2
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 +131 -63
- package/lib/tsserver.js +158 -69
- package/lib/typescript.js +156 -69
- package/lib/typingsInstaller.js +20 -21
- package/package.json +2 -2
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.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230816`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -12422,16 +12422,14 @@ function createDiagnosticForNodeArrayFromMessageChain(sourceFile, nodes, message
|
|
|
12422
12422
|
const start = skipTrivia(sourceFile.text, nodes.pos);
|
|
12423
12423
|
return createFileDiagnosticFromMessageChain(sourceFile, start, nodes.end - start, messageChain, relatedInformation);
|
|
12424
12424
|
}
|
|
12425
|
-
function assertDiagnosticLocation(
|
|
12425
|
+
function assertDiagnosticLocation(sourceText, start, length2) {
|
|
12426
12426
|
Debug.assertGreaterThanOrEqual(start, 0);
|
|
12427
12427
|
Debug.assertGreaterThanOrEqual(length2, 0);
|
|
12428
|
-
|
|
12429
|
-
|
|
12430
|
-
Debug.assertLessThanOrEqual(start + length2, file.text.length);
|
|
12431
|
-
}
|
|
12428
|
+
Debug.assertLessThanOrEqual(start, sourceText.length);
|
|
12429
|
+
Debug.assertLessThanOrEqual(start + length2, sourceText.length);
|
|
12432
12430
|
}
|
|
12433
12431
|
function createFileDiagnosticFromMessageChain(file, start, length2, messageChain, relatedInformation) {
|
|
12434
|
-
assertDiagnosticLocation(file, start, length2);
|
|
12432
|
+
assertDiagnosticLocation(file.text, start, length2);
|
|
12435
12433
|
return {
|
|
12436
12434
|
file,
|
|
12437
12435
|
start,
|
|
@@ -13288,8 +13286,8 @@ function isInExpressionContext(node) {
|
|
|
13288
13286
|
return forStatement.initializer === node && forStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forStatement.condition === node || forStatement.incrementor === node;
|
|
13289
13287
|
case 249 /* ForInStatement */:
|
|
13290
13288
|
case 250 /* ForOfStatement */:
|
|
13291
|
-
const
|
|
13292
|
-
return
|
|
13289
|
+
const forInOrOfStatement = parent;
|
|
13290
|
+
return forInOrOfStatement.initializer === node && forInOrOfStatement.initializer.kind !== 261 /* VariableDeclarationList */ || forInOrOfStatement.expression === node;
|
|
13293
13291
|
case 216 /* TypeAssertionExpression */:
|
|
13294
13292
|
case 234 /* AsExpression */:
|
|
13295
13293
|
return node === parent.expression;
|
|
@@ -13950,20 +13948,23 @@ function getTypeParameterFromJsDoc(node) {
|
|
|
13950
13948
|
const { typeParameters } = node.parent.parent.parent;
|
|
13951
13949
|
return typeParameters && find(typeParameters, (p) => p.name.escapedText === name);
|
|
13952
13950
|
}
|
|
13953
|
-
function
|
|
13951
|
+
function getAssignmentTarget(node) {
|
|
13954
13952
|
let parent = node.parent;
|
|
13955
13953
|
while (true) {
|
|
13956
13954
|
switch (parent.kind) {
|
|
13957
13955
|
case 226 /* BinaryExpression */:
|
|
13958
|
-
const
|
|
13959
|
-
|
|
13956
|
+
const binaryExpression = parent;
|
|
13957
|
+
const binaryOperator = binaryExpression.operatorToken.kind;
|
|
13958
|
+
return isAssignmentOperator(binaryOperator) && binaryExpression.left === node ? binaryExpression : void 0;
|
|
13960
13959
|
case 224 /* PrefixUnaryExpression */:
|
|
13961
13960
|
case 225 /* PostfixUnaryExpression */:
|
|
13962
|
-
const
|
|
13963
|
-
|
|
13961
|
+
const unaryExpression = parent;
|
|
13962
|
+
const unaryOperator = unaryExpression.operator;
|
|
13963
|
+
return unaryOperator === 46 /* PlusPlusToken */ || unaryOperator === 47 /* MinusMinusToken */ ? unaryExpression : void 0;
|
|
13964
13964
|
case 249 /* ForInStatement */:
|
|
13965
13965
|
case 250 /* ForOfStatement */:
|
|
13966
|
-
|
|
13966
|
+
const forInOrOfStatement = parent;
|
|
13967
|
+
return forInOrOfStatement.initializer === node ? forInOrOfStatement : void 0;
|
|
13967
13968
|
case 217 /* ParenthesizedExpression */:
|
|
13968
13969
|
case 209 /* ArrayLiteralExpression */:
|
|
13969
13970
|
case 230 /* SpreadElement */:
|
|
@@ -13975,24 +13976,53 @@ function getAssignmentTargetKind(node) {
|
|
|
13975
13976
|
break;
|
|
13976
13977
|
case 304 /* ShorthandPropertyAssignment */:
|
|
13977
13978
|
if (parent.name !== node) {
|
|
13978
|
-
return 0
|
|
13979
|
+
return void 0;
|
|
13979
13980
|
}
|
|
13980
13981
|
node = parent.parent;
|
|
13981
13982
|
break;
|
|
13982
13983
|
case 303 /* PropertyAssignment */:
|
|
13983
13984
|
if (parent.name === node) {
|
|
13984
|
-
return 0
|
|
13985
|
+
return void 0;
|
|
13985
13986
|
}
|
|
13986
13987
|
node = parent.parent;
|
|
13987
13988
|
break;
|
|
13988
13989
|
default:
|
|
13989
|
-
return 0
|
|
13990
|
+
return void 0;
|
|
13990
13991
|
}
|
|
13991
13992
|
parent = node.parent;
|
|
13992
13993
|
}
|
|
13993
13994
|
}
|
|
13995
|
+
function getAssignmentTargetKind(node) {
|
|
13996
|
+
const target = getAssignmentTarget(node);
|
|
13997
|
+
if (!target) {
|
|
13998
|
+
return 0 /* None */;
|
|
13999
|
+
}
|
|
14000
|
+
switch (target.kind) {
|
|
14001
|
+
case 226 /* BinaryExpression */:
|
|
14002
|
+
const binaryOperator = target.operatorToken.kind;
|
|
14003
|
+
return binaryOperator === 64 /* EqualsToken */ || isLogicalOrCoalescingAssignmentOperator(binaryOperator) ? 1 /* Definite */ : 2 /* Compound */;
|
|
14004
|
+
case 224 /* PrefixUnaryExpression */:
|
|
14005
|
+
case 225 /* PostfixUnaryExpression */:
|
|
14006
|
+
return 2 /* Compound */;
|
|
14007
|
+
case 249 /* ForInStatement */:
|
|
14008
|
+
case 250 /* ForOfStatement */:
|
|
14009
|
+
return 1 /* Definite */;
|
|
14010
|
+
}
|
|
14011
|
+
}
|
|
13994
14012
|
function isAssignmentTarget(node) {
|
|
13995
|
-
return
|
|
14013
|
+
return !!getAssignmentTarget(node);
|
|
14014
|
+
}
|
|
14015
|
+
function isCompoundLikeAssignment(assignment) {
|
|
14016
|
+
const right = skipParentheses(assignment.right);
|
|
14017
|
+
return right.kind === 226 /* BinaryExpression */ && isShiftOperatorOrHigher(right.operatorToken.kind);
|
|
14018
|
+
}
|
|
14019
|
+
function isInCompoundLikeAssignment(node) {
|
|
14020
|
+
const target = getAssignmentTarget(node);
|
|
14021
|
+
return !!target && isAssignmentExpression(
|
|
14022
|
+
target,
|
|
14023
|
+
/*excludeCompoundAssignment*/
|
|
14024
|
+
true
|
|
14025
|
+
) && isCompoundLikeAssignment(target);
|
|
13996
14026
|
}
|
|
13997
14027
|
function isNodeWithPossibleHoistedDeclaration(node) {
|
|
13998
14028
|
switch (node.kind) {
|
|
@@ -14642,8 +14672,11 @@ var templateSubstitutionRegExp = /\$\{/g;
|
|
|
14642
14672
|
function escapeTemplateSubstitution(str) {
|
|
14643
14673
|
return str.replace(templateSubstitutionRegExp, "\\${");
|
|
14644
14674
|
}
|
|
14675
|
+
function containsInvalidEscapeFlag(node) {
|
|
14676
|
+
return !!((node.templateFlags || 0) & 2048 /* ContainsInvalidEscape */);
|
|
14677
|
+
}
|
|
14645
14678
|
function hasInvalidEscape(template) {
|
|
14646
|
-
return template && !!(isNoSubstitutionTemplateLiteral(template) ? template
|
|
14679
|
+
return template && !!(isNoSubstitutionTemplateLiteral(template) ? containsInvalidEscapeFlag(template) : containsInvalidEscapeFlag(template.head) || some(template.templateSpans, (span) => containsInvalidEscapeFlag(span.literal)));
|
|
14647
14680
|
}
|
|
14648
14681
|
var doubleQuoteEscapedCharsRegExp = /[\\"\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
14649
14682
|
var singleQuoteEscapedCharsRegExp = /[\\'\u0000-\u001f\t\v\f\b\r\n\u2028\u2029\u0085]/g;
|
|
@@ -16044,13 +16077,11 @@ function setLocalizedDiagnosticMessages(messages) {
|
|
|
16044
16077
|
function getLocaleSpecificMessage(message) {
|
|
16045
16078
|
return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
|
|
16046
16079
|
}
|
|
16047
|
-
function createDetachedDiagnostic(fileName, start, length2, message, ...args) {
|
|
16048
|
-
|
|
16049
|
-
|
|
16050
|
-
|
|
16051
|
-
|
|
16052
|
-
length2
|
|
16053
|
-
);
|
|
16080
|
+
function createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args) {
|
|
16081
|
+
if (start + length2 > sourceText.length) {
|
|
16082
|
+
length2 = sourceText.length - start;
|
|
16083
|
+
}
|
|
16084
|
+
assertDiagnosticLocation(sourceText, start, length2);
|
|
16054
16085
|
let text = getLocaleSpecificMessage(message);
|
|
16055
16086
|
if (some(args)) {
|
|
16056
16087
|
text = formatStringFromArgs(text, args);
|
|
@@ -16106,7 +16137,7 @@ function attachFileToDiagnostics(diagnostics, file) {
|
|
|
16106
16137
|
return diagnosticsWithLocation;
|
|
16107
16138
|
}
|
|
16108
16139
|
function createFileDiagnostic(file, start, length2, message, ...args) {
|
|
16109
|
-
assertDiagnosticLocation(file, start, length2);
|
|
16140
|
+
assertDiagnosticLocation(file.text, start, length2);
|
|
16110
16141
|
let text = getLocaleSpecificMessage(message);
|
|
16111
16142
|
if (some(args)) {
|
|
16112
16143
|
text = formatStringFromArgs(text, args);
|
|
@@ -26636,7 +26667,7 @@ var Parser;
|
|
|
26636
26667
|
}
|
|
26637
26668
|
return sourceFile;
|
|
26638
26669
|
function reportPragmaDiagnostic(pos, end, diagnostic) {
|
|
26639
|
-
parseDiagnostics.push(createDetachedDiagnostic(fileName, pos, end, diagnostic));
|
|
26670
|
+
parseDiagnostics.push(createDetachedDiagnostic(fileName, sourceText, pos, end, diagnostic));
|
|
26640
26671
|
}
|
|
26641
26672
|
}
|
|
26642
26673
|
let hasDeprecatedTag = false;
|
|
@@ -26876,7 +26907,7 @@ var Parser;
|
|
|
26876
26907
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
26877
26908
|
let result;
|
|
26878
26909
|
if (!lastError || start !== lastError.start) {
|
|
26879
|
-
result = createDetachedDiagnostic(fileName, start, length2, message, ...args);
|
|
26910
|
+
result = createDetachedDiagnostic(fileName, sourceText, start, length2, message, ...args);
|
|
26880
26911
|
parseDiagnostics.push(result);
|
|
26881
26912
|
}
|
|
26882
26913
|
parseErrorBeforeNextFinishedNode = true;
|
|
@@ -27104,7 +27135,7 @@ var Parser;
|
|
|
27104
27135
|
if (lastError) {
|
|
27105
27136
|
addRelatedInfo(
|
|
27106
27137
|
lastError,
|
|
27107
|
-
createDetachedDiagnostic(fileName, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind))
|
|
27138
|
+
createDetachedDiagnostic(fileName, sourceText, openPosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, tokenToString(openKind), tokenToString(closeKind))
|
|
27108
27139
|
);
|
|
27109
27140
|
}
|
|
27110
27141
|
}
|
|
@@ -28703,7 +28734,7 @@ var Parser;
|
|
|
28703
28734
|
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
28704
28735
|
addRelatedInfo(
|
|
28705
28736
|
lastError,
|
|
28706
|
-
createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
28737
|
+
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
28707
28738
|
);
|
|
28708
28739
|
}
|
|
28709
28740
|
}
|
|
@@ -31820,7 +31851,7 @@ var Parser;
|
|
|
31820
31851
|
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
31821
31852
|
addRelatedInfo(
|
|
31822
31853
|
lastError,
|
|
31823
|
-
createDetachedDiagnostic(fileName, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
31854
|
+
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
31824
31855
|
);
|
|
31825
31856
|
}
|
|
31826
31857
|
}
|
|
@@ -32799,7 +32830,7 @@ var Parser;
|
|
|
32799
32830
|
if (childTypeTag) {
|
|
32800
32831
|
const lastError = parseErrorAtCurrentToken(Diagnostics.A_JSDoc_typedef_comment_may_not_contain_multiple_type_tags);
|
|
32801
32832
|
if (lastError) {
|
|
32802
|
-
addRelatedInfo(lastError, createDetachedDiagnostic(fileName, 0, 0, Diagnostics.The_tag_was_first_specified_here));
|
|
32833
|
+
addRelatedInfo(lastError, createDetachedDiagnostic(fileName, sourceText, 0, 0, Diagnostics.The_tag_was_first_specified_here));
|
|
32803
32834
|
}
|
|
32804
32835
|
break;
|
|
32805
32836
|
} else {
|
|
@@ -37247,9 +37278,8 @@ function compilerOptionValueToString(value) {
|
|
|
37247
37278
|
function getKeyForCompilerOptions(options, affectingOptionDeclarations) {
|
|
37248
37279
|
return affectingOptionDeclarations.map((option) => compilerOptionValueToString(getCompilerOptionValue(options, option))).join("|") + `|${options.pathsBasePath}`;
|
|
37249
37280
|
}
|
|
37250
|
-
function createCacheWithRedirects(ownOptions) {
|
|
37281
|
+
function createCacheWithRedirects(ownOptions, optionsToRedirectsKey) {
|
|
37251
37282
|
const redirectsMap = /* @__PURE__ */ new Map();
|
|
37252
|
-
const optionsToRedirectsKey = /* @__PURE__ */ new Map();
|
|
37253
37283
|
const redirectsKeyToMap = /* @__PURE__ */ new Map();
|
|
37254
37284
|
let ownMap = /* @__PURE__ */ new Map();
|
|
37255
37285
|
if (ownOptions)
|
|
@@ -37359,8 +37389,8 @@ function getOrCreateCache(cacheWithRedirects, redirectedReference, key, create)
|
|
|
37359
37389
|
}
|
|
37360
37390
|
return result;
|
|
37361
37391
|
}
|
|
37362
|
-
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options) {
|
|
37363
|
-
const directoryToModuleNameMap = createCacheWithRedirects(options);
|
|
37392
|
+
function createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, options, optionsToRedirectsKey) {
|
|
37393
|
+
const directoryToModuleNameMap = createCacheWithRedirects(options, optionsToRedirectsKey);
|
|
37364
37394
|
return {
|
|
37365
37395
|
getFromDirectoryCache,
|
|
37366
37396
|
getOrCreateCacheForDirectory,
|
|
@@ -37436,8 +37466,8 @@ function getOriginalOrResolvedModuleFileName(result) {
|
|
|
37436
37466
|
function getOriginalOrResolvedTypeReferenceFileName(result) {
|
|
37437
37467
|
return result.resolvedTypeReferenceDirective && (result.resolvedTypeReferenceDirective.originalPath || result.resolvedTypeReferenceDirective.resolvedFileName);
|
|
37438
37468
|
}
|
|
37439
|
-
function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName) {
|
|
37440
|
-
const moduleNameToDirectoryMap = createCacheWithRedirects(options);
|
|
37469
|
+
function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFileName, options, getResolvedFileName, optionsToRedirectsKey) {
|
|
37470
|
+
const moduleNameToDirectoryMap = createCacheWithRedirects(options, optionsToRedirectsKey);
|
|
37441
37471
|
return {
|
|
37442
37472
|
getFromNonRelativeNameCache,
|
|
37443
37473
|
getOrCreateCacheForNonRelativeName,
|
|
@@ -37505,13 +37535,20 @@ function createNonRelativeNameResolutionCache(currentDirectory, getCanonicalFile
|
|
|
37505
37535
|
}
|
|
37506
37536
|
}
|
|
37507
37537
|
}
|
|
37508
|
-
function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName) {
|
|
37509
|
-
|
|
37538
|
+
function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, getResolvedFileName, optionsToRedirectsKey) {
|
|
37539
|
+
optionsToRedirectsKey ?? (optionsToRedirectsKey = /* @__PURE__ */ new Map());
|
|
37540
|
+
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(
|
|
37541
|
+
currentDirectory,
|
|
37542
|
+
getCanonicalFileName,
|
|
37543
|
+
options,
|
|
37544
|
+
optionsToRedirectsKey
|
|
37545
|
+
);
|
|
37510
37546
|
const nonRelativeNameResolutionCache = createNonRelativeNameResolutionCache(
|
|
37511
37547
|
currentDirectory,
|
|
37512
37548
|
getCanonicalFileName,
|
|
37513
37549
|
options,
|
|
37514
|
-
getResolvedFileName
|
|
37550
|
+
getResolvedFileName,
|
|
37551
|
+
optionsToRedirectsKey
|
|
37515
37552
|
);
|
|
37516
37553
|
packageJsonInfoCache ?? (packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName));
|
|
37517
37554
|
return {
|
|
@@ -37521,7 +37558,8 @@ function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonic
|
|
|
37521
37558
|
clear: clear2,
|
|
37522
37559
|
update,
|
|
37523
37560
|
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
|
37524
|
-
clearAllExceptPackageJsonInfoCache
|
|
37561
|
+
clearAllExceptPackageJsonInfoCache,
|
|
37562
|
+
optionsToRedirectsKey
|
|
37525
37563
|
};
|
|
37526
37564
|
function clear2() {
|
|
37527
37565
|
clearAllExceptPackageJsonInfoCache();
|
|
@@ -37536,24 +37574,26 @@ function createModuleOrTypeReferenceResolutionCache(currentDirectory, getCanonic
|
|
|
37536
37574
|
nonRelativeNameResolutionCache.update(options2);
|
|
37537
37575
|
}
|
|
37538
37576
|
}
|
|
37539
|
-
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
|
|
37577
|
+
function createModuleResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) {
|
|
37540
37578
|
const result = createModuleOrTypeReferenceResolutionCache(
|
|
37541
37579
|
currentDirectory,
|
|
37542
37580
|
getCanonicalFileName,
|
|
37543
37581
|
options,
|
|
37544
37582
|
packageJsonInfoCache,
|
|
37545
|
-
getOriginalOrResolvedModuleFileName
|
|
37583
|
+
getOriginalOrResolvedModuleFileName,
|
|
37584
|
+
optionsToRedirectsKey
|
|
37546
37585
|
);
|
|
37547
37586
|
result.getOrCreateCacheForModuleName = (nonRelativeName, mode, redirectedReference) => result.getOrCreateCacheForNonRelativeName(nonRelativeName, mode, redirectedReference);
|
|
37548
37587
|
return result;
|
|
37549
37588
|
}
|
|
37550
|
-
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache) {
|
|
37589
|
+
function createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, options, packageJsonInfoCache, optionsToRedirectsKey) {
|
|
37551
37590
|
return createModuleOrTypeReferenceResolutionCache(
|
|
37552
37591
|
currentDirectory,
|
|
37553
37592
|
getCanonicalFileName,
|
|
37554
37593
|
options,
|
|
37555
37594
|
packageJsonInfoCache,
|
|
37556
|
-
getOriginalOrResolvedTypeReferenceFileName
|
|
37595
|
+
getOriginalOrResolvedTypeReferenceFileName,
|
|
37596
|
+
optionsToRedirectsKey
|
|
37557
37597
|
);
|
|
37558
37598
|
}
|
|
37559
37599
|
function getOptionsForLibraryResolution(options) {
|
|
@@ -49151,7 +49191,14 @@ function createTypeChecker(host) {
|
|
|
49151
49191
|
}
|
|
49152
49192
|
function isStringNamed(d) {
|
|
49153
49193
|
const name = getNameOfDeclaration(d);
|
|
49154
|
-
|
|
49194
|
+
if (!name) {
|
|
49195
|
+
return false;
|
|
49196
|
+
}
|
|
49197
|
+
if (isComputedPropertyName(name)) {
|
|
49198
|
+
const type = checkExpression(name.expression);
|
|
49199
|
+
return !!(type.flags & 402653316 /* StringLike */);
|
|
49200
|
+
}
|
|
49201
|
+
return isStringLiteral(name);
|
|
49155
49202
|
}
|
|
49156
49203
|
function isSingleQuotedStringNamed(d) {
|
|
49157
49204
|
const name = getNameOfDeclaration(d);
|
|
@@ -52283,7 +52330,7 @@ function createTypeChecker(host) {
|
|
|
52283
52330
|
return checkFlags & 2 /* SyntheticProperty */ ? checkFlags & 65536 /* DeferredType */ ? getWriteTypeOfSymbolWithDeferredType(symbol) || getTypeOfSymbolWithDeferredType(symbol) : (
|
|
52284
52331
|
// NOTE: cast to TransientSymbol should be safe because only TransientSymbols can have CheckFlags.SyntheticProperty
|
|
52285
52332
|
symbol.links.writeType || symbol.links.type
|
|
52286
|
-
) : getTypeOfSymbol(symbol);
|
|
52333
|
+
) : removeMissingType(getTypeOfSymbol(symbol), !!(symbol.flags & 16777216 /* Optional */));
|
|
52287
52334
|
}
|
|
52288
52335
|
if (symbol.flags & 98304 /* Accessor */) {
|
|
52289
52336
|
return checkFlags & 1 /* Instantiated */ ? getWriteTypeOfInstantiatedSymbol(symbol) : getWriteTypeOfAccessors(symbol);
|
|
@@ -63494,7 +63541,6 @@ function createTypeChecker(host) {
|
|
|
63494
63541
|
let bivariant = false;
|
|
63495
63542
|
let propagationType;
|
|
63496
63543
|
let inferencePriority = 2048 /* MaxValue */;
|
|
63497
|
-
let allowComplexConstraintInference = true;
|
|
63498
63544
|
let visited;
|
|
63499
63545
|
let sourceStack;
|
|
63500
63546
|
let targetStack;
|
|
@@ -63649,8 +63695,7 @@ function createTypeChecker(host) {
|
|
|
63649
63695
|
source = getReducedType(source);
|
|
63650
63696
|
if (!(priority & 512 /* NoConstraints */ && source.flags & (2097152 /* Intersection */ | 465829888 /* Instantiable */))) {
|
|
63651
63697
|
const apparentSource = getApparentType(source);
|
|
63652
|
-
if (apparentSource !== source &&
|
|
63653
|
-
allowComplexConstraintInference = false;
|
|
63698
|
+
if (apparentSource !== source && !(apparentSource.flags & (524288 /* Object */ | 2097152 /* Intersection */))) {
|
|
63654
63699
|
return inferFromTypes(apparentSource, target);
|
|
63655
63700
|
}
|
|
63656
63701
|
source = apparentSource;
|
|
@@ -65294,10 +65339,11 @@ function createTypeChecker(host) {
|
|
|
65294
65339
|
const assignedType = getWidenedLiteralType(getInitialOrAssignedType(flow));
|
|
65295
65340
|
return isTypeAssignableTo(assignedType, declaredType) ? assignedType : anyArrayType;
|
|
65296
65341
|
}
|
|
65297
|
-
|
|
65298
|
-
|
|
65342
|
+
const t = isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(declaredType) : declaredType;
|
|
65343
|
+
if (t.flags & 1048576 /* Union */) {
|
|
65344
|
+
return getAssignmentReducedType(t, getInitialOrAssignedType(flow));
|
|
65299
65345
|
}
|
|
65300
|
-
return
|
|
65346
|
+
return t;
|
|
65301
65347
|
}
|
|
65302
65348
|
if (containsMatchingReference(reference, node)) {
|
|
65303
65349
|
if (!isReachableFlowNode(flow)) {
|
|
@@ -66160,7 +66206,15 @@ function createTypeChecker(host) {
|
|
|
66160
66206
|
location = location.parent;
|
|
66161
66207
|
}
|
|
66162
66208
|
if (isExpressionNode(location) && (!isAssignmentTarget(location) || isWriteAccess(location))) {
|
|
66163
|
-
const type = removeOptionalTypeMarker(
|
|
66209
|
+
const type = removeOptionalTypeMarker(
|
|
66210
|
+
isWriteAccess(location) && location.kind === 211 /* PropertyAccessExpression */ ? checkPropertyAccessExpression(
|
|
66211
|
+
location,
|
|
66212
|
+
/*checkMode*/
|
|
66213
|
+
void 0,
|
|
66214
|
+
/*writeOnly*/
|
|
66215
|
+
true
|
|
66216
|
+
) : getTypeOfExpression(location)
|
|
66217
|
+
);
|
|
66164
66218
|
if (getExportSymbolOfValueSymbolIfExported(getNodeLinks(location).resolvedSymbol) === symbol) {
|
|
66165
66219
|
return type;
|
|
66166
66220
|
}
|
|
@@ -66421,7 +66475,7 @@ function createTypeChecker(host) {
|
|
|
66421
66475
|
const isAlias = localOrExportSymbol.flags & 2097152 /* Alias */;
|
|
66422
66476
|
if (localOrExportSymbol.flags & 3 /* Variable */) {
|
|
66423
66477
|
if (assignmentKind === 1 /* Definite */) {
|
|
66424
|
-
return type;
|
|
66478
|
+
return isInCompoundLikeAssignment(node) ? getBaseTypeOfLiteralType(type) : type;
|
|
66425
66479
|
}
|
|
66426
66480
|
} else if (isAlias) {
|
|
66427
66481
|
declaration = getDeclarationOfAliasSymbol(symbol);
|
|
@@ -67516,8 +67570,19 @@ function createTypeChecker(host) {
|
|
|
67516
67570
|
contextualType,
|
|
67517
67571
|
concatenate(
|
|
67518
67572
|
map(
|
|
67519
|
-
filter(node.properties, (p) =>
|
|
67520
|
-
|
|
67573
|
+
filter(node.properties, (p) => {
|
|
67574
|
+
if (!p.symbol) {
|
|
67575
|
+
return false;
|
|
67576
|
+
}
|
|
67577
|
+
if (p.kind === 303 /* PropertyAssignment */) {
|
|
67578
|
+
return isPossiblyDiscriminantValue(p.initializer) && isDiscriminantProperty(contextualType, p.symbol.escapedName);
|
|
67579
|
+
}
|
|
67580
|
+
if (p.kind === 304 /* ShorthandPropertyAssignment */) {
|
|
67581
|
+
return isDiscriminantProperty(contextualType, p.symbol.escapedName);
|
|
67582
|
+
}
|
|
67583
|
+
return false;
|
|
67584
|
+
}),
|
|
67585
|
+
(prop) => [() => getContextFreeTypeOfExpression(prop.kind === 303 /* PropertyAssignment */ ? prop.initializer : prop.name), prop.symbol.escapedName]
|
|
67521
67586
|
),
|
|
67522
67587
|
map(
|
|
67523
67588
|
filter(getPropertiesOfType(contextualType), (s) => {
|
|
@@ -115523,7 +115588,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115523
115588
|
getCanonicalFileName,
|
|
115524
115589
|
/*options*/
|
|
115525
115590
|
void 0,
|
|
115526
|
-
moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache()
|
|
115591
|
+
moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(),
|
|
115592
|
+
moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey
|
|
115527
115593
|
);
|
|
115528
115594
|
actualResolveTypeReferenceDirectiveNamesWorker = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
115529
115595
|
typeDirectiveNames,
|
|
@@ -120538,7 +120604,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120538
120604
|
getCurrentDirectory(),
|
|
120539
120605
|
resolutionHost.getCanonicalFileName,
|
|
120540
120606
|
resolutionHost.getCompilationSettings(),
|
|
120541
|
-
moduleResolutionCache.getPackageJsonInfoCache()
|
|
120607
|
+
moduleResolutionCache.getPackageJsonInfoCache(),
|
|
120608
|
+
moduleResolutionCache.optionsToRedirectsKey
|
|
120542
120609
|
);
|
|
120543
120610
|
const resolvedLibraries = /* @__PURE__ */ new Map();
|
|
120544
120611
|
const libraryResolutionCache = createModuleResolutionCache(
|
|
@@ -122842,7 +122909,8 @@ function createSolutionBuilderState(watch, hostOrHostWithWatch, rootNames, optio
|
|
|
122842
122909
|
compilerHost.getCanonicalFileName,
|
|
122843
122910
|
/*options*/
|
|
122844
122911
|
void 0,
|
|
122845
|
-
moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache()
|
|
122912
|
+
moduleResolutionCache == null ? void 0 : moduleResolutionCache.getPackageJsonInfoCache(),
|
|
122913
|
+
moduleResolutionCache == null ? void 0 : moduleResolutionCache.optionsToRedirectsKey
|
|
122846
122914
|
);
|
|
122847
122915
|
compilerHost.resolveTypeReferenceDirectiveReferences = (typeDirectiveNames, containingFile, redirectedReference, options2, containingSourceFile) => loadWithModeAwareCache(
|
|
122848
122916
|
typeDirectiveNames,
|