typescript 5.2.0-dev.20230803 → 5.2.0-dev.20230805

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.
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230803`;
38
+ version = `${versionMajorMinor}.0-dev.20230805`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -4387,15 +4387,13 @@ ${lanes.join("\n")}
4387
4387
  NodeCheckFlags2[NodeCheckFlags2["ContainsCapturedBlockScopeBinding"] = 8192] = "ContainsCapturedBlockScopeBinding";
4388
4388
  NodeCheckFlags2[NodeCheckFlags2["CapturedBlockScopedBinding"] = 16384] = "CapturedBlockScopedBinding";
4389
4389
  NodeCheckFlags2[NodeCheckFlags2["BlockScopedBindingInLoop"] = 32768] = "BlockScopedBindingInLoop";
4390
- NodeCheckFlags2[NodeCheckFlags2["ClassWithBodyScopedClassBinding"] = 65536] = "ClassWithBodyScopedClassBinding";
4391
- NodeCheckFlags2[NodeCheckFlags2["BodyScopedClassBinding"] = 131072] = "BodyScopedClassBinding";
4392
- NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 262144] = "NeedsLoopOutParameter";
4393
- NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 524288] = "AssignmentsMarked";
4394
- NodeCheckFlags2[NodeCheckFlags2["ClassWithConstructorReference"] = 1048576] = "ClassWithConstructorReference";
4395
- NodeCheckFlags2[NodeCheckFlags2["ConstructorReferenceInClass"] = 2097152] = "ConstructorReferenceInClass";
4396
- NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 4194304] = "ContainsClassWithPrivateIdentifiers";
4397
- NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 8388608] = "ContainsSuperPropertyInStaticInitializer";
4398
- NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 16777216] = "InCheckIdentifier";
4390
+ NodeCheckFlags2[NodeCheckFlags2["NeedsLoopOutParameter"] = 65536] = "NeedsLoopOutParameter";
4391
+ NodeCheckFlags2[NodeCheckFlags2["AssignmentsMarked"] = 131072] = "AssignmentsMarked";
4392
+ NodeCheckFlags2[NodeCheckFlags2["ContainsConstructorReference"] = 262144] = "ContainsConstructorReference";
4393
+ NodeCheckFlags2[NodeCheckFlags2["ConstructorReference"] = 536870912] = "ConstructorReference";
4394
+ NodeCheckFlags2[NodeCheckFlags2["ContainsClassWithPrivateIdentifiers"] = 1048576] = "ContainsClassWithPrivateIdentifiers";
4395
+ NodeCheckFlags2[NodeCheckFlags2["ContainsSuperPropertyInStaticInitializer"] = 2097152] = "ContainsSuperPropertyInStaticInitializer";
4396
+ NodeCheckFlags2[NodeCheckFlags2["InCheckIdentifier"] = 4194304] = "InCheckIdentifier";
4399
4397
  return NodeCheckFlags2;
4400
4398
  })(NodeCheckFlags || {});
4401
4399
  TypeFlags = /* @__PURE__ */ ((TypeFlags2) => {
@@ -27672,7 +27670,7 @@ ${lanes.join("\n")}
27672
27670
  initializer
27673
27671
  );
27674
27672
  }
27675
- function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) {
27673
+ function createAccessorPropertyGetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) {
27676
27674
  return factory2.createGetAccessorDeclaration(
27677
27675
  modifiers,
27678
27676
  name,
@@ -27682,7 +27680,7 @@ ${lanes.join("\n")}
27682
27680
  factory2.createBlock([
27683
27681
  factory2.createReturnStatement(
27684
27682
  factory2.createPropertyAccessExpression(
27685
- factory2.createThis(),
27683
+ receiver,
27686
27684
  factory2.getGeneratedPrivateNameForNode(
27687
27685
  node.name,
27688
27686
  /*prefix*/
@@ -27694,7 +27692,7 @@ ${lanes.join("\n")}
27694
27692
  ])
27695
27693
  );
27696
27694
  }
27697
- function createAccessorPropertySetRedirector(factory2, node, modifiers, name) {
27695
+ function createAccessorPropertySetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) {
27698
27696
  return factory2.createSetAccessorDeclaration(
27699
27697
  modifiers,
27700
27698
  name,
@@ -27709,7 +27707,7 @@ ${lanes.join("\n")}
27709
27707
  factory2.createExpressionStatement(
27710
27708
  factory2.createAssignment(
27711
27709
  factory2.createPropertyAccessExpression(
27712
- factory2.createThis(),
27710
+ receiver,
27713
27711
  factory2.getGeneratedPrivateNameForNode(
27714
27712
  node.name,
27715
27713
  /*prefix*/
@@ -46831,7 +46829,7 @@ ${lanes.join("\n")}
46831
46829
  return symbol;
46832
46830
  }
46833
46831
  if (symbol.flags & 2097152 /* Alias */) {
46834
- const targetFlags = getAllSymbolFlags(symbol);
46832
+ const targetFlags = getSymbolFlags(symbol);
46835
46833
  if (targetFlags & meaning) {
46836
46834
  return symbol;
46837
46835
  }
@@ -47591,7 +47589,7 @@ ${lanes.join("\n")}
47591
47589
  /*isUse*/
47592
47590
  false
47593
47591
  ));
47594
- const allFlags = symbol && getAllSymbolFlags(symbol);
47592
+ const allFlags = symbol && getSymbolFlags(symbol);
47595
47593
  if (symbol && allFlags !== void 0 && !(allFlags & 111551 /* Value */)) {
47596
47594
  const rawName = unescapeLeadingUnderscores(name);
47597
47595
  if (isES2015OrLaterConstructorName(name)) {
@@ -48327,11 +48325,23 @@ ${lanes.join("\n")}
48327
48325
  }
48328
48326
  return void 0;
48329
48327
  }
48330
- function getAllSymbolFlags(symbol) {
48331
- let flags = symbol.flags;
48328
+ function getSymbolFlags(symbol, excludeTypeOnlyMeanings, excludeLocalMeanings) {
48329
+ const typeOnlyDeclaration = excludeTypeOnlyMeanings && getTypeOnlyAliasDeclaration(symbol);
48330
+ const typeOnlyDeclarationIsExportStar = typeOnlyDeclaration && isExportDeclaration(typeOnlyDeclaration);
48331
+ const typeOnlyResolution = typeOnlyDeclaration && (typeOnlyDeclarationIsExportStar ? resolveExternalModuleName(
48332
+ typeOnlyDeclaration.moduleSpecifier,
48333
+ typeOnlyDeclaration.moduleSpecifier,
48334
+ /*ignoreErrors*/
48335
+ true
48336
+ ) : resolveAlias(typeOnlyDeclaration.symbol));
48337
+ const typeOnlyExportStarTargets = typeOnlyDeclarationIsExportStar && typeOnlyResolution ? getExportsOfModule(typeOnlyResolution) : void 0;
48338
+ let flags = excludeLocalMeanings ? 0 /* None */ : symbol.flags;
48332
48339
  let seenSymbols;
48333
48340
  while (symbol.flags & 2097152 /* Alias */) {
48334
- const target = resolveAlias(symbol);
48341
+ const target = getExportSymbolOfValueSymbolIfExported(resolveAlias(symbol));
48342
+ if (!typeOnlyDeclarationIsExportStar && target === typeOnlyResolution || (typeOnlyExportStarTargets == null ? void 0 : typeOnlyExportStarTargets.get(target.escapedName)) === target) {
48343
+ break;
48344
+ }
48335
48345
  if (target === unknownSymbol) {
48336
48346
  return 67108863 /* All */;
48337
48347
  }
@@ -48389,7 +48399,7 @@ ${lanes.join("\n")}
48389
48399
  }
48390
48400
  if (links.typeOnlyDeclaration) {
48391
48401
  const resolved = links.typeOnlyDeclaration.kind === 278 /* ExportDeclaration */ ? resolveSymbol(getExportsOfModule(links.typeOnlyDeclaration.symbol.parent).get(links.typeOnlyExportStarName || symbol.escapedName)) : resolveAlias(links.typeOnlyDeclaration.symbol);
48392
- return getAllSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
48402
+ return getSymbolFlags(resolved) & include ? links.typeOnlyDeclaration : void 0;
48393
48403
  }
48394
48404
  return void 0;
48395
48405
  }
@@ -48400,7 +48410,11 @@ ${lanes.join("\n")}
48400
48410
  const symbol = getSymbolOfDeclaration(node);
48401
48411
  const target = resolveAlias(symbol);
48402
48412
  if (target) {
48403
- const markAlias = target === unknownSymbol || getAllSymbolFlags(target) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
48413
+ const markAlias = target === unknownSymbol || getSymbolFlags(
48414
+ symbol,
48415
+ /*excludeTypeOnlyMeanings*/
48416
+ true
48417
+ ) & 111551 /* Value */ && !isConstEnumOrConstEnumOnlyModule(target);
48404
48418
  if (markAlias) {
48405
48419
  markAliasSymbolAsReferenced(symbol);
48406
48420
  }
@@ -48415,7 +48429,7 @@ ${lanes.join("\n")}
48415
48429
  if (!node)
48416
48430
  return Debug.fail();
48417
48431
  if (isInternalModuleImportEqualsDeclaration(node)) {
48418
- if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) {
48432
+ if (getSymbolFlags(resolveSymbol(symbol)) & 111551 /* Value */) {
48419
48433
  checkExpressionCached(node.moduleReference);
48420
48434
  }
48421
48435
  }
@@ -49266,7 +49280,7 @@ ${lanes.join("\n")}
49266
49280
  return getMergedSymbol(symbol && (symbol.flags & 1048576 /* ExportValue */) !== 0 && symbol.exportSymbol || symbol);
49267
49281
  }
49268
49282
  function symbolIsValue(symbol, includeTypeOnlyMembers) {
49269
- return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getAllSymbolFlags(symbol) & 111551 /* Value */ && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
49283
+ return !!(symbol.flags & 111551 /* Value */ || symbol.flags & 2097152 /* Alias */ && getSymbolFlags(symbol, !includeTypeOnlyMembers) & 111551 /* Value */);
49270
49284
  }
49271
49285
  function findConstructorDeclaration(node) {
49272
49286
  const members = node.members;
@@ -49533,7 +49547,7 @@ ${lanes.join("\n")}
49533
49547
  }
49534
49548
  const shouldResolveAlias = symbolFromSymbolTable.flags & 2097152 /* Alias */ && !getDeclarationOfKind(symbolFromSymbolTable, 281 /* ExportSpecifier */);
49535
49549
  symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
49536
- const flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
49550
+ const flags = shouldResolveAlias ? getSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
49537
49551
  if (flags & meaning) {
49538
49552
  qualify = true;
49539
49553
  return true;
@@ -52395,7 +52409,7 @@ ${lanes.join("\n")}
52395
52409
  return !exports ? [] : filter(arrayFrom(exports.values()), (m) => isNamespaceMember(m) && isIdentifierText(m.escapedName, 99 /* ESNext */));
52396
52410
  }
52397
52411
  function isTypeOnlyNamespace(symbol) {
52398
- return every(getNamespaceMembersForSerialization(symbol), (m) => !(getAllSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
52412
+ return every(getNamespaceMembersForSerialization(symbol), (m) => !(getSymbolFlags(resolveSymbol(m)) & 111551 /* Value */));
52399
52413
  }
52400
52414
  function serializeModule(symbol, symbolName2, modifierFlags) {
52401
52415
  const members = getNamespaceMembersForSerialization(symbol);
@@ -54667,7 +54681,7 @@ ${lanes.join("\n")}
54667
54681
  true
54668
54682
  );
54669
54683
  const declaredType = firstDefined(exportSymbol == null ? void 0 : exportSymbol.declarations, (d) => isExportAssignment(d) ? tryGetTypeFromEffectiveTypeNode(d) : void 0);
54670
- links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getAllSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
54684
+ links.type = (exportSymbol == null ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol) : isDuplicatedCommonJSExport(symbol.declarations) ? autoType : declaredType ? declaredType : getSymbolFlags(targetSymbol) & 111551 /* Value */ ? getTypeOfSymbol(targetSymbol) : errorType;
54671
54685
  }
54672
54686
  return links.type;
54673
54687
  }
@@ -62277,6 +62291,7 @@ ${lanes.join("\n")}
62277
62291
  let errorInfo;
62278
62292
  let relatedInfo;
62279
62293
  let maybeKeys;
62294
+ let maybeKeysSet;
62280
62295
  let sourceStack;
62281
62296
  let targetStack;
62282
62297
  let maybeCount = 0;
@@ -63146,9 +63161,13 @@ ${lanes.join("\n")}
63146
63161
  }
63147
63162
  if (!maybeKeys) {
63148
63163
  maybeKeys = [];
63164
+ maybeKeysSet = /* @__PURE__ */ new Set();
63149
63165
  sourceStack = [];
63150
63166
  targetStack = [];
63151
63167
  } else {
63168
+ if (maybeKeysSet.has(id)) {
63169
+ return 3 /* Maybe */;
63170
+ }
63152
63171
  const broadestEquivalentId = id.startsWith("*") ? getRelationKey(
63153
63172
  source2,
63154
63173
  target2,
@@ -63157,10 +63176,8 @@ ${lanes.join("\n")}
63157
63176
  /*ignoreConstraints*/
63158
63177
  true
63159
63178
  ) : void 0;
63160
- for (let i = 0; i < maybeCount; i++) {
63161
- if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
63162
- return 3 /* Maybe */;
63163
- }
63179
+ if (broadestEquivalentId && maybeKeysSet.has(broadestEquivalentId)) {
63180
+ return 3 /* Maybe */;
63164
63181
  }
63165
63182
  if (sourceDepth === 100 || targetDepth === 100) {
63166
63183
  overflow = true;
@@ -63169,6 +63186,7 @@ ${lanes.join("\n")}
63169
63186
  }
63170
63187
  const maybeStart = maybeCount;
63171
63188
  maybeKeys[maybeCount] = id;
63189
+ maybeKeysSet.add(id);
63172
63190
  maybeCount++;
63173
63191
  const saveExpandingFlags = expandingFlags;
63174
63192
  if (recursionFlags & 1 /* Source */) {
@@ -63221,17 +63239,34 @@ ${lanes.join("\n")}
63221
63239
  if (result2) {
63222
63240
  if (result2 === -1 /* True */ || sourceDepth === 0 && targetDepth === 0) {
63223
63241
  if (result2 === -1 /* True */ || result2 === 3 /* Maybe */) {
63224
- for (let i = maybeStart; i < maybeCount; i++) {
63225
- relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
63226
- }
63242
+ resetMaybeStack(
63243
+ /*markAllAsSucceeded*/
63244
+ true
63245
+ );
63246
+ } else {
63247
+ resetMaybeStack(
63248
+ /*markAllAsSucceeded*/
63249
+ false
63250
+ );
63227
63251
  }
63228
- maybeCount = maybeStart;
63229
63252
  }
63230
63253
  } else {
63231
63254
  relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
63232
- maybeCount = maybeStart;
63255
+ resetMaybeStack(
63256
+ /*markAllAsSucceeded*/
63257
+ false
63258
+ );
63233
63259
  }
63234
63260
  return result2;
63261
+ function resetMaybeStack(markAllAsSucceeded) {
63262
+ for (let i = maybeStart; i < maybeCount; i++) {
63263
+ maybeKeysSet.delete(maybeKeys[i]);
63264
+ if (markAllAsSucceeded) {
63265
+ relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
63266
+ }
63267
+ }
63268
+ maybeCount = maybeStart;
63269
+ }
63235
63270
  }
63236
63271
  function structuredTypeRelatedTo(source2, target2, reportErrors2, intersectionState) {
63237
63272
  const saveErrorInfo = captureErrorCalculationState();
@@ -68584,8 +68619,8 @@ ${lanes.join("\n")}
68584
68619
  }
68585
68620
  const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
68586
68621
  const links = getNodeLinks(parent2);
68587
- if (!(links.flags & 524288 /* AssignmentsMarked */)) {
68588
- links.flags |= 524288 /* AssignmentsMarked */;
68622
+ if (!(links.flags & 131072 /* AssignmentsMarked */)) {
68623
+ links.flags |= 131072 /* AssignmentsMarked */;
68589
68624
  if (!hasParentWithAssignmentsMarked(parent2)) {
68590
68625
  markNodeAssignments(parent2);
68591
68626
  }
@@ -68593,7 +68628,7 @@ ${lanes.join("\n")}
68593
68628
  return symbol.isAssigned || false;
68594
68629
  }
68595
68630
  function hasParentWithAssignmentsMarked(node) {
68596
- return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 524288 /* AssignmentsMarked */));
68631
+ return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
68597
68632
  }
68598
68633
  function markNodeAssignments(node) {
68599
68634
  if (node.kind === 80 /* Identifier */) {
@@ -68675,9 +68710,13 @@ ${lanes.join("\n")}
68675
68710
  symbol,
68676
68711
  /*excludes*/
68677
68712
  111551 /* Value */
68678
- ) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */)) {
68713
+ ) && !isInTypeQuery(location)) {
68679
68714
  const target = resolveAlias(symbol);
68680
- if (getAllSymbolFlags(target) & (111551 /* Value */ | 1048576 /* ExportValue */)) {
68715
+ if (getSymbolFlags(
68716
+ symbol,
68717
+ /*excludeTypeOnlyMeanings*/
68718
+ true
68719
+ ) & (111551 /* Value */ | 1048576 /* ExportValue */)) {
68681
68720
  if (getIsolatedModules(compilerOptions) || shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) || !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) {
68682
68721
  markAliasSymbolAsReferenced(symbol);
68683
68722
  } else {
@@ -68695,11 +68734,11 @@ ${lanes.join("\n")}
68695
68734
  const parent2 = declaration.parent.parent;
68696
68735
  if (parent2.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || parent2.kind === 169 /* Parameter */) {
68697
68736
  const links = getNodeLinks(parent2);
68698
- if (!(links.flags & 16777216 /* InCheckIdentifier */)) {
68699
- links.flags |= 16777216 /* InCheckIdentifier */;
68737
+ if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
68738
+ links.flags |= 4194304 /* InCheckIdentifier */;
68700
68739
  const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
68701
68740
  const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
68702
- links.flags &= ~16777216 /* InCheckIdentifier */;
68741
+ links.flags &= ~4194304 /* InCheckIdentifier */;
68703
68742
  if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
68704
68743
  const pattern = declaration.parent;
68705
68744
  const narrowedType = getFlowTypeOfReference(
@@ -68776,17 +68815,7 @@ ${lanes.join("\n")}
68776
68815
  }
68777
68816
  let declaration = localOrExportSymbol.valueDeclaration;
68778
68817
  if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
68779
- if (declaration.kind === 263 /* ClassDeclaration */ && nodeIsDecorated(legacyDecorators, declaration)) {
68780
- let container = getContainingClass(node);
68781
- while (container !== void 0) {
68782
- if (container === declaration && container.name !== node) {
68783
- getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
68784
- getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
68785
- break;
68786
- }
68787
- container = getContainingClass(container);
68788
- }
68789
- } else if (declaration.kind === 231 /* ClassExpression */) {
68818
+ if (isClassLike(declaration) && declaration.name !== node) {
68790
68819
  let container = getThisContainer(
68791
68820
  node,
68792
68821
  /*includeArrowFunctions*/
@@ -68794,14 +68823,7 @@ ${lanes.join("\n")}
68794
68823
  /*includeClassComputedPropertyName*/
68795
68824
  false
68796
68825
  );
68797
- while (container.kind !== 312 /* SourceFile */) {
68798
- if (container.parent === declaration) {
68799
- if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
68800
- getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
68801
- getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
68802
- }
68803
- break;
68804
- }
68826
+ while (container.kind !== 312 /* SourceFile */ && container.parent !== declaration) {
68805
68827
  container = getThisContainer(
68806
68828
  container,
68807
68829
  /*includeArrowFunctions*/
@@ -68810,6 +68832,11 @@ ${lanes.join("\n")}
68810
68832
  false
68811
68833
  );
68812
68834
  }
68835
+ if (container.kind !== 312 /* SourceFile */) {
68836
+ getNodeLinks(declaration).flags |= 262144 /* ContainsConstructorReference */;
68837
+ getNodeLinks(container).flags |= 262144 /* ContainsConstructorReference */;
68838
+ getNodeLinks(node).flags |= 536870912 /* ConstructorReference */;
68839
+ }
68813
68840
  }
68814
68841
  }
68815
68842
  checkNestedBlockScopedBinding(node, symbol);
@@ -68940,7 +68967,7 @@ ${lanes.join("\n")}
68940
68967
  if (isForStatement(container)) {
68941
68968
  const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */);
68942
68969
  if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
68943
- getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */;
68970
+ getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */;
68944
68971
  }
68945
68972
  }
68946
68973
  getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
@@ -69218,7 +69245,7 @@ ${lanes.join("\n")}
69218
69245
  if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
69219
69246
  forEachEnclosingBlockScopeContainer(node.parent, (current) => {
69220
69247
  if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
69221
- getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */;
69248
+ getNodeLinks(current).flags |= 2097152 /* ContainsSuperPropertyInStaticInitializer */;
69222
69249
  }
69223
69250
  });
69224
69251
  }
@@ -72760,7 +72787,7 @@ ${lanes.join("\n")}
72760
72787
  }
72761
72788
  }
72762
72789
  function getThisArgumentOfCall(node) {
72763
- const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : void 0;
72790
+ const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : node.kind === 170 /* Decorator */ && !legacyDecorators ? node.expression : void 0;
72764
72791
  if (expression) {
72765
72792
  const callee = skipOuterExpressions(expression);
72766
72793
  if (isAccessExpression(callee)) {
@@ -77667,7 +77694,7 @@ ${lanes.join("\n")}
77667
77694
  function setNodeLinksForPrivateIdentifierScope(node) {
77668
77695
  if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
77669
77696
  for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
77670
- getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */;
77697
+ getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
77671
77698
  }
77672
77699
  if (isClassExpression(node.parent)) {
77673
77700
  const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
@@ -79420,7 +79447,7 @@ ${lanes.join("\n")}
79420
79447
  }
79421
79448
  function checkWeakMapSetCollision(node) {
79422
79449
  const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
79423
- if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) {
79450
+ if (getNodeCheckFlags(enclosingBlockScope) & 1048576 /* ContainsClassWithPrivateIdentifiers */) {
79424
79451
  Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
79425
79452
  errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
79426
79453
  }
@@ -79434,18 +79461,18 @@ ${lanes.join("\n")}
79434
79461
  let hasCollision = false;
79435
79462
  if (isClassExpression(node)) {
79436
79463
  for (const member of node.members) {
79437
- if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
79464
+ if (getNodeCheckFlags(member) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
79438
79465
  hasCollision = true;
79439
79466
  break;
79440
79467
  }
79441
79468
  }
79442
79469
  } else if (isFunctionExpression(node)) {
79443
- if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
79470
+ if (getNodeCheckFlags(node) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
79444
79471
  hasCollision = true;
79445
79472
  }
79446
79473
  } else {
79447
79474
  const container = getEnclosingBlockScopeContainer(node);
79448
- if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
79475
+ if (container && getNodeCheckFlags(container) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
79449
79476
  hasCollision = true;
79450
79477
  }
79451
79478
  }
@@ -79480,9 +79507,6 @@ ${lanes.join("\n")}
79480
79507
  if ((getCombinedNodeFlagsCached(node) & 7 /* BlockScoped */) !== 0 || isParameterDeclaration(node)) {
79481
79508
  return;
79482
79509
  }
79483
- if (node.kind === 260 /* VariableDeclaration */ && !node.initializer) {
79484
- return;
79485
- }
79486
79510
  const symbol = getSymbolOfDeclaration(node);
79487
79511
  if (symbol.flags & 1 /* FunctionScopedVariable */) {
79488
79512
  if (!isIdentifier(node.name))
@@ -82104,7 +82128,7 @@ ${lanes.join("\n")}
82104
82128
  }
82105
82129
  return;
82106
82130
  }
82107
- const targetFlags = getAllSymbolFlags(target);
82131
+ const targetFlags = getSymbolFlags(target);
82108
82132
  const excludedMeanings = (symbol.flags & (111551 /* Value */ | 1048576 /* ExportValue */) ? 111551 /* Value */ : 0) | (symbol.flags & 788968 /* Type */ ? 788968 /* Type */ : 0) | (symbol.flags & 1920 /* Namespace */ ? 1920 /* Namespace */ : 0);
82109
82133
  if (targetFlags & excludedMeanings) {
82110
82134
  const message = node.kind === 281 /* ExportSpecifier */ ? Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 : Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
@@ -82262,7 +82286,7 @@ ${lanes.join("\n")}
82262
82286
  if (node.moduleReference.kind !== 283 /* ExternalModuleReference */) {
82263
82287
  const target = resolveAlias(getSymbolOfDeclaration(node));
82264
82288
  if (target !== unknownSymbol) {
82265
- const targetFlags = getAllSymbolFlags(target);
82289
+ const targetFlags = getSymbolFlags(target);
82266
82290
  if (targetFlags & 111551 /* Value */) {
82267
82291
  const moduleName = getFirstIdentifier(node.moduleReference);
82268
82292
  if (!(resolveEntityName(moduleName, 111551 /* Value */ | 1920 /* Namespace */).flags & 1920 /* Namespace */)) {
@@ -82402,7 +82426,7 @@ ${lanes.join("\n")}
82402
82426
  markExportAsReferenced(node);
82403
82427
  }
82404
82428
  const target = symbol && (symbol.flags & 2097152 /* Alias */ ? resolveAlias(symbol) : symbol);
82405
- if (!target || getAllSymbolFlags(target) & 111551 /* Value */) {
82429
+ if (!target || getSymbolFlags(target) & 111551 /* Value */) {
82406
82430
  checkExpressionCached(node.propertyName || node.name);
82407
82431
  }
82408
82432
  }
@@ -82447,7 +82471,7 @@ ${lanes.join("\n")}
82447
82471
  ));
82448
82472
  if (sym) {
82449
82473
  markAliasReferenced(sym, id);
82450
- if (getAllSymbolFlags(sym) & 111551 /* Value */) {
82474
+ if (getSymbolFlags(sym) & 111551 /* Value */) {
82451
82475
  checkExpressionCached(id);
82452
82476
  if (!isIllegalExportDefaultInCJS && !(node.flags & 33554432 /* Ambient */) && compilerOptions.verbatimModuleSyntax && getTypeOnlyAliasDeclaration(sym, 111551 /* Value */)) {
82453
82477
  error2(
@@ -83694,7 +83718,7 @@ ${lanes.join("\n")}
83694
83718
  return symbolLinks2.exportsSomeValue;
83695
83719
  function isValue(s) {
83696
83720
  s = resolveSymbol(s);
83697
- return s && !!(getAllSymbolFlags(s) & 111551 /* Value */);
83721
+ return s && !!(getSymbolFlags(s) & 111551 /* Value */);
83698
83722
  }
83699
83723
  }
83700
83724
  function isNameOfModuleOrEnumDeclaration(node) {
@@ -83824,7 +83848,11 @@ ${lanes.join("\n")}
83824
83848
  case 276 /* ImportSpecifier */:
83825
83849
  case 281 /* ExportSpecifier */:
83826
83850
  const symbol = getSymbolOfDeclaration(node);
83827
- return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551 /* Value */);
83851
+ return !!symbol && isAliasResolvedToValue(
83852
+ symbol,
83853
+ /*excludeTypeOnlyValues*/
83854
+ true
83855
+ );
83828
83856
  case 278 /* ExportDeclaration */:
83829
83857
  const exportClause = node.exportClause;
83830
83858
  return !!exportClause && (isNamespaceExport(exportClause) || some(exportClause.elements, isValueAliasDeclaration));
@@ -83841,7 +83869,7 @@ ${lanes.join("\n")}
83841
83869
  const isValue = isAliasResolvedToValue(getSymbolOfDeclaration(node));
83842
83870
  return isValue && node.moduleReference && !nodeIsMissing(node.moduleReference);
83843
83871
  }
83844
- function isAliasResolvedToValue(symbol) {
83872
+ function isAliasResolvedToValue(symbol, excludeTypeOnlyValues) {
83845
83873
  if (!symbol) {
83846
83874
  return false;
83847
83875
  }
@@ -83849,7 +83877,12 @@ ${lanes.join("\n")}
83849
83877
  if (target === unknownSymbol) {
83850
83878
  return true;
83851
83879
  }
83852
- return !!((getAllSymbolFlags(target) ?? -1) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
83880
+ return !!(getSymbolFlags(
83881
+ symbol,
83882
+ excludeTypeOnlyValues,
83883
+ /*excludeLocalMeanings*/
83884
+ true
83885
+ ) & 111551 /* Value */) && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
83853
83886
  }
83854
83887
  function isConstEnumOrConstEnumOnlyModule(s) {
83855
83888
  return isConstEnumSymbol(s) || !!s.constEnumOnlyModule;
@@ -83863,7 +83896,7 @@ ${lanes.join("\n")}
83863
83896
  return true;
83864
83897
  }
83865
83898
  const target = getSymbolLinks(symbol).aliasTarget;
83866
- if (target && getEffectiveModifierFlags(node) & 1 /* Export */ && getAllSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
83899
+ if (target && getEffectiveModifierFlags(node) & 1 /* Export */ && getSymbolFlags(target) & 111551 /* Value */ && (shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
83867
83900
  return true;
83868
83901
  }
83869
83902
  }
@@ -91918,6 +91951,11 @@ ${lanes.join("\n")}
91918
91951
  }
91919
91952
  }
91920
91953
  }
91954
+ function getClassThis() {
91955
+ const lex = getClassLexicalEnvironment();
91956
+ const classThis = lex.classThis ?? lex.classConstructor ?? (currentClassContainer == null ? void 0 : currentClassContainer.name);
91957
+ return Debug.checkDefined(classThis);
91958
+ }
91921
91959
  function transformAutoAccessor(node) {
91922
91960
  const commentRange = getCommentRange(node);
91923
91961
  const sourceMapRange = getSourceMapRange(node);
@@ -91944,11 +91982,13 @@ ${lanes.join("\n")}
91944
91982
  setOriginalNode(backingField, node);
91945
91983
  setEmitFlags(backingField, 3072 /* NoComments */);
91946
91984
  setSourceMapRange(backingField, sourceMapRange);
91947
- const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName);
91985
+ const receiver = isStatic(node) ? getClassThis() : factory2.createThis();
91986
+ const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName, receiver);
91948
91987
  setOriginalNode(getter, node);
91949
91988
  setCommentRange(getter, commentRange);
91950
91989
  setSourceMapRange(getter, sourceMapRange);
91951
- const setter = createAccessorPropertySetRedirector(factory2, node, modifiers, setterName);
91990
+ const setterModifiers = factory2.createModifiersFromModifierFlags(modifiersToFlags(modifiers));
91991
+ const setter = createAccessorPropertySetRedirector(factory2, node, setterModifiers, setterName, receiver);
91952
91992
  setOriginalNode(setter, node);
91953
91993
  setEmitFlags(setter, 3072 /* NoComments */);
91954
91994
  setSourceMapRange(setter, sourceMapRange);
@@ -92505,6 +92545,7 @@ ${lanes.join("\n")}
92505
92545
  return filter(node.members, isNonStaticMethodOrAccessorWithPrivateName);
92506
92546
  }
92507
92547
  function getClassFacts(node) {
92548
+ var _a;
92508
92549
  let facts = 0 /* None */;
92509
92550
  const original = getOriginalNode(node);
92510
92551
  if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) {
@@ -92521,6 +92562,8 @@ ${lanes.join("\n")}
92521
92562
  if (isStatic(member)) {
92522
92563
  if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) {
92523
92564
  facts |= 2 /* NeedsClassConstructorReference */;
92565
+ } else if (isAutoAccessorPropertyDeclaration(member) && shouldTransformAutoAccessors === -1 /* True */ && !node.name && !((_a = node.emitNode) == null ? void 0 : _a.classThis)) {
92566
+ facts |= 2 /* NeedsClassConstructorReference */;
92524
92567
  }
92525
92568
  if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) {
92526
92569
  if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) {
@@ -92541,6 +92584,9 @@ ${lanes.join("\n")}
92541
92584
  containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
92542
92585
  } else if (isPrivateIdentifierClassElementDeclaration(member)) {
92543
92586
  containsInstancePrivateElements = true;
92587
+ if (resolver.getNodeCheckFlags(member) & 262144 /* ContainsConstructorReference */) {
92588
+ facts |= 2 /* NeedsClassConstructorReference */;
92589
+ }
92544
92590
  } else if (isPropertyDeclaration(member)) {
92545
92591
  containsPublicInstanceFields = true;
92546
92592
  containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer);
@@ -92641,10 +92687,11 @@ ${lanes.join("\n")}
92641
92687
  getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp);
92642
92688
  pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node));
92643
92689
  }
92644
- if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
92645
- getClassLexicalEnvironment().classThis = node.emitNode.classThis;
92646
- }
92647
92690
  }
92691
+ if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
92692
+ getClassLexicalEnvironment().classThis = node.emitNode.classThis;
92693
+ }
92694
+ const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
92648
92695
  const isExport = hasSyntacticModifier(node, 1 /* Export */);
92649
92696
  const isDefault = hasSyntacticModifier(node, 1024 /* Default */);
92650
92697
  let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
@@ -92679,6 +92726,11 @@ ${lanes.join("\n")}
92679
92726
  )
92680
92727
  ));
92681
92728
  }
92729
+ const alias = getClassLexicalEnvironment().classConstructor;
92730
+ if (isClassWithConstructorReference && alias) {
92731
+ enableSubstitutionForClassAliases();
92732
+ classAliases[getOriginalNodeId(node)] = alias;
92733
+ }
92682
92734
  const classDecl = factory2.updateClassDeclaration(
92683
92735
  node,
92684
92736
  modifiers,
@@ -92701,14 +92753,14 @@ ${lanes.join("\n")}
92701
92753
  var _a, _b, _c;
92702
92754
  const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
92703
92755
  const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
92704
- const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */;
92756
+ const classCheckFlags = resolver.getNodeCheckFlags(node);
92757
+ const isClassWithConstructorReference = classCheckFlags & 262144 /* ContainsConstructorReference */;
92705
92758
  let temp;
92706
92759
  function createClassTempVar() {
92707
92760
  var _a2;
92708
92761
  if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) {
92709
92762
  return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
92710
92763
  }
92711
- const classCheckFlags = resolver.getNodeCheckFlags(node);
92712
92764
  const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
92713
92765
  const temp2 = factory2.createTempVariable(
92714
92766
  requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
@@ -93675,7 +93727,7 @@ ${lanes.join("\n")}
93675
93727
  }
93676
93728
  function trySubstituteClassAlias(node) {
93677
93729
  if (enabledSubstitutions & 1 /* ClassAliases */) {
93678
- if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
93730
+ if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
93679
93731
  const declaration = resolver.getReferencedValueDeclaration(node);
93680
93732
  if (declaration) {
93681
93733
  const classAlias = classAliases[declaration.id];
@@ -94541,7 +94593,7 @@ ${lanes.join("\n")}
94541
94593
  }
94542
94594
  }
94543
94595
  function getClassAliasIfNeeded(node) {
94544
- if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) {
94596
+ if (resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */) {
94545
94597
  enableSubstitutionForClassAliases();
94546
94598
  const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
94547
94599
  classAliases[getOriginalNodeId(node)] = classAlias;
@@ -94574,7 +94626,7 @@ ${lanes.join("\n")}
94574
94626
  }
94575
94627
  function trySubstituteClassAlias(node) {
94576
94628
  if (classAliases) {
94577
- if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
94629
+ if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
94578
94630
  const declaration = resolver.getReferencedValueDeclaration(node);
94579
94631
  if (declaration) {
94580
94632
  const classAlias = classAliases[declaration.id];
@@ -94606,6 +94658,7 @@ ${lanes.join("\n")}
94606
94658
  endLexicalEnvironment,
94607
94659
  hoistVariableDeclaration
94608
94660
  } = context;
94661
+ const languageVersion = getEmitScriptTarget(context.getCompilerOptions());
94609
94662
  let top;
94610
94663
  let classInfo;
94611
94664
  let classThis;
@@ -96107,6 +96160,17 @@ ${lanes.join("\n")}
96107
96160
  function transformDecorator(decorator) {
96108
96161
  const expression = visitNode(decorator.expression, visitor, isExpression);
96109
96162
  setEmitFlags(expression, 3072 /* NoComments */);
96163
+ const innerExpression = skipOuterExpressions(expression);
96164
+ if (isAccessExpression(innerExpression)) {
96165
+ const { target, thisArg } = factory2.createCallBinding(
96166
+ expression,
96167
+ hoistVariableDeclaration,
96168
+ languageVersion,
96169
+ /*cacheIdentifiers*/
96170
+ true
96171
+ );
96172
+ return factory2.restoreOuterExpressions(expression, factory2.createFunctionBindCall(target, thisArg, []));
96173
+ }
96110
96174
  return expression;
96111
96175
  }
96112
96176
  function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) {
@@ -102805,10 +102869,10 @@ ${lanes.join("\n")}
102805
102869
  name
102806
102870
  ));
102807
102871
  const checkFlags = resolver.getNodeCheckFlags(decl);
102808
- if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
102872
+ if (checkFlags & 65536 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
102809
102873
  const outParamName = factory2.createUniqueName("out_" + idText(name));
102810
102874
  let flags = 0 /* None */;
102811
- if (checkFlags & 262144 /* NeedsLoopOutParameter */) {
102875
+ if (checkFlags & 65536 /* NeedsLoopOutParameter */) {
102812
102876
  flags |= 1 /* Body */;
102813
102877
  }
102814
102878
  if (isForStatement(container)) {
@@ -137356,25 +137420,25 @@ ${lanes.join("\n")}
137356
137420
  const { file } = context;
137357
137421
  const range = createTextRangeFromSpan(getRefactorContextSpan(context));
137358
137422
  const { statements } = file;
137359
- const startNodeIndex = findIndex(statements, (s) => s.end > range.pos);
137423
+ let startNodeIndex = findIndex(statements, (s) => s.end > range.pos);
137360
137424
  if (startNodeIndex === -1)
137361
137425
  return void 0;
137362
137426
  const startStatement = statements[startNodeIndex];
137363
- if (isNamedDeclaration(startStatement) && startStatement.name && rangeContainsRange(startStatement.name, range)) {
137364
- return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };
137365
- }
137366
137427
  const overloadRangeToMove = getOverloadRangeToMove(file, startStatement);
137367
137428
  if (overloadRangeToMove) {
137368
- return overloadRangeToMove;
137429
+ startNodeIndex = overloadRangeToMove.start;
137430
+ }
137431
+ let endNodeIndex = findIndex(statements, (s) => s.end >= range.end, startNodeIndex);
137432
+ if (endNodeIndex !== -1 && range.end <= statements[endNodeIndex].getStart()) {
137433
+ endNodeIndex--;
137434
+ }
137435
+ const endingOverloadRangeToMove = getOverloadRangeToMove(file, statements[endNodeIndex]);
137436
+ if (endingOverloadRangeToMove) {
137437
+ endNodeIndex = endingOverloadRangeToMove.end;
137369
137438
  }
137370
- if (range.pos > startStatement.getStart(file))
137371
- return void 0;
137372
- const afterEndNodeIndex = findIndex(statements, (s) => s.end > range.end, startNodeIndex);
137373
- if (afterEndNodeIndex !== -1 && (afterEndNodeIndex === 0 || statements[afterEndNodeIndex].getStart(file) < range.end))
137374
- return void 0;
137375
137439
  return {
137376
- toMove: statements.slice(startNodeIndex, afterEndNodeIndex === -1 ? statements.length : afterEndNodeIndex),
137377
- afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex]
137440
+ toMove: statements.slice(startNodeIndex, endNodeIndex === -1 ? statements.length : endNodeIndex + 1),
137441
+ afterLast: endNodeIndex === -1 ? void 0 : statements[endNodeIndex + 1]
137378
137442
  };
137379
137443
  }
137380
137444
  function getStatementsToMove(context) {
@@ -137629,10 +137693,12 @@ ${lanes.join("\n")}
137629
137693
  if (declarations === void 0 || length(declarations) <= 1 || !contains(declarations, statement)) {
137630
137694
  return void 0;
137631
137695
  }
137696
+ const firstDecl = declarations[0];
137632
137697
  const lastDecl = declarations[length(declarations) - 1];
137633
137698
  const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0);
137634
- const end = findLastIndex(sourceFile.statements, (s) => s.end > lastDecl.end);
137635
- return { toMove: statementsToMove, afterLast: end >= 0 ? sourceFile.statements[end] : void 0 };
137699
+ const end = findIndex(sourceFile.statements, (s) => s.end >= lastDecl.end);
137700
+ const start = findIndex(sourceFile.statements, (s) => s.end >= firstDecl.end);
137701
+ return { toMove: statementsToMove, start, end };
137636
137702
  }
137637
137703
  return void 0;
137638
137704
  }
@@ -137679,7 +137745,7 @@ ${lanes.join("\n")}
137679
137745
  if (host.fileExists(targetFile) && program.getSourceFile(targetFile) === void 0) {
137680
137746
  return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_statements_to_the_selected_file));
137681
137747
  }
137682
- const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, program, statements, t, context.host, context.preferences));
137748
+ const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
137683
137749
  return { edits, renameFilename: void 0, renameLocation: void 0 };
137684
137750
  }
137685
137751
  return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid));
@@ -159650,6 +159716,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
159650
159716
  return cls;
159651
159717
  }
159652
159718
  break;
159719
+ case 81 /* PrivateIdentifier */:
159720
+ if (tryCast(location.parent, isPropertyDeclaration)) {
159721
+ return findAncestor(location, isClassLike);
159722
+ }
159723
+ break;
159653
159724
  case 80 /* Identifier */: {
159654
159725
  const originalKeywordKind = identifierToKeywordKind(location);
159655
159726
  if (originalKeywordKind) {
@@ -164039,8 +164110,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164039
164110
  }
164040
164111
  function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile) {
164041
164112
  let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
164113
+ let displayParts;
164042
164114
  if (shouldUseInteractiveInlayHints(preferences)) {
164043
- hintText = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
164115
+ displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
164116
+ hintText = "";
164044
164117
  } else {
164045
164118
  hintText += ":";
164046
164119
  }
@@ -164048,7 +164121,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164048
164121
  text: hintText,
164049
164122
  position,
164050
164123
  kind: "Parameter" /* Parameter */,
164051
- whitespaceAfter: true
164124
+ whitespaceAfter: true,
164125
+ displayParts
164052
164126
  });
164053
164127
  }
164054
164128
  function addTypeHints(text, position) {
@@ -180995,19 +181069,18 @@ Project '${project.projectName}' (${ProjectKind[project.projectKind]}) ${counter
180995
181069
  const scriptInfo = this.projectService.getScriptInfoForNormalizedPath(file);
180996
181070
  const hints = project.getLanguageService().provideInlayHints(file, args, this.getPreferences(file));
180997
181071
  return hints.map((hint) => {
180998
- const { text, position } = hint;
180999
- const hintText = typeof text === "string" ? text : text.map(({ text: text2, span, file: file2 }) => ({
181000
- text: text2,
181001
- span: span && {
181002
- start: scriptInfo.positionToLineOffset(span.start),
181003
- end: scriptInfo.positionToLineOffset(span.start + span.length),
181004
- file: file2
181005
- }
181006
- }));
181072
+ const { position, displayParts } = hint;
181007
181073
  return {
181008
181074
  ...hint,
181009
181075
  position: scriptInfo.positionToLineOffset(position),
181010
- text: hintText
181076
+ displayParts: displayParts == null ? void 0 : displayParts.map(({ text, span, file: file2 }) => ({
181077
+ text,
181078
+ span: span && {
181079
+ start: scriptInfo.positionToLineOffset(span.start),
181080
+ end: scriptInfo.positionToLineOffset(span.start + span.length),
181081
+ file: file2
181082
+ }
181083
+ }))
181011
181084
  };
181012
181085
  });
181013
181086
  }