@typescript-deploys/pr-build 5.8.0-pr-60898-2 → 5.8.0-pr-60052-36
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 +121 -18
- package/lib/typescript.d.ts +4 -0
- package/lib/typescript.js +123 -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.8";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20250121`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -41545,7 +41545,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
|
|
|
41545
41545
|
);
|
|
41546
41546
|
}
|
|
41547
41547
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
41548
|
-
const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
41548
|
+
const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ || state.conditions.includes("import") ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
41549
41549
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
41550
41550
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
41551
41551
|
if (priorityExtensions) {
|
|
@@ -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) && !isLateBindableIndexSignature(getNameOfDeclaration(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,6 +51517,38 @@ 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
|
+
}
|
|
51520
51552
|
function createTypeNodesFromResolvedType(resolvedType) {
|
|
51521
51553
|
if (checkTruncationLength(context)) {
|
|
51522
51554
|
if (context.flags & 1 /* NoTruncation */) {
|
|
@@ -51541,7 +51573,7 @@ function createTypeChecker(host) {
|
|
|
51541
51573
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
51542
51574
|
}
|
|
51543
51575
|
for (const info of resolvedType.indexInfos) {
|
|
51544
|
-
typeElements.push(
|
|
51576
|
+
typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
51545
51577
|
}
|
|
51546
51578
|
const properties = resolvedType.properties;
|
|
51547
51579
|
if (!properties) {
|
|
@@ -52230,7 +52262,7 @@ function createTypeChecker(host) {
|
|
|
52230
52262
|
if (!context.tracker.canTrackSymbol) return;
|
|
52231
52263
|
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
52232
52264
|
const name = resolveName(
|
|
52233
|
-
|
|
52265
|
+
enclosingDeclaration,
|
|
52234
52266
|
firstIdentifier.escapedText,
|
|
52235
52267
|
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
52236
52268
|
/*nameNotFoundMessage*/
|
|
@@ -52240,6 +52272,19 @@ function createTypeChecker(host) {
|
|
|
52240
52272
|
);
|
|
52241
52273
|
if (name) {
|
|
52242
52274
|
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
|
+
}
|
|
52243
52288
|
}
|
|
52244
52289
|
}
|
|
52245
52290
|
function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
|
|
@@ -59054,8 +59099,8 @@ function createTypeChecker(host) {
|
|
|
59054
59099
|
function getIndexSymbolFromSymbolTable(symbolTable) {
|
|
59055
59100
|
return symbolTable.get("__index" /* Index */);
|
|
59056
59101
|
}
|
|
59057
|
-
function createIndexInfo(keyType, type, isReadonly, declaration) {
|
|
59058
|
-
return { keyType, type, isReadonly, declaration };
|
|
59102
|
+
function createIndexInfo(keyType, type, isReadonly, declaration, components) {
|
|
59103
|
+
return { keyType, type, isReadonly, declaration, components };
|
|
59059
59104
|
}
|
|
59060
59105
|
function getIndexInfosOfSymbol(symbol) {
|
|
59061
59106
|
const indexSymbol = getIndexSymbol(symbol);
|
|
@@ -62128,7 +62173,7 @@ function createTypeChecker(host) {
|
|
|
62128
62173
|
return result;
|
|
62129
62174
|
}
|
|
62130
62175
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
62131
|
-
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
|
|
62176
|
+
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration, info.components) : info;
|
|
62132
62177
|
}
|
|
62133
62178
|
function createLiteralType(flags, value, symbol, regularType) {
|
|
62134
62179
|
const type = createTypeWithSymbol(flags, symbol);
|
|
@@ -62918,7 +62963,7 @@ function createTypeChecker(host) {
|
|
|
62918
62963
|
return type.restrictiveInstantiation;
|
|
62919
62964
|
}
|
|
62920
62965
|
function instantiateIndexInfo(info, mapper) {
|
|
62921
|
-
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
|
|
62966
|
+
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components);
|
|
62922
62967
|
}
|
|
62923
62968
|
function isContextSensitive(node) {
|
|
62924
62969
|
Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
|
|
@@ -67051,7 +67096,7 @@ function createTypeChecker(host) {
|
|
|
67051
67096
|
}
|
|
67052
67097
|
}
|
|
67053
67098
|
}
|
|
67054
|
-
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
67099
|
+
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly, info.declaration, info.components)));
|
|
67055
67100
|
result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
|
|
67056
67101
|
return result;
|
|
67057
67102
|
}
|
|
@@ -73099,16 +73144,33 @@ function createTypeChecker(host) {
|
|
|
73099
73144
|
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
73100
73145
|
return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
|
|
73101
73146
|
}
|
|
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
|
+
}
|
|
73102
73152
|
function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
|
|
73153
|
+
var _a;
|
|
73103
73154
|
const propTypes = [];
|
|
73155
|
+
let components;
|
|
73104
73156
|
for (let i = offset; i < properties.length; i++) {
|
|
73105
73157
|
const prop = properties[i];
|
|
73106
73158
|
if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
|
|
73107
73159
|
propTypes.push(getTypeOfSymbol(properties[i]));
|
|
73160
|
+
if (isSymbolWithComputedName(properties[i])) {
|
|
73161
|
+
components = append(components, (_a = properties[i].declarations) == null ? void 0 : _a[0]);
|
|
73162
|
+
}
|
|
73108
73163
|
}
|
|
73109
73164
|
}
|
|
73110
73165
|
const unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;
|
|
73111
|
-
return createIndexInfo(
|
|
73166
|
+
return createIndexInfo(
|
|
73167
|
+
keyType,
|
|
73168
|
+
unionType,
|
|
73169
|
+
isReadonly,
|
|
73170
|
+
/*declaration*/
|
|
73171
|
+
void 0,
|
|
73172
|
+
components
|
|
73173
|
+
);
|
|
73112
73174
|
}
|
|
73113
73175
|
function getImmediateAliasedSymbol(symbol) {
|
|
73114
73176
|
Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here.");
|
|
@@ -83808,7 +83870,7 @@ function createTypeChecker(host) {
|
|
|
83808
83870
|
const typeDeclaration = symbol.valueDeclaration;
|
|
83809
83871
|
if (typeDeclaration && isClassLike(typeDeclaration)) {
|
|
83810
83872
|
for (const member of typeDeclaration.members) {
|
|
83811
|
-
if (!isStatic(member) && !hasBindableName(member)) {
|
|
83873
|
+
if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) {
|
|
83812
83874
|
const symbol2 = getSymbolOfDeclaration(member);
|
|
83813
83875
|
checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
|
|
83814
83876
|
}
|
|
@@ -87608,6 +87670,35 @@ function createTypeChecker(host) {
|
|
|
87608
87670
|
for (const info of infoList) {
|
|
87609
87671
|
if (info.declaration) continue;
|
|
87610
87672
|
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
|
+
}
|
|
87611
87702
|
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
|
|
87612
87703
|
if (node && infoList === staticInfos) {
|
|
87613
87704
|
(node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
|
|
@@ -87618,6 +87709,22 @@ function createTypeChecker(host) {
|
|
|
87618
87709
|
}
|
|
87619
87710
|
}
|
|
87620
87711
|
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
|
+
}
|
|
87621
87728
|
}
|
|
87622
87729
|
};
|
|
87623
87730
|
function isImportRequiredByAugmentation(node) {
|
|
@@ -88862,7 +88969,7 @@ function createTypeChecker(host) {
|
|
|
88862
88969
|
}
|
|
88863
88970
|
}
|
|
88864
88971
|
function checkGrammarForInvalidDynamicName(node, message) {
|
|
88865
|
-
if (isNonBindableDynamicName(node)) {
|
|
88972
|
+
if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) {
|
|
88866
88973
|
return grammarErrorOnNode(node, message);
|
|
88867
88974
|
}
|
|
88868
88975
|
}
|
|
@@ -112825,11 +112932,7 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
112825
112932
|
if (isSetAccessor(node.parent)) {
|
|
112826
112933
|
return createAccessorTypeError(node.parent);
|
|
112827
112934
|
}
|
|
112828
|
-
const addUndefined = resolver.requiresAddingImplicitUndefined(
|
|
112829
|
-
node,
|
|
112830
|
-
/*enclosingDeclaration*/
|
|
112831
|
-
void 0
|
|
112832
|
-
);
|
|
112935
|
+
const addUndefined = resolver.requiresAddingImplicitUndefined(node, node.parent);
|
|
112833
112936
|
if (!addUndefined && node.initializer) {
|
|
112834
112937
|
return createExpressionError(node.initializer);
|
|
112835
112938
|
}
|
package/lib/typescript.d.ts
CHANGED
|
@@ -6851,11 +6851,15 @@ declare namespace ts {
|
|
|
6851
6851
|
String = 0,
|
|
6852
6852
|
Number = 1,
|
|
6853
6853
|
}
|
|
6854
|
+
type ElementWithComputedPropertyName = (ClassElement | ObjectLiteralElement) & {
|
|
6855
|
+
name: ComputedPropertyName;
|
|
6856
|
+
};
|
|
6854
6857
|
interface IndexInfo {
|
|
6855
6858
|
keyType: Type;
|
|
6856
6859
|
type: Type;
|
|
6857
6860
|
isReadonly: boolean;
|
|
6858
6861
|
declaration?: IndexSignatureDeclaration;
|
|
6862
|
+
components?: ElementWithComputedPropertyName[];
|
|
6859
6863
|
}
|
|
6860
6864
|
enum InferencePriority {
|
|
6861
6865
|
None = 0,
|
package/lib/typescript.js
CHANGED
|
@@ -2285,7 +2285,7 @@ module.exports = __toCommonJS(typescript_exports);
|
|
|
2285
2285
|
|
|
2286
2286
|
// src/compiler/corePublic.ts
|
|
2287
2287
|
var versionMajorMinor = "5.8";
|
|
2288
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
2288
|
+
var version = `${versionMajorMinor}.0-insiders.20250121`;
|
|
2289
2289
|
var Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
2290
2290
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
2291
2291
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -46037,7 +46037,7 @@ function loadModuleFromNearestNodeModulesDirectoryTypesScope(moduleName, directo
|
|
|
46037
46037
|
);
|
|
46038
46038
|
}
|
|
46039
46039
|
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
|
|
46040
|
-
const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
46040
|
+
const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ || state.conditions.includes("import") ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
46041
46041
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
46042
46042
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
46043
46043
|
if (priorityExtensions) {
|
|
@@ -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) && !isLateBindableIndexSignature(getNameOfDeclaration(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,6 +56127,38 @@ 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
|
+
}
|
|
56130
56162
|
function createTypeNodesFromResolvedType(resolvedType) {
|
|
56131
56163
|
if (checkTruncationLength(context)) {
|
|
56132
56164
|
if (context.flags & 1 /* NoTruncation */) {
|
|
@@ -56151,7 +56183,7 @@ function createTypeChecker(host) {
|
|
|
56151
56183
|
typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
|
|
56152
56184
|
}
|
|
56153
56185
|
for (const info of resolvedType.indexInfos) {
|
|
56154
|
-
typeElements.push(
|
|
56186
|
+
typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
|
|
56155
56187
|
}
|
|
56156
56188
|
const properties = resolvedType.properties;
|
|
56157
56189
|
if (!properties) {
|
|
@@ -56840,7 +56872,7 @@ function createTypeChecker(host) {
|
|
|
56840
56872
|
if (!context.tracker.canTrackSymbol) return;
|
|
56841
56873
|
const firstIdentifier = getFirstIdentifier(accessExpression);
|
|
56842
56874
|
const name = resolveName(
|
|
56843
|
-
|
|
56875
|
+
enclosingDeclaration,
|
|
56844
56876
|
firstIdentifier.escapedText,
|
|
56845
56877
|
111551 /* Value */ | 1048576 /* ExportValue */,
|
|
56846
56878
|
/*nameNotFoundMessage*/
|
|
@@ -56850,6 +56882,19 @@ function createTypeChecker(host) {
|
|
|
56850
56882
|
);
|
|
56851
56883
|
if (name) {
|
|
56852
56884
|
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
|
+
}
|
|
56853
56898
|
}
|
|
56854
56899
|
}
|
|
56855
56900
|
function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
|
|
@@ -63664,8 +63709,8 @@ function createTypeChecker(host) {
|
|
|
63664
63709
|
function getIndexSymbolFromSymbolTable(symbolTable) {
|
|
63665
63710
|
return symbolTable.get("__index" /* Index */);
|
|
63666
63711
|
}
|
|
63667
|
-
function createIndexInfo(keyType, type, isReadonly, declaration) {
|
|
63668
|
-
return { keyType, type, isReadonly, declaration };
|
|
63712
|
+
function createIndexInfo(keyType, type, isReadonly, declaration, components) {
|
|
63713
|
+
return { keyType, type, isReadonly, declaration, components };
|
|
63669
63714
|
}
|
|
63670
63715
|
function getIndexInfosOfSymbol(symbol) {
|
|
63671
63716
|
const indexSymbol = getIndexSymbol(symbol);
|
|
@@ -66738,7 +66783,7 @@ function createTypeChecker(host) {
|
|
|
66738
66783
|
return result;
|
|
66739
66784
|
}
|
|
66740
66785
|
function getIndexInfoWithReadonly(info, readonly) {
|
|
66741
|
-
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
|
|
66786
|
+
return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration, info.components) : info;
|
|
66742
66787
|
}
|
|
66743
66788
|
function createLiteralType(flags, value, symbol, regularType) {
|
|
66744
66789
|
const type = createTypeWithSymbol(flags, symbol);
|
|
@@ -67528,7 +67573,7 @@ function createTypeChecker(host) {
|
|
|
67528
67573
|
return type.restrictiveInstantiation;
|
|
67529
67574
|
}
|
|
67530
67575
|
function instantiateIndexInfo(info, mapper) {
|
|
67531
|
-
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
|
|
67576
|
+
return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components);
|
|
67532
67577
|
}
|
|
67533
67578
|
function isContextSensitive(node) {
|
|
67534
67579
|
Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
|
|
@@ -71661,7 +71706,7 @@ function createTypeChecker(host) {
|
|
|
71661
71706
|
}
|
|
71662
71707
|
}
|
|
71663
71708
|
}
|
|
71664
|
-
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
|
|
71709
|
+
const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly, info.declaration, info.components)));
|
|
71665
71710
|
result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
|
|
71666
71711
|
return result;
|
|
71667
71712
|
}
|
|
@@ -77709,16 +77754,33 @@ function createTypeChecker(host) {
|
|
|
77709
77754
|
const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
|
|
77710
77755
|
return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
|
|
77711
77756
|
}
|
|
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
|
+
}
|
|
77712
77762
|
function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
|
|
77763
|
+
var _a;
|
|
77713
77764
|
const propTypes = [];
|
|
77765
|
+
let components;
|
|
77714
77766
|
for (let i = offset; i < properties.length; i++) {
|
|
77715
77767
|
const prop = properties[i];
|
|
77716
77768
|
if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
|
|
77717
77769
|
propTypes.push(getTypeOfSymbol(properties[i]));
|
|
77770
|
+
if (isSymbolWithComputedName(properties[i])) {
|
|
77771
|
+
components = append(components, (_a = properties[i].declarations) == null ? void 0 : _a[0]);
|
|
77772
|
+
}
|
|
77718
77773
|
}
|
|
77719
77774
|
}
|
|
77720
77775
|
const unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;
|
|
77721
|
-
return createIndexInfo(
|
|
77776
|
+
return createIndexInfo(
|
|
77777
|
+
keyType,
|
|
77778
|
+
unionType,
|
|
77779
|
+
isReadonly,
|
|
77780
|
+
/*declaration*/
|
|
77781
|
+
void 0,
|
|
77782
|
+
components
|
|
77783
|
+
);
|
|
77722
77784
|
}
|
|
77723
77785
|
function getImmediateAliasedSymbol(symbol) {
|
|
77724
77786
|
Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here.");
|
|
@@ -88418,7 +88480,7 @@ function createTypeChecker(host) {
|
|
|
88418
88480
|
const typeDeclaration = symbol.valueDeclaration;
|
|
88419
88481
|
if (typeDeclaration && isClassLike(typeDeclaration)) {
|
|
88420
88482
|
for (const member of typeDeclaration.members) {
|
|
88421
|
-
if (!isStatic(member) && !hasBindableName(member)) {
|
|
88483
|
+
if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) {
|
|
88422
88484
|
const symbol2 = getSymbolOfDeclaration(member);
|
|
88423
88485
|
checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
|
|
88424
88486
|
}
|
|
@@ -92218,6 +92280,35 @@ function createTypeChecker(host) {
|
|
|
92218
92280
|
for (const info of infoList) {
|
|
92219
92281
|
if (info.declaration) continue;
|
|
92220
92282
|
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
|
+
}
|
|
92221
92312
|
const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
|
|
92222
92313
|
if (node && infoList === staticInfos) {
|
|
92223
92314
|
(node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
|
|
@@ -92228,6 +92319,22 @@ function createTypeChecker(host) {
|
|
|
92228
92319
|
}
|
|
92229
92320
|
}
|
|
92230
92321
|
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
|
+
}
|
|
92231
92338
|
}
|
|
92232
92339
|
};
|
|
92233
92340
|
function isImportRequiredByAugmentation(node) {
|
|
@@ -93472,7 +93579,7 @@ function createTypeChecker(host) {
|
|
|
93472
93579
|
}
|
|
93473
93580
|
}
|
|
93474
93581
|
function checkGrammarForInvalidDynamicName(node, message) {
|
|
93475
|
-
if (isNonBindableDynamicName(node)) {
|
|
93582
|
+
if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) {
|
|
93476
93583
|
return grammarErrorOnNode(node, message);
|
|
93477
93584
|
}
|
|
93478
93585
|
}
|
|
@@ -117617,11 +117724,7 @@ function createGetIsolatedDeclarationErrors(resolver) {
|
|
|
117617
117724
|
if (isSetAccessor(node.parent)) {
|
|
117618
117725
|
return createAccessorTypeError(node.parent);
|
|
117619
117726
|
}
|
|
117620
|
-
const addUndefined = resolver.requiresAddingImplicitUndefined(
|
|
117621
|
-
node,
|
|
117622
|
-
/*enclosingDeclaration*/
|
|
117623
|
-
void 0
|
|
117624
|
-
);
|
|
117727
|
+
const addUndefined = resolver.requiresAddingImplicitUndefined(node, node.parent);
|
|
117625
117728
|
if (!addUndefined && node.initializer) {
|
|
117626
117729
|
return createExpressionError(node.initializer);
|
|
117627
117730
|
}
|
|
@@ -161639,6 +161742,8 @@ registerCodeFix({
|
|
|
161639
161742
|
break;
|
|
161640
161743
|
} else if (canDeleteEntireVariableStatement(sourceFile, token)) {
|
|
161641
161744
|
deleteEntireVariableStatement(changes, sourceFile, token.parent);
|
|
161745
|
+
} else if (isIdentifier(token) && isFunctionDeclaration(token.parent)) {
|
|
161746
|
+
deleteFunctionLikeDeclaration(changes, sourceFile, token.parent);
|
|
161642
161747
|
} else {
|
|
161643
161748
|
tryDeleteDeclaration(
|
|
161644
161749
|
sourceFile,
|
|
@@ -182184,12 +182289,6 @@ var SmartIndenter;
|
|
|
182184
182289
|
return false;
|
|
182185
182290
|
}
|
|
182186
182291
|
break;
|
|
182187
|
-
case 258 /* TryStatement */:
|
|
182188
|
-
const tryStatement = parent2;
|
|
182189
|
-
if (tryStatement.finallyBlock && tryStatement.finallyBlock === child) {
|
|
182190
|
-
return false;
|
|
182191
|
-
}
|
|
182192
|
-
break;
|
|
182193
182292
|
}
|
|
182194
182293
|
return indentByDefault;
|
|
182195
182294
|
}
|
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-60052-36",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|