@typescript-deploys/pr-build 5.8.0-pr-60052-36 → 5.8.0-pr-60384-4
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 +11 -118
- package/lib/typescript.d.ts +0 -4
- package/lib/typescript.js +31 -132
- package/package.json +1 -1
package/lib/_tsc.js
CHANGED
|
@@ -51214,7 +51214,7 @@ function createTypeChecker(host) {
|
|
|
51214
51214
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
51215
51215
|
var _a3;
|
|
51216
51216
|
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
|
|
51217
|
-
some(symbol.declarations, (declaration) => isStatic(declaration)
|
|
51217
|
+
some(symbol.declarations, (declaration) => isStatic(declaration));
|
|
51218
51218
|
const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
|
|
51219
51219
|
forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
|
|
51220
51220
|
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
|
|
@@ -51517,38 +51517,6 @@ function createTypeChecker(host) {
|
|
|
51517
51517
|
ids.unshift(state);
|
|
51518
51518
|
return ids;
|
|
51519
51519
|
}
|
|
51520
|
-
function indexInfoToObjectComputedNamesOrSignatureDeclaration(indexInfo, context2, typeNode) {
|
|
51521
|
-
if (indexInfo.components) {
|
|
51522
|
-
const allComponentComputedNamesSerializable = every(indexInfo.components, (e) => {
|
|
51523
|
-
var _a2;
|
|
51524
|
-
return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && context2.enclosingDeclaration && ((_a2 = isEntityNameVisible(
|
|
51525
|
-
e.name.expression,
|
|
51526
|
-
context2.enclosingDeclaration,
|
|
51527
|
-
/*shouldComputeAliasToMakeVisible*/
|
|
51528
|
-
false
|
|
51529
|
-
)) == null ? void 0 : _a2.accessibility) === 0 /* Accessible */);
|
|
51530
|
-
});
|
|
51531
|
-
if (allComponentComputedNamesSerializable) {
|
|
51532
|
-
const newComponents = filter(indexInfo.components, (e) => {
|
|
51533
|
-
return !hasLateBindableName(e);
|
|
51534
|
-
});
|
|
51535
|
-
return map(newComponents, (e) => {
|
|
51536
|
-
trackComputedName(e.name.expression, context2.enclosingDeclaration, context2);
|
|
51537
|
-
return setTextRange2(
|
|
51538
|
-
context2,
|
|
51539
|
-
factory.createPropertySignature(
|
|
51540
|
-
indexInfo.isReadonly ? [factory.createModifier(148 /* ReadonlyKeyword */)] : void 0,
|
|
51541
|
-
e.name,
|
|
51542
|
-
(isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
51543
|
-
typeNode || typeToTypeNodeHelper(getTypeOfSymbol(e.symbol), context2)
|
|
51544
|
-
),
|
|
51545
|
-
e
|
|
51546
|
-
);
|
|
51547
|
-
});
|
|
51548
|
-
}
|
|
51549
|
-
}
|
|
51550
|
-
return [indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode)];
|
|
51551
|
-
}
|
|
51552
51520
|
function createTypeNodesFromResolvedType(resolvedType) {
|
|
51553
51521
|
if (checkTruncationLength(context)) {
|
|
51554
51522
|
if (context.flags & 1 /* NoTruncation */) {
|
|
@@ -51573,7 +51541,7 @@ function createTypeChecker(host) {
|
|
|
51573
51541
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
51574
51542
|
}
|
|
51575
51543
|
for (const info of resolvedType.indexInfos) {
|
|
51576
|
-
typeElements.push(
|
|
51544
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
51577
51545
|
}
|
|
51578
51546
|
const properties = resolvedType.properties;
|
|
51579
51547
|
if (!properties) {
|
|
@@ -52262,7 +52230,7 @@ function createTypeChecker(host) {
|
|
|
52262
52230
|
if (!context.tracker.canTrackSymbol) return;
|
|
52263
52231
|
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
52264
52232
|
const name = resolveName(
|
|
52265
|
-
|
|
52233
|
+
firstIdentifier,
|
|
52266
52234
|
firstIdentifier.escapedText,
|
|
52267
52235
|
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
52268
52236
|
/*nameNotFoundMessage*/
|
|
@@ -52272,19 +52240,6 @@ function createTypeChecker(host) {
|
|
|
52272
52240
|
);
|
|
52273
52241
|
if (name) {
|
|
52274
52242
|
context.tracker.trackSymbol(name, enclosingDeclaration, 111551 /* Value */);
|
|
52275
|
-
} else {
|
|
52276
|
-
const fallback = resolveName(
|
|
52277
|
-
firstIdentifier,
|
|
52278
|
-
firstIdentifier.escapedText,
|
|
52279
|
-
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
52280
|
-
/*nameNotFoundMessage*/
|
|
52281
|
-
void 0,
|
|
52282
|
-
/*isUse*/
|
|
52283
|
-
true
|
|
52284
|
-
);
|
|
52285
|
-
if (fallback) {
|
|
52286
|
-
context.tracker.trackSymbol(fallback, enclosingDeclaration, 111551 /* Value */);
|
|
52287
|
-
}
|
|
52288
52243
|
}
|
|
52289
52244
|
}
|
|
52290
52245
|
function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
|
|
@@ -59099,8 +59054,8 @@ function createTypeChecker(host) {
|
|
|
59099
59054
|
function getIndexSymbolFromSymbolTable(symbolTable) {
|
|
59100
59055
|
return symbolTable.get("__index" /* Index */);
|
|
59101
59056
|
}
|
|
59102
|
-
function createIndexInfo(keyType, type, isReadonly, declaration
|
|
59103
|
-
return { keyType, type, isReadonly, declaration
|
|
59057
|
+
function createIndexInfo(keyType, type, isReadonly, declaration) {
|
|
59058
|
+
return { keyType, type, isReadonly, declaration };
|
|
59104
59059
|
}
|
|
59105
59060
|
function getIndexInfosOfSymbol(symbol) {
|
|
59106
59061
|
const indexSymbol = getIndexSymbol(symbol);
|
|
@@ -62173,7 +62128,7 @@ function createTypeChecker(host) {
|
|
|
62173
62128
|
return result;
|
|
62174
62129
|
}
|
|
62175
62130
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
62176
|
-
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration
|
|
62131
|
+
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
|
|
62177
62132
|
}
|
|
62178
62133
|
function createLiteralType(flags, value, symbol, regularType) {
|
|
62179
62134
|
const type = createTypeWithSymbol(flags, symbol);
|
|
@@ -62963,7 +62918,7 @@ function createTypeChecker(host) {
|
|
|
62963
62918
|
return type.restrictiveInstantiation;
|
|
62964
62919
|
}
|
|
62965
62920
|
function instantiateIndexInfo(info, mapper) {
|
|
62966
|
-
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration
|
|
62921
|
+
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
|
|
62967
62922
|
}
|
|
62968
62923
|
function isContextSensitive(node) {
|
|
62969
62924
|
Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
|
|
@@ -67096,7 +67051,7 @@ function createTypeChecker(host) {
|
|
|
67096
67051
|
}
|
|
67097
67052
|
}
|
|
67098
67053
|
}
|
|
67099
|
-
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly
|
|
67054
|
+
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
67100
67055
|
result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
|
|
67101
67056
|
return result;
|
|
67102
67057
|
}
|
|
@@ -73144,33 +73099,16 @@ function createTypeChecker(host) {
|
|
|
73144
73099
|
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
73145
73100
|
return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
|
|
73146
73101
|
}
|
|
73147
|
-
function isSymbolWithComputedName(symbol) {
|
|
73148
|
-
var _a;
|
|
73149
|
-
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
73150
|
-
return firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name);
|
|
73151
|
-
}
|
|
73152
73102
|
function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
|
|
73153
|
-
var _a;
|
|
73154
73103
|
const propTypes = [];
|
|
73155
|
-
let components;
|
|
73156
73104
|
for (let i = offset; i < properties.length; i++) {
|
|
73157
73105
|
const prop = properties[i];
|
|
73158
73106
|
if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
|
|
73159
73107
|
propTypes.push(getTypeOfSymbol(properties[i]));
|
|
73160
|
-
if (isSymbolWithComputedName(properties[i])) {
|
|
73161
|
-
components = append(components, (_a = properties[i].declarations) == null ? void 0 : _a[0]);
|
|
73162
|
-
}
|
|
73163
73108
|
}
|
|
73164
73109
|
}
|
|
73165
73110
|
const unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;
|
|
73166
|
-
return createIndexInfo(
|
|
73167
|
-
keyType,
|
|
73168
|
-
unionType,
|
|
73169
|
-
isReadonly,
|
|
73170
|
-
/*declaration*/
|
|
73171
|
-
void 0,
|
|
73172
|
-
components
|
|
73173
|
-
);
|
|
73111
|
+
return createIndexInfo(keyType, unionType, isReadonly);
|
|
73174
73112
|
}
|
|
73175
73113
|
function getImmediateAliasedSymbol(symbol) {
|
|
73176
73114
|
Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here.");
|
|
@@ -83870,7 +83808,7 @@ function createTypeChecker(host) {
|
|
|
83870
83808
|
const typeDeclaration = symbol.valueDeclaration;
|
|
83871
83809
|
if (typeDeclaration && isClassLike(typeDeclaration)) {
|
|
83872
83810
|
for (const member of typeDeclaration.members) {
|
|
83873
|
-
if (
|
|
83811
|
+
if (!isStatic(member) && !hasBindableName(member)) {
|
|
83874
83812
|
const symbol2 = getSymbolOfDeclaration(member);
|
|
83875
83813
|
checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
|
|
83876
83814
|
}
|
|
@@ -87670,35 +87608,6 @@ function createTypeChecker(host) {
|
|
|
87670
87608
|
for (const info of infoList) {
|
|
87671
87609
|
if (info.declaration) continue;
|
|
87672
87610
|
if (info === anyBaseTypeIndexInfo) continue;
|
|
87673
|
-
if (info.components) {
|
|
87674
|
-
const allComponentComputedNamesSerializable = every(info.components, (e) => {
|
|
87675
|
-
var _a;
|
|
87676
|
-
return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && enclosing && ((_a = isEntityNameVisible(
|
|
87677
|
-
e.name.expression,
|
|
87678
|
-
enclosing,
|
|
87679
|
-
/*shouldComputeAliasToMakeVisible*/
|
|
87680
|
-
false
|
|
87681
|
-
)) == null ? void 0 : _a.accessibility) === 0 /* Accessible */);
|
|
87682
|
-
});
|
|
87683
|
-
if (allComponentComputedNamesSerializable) {
|
|
87684
|
-
const newComponents = filter(info.components, (e) => {
|
|
87685
|
-
return !hasLateBindableName(e);
|
|
87686
|
-
});
|
|
87687
|
-
result.push(...map(newComponents, (e) => {
|
|
87688
|
-
trackComputedName(e.name.expression);
|
|
87689
|
-
const mods = infoList === staticInfos ? [factory.createModifier(126 /* StaticKeyword */)] : void 0;
|
|
87690
|
-
return factory.createPropertyDeclaration(
|
|
87691
|
-
append(mods, info.isReadonly ? factory.createModifier(148 /* ReadonlyKeyword */) : void 0),
|
|
87692
|
-
e.name,
|
|
87693
|
-
(isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
87694
|
-
nodeBuilder.typeToTypeNode(getTypeOfSymbol(e.symbol), enclosing, flags, internalFlags, tracker),
|
|
87695
|
-
/*initializer*/
|
|
87696
|
-
void 0
|
|
87697
|
-
);
|
|
87698
|
-
}));
|
|
87699
|
-
continue;
|
|
87700
|
-
}
|
|
87701
|
-
}
|
|
87702
87611
|
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
|
|
87703
87612
|
if (node && infoList === staticInfos) {
|
|
87704
87613
|
(node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
|
|
@@ -87709,22 +87618,6 @@ function createTypeChecker(host) {
|
|
|
87709
87618
|
}
|
|
87710
87619
|
}
|
|
87711
87620
|
return result;
|
|
87712
|
-
function trackComputedName(accessExpression) {
|
|
87713
|
-
if (!tracker.trackSymbol) return;
|
|
87714
|
-
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
87715
|
-
const name = resolveName(
|
|
87716
|
-
firstIdentifier,
|
|
87717
|
-
firstIdentifier.escapedText,
|
|
87718
|
-
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
87719
|
-
/*nameNotFoundMessage*/
|
|
87720
|
-
void 0,
|
|
87721
|
-
/*isUse*/
|
|
87722
|
-
true
|
|
87723
|
-
);
|
|
87724
|
-
if (name) {
|
|
87725
|
-
tracker.trackSymbol(name, enclosing, 111551 /* Value */);
|
|
87726
|
-
}
|
|
87727
|
-
}
|
|
87728
87621
|
}
|
|
87729
87622
|
};
|
|
87730
87623
|
function isImportRequiredByAugmentation(node) {
|
|
@@ -88969,7 +88862,7 @@ function createTypeChecker(host) {
|
|
|
88969
88862
|
}
|
|
88970
88863
|
}
|
|
88971
88864
|
function checkGrammarForInvalidDynamicName(node, message) {
|
|
88972
|
-
if (isNonBindableDynamicName(node)
|
|
88865
|
+
if (isNonBindableDynamicName(node)) {
|
|
88973
88866
|
return grammarErrorOnNode(node, message);
|
|
88974
88867
|
}
|
|
88975
88868
|
}
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6851,15 +6851,11 @@ declare namespace ts {
|
|
|
6851
6851
|
String = 0,
|
|
6852
6852
|
Number = 1,
|
|
6853
6853
|
}
|
|
6854
|
-
type ElementWithComputedPropertyName = (ClassElement | ObjectLiteralElement) & {
|
|
6855
|
-
name: ComputedPropertyName;
|
|
6856
|
-
};
|
|
6857
6854
|
interface IndexInfo {
|
|
6858
6855
|
keyType: Type;
|
|
6859
6856
|
type: Type;
|
|
6860
6857
|
isReadonly: boolean;
|
|
6861
6858
|
declaration?: IndexSignatureDeclaration;
|
|
6862
|
-
components?: ElementWithComputedPropertyName[];
|
|
6863
6859
|
}
|
|
6864
6860
|
enum InferencePriority {
|
|
6865
6861
|
None = 0,
|
package/lib/typescript.js
CHANGED
|
@@ -55824,7 +55824,7 @@ function createTypeChecker(host) {
|
|
|
55824
55824
|
function shouldWriteTypeOfFunctionSymbol() {
|
|
55825
55825
|
var _a3;
|
|
55826
55826
|
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
|
|
55827
|
-
some(symbol.declarations, (declaration) => isStatic(declaration)
|
|
55827
|
+
some(symbol.declarations, (declaration) => isStatic(declaration));
|
|
55828
55828
|
const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
|
|
55829
55829
|
forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
|
|
55830
55830
|
if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
|
|
@@ -56127,38 +56127,6 @@ function createTypeChecker(host) {
|
|
|
56127
56127
|
ids.unshift(state);
|
|
56128
56128
|
return ids;
|
|
56129
56129
|
}
|
|
56130
|
-
function indexInfoToObjectComputedNamesOrSignatureDeclaration(indexInfo, context2, typeNode) {
|
|
56131
|
-
if (indexInfo.components) {
|
|
56132
|
-
const allComponentComputedNamesSerializable = every(indexInfo.components, (e) => {
|
|
56133
|
-
var _a2;
|
|
56134
|
-
return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && context2.enclosingDeclaration && ((_a2 = isEntityNameVisible(
|
|
56135
|
-
e.name.expression,
|
|
56136
|
-
context2.enclosingDeclaration,
|
|
56137
|
-
/*shouldComputeAliasToMakeVisible*/
|
|
56138
|
-
false
|
|
56139
|
-
)) == null ? void 0 : _a2.accessibility) === 0 /* Accessible */);
|
|
56140
|
-
});
|
|
56141
|
-
if (allComponentComputedNamesSerializable) {
|
|
56142
|
-
const newComponents = filter(indexInfo.components, (e) => {
|
|
56143
|
-
return !hasLateBindableName(e);
|
|
56144
|
-
});
|
|
56145
|
-
return map(newComponents, (e) => {
|
|
56146
|
-
trackComputedName(e.name.expression, context2.enclosingDeclaration, context2);
|
|
56147
|
-
return setTextRange2(
|
|
56148
|
-
context2,
|
|
56149
|
-
factory.createPropertySignature(
|
|
56150
|
-
indexInfo.isReadonly ? [factory.createModifier(148 /* ReadonlyKeyword */)] : void 0,
|
|
56151
|
-
e.name,
|
|
56152
|
-
(isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
56153
|
-
typeNode || typeToTypeNodeHelper(getTypeOfSymbol(e.symbol), context2)
|
|
56154
|
-
),
|
|
56155
|
-
e
|
|
56156
|
-
);
|
|
56157
|
-
});
|
|
56158
|
-
}
|
|
56159
|
-
}
|
|
56160
|
-
return [indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode)];
|
|
56161
|
-
}
|
|
56162
56130
|
function createTypeNodesFromResolvedType(resolvedType) {
|
|
56163
56131
|
if (checkTruncationLength(context)) {
|
|
56164
56132
|
if (context.flags & 1 /* NoTruncation */) {
|
|
@@ -56183,7 +56151,7 @@ function createTypeChecker(host) {
|
|
|
56183
56151
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
56184
56152
|
}
|
|
56185
56153
|
for (const info of resolvedType.indexInfos) {
|
|
56186
|
-
typeElements.push(
|
|
56154
|
+
typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
56187
56155
|
}
|
|
56188
56156
|
const properties = resolvedType.properties;
|
|
56189
56157
|
if (!properties) {
|
|
@@ -56872,7 +56840,7 @@ function createTypeChecker(host) {
|
|
|
56872
56840
|
if (!context.tracker.canTrackSymbol) return;
|
|
56873
56841
|
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
56874
56842
|
const name = resolveName(
|
|
56875
|
-
|
|
56843
|
+
firstIdentifier,
|
|
56876
56844
|
firstIdentifier.escapedText,
|
|
56877
56845
|
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
56878
56846
|
/*nameNotFoundMessage*/
|
|
@@ -56882,19 +56850,6 @@ function createTypeChecker(host) {
|
|
|
56882
56850
|
);
|
|
56883
56851
|
if (name) {
|
|
56884
56852
|
context.tracker.trackSymbol(name, enclosingDeclaration, 111551 /* Value */);
|
|
56885
|
-
} else {
|
|
56886
|
-
const fallback = resolveName(
|
|
56887
|
-
firstIdentifier,
|
|
56888
|
-
firstIdentifier.escapedText,
|
|
56889
|
-
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
56890
|
-
/*nameNotFoundMessage*/
|
|
56891
|
-
void 0,
|
|
56892
|
-
/*isUse*/
|
|
56893
|
-
true
|
|
56894
|
-
);
|
|
56895
|
-
if (fallback) {
|
|
56896
|
-
context.tracker.trackSymbol(fallback, enclosingDeclaration, 111551 /* Value */);
|
|
56897
|
-
}
|
|
56898
56853
|
}
|
|
56899
56854
|
}
|
|
56900
56855
|
function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
|
|
@@ -63709,8 +63664,8 @@ function createTypeChecker(host) {
|
|
|
63709
63664
|
function getIndexSymbolFromSymbolTable(symbolTable) {
|
|
63710
63665
|
return symbolTable.get("__index" /* Index */);
|
|
63711
63666
|
}
|
|
63712
|
-
function createIndexInfo(keyType, type, isReadonly, declaration
|
|
63713
|
-
return { keyType, type, isReadonly, declaration
|
|
63667
|
+
function createIndexInfo(keyType, type, isReadonly, declaration) {
|
|
63668
|
+
return { keyType, type, isReadonly, declaration };
|
|
63714
63669
|
}
|
|
63715
63670
|
function getIndexInfosOfSymbol(symbol) {
|
|
63716
63671
|
const indexSymbol = getIndexSymbol(symbol);
|
|
@@ -66783,7 +66738,7 @@ function createTypeChecker(host) {
|
|
|
66783
66738
|
return result;
|
|
66784
66739
|
}
|
|
66785
66740
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
66786
|
-
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration
|
|
66741
|
+
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
|
|
66787
66742
|
}
|
|
66788
66743
|
function createLiteralType(flags, value, symbol, regularType) {
|
|
66789
66744
|
const type = createTypeWithSymbol(flags, symbol);
|
|
@@ -67573,7 +67528,7 @@ function createTypeChecker(host) {
|
|
|
67573
67528
|
return type.restrictiveInstantiation;
|
|
67574
67529
|
}
|
|
67575
67530
|
function instantiateIndexInfo(info, mapper) {
|
|
67576
|
-
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration
|
|
67531
|
+
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
|
|
67577
67532
|
}
|
|
67578
67533
|
function isContextSensitive(node) {
|
|
67579
67534
|
Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
|
|
@@ -71706,7 +71661,7 @@ function createTypeChecker(host) {
|
|
|
71706
71661
|
}
|
|
71707
71662
|
}
|
|
71708
71663
|
}
|
|
71709
|
-
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly
|
|
71664
|
+
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
71710
71665
|
result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
|
|
71711
71666
|
return result;
|
|
71712
71667
|
}
|
|
@@ -77754,33 +77709,16 @@ function createTypeChecker(host) {
|
|
|
77754
77709
|
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
77755
77710
|
return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
|
|
77756
77711
|
}
|
|
77757
|
-
function isSymbolWithComputedName(symbol) {
|
|
77758
|
-
var _a;
|
|
77759
|
-
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
77760
|
-
return firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name);
|
|
77761
|
-
}
|
|
77762
77712
|
function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
|
|
77763
|
-
var _a;
|
|
77764
77713
|
const propTypes = [];
|
|
77765
|
-
let components;
|
|
77766
77714
|
for (let i = offset; i < properties.length; i++) {
|
|
77767
77715
|
const prop = properties[i];
|
|
77768
77716
|
if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
|
|
77769
77717
|
propTypes.push(getTypeOfSymbol(properties[i]));
|
|
77770
|
-
if (isSymbolWithComputedName(properties[i])) {
|
|
77771
|
-
components = append(components, (_a = properties[i].declarations) == null ? void 0 : _a[0]);
|
|
77772
|
-
}
|
|
77773
77718
|
}
|
|
77774
77719
|
}
|
|
77775
77720
|
const unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;
|
|
77776
|
-
return createIndexInfo(
|
|
77777
|
-
keyType,
|
|
77778
|
-
unionType,
|
|
77779
|
-
isReadonly,
|
|
77780
|
-
/*declaration*/
|
|
77781
|
-
void 0,
|
|
77782
|
-
components
|
|
77783
|
-
);
|
|
77721
|
+
return createIndexInfo(keyType, unionType, isReadonly);
|
|
77784
77722
|
}
|
|
77785
77723
|
function getImmediateAliasedSymbol(symbol) {
|
|
77786
77724
|
Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here.");
|
|
@@ -88480,7 +88418,7 @@ function createTypeChecker(host) {
|
|
|
88480
88418
|
const typeDeclaration = symbol.valueDeclaration;
|
|
88481
88419
|
if (typeDeclaration && isClassLike(typeDeclaration)) {
|
|
88482
88420
|
for (const member of typeDeclaration.members) {
|
|
88483
|
-
if (
|
|
88421
|
+
if (!isStatic(member) && !hasBindableName(member)) {
|
|
88484
88422
|
const symbol2 = getSymbolOfDeclaration(member);
|
|
88485
88423
|
checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
|
|
88486
88424
|
}
|
|
@@ -92280,35 +92218,6 @@ function createTypeChecker(host) {
|
|
|
92280
92218
|
for (const info of infoList) {
|
|
92281
92219
|
if (info.declaration) continue;
|
|
92282
92220
|
if (info === anyBaseTypeIndexInfo) continue;
|
|
92283
|
-
if (info.components) {
|
|
92284
|
-
const allComponentComputedNamesSerializable = every(info.components, (e) => {
|
|
92285
|
-
var _a;
|
|
92286
|
-
return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && enclosing && ((_a = isEntityNameVisible(
|
|
92287
|
-
e.name.expression,
|
|
92288
|
-
enclosing,
|
|
92289
|
-
/*shouldComputeAliasToMakeVisible*/
|
|
92290
|
-
false
|
|
92291
|
-
)) == null ? void 0 : _a.accessibility) === 0 /* Accessible */);
|
|
92292
|
-
});
|
|
92293
|
-
if (allComponentComputedNamesSerializable) {
|
|
92294
|
-
const newComponents = filter(info.components, (e) => {
|
|
92295
|
-
return !hasLateBindableName(e);
|
|
92296
|
-
});
|
|
92297
|
-
result.push(...map(newComponents, (e) => {
|
|
92298
|
-
trackComputedName(e.name.expression);
|
|
92299
|
-
const mods = infoList === staticInfos ? [factory.createModifier(126 /* StaticKeyword */)] : void 0;
|
|
92300
|
-
return factory.createPropertyDeclaration(
|
|
92301
|
-
append(mods, info.isReadonly ? factory.createModifier(148 /* ReadonlyKeyword */) : void 0),
|
|
92302
|
-
e.name,
|
|
92303
|
-
(isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(58 /* QuestionToken */) : void 0,
|
|
92304
|
-
nodeBuilder.typeToTypeNode(getTypeOfSymbol(e.symbol), enclosing, flags, internalFlags, tracker),
|
|
92305
|
-
/*initializer*/
|
|
92306
|
-
void 0
|
|
92307
|
-
);
|
|
92308
|
-
}));
|
|
92309
|
-
continue;
|
|
92310
|
-
}
|
|
92311
|
-
}
|
|
92312
92221
|
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
|
|
92313
92222
|
if (node && infoList === staticInfos) {
|
|
92314
92223
|
(node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
|
|
@@ -92319,22 +92228,6 @@ function createTypeChecker(host) {
|
|
|
92319
92228
|
}
|
|
92320
92229
|
}
|
|
92321
92230
|
return result;
|
|
92322
|
-
function trackComputedName(accessExpression) {
|
|
92323
|
-
if (!tracker.trackSymbol) return;
|
|
92324
|
-
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
92325
|
-
const name = resolveName(
|
|
92326
|
-
firstIdentifier,
|
|
92327
|
-
firstIdentifier.escapedText,
|
|
92328
|
-
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
92329
|
-
/*nameNotFoundMessage*/
|
|
92330
|
-
void 0,
|
|
92331
|
-
/*isUse*/
|
|
92332
|
-
true
|
|
92333
|
-
);
|
|
92334
|
-
if (name) {
|
|
92335
|
-
tracker.trackSymbol(name, enclosing, 111551 /* Value */);
|
|
92336
|
-
}
|
|
92337
|
-
}
|
|
92338
92231
|
}
|
|
92339
92232
|
};
|
|
92340
92233
|
function isImportRequiredByAugmentation(node) {
|
|
@@ -93579,7 +93472,7 @@ function createTypeChecker(host) {
|
|
|
93579
93472
|
}
|
|
93580
93473
|
}
|
|
93581
93474
|
function checkGrammarForInvalidDynamicName(node, message) {
|
|
93582
|
-
if (isNonBindableDynamicName(node)
|
|
93475
|
+
if (isNonBindableDynamicName(node)) {
|
|
93583
93476
|
return grammarErrorOnNode(node, message);
|
|
93584
93477
|
}
|
|
93585
93478
|
}
|
|
@@ -173672,7 +173565,10 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
173672
173565
|
const { parent: parent2 } = node;
|
|
173673
173566
|
const typeChecker = program.getTypeChecker();
|
|
173674
173567
|
if (node.kind === 164 /* OverrideKeyword */ || isIdentifier(node) && isJSDocOverrideTag(parent2) && parent2.tagName === node) {
|
|
173675
|
-
|
|
173568
|
+
const def = getDefinitionFromOverriddenMember(typeChecker, node);
|
|
173569
|
+
if (def !== void 0 || node.kind !== 164 /* OverrideKeyword */) {
|
|
173570
|
+
return def || emptyArray;
|
|
173571
|
+
}
|
|
173676
173572
|
}
|
|
173677
173573
|
if (isJumpStatementTarget(node)) {
|
|
173678
173574
|
const label = getTargetLabel(node.parent, node.text);
|
|
@@ -173686,9 +173582,6 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
173686
173582
|
)] : void 0;
|
|
173687
173583
|
}
|
|
173688
173584
|
switch (node.kind) {
|
|
173689
|
-
case 107 /* ReturnKeyword */:
|
|
173690
|
-
const functionDeclaration = findAncestor(node.parent, (n) => isClassStaticBlockDeclaration(n) ? "quit" : isFunctionLikeDeclaration(n));
|
|
173691
|
-
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
173692
173585
|
case 90 /* DefaultKeyword */:
|
|
173693
173586
|
if (!isDefaultClause(node.parent)) {
|
|
173694
173587
|
break;
|
|
@@ -173701,15 +173594,14 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
173701
173594
|
}
|
|
173702
173595
|
break;
|
|
173703
173596
|
}
|
|
173704
|
-
|
|
173705
|
-
|
|
173706
|
-
|
|
173707
|
-
|
|
173708
|
-
|
|
173709
|
-
|
|
173710
|
-
|
|
173711
|
-
|
|
173712
|
-
return isGeneratorFunction ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
173597
|
+
let findFunctionDecl;
|
|
173598
|
+
switch (node.kind) {
|
|
173599
|
+
case 107 /* ReturnKeyword */:
|
|
173600
|
+
case 135 /* AwaitKeyword */:
|
|
173601
|
+
case 127 /* YieldKeyword */:
|
|
173602
|
+
findFunctionDecl = isFunctionLikeDeclaration;
|
|
173603
|
+
const functionDeclaration = findAncestor(node, findFunctionDecl);
|
|
173604
|
+
return functionDeclaration ? [createDefinitionFromSignatureDeclaration(typeChecker, functionDeclaration)] : void 0;
|
|
173713
173605
|
}
|
|
173714
173606
|
if (isStaticModifier(node) && isClassStaticBlockDeclaration(node.parent)) {
|
|
173715
173607
|
const classDecl = node.parent.parent;
|
|
@@ -173759,6 +173651,9 @@ function getDefinitionAtPosition(program, sourceFile, position, searchOtherFiles
|
|
|
173759
173651
|
}];
|
|
173760
173652
|
}
|
|
173761
173653
|
}
|
|
173654
|
+
if (isModifier(node) && (isClassElement(parent2) || isNamedDeclaration(parent2))) {
|
|
173655
|
+
symbol = parent2.symbol;
|
|
173656
|
+
}
|
|
173762
173657
|
if (!symbol) {
|
|
173763
173658
|
return concatenate(fileReferenceDefinition, getDefinitionInfoForIndexSignatures(node, typeChecker));
|
|
173764
173659
|
}
|
|
@@ -173955,12 +173850,16 @@ function getTypeDefinitionAtPosition(typeChecker, sourceFile, position) {
|
|
|
173955
173850
|
false
|
|
173956
173851
|
);
|
|
173957
173852
|
}
|
|
173958
|
-
|
|
173853
|
+
let { symbol, failedAliasResolution } = getSymbol(
|
|
173959
173854
|
node,
|
|
173960
173855
|
typeChecker,
|
|
173961
173856
|
/*stopAtAlias*/
|
|
173962
173857
|
false
|
|
173963
173858
|
);
|
|
173859
|
+
if (isModifier(node) && (isClassElement(node.parent) || isNamedDeclaration(node.parent))) {
|
|
173860
|
+
symbol = node.parent.symbol;
|
|
173861
|
+
failedAliasResolution = false;
|
|
173862
|
+
}
|
|
173964
173863
|
if (!symbol) return void 0;
|
|
173965
173864
|
const typeAtLocation = typeChecker.getTypeOfSymbolAtLocation(symbol, node);
|
|
173966
173865
|
const returnType = tryGetReturnTypeOfFunction(symbol, typeAtLocation, typeChecker);
|
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.8.0-pr-
|
|
5
|
+
"version": "5.8.0-pr-60384-4",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|