@typescript-deploys/pr-build 5.2.0-pr-55267-8 → 5.3.0-pr-54778-3

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
@@ -17,8 +17,8 @@ and limitations under the License.
17
17
  "use strict";
18
18
 
19
19
  // src/compiler/corePublic.ts
20
- var versionMajorMinor = "5.2";
21
- var version = `${versionMajorMinor}.0-insiders.20230804`;
20
+ var versionMajorMinor = "5.3";
21
+ var version = `${versionMajorMinor}.0-insiders.20230809`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -18723,8 +18723,10 @@ function createNodeFactory(flags, baseFactory2) {
18723
18723
  return update(updated, original);
18724
18724
  }
18725
18725
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
18726
+ const text = typeof value === "number" ? value + "" : value;
18727
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
18726
18728
  const node = createBaseDeclaration(9 /* NumericLiteral */);
18727
- node.text = typeof value === "number" ? value + "" : value;
18729
+ node.text = text;
18728
18730
  node.numericLiteralFlags = numericLiteralFlags;
18729
18731
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
18730
18732
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -25552,7 +25554,7 @@ function createAccessorPropertyBackingField(factory2, node, modifiers, initializ
25552
25554
  initializer
25553
25555
  );
25554
25556
  }
25555
- function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) {
25557
+ function createAccessorPropertyGetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) {
25556
25558
  return factory2.createGetAccessorDeclaration(
25557
25559
  modifiers,
25558
25560
  name,
@@ -25562,7 +25564,7 @@ function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) {
25562
25564
  factory2.createBlock([
25563
25565
  factory2.createReturnStatement(
25564
25566
  factory2.createPropertyAccessExpression(
25565
- factory2.createThis(),
25567
+ receiver,
25566
25568
  factory2.getGeneratedPrivateNameForNode(
25567
25569
  node.name,
25568
25570
  /*prefix*/
@@ -25574,7 +25576,7 @@ function createAccessorPropertyGetRedirector(factory2, node, modifiers, name) {
25574
25576
  ])
25575
25577
  );
25576
25578
  }
25577
- function createAccessorPropertySetRedirector(factory2, node, modifiers, name) {
25579
+ function createAccessorPropertySetRedirector(factory2, node, modifiers, name, receiver = factory2.createThis()) {
25578
25580
  return factory2.createSetAccessorDeclaration(
25579
25581
  modifiers,
25580
25582
  name,
@@ -25589,7 +25591,7 @@ function createAccessorPropertySetRedirector(factory2, node, modifiers, name) {
25589
25591
  factory2.createExpressionStatement(
25590
25592
  factory2.createAssignment(
25591
25593
  factory2.createPropertyAccessExpression(
25592
- factory2.createThis(),
25594
+ receiver,
25593
25595
  factory2.getGeneratedPrivateNameForNode(
25594
25596
  node.name,
25595
25597
  /*prefix*/
@@ -49161,7 +49163,7 @@ function createTypeChecker(host) {
49161
49163
  return factory.createStringLiteral(name, !!singleQuote);
49162
49164
  }
49163
49165
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
49164
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
49166
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(+name))));
49165
49167
  }
49166
49168
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions));
49167
49169
  }
@@ -51926,7 +51928,7 @@ function createTypeChecker(host) {
51926
51928
  if (reportErrors2) {
51927
51929
  reportErrorsFromWidening(declaration, type);
51928
51930
  }
51929
- if (type.flags & 8192 /* UniqueESSymbol */ && (isBindingElement(declaration) || !declaration.type) && type.symbol !== getSymbolOfDeclaration(declaration)) {
51931
+ if (type.flags & 8192 /* UniqueESSymbol */ && !declaration.type && type.symbol !== getSymbolOfDeclaration(declaration) && !isValueSymbolAccessible(type.symbol, type.symbol.valueDeclaration)) {
51930
51932
  type = esSymbolType;
51931
51933
  }
51932
51934
  return getWidenedType(type);
@@ -59828,6 +59830,7 @@ function createTypeChecker(host) {
59828
59830
  let expandingFlags = 0 /* None */;
59829
59831
  let overflow = false;
59830
59832
  let overrideNextErrorInfo = 0;
59833
+ let skipParentCounter = 0;
59831
59834
  let lastSkippedInfo;
59832
59835
  let incompatibleStack;
59833
59836
  Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
@@ -59893,6 +59896,7 @@ function createTypeChecker(host) {
59893
59896
  lastSkippedInfo = saved.lastSkippedInfo;
59894
59897
  incompatibleStack = saved.incompatibleStack;
59895
59898
  overrideNextErrorInfo = saved.overrideNextErrorInfo;
59899
+ skipParentCounter = saved.skipParentCounter;
59896
59900
  relatedInfo = saved.relatedInfo;
59897
59901
  }
59898
59902
  function captureErrorCalculationState() {
@@ -59901,6 +59905,7 @@ function createTypeChecker(host) {
59901
59905
  lastSkippedInfo,
59902
59906
  incompatibleStack: incompatibleStack == null ? void 0 : incompatibleStack.slice(),
59903
59907
  overrideNextErrorInfo,
59908
+ skipParentCounter,
59904
59909
  relatedInfo: relatedInfo == null ? void 0 : relatedInfo.slice()
59905
59910
  };
59906
59911
  }
@@ -60005,7 +60010,15 @@ function createTypeChecker(host) {
60005
60010
  reportIncompatibleStack();
60006
60011
  if (message.elidedInCompatabilityPyramid)
60007
60012
  return;
60008
- errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
60013
+ if (skipParentCounter === 0) {
60014
+ errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
60015
+ } else {
60016
+ skipParentCounter--;
60017
+ }
60018
+ }
60019
+ function reportParentSkippedError(message, ...args) {
60020
+ reportError(message, ...args);
60021
+ skipParentCounter++;
60009
60022
  }
60010
60023
  function associateRelatedInfo(info) {
60011
60024
  Debug.assert(!!errorInfo);
@@ -60342,14 +60355,14 @@ function createTypeChecker(host) {
60342
60355
  }
60343
60356
  }
60344
60357
  if (suggestion !== void 0) {
60345
- reportError(
60358
+ reportParentSkippedError(
60346
60359
  Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
60347
60360
  symbolToString(prop),
60348
60361
  typeToString(errorTarget),
60349
60362
  suggestion
60350
60363
  );
60351
60364
  } else {
60352
- reportError(
60365
+ reportParentSkippedError(
60353
60366
  Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
60354
60367
  symbolToString(prop),
60355
60368
  typeToString(errorTarget)
@@ -66147,8 +66160,8 @@ function createTypeChecker(host) {
66147
66160
  }
66148
66161
  const parent = getRootDeclaration(symbol.valueDeclaration).parent;
66149
66162
  const links = getNodeLinks(parent);
66150
- if (!(links.flags & 524288 /* AssignmentsMarked */)) {
66151
- links.flags |= 524288 /* AssignmentsMarked */;
66163
+ if (!(links.flags & 131072 /* AssignmentsMarked */)) {
66164
+ links.flags |= 131072 /* AssignmentsMarked */;
66152
66165
  if (!hasParentWithAssignmentsMarked(parent)) {
66153
66166
  markNodeAssignments(parent);
66154
66167
  }
@@ -66156,7 +66169,7 @@ function createTypeChecker(host) {
66156
66169
  return symbol.isAssigned || false;
66157
66170
  }
66158
66171
  function hasParentWithAssignmentsMarked(node) {
66159
- return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 524288 /* AssignmentsMarked */));
66172
+ return !!findAncestor(node.parent, (node2) => (isFunctionLike(node2) || isCatchClause(node2)) && !!(getNodeLinks(node2).flags & 131072 /* AssignmentsMarked */));
66160
66173
  }
66161
66174
  function markNodeAssignments(node) {
66162
66175
  if (node.kind === 80 /* Identifier */) {
@@ -66262,11 +66275,11 @@ function createTypeChecker(host) {
66262
66275
  const parent = declaration.parent.parent;
66263
66276
  if (parent.kind === 260 /* VariableDeclaration */ && getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || parent.kind === 169 /* Parameter */) {
66264
66277
  const links = getNodeLinks(parent);
66265
- if (!(links.flags & 16777216 /* InCheckIdentifier */)) {
66266
- links.flags |= 16777216 /* InCheckIdentifier */;
66278
+ if (!(links.flags & 4194304 /* InCheckIdentifier */)) {
66279
+ links.flags |= 4194304 /* InCheckIdentifier */;
66267
66280
  const parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
66268
66281
  const parentTypeConstraint = parentType && mapType(parentType, getBaseConstraintOrType);
66269
- links.flags &= ~16777216 /* InCheckIdentifier */;
66282
+ links.flags &= ~4194304 /* InCheckIdentifier */;
66270
66283
  if (parentTypeConstraint && parentTypeConstraint.flags & 1048576 /* Union */ && !(parent.kind === 169 /* Parameter */ && isSymbolAssigned(symbol))) {
66271
66284
  const pattern = declaration.parent;
66272
66285
  const narrowedType = getFlowTypeOfReference(
@@ -66343,17 +66356,7 @@ function createTypeChecker(host) {
66343
66356
  }
66344
66357
  let declaration = localOrExportSymbol.valueDeclaration;
66345
66358
  if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
66346
- if (declaration.kind === 263 /* ClassDeclaration */ && nodeIsDecorated(legacyDecorators, declaration)) {
66347
- let container = getContainingClass(node);
66348
- while (container !== void 0) {
66349
- if (container === declaration && container.name !== node) {
66350
- getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
66351
- getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
66352
- break;
66353
- }
66354
- container = getContainingClass(container);
66355
- }
66356
- } else if (declaration.kind === 231 /* ClassExpression */) {
66359
+ if (isClassLike(declaration) && declaration.name !== node) {
66357
66360
  let container = getThisContainer(
66358
66361
  node,
66359
66362
  /*includeArrowFunctions*/
@@ -66361,14 +66364,7 @@ function createTypeChecker(host) {
66361
66364
  /*includeClassComputedPropertyName*/
66362
66365
  false
66363
66366
  );
66364
- while (container.kind !== 312 /* SourceFile */) {
66365
- if (container.parent === declaration) {
66366
- if (isPropertyDeclaration(container) && isStatic(container) || isClassStaticBlockDeclaration(container)) {
66367
- getNodeLinks(declaration).flags |= 1048576 /* ClassWithConstructorReference */;
66368
- getNodeLinks(node).flags |= 2097152 /* ConstructorReferenceInClass */;
66369
- }
66370
- break;
66371
- }
66367
+ while (container.kind !== 312 /* SourceFile */ && container.parent !== declaration) {
66372
66368
  container = getThisContainer(
66373
66369
  container,
66374
66370
  /*includeArrowFunctions*/
@@ -66377,6 +66373,11 @@ function createTypeChecker(host) {
66377
66373
  false
66378
66374
  );
66379
66375
  }
66376
+ if (container.kind !== 312 /* SourceFile */) {
66377
+ getNodeLinks(declaration).flags |= 262144 /* ContainsConstructorReference */;
66378
+ getNodeLinks(container).flags |= 262144 /* ContainsConstructorReference */;
66379
+ getNodeLinks(node).flags |= 536870912 /* ConstructorReference */;
66380
+ }
66380
66381
  }
66381
66382
  }
66382
66383
  checkNestedBlockScopedBinding(node, symbol);
@@ -66507,7 +66508,7 @@ function createTypeChecker(host) {
66507
66508
  if (isForStatement(container)) {
66508
66509
  const varDeclList = getAncestor(symbol.valueDeclaration, 261 /* VariableDeclarationList */);
66509
66510
  if (varDeclList && varDeclList.parent === container && isAssignedInBodyOfForStatement(node, container)) {
66510
- getNodeLinks(symbol.valueDeclaration).flags |= 262144 /* NeedsLoopOutParameter */;
66511
+ getNodeLinks(symbol.valueDeclaration).flags |= 65536 /* NeedsLoopOutParameter */;
66511
66512
  }
66512
66513
  }
66513
66514
  getNodeLinks(symbol.valueDeclaration).flags |= 32768 /* BlockScopedBindingInLoop */;
@@ -66785,7 +66786,7 @@ function createTypeChecker(host) {
66785
66786
  if (!isCallExpression2 && languageVersion >= 2 /* ES2015 */ && languageVersion <= 8 /* ES2021 */ && (isPropertyDeclaration(container) || isClassStaticBlockDeclaration(container))) {
66786
66787
  forEachEnclosingBlockScopeContainer(node.parent, (current) => {
66787
66788
  if (!isSourceFile(current) || isExternalOrCommonJsModule(current)) {
66788
- getNodeLinks(current).flags |= 8388608 /* ContainsSuperPropertyInStaticInitializer */;
66789
+ getNodeLinks(current).flags |= 2097152 /* ContainsSuperPropertyInStaticInitializer */;
66789
66790
  }
66790
66791
  });
66791
66792
  }
@@ -67312,7 +67313,7 @@ function createTypeChecker(host) {
67312
67313
  } else if (t.flags & 3670016 /* StructuredType */) {
67313
67314
  const prop = getPropertyOfType(t, name);
67314
67315
  if (prop) {
67315
- return isCircularMappedProperty(prop) ? void 0 : getTypeOfSymbol(prop);
67316
+ return isCircularMappedProperty(prop) ? void 0 : removeMissingType(getTypeOfSymbol(prop), !!(prop && prop.flags & 16777216 /* Optional */));
67316
67317
  }
67317
67318
  if (isTupleType(t) && isNumericLiteralName(name) && +name >= 0) {
67318
67319
  const restType = getElementTypeOfSliceOfTupleType(
@@ -67397,7 +67398,7 @@ function createTypeChecker(host) {
67397
67398
  (t) => {
67398
67399
  if (isTupleType(t)) {
67399
67400
  if ((firstSpreadIndex === void 0 || index < firstSpreadIndex) && index < t.target.fixedLength) {
67400
- return getTypeArguments(t)[index];
67401
+ return removeMissingType(getTypeArguments(t)[index], !!(t.target.elementFlags[index] && 2 /* Optional */));
67401
67402
  }
67402
67403
  const offset = length2 !== void 0 && (lastSpreadIndex === void 0 || index > lastSpreadIndex) ? length2 - index : 0;
67403
67404
  const fixedEndLength = offset > 0 && t.target.hasRestElement ? getEndElementCount(t.target, 3 /* Fixed */) : 0;
@@ -68558,13 +68559,18 @@ function createTypeChecker(host) {
68558
68559
  if (!isErrorType(intrinsicElementsType)) {
68559
68560
  if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName))
68560
68561
  return Debug.fail();
68561
- const intrinsicProp = getPropertyOfType(intrinsicElementsType, isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText);
68562
+ const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
68563
+ const intrinsicProp = getPropertyOfType(intrinsicElementsType, propName);
68562
68564
  if (intrinsicProp) {
68563
68565
  links.jsxFlags |= 1 /* IntrinsicNamedElement */;
68564
68566
  return links.resolvedSymbol = intrinsicProp;
68565
68567
  }
68566
- const indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType);
68567
- if (indexSignatureType) {
68568
+ const indexSymbol = getApplicableIndexSymbol(intrinsicElementsType, getStringLiteralType(unescapeLeadingUnderscores(propName)));
68569
+ if (indexSymbol) {
68570
+ links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
68571
+ return links.resolvedSymbol = indexSymbol;
68572
+ }
68573
+ if (getTypeOfPropertyOrIndexSignatureOfType(intrinsicElementsType, propName)) {
68568
68574
  links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
68569
68575
  return links.resolvedSymbol = intrinsicElementsType.symbol;
68570
68576
  }
@@ -68742,6 +68748,7 @@ function createTypeChecker(host) {
68742
68748
  }
68743
68749
  }
68744
68750
  function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
68751
+ var _a;
68745
68752
  Debug.assert(isJsxIntrinsicTagName(node.tagName));
68746
68753
  const links = getNodeLinks(node);
68747
68754
  if (!links.resolvedJsxElementAttributesType) {
@@ -68749,7 +68756,8 @@ function createTypeChecker(host) {
68749
68756
  if (links.jsxFlags & 1 /* IntrinsicNamedElement */) {
68750
68757
  return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
68751
68758
  } else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
68752
- return links.resolvedJsxElementAttributesType = getIndexTypeOfType(getJsxType(JsxNames.IntrinsicElements, node), stringType) || errorType;
68759
+ const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
68760
+ return links.resolvedJsxElementAttributesType = ((_a = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a.type) || errorType;
68753
68761
  } else {
68754
68762
  return links.resolvedJsxElementAttributesType = errorType;
68755
68763
  }
@@ -70327,7 +70335,7 @@ function createTypeChecker(host) {
70327
70335
  }
70328
70336
  }
70329
70337
  function getThisArgumentOfCall(node) {
70330
- const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : void 0;
70338
+ const expression = node.kind === 213 /* CallExpression */ ? node.expression : node.kind === 215 /* TaggedTemplateExpression */ ? node.tag : node.kind === 170 /* Decorator */ && !legacyDecorators ? node.expression : void 0;
70331
70339
  if (expression) {
70332
70340
  const callee = skipOuterExpressions(expression);
70333
70341
  if (isAccessExpression(callee)) {
@@ -74402,7 +74410,7 @@ function createTypeChecker(host) {
74402
74410
  return createTupleType(elementTypes, elementFlags, type.target.readonly);
74403
74411
  }
74404
74412
  function widenTypeInferredFromInitializer(declaration, type) {
74405
- const widened = getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || isDeclarationReadonly(declaration) ? type : getWidenedLiteralType(type);
74413
+ const widened = getCombinedNodeFlagsCached(declaration) & 6 /* Constant */ || isDeclarationReadonly(declaration) ? type : getWidenedUniqueESSymbolType(getWidenedLiteralType(type));
74406
74414
  if (isInJSFile(declaration)) {
74407
74415
  if (isEmptyLiteralType(widened)) {
74408
74416
  reportImplicitAny(declaration, anyType);
@@ -74732,9 +74740,14 @@ function createTypeChecker(host) {
74732
74740
  case 15 /* NoSubstitutionTemplateLiteral */:
74733
74741
  case 11 /* StringLiteral */:
74734
74742
  return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
74735
- case 9 /* NumericLiteral */:
74743
+ case 9 /* NumericLiteral */: {
74736
74744
  checkGrammarNumericLiteral(node);
74737
- return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
74745
+ const value = +node.text;
74746
+ if (!isFinite(value)) {
74747
+ return numberType;
74748
+ }
74749
+ return getFreshTypeOfLiteralType(getNumberLiteralType(value));
74750
+ }
74738
74751
  case 10 /* BigIntLiteral */:
74739
74752
  checkGrammarBigIntLiteral(node);
74740
74753
  return getFreshTypeOfLiteralType(getBigIntLiteralType({
@@ -75234,7 +75247,7 @@ function createTypeChecker(host) {
75234
75247
  function setNodeLinksForPrivateIdentifierScope(node) {
75235
75248
  if (isPrivateIdentifier(node.name) && languageVersion < 99 /* ESNext */) {
75236
75249
  for (let lexicalScope = getEnclosingBlockScopeContainer(node); !!lexicalScope; lexicalScope = getEnclosingBlockScopeContainer(lexicalScope)) {
75237
- getNodeLinks(lexicalScope).flags |= 4194304 /* ContainsClassWithPrivateIdentifiers */;
75250
+ getNodeLinks(lexicalScope).flags |= 1048576 /* ContainsClassWithPrivateIdentifiers */;
75238
75251
  }
75239
75252
  if (isClassExpression(node.parent)) {
75240
75253
  const enclosingIterationStatement = getEnclosingIterationStatement(node.parent);
@@ -76987,7 +77000,7 @@ function createTypeChecker(host) {
76987
77000
  }
76988
77001
  function checkWeakMapSetCollision(node) {
76989
77002
  const enclosingBlockScope = getEnclosingBlockScopeContainer(node);
76990
- if (getNodeCheckFlags(enclosingBlockScope) & 4194304 /* ContainsClassWithPrivateIdentifiers */) {
77003
+ if (getNodeCheckFlags(enclosingBlockScope) & 1048576 /* ContainsClassWithPrivateIdentifiers */) {
76991
77004
  Debug.assert(isNamedDeclaration(node) && isIdentifier(node.name) && typeof node.name.escapedText === "string", "The target of a WeakMap/WeakSet collision check should be an identifier");
76992
77005
  errorSkippedOn("noEmit", node, Diagnostics.Compiler_reserves_name_0_when_emitting_private_identifier_downlevel, node.name.escapedText);
76993
77006
  }
@@ -77001,18 +77014,18 @@ function createTypeChecker(host) {
77001
77014
  let hasCollision = false;
77002
77015
  if (isClassExpression(node)) {
77003
77016
  for (const member of node.members) {
77004
- if (getNodeCheckFlags(member) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
77017
+ if (getNodeCheckFlags(member) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
77005
77018
  hasCollision = true;
77006
77019
  break;
77007
77020
  }
77008
77021
  }
77009
77022
  } else if (isFunctionExpression(node)) {
77010
- if (getNodeCheckFlags(node) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
77023
+ if (getNodeCheckFlags(node) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
77011
77024
  hasCollision = true;
77012
77025
  }
77013
77026
  } else {
77014
77027
  const container = getEnclosingBlockScopeContainer(node);
77015
- if (container && getNodeCheckFlags(container) & 8388608 /* ContainsSuperPropertyInStaticInitializer */) {
77028
+ if (container && getNodeCheckFlags(container) & 2097152 /* ContainsSuperPropertyInStaticInitializer */) {
77016
77029
  hasCollision = true;
77017
77030
  }
77018
77031
  }
@@ -80866,31 +80879,7 @@ function createTypeChecker(host) {
80866
80879
  if (name.kind === 211 /* PropertyAccessExpression */) {
80867
80880
  checkPropertyAccessExpression(name, 0 /* Normal */);
80868
80881
  if (!links.resolvedSymbol) {
80869
- const expressionType = checkExpressionCached(name.expression);
80870
- const infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name));
80871
- if (infos.length && expressionType.members) {
80872
- const resolved = resolveStructuredTypeMembers(expressionType);
80873
- const symbol = resolved.members.get("__index" /* Index */);
80874
- if (infos === getIndexInfosOfType(expressionType)) {
80875
- links.resolvedSymbol = symbol;
80876
- } else if (symbol) {
80877
- const symbolLinks2 = getSymbolLinks(symbol);
80878
- const declarationList = mapDefined(infos, (i) => i.declaration);
80879
- const nodeListId = map(declarationList, getNodeId).join(",");
80880
- if (!symbolLinks2.filteredIndexSymbolCache) {
80881
- symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
80882
- }
80883
- if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
80884
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
80885
- } else {
80886
- const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
80887
- copy.declarations = mapDefined(infos, (i) => i.declaration);
80888
- copy.parent = expressionType.aliasSymbol ? expressionType.aliasSymbol : expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent);
80889
- symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
80890
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
80891
- }
80892
- }
80893
- }
80882
+ links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name));
80894
80883
  }
80895
80884
  } else {
80896
80885
  checkQualifiedName(name, 0 /* Normal */);
@@ -80923,6 +80912,31 @@ function createTypeChecker(host) {
80923
80912
  }
80924
80913
  return void 0;
80925
80914
  }
80915
+ function getApplicableIndexSymbol(type, keyType) {
80916
+ const infos = getApplicableIndexInfos(type, keyType);
80917
+ if (infos.length && type.members) {
80918
+ const symbol = getIndexSymbolFromSymbolTable(resolveStructuredTypeMembers(type).members);
80919
+ if (infos === getIndexInfosOfType(type)) {
80920
+ return symbol;
80921
+ } else if (symbol) {
80922
+ const symbolLinks2 = getSymbolLinks(symbol);
80923
+ const declarationList = mapDefined(infos, (i) => i.declaration);
80924
+ const nodeListId = map(declarationList, getNodeId).join(",");
80925
+ if (!symbolLinks2.filteredIndexSymbolCache) {
80926
+ symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
80927
+ }
80928
+ if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
80929
+ return symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
80930
+ } else {
80931
+ const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
80932
+ copy.declarations = mapDefined(infos, (i) => i.declaration);
80933
+ copy.parent = type.aliasSymbol ? type.aliasSymbol : type.symbol ? type.symbol : getSymbolAtLocation(copy.declarations[0].parent);
80934
+ symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
80935
+ return copy;
80936
+ }
80937
+ }
80938
+ }
80939
+ }
80926
80940
  function resolveJSDocMemberName(name, ignoreErrors, container) {
80927
80941
  if (isEntityName(name)) {
80928
80942
  const meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;
@@ -81751,7 +81765,7 @@ function createTypeChecker(host) {
81751
81765
  if (enumResult)
81752
81766
  return enumResult;
81753
81767
  const literalValue = type.value;
81754
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
81768
+ return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(literalValue))) : factory.createNumericLiteral(literalValue);
81755
81769
  }
81756
81770
  function createLiteralConstValue(node, tracker) {
81757
81771
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -88176,7 +88190,7 @@ function transformTypeScript(context) {
88176
88190
  function transformEnumMemberDeclarationValue(member) {
88177
88191
  const value = resolver.getConstantValue(member);
88178
88192
  if (value !== void 0) {
88179
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
88193
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(value))) : factory2.createNumericLiteral(value);
88180
88194
  } else {
88181
88195
  enableSubstitutionForNonQualifiedEnumMembers();
88182
88196
  if (member.initializer) {
@@ -89131,6 +89145,11 @@ function transformClassFields(context) {
89131
89145
  }
89132
89146
  }
89133
89147
  }
89148
+ function getClassThis() {
89149
+ const lex = getClassLexicalEnvironment();
89150
+ const classThis = lex.classThis ?? lex.classConstructor ?? (currentClassContainer == null ? void 0 : currentClassContainer.name);
89151
+ return Debug.checkDefined(classThis);
89152
+ }
89134
89153
  function transformAutoAccessor(node) {
89135
89154
  const commentRange = getCommentRange(node);
89136
89155
  const sourceMapRange = getSourceMapRange(node);
@@ -89157,11 +89176,13 @@ function transformClassFields(context) {
89157
89176
  setOriginalNode(backingField, node);
89158
89177
  setEmitFlags(backingField, 3072 /* NoComments */);
89159
89178
  setSourceMapRange(backingField, sourceMapRange);
89160
- const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName);
89179
+ const receiver = isStatic(node) ? getClassThis() : factory2.createThis();
89180
+ const getter = createAccessorPropertyGetRedirector(factory2, node, modifiers, getterName, receiver);
89161
89181
  setOriginalNode(getter, node);
89162
89182
  setCommentRange(getter, commentRange);
89163
89183
  setSourceMapRange(getter, sourceMapRange);
89164
- const setter = createAccessorPropertySetRedirector(factory2, node, modifiers, setterName);
89184
+ const setterModifiers = factory2.createModifiersFromModifierFlags(modifiersToFlags(modifiers));
89185
+ const setter = createAccessorPropertySetRedirector(factory2, node, setterModifiers, setterName, receiver);
89165
89186
  setOriginalNode(setter, node);
89166
89187
  setEmitFlags(setter, 3072 /* NoComments */);
89167
89188
  setSourceMapRange(setter, sourceMapRange);
@@ -89718,6 +89739,7 @@ function transformClassFields(context) {
89718
89739
  return filter(node.members, isNonStaticMethodOrAccessorWithPrivateName);
89719
89740
  }
89720
89741
  function getClassFacts(node) {
89742
+ var _a;
89721
89743
  let facts = 0 /* None */;
89722
89744
  const original = getOriginalNode(node);
89723
89745
  if (isClassDeclaration(original) && classOrConstructorParameterIsDecorated(legacyDecorators, original)) {
@@ -89734,6 +89756,8 @@ function transformClassFields(context) {
89734
89756
  if (isStatic(member)) {
89735
89757
  if (member.name && (isPrivateIdentifier(member.name) || isAutoAccessorPropertyDeclaration(member)) && shouldTransformPrivateElementsOrClassStaticBlocks) {
89736
89758
  facts |= 2 /* NeedsClassConstructorReference */;
89759
+ } else if (isAutoAccessorPropertyDeclaration(member) && shouldTransformAutoAccessors === -1 /* True */ && !node.name && !((_a = node.emitNode) == null ? void 0 : _a.classThis)) {
89760
+ facts |= 2 /* NeedsClassConstructorReference */;
89737
89761
  }
89738
89762
  if (isPropertyDeclaration(member) || isClassStaticBlockDeclaration(member)) {
89739
89763
  if (shouldTransformThisInStaticInitializers && member.transformFlags & 16384 /* ContainsLexicalThis */) {
@@ -89754,6 +89778,9 @@ function transformClassFields(context) {
89754
89778
  containsInstancePrivateElements || (containsInstancePrivateElements = isPrivateIdentifierClassElementDeclaration(member));
89755
89779
  } else if (isPrivateIdentifierClassElementDeclaration(member)) {
89756
89780
  containsInstancePrivateElements = true;
89781
+ if (resolver.getNodeCheckFlags(member) & 262144 /* ContainsConstructorReference */) {
89782
+ facts |= 2 /* NeedsClassConstructorReference */;
89783
+ }
89757
89784
  } else if (isPropertyDeclaration(member)) {
89758
89785
  containsPublicInstanceFields = true;
89759
89786
  containsInitializedPublicInstanceFields || (containsInitializedPublicInstanceFields = !!member.initializer);
@@ -89854,10 +89881,11 @@ function transformClassFields(context) {
89854
89881
  getClassLexicalEnvironment().classConstructor = factory2.cloneNode(temp);
89855
89882
  pendingClassReferenceAssignment = factory2.createAssignment(temp, factory2.getInternalName(node));
89856
89883
  }
89857
- if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
89858
- getClassLexicalEnvironment().classThis = node.emitNode.classThis;
89859
- }
89860
89884
  }
89885
+ if ((_b = node.emitNode) == null ? void 0 : _b.classThis) {
89886
+ getClassLexicalEnvironment().classThis = node.emitNode.classThis;
89887
+ }
89888
+ const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */;
89861
89889
  const isExport = hasSyntacticModifier(node, 1 /* Export */);
89862
89890
  const isDefault = hasSyntacticModifier(node, 1024 /* Default */);
89863
89891
  let modifiers = visitNodes2(node.modifiers, modifierVisitor, isModifier);
@@ -89892,6 +89920,11 @@ function transformClassFields(context) {
89892
89920
  )
89893
89921
  ));
89894
89922
  }
89923
+ const alias = getClassLexicalEnvironment().classConstructor;
89924
+ if (isClassWithConstructorReference && alias) {
89925
+ enableSubstitutionForClassAliases();
89926
+ classAliases[getOriginalNodeId(node)] = alias;
89927
+ }
89895
89928
  const classDecl = factory2.updateClassDeclaration(
89896
89929
  node,
89897
89930
  modifiers,
@@ -89914,14 +89947,14 @@ function transformClassFields(context) {
89914
89947
  var _a, _b, _c;
89915
89948
  const isDecoratedClassDeclaration = !!(facts & 1 /* ClassWasDecorated */);
89916
89949
  const staticPropertiesOrClassStaticBlocks = getStaticPropertiesAndClassStaticBlock(node);
89917
- const isClassWithConstructorReference = resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */;
89950
+ const classCheckFlags = resolver.getNodeCheckFlags(node);
89951
+ const isClassWithConstructorReference = classCheckFlags & 262144 /* ContainsConstructorReference */;
89918
89952
  let temp;
89919
89953
  function createClassTempVar() {
89920
89954
  var _a2;
89921
89955
  if (shouldTransformPrivateElementsOrClassStaticBlocks && ((_a2 = node.emitNode) == null ? void 0 : _a2.classThis)) {
89922
89956
  return getClassLexicalEnvironment().classConstructor = node.emitNode.classThis;
89923
89957
  }
89924
- const classCheckFlags = resolver.getNodeCheckFlags(node);
89925
89958
  const requiresBlockScopedVar = classCheckFlags & 32768 /* BlockScopedBindingInLoop */;
89926
89959
  const temp2 = factory2.createTempVariable(
89927
89960
  requiresBlockScopedVar ? addBlockScopedVariable : hoistVariableDeclaration,
@@ -90888,7 +90921,7 @@ function transformClassFields(context) {
90888
90921
  }
90889
90922
  function trySubstituteClassAlias(node) {
90890
90923
  if (enabledSubstitutions & 1 /* ClassAliases */) {
90891
- if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
90924
+ if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
90892
90925
  const declaration = resolver.getReferencedValueDeclaration(node);
90893
90926
  if (declaration) {
90894
90927
  const classAlias = classAliases[declaration.id];
@@ -91742,7 +91775,7 @@ function transformLegacyDecorators(context) {
91742
91775
  }
91743
91776
  }
91744
91777
  function getClassAliasIfNeeded(node) {
91745
- if (resolver.getNodeCheckFlags(node) & 1048576 /* ClassWithConstructorReference */) {
91778
+ if (resolver.getNodeCheckFlags(node) & 262144 /* ContainsConstructorReference */) {
91746
91779
  enableSubstitutionForClassAliases();
91747
91780
  const classAlias = factory2.createUniqueName(node.name && !isGeneratedIdentifier(node.name) ? idText(node.name) : "default");
91748
91781
  classAliases[getOriginalNodeId(node)] = classAlias;
@@ -91775,7 +91808,7 @@ function transformLegacyDecorators(context) {
91775
91808
  }
91776
91809
  function trySubstituteClassAlias(node) {
91777
91810
  if (classAliases) {
91778
- if (resolver.getNodeCheckFlags(node) & 2097152 /* ConstructorReferenceInClass */) {
91811
+ if (resolver.getNodeCheckFlags(node) & 536870912 /* ConstructorReference */) {
91779
91812
  const declaration = resolver.getReferencedValueDeclaration(node);
91780
91813
  if (declaration) {
91781
91814
  const classAlias = classAliases[declaration.id];
@@ -91801,6 +91834,7 @@ function transformESDecorators(context) {
91801
91834
  endLexicalEnvironment,
91802
91835
  hoistVariableDeclaration
91803
91836
  } = context;
91837
+ const languageVersion = getEmitScriptTarget(context.getCompilerOptions());
91804
91838
  let top;
91805
91839
  let classInfo;
91806
91840
  let classThis;
@@ -93302,6 +93336,17 @@ function transformESDecorators(context) {
93302
93336
  function transformDecorator(decorator) {
93303
93337
  const expression = visitNode(decorator.expression, visitor, isExpression);
93304
93338
  setEmitFlags(expression, 3072 /* NoComments */);
93339
+ const innerExpression = skipOuterExpressions(expression);
93340
+ if (isAccessExpression(innerExpression)) {
93341
+ const { target, thisArg } = factory2.createCallBinding(
93342
+ expression,
93343
+ hoistVariableDeclaration,
93344
+ languageVersion,
93345
+ /*cacheIdentifiers*/
93346
+ true
93347
+ );
93348
+ return factory2.restoreOuterExpressions(expression, factory2.createFunctionBindCall(target, thisArg, []));
93349
+ }
93305
93350
  return expression;
93306
93351
  }
93307
93352
  function createDescriptorMethod(original, name, modifiers, asteriskToken, kind, parameters, body) {
@@ -99945,10 +99990,10 @@ function transformES2015(context) {
99945
99990
  name
99946
99991
  ));
99947
99992
  const checkFlags = resolver.getNodeCheckFlags(decl);
99948
- if (checkFlags & 262144 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
99993
+ if (checkFlags & 65536 /* NeedsLoopOutParameter */ || hasCapturedBindingsInForHead) {
99949
99994
  const outParamName = factory2.createUniqueName("out_" + idText(name));
99950
99995
  let flags = 0 /* None */;
99951
- if (checkFlags & 262144 /* NeedsLoopOutParameter */) {
99996
+ if (checkFlags & 65536 /* NeedsLoopOutParameter */) {
99952
99997
  flags |= 1 /* Body */;
99953
99998
  }
99954
99999
  if (isForStatement(container)) {
@@ -102156,7 +102201,7 @@ function transformGenerators(context) {
102156
102201
  if (labelExpressions === void 0) {
102157
102202
  labelExpressions = [];
102158
102203
  }
102159
- const expression = factory2.createNumericLiteral(-1);
102204
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
102160
102205
  if (labelExpressions[label] === void 0) {
102161
102206
  labelExpressions[label] = [expression];
102162
102207
  } else {
@@ -108014,7 +108059,8 @@ function transformDeclarations(context) {
108014
108059
  if (shouldStripInternal(m))
108015
108060
  return;
108016
108061
  const constValue = resolver.getConstantValue(m);
108017
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
108062
+ const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constValue))) : factory2.createNumericLiteral(constValue);
108063
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
108018
108064
  }))));
108019
108065
  }
108020
108066
  }