typescript 5.2.0-dev.20230804 → 5.2.0-dev.20230806

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/typescript.js CHANGED
@@ -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.20230804`;
38
+ version = `${versionMajorMinor}.0-dev.20230806`;
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*/
@@ -68621,8 +68619,8 @@ ${lanes.join("\n")}
68621
68619
  }
68622
68620
  const parent2 = getRootDeclaration(symbol.valueDeclaration).parent;
68623
68621
  const links = getNodeLinks(parent2);
68624
- if (!(links.flags & 524288 /* AssignmentsMarked */)) {
68625
- links.flags |= 524288 /* AssignmentsMarked */;
68622
+ if (!(links.flags & 131072 /* AssignmentsMarked */)) {
68623
+ links.flags |= 131072 /* AssignmentsMarked */;
68626
68624
  if (!hasParentWithAssignmentsMarked(parent2)) {
68627
68625
  markNodeAssignments(parent2);
68628
68626
  }
@@ -68630,7 +68628,7 @@ ${lanes.join("\n")}
68630
68628
  return symbol.isAssigned || false;
68631
68629
  }
68632
68630
  function hasParentWithAssignmentsMarked(node) {
68633
- 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 */));
68634
68632
  }
68635
68633
  function markNodeAssignments(node) {
68636
68634
  if (node.kind === 80 /* Identifier */) {
@@ -68736,11 +68734,11 @@ ${lanes.join("\n")}
68736
68734
  const parent2 = declaration.parent.parent;
68737
68735
  if (parent2.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || parent2.kind === 169 /* Parameter */) {
68738
68736
  const links = getNodeLinks(parent2);
68739
- if (!(links.flags & 16777216 /* InCheckIdentifier */)) {
68740
- links.flags |= 16777216 /* InCheckIdentifier */;
68737
+ if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
68738
+ links.flags |= 4194304 /* InCheckIdentifier */;
68741
68739
  const parentType = getTypeForBindingElementParent(parent2, 0 /* Normal */);
68742
68740
  const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
68743
- links.flags &= ~16777216 /* InCheckIdentifier */;
68741
+ links.flags &= ~4194304 /* InCheckIdentifier */;
68744
68742
  if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent2.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
68745
68743
  const pattern = declaration.parent;
68746
68744
  const narrowedType = getFlowTypeOfReference(
@@ -68817,17 +68815,7 @@ ${lanes.join("\n")}
68817
68815
  }
68818
68816
  let declaration = localOrExportSymbol.valueDeclaration;
68819
68817
  if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
68820
- if (declaration.kind === 263 /* ClassDeclaration */ && nodeIsDecorated(legacyDecorators, declaration)) {
68821
- let container = getContainingClass(node);
68822
- while (container !== void 0) {
68823
- if (container === declaration && container.name !== node) {
68824
- getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
68825
- getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
68826
- break;
68827
- }
68828
- container = getContainingClass(container);
68829
- }
68830
- } else if (declaration.kind === 231 /* ClassExpression */) {
68818
+ if (isClassLike(declaration) && declaration.name !== node) {
68831
68819
  let container = getThisContainer(
68832
68820
  node,
68833
68821
  /*includeArrowFunctions*/
@@ -68835,14 +68823,7 @@ ${lanes.join("\n")}
68835
68823
  /*includeClassComputedPropertyName*/
68836
68824
  false
68837
68825
  );
68838
- while (container.kind !== 312 /* SourceFile */) {
68839
- if (container.parent === declaration) {
68840
- if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
68841
- getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
68842
- getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
68843
- }
68844
- break;
68845
- }
68826
+ while (container.kind !== 312 /* SourceFile */ && container.parent !== declaration) {
68846
68827
  container = getThisContainer(
68847
68828
  container,
68848
68829
  /*includeArrowFunctions*/
@@ -68851,6 +68832,11 @@ ${lanes.join("\n")}
68851
68832
  false
68852
68833
  );
68853
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
+ }
68854
68840
  }
68855
68841
  }
68856
68842
  checkNestedBlockScopedBinding(node, symbol);
@@ -68981,7 +68967,7 @@ ${lanes.join("\n")}
68981
68967
  if (isForStatement(container)) {
68982
68968
  const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */);
68983
68969
  if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
68984
- getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */;
68970
+ getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */;
68985
68971
  }
68986
68972
  }
68987
68973
  getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
@@ -69259,7 +69245,7 @@ ${lanes.join("\n")}
69259
69245
  if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
69260
69246
  forEachEnclosingBlockScopeContainer(node.parent, (current) => {
69261
69247
  if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
69262
- getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */;
69248
+ getNodeLinks(current).flags |= 2097152 /* ContainsSuperPropertyInStaticInitializer */;
69263
69249
  }
69264
69250
  });
69265
69251
  }
@@ -72801,7 +72787,7 @@ ${lanes.join("\n")}
72801
72787
  }
72802
72788
  }
72803
72789
  function getThisArgumentOfCall(node) {
72804
- 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;
72805
72791
  if (expression) {
72806
72792
  const callee = skipOuterExpressions(expression);
72807
72793
  if (isAccessExpression(callee)) {
@@ -77708,7 +77694,7 @@ ${lanes.join("\n")}
77708
77694
  function setNodeLinksForPrivateIdentifierScope(node) {
77709
77695
  if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
77710
77696
  for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
77711
- getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */;
77697
+ getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
77712
77698
  }
77713
77699
  if (isClassExpression(node.parent)) {
77714
77700
  const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
@@ -79461,7 +79447,7 @@ ${lanes.join("\n")}
79461
79447
  }
79462
79448
  function checkWeakMapSetCollision(node) {
79463
79449
  const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
79464
- if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) {
79450
+ if (getNodeCheckFlags(enclosingBlockScope) & 1048576 /* ContainsClassWithPrivateIdentifiers */) {
79465
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");
79466
79452
  errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
79467
79453
  }
@@ -79475,18 +79461,18 @@ ${lanes.join("\n")}
79475
79461
  let hasCollision = false;
79476
79462
  if (isClassExpression(node)) {
79477
79463
  for (const member of node.members) {
79478
- if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
79464
+ if (getNodeCheckFlags(member) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
79479
79465
  hasCollision = true;
79480
79466
  break;
79481
79467
  }
79482
79468
  }
79483
79469
  } else if (isFunctionExpression(node)) {
79484
- if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
79470
+ if (getNodeCheckFlags(node) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
79485
79471
  hasCollision = true;
79486
79472
  }
79487
79473
  } else {
79488
79474
  const container = getEnclosingBlockScopeContainer(node);
79489
- if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
79475
+ if (container && getNodeCheckFlags(container) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
79490
79476
  hasCollision = true;
79491
79477
  }
79492
79478
  }
@@ -91965,6 +91951,11 @@ ${lanes.join("\n")}
91965
91951
  }
91966
91952
  }
91967
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
+ }
91968
91959
  function transformAutoAccessor(node) {
91969
91960
  const commentRange = getCommentRange(node);
91970
91961
  const sourceMapRange = getSourceMapRange(node);
@@ -91991,11 +91982,13 @@ ${lanes.join("\n")}
91991
91982
  setOriginalNode(backingField, node);
91992
91983
  setEmitFlags(backingField, 3072 /* NoComments */);
91993
91984
  setSourceMapRange(backingField, sourceMapRange);
91994
- const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName);
91985
+ const receiver = isStatic(node) ? getClassThis() : factory2.createThis();
91986
+ const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName, receiver);
91995
91987
  setOriginalNode(getter, node);
91996
91988
  setCommentRange(getter, commentRange);
91997
91989
  setSourceMapRange(getter, sourceMapRange);
91998
- const setter = createAccessorPropertySetRedirector(factory2, node, modifiers, setterName);
91990
+ const setterModifiers = factory2.createModifiersFromModifierFlags(modifiersToFlags(modifiers));
91991
+ const setter = createAccessorPropertySetRedirector(factory2, node, setterModifiers, setterName, receiver);
91999
91992
  setOriginalNode(setter, node);
92000
91993
  setEmitFlags(setter, 3072 /* NoComments */);
92001
91994
  setSourceMapRange(setter, sourceMapRange);
@@ -92552,6 +92545,7 @@ ${lanes.join("\n")}
92552
92545
  return filter(node.members, isNonStaticMethodOrAccessorWithPrivateName);
92553
92546
  }
92554
92547
  function getClassFacts(node) {
92548
+ var _a;
92555
92549
  let facts = 0 /* None */;
92556
92550
  const original = getOriginalNode(node);
92557
92551
  if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) {
@@ -92568,6 +92562,8 @@ ${lanes.join("\n")}
92568
92562
  if (isStatic(member)) {
92569
92563
  if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) {
92570
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 */;
92571
92567
  }
92572
92568
  if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) {
92573
92569
  if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) {
@@ -92588,6 +92584,9 @@ ${lanes.join("\n")}
92588
92584
  containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
92589
92585
  } else if (isPrivateIdentifierClassElementDeclaration(member)) {
92590
92586
  containsInstancePrivateElements = true;
92587
+ if (resolver.getNodeCheckFlags(member) & 262144 /* ContainsConstructorReference */) {
92588
+ facts |= 2 /* NeedsClassConstructorReference */;
92589
+ }
92591
92590
  } else if (isPropertyDeclaration(member)) {
92592
92591
  containsPublicInstanceFields = true;
92593
92592
  containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer);
@@ -92688,10 +92687,11 @@ ${lanes.join("\n")}
92688
92687
  getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp);
92689
92688
  pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node));
92690
92689
  }
92691
- if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
92692
- getClassLexicalEnvironment().classThis = node.emitNode.classThis;
92693
- }
92694
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 */;
92695
92695
  const isExport = hasSyntacticModifier(node, 1 /* Export */);
92696
92696
  const isDefault = hasSyntacticModifier(node, 1024 /* Default */);
92697
92697
  let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
@@ -92726,6 +92726,11 @@ ${lanes.join("\n")}
92726
92726
  )
92727
92727
  ));
92728
92728
  }
92729
+ const alias = getClassLexicalEnvironment().classConstructor;
92730
+ if (isClassWithConstructorReference && alias) {
92731
+ enableSubstitutionForClassAliases();
92732
+ classAliases[getOriginalNodeId(node)] = alias;
92733
+ }
92729
92734
  const classDecl = factory2.updateClassDeclaration(
92730
92735
  node,
92731
92736
  modifiers,
@@ -92748,14 +92753,14 @@ ${lanes.join("\n")}
92748
92753
  var _a, _b, _c;
92749
92754
  const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
92750
92755
  const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
92751
- const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */;
92756
+ const classCheckFlags = resolver.getNodeCheckFlags(node);
92757
+ const isClassWithConstructorReference = classCheckFlags & 262144 /* ContainsConstructorReference */;
92752
92758
  let temp;
92753
92759
  function createClassTempVar() {
92754
92760
  var _a2;
92755
92761
  if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) {
92756
92762
  return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
92757
92763
  }
92758
- const classCheckFlags = resolver.getNodeCheckFlags(node);
92759
92764
  const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
92760
92765
  const temp2 = factory2.createTempVariable(
92761
92766
  requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
@@ -93722,7 +93727,7 @@ ${lanes.join("\n")}
93722
93727
  }
93723
93728
  function trySubstituteClassAlias(node) {
93724
93729
  if (enabledSubstitutions & 1 /* ClassAliases */) {
93725
- if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
93730
+ if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
93726
93731
  const declaration = resolver.getReferencedValueDeclaration(node);
93727
93732
  if (declaration) {
93728
93733
  const classAlias = classAliases[declaration.id];
@@ -94588,7 +94593,7 @@ ${lanes.join("\n")}
94588
94593
  }
94589
94594
  }
94590
94595
  function getClassAliasIfNeeded(node) {
94591
- if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) {
94596
+ if (resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */) {
94592
94597
  enableSubstitutionForClassAliases();
94593
94598
  const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
94594
94599
  classAliases[getOriginalNodeId(node)] = classAlias;
@@ -94621,7 +94626,7 @@ ${lanes.join("\n")}
94621
94626
  }
94622
94627
  function trySubstituteClassAlias(node) {
94623
94628
  if (classAliases) {
94624
- if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
94629
+ if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
94625
94630
  const declaration = resolver.getReferencedValueDeclaration(node);
94626
94631
  if (declaration) {
94627
94632
  const classAlias = classAliases[declaration.id];
@@ -94653,6 +94658,7 @@ ${lanes.join("\n")}
94653
94658
  endLexicalEnvironment,
94654
94659
  hoistVariableDeclaration
94655
94660
  } = context;
94661
+ const languageVersion = getEmitScriptTarget(context.getCompilerOptions());
94656
94662
  let top;
94657
94663
  let classInfo;
94658
94664
  let classThis;
@@ -96154,6 +96160,17 @@ ${lanes.join("\n")}
96154
96160
  function transformDecorator(decorator) {
96155
96161
  const expression = visitNode(decorator.expression, visitor, isExpression);
96156
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
+ }
96157
96174
  return expression;
96158
96175
  }
96159
96176
  function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) {
@@ -102852,10 +102869,10 @@ ${lanes.join("\n")}
102852
102869
  name
102853
102870
  ));
102854
102871
  const checkFlags = resolver.getNodeCheckFlags(decl);
102855
- if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
102872
+ if (checkFlags & 65536 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
102856
102873
  const outParamName = factory2.createUniqueName("out_" + idText(name));
102857
102874
  let flags = 0 /* None */;
102858
- if (checkFlags & 262144 /* NeedsLoopOutParameter */) {
102875
+ if (checkFlags & 65536 /* NeedsLoopOutParameter */) {
102859
102876
  flags |= 1 /* Body */;
102860
102877
  }
102861
102878
  if (isForStatement(container)) {
@@ -137418,25 +137435,25 @@ ${lanes.join("\n")}
137418
137435
  const { file } = context;
137419
137436
  const range = createTextRangeFromSpan(getRefactorContextSpan(context));
137420
137437
  const { statements } = file;
137421
- const startNodeIndex = findIndex(statements, (s) => s.end > range.pos);
137438
+ let startNodeIndex = findIndex(statements, (s) => s.end > range.pos);
137422
137439
  if (startNodeIndex === -1)
137423
137440
  return void 0;
137424
137441
  const startStatement = statements[startNodeIndex];
137425
- if (isNamedDeclaration(startStatement) && startStatement.name && rangeContainsRange(startStatement.name, range)) {
137426
- return { toMove: [statements[startNodeIndex]], afterLast: statements[startNodeIndex + 1] };
137427
- }
137428
137442
  const overloadRangeToMove = getOverloadRangeToMove(file, startStatement);
137429
137443
  if (overloadRangeToMove) {
137430
- return overloadRangeToMove;
137444
+ startNodeIndex = overloadRangeToMove.start;
137445
+ }
137446
+ let endNodeIndex = findIndex(statements, (s) => s.end >= range.end, startNodeIndex);
137447
+ if (endNodeIndex !== -1 && range.end <= statements[endNodeIndex].getStart()) {
137448
+ endNodeIndex--;
137449
+ }
137450
+ const endingOverloadRangeToMove = getOverloadRangeToMove(file, statements[endNodeIndex]);
137451
+ if (endingOverloadRangeToMove) {
137452
+ endNodeIndex = endingOverloadRangeToMove.end;
137431
137453
  }
137432
- if (range.pos > startStatement.getStart(file))
137433
- return void 0;
137434
- const afterEndNodeIndex = findIndex(statements, (s) => s.end > range.end, startNodeIndex);
137435
- if (afterEndNodeIndex !== -1 && (afterEndNodeIndex === 0 || statements[afterEndNodeIndex].getStart(file) < range.end))
137436
- return void 0;
137437
137454
  return {
137438
- toMove: statements.slice(startNodeIndex, afterEndNodeIndex === -1 ? statements.length : afterEndNodeIndex),
137439
- afterLast: afterEndNodeIndex === -1 ? void 0 : statements[afterEndNodeIndex]
137455
+ toMove: statements.slice(startNodeIndex, endNodeIndex === -1 ? statements.length : endNodeIndex + 1),
137456
+ afterLast: endNodeIndex === -1 ? void 0 : statements[endNodeIndex + 1]
137440
137457
  };
137441
137458
  }
137442
137459
  function getStatementsToMove(context) {
@@ -137691,10 +137708,12 @@ ${lanes.join("\n")}
137691
137708
  if (declarations === void 0 || length(declarations) <= 1 || !contains(declarations, statement)) {
137692
137709
  return void 0;
137693
137710
  }
137711
+ const firstDecl = declarations[0];
137694
137712
  const lastDecl = declarations[length(declarations) - 1];
137695
137713
  const statementsToMove = mapDefined(declarations, (d) => getSourceFileOfNode(d) === sourceFile && isStatement(d) ? d : void 0);
137696
- const end = findLastIndex(sourceFile.statements, (s) => s.end > lastDecl.end);
137697
- return { toMove: statementsToMove, afterLast: end >= 0 ? sourceFile.statements[end] : void 0 };
137714
+ const end = findIndex(sourceFile.statements, (s) => s.end >= lastDecl.end);
137715
+ const start = findIndex(sourceFile.statements, (s) => s.end >= firstDecl.end);
137716
+ return { toMove: statementsToMove, start, end };
137698
137717
  }
137699
137718
  return void 0;
137700
137719
  }
@@ -137741,7 +137760,7 @@ ${lanes.join("\n")}
137741
137760
  if (host.fileExists(targetFile) && program.getSourceFile(targetFile) === void 0) {
137742
137761
  return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_statements_to_the_selected_file));
137743
137762
  }
137744
- const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, program, statements, t, context.host, context.preferences));
137763
+ const edits = ts_textChanges_exports.ChangeTracker.with(context, (t) => doChange4(context, context.file, interactiveRefactorArguments.targetFile, context.program, statements, t, context.host, context.preferences));
137745
137764
  return { edits, renameFilename: void 0, renameLocation: void 0 };
137746
137765
  }
137747
137766
  return error(getLocaleSpecificMessage(Diagnostics.Cannot_move_to_file_selected_file_is_invalid));
@@ -164106,8 +164125,10 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164106
164125
  }
164107
164126
  function addParameterHints(text, parameter, position, isFirstVariadicArgument, sourceFile) {
164108
164127
  let hintText = `${isFirstVariadicArgument ? "..." : ""}${text}`;
164128
+ let displayParts;
164109
164129
  if (shouldUseInteractiveInlayHints(preferences)) {
164110
- hintText = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
164130
+ displayParts = [getNodeDisplayPart(hintText, parameter, sourceFile), { text: ":" }];
164131
+ hintText = "";
164111
164132
  } else {
164112
164133
  hintText += ":";
164113
164134
  }
@@ -164115,7 +164136,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
164115
164136
  text: hintText,
164116
164137
  position,
164117
164138
  kind: "Parameter" /* Parameter */,
164118
- whitespaceAfter: true
164139
+ whitespaceAfter: true,
164140
+ displayParts
164119
164141
  });
164120
164142
  }
164121
164143
  function addTypeHints(text, position) {
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-dev.20230804`;
57
+ var version = `${versionMajorMinor}.0-dev.20230806`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "typescript",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.2.0-dev.20230804",
5
+ "version": "5.2.0-dev.20230806",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -113,5 +113,5 @@
113
113
  "node": "20.1.0",
114
114
  "npm": "8.19.4"
115
115
  },
116
- "gitHead": "83f3abda153f0f567e296a3c75cdca37c7eb065d"
116
+ "gitHead": "e36cd5768aa46ed2ce9487cce768222d8ee05a4d"
117
117
  }