@typescript-deploys/pr-build 5.8.0-pr-60052-36 → 5.8.0-pr-60994-8

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
@@ -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.20250121`;
21
+ var version = `${versionMajorMinor}.0-insiders.20250123`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -13236,6 +13236,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
13236
13236
  "trunc",
13237
13237
  "fround",
13238
13238
  "cbrt"
13239
+ ],
13240
+ esnext: [
13241
+ "f16round"
13239
13242
  ]
13240
13243
  })),
13241
13244
  Map: new Map(Object.entries({
@@ -13405,6 +13408,10 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
13405
13408
  "setBigUint64",
13406
13409
  "getBigInt64",
13407
13410
  "getBigUint64"
13411
+ ],
13412
+ esnext: [
13413
+ "setFloat16",
13414
+ "getFloat16"
13408
13415
  ]
13409
13416
  })),
13410
13417
  BigInt: new Map(Object.entries({
@@ -13508,6 +13515,9 @@ var getScriptTargetFeatures = /* @__PURE__ */ memoize(
13508
13515
  "with"
13509
13516
  ]
13510
13517
  })),
13518
+ Float16Array: new Map(Object.entries({
13519
+ esnext: emptyArray
13520
+ })),
13511
13521
  Float32Array: new Map(Object.entries({
13512
13522
  es2022: [
13513
13523
  "at"
@@ -36256,6 +36266,7 @@ var libEntries = [
36256
36266
  ["esnext.string", "lib.es2024.string.d.ts"],
36257
36267
  ["esnext.iterator", "lib.esnext.iterator.d.ts"],
36258
36268
  ["esnext.promise", "lib.esnext.promise.d.ts"],
36269
+ ["esnext.float16", "lib.esnext.float16.d.ts"],
36259
36270
  ["decorators", "lib.decorators.d.ts"],
36260
36271
  ["decorators.legacy", "lib.decorators.legacy.d.ts"]
36261
36272
  ];
@@ -42866,13 +42877,16 @@ function createBinder() {
42866
42877
  function bindForStatement(node) {
42867
42878
  const preLoopLabel = setContinueTarget(node, createLoopLabel());
42868
42879
  const preBodyLabel = createBranchLabel();
42880
+ const preIncrementorLabel = createBranchLabel();
42869
42881
  const postLoopLabel = createBranchLabel();
42870
42882
  bind(node.initializer);
42871
42883
  addAntecedent(preLoopLabel, currentFlow);
42872
42884
  currentFlow = preLoopLabel;
42873
42885
  bindCondition(node.condition, preBodyLabel, postLoopLabel);
42874
42886
  currentFlow = finishFlowLabel(preBodyLabel);
42875
- bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
42887
+ bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
42888
+ addAntecedent(preIncrementorLabel, currentFlow);
42889
+ currentFlow = finishFlowLabel(preIncrementorLabel);
42876
42890
  bind(node.incrementor);
42877
42891
  addAntecedent(preLoopLabel, currentFlow);
42878
42892
  currentFlow = finishFlowLabel(postLoopLabel);
@@ -51214,7 +51228,7 @@ function createTypeChecker(host) {
51214
51228
  function shouldWriteTypeOfFunctionSymbol() {
51215
51229
  var _a3;
51216
51230
  const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
51217
- some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration)));
51231
+ some(symbol.declarations, (declaration) => isStatic(declaration));
51218
51232
  const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
51219
51233
  forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
51220
51234
  if (isStaticMethodSymbol || isNonLocalFunctionSymbol) {
@@ -51517,38 +51531,6 @@ function createTypeChecker(host) {
51517
51531
  ids.unshift(state);
51518
51532
  return ids;
51519
51533
  }
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
51534
  function createTypeNodesFromResolvedType(resolvedType) {
51553
51535
  if (checkTruncationLength(context)) {
51554
51536
  if (context.flags & 1 /* NoTruncation */) {
@@ -51573,7 +51555,7 @@ function createTypeChecker(host) {
51573
51555
  typeElements.push(signatureToSignatureDeclarationHelper(signature, 180 /* ConstructSignature */, context));
51574
51556
  }
51575
51557
  for (const info of resolvedType.indexInfos) {
51576
- typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
51558
+ typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
51577
51559
  }
51578
51560
  const properties = resolvedType.properties;
51579
51561
  if (!properties) {
@@ -52262,7 +52244,7 @@ function createTypeChecker(host) {
52262
52244
  if (!context.tracker.canTrackSymbol) return;
52263
52245
  const firstIdentifier = getFirstIdentifier(accessExpression);
52264
52246
  const name = resolveName(
52265
- enclosingDeclaration,
52247
+ firstIdentifier,
52266
52248
  firstIdentifier.escapedText,
52267
52249
  111551 /* Value */ | 1048576 /* ExportValue */,
52268
52250
  /*nameNotFoundMessage*/
@@ -52272,19 +52254,6 @@ function createTypeChecker(host) {
52272
52254
  );
52273
52255
  if (name) {
52274
52256
  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
52257
  }
52289
52258
  }
52290
52259
  function lookupSymbolChain(symbol, context, meaning, yieldModuleSymbol) {
@@ -59099,8 +59068,8 @@ function createTypeChecker(host) {
59099
59068
  function getIndexSymbolFromSymbolTable(symbolTable) {
59100
59069
  return symbolTable.get("__index" /* Index */);
59101
59070
  }
59102
- function createIndexInfo(keyType, type, isReadonly, declaration, components) {
59103
- return { keyType, type, isReadonly, declaration, components };
59071
+ function createIndexInfo(keyType, type, isReadonly, declaration) {
59072
+ return { keyType, type, isReadonly, declaration };
59104
59073
  }
59105
59074
  function getIndexInfosOfSymbol(symbol) {
59106
59075
  const indexSymbol = getIndexSymbol(symbol);
@@ -59619,6 +59588,9 @@ function createTypeChecker(host) {
59619
59588
  case "Number":
59620
59589
  checkNoTypeArguments(node);
59621
59590
  return numberType;
59591
+ case "BigInt":
59592
+ checkNoTypeArguments(node);
59593
+ return bigintType;
59622
59594
  case "Boolean":
59623
59595
  checkNoTypeArguments(node);
59624
59596
  return booleanType;
@@ -61110,6 +61082,12 @@ function createTypeChecker(host) {
61110
61082
  const name = getNameOfDeclaration(prop.valueDeclaration);
61111
61083
  type = prop.escapedName === "default" /* Default */ ? getStringLiteralType("default") : name && getLiteralTypeFromPropertyName(name) || (!isKnownSymbol(prop) ? getStringLiteralType(symbolName(prop)) : void 0);
61112
61084
  }
61085
+ if (type && type.flags & 1048576 /* Union */) {
61086
+ const unionType = type;
61087
+ if (unionType.types.length > 0) {
61088
+ type = unionType.types[0];
61089
+ }
61090
+ }
61113
61091
  if (type && type.flags & include) {
61114
61092
  return type;
61115
61093
  }
@@ -62173,7 +62151,7 @@ function createTypeChecker(host) {
62173
62151
  return result;
62174
62152
  }
62175
62153
  function getIndexInfoWithReadonly(info, readonly) {
62176
- return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration, info.components) : info;
62154
+ return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
62177
62155
  }
62178
62156
  function createLiteralType(flags, value, symbol, regularType) {
62179
62157
  const type = createTypeWithSymbol(flags, symbol);
@@ -62963,7 +62941,7 @@ function createTypeChecker(host) {
62963
62941
  return type.restrictiveInstantiation;
62964
62942
  }
62965
62943
  function instantiateIndexInfo(info, mapper) {
62966
- return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components);
62944
+ return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
62967
62945
  }
62968
62946
  function isContextSensitive(node) {
62969
62947
  Debug.assert(node.kind !== 174 /* MethodDeclaration */ || isObjectLiteralMethod(node));
@@ -67096,7 +67074,7 @@ function createTypeChecker(host) {
67096
67074
  }
67097
67075
  }
67098
67076
  }
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)));
67077
+ const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
67100
67078
  result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
67101
67079
  return result;
67102
67080
  }
@@ -68538,6 +68516,7 @@ function createTypeChecker(host) {
68538
68516
  return target.kind === 108 /* SuperKeyword */;
68539
68517
  case 235 /* NonNullExpression */:
68540
68518
  case 217 /* ParenthesizedExpression */:
68519
+ case 238 /* SatisfiesExpression */:
68541
68520
  return isMatchingReference(source.expression, target);
68542
68521
  case 211 /* PropertyAccessExpression */:
68543
68522
  case 212 /* ElementAccessExpression */:
@@ -70507,6 +70486,7 @@ function createTypeChecker(host) {
70507
70486
  return narrowTypeByCallExpression(type, expr, assumeTrue);
70508
70487
  case 217 /* ParenthesizedExpression */:
70509
70488
  case 235 /* NonNullExpression */:
70489
+ case 238 /* SatisfiesExpression */:
70510
70490
  return narrowType(type, expr.expression, assumeTrue);
70511
70491
  case 226 /* BinaryExpression */:
70512
70492
  return narrowTypeByBinaryExpression(type, expr, assumeTrue);
@@ -73144,33 +73124,16 @@ function createTypeChecker(host) {
73144
73124
  const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
73145
73125
  return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
73146
73126
  }
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
73127
  function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
73153
- var _a;
73154
73128
  const propTypes = [];
73155
- let components;
73156
73129
  for (let i = offset; i < properties.length; i++) {
73157
73130
  const prop = properties[i];
73158
73131
  if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
73159
73132
  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
73133
  }
73164
73134
  }
73165
73135
  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
- );
73136
+ return createIndexInfo(keyType, unionType, isReadonly);
73174
73137
  }
73175
73138
  function getImmediateAliasedSymbol(symbol) {
73176
73139
  Debug.assert((symbol.flags & 2097152 /* Alias */) !== 0, "Should only get Alias here.");
@@ -83870,7 +83833,7 @@ function createTypeChecker(host) {
83870
83833
  const typeDeclaration = symbol.valueDeclaration;
83871
83834
  if (typeDeclaration && isClassLike(typeDeclaration)) {
83872
83835
  for (const member of typeDeclaration.members) {
83873
- if ((!isStaticIndex && !isStatic(member) || isStaticIndex && isStatic(member)) && !hasBindableName(member)) {
83836
+ if (!isStatic(member) && !hasBindableName(member)) {
83874
83837
  const symbol2 = getSymbolOfDeclaration(member);
83875
83838
  checkIndexConstraintForProperty(type, symbol2, getTypeOfExpression(member.name.expression), getNonMissingTypeOfSymbol(symbol2));
83876
83839
  }
@@ -87670,35 +87633,6 @@ function createTypeChecker(host) {
87670
87633
  for (const info of infoList) {
87671
87634
  if (info.declaration) continue;
87672
87635
  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
87636
  const node = nodeBuilder.indexInfoToIndexSignatureDeclaration(info, enclosing, flags, internalFlags, tracker);
87703
87637
  if (node && infoList === staticInfos) {
87704
87638
  (node.modifiers || (node.modifiers = factory.createNodeArray())).unshift(factory.createModifier(126 /* StaticKeyword */));
@@ -87709,22 +87643,6 @@ function createTypeChecker(host) {
87709
87643
  }
87710
87644
  }
87711
87645
  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
87646
  }
87729
87647
  };
87730
87648
  function isImportRequiredByAugmentation(node) {
@@ -88969,7 +88887,7 @@ function createTypeChecker(host) {
88969
88887
  }
88970
88888
  }
88971
88889
  function checkGrammarForInvalidDynamicName(node, message) {
88972
- if (isNonBindableDynamicName(node) && !isEntityNameExpression(isElementAccessExpression(node) ? skipParentheses(node.argumentExpression) : node.expression)) {
88890
+ if (isNonBindableDynamicName(node)) {
88973
88891
  return grammarErrorOnNode(node, message);
88974
88892
  }
88975
88893
  }