@typescript-deploys/pr-build 5.8.0-pr-60950-9 → 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 CHANGED
@@ -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) {
@@ -42866,16 +42866,13 @@ function createBinder() {
42866
42866
  function bindForStatement(node) {
42867
42867
  const preLoopLabel = setContinueTarget(node, createLoopLabel());
42868
42868
  const preBodyLabel = createBranchLabel();
42869
- const preIncrementorLabel = createBranchLabel();
42870
42869
  const postLoopLabel = createBranchLabel();
42871
42870
  bind(node.initializer);
42872
42871
  addAntecedent(preLoopLabel, currentFlow);
42873
42872
  currentFlow = preLoopLabel;
42874
42873
  bindCondition(node.condition, preBodyLabel, postLoopLabel);
42875
42874
  currentFlow = finishFlowLabel(preBodyLabel);
42876
- bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
42877
- addAntecedent(preIncrementorLabel, currentFlow);
42878
- currentFlow = finishFlowLabel(preIncrementorLabel);
42875
+ bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
42879
42876
  bind(node.incrementor);
42880
42877
  addAntecedent(preLoopLabel, currentFlow);
42881
42878
  currentFlow = finishFlowLabel(postLoopLabel);
@@ -51217,7 +51214,7 @@ function createTypeChecker(host) {
51217
51214
  function shouldWriteTypeOfFunctionSymbol() {
51218
51215
  var _a3;
51219
51216
  const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
51220
- some(symbol.declarations, (declaration) => isStatic(declaration));
51217
+ some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration)));
51221
51218
  const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
51222
51219
  forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
51223
51220
  if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
@@ -51520,6 +51517,38 @@ function createTypeChecker(host) {
51520
51517
  ids.unshift(state);
51521
51518
  return ids;
51522
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
+ }
51523
51552
  function createTypeNodesFromResolvedType(resolvedType) {
51524
51553
  if (checkTruncationLength(context)) {
51525
51554
  if (context.flags & 1 /* NoTruncation */) {
@@ -51544,7 +51573,7 @@ function createTypeChecker(host) {
51544
51573
  typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
51545
51574
  }
51546
51575
  for (const info of resolvedType.indexInfos) {
51547
- typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
51576
+ typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
51548
51577
  }
51549
51578
  const properties = resolvedType.properties;
51550
51579
  if (!properties) {
@@ -52233,7 +52262,7 @@ function createTypeChecker(host) {
52233
52262
  if (!context.tracker.canTrackSymbol) return;
52234
52263
  const firstIdentifier = getFirstIdentifier(accessExpression);
52235
52264
  const name = resolveName(
52236
- firstIdentifier,
52265
+ enclosingDeclaration,
52237
52266
  firstIdentifier.escapedText,
52238
52267
  111551 /* Value */ | 1048576 /* ExportValue */,
52239
52268
  /*nameNotFoundMessage*/
@@ -52243,6 +52272,19 @@ function createTypeChecker(host) {
52243
52272
  );
52244
52273
  if (name) {
52245
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
+ }
52246
52288
  }
52247
52289
  }
52248
52290
  function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
@@ -59057,8 +59099,8 @@ function createTypeChecker(host) {
59057
59099
  function getIndexSymbolFromSymbolTable(symbolTable) {
59058
59100
  return symbolTable.get("__index" /* Index */);
59059
59101
  }
59060
- function createIndexInfo(keyType, type, isReadonly, declaration) {
59061
- return { keyType, type, isReadonly, declaration };
59102
+ function createIndexInfo(keyType, type, isReadonly, declaration, components) {
59103
+ return { keyType, type, isReadonly, declaration, components };
59062
59104
  }
59063
59105
  function getIndexInfosOfSymbol(symbol) {
59064
59106
  const indexSymbol = getIndexSymbol(symbol);
@@ -62131,7 +62173,7 @@ function createTypeChecker(host) {
62131
62173
  return result;
62132
62174
  }
62133
62175
  function getIndexInfoWithReadonly(info, readonly) {
62134
- 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;
62135
62177
  }
62136
62178
  function createLiteralType(flags, value, symbol, regularType) {
62137
62179
  const type = createTypeWithSymbol(flags, symbol);
@@ -62921,7 +62963,7 @@ function createTypeChecker(host) {
62921
62963
  return type.restrictiveInstantiation;
62922
62964
  }
62923
62965
  function instantiateIndexInfo(info, mapper) {
62924
- 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);
62925
62967
  }
62926
62968
  function isContextSensitive(node) {
62927
62969
  Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
@@ -67054,7 +67096,7 @@ function createTypeChecker(host) {
67054
67096
  }
67055
67097
  }
67056
67098
  }
67057
- 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)));
67058
67100
  result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
67059
67101
  return result;
67060
67102
  }
@@ -73102,16 +73144,33 @@ function createTypeChecker(host) {
73102
73144
  const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
73103
73145
  return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
73104
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
+ }
73105
73152
  function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
73153
+ var _a;
73106
73154
  const propTypes = [];
73155
+ let components;
73107
73156
  for (let i = offset; i < properties.length; i++) {
73108
73157
  const prop = properties[i];
73109
73158
  if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
73110
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
+ }
73111
73163
  }
73112
73164
  }
73113
73165
  const unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;
73114
- return createIndexInfo(keyType, unionType, isReadonly);
73166
+ return createIndexInfo(
73167
+ keyType,
73168
+ unionType,
73169
+ isReadonly,
73170
+ /*declaration*/
73171
+ void 0,
73172
+ components
73173
+ );
73115
73174
  }
73116
73175
  function getImmediateAliasedSymbol(symbol) {
73117
73176
  Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here.");
@@ -83811,7 +83870,7 @@ function createTypeChecker(host) {
83811
83870
  const typeDeclaration = symbol.valueDeclaration;
83812
83871
  if (typeDeclaration && isClassLike(typeDeclaration)) {
83813
83872
  for (const member of typeDeclaration.members) {
83814
- if (!isStatic(member) && !hasBindableName(member)) {
83873
+ if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) {
83815
83874
  const symbol2 = getSymbolOfDeclaration(member);
83816
83875
  checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
83817
83876
  }
@@ -87611,6 +87670,35 @@ function createTypeChecker(host) {
87611
87670
  for (const info of infoList) {
87612
87671
  if (info.declaration) continue;
87613
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
+ }
87614
87702
  const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
87615
87703
  if (node && infoList === staticInfos) {
87616
87704
  (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
@@ -87621,6 +87709,22 @@ function createTypeChecker(host) {
87621
87709
  }
87622
87710
  }
87623
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
+ }
87624
87728
  }
87625
87729
  };
87626
87730
  function isImportRequiredByAugmentation(node) {
@@ -88865,7 +88969,7 @@ function createTypeChecker(host) {
88865
88969
  }
88866
88970
  }
88867
88971
  function checkGrammarForInvalidDynamicName(node, message) {
88868
- if (isNonBindableDynamicName(node)) {
88972
+ if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) {
88869
88973
  return grammarErrorOnNode(node, message);
88870
88974
  }
88871
88975
  }
@@ -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
@@ -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) {
@@ -47376,16 +47376,13 @@ function createBinder() {
47376
47376
  function bindForStatement(node) {
47377
47377
  const preLoopLabel = setContinueTarget(node, createLoopLabel());
47378
47378
  const preBodyLabel = createBranchLabel();
47379
- const preIncrementorLabel = createBranchLabel();
47380
47379
  const postLoopLabel = createBranchLabel();
47381
47380
  bind(node.initializer);
47382
47381
  addAntecedent(preLoopLabel, currentFlow);
47383
47382
  currentFlow = preLoopLabel;
47384
47383
  bindCondition(node.condition, preBodyLabel, postLoopLabel);
47385
47384
  currentFlow = finishFlowLabel(preBodyLabel);
47386
- bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
47387
- addAntecedent(preIncrementorLabel, currentFlow);
47388
- currentFlow = finishFlowLabel(preIncrementorLabel);
47385
+ bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
47389
47386
  bind(node.incrementor);
47390
47387
  addAntecedent(preLoopLabel, currentFlow);
47391
47388
  currentFlow = finishFlowLabel(postLoopLabel);
@@ -55827,7 +55824,7 @@ function createTypeChecker(host) {
55827
55824
  function shouldWriteTypeOfFunctionSymbol() {
55828
55825
  var _a3;
55829
55826
  const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
55830
- some(symbol.declarations, (declaration) => isStatic(declaration));
55827
+ some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration)));
55831
55828
  const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
55832
55829
  forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
55833
55830
  if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
@@ -56130,6 +56127,38 @@ function createTypeChecker(host) {
56130
56127
  ids.unshift(state);
56131
56128
  return ids;
56132
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
+ }
56133
56162
  function createTypeNodesFromResolvedType(resolvedType) {
56134
56163
  if (checkTruncationLength(context)) {
56135
56164
  if (context.flags & 1 /* NoTruncation */) {
@@ -56154,7 +56183,7 @@ function createTypeChecker(host) {
56154
56183
  typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
56155
56184
  }
56156
56185
  for (const info of resolvedType.indexInfos) {
56157
- typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
56186
+ typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
56158
56187
  }
56159
56188
  const properties = resolvedType.properties;
56160
56189
  if (!properties) {
@@ -56843,7 +56872,7 @@ function createTypeChecker(host) {
56843
56872
  if (!context.tracker.canTrackSymbol) return;
56844
56873
  const firstIdentifier = getFirstIdentifier(accessExpression);
56845
56874
  const name = resolveName(
56846
- firstIdentifier,
56875
+ enclosingDeclaration,
56847
56876
  firstIdentifier.escapedText,
56848
56877
  111551 /* Value */ | 1048576 /* ExportValue */,
56849
56878
  /*nameNotFoundMessage*/
@@ -56853,6 +56882,19 @@ function createTypeChecker(host) {
56853
56882
  );
56854
56883
  if (name) {
56855
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
+ }
56856
56898
  }
56857
56899
  }
56858
56900
  function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
@@ -63667,8 +63709,8 @@ function createTypeChecker(host) {
63667
63709
  function getIndexSymbolFromSymbolTable(symbolTable) {
63668
63710
  return symbolTable.get("__index" /* Index */);
63669
63711
  }
63670
- function createIndexInfo(keyType, type, isReadonly, declaration) {
63671
- return { keyType, type, isReadonly, declaration };
63712
+ function createIndexInfo(keyType, type, isReadonly, declaration, components) {
63713
+ return { keyType, type, isReadonly, declaration, components };
63672
63714
  }
63673
63715
  function getIndexInfosOfSymbol(symbol) {
63674
63716
  const indexSymbol = getIndexSymbol(symbol);
@@ -66741,7 +66783,7 @@ function createTypeChecker(host) {
66741
66783
  return result;
66742
66784
  }
66743
66785
  function getIndexInfoWithReadonly(info, readonly) {
66744
- 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;
66745
66787
  }
66746
66788
  function createLiteralType(flags, value, symbol, regularType) {
66747
66789
  const type = createTypeWithSymbol(flags, symbol);
@@ -67531,7 +67573,7 @@ function createTypeChecker(host) {
67531
67573
  return type.restrictiveInstantiation;
67532
67574
  }
67533
67575
  function instantiateIndexInfo(info, mapper) {
67534
- 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);
67535
67577
  }
67536
67578
  function isContextSensitive(node) {
67537
67579
  Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
@@ -71664,7 +71706,7 @@ function createTypeChecker(host) {
71664
71706
  }
71665
71707
  }
71666
71708
  }
71667
- 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)));
71668
71710
  result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
71669
71711
  return result;
71670
71712
  }
@@ -77712,16 +77754,33 @@ function createTypeChecker(host) {
77712
77754
  const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
77713
77755
  return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
77714
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
+ }
77715
77762
  function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
77763
+ var _a;
77716
77764
  const propTypes = [];
77765
+ let components;
77717
77766
  for (let i = offset; i < properties.length; i++) {
77718
77767
  const prop = properties[i];
77719
77768
  if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
77720
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
+ }
77721
77773
  }
77722
77774
  }
77723
77775
  const unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;
77724
- return createIndexInfo(keyType, unionType, isReadonly);
77776
+ return createIndexInfo(
77777
+ keyType,
77778
+ unionType,
77779
+ isReadonly,
77780
+ /*declaration*/
77781
+ void 0,
77782
+ components
77783
+ );
77725
77784
  }
77726
77785
  function getImmediateAliasedSymbol(symbol) {
77727
77786
  Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here.");
@@ -88421,7 +88480,7 @@ function createTypeChecker(host) {
88421
88480
  const typeDeclaration = symbol.valueDeclaration;
88422
88481
  if (typeDeclaration && isClassLike(typeDeclaration)) {
88423
88482
  for (const member of typeDeclaration.members) {
88424
- if (!isStatic(member) && !hasBindableName(member)) {
88483
+ if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) {
88425
88484
  const symbol2 = getSymbolOfDeclaration(member);
88426
88485
  checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
88427
88486
  }
@@ -92221,6 +92280,35 @@ function createTypeChecker(host) {
92221
92280
  for (const info of infoList) {
92222
92281
  if (info.declaration) continue;
92223
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
+ }
92224
92312
  const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
92225
92313
  if (node && infoList === staticInfos) {
92226
92314
  (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
@@ -92231,6 +92319,22 @@ function createTypeChecker(host) {
92231
92319
  }
92232
92320
  }
92233
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
+ }
92234
92338
  }
92235
92339
  };
92236
92340
  function isImportRequiredByAugmentation(node) {
@@ -93475,7 +93579,7 @@ function createTypeChecker(host) {
93475
93579
  }
93476
93580
  }
93477
93581
  function checkGrammarForInvalidDynamicName(node, message) {
93478
- if (isNonBindableDynamicName(node)) {
93582
+ if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) {
93479
93583
  return grammarErrorOnNode(node, message);
93480
93584
  }
93481
93585
  }
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-60950-9",
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": [