@typescript-deploys/pr-build 5.5.0-pr-58528-2 → 5.5.0-pr-58495-31
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 +185 -24
- package/lib/typescript.js +186 -24
- 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.5";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20240515`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -13651,7 +13651,8 @@ function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
|
|
|
13651
13651
|
}
|
|
13652
13652
|
function getJSDocCommentRanges(node, text) {
|
|
13653
13653
|
const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 260 /* VariableDeclaration */ || node.kind === 281 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
|
|
13654
|
-
return filter(commentRanges, (comment) =>
|
|
13654
|
+
return filter(commentRanges, (comment) => comment.end <= node.end && // Due to parse errors sometime empty parameter may get comments assigned to it that end up not in parameter range
|
|
13655
|
+
text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */);
|
|
13655
13656
|
}
|
|
13656
13657
|
var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
|
|
13657
13658
|
var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
|
|
@@ -49019,7 +49020,7 @@ function createTypeChecker(host) {
|
|
|
49019
49020
|
return { accessibility: 0 /* Accessible */ };
|
|
49020
49021
|
}
|
|
49021
49022
|
return symbol && hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) || {
|
|
49022
|
-
accessibility:
|
|
49023
|
+
accessibility: 3 /* NotResolved */,
|
|
49023
49024
|
errorSymbolName: getTextOfNode(firstIdentifier),
|
|
49024
49025
|
errorNode: firstIdentifier
|
|
49025
49026
|
};
|
|
@@ -49157,6 +49158,7 @@ function createTypeChecker(host) {
|
|
|
49157
49158
|
if (!nodeIsSynthesized(range) && !(range.flags & 16 /* Synthesized */) && (!context.enclosingFile || context.enclosingFile !== getSourceFileOfNode(range))) {
|
|
49158
49159
|
range = factory.cloneNode(range);
|
|
49159
49160
|
}
|
|
49161
|
+
if (range === location) return range;
|
|
49160
49162
|
if (!location) {
|
|
49161
49163
|
return range;
|
|
49162
49164
|
}
|
|
@@ -51293,6 +51295,57 @@ function createTypeChecker(host) {
|
|
|
51293
51295
|
return updated;
|
|
51294
51296
|
}
|
|
51295
51297
|
}
|
|
51298
|
+
function serializeTypeName(context, node, isTypeOf, typeArguments) {
|
|
51299
|
+
const meaning = isTypeOf ? 111551 /* Value */ : 788968 /* Type */;
|
|
51300
|
+
const symbol = resolveEntityName(
|
|
51301
|
+
node,
|
|
51302
|
+
meaning,
|
|
51303
|
+
/*ignoreErrors*/
|
|
51304
|
+
true
|
|
51305
|
+
);
|
|
51306
|
+
if (!symbol) return void 0;
|
|
51307
|
+
const resolvedSymbol = symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol;
|
|
51308
|
+
if (isSymbolAccessible(
|
|
51309
|
+
symbol,
|
|
51310
|
+
context.enclosingDeclaration,
|
|
51311
|
+
meaning,
|
|
51312
|
+
/*shouldComputeAliasesToMakeVisible*/
|
|
51313
|
+
false
|
|
51314
|
+
).accessibility !== 0 /* Accessible */) return void 0;
|
|
51315
|
+
return symbolToTypeNode(resolvedSymbol, context, meaning, typeArguments);
|
|
51316
|
+
}
|
|
51317
|
+
function canReuseTypeNode(context, existing) {
|
|
51318
|
+
if (isInJSFile(existing)) {
|
|
51319
|
+
if (isLiteralImportTypeNode(existing)) {
|
|
51320
|
+
void getTypeFromImportTypeNode(existing);
|
|
51321
|
+
const nodeSymbol = getNodeLinks(existing).resolvedSymbol;
|
|
51322
|
+
return !nodeSymbol || !// The import type resolved using jsdoc fallback logic
|
|
51323
|
+
(!existing.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
|
|
51324
|
+
!(length(existing.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))));
|
|
51325
|
+
}
|
|
51326
|
+
}
|
|
51327
|
+
if (isTypeReferenceNode(existing)) {
|
|
51328
|
+
if (isConstTypeReference(existing)) return false;
|
|
51329
|
+
const type = getTypeFromTypeReference(existing);
|
|
51330
|
+
const symbol = getNodeLinks(existing).resolvedSymbol;
|
|
51331
|
+
if (!symbol) return false;
|
|
51332
|
+
if (symbol.flags & 262144 /* TypeParameter */) {
|
|
51333
|
+
return true;
|
|
51334
|
+
}
|
|
51335
|
+
if (isInJSDoc(existing)) {
|
|
51336
|
+
return existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) && !getIntendedTypeFromJSDocTypeReference(existing) && symbol.flags & 788968 /* Type */;
|
|
51337
|
+
}
|
|
51338
|
+
}
|
|
51339
|
+
if (isTypeOperatorNode(existing) && existing.operator === 158 /* UniqueKeyword */ && existing.type.kind === 155 /* SymbolKeyword */) {
|
|
51340
|
+
const effectiveEnclosingContext = context.enclosingDeclaration && getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
51341
|
+
return !!findAncestor(existing, (n) => n === effectiveEnclosingContext);
|
|
51342
|
+
}
|
|
51343
|
+
return true;
|
|
51344
|
+
}
|
|
51345
|
+
function serializeExistingTypeNode(context, typeNode) {
|
|
51346
|
+
const type = getTypeFromTypeNode(typeNode);
|
|
51347
|
+
return typeToTypeNodeHelper(type, context);
|
|
51348
|
+
}
|
|
51296
51349
|
function tryReuseExistingTypeNodeHelper(context, existing) {
|
|
51297
51350
|
if (cancellationToken && cancellationToken.throwIfCancellationRequested) {
|
|
51298
51351
|
cancellationToken.throwIfCancellationRequested();
|
|
@@ -51302,6 +51355,7 @@ function createTypeChecker(host) {
|
|
|
51302
51355
|
if (hadError) {
|
|
51303
51356
|
return void 0;
|
|
51304
51357
|
}
|
|
51358
|
+
context.approximateLength += existing.end - existing.pos;
|
|
51305
51359
|
return transformed;
|
|
51306
51360
|
function visitExistingNodeTreeSymbols(node) {
|
|
51307
51361
|
const onExitNewScope = isNewScopeNode(node) ? onEnterNewScope(node) : void 0;
|
|
@@ -51401,20 +51455,38 @@ function createTypeChecker(host) {
|
|
|
51401
51455
|
);
|
|
51402
51456
|
}
|
|
51403
51457
|
}
|
|
51404
|
-
if (isTypeReferenceNode(node)
|
|
51405
|
-
node
|
|
51406
|
-
|
|
51407
|
-
|
|
51408
|
-
|
|
51409
|
-
|
|
51410
|
-
|
|
51458
|
+
if (isTypeReferenceNode(node)) {
|
|
51459
|
+
if (canReuseTypeNode(context, node)) {
|
|
51460
|
+
const { introducesError, node: newName } = trackExistingEntityName(node.typeName, context);
|
|
51461
|
+
const typeArguments = visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode);
|
|
51462
|
+
if (!introducesError) {
|
|
51463
|
+
const updated = factory.updateTypeReferenceNode(
|
|
51464
|
+
node,
|
|
51465
|
+
newName,
|
|
51466
|
+
typeArguments
|
|
51467
|
+
);
|
|
51468
|
+
return setTextRange2(context, updated, node);
|
|
51469
|
+
} else {
|
|
51470
|
+
const serializedName = serializeTypeName(
|
|
51471
|
+
context,
|
|
51472
|
+
node.typeName,
|
|
51473
|
+
/*isTypeOf*/
|
|
51474
|
+
false,
|
|
51475
|
+
typeArguments
|
|
51476
|
+
);
|
|
51477
|
+
if (serializedName) {
|
|
51478
|
+
return setTextRange2(context, serializedName, node.typeName);
|
|
51479
|
+
}
|
|
51480
|
+
}
|
|
51481
|
+
}
|
|
51482
|
+
return serializeExistingTypeNode(context, node);
|
|
51411
51483
|
}
|
|
51412
51484
|
if (isLiteralImportTypeNode(node)) {
|
|
51413
51485
|
const nodeSymbol = getNodeLinks(node).resolvedSymbol;
|
|
51414
51486
|
if (isInJSDoc(node) && nodeSymbol && // The import type resolved using jsdoc fallback logic
|
|
51415
51487
|
(!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
|
|
51416
51488
|
!(length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) {
|
|
51417
|
-
return
|
|
51489
|
+
return setTextRange2(context, typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
|
|
51418
51490
|
}
|
|
51419
51491
|
return factory.updateImportTypeNode(
|
|
51420
51492
|
node,
|
|
@@ -51446,13 +51518,48 @@ function createTypeChecker(host) {
|
|
|
51446
51518
|
}
|
|
51447
51519
|
return visited;
|
|
51448
51520
|
}
|
|
51449
|
-
if (
|
|
51450
|
-
|
|
51451
|
-
|
|
51521
|
+
if (isTypeQueryNode(node)) {
|
|
51522
|
+
const { introducesError, node: exprName } = trackExistingEntityName(node.exprName, context);
|
|
51523
|
+
if (introducesError) {
|
|
51524
|
+
const serializedName = serializeTypeName(
|
|
51525
|
+
context,
|
|
51526
|
+
node.exprName,
|
|
51527
|
+
/*isTypeOf*/
|
|
51528
|
+
true
|
|
51529
|
+
);
|
|
51530
|
+
if (serializedName) {
|
|
51531
|
+
return setTextRange2(context, serializedName, node.exprName);
|
|
51532
|
+
}
|
|
51533
|
+
return serializeExistingTypeNode(context, node);
|
|
51452
51534
|
}
|
|
51453
|
-
|
|
51535
|
+
return factory.updateTypeQueryNode(
|
|
51536
|
+
node,
|
|
51537
|
+
exprName,
|
|
51538
|
+
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode)
|
|
51539
|
+
);
|
|
51540
|
+
}
|
|
51541
|
+
if (isComputedPropertyName(node) && isEntityNameExpression(node.expression)) {
|
|
51542
|
+
const { node: result, introducesError } = trackExistingEntityName(node.expression, context);
|
|
51543
|
+
if (!introducesError) {
|
|
51544
|
+
return factory.updateComputedPropertyName(node, result);
|
|
51545
|
+
} else {
|
|
51546
|
+
const type = getWidenedType(getRegularTypeOfExpression(node.expression));
|
|
51547
|
+
const computedPropertyNameType = typeToTypeNodeHelper(type, context);
|
|
51548
|
+
Debug.assertNode(computedPropertyNameType, isLiteralTypeNode);
|
|
51549
|
+
const literal = computedPropertyNameType.literal;
|
|
51550
|
+
if (literal.kind === 11 /* StringLiteral */ && isIdentifierText(literal.text, getEmitScriptTarget(compilerOptions))) {
|
|
51551
|
+
return factory.createIdentifier(literal.text);
|
|
51552
|
+
}
|
|
51553
|
+
if (literal.kind === 9 /* NumericLiteral */ && !literal.text.startsWith("-")) {
|
|
51554
|
+
return literal;
|
|
51555
|
+
}
|
|
51556
|
+
return factory.updateComputedPropertyName(node, literal);
|
|
51557
|
+
}
|
|
51558
|
+
}
|
|
51559
|
+
if (isTypePredicateNode(node) && isIdentifier(node.parameterName)) {
|
|
51560
|
+
const { node: result, introducesError } = trackExistingEntityName(node.parameterName, context);
|
|
51454
51561
|
hadError = hadError || introducesError;
|
|
51455
|
-
return result;
|
|
51562
|
+
return factory.updateTypePredicateNode(node, node.assertsModifier, result, visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode));
|
|
51456
51563
|
}
|
|
51457
51564
|
if (isTupleTypeNode(node) || isTypeLiteralNode(node) || isMappedTypeNode(node)) {
|
|
51458
51565
|
const visited = visitEachChild(
|
|
@@ -51486,6 +51593,11 @@ function createTypeChecker(host) {
|
|
|
51486
51593
|
falseType2
|
|
51487
51594
|
);
|
|
51488
51595
|
}
|
|
51596
|
+
if (isTypeOperatorNode(node) && node.operator === 158 /* UniqueKeyword */ && node.type.kind === 155 /* SymbolKeyword */) {
|
|
51597
|
+
if (!canReuseTypeNode(context, node)) {
|
|
51598
|
+
return serializeExistingTypeNode(context, node);
|
|
51599
|
+
}
|
|
51600
|
+
}
|
|
51489
51601
|
return visitEachChild(
|
|
51490
51602
|
node,
|
|
51491
51603
|
visitExistingNodeTreeSymbols,
|
|
@@ -57272,10 +57384,14 @@ function createTypeChecker(host) {
|
|
|
57272
57384
|
}
|
|
57273
57385
|
if (type || jsdocPredicate) {
|
|
57274
57386
|
signature.resolvedTypePredicate = type && isTypePredicateNode(type) ? createTypePredicateFromTypePredicateNode(type, signature) : jsdocPredicate || noTypePredicate;
|
|
57275
|
-
} else if (signature.declaration && isFunctionLikeDeclaration(signature.declaration) && (!signature.resolvedReturnType || signature.resolvedReturnType.flags & 16 /* Boolean */) && getParameterCount(signature) > 0) {
|
|
57387
|
+
} else if (signature.declaration && isFunctionLikeDeclaration(signature.declaration) && (!signature.resolvedReturnType || signature.resolvedReturnType.flags & (16 /* Boolean */ | 49152 /* VoidLike */)) && getParameterCount(signature) > 0) {
|
|
57276
57388
|
const { declaration } = signature;
|
|
57277
57389
|
signature.resolvedTypePredicate = noTypePredicate;
|
|
57278
|
-
signature.
|
|
57390
|
+
if (!signature.resolvedReturnType || signature.resolvedReturnType.flags & 16 /* Boolean */) {
|
|
57391
|
+
signature.resolvedTypePredicate = getTypePredicateFromBody(declaration) || noTypePredicate;
|
|
57392
|
+
} else if (!signature.resolvedReturnType || signature.resolvedReturnType.flags & 49152 /* VoidLike */) {
|
|
57393
|
+
signature.resolvedTypePredicate = getTypeAssertionFromBody(declaration) || noTypePredicate;
|
|
57394
|
+
}
|
|
57279
57395
|
} else {
|
|
57280
57396
|
signature.resolvedTypePredicate = noTypePredicate;
|
|
57281
57397
|
}
|
|
@@ -76073,6 +76189,48 @@ function createTypeChecker(host) {
|
|
|
76073
76189
|
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
|
|
76074
76190
|
return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
|
|
76075
76191
|
}
|
|
76192
|
+
function getTypeAssertionFromBody(func) {
|
|
76193
|
+
switch (func.kind) {
|
|
76194
|
+
case 176 /* Constructor */:
|
|
76195
|
+
case 177 /* GetAccessor */:
|
|
76196
|
+
case 178 /* SetAccessor */:
|
|
76197
|
+
case 219 /* ArrowFunction */:
|
|
76198
|
+
case 218 /* FunctionExpression */:
|
|
76199
|
+
case 174 /* MethodDeclaration */:
|
|
76200
|
+
return void 0;
|
|
76201
|
+
}
|
|
76202
|
+
const functionFlags = getFunctionFlags(func);
|
|
76203
|
+
if (functionFlags !== 0 /* Normal */ || !func.body) return void 0;
|
|
76204
|
+
const returnFlowNodes = [];
|
|
76205
|
+
const bailedEarly = forEachReturnStatement(func.body, (returnStatement) => {
|
|
76206
|
+
if (!returnStatement.flowNode) {
|
|
76207
|
+
return true;
|
|
76208
|
+
}
|
|
76209
|
+
returnFlowNodes.push(returnStatement.flowNode);
|
|
76210
|
+
});
|
|
76211
|
+
if (bailedEarly) return void 0;
|
|
76212
|
+
if (functionHasImplicitReturn(func)) {
|
|
76213
|
+
returnFlowNodes.push(func.endFlowNode);
|
|
76214
|
+
}
|
|
76215
|
+
if (!returnFlowNodes.length) return void 0;
|
|
76216
|
+
return forEach(func.parameters, (param, i) => {
|
|
76217
|
+
const initType = getTypeOfSymbol(param.symbol);
|
|
76218
|
+
if (!initType || !isIdentifier(param.name) || isSymbolAssigned(param.symbol) || isRestParameter(param)) {
|
|
76219
|
+
return;
|
|
76220
|
+
}
|
|
76221
|
+
const typesAtReturn = [];
|
|
76222
|
+
const bailedEarly2 = forEach(returnFlowNodes, (flowNode) => {
|
|
76223
|
+
const type = getFlowTypeOfReference(param.name, initType, initType, func, flowNode);
|
|
76224
|
+
if (type === initType) return true;
|
|
76225
|
+
typesAtReturn.push(type);
|
|
76226
|
+
});
|
|
76227
|
+
if (bailedEarly2) return;
|
|
76228
|
+
const assertedType = getUnionType(typesAtReturn, 2 /* Subtype */);
|
|
76229
|
+
const patchedInitType = mapType(initType, (t) => t.flags & 16384 /* Void */ ? undefinedType : t.flags & 1 /* Any */ ? unknownType : t);
|
|
76230
|
+
if (isTypeAssignableTo(patchedInitType, assertedType)) return;
|
|
76231
|
+
return createTypePredicate(3 /* AssertsIdentifier */, unescapeLeadingUnderscores(param.name.escapedText), i, assertedType);
|
|
76232
|
+
});
|
|
76233
|
+
}
|
|
76076
76234
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
|
76077
76235
|
addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics);
|
|
76078
76236
|
return;
|
|
@@ -77451,6 +77609,10 @@ function createTypeChecker(host) {
|
|
|
77451
77609
|
texts.push(span.literal.text);
|
|
77452
77610
|
types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType);
|
|
77453
77611
|
}
|
|
77612
|
+
const evaluated = node.parent.kind !== 215 /* TaggedTemplateExpression */ && evaluate(node).value;
|
|
77613
|
+
if (evaluated) {
|
|
77614
|
+
return getFreshTypeOfLiteralType(getStringLiteralType(evaluated));
|
|
77615
|
+
}
|
|
77454
77616
|
if (isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType(
|
|
77455
77617
|
node,
|
|
77456
77618
|
/*contextFlags*/
|
|
@@ -77458,8 +77620,7 @@ function createTypeChecker(host) {
|
|
|
77458
77620
|
) || unknownType, isTemplateLiteralContextualType)) {
|
|
77459
77621
|
return getTemplateLiteralType(texts, types);
|
|
77460
77622
|
}
|
|
77461
|
-
|
|
77462
|
-
return evaluated ? getFreshTypeOfLiteralType(getStringLiteralType(evaluated)) : stringType;
|
|
77623
|
+
return stringType;
|
|
77463
77624
|
}
|
|
77464
77625
|
function isTemplateLiteralContextualType(type) {
|
|
77465
77626
|
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
|
|
@@ -110149,7 +110310,7 @@ function transformDeclarations(context) {
|
|
|
110149
110310
|
}
|
|
110150
110311
|
}
|
|
110151
110312
|
}
|
|
110152
|
-
} else {
|
|
110313
|
+
} else if (symbolAccessibilityResult.accessibility !== 3 /* NotResolved */) {
|
|
110153
110314
|
const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult);
|
|
110154
110315
|
if (errorInfo) {
|
|
110155
110316
|
if (errorInfo.typeName) {
|
|
@@ -118040,7 +118201,7 @@ function createModuleResolutionLoader(containingFile, redirectedReference, optio
|
|
|
118040
118201
|
};
|
|
118041
118202
|
}
|
|
118042
118203
|
function getTypeReferenceResolutionName(entry) {
|
|
118043
|
-
return !isString(entry) ?
|
|
118204
|
+
return !isString(entry) ? entry.fileName : entry;
|
|
118044
118205
|
}
|
|
118045
118206
|
var typeReferenceResolutionNameAndModeGetter = {
|
|
118046
118207
|
getName: getTypeReferenceResolutionName,
|
|
@@ -118792,7 +118953,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118792
118953
|
return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
118793
118954
|
}
|
|
118794
118955
|
function getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(typeRef, sourceFile) {
|
|
118795
|
-
return getResolvedTypeReferenceDirective(sourceFile,
|
|
118956
|
+
return getResolvedTypeReferenceDirective(sourceFile, typeRef.fileName, typeRef.resolutionMode || sourceFile.impliedNodeFormat);
|
|
118796
118957
|
}
|
|
118797
118958
|
function forEachResolvedModule(callback, file) {
|
|
118798
118959
|
forEachResolution(resolvedModules, callback, file);
|
|
@@ -120334,7 +120495,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
120334
120495
|
for (let index = 0; index < typeDirectives.length; index++) {
|
|
120335
120496
|
const ref = file.typeReferenceDirectives[index];
|
|
120336
120497
|
const resolvedTypeReferenceDirective = resolutions[index];
|
|
120337
|
-
const fileName =
|
|
120498
|
+
const fileName = ref.fileName;
|
|
120338
120499
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
120339
120500
|
const mode = ref.resolutionMode || getDefaultResolutionModeForFile2(file);
|
|
120340
120501
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
package/lib/typescript.js
CHANGED
|
@@ -2368,7 +2368,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2368
2368
|
|
|
2369
2369
|
// src/compiler/corePublic.ts
|
|
2370
2370
|
var versionMajorMinor = "5.5";
|
|
2371
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2371
|
+
var version = `${versionMajorMinor}.0-insiders.20240515`;
|
|
2372
2372
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2373
2373
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2374
2374
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -6394,6 +6394,7 @@ var SymbolAccessibility = /* @__PURE__ */ ((SymbolAccessibility2) => {
|
|
|
6394
6394
|
SymbolAccessibility2[SymbolAccessibility2["Accessible"] = 0] = "Accessible";
|
|
6395
6395
|
SymbolAccessibility2[SymbolAccessibility2["NotAccessible"] = 1] = "NotAccessible";
|
|
6396
6396
|
SymbolAccessibility2[SymbolAccessibility2["CannotBeNamed"] = 2] = "CannotBeNamed";
|
|
6397
|
+
SymbolAccessibility2[SymbolAccessibility2["NotResolved"] = 3] = "NotResolved";
|
|
6397
6398
|
return SymbolAccessibility2;
|
|
6398
6399
|
})(SymbolAccessibility || {});
|
|
6399
6400
|
var SyntheticSymbolKind = /* @__PURE__ */ ((SyntheticSymbolKind2) => {
|
|
@@ -17550,7 +17551,8 @@ function getLeadingCommentRangesOfNode(node, sourceFileOfNode) {
|
|
|
17550
17551
|
}
|
|
17551
17552
|
function getJSDocCommentRanges(node, text) {
|
|
17552
17553
|
const commentRanges = node.kind === 169 /* Parameter */ || node.kind === 168 /* TypeParameter */ || node.kind === 218 /* FunctionExpression */ || node.kind === 219 /* ArrowFunction */ || node.kind === 217 /* ParenthesizedExpression */ || node.kind === 260 /* VariableDeclaration */ || node.kind === 281 /* ExportSpecifier */ ? concatenate(getTrailingCommentRanges(text, node.pos), getLeadingCommentRanges(text, node.pos)) : getLeadingCommentRanges(text, node.pos);
|
|
17553
|
-
return filter(commentRanges, (comment) =>
|
|
17554
|
+
return filter(commentRanges, (comment) => comment.end <= node.end && // Due to parse errors sometime empty parameter may get comments assigned to it that end up not in parameter range
|
|
17555
|
+
text.charCodeAt(comment.pos + 1) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 2) === 42 /* asterisk */ && text.charCodeAt(comment.pos + 3) !== 47 /* slash */);
|
|
17554
17556
|
}
|
|
17555
17557
|
var fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*<reference\s+path\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
|
|
17556
17558
|
var fullTripleSlashReferenceTypeReferenceDirectiveRegEx = /^(\/\/\/\s*<reference\s+types\s*=\s*)(('[^']*')|("[^"]*")).*?\/>/;
|
|
@@ -53813,7 +53815,7 @@ function createTypeChecker(host) {
|
|
|
53813
53815
|
return { accessibility: 0 /* Accessible */ };
|
|
53814
53816
|
}
|
|
53815
53817
|
return symbol && hasVisibleDeclarations(symbol, shouldComputeAliasToMakeVisible) || {
|
|
53816
|
-
accessibility:
|
|
53818
|
+
accessibility: 3 /* NotResolved */,
|
|
53817
53819
|
errorSymbolName: getTextOfNode(firstIdentifier),
|
|
53818
53820
|
errorNode: firstIdentifier
|
|
53819
53821
|
};
|
|
@@ -53951,6 +53953,7 @@ function createTypeChecker(host) {
|
|
|
53951
53953
|
if (!nodeIsSynthesized(range) && !(range.flags & 16 /* Synthesized */) && (!context.enclosingFile || context.enclosingFile !== getSourceFileOfNode(range))) {
|
|
53952
53954
|
range = factory.cloneNode(range);
|
|
53953
53955
|
}
|
|
53956
|
+
if (range === location) return range;
|
|
53954
53957
|
if (!location) {
|
|
53955
53958
|
return range;
|
|
53956
53959
|
}
|
|
@@ -56087,6 +56090,57 @@ function createTypeChecker(host) {
|
|
|
56087
56090
|
return updated;
|
|
56088
56091
|
}
|
|
56089
56092
|
}
|
|
56093
|
+
function serializeTypeName(context, node, isTypeOf, typeArguments) {
|
|
56094
|
+
const meaning = isTypeOf ? 111551 /* Value */ : 788968 /* Type */;
|
|
56095
|
+
const symbol = resolveEntityName(
|
|
56096
|
+
node,
|
|
56097
|
+
meaning,
|
|
56098
|
+
/*ignoreErrors*/
|
|
56099
|
+
true
|
|
56100
|
+
);
|
|
56101
|
+
if (!symbol) return void 0;
|
|
56102
|
+
const resolvedSymbol = symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol;
|
|
56103
|
+
if (isSymbolAccessible(
|
|
56104
|
+
symbol,
|
|
56105
|
+
context.enclosingDeclaration,
|
|
56106
|
+
meaning,
|
|
56107
|
+
/*shouldComputeAliasesToMakeVisible*/
|
|
56108
|
+
false
|
|
56109
|
+
).accessibility !== 0 /* Accessible */) return void 0;
|
|
56110
|
+
return symbolToTypeNode(resolvedSymbol, context, meaning, typeArguments);
|
|
56111
|
+
}
|
|
56112
|
+
function canReuseTypeNode(context, existing) {
|
|
56113
|
+
if (isInJSFile(existing)) {
|
|
56114
|
+
if (isLiteralImportTypeNode(existing)) {
|
|
56115
|
+
void getTypeFromImportTypeNode(existing);
|
|
56116
|
+
const nodeSymbol = getNodeLinks(existing).resolvedSymbol;
|
|
56117
|
+
return !nodeSymbol || !// The import type resolved using jsdoc fallback logic
|
|
56118
|
+
(!existing.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
|
|
56119
|
+
!(length(existing.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))));
|
|
56120
|
+
}
|
|
56121
|
+
}
|
|
56122
|
+
if (isTypeReferenceNode(existing)) {
|
|
56123
|
+
if (isConstTypeReference(existing)) return false;
|
|
56124
|
+
const type = getTypeFromTypeReference(existing);
|
|
56125
|
+
const symbol = getNodeLinks(existing).resolvedSymbol;
|
|
56126
|
+
if (!symbol) return false;
|
|
56127
|
+
if (symbol.flags & 262144 /* TypeParameter */) {
|
|
56128
|
+
return true;
|
|
56129
|
+
}
|
|
56130
|
+
if (isInJSDoc(existing)) {
|
|
56131
|
+
return existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(existing, type) && !getIntendedTypeFromJSDocTypeReference(existing) && symbol.flags & 788968 /* Type */;
|
|
56132
|
+
}
|
|
56133
|
+
}
|
|
56134
|
+
if (isTypeOperatorNode(existing) && existing.operator === 158 /* UniqueKeyword */ && existing.type.kind === 155 /* SymbolKeyword */) {
|
|
56135
|
+
const effectiveEnclosingContext = context.enclosingDeclaration && getEnclosingDeclarationIgnoringFakeScope(context.enclosingDeclaration);
|
|
56136
|
+
return !!findAncestor(existing, (n) => n === effectiveEnclosingContext);
|
|
56137
|
+
}
|
|
56138
|
+
return true;
|
|
56139
|
+
}
|
|
56140
|
+
function serializeExistingTypeNode(context, typeNode) {
|
|
56141
|
+
const type = getTypeFromTypeNode(typeNode);
|
|
56142
|
+
return typeToTypeNodeHelper(type, context);
|
|
56143
|
+
}
|
|
56090
56144
|
function tryReuseExistingTypeNodeHelper(context, existing) {
|
|
56091
56145
|
if (cancellationToken && cancellationToken.throwIfCancellationRequested) {
|
|
56092
56146
|
cancellationToken.throwIfCancellationRequested();
|
|
@@ -56096,6 +56150,7 @@ function createTypeChecker(host) {
|
|
|
56096
56150
|
if (hadError) {
|
|
56097
56151
|
return void 0;
|
|
56098
56152
|
}
|
|
56153
|
+
context.approximateLength += existing.end - existing.pos;
|
|
56099
56154
|
return transformed;
|
|
56100
56155
|
function visitExistingNodeTreeSymbols(node) {
|
|
56101
56156
|
const onExitNewScope = isNewScopeNode(node) ? onEnterNewScope(node) : void 0;
|
|
@@ -56195,20 +56250,38 @@ function createTypeChecker(host) {
|
|
|
56195
56250
|
);
|
|
56196
56251
|
}
|
|
56197
56252
|
}
|
|
56198
|
-
if (isTypeReferenceNode(node)
|
|
56199
|
-
node
|
|
56200
|
-
|
|
56201
|
-
|
|
56202
|
-
|
|
56203
|
-
|
|
56204
|
-
|
|
56253
|
+
if (isTypeReferenceNode(node)) {
|
|
56254
|
+
if (canReuseTypeNode(context, node)) {
|
|
56255
|
+
const { introducesError, node: newName } = trackExistingEntityName(node.typeName, context);
|
|
56256
|
+
const typeArguments = visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode);
|
|
56257
|
+
if (!introducesError) {
|
|
56258
|
+
const updated = factory.updateTypeReferenceNode(
|
|
56259
|
+
node,
|
|
56260
|
+
newName,
|
|
56261
|
+
typeArguments
|
|
56262
|
+
);
|
|
56263
|
+
return setTextRange2(context, updated, node);
|
|
56264
|
+
} else {
|
|
56265
|
+
const serializedName = serializeTypeName(
|
|
56266
|
+
context,
|
|
56267
|
+
node.typeName,
|
|
56268
|
+
/*isTypeOf*/
|
|
56269
|
+
false,
|
|
56270
|
+
typeArguments
|
|
56271
|
+
);
|
|
56272
|
+
if (serializedName) {
|
|
56273
|
+
return setTextRange2(context, serializedName, node.typeName);
|
|
56274
|
+
}
|
|
56275
|
+
}
|
|
56276
|
+
}
|
|
56277
|
+
return serializeExistingTypeNode(context, node);
|
|
56205
56278
|
}
|
|
56206
56279
|
if (isLiteralImportTypeNode(node)) {
|
|
56207
56280
|
const nodeSymbol = getNodeLinks(node).resolvedSymbol;
|
|
56208
56281
|
if (isInJSDoc(node) && nodeSymbol && // The import type resolved using jsdoc fallback logic
|
|
56209
56282
|
(!node.isTypeOf && !(nodeSymbol.flags & 788968 /* Type */) || // The import type had type arguments autofilled by js fallback logic
|
|
56210
56283
|
!(length(node.typeArguments) >= getMinTypeArgumentCount(getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(nodeSymbol))))) {
|
|
56211
|
-
return
|
|
56284
|
+
return setTextRange2(context, typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
|
|
56212
56285
|
}
|
|
56213
56286
|
return factory.updateImportTypeNode(
|
|
56214
56287
|
node,
|
|
@@ -56240,13 +56313,48 @@ function createTypeChecker(host) {
|
|
|
56240
56313
|
}
|
|
56241
56314
|
return visited;
|
|
56242
56315
|
}
|
|
56243
|
-
if (
|
|
56244
|
-
|
|
56245
|
-
|
|
56316
|
+
if (isTypeQueryNode(node)) {
|
|
56317
|
+
const { introducesError, node: exprName } = trackExistingEntityName(node.exprName, context);
|
|
56318
|
+
if (introducesError) {
|
|
56319
|
+
const serializedName = serializeTypeName(
|
|
56320
|
+
context,
|
|
56321
|
+
node.exprName,
|
|
56322
|
+
/*isTypeOf*/
|
|
56323
|
+
true
|
|
56324
|
+
);
|
|
56325
|
+
if (serializedName) {
|
|
56326
|
+
return setTextRange2(context, serializedName, node.exprName);
|
|
56327
|
+
}
|
|
56328
|
+
return serializeExistingTypeNode(context, node);
|
|
56246
56329
|
}
|
|
56247
|
-
|
|
56330
|
+
return factory.updateTypeQueryNode(
|
|
56331
|
+
node,
|
|
56332
|
+
exprName,
|
|
56333
|
+
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode)
|
|
56334
|
+
);
|
|
56335
|
+
}
|
|
56336
|
+
if (isComputedPropertyName(node) && isEntityNameExpression(node.expression)) {
|
|
56337
|
+
const { node: result, introducesError } = trackExistingEntityName(node.expression, context);
|
|
56338
|
+
if (!introducesError) {
|
|
56339
|
+
return factory.updateComputedPropertyName(node, result);
|
|
56340
|
+
} else {
|
|
56341
|
+
const type = getWidenedType(getRegularTypeOfExpression(node.expression));
|
|
56342
|
+
const computedPropertyNameType = typeToTypeNodeHelper(type, context);
|
|
56343
|
+
Debug.assertNode(computedPropertyNameType, isLiteralTypeNode);
|
|
56344
|
+
const literal = computedPropertyNameType.literal;
|
|
56345
|
+
if (literal.kind === 11 /* StringLiteral */ && isIdentifierText(literal.text, getEmitScriptTarget(compilerOptions))) {
|
|
56346
|
+
return factory.createIdentifier(literal.text);
|
|
56347
|
+
}
|
|
56348
|
+
if (literal.kind === 9 /* NumericLiteral */ && !literal.text.startsWith("-")) {
|
|
56349
|
+
return literal;
|
|
56350
|
+
}
|
|
56351
|
+
return factory.updateComputedPropertyName(node, literal);
|
|
56352
|
+
}
|
|
56353
|
+
}
|
|
56354
|
+
if (isTypePredicateNode(node) && isIdentifier(node.parameterName)) {
|
|
56355
|
+
const { node: result, introducesError } = trackExistingEntityName(node.parameterName, context);
|
|
56248
56356
|
hadError = hadError || introducesError;
|
|
56249
|
-
return result;
|
|
56357
|
+
return factory.updateTypePredicateNode(node, node.assertsModifier, result, visitNode(node.type, visitExistingNodeTreeSymbols, isTypeNode));
|
|
56250
56358
|
}
|
|
56251
56359
|
if (isTupleTypeNode(node) || isTypeLiteralNode(node) || isMappedTypeNode(node)) {
|
|
56252
56360
|
const visited = visitEachChild(
|
|
@@ -56280,6 +56388,11 @@ function createTypeChecker(host) {
|
|
|
56280
56388
|
falseType2
|
|
56281
56389
|
);
|
|
56282
56390
|
}
|
|
56391
|
+
if (isTypeOperatorNode(node) && node.operator === 158 /* UniqueKeyword */ && node.type.kind === 155 /* SymbolKeyword */) {
|
|
56392
|
+
if (!canReuseTypeNode(context, node)) {
|
|
56393
|
+
return serializeExistingTypeNode(context, node);
|
|
56394
|
+
}
|
|
56395
|
+
}
|
|
56283
56396
|
return visitEachChild(
|
|
56284
56397
|
node,
|
|
56285
56398
|
visitExistingNodeTreeSymbols,
|
|
@@ -62066,10 +62179,14 @@ function createTypeChecker(host) {
|
|
|
62066
62179
|
}
|
|
62067
62180
|
if (type || jsdocPredicate) {
|
|
62068
62181
|
signature.resolvedTypePredicate = type && isTypePredicateNode(type) ? createTypePredicateFromTypePredicateNode(type, signature) : jsdocPredicate || noTypePredicate;
|
|
62069
|
-
} else if (signature.declaration && isFunctionLikeDeclaration(signature.declaration) && (!signature.resolvedReturnType || signature.resolvedReturnType.flags & 16 /* Boolean */) && getParameterCount(signature) > 0) {
|
|
62182
|
+
} else if (signature.declaration && isFunctionLikeDeclaration(signature.declaration) && (!signature.resolvedReturnType || signature.resolvedReturnType.flags & (16 /* Boolean */ | 49152 /* VoidLike */)) && getParameterCount(signature) > 0) {
|
|
62070
62183
|
const { declaration } = signature;
|
|
62071
62184
|
signature.resolvedTypePredicate = noTypePredicate;
|
|
62072
|
-
signature.
|
|
62185
|
+
if (!signature.resolvedReturnType || signature.resolvedReturnType.flags & 16 /* Boolean */) {
|
|
62186
|
+
signature.resolvedTypePredicate = getTypePredicateFromBody(declaration) || noTypePredicate;
|
|
62187
|
+
} else if (!signature.resolvedReturnType || signature.resolvedReturnType.flags & 49152 /* VoidLike */) {
|
|
62188
|
+
signature.resolvedTypePredicate = getTypeAssertionFromBody(declaration) || noTypePredicate;
|
|
62189
|
+
}
|
|
62073
62190
|
} else {
|
|
62074
62191
|
signature.resolvedTypePredicate = noTypePredicate;
|
|
62075
62192
|
}
|
|
@@ -80867,6 +80984,48 @@ function createTypeChecker(host) {
|
|
|
80867
80984
|
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType2, func, falseCondition);
|
|
80868
80985
|
return falseSubtype.flags & 131072 /* Never */ ? trueType2 : void 0;
|
|
80869
80986
|
}
|
|
80987
|
+
function getTypeAssertionFromBody(func) {
|
|
80988
|
+
switch (func.kind) {
|
|
80989
|
+
case 176 /* Constructor */:
|
|
80990
|
+
case 177 /* GetAccessor */:
|
|
80991
|
+
case 178 /* SetAccessor */:
|
|
80992
|
+
case 219 /* ArrowFunction */:
|
|
80993
|
+
case 218 /* FunctionExpression */:
|
|
80994
|
+
case 174 /* MethodDeclaration */:
|
|
80995
|
+
return void 0;
|
|
80996
|
+
}
|
|
80997
|
+
const functionFlags = getFunctionFlags(func);
|
|
80998
|
+
if (functionFlags !== 0 /* Normal */ || !func.body) return void 0;
|
|
80999
|
+
const returnFlowNodes = [];
|
|
81000
|
+
const bailedEarly = forEachReturnStatement(func.body, (returnStatement) => {
|
|
81001
|
+
if (!returnStatement.flowNode) {
|
|
81002
|
+
return true;
|
|
81003
|
+
}
|
|
81004
|
+
returnFlowNodes.push(returnStatement.flowNode);
|
|
81005
|
+
});
|
|
81006
|
+
if (bailedEarly) return void 0;
|
|
81007
|
+
if (functionHasImplicitReturn(func)) {
|
|
81008
|
+
returnFlowNodes.push(func.endFlowNode);
|
|
81009
|
+
}
|
|
81010
|
+
if (!returnFlowNodes.length) return void 0;
|
|
81011
|
+
return forEach(func.parameters, (param, i) => {
|
|
81012
|
+
const initType = getTypeOfSymbol(param.symbol);
|
|
81013
|
+
if (!initType || !isIdentifier(param.name) || isSymbolAssigned(param.symbol) || isRestParameter(param)) {
|
|
81014
|
+
return;
|
|
81015
|
+
}
|
|
81016
|
+
const typesAtReturn = [];
|
|
81017
|
+
const bailedEarly2 = forEach(returnFlowNodes, (flowNode) => {
|
|
81018
|
+
const type = getFlowTypeOfReference(param.name, initType, initType, func, flowNode);
|
|
81019
|
+
if (type === initType) return true;
|
|
81020
|
+
typesAtReturn.push(type);
|
|
81021
|
+
});
|
|
81022
|
+
if (bailedEarly2) return;
|
|
81023
|
+
const assertedType = getUnionType(typesAtReturn, 2 /* Subtype */);
|
|
81024
|
+
const patchedInitType = mapType(initType, (t) => t.flags & 16384 /* Void */ ? undefinedType : t.flags & 1 /* Any */ ? unknownType : t);
|
|
81025
|
+
if (isTypeAssignableTo(patchedInitType, assertedType)) return;
|
|
81026
|
+
return createTypePredicate(3 /* AssertsIdentifier */, unescapeLeadingUnderscores(param.name.escapedText), i, assertedType);
|
|
81027
|
+
});
|
|
81028
|
+
}
|
|
80870
81029
|
function checkAllCodePathsInNonVoidFunctionReturnOrThrow(func, returnType) {
|
|
80871
81030
|
addLazyDiagnostic(checkAllCodePathsInNonVoidFunctionReturnOrThrowDiagnostics);
|
|
80872
81031
|
return;
|
|
@@ -82245,6 +82404,10 @@ function createTypeChecker(host) {
|
|
|
82245
82404
|
texts.push(span.literal.text);
|
|
82246
82405
|
types.push(isTypeAssignableTo(type, templateConstraintType) ? type : stringType);
|
|
82247
82406
|
}
|
|
82407
|
+
const evaluated = node.parent.kind !== 215 /* TaggedTemplateExpression */ && evaluate(node).value;
|
|
82408
|
+
if (evaluated) {
|
|
82409
|
+
return getFreshTypeOfLiteralType(getStringLiteralType(evaluated));
|
|
82410
|
+
}
|
|
82248
82411
|
if (isConstContext(node) || isTemplateLiteralContext(node) || someType(getContextualType2(
|
|
82249
82412
|
node,
|
|
82250
82413
|
/*contextFlags*/
|
|
@@ -82252,8 +82415,7 @@ function createTypeChecker(host) {
|
|
|
82252
82415
|
) || unknownType, isTemplateLiteralContextualType)) {
|
|
82253
82416
|
return getTemplateLiteralType(texts, types);
|
|
82254
82417
|
}
|
|
82255
|
-
|
|
82256
|
-
return evaluated ? getFreshTypeOfLiteralType(getStringLiteralType(evaluated)) : stringType;
|
|
82418
|
+
return stringType;
|
|
82257
82419
|
}
|
|
82258
82420
|
function isTemplateLiteralContextualType(type) {
|
|
82259
82421
|
return !!(type.flags & (128 /* StringLiteral */ | 134217728 /* TemplateLiteral */) || type.flags & 58982400 /* InstantiableNonPrimitive */ && maybeTypeOfKind(getBaseConstraintOfType(type) || unknownType, 402653316 /* StringLike */));
|
|
@@ -115125,7 +115287,7 @@ function transformDeclarations(context) {
|
|
|
115125
115287
|
}
|
|
115126
115288
|
}
|
|
115127
115289
|
}
|
|
115128
|
-
} else {
|
|
115290
|
+
} else if (symbolAccessibilityResult.accessibility !== 3 /* NotResolved */) {
|
|
115129
115291
|
const errorInfo = getSymbolAccessibilityDiagnostic(symbolAccessibilityResult);
|
|
115130
115292
|
if (errorInfo) {
|
|
115131
115293
|
if (errorInfo.typeName) {
|
|
@@ -123069,7 +123231,7 @@ function createModuleResolutionLoader(containingFile, redirectedReference, optio
|
|
|
123069
123231
|
};
|
|
123070
123232
|
}
|
|
123071
123233
|
function getTypeReferenceResolutionName(entry) {
|
|
123072
|
-
return !isString(entry) ?
|
|
123234
|
+
return !isString(entry) ? entry.fileName : entry;
|
|
123073
123235
|
}
|
|
123074
123236
|
var typeReferenceResolutionNameAndModeGetter = {
|
|
123075
123237
|
getName: getTypeReferenceResolutionName,
|
|
@@ -123825,7 +123987,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
123825
123987
|
return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
123826
123988
|
}
|
|
123827
123989
|
function getResolvedTypeReferenceDirectiveFromTypeReferenceDirective(typeRef, sourceFile) {
|
|
123828
|
-
return getResolvedTypeReferenceDirective(sourceFile,
|
|
123990
|
+
return getResolvedTypeReferenceDirective(sourceFile, typeRef.fileName, typeRef.resolutionMode || sourceFile.impliedNodeFormat);
|
|
123829
123991
|
}
|
|
123830
123992
|
function forEachResolvedModule(callback, file) {
|
|
123831
123993
|
forEachResolution(resolvedModules, callback, file);
|
|
@@ -125367,7 +125529,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
125367
125529
|
for (let index = 0; index < typeDirectives.length; index++) {
|
|
125368
125530
|
const ref = file.typeReferenceDirectives[index];
|
|
125369
125531
|
const resolvedTypeReferenceDirective = resolutions[index];
|
|
125370
|
-
const fileName =
|
|
125532
|
+
const fileName = ref.fileName;
|
|
125371
125533
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
125372
125534
|
const mode = ref.resolutionMode || getDefaultResolutionModeForFile2(file);
|
|
125373
125535
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@typescript-deploys/pr-build",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "5.5.0-pr-
|
|
5
|
+
"version": "5.5.0-pr-58495-31",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|