typescript 5.2.0-dev.20230807 → 5.3.0-dev.20230808

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-dev.20230807`;
20
+ var versionMajorMinor = "5.3";
21
+ var version = `${versionMajorMinor}.0-dev.20230808`;
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 */;
@@ -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
  }
@@ -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)
@@ -68546,13 +68559,18 @@ function createTypeChecker(host) {
68546
68559
  if (!isErrorType(intrinsicElementsType)) {
68547
68560
  if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName))
68548
68561
  return Debug.fail();
68549
- 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);
68550
68564
  if (intrinsicProp) {
68551
68565
  links.jsxFlags |= 1 /* IntrinsicNamedElement */;
68552
68566
  return links.resolvedSymbol = intrinsicProp;
68553
68567
  }
68554
- const indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType);
68555
- 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)) {
68556
68574
  links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
68557
68575
  return links.resolvedSymbol = intrinsicElementsType.symbol;
68558
68576
  }
@@ -68730,6 +68748,7 @@ function createTypeChecker(host) {
68730
68748
  }
68731
68749
  }
68732
68750
  function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
68751
+ var _a;
68733
68752
  Debug.assert(isJsxIntrinsicTagName(node.tagName));
68734
68753
  const links = getNodeLinks(node);
68735
68754
  if (!links.resolvedJsxElementAttributesType) {
@@ -68737,7 +68756,8 @@ function createTypeChecker(host) {
68737
68756
  if (links.jsxFlags & 1 /* IntrinsicNamedElement */) {
68738
68757
  return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
68739
68758
  } else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
68740
- 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;
68741
68761
  } else {
68742
68762
  return links.resolvedJsxElementAttributesType = errorType;
68743
68763
  }
@@ -74720,9 +74740,14 @@ function createTypeChecker(host) {
74720
74740
  case 15 /* NoSubstitutionTemplateLiteral */:
74721
74741
  case 11 /* StringLiteral */:
74722
74742
  return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
74723
- case 9 /* NumericLiteral */:
74743
+ case 9 /* NumericLiteral */: {
74724
74744
  checkGrammarNumericLiteral(node);
74725
- return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
74745
+ const value = +node.text;
74746
+ if (!isFinite(value)) {
74747
+ return numberType;
74748
+ }
74749
+ return getFreshTypeOfLiteralType(getNumberLiteralType(value));
74750
+ }
74726
74751
  case 10 /* BigIntLiteral */:
74727
74752
  checkGrammarBigIntLiteral(node);
74728
74753
  return getFreshTypeOfLiteralType(getBigIntLiteralType({
@@ -80854,31 +80879,7 @@ function createTypeChecker(host) {
80854
80879
  if (name.kind === 211 /* PropertyAccessExpression */) {
80855
80880
  checkPropertyAccessExpression(name, 0 /* Normal */);
80856
80881
  if (!links.resolvedSymbol) {
80857
- const expressionType = checkExpressionCached(name.expression);
80858
- const infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name));
80859
- if (infos.length && expressionType.members) {
80860
- const resolved = resolveStructuredTypeMembers(expressionType);
80861
- const symbol = resolved.members.get("__index" /* Index */);
80862
- if (infos === getIndexInfosOfType(expressionType)) {
80863
- links.resolvedSymbol = symbol;
80864
- } else if (symbol) {
80865
- const symbolLinks2 = getSymbolLinks(symbol);
80866
- const declarationList = mapDefined(infos, (i) => i.declaration);
80867
- const nodeListId = map(declarationList, getNodeId).join(",");
80868
- if (!symbolLinks2.filteredIndexSymbolCache) {
80869
- symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
80870
- }
80871
- if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
80872
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
80873
- } else {
80874
- const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
80875
- copy.declarations = mapDefined(infos, (i) => i.declaration);
80876
- copy.parent = expressionType.aliasSymbol ? expressionType.aliasSymbol : expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent);
80877
- symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
80878
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
80879
- }
80880
- }
80881
- }
80882
+ links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name));
80882
80883
  }
80883
80884
  } else {
80884
80885
  checkQualifiedName(name, 0 /* Normal */);
@@ -80911,6 +80912,31 @@ function createTypeChecker(host) {
80911
80912
  }
80912
80913
  return void 0;
80913
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
+ }
80914
80940
  function resolveJSDocMemberName(name, ignoreErrors, container) {
80915
80941
  if (isEntityName(name)) {
80916
80942
  const meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;
@@ -81739,7 +81765,7 @@ function createTypeChecker(host) {
81739
81765
  if (enumResult)
81740
81766
  return enumResult;
81741
81767
  const literalValue = type.value;
81742
- 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);
81743
81769
  }
81744
81770
  function createLiteralConstValue(node, tracker) {
81745
81771
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -88164,7 +88190,7 @@ function transformTypeScript(context) {
88164
88190
  function transformEnumMemberDeclarationValue(member) {
88165
88191
  const value = resolver.getConstantValue(member);
88166
88192
  if (value !== void 0) {
88167
- 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);
88168
88194
  } else {
88169
88195
  enableSubstitutionForNonQualifiedEnumMembers();
88170
88196
  if (member.initializer) {
@@ -102175,7 +102201,7 @@ function transformGenerators(context) {
102175
102201
  if (labelExpressions === void 0) {
102176
102202
  labelExpressions = [];
102177
102203
  }
102178
- const expression = factory2.createNumericLiteral(-1);
102204
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
102179
102205
  if (labelExpressions[label] === void 0) {
102180
102206
  labelExpressions[label] = [expression];
102181
102207
  } else {
@@ -108033,7 +108059,8 @@ function transformDeclarations(context) {
108033
108059
  if (shouldStripInternal(m))
108034
108060
  return;
108035
108061
  const constValue = resolver.getConstantValue(m);
108036
- 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);
108037
108064
  }))));
108038
108065
  }
108039
108066
  }
package/lib/tsserver.js CHANGED
@@ -2330,8 +2330,8 @@ __export(server_exports, {
2330
2330
  module.exports = __toCommonJS(server_exports);
2331
2331
 
2332
2332
  // src/compiler/corePublic.ts
2333
- var versionMajorMinor = "5.2";
2334
- var version = `${versionMajorMinor}.0-dev.20230807`;
2333
+ var versionMajorMinor = "5.3";
2334
+ var version = `${versionMajorMinor}.0-dev.20230808`;
2335
2335
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2336
2336
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2337
2337
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -22933,8 +22933,10 @@ function createNodeFactory(flags, baseFactory2) {
22933
22933
  return update(updated, original);
22934
22934
  }
22935
22935
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
22936
+ const text = typeof value === "number" ? value + "" : value;
22937
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
22936
22938
  const node = createBaseDeclaration(9 /* NumericLiteral */);
22937
- node.text = typeof value === "number" ? value + "" : value;
22939
+ node.text = text;
22938
22940
  node.numericLiteralFlags = numericLiteralFlags;
22939
22941
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
22940
22942
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -53870,7 +53872,7 @@ function createTypeChecker(host) {
53870
53872
  return factory.createStringLiteral(name, !!singleQuote);
53871
53873
  }
53872
53874
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
53873
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
53875
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(+name))));
53874
53876
  }
53875
53877
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions));
53876
53878
  }
@@ -64537,6 +64539,7 @@ function createTypeChecker(host) {
64537
64539
  let expandingFlags = 0 /* None */;
64538
64540
  let overflow = false;
64539
64541
  let overrideNextErrorInfo = 0;
64542
+ let skipParentCounter = 0;
64540
64543
  let lastSkippedInfo;
64541
64544
  let incompatibleStack;
64542
64545
  Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
@@ -64602,6 +64605,7 @@ function createTypeChecker(host) {
64602
64605
  lastSkippedInfo = saved.lastSkippedInfo;
64603
64606
  incompatibleStack = saved.incompatibleStack;
64604
64607
  overrideNextErrorInfo = saved.overrideNextErrorInfo;
64608
+ skipParentCounter = saved.skipParentCounter;
64605
64609
  relatedInfo = saved.relatedInfo;
64606
64610
  }
64607
64611
  function captureErrorCalculationState() {
@@ -64610,6 +64614,7 @@ function createTypeChecker(host) {
64610
64614
  lastSkippedInfo,
64611
64615
  incompatibleStack: incompatibleStack == null ? void 0 : incompatibleStack.slice(),
64612
64616
  overrideNextErrorInfo,
64617
+ skipParentCounter,
64613
64618
  relatedInfo: relatedInfo == null ? void 0 : relatedInfo.slice()
64614
64619
  };
64615
64620
  }
@@ -64714,7 +64719,15 @@ function createTypeChecker(host) {
64714
64719
  reportIncompatibleStack();
64715
64720
  if (message.elidedInCompatabilityPyramid)
64716
64721
  return;
64717
- errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
64722
+ if (skipParentCounter === 0) {
64723
+ errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
64724
+ } else {
64725
+ skipParentCounter--;
64726
+ }
64727
+ }
64728
+ function reportParentSkippedError(message, ...args) {
64729
+ reportError(message, ...args);
64730
+ skipParentCounter++;
64718
64731
  }
64719
64732
  function associateRelatedInfo(info) {
64720
64733
  Debug.assert(!!errorInfo);
@@ -65051,14 +65064,14 @@ function createTypeChecker(host) {
65051
65064
  }
65052
65065
  }
65053
65066
  if (suggestion !== void 0) {
65054
- reportError(
65067
+ reportParentSkippedError(
65055
65068
  Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
65056
65069
  symbolToString(prop),
65057
65070
  typeToString(errorTarget),
65058
65071
  suggestion
65059
65072
  );
65060
65073
  } else {
65061
- reportError(
65074
+ reportParentSkippedError(
65062
65075
  Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
65063
65076
  symbolToString(prop),
65064
65077
  typeToString(errorTarget)
@@ -73255,13 +73268,18 @@ function createTypeChecker(host) {
73255
73268
  if (!isErrorType(intrinsicElementsType)) {
73256
73269
  if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName))
73257
73270
  return Debug.fail();
73258
- const intrinsicProp = getPropertyOfType(intrinsicElementsType, isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText);
73271
+ const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
73272
+ const intrinsicProp = getPropertyOfType(intrinsicElementsType, propName);
73259
73273
  if (intrinsicProp) {
73260
73274
  links.jsxFlags |= 1 /* IntrinsicNamedElement */;
73261
73275
  return links.resolvedSymbol = intrinsicProp;
73262
73276
  }
73263
- const indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType);
73264
- if (indexSignatureType) {
73277
+ const indexSymbol = getApplicableIndexSymbol(intrinsicElementsType, getStringLiteralType(unescapeLeadingUnderscores(propName)));
73278
+ if (indexSymbol) {
73279
+ links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
73280
+ return links.resolvedSymbol = indexSymbol;
73281
+ }
73282
+ if (getTypeOfPropertyOrIndexSignatureOfType(intrinsicElementsType, propName)) {
73265
73283
  links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
73266
73284
  return links.resolvedSymbol = intrinsicElementsType.symbol;
73267
73285
  }
@@ -73439,6 +73457,7 @@ function createTypeChecker(host) {
73439
73457
  }
73440
73458
  }
73441
73459
  function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
73460
+ var _a;
73442
73461
  Debug.assert(isJsxIntrinsicTagName(node.tagName));
73443
73462
  const links = getNodeLinks(node);
73444
73463
  if (!links.resolvedJsxElementAttributesType) {
@@ -73446,7 +73465,8 @@ function createTypeChecker(host) {
73446
73465
  if (links.jsxFlags & 1 /* IntrinsicNamedElement */) {
73447
73466
  return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
73448
73467
  } else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
73449
- return links.resolvedJsxElementAttributesType = getIndexTypeOfType(getJsxType(JsxNames.IntrinsicElements, node), stringType) || errorType;
73468
+ const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
73469
+ return links.resolvedJsxElementAttributesType = ((_a = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a.type) || errorType;
73450
73470
  } else {
73451
73471
  return links.resolvedJsxElementAttributesType = errorType;
73452
73472
  }
@@ -79429,9 +79449,14 @@ function createTypeChecker(host) {
79429
79449
  case 15 /* NoSubstitutionTemplateLiteral */:
79430
79450
  case 11 /* StringLiteral */:
79431
79451
  return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
79432
- case 9 /* NumericLiteral */:
79452
+ case 9 /* NumericLiteral */: {
79433
79453
  checkGrammarNumericLiteral(node);
79434
- return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
79454
+ const value = +node.text;
79455
+ if (!isFinite(value)) {
79456
+ return numberType;
79457
+ }
79458
+ return getFreshTypeOfLiteralType(getNumberLiteralType(value));
79459
+ }
79435
79460
  case 10 /* BigIntLiteral */:
79436
79461
  checkGrammarBigIntLiteral(node);
79437
79462
  return getFreshTypeOfLiteralType(getBigIntLiteralType({
@@ -85563,31 +85588,7 @@ function createTypeChecker(host) {
85563
85588
  if (name.kind === 211 /* PropertyAccessExpression */) {
85564
85589
  checkPropertyAccessExpression(name, 0 /* Normal */);
85565
85590
  if (!links.resolvedSymbol) {
85566
- const expressionType = checkExpressionCached(name.expression);
85567
- const infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name));
85568
- if (infos.length && expressionType.members) {
85569
- const resolved = resolveStructuredTypeMembers(expressionType);
85570
- const symbol = resolved.members.get("__index" /* Index */);
85571
- if (infos === getIndexInfosOfType(expressionType)) {
85572
- links.resolvedSymbol = symbol;
85573
- } else if (symbol) {
85574
- const symbolLinks2 = getSymbolLinks(symbol);
85575
- const declarationList = mapDefined(infos, (i) => i.declaration);
85576
- const nodeListId = map(declarationList, getNodeId).join(",");
85577
- if (!symbolLinks2.filteredIndexSymbolCache) {
85578
- symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
85579
- }
85580
- if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
85581
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
85582
- } else {
85583
- const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
85584
- copy.declarations = mapDefined(infos, (i) => i.declaration);
85585
- copy.parent = expressionType.aliasSymbol ? expressionType.aliasSymbol : expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent);
85586
- symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
85587
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
85588
- }
85589
- }
85590
- }
85591
+ links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name));
85591
85592
  }
85592
85593
  } else {
85593
85594
  checkQualifiedName(name, 0 /* Normal */);
@@ -85620,6 +85621,31 @@ function createTypeChecker(host) {
85620
85621
  }
85621
85622
  return void 0;
85622
85623
  }
85624
+ function getApplicableIndexSymbol(type, keyType) {
85625
+ const infos = getApplicableIndexInfos(type, keyType);
85626
+ if (infos.length && type.members) {
85627
+ const symbol = getIndexSymbolFromSymbolTable(resolveStructuredTypeMembers(type).members);
85628
+ if (infos === getIndexInfosOfType(type)) {
85629
+ return symbol;
85630
+ } else if (symbol) {
85631
+ const symbolLinks2 = getSymbolLinks(symbol);
85632
+ const declarationList = mapDefined(infos, (i) => i.declaration);
85633
+ const nodeListId = map(declarationList, getNodeId).join(",");
85634
+ if (!symbolLinks2.filteredIndexSymbolCache) {
85635
+ symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
85636
+ }
85637
+ if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
85638
+ return symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
85639
+ } else {
85640
+ const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
85641
+ copy.declarations = mapDefined(infos, (i) => i.declaration);
85642
+ copy.parent = type.aliasSymbol ? type.aliasSymbol : type.symbol ? type.symbol : getSymbolAtLocation(copy.declarations[0].parent);
85643
+ symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
85644
+ return copy;
85645
+ }
85646
+ }
85647
+ }
85648
+ }
85623
85649
  function resolveJSDocMemberName(name, ignoreErrors, container) {
85624
85650
  if (isEntityName(name)) {
85625
85651
  const meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;
@@ -86448,7 +86474,7 @@ function createTypeChecker(host) {
86448
86474
  if (enumResult)
86449
86475
  return enumResult;
86450
86476
  const literalValue = type.value;
86451
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
86477
+ 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);
86452
86478
  }
86453
86479
  function createLiteralConstValue(node, tracker) {
86454
86480
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -93044,7 +93070,7 @@ function transformTypeScript(context) {
93044
93070
  function transformEnumMemberDeclarationValue(member) {
93045
93071
  const value = resolver.getConstantValue(member);
93046
93072
  if (value !== void 0) {
93047
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
93073
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(value))) : factory2.createNumericLiteral(value);
93048
93074
  } else {
93049
93075
  enableSubstitutionForNonQualifiedEnumMembers();
93050
93076
  if (member.initializer) {
@@ -107055,7 +107081,7 @@ function transformGenerators(context) {
107055
107081
  if (labelExpressions === void 0) {
107056
107082
  labelExpressions = [];
107057
107083
  }
107058
- const expression = factory2.createNumericLiteral(-1);
107084
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
107059
107085
  if (labelExpressions[label] === void 0) {
107060
107086
  labelExpressions[label] = [expression];
107061
107087
  } else {
@@ -112913,7 +112939,8 @@ function transformDeclarations(context) {
112913
112939
  if (shouldStripInternal(m))
112914
112940
  return;
112915
112941
  const constValue = resolver.getConstantValue(m);
112916
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
112942
+ 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);
112943
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
112917
112944
  }))));
112918
112945
  }
112919
112946
  }
@@ -4074,7 +4074,7 @@ declare namespace ts {
4074
4074
  responseRequired?: boolean;
4075
4075
  }
4076
4076
  }
4077
- const versionMajorMinor = "5.2";
4077
+ const versionMajorMinor = "5.3";
4078
4078
  /** The version of the TypeScript compiler release */
4079
4079
  const version: string;
4080
4080
  /**
@@ -34,8 +34,8 @@ var ts = (() => {
34
34
  var init_corePublic = __esm({
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
- versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230807`;
37
+ versionMajorMinor = "5.3";
38
+ version = `${versionMajorMinor}.0-dev.20230808`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -20744,8 +20744,10 @@ ${lanes.join("\n")}
20744
20744
  return update(updated, original);
20745
20745
  }
20746
20746
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
20747
+ const text = typeof value === "number" ? value + "" : value;
20748
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
20747
20749
  const node = createBaseDeclaration(9 /* NumericLiteral */);
20748
- node.text = typeof value === "number" ? value + "" : value;
20750
+ node.text = text;
20749
20751
  node.numericLiteralFlags = numericLiteralFlags;
20750
20752
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
20751
20753
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -51633,7 +51635,7 @@ ${lanes.join("\n")}
51633
51635
  return factory.createStringLiteral(name, !!singleQuote);
51634
51636
  }
51635
51637
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
51636
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
51638
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(+name))));
51637
51639
  }
51638
51640
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions));
51639
51641
  }
@@ -62300,6 +62302,7 @@ ${lanes.join("\n")}
62300
62302
  let expandingFlags = 0 /* None */;
62301
62303
  let overflow = false;
62302
62304
  let overrideNextErrorInfo = 0;
62305
+ let skipParentCounter = 0;
62303
62306
  let lastSkippedInfo;
62304
62307
  let incompatibleStack;
62305
62308
  Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
@@ -62365,6 +62368,7 @@ ${lanes.join("\n")}
62365
62368
  lastSkippedInfo = saved.lastSkippedInfo;
62366
62369
  incompatibleStack = saved.incompatibleStack;
62367
62370
  overrideNextErrorInfo = saved.overrideNextErrorInfo;
62371
+ skipParentCounter = saved.skipParentCounter;
62368
62372
  relatedInfo = saved.relatedInfo;
62369
62373
  }
62370
62374
  function captureErrorCalculationState() {
@@ -62373,6 +62377,7 @@ ${lanes.join("\n")}
62373
62377
  lastSkippedInfo,
62374
62378
  incompatibleStack: incompatibleStack == null ? void 0 : incompatibleStack.slice(),
62375
62379
  overrideNextErrorInfo,
62380
+ skipParentCounter,
62376
62381
  relatedInfo: relatedInfo == null ? void 0 : relatedInfo.slice()
62377
62382
  };
62378
62383
  }
@@ -62477,7 +62482,15 @@ ${lanes.join("\n")}
62477
62482
  reportIncompatibleStack();
62478
62483
  if (message.elidedInCompatabilityPyramid)
62479
62484
  return;
62480
- errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
62485
+ if (skipParentCounter === 0) {
62486
+ errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
62487
+ } else {
62488
+ skipParentCounter--;
62489
+ }
62490
+ }
62491
+ function reportParentSkippedError(message, ...args) {
62492
+ reportError(message, ...args);
62493
+ skipParentCounter++;
62481
62494
  }
62482
62495
  function associateRelatedInfo(info) {
62483
62496
  Debug.assert(!!errorInfo);
@@ -62814,14 +62827,14 @@ ${lanes.join("\n")}
62814
62827
  }
62815
62828
  }
62816
62829
  if (suggestion !== void 0) {
62817
- reportError(
62830
+ reportParentSkippedError(
62818
62831
  Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
62819
62832
  symbolToString(prop),
62820
62833
  typeToString(errorTarget),
62821
62834
  suggestion
62822
62835
  );
62823
62836
  } else {
62824
- reportError(
62837
+ reportParentSkippedError(
62825
62838
  Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
62826
62839
  symbolToString(prop),
62827
62840
  typeToString(errorTarget)
@@ -71018,13 +71031,18 @@ ${lanes.join("\n")}
71018
71031
  if (!isErrorType(intrinsicElementsType)) {
71019
71032
  if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName))
71020
71033
  return Debug.fail();
71021
- const intrinsicProp = getPropertyOfType(intrinsicElementsType, isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText);
71034
+ const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
71035
+ const intrinsicProp = getPropertyOfType(intrinsicElementsType, propName);
71022
71036
  if (intrinsicProp) {
71023
71037
  links.jsxFlags |= 1 /* IntrinsicNamedElement */;
71024
71038
  return links.resolvedSymbol = intrinsicProp;
71025
71039
  }
71026
- const indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType);
71027
- if (indexSignatureType) {
71040
+ const indexSymbol = getApplicableIndexSymbol(intrinsicElementsType, getStringLiteralType(unescapeLeadingUnderscores(propName)));
71041
+ if (indexSymbol) {
71042
+ links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
71043
+ return links.resolvedSymbol = indexSymbol;
71044
+ }
71045
+ if (getTypeOfPropertyOrIndexSignatureOfType(intrinsicElementsType, propName)) {
71028
71046
  links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
71029
71047
  return links.resolvedSymbol = intrinsicElementsType.symbol;
71030
71048
  }
@@ -71202,6 +71220,7 @@ ${lanes.join("\n")}
71202
71220
  }
71203
71221
  }
71204
71222
  function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
71223
+ var _a;
71205
71224
  Debug.assert(isJsxIntrinsicTagName(node.tagName));
71206
71225
  const links = getNodeLinks(node);
71207
71226
  if (!links.resolvedJsxElementAttributesType) {
@@ -71209,7 +71228,8 @@ ${lanes.join("\n")}
71209
71228
  if (links.jsxFlags & 1 /* IntrinsicNamedElement */) {
71210
71229
  return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
71211
71230
  } else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
71212
- return links.resolvedJsxElementAttributesType = getIndexTypeOfType(getJsxType(JsxNames.IntrinsicElements, node), stringType) || errorType;
71231
+ const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
71232
+ return links.resolvedJsxElementAttributesType = ((_a = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a.type) || errorType;
71213
71233
  } else {
71214
71234
  return links.resolvedJsxElementAttributesType = errorType;
71215
71235
  }
@@ -77192,9 +77212,14 @@ ${lanes.join("\n")}
77192
77212
  case 15 /* NoSubstitutionTemplateLiteral */:
77193
77213
  case 11 /* StringLiteral */:
77194
77214
  return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
77195
- case 9 /* NumericLiteral */:
77215
+ case 9 /* NumericLiteral */: {
77196
77216
  checkGrammarNumericLiteral(node);
77197
- return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
77217
+ const value = +node.text;
77218
+ if (!isFinite(value)) {
77219
+ return numberType;
77220
+ }
77221
+ return getFreshTypeOfLiteralType(getNumberLiteralType(value));
77222
+ }
77198
77223
  case 10 /* BigIntLiteral */:
77199
77224
  checkGrammarBigIntLiteral(node);
77200
77225
  return getFreshTypeOfLiteralType(getBigIntLiteralType({
@@ -83326,31 +83351,7 @@ ${lanes.join("\n")}
83326
83351
  if (name.kind === 211 /* PropertyAccessExpression */) {
83327
83352
  checkPropertyAccessExpression(name, 0 /* Normal */);
83328
83353
  if (!links.resolvedSymbol) {
83329
- const expressionType = checkExpressionCached(name.expression);
83330
- const infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name));
83331
- if (infos.length && expressionType.members) {
83332
- const resolved = resolveStructuredTypeMembers(expressionType);
83333
- const symbol = resolved.members.get("__index" /* Index */);
83334
- if (infos === getIndexInfosOfType(expressionType)) {
83335
- links.resolvedSymbol = symbol;
83336
- } else if (symbol) {
83337
- const symbolLinks2 = getSymbolLinks(symbol);
83338
- const declarationList = mapDefined(infos, (i) => i.declaration);
83339
- const nodeListId = map(declarationList, getNodeId).join(",");
83340
- if (!symbolLinks2.filteredIndexSymbolCache) {
83341
- symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
83342
- }
83343
- if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
83344
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
83345
- } else {
83346
- const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
83347
- copy.declarations = mapDefined(infos, (i) => i.declaration);
83348
- copy.parent = expressionType.aliasSymbol ? expressionType.aliasSymbol : expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent);
83349
- symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
83350
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
83351
- }
83352
- }
83353
- }
83354
+ links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name));
83354
83355
  }
83355
83356
  } else {
83356
83357
  checkQualifiedName(name, 0 /* Normal */);
@@ -83383,6 +83384,31 @@ ${lanes.join("\n")}
83383
83384
  }
83384
83385
  return void 0;
83385
83386
  }
83387
+ function getApplicableIndexSymbol(type, keyType) {
83388
+ const infos = getApplicableIndexInfos(type, keyType);
83389
+ if (infos.length && type.members) {
83390
+ const symbol = getIndexSymbolFromSymbolTable(resolveStructuredTypeMembers(type).members);
83391
+ if (infos === getIndexInfosOfType(type)) {
83392
+ return symbol;
83393
+ } else if (symbol) {
83394
+ const symbolLinks2 = getSymbolLinks(symbol);
83395
+ const declarationList = mapDefined(infos, (i) => i.declaration);
83396
+ const nodeListId = map(declarationList, getNodeId).join(",");
83397
+ if (!symbolLinks2.filteredIndexSymbolCache) {
83398
+ symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
83399
+ }
83400
+ if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
83401
+ return symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
83402
+ } else {
83403
+ const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
83404
+ copy.declarations = mapDefined(infos, (i) => i.declaration);
83405
+ copy.parent = type.aliasSymbol ? type.aliasSymbol : type.symbol ? type.symbol : getSymbolAtLocation(copy.declarations[0].parent);
83406
+ symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
83407
+ return copy;
83408
+ }
83409
+ }
83410
+ }
83411
+ }
83386
83412
  function resolveJSDocMemberName(name, ignoreErrors, container) {
83387
83413
  if (isEntityName(name)) {
83388
83414
  const meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;
@@ -84211,7 +84237,7 @@ ${lanes.join("\n")}
84211
84237
  if (enumResult)
84212
84238
  return enumResult;
84213
84239
  const literalValue = type.value;
84214
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
84240
+ 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);
84215
84241
  }
84216
84242
  function createLiteralConstValue(node, tracker) {
84217
84243
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -90988,7 +91014,7 @@ ${lanes.join("\n")}
90988
91014
  function transformEnumMemberDeclarationValue(member) {
90989
91015
  const value = resolver.getConstantValue(member);
90990
91016
  if (value !== void 0) {
90991
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
91017
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(value))) : factory2.createNumericLiteral(value);
90992
91018
  } else {
90993
91019
  enableSubstitutionForNonQualifiedEnumMembers();
90994
91020
  if (member.initializer) {
@@ -105092,7 +105118,7 @@ ${lanes.join("\n")}
105092
105118
  if (labelExpressions === void 0) {
105093
105119
  labelExpressions = [];
105094
105120
  }
105095
- const expression = factory2.createNumericLiteral(-1);
105121
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
105096
105122
  if (labelExpressions[label] === void 0) {
105097
105123
  labelExpressions[label] = [expression];
105098
105124
  } else {
@@ -110986,7 +111012,8 @@ ${lanes.join("\n")}
110986
111012
  if (shouldStripInternal(m))
110987
111013
  return;
110988
111014
  const constValue = resolver.getConstantValue(m);
110989
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
111015
+ 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);
111016
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
110990
111017
  }))));
110991
111018
  }
110992
111019
  }
@@ -14,7 +14,7 @@ and limitations under the License.
14
14
  ***************************************************************************** */
15
15
 
16
16
  declare namespace ts {
17
- const versionMajorMinor = "5.2";
17
+ const versionMajorMinor = "5.3";
18
18
  /** The version of the TypeScript compiler release */
19
19
  const version: string;
20
20
  /**
package/lib/typescript.js CHANGED
@@ -34,8 +34,8 @@ var ts = (() => {
34
34
  var init_corePublic = __esm({
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
- versionMajorMinor = "5.2";
38
- version = `${versionMajorMinor}.0-dev.20230807`;
37
+ versionMajorMinor = "5.3";
38
+ version = `${versionMajorMinor}.0-dev.20230808`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -20744,8 +20744,10 @@ ${lanes.join("\n")}
20744
20744
  return update(updated, original);
20745
20745
  }
20746
20746
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
20747
+ const text = typeof value === "number" ? value + "" : value;
20748
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
20747
20749
  const node = createBaseDeclaration(9 /* NumericLiteral */);
20748
- node.text = typeof value === "number" ? value + "" : value;
20750
+ node.text = text;
20749
20751
  node.numericLiteralFlags = numericLiteralFlags;
20750
20752
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
20751
20753
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -51633,7 +51635,7 @@ ${lanes.join("\n")}
51633
51635
  return factory.createStringLiteral(name, !!singleQuote);
51634
51636
  }
51635
51637
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
51636
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
51638
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(Math.abs(+name))));
51637
51639
  }
51638
51640
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions));
51639
51641
  }
@@ -62300,6 +62302,7 @@ ${lanes.join("\n")}
62300
62302
  let expandingFlags = 0 /* None */;
62301
62303
  let overflow = false;
62302
62304
  let overrideNextErrorInfo = 0;
62305
+ let skipParentCounter = 0;
62303
62306
  let lastSkippedInfo;
62304
62307
  let incompatibleStack;
62305
62308
  Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
@@ -62365,6 +62368,7 @@ ${lanes.join("\n")}
62365
62368
  lastSkippedInfo = saved.lastSkippedInfo;
62366
62369
  incompatibleStack = saved.incompatibleStack;
62367
62370
  overrideNextErrorInfo = saved.overrideNextErrorInfo;
62371
+ skipParentCounter = saved.skipParentCounter;
62368
62372
  relatedInfo = saved.relatedInfo;
62369
62373
  }
62370
62374
  function captureErrorCalculationState() {
@@ -62373,6 +62377,7 @@ ${lanes.join("\n")}
62373
62377
  lastSkippedInfo,
62374
62378
  incompatibleStack: incompatibleStack == null ? void 0 : incompatibleStack.slice(),
62375
62379
  overrideNextErrorInfo,
62380
+ skipParentCounter,
62376
62381
  relatedInfo: relatedInfo == null ? void 0 : relatedInfo.slice()
62377
62382
  };
62378
62383
  }
@@ -62477,7 +62482,15 @@ ${lanes.join("\n")}
62477
62482
  reportIncompatibleStack();
62478
62483
  if (message.elidedInCompatabilityPyramid)
62479
62484
  return;
62480
- errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
62485
+ if (skipParentCounter === 0) {
62486
+ errorInfo = chainDiagnosticMessages(errorInfo, message, ...args);
62487
+ } else {
62488
+ skipParentCounter--;
62489
+ }
62490
+ }
62491
+ function reportParentSkippedError(message, ...args) {
62492
+ reportError(message, ...args);
62493
+ skipParentCounter++;
62481
62494
  }
62482
62495
  function associateRelatedInfo(info) {
62483
62496
  Debug.assert(!!errorInfo);
@@ -62814,14 +62827,14 @@ ${lanes.join("\n")}
62814
62827
  }
62815
62828
  }
62816
62829
  if (suggestion !== void 0) {
62817
- reportError(
62830
+ reportParentSkippedError(
62818
62831
  Diagnostics.Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2,
62819
62832
  symbolToString(prop),
62820
62833
  typeToString(errorTarget),
62821
62834
  suggestion
62822
62835
  );
62823
62836
  } else {
62824
- reportError(
62837
+ reportParentSkippedError(
62825
62838
  Diagnostics.Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1,
62826
62839
  symbolToString(prop),
62827
62840
  typeToString(errorTarget)
@@ -71018,13 +71031,18 @@ ${lanes.join("\n")}
71018
71031
  if (!isErrorType(intrinsicElementsType)) {
71019
71032
  if (!isIdentifier(node.tagName) && !isJsxNamespacedName(node.tagName))
71020
71033
  return Debug.fail();
71021
- const intrinsicProp = getPropertyOfType(intrinsicElementsType, isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText);
71034
+ const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
71035
+ const intrinsicProp = getPropertyOfType(intrinsicElementsType, propName);
71022
71036
  if (intrinsicProp) {
71023
71037
  links.jsxFlags |= 1 /* IntrinsicNamedElement */;
71024
71038
  return links.resolvedSymbol = intrinsicProp;
71025
71039
  }
71026
- const indexSignatureType = getIndexTypeOfType(intrinsicElementsType, stringType);
71027
- if (indexSignatureType) {
71040
+ const indexSymbol = getApplicableIndexSymbol(intrinsicElementsType, getStringLiteralType(unescapeLeadingUnderscores(propName)));
71041
+ if (indexSymbol) {
71042
+ links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
71043
+ return links.resolvedSymbol = indexSymbol;
71044
+ }
71045
+ if (getTypeOfPropertyOrIndexSignatureOfType(intrinsicElementsType, propName)) {
71028
71046
  links.jsxFlags |= 2 /* IntrinsicIndexedElement */;
71029
71047
  return links.resolvedSymbol = intrinsicElementsType.symbol;
71030
71048
  }
@@ -71202,6 +71220,7 @@ ${lanes.join("\n")}
71202
71220
  }
71203
71221
  }
71204
71222
  function getIntrinsicAttributesTypeFromJsxOpeningLikeElement(node) {
71223
+ var _a;
71205
71224
  Debug.assert(isJsxIntrinsicTagName(node.tagName));
71206
71225
  const links = getNodeLinks(node);
71207
71226
  if (!links.resolvedJsxElementAttributesType) {
@@ -71209,7 +71228,8 @@ ${lanes.join("\n")}
71209
71228
  if (links.jsxFlags & 1 /* IntrinsicNamedElement */) {
71210
71229
  return links.resolvedJsxElementAttributesType = getTypeOfSymbol(symbol) || errorType;
71211
71230
  } else if (links.jsxFlags & 2 /* IntrinsicIndexedElement */) {
71212
- return links.resolvedJsxElementAttributesType = getIndexTypeOfType(getJsxType(JsxNames.IntrinsicElements, node), stringType) || errorType;
71231
+ const propName = isJsxNamespacedName(node.tagName) ? getEscapedTextOfJsxNamespacedName(node.tagName) : node.tagName.escapedText;
71232
+ return links.resolvedJsxElementAttributesType = ((_a = getApplicableIndexInfoForName(getJsxType(JsxNames.IntrinsicElements, node), propName)) == null ? void 0 : _a.type) || errorType;
71213
71233
  } else {
71214
71234
  return links.resolvedJsxElementAttributesType = errorType;
71215
71235
  }
@@ -77192,9 +77212,14 @@ ${lanes.join("\n")}
77192
77212
  case 15 /* NoSubstitutionTemplateLiteral */:
77193
77213
  case 11 /* StringLiteral */:
77194
77214
  return hasSkipDirectInferenceFlag(node) ? wildcardType : getFreshTypeOfLiteralType(getStringLiteralType(node.text));
77195
- case 9 /* NumericLiteral */:
77215
+ case 9 /* NumericLiteral */: {
77196
77216
  checkGrammarNumericLiteral(node);
77197
- return getFreshTypeOfLiteralType(getNumberLiteralType(+node.text));
77217
+ const value = +node.text;
77218
+ if (!isFinite(value)) {
77219
+ return numberType;
77220
+ }
77221
+ return getFreshTypeOfLiteralType(getNumberLiteralType(value));
77222
+ }
77198
77223
  case 10 /* BigIntLiteral */:
77199
77224
  checkGrammarBigIntLiteral(node);
77200
77225
  return getFreshTypeOfLiteralType(getBigIntLiteralType({
@@ -83326,31 +83351,7 @@ ${lanes.join("\n")}
83326
83351
  if (name.kind === 211 /* PropertyAccessExpression */) {
83327
83352
  checkPropertyAccessExpression(name, 0 /* Normal */);
83328
83353
  if (!links.resolvedSymbol) {
83329
- const expressionType = checkExpressionCached(name.expression);
83330
- const infos = getApplicableIndexInfos(expressionType, getLiteralTypeFromPropertyName(name.name));
83331
- if (infos.length && expressionType.members) {
83332
- const resolved = resolveStructuredTypeMembers(expressionType);
83333
- const symbol = resolved.members.get("__index" /* Index */);
83334
- if (infos === getIndexInfosOfType(expressionType)) {
83335
- links.resolvedSymbol = symbol;
83336
- } else if (symbol) {
83337
- const symbolLinks2 = getSymbolLinks(symbol);
83338
- const declarationList = mapDefined(infos, (i) => i.declaration);
83339
- const nodeListId = map(declarationList, getNodeId).join(",");
83340
- if (!symbolLinks2.filteredIndexSymbolCache) {
83341
- symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
83342
- }
83343
- if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
83344
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
83345
- } else {
83346
- const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
83347
- copy.declarations = mapDefined(infos, (i) => i.declaration);
83348
- copy.parent = expressionType.aliasSymbol ? expressionType.aliasSymbol : expressionType.symbol ? expressionType.symbol : getSymbolAtLocation(copy.declarations[0].parent);
83349
- symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
83350
- links.resolvedSymbol = symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
83351
- }
83352
- }
83353
- }
83354
+ links.resolvedSymbol = getApplicableIndexSymbol(checkExpressionCached(name.expression), getLiteralTypeFromPropertyName(name.name));
83354
83355
  }
83355
83356
  } else {
83356
83357
  checkQualifiedName(name, 0 /* Normal */);
@@ -83383,6 +83384,31 @@ ${lanes.join("\n")}
83383
83384
  }
83384
83385
  return void 0;
83385
83386
  }
83387
+ function getApplicableIndexSymbol(type, keyType) {
83388
+ const infos = getApplicableIndexInfos(type, keyType);
83389
+ if (infos.length && type.members) {
83390
+ const symbol = getIndexSymbolFromSymbolTable(resolveStructuredTypeMembers(type).members);
83391
+ if (infos === getIndexInfosOfType(type)) {
83392
+ return symbol;
83393
+ } else if (symbol) {
83394
+ const symbolLinks2 = getSymbolLinks(symbol);
83395
+ const declarationList = mapDefined(infos, (i) => i.declaration);
83396
+ const nodeListId = map(declarationList, getNodeId).join(",");
83397
+ if (!symbolLinks2.filteredIndexSymbolCache) {
83398
+ symbolLinks2.filteredIndexSymbolCache = /* @__PURE__ */ new Map();
83399
+ }
83400
+ if (symbolLinks2.filteredIndexSymbolCache.has(nodeListId)) {
83401
+ return symbolLinks2.filteredIndexSymbolCache.get(nodeListId);
83402
+ } else {
83403
+ const copy = createSymbol(131072 /* Signature */, "__index" /* Index */);
83404
+ copy.declarations = mapDefined(infos, (i) => i.declaration);
83405
+ copy.parent = type.aliasSymbol ? type.aliasSymbol : type.symbol ? type.symbol : getSymbolAtLocation(copy.declarations[0].parent);
83406
+ symbolLinks2.filteredIndexSymbolCache.set(nodeListId, copy);
83407
+ return copy;
83408
+ }
83409
+ }
83410
+ }
83411
+ }
83386
83412
  function resolveJSDocMemberName(name, ignoreErrors, container) {
83387
83413
  if (isEntityName(name)) {
83388
83414
  const meaning = 788968 /* Type */ | 1920 /* Namespace */ | 111551 /* Value */;
@@ -84211,7 +84237,7 @@ ${lanes.join("\n")}
84211
84237
  if (enumResult)
84212
84238
  return enumResult;
84213
84239
  const literalValue = type.value;
84214
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
84240
+ 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);
84215
84241
  }
84216
84242
  function createLiteralConstValue(node, tracker) {
84217
84243
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -90988,7 +91014,7 @@ ${lanes.join("\n")}
90988
91014
  function transformEnumMemberDeclarationValue(member) {
90989
91015
  const value = resolver.getConstantValue(member);
90990
91016
  if (value !== void 0) {
90991
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
91017
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(value))) : factory2.createNumericLiteral(value);
90992
91018
  } else {
90993
91019
  enableSubstitutionForNonQualifiedEnumMembers();
90994
91020
  if (member.initializer) {
@@ -105092,7 +105118,7 @@ ${lanes.join("\n")}
105092
105118
  if (labelExpressions === void 0) {
105093
105119
  labelExpressions = [];
105094
105120
  }
105095
- const expression = factory2.createNumericLiteral(-1);
105121
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
105096
105122
  if (labelExpressions[label] === void 0) {
105097
105123
  labelExpressions[label] = [expression];
105098
105124
  } else {
@@ -110986,7 +111012,8 @@ ${lanes.join("\n")}
110986
111012
  if (shouldStripInternal(m))
110987
111013
  return;
110988
111014
  const constValue = resolver.getConstantValue(m);
110989
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
111015
+ 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);
111016
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
110990
111017
  }))));
110991
111018
  }
110992
111019
  }
@@ -53,8 +53,8 @@ var fs = __toESM(require("fs"));
53
53
  var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
- var versionMajorMinor = "5.2";
57
- var version = `${versionMajorMinor}.0-dev.20230807`;
56
+ var versionMajorMinor = "5.3";
57
+ var version = `${versionMajorMinor}.0-dev.20230808`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -13013,8 +13013,10 @@ function createNodeFactory(flags, baseFactory2) {
13013
13013
  return update(updated, original);
13014
13014
  }
13015
13015
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
13016
+ const text = typeof value === "number" ? value + "" : value;
13017
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
13016
13018
  const node = createBaseDeclaration(9 /* NumericLiteral */);
13017
- node.text = typeof value === "number" ? value + "" : value;
13019
+ node.text = text;
13018
13020
  node.numericLiteralFlags = numericLiteralFlags;
13019
13021
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
13020
13022
  node.transformFlags |= 1024 /* ContainsES2015 */;
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.20230807",
5
+ "version": "5.3.0-dev.20230808",
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": "e936eb13d2900f21d79553c32a704307c7ad03dd"
116
+ "gitHead": "358842e45e06fa4aca3e946f311921e7c732bf37"
117
117
  }