@typescript-deploys/pr-build 5.3.0-pr-55503-5 → 5.3.0-pr-55452-7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/tsc.js CHANGED
@@ -18,7 +18,7 @@ and limitations under the License.
18
18
 
19
19
  // src/compiler/corePublic.ts
20
20
  var versionMajorMinor = "5.3";
21
- var version = `${versionMajorMinor}.0-insiders.20230824`;
21
+ var version = `${versionMajorMinor}.0-insiders.20230825`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -5955,6 +5955,7 @@ var Diagnostics = {
5955
5955
  Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, 1 /* Error */, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"),
5956
5956
  Keywords_cannot_contain_escape_characters: diag(1260, 1 /* Error */, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."),
5957
5957
  Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, 1 /* Error */, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."),
5958
+ Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."),
5958
5959
  Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, 1 /* Error */, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."),
5959
5960
  Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, 1 /* Error */, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."),
5960
5961
  A_rest_element_cannot_follow_another_rest_element: diag(1265, 1 /* Error */, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."),
@@ -17483,6 +17484,9 @@ function getPropertyNameFromType(type) {
17483
17484
  }
17484
17485
  return Debug.fail();
17485
17486
  }
17487
+ function isNamedTupleMemberName(node) {
17488
+ return node.kind === 80 /* Identifier */ || node.kind === 203 /* TemplateLiteralType */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */;
17489
+ }
17486
17490
 
17487
17491
  // src/compiler/factory/baseNodeFactory.ts
17488
17492
  function createBaseNodeFactory() {
@@ -28656,21 +28660,29 @@ var Parser;
28656
28660
  }
28657
28661
  return type;
28658
28662
  }
28659
- function isNextTokenColonOrQuestionColon() {
28660
- return nextToken() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
28663
+ function isTokenColonOrQuestionColon() {
28664
+ return token() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
28661
28665
  }
28662
28666
  function isTupleElementName() {
28663
28667
  if (token() === 26 /* DotDotDotToken */) {
28664
- return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon();
28668
+ nextToken();
28665
28669
  }
28666
- return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon();
28670
+ if (token() === 16 /* TemplateHead */) {
28671
+ parseTemplateType();
28672
+ return isTokenColonOrQuestionColon();
28673
+ }
28674
+ if (tokenIsIdentifierOrKeyword(token()) || token() === 15 /* NoSubstitutionTemplateLiteral */) {
28675
+ nextToken();
28676
+ return isTokenColonOrQuestionColon();
28677
+ }
28678
+ return false;
28667
28679
  }
28668
28680
  function parseTupleElementNameOrTupleElementType() {
28669
28681
  if (lookAhead(isTupleElementName)) {
28670
28682
  const pos = getNodePos();
28671
28683
  const hasJSDoc = hasPrecedingJSDocComment();
28672
28684
  const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
28673
- const name = parseIdentifierName();
28685
+ const name = token() === 15 /* NoSubstitutionTemplateLiteral */ ? parseLiteralLikeNode(token()) : token() === 16 /* TemplateHead */ ? parseTemplateType() : parseIdentifierName();
28674
28686
  const questionToken = parseOptionalToken(58 /* QuestionToken */);
28675
28687
  parseExpected(59 /* ColonToken */);
28676
28688
  const type = parseTupleElementType();
@@ -40899,8 +40911,12 @@ function createBinder() {
40899
40911
  }
40900
40912
  if (inStrictMode && originalKeywordKind >= 119 /* FirstFutureReservedWord */ && originalKeywordKind <= 127 /* LastFutureReservedWord */) {
40901
40913
  file.bindDiagnostics.push(createDiagnosticForNode2(node, getStrictModeIdentifierMessage(node), declarationNameToString(node)));
40902
- } else if (originalKeywordKind === 135 /* AwaitKeyword */ && (node.flags & 65536 /* AwaitContext */ || isExternalModule(file))) {
40903
- file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
40914
+ } else if (originalKeywordKind === 135 /* AwaitKeyword */) {
40915
+ if (isExternalModule(file) && isInTopLevelContext(node)) {
40916
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, declarationNameToString(node)));
40917
+ } else if (node.flags & 65536 /* AwaitContext */) {
40918
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
40919
+ }
40904
40920
  } else if (originalKeywordKind === 127 /* YieldKeyword */ && node.flags & 16384 /* YieldContext */) {
40905
40921
  file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
40906
40922
  }
@@ -48078,10 +48094,11 @@ function createTypeChecker(host) {
48078
48094
  for (let i = 0; i < tupleConstituentNodes.length; i++) {
48079
48095
  const flags = type2.target.elementFlags[i];
48080
48096
  const labeledElementDeclaration = labeledElementDeclarations == null ? void 0 : labeledElementDeclarations[i];
48081
- if (labeledElementDeclaration) {
48097
+ const label = labeledElementDeclaration && getTupleElementLabel(type2, labeledElementDeclaration);
48098
+ if (label) {
48082
48099
  tupleConstituentNodes[i] = factory.createNamedTupleMember(
48083
48100
  flags & 12 /* Variable */ ? factory.createToken(26 /* DotDotDotToken */) : void 0,
48084
- factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(labeledElementDeclaration))),
48101
+ factory.createIdentifier(unescapeLeadingUnderscores(label)),
48085
48102
  flags & 2 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
48086
48103
  flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]
48087
48104
  );
@@ -53305,7 +53322,7 @@ function createTypeChecker(host) {
53305
53322
  function getUniqAssociatedNamesFromTupleType(type, restName) {
53306
53323
  const associatedNamesMap = /* @__PURE__ */ new Map();
53307
53324
  return map(type.target.labeledElementDeclarations, (labeledElement, i) => {
53308
- const name = getTupleElementLabel(labeledElement, i, restName);
53325
+ const name = getTupleElementLabel(type, labeledElement, i, restName);
53309
53326
  const prevCounter = associatedNamesMap.get(name);
53310
53327
  if (prevCounter === void 0) {
53311
53328
  associatedNamesMap.set(name, 1);
@@ -72082,11 +72099,18 @@ function createTypeChecker(host) {
72082
72099
  !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration))
72083
72100
  );
72084
72101
  }
72085
- function getTupleElementLabel(d, index, restParameterName = "arg") {
72102
+ function getTupleElementLabel(tupleType, d, index, restParameterName = "arg") {
72086
72103
  if (!d) {
72087
72104
  return `${restParameterName}_${index}`;
72088
72105
  }
72089
- Debug.assert(isIdentifier(d.name));
72106
+ Debug.assert(!isBindingPattern(d.name));
72107
+ if (d.name.kind === 203 /* TemplateLiteralType */) {
72108
+ const label = instantiateType(getTypeFromTypeNode(d.name), tupleType.mapper);
72109
+ return label.flags & 128 /* StringLiteral */ ? escapeLeadingUnderscores(label.value) : typeof index === "number" ? `${restParameterName}_${index}` : void 0;
72110
+ }
72111
+ if (d.name.kind === 15 /* NoSubstitutionTemplateLiteral */) {
72112
+ return escapeLeadingUnderscores(d.name.text);
72113
+ }
72090
72114
  return d.name.escapedText;
72091
72115
  }
72092
72116
  function getParameterNameAtPosition(signature, pos, overrideRestType) {
@@ -72099,7 +72123,7 @@ function createTypeChecker(host) {
72099
72123
  if (isTupleType(restType)) {
72100
72124
  const associatedNames = restType.target.labeledElementDeclarations;
72101
72125
  const index = pos - paramCount;
72102
- return getTupleElementLabel(associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
72126
+ return getTupleElementLabel(restType, associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
72103
72127
  }
72104
72128
  return restParameter.escapedName;
72105
72129
  }
@@ -72129,8 +72153,7 @@ function createTypeChecker(host) {
72129
72153
  const index = pos - paramCount;
72130
72154
  const associatedName = associatedNames == null ? void 0 : associatedNames[index];
72131
72155
  const isRestTupleElement = !!(associatedName == null ? void 0 : associatedName.dotDotDotToken);
72132
- if (associatedName) {
72133
- Debug.assert(isIdentifier(associatedName.name));
72156
+ if (associatedName && isIdentifier(associatedName.name)) {
72134
72157
  return { parameter: associatedName.name, parameterName: associatedName.name.escapedText, isRestParameter: isRestTupleElement };
72135
72158
  }
72136
72159
  return void 0;
@@ -75635,6 +75658,9 @@ function createTypeChecker(host) {
75635
75658
  if (node.type.kind === 191 /* RestType */) {
75636
75659
  grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
75637
75660
  }
75661
+ if (node.name.kind === 203 /* TemplateLiteralType */) {
75662
+ checkSourceElement(node.name);
75663
+ }
75638
75664
  checkSourceElement(node.type);
75639
75665
  getTypeFromTypeNode(node);
75640
75666
  }
@@ -84446,7 +84472,7 @@ var visitEachChildTable = {
84446
84472
  return context.factory.updateNamedTupleMember(
84447
84473
  node,
84448
84474
  tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken,
84449
- Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)),
84475
+ Debug.checkDefined(nodeVisitor(node.name, visitor, isNamedTupleMemberName)),
84450
84476
  tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken,
84451
84477
  Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode))
84452
84478
  );
@@ -115287,6 +115313,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
115287
115313
  Diagnostics.A_module_cannot_have_multiple_default_exports.code,
115288
115314
  Diagnostics.Another_export_default_is_here.code,
115289
115315
  Diagnostics.The_first_export_default_is_here.code,
115316
+ Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
115290
115317
  Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
115291
115318
  Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
115292
115319
  Diagnostics.constructor_is_a_reserved_word.code,
package/lib/tsserver.js CHANGED
@@ -1587,6 +1587,7 @@ __export(server_exports, {
1587
1587
  isNamedImports: () => isNamedImports,
1588
1588
  isNamedImportsOrExports: () => isNamedImportsOrExports,
1589
1589
  isNamedTupleMember: () => isNamedTupleMember,
1590
+ isNamedTupleMemberName: () => isNamedTupleMemberName,
1590
1591
  isNamespaceBody: () => isNamespaceBody,
1591
1592
  isNamespaceExport: () => isNamespaceExport,
1592
1593
  isNamespaceExportDeclaration: () => isNamespaceExportDeclaration,
@@ -2333,7 +2334,7 @@ module.exports = __toCommonJS(server_exports);
2333
2334
 
2334
2335
  // src/compiler/corePublic.ts
2335
2336
  var versionMajorMinor = "5.3";
2336
- var version = `${versionMajorMinor}.0-insiders.20230824`;
2337
+ var version = `${versionMajorMinor}.0-insiders.20230825`;
2337
2338
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2338
2339
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2339
2340
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -9480,6 +9481,7 @@ var Diagnostics = {
9480
9481
  Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, 1 /* Error */, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"),
9481
9482
  Keywords_cannot_contain_escape_characters: diag(1260, 1 /* Error */, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."),
9482
9483
  Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, 1 /* Error */, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."),
9484
+ Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."),
9483
9485
  Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, 1 /* Error */, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."),
9484
9486
  Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, 1 /* Error */, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."),
9485
9487
  A_rest_element_cannot_follow_another_rest_element: diag(1265, 1 /* Error */, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."),
@@ -21684,6 +21686,9 @@ function getPropertyNameFromType(type) {
21684
21686
  }
21685
21687
  return Debug.fail();
21686
21688
  }
21689
+ function isNamedTupleMemberName(node) {
21690
+ return node.kind === 80 /* Identifier */ || node.kind === 203 /* TemplateLiteralType */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */;
21691
+ }
21687
21692
 
21688
21693
  // src/compiler/factory/baseNodeFactory.ts
21689
21694
  function createBaseNodeFactory() {
@@ -33058,21 +33063,29 @@ var Parser;
33058
33063
  }
33059
33064
  return type;
33060
33065
  }
33061
- function isNextTokenColonOrQuestionColon() {
33062
- return nextToken() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
33066
+ function isTokenColonOrQuestionColon() {
33067
+ return token() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
33063
33068
  }
33064
33069
  function isTupleElementName() {
33065
33070
  if (token() === 26 /* DotDotDotToken */) {
33066
- return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon();
33071
+ nextToken();
33067
33072
  }
33068
- return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon();
33073
+ if (token() === 16 /* TemplateHead */) {
33074
+ parseTemplateType();
33075
+ return isTokenColonOrQuestionColon();
33076
+ }
33077
+ if (tokenIsIdentifierOrKeyword(token()) || token() === 15 /* NoSubstitutionTemplateLiteral */) {
33078
+ nextToken();
33079
+ return isTokenColonOrQuestionColon();
33080
+ }
33081
+ return false;
33069
33082
  }
33070
33083
  function parseTupleElementNameOrTupleElementType() {
33071
33084
  if (lookAhead(isTupleElementName)) {
33072
33085
  const pos = getNodePos();
33073
33086
  const hasJSDoc = hasPrecedingJSDocComment();
33074
33087
  const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
33075
- const name = parseIdentifierName();
33088
+ const name = token() === 15 /* NoSubstitutionTemplateLiteral */ ? parseLiteralLikeNode(token()) : token() === 16 /* TemplateHead */ ? parseTemplateType() : parseIdentifierName();
33076
33089
  const questionToken = parseOptionalToken(58 /* QuestionToken */);
33077
33090
  parseExpected(59 /* ColonToken */);
33078
33091
  const type = parseTupleElementType();
@@ -45562,8 +45575,12 @@ function createBinder() {
45562
45575
  }
45563
45576
  if (inStrictMode && originalKeywordKind >= 119 /* FirstFutureReservedWord */ && originalKeywordKind <= 127 /* LastFutureReservedWord */) {
45564
45577
  file.bindDiagnostics.push(createDiagnosticForNode2(node, getStrictModeIdentifierMessage(node), declarationNameToString(node)));
45565
- } else if (originalKeywordKind === 135 /* AwaitKeyword */ && (node.flags & 65536 /* AwaitContext */ || isExternalModule(file))) {
45566
- file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
45578
+ } else if (originalKeywordKind === 135 /* AwaitKeyword */) {
45579
+ if (isExternalModule(file) && isInTopLevelContext(node)) {
45580
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, declarationNameToString(node)));
45581
+ } else if (node.flags & 65536 /* AwaitContext */) {
45582
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
45583
+ }
45567
45584
  } else if (originalKeywordKind === 127 /* YieldKeyword */ && node.flags & 16384 /* YieldContext */) {
45568
45585
  file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
45569
45586
  }
@@ -52786,10 +52803,11 @@ function createTypeChecker(host) {
52786
52803
  for (let i = 0; i < tupleConstituentNodes.length; i++) {
52787
52804
  const flags = type2.target.elementFlags[i];
52788
52805
  const labeledElementDeclaration = labeledElementDeclarations == null ? void 0 : labeledElementDeclarations[i];
52789
- if (labeledElementDeclaration) {
52806
+ const label = labeledElementDeclaration && getTupleElementLabel(type2, labeledElementDeclaration);
52807
+ if (label) {
52790
52808
  tupleConstituentNodes[i] = factory.createNamedTupleMember(
52791
52809
  flags & 12 /* Variable */ ? factory.createToken(26 /* DotDotDotToken */) : void 0,
52792
- factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(labeledElementDeclaration))),
52810
+ factory.createIdentifier(unescapeLeadingUnderscores(label)),
52793
52811
  flags & 2 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
52794
52812
  flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]
52795
52813
  );
@@ -58013,7 +58031,7 @@ function createTypeChecker(host) {
58013
58031
  function getUniqAssociatedNamesFromTupleType(type, restName) {
58014
58032
  const associatedNamesMap = /* @__PURE__ */ new Map();
58015
58033
  return map(type.target.labeledElementDeclarations, (labeledElement, i) => {
58016
- const name = getTupleElementLabel(labeledElement, i, restName);
58034
+ const name = getTupleElementLabel(type, labeledElement, i, restName);
58017
58035
  const prevCounter = associatedNamesMap.get(name);
58018
58036
  if (prevCounter === void 0) {
58019
58037
  associatedNamesMap.set(name, 1);
@@ -76790,11 +76808,18 @@ function createTypeChecker(host) {
76790
76808
  !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration))
76791
76809
  );
76792
76810
  }
76793
- function getTupleElementLabel(d, index, restParameterName = "arg") {
76811
+ function getTupleElementLabel(tupleType, d, index, restParameterName = "arg") {
76794
76812
  if (!d) {
76795
76813
  return `${restParameterName}_${index}`;
76796
76814
  }
76797
- Debug.assert(isIdentifier(d.name));
76815
+ Debug.assert(!isBindingPattern(d.name));
76816
+ if (d.name.kind === 203 /* TemplateLiteralType */) {
76817
+ const label = instantiateType(getTypeFromTypeNode(d.name), tupleType.mapper);
76818
+ return label.flags & 128 /* StringLiteral */ ? escapeLeadingUnderscores(label.value) : typeof index === "number" ? `${restParameterName}_${index}` : void 0;
76819
+ }
76820
+ if (d.name.kind === 15 /* NoSubstitutionTemplateLiteral */) {
76821
+ return escapeLeadingUnderscores(d.name.text);
76822
+ }
76798
76823
  return d.name.escapedText;
76799
76824
  }
76800
76825
  function getParameterNameAtPosition(signature, pos, overrideRestType) {
@@ -76807,7 +76832,7 @@ function createTypeChecker(host) {
76807
76832
  if (isTupleType(restType)) {
76808
76833
  const associatedNames = restType.target.labeledElementDeclarations;
76809
76834
  const index = pos - paramCount;
76810
- return getTupleElementLabel(associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
76835
+ return getTupleElementLabel(restType, associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
76811
76836
  }
76812
76837
  return restParameter.escapedName;
76813
76838
  }
@@ -76837,8 +76862,7 @@ function createTypeChecker(host) {
76837
76862
  const index = pos - paramCount;
76838
76863
  const associatedName = associatedNames == null ? void 0 : associatedNames[index];
76839
76864
  const isRestTupleElement = !!(associatedName == null ? void 0 : associatedName.dotDotDotToken);
76840
- if (associatedName) {
76841
- Debug.assert(isIdentifier(associatedName.name));
76865
+ if (associatedName && isIdentifier(associatedName.name)) {
76842
76866
  return { parameter: associatedName.name, parameterName: associatedName.name.escapedText, isRestParameter: isRestTupleElement };
76843
76867
  }
76844
76868
  return void 0;
@@ -80343,6 +80367,9 @@ function createTypeChecker(host) {
80343
80367
  if (node.type.kind === 191 /* RestType */) {
80344
80368
  grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
80345
80369
  }
80370
+ if (node.name.kind === 203 /* TemplateLiteralType */) {
80371
+ checkSourceElement(node.name);
80372
+ }
80346
80373
  checkSourceElement(node.type);
80347
80374
  getTypeFromTypeNode(node);
80348
80375
  }
@@ -89154,7 +89181,7 @@ var visitEachChildTable = {
89154
89181
  return context.factory.updateNamedTupleMember(
89155
89182
  node,
89156
89183
  tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken,
89157
- Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)),
89184
+ Debug.checkDefined(nodeVisitor(node.name, visitor, isNamedTupleMemberName)),
89158
89185
  tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken,
89159
89186
  Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode))
89160
89187
  );
@@ -120231,6 +120258,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
120231
120258
  Diagnostics.A_module_cannot_have_multiple_default_exports.code,
120232
120259
  Diagnostics.Another_export_default_is_here.code,
120233
120260
  Diagnostics.The_first_export_default_is_here.code,
120261
+ Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
120234
120262
  Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
120235
120263
  Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
120236
120264
  Diagnostics.constructor_is_a_reserved_word.code,
@@ -173498,6 +173526,7 @@ __export(ts_exports2, {
173498
173526
  isNamedImports: () => isNamedImports,
173499
173527
  isNamedImportsOrExports: () => isNamedImportsOrExports,
173500
173528
  isNamedTupleMember: () => isNamedTupleMember,
173529
+ isNamedTupleMemberName: () => isNamedTupleMemberName,
173501
173530
  isNamespaceBody: () => isNamespaceBody,
173502
173531
  isNamespaceExport: () => isNamespaceExport,
173503
173532
  isNamespaceExportDeclaration: () => isNamespaceExportDeclaration,
@@ -188061,6 +188090,7 @@ start(initializeNodeSystem(), require("os").platform());
188061
188090
  isNamedImports,
188062
188091
  isNamedImportsOrExports,
188063
188092
  isNamedTupleMember,
188093
+ isNamedTupleMemberName,
188064
188094
  isNamespaceBody,
188065
188095
  isNamespaceExport,
188066
188096
  isNamespaceExportDeclaration,
@@ -5196,10 +5196,11 @@ declare namespace ts {
5196
5196
  readonly kind: SyntaxKind.TupleType;
5197
5197
  readonly elements: NodeArray<TypeNode | NamedTupleMember>;
5198
5198
  }
5199
+ type NamedTupleMemberName = Identifier | NoSubstitutionTemplateLiteral | TemplateLiteralTypeNode;
5199
5200
  interface NamedTupleMember extends TypeNode, Declaration, JSDocContainer {
5200
5201
  readonly kind: SyntaxKind.NamedTupleMember;
5201
5202
  readonly dotDotDotToken?: Token<SyntaxKind.DotDotDotToken>;
5202
- readonly name: Identifier;
5203
+ readonly name: NamedTupleMemberName;
5203
5204
  readonly questionToken?: Token<SyntaxKind.QuestionToken>;
5204
5205
  readonly type: TypeNode;
5205
5206
  }
@@ -7932,8 +7933,8 @@ declare namespace ts {
7932
7933
  updateArrayTypeNode(node: ArrayTypeNode, elementType: TypeNode): ArrayTypeNode;
7933
7934
  createTupleTypeNode(elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
7934
7935
  updateTupleTypeNode(node: TupleTypeNode, elements: readonly (TypeNode | NamedTupleMember)[]): TupleTypeNode;
7935
- createNamedTupleMember(dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
7936
- updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken | undefined, name: Identifier, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
7936
+ createNamedTupleMember(dotDotDotToken: DotDotDotToken | undefined, name: NamedTupleMemberName, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
7937
+ updateNamedTupleMember(node: NamedTupleMember, dotDotDotToken: DotDotDotToken | undefined, name: NamedTupleMemberName, questionToken: QuestionToken | undefined, type: TypeNode): NamedTupleMember;
7937
7938
  createOptionalTypeNode(type: TypeNode): OptionalTypeNode;
7938
7939
  updateOptionalTypeNode(node: OptionalTypeNode, type: TypeNode): OptionalTypeNode;
7939
7940
  createRestTypeNode(type: TypeNode): RestTypeNode;
package/lib/typescript.js CHANGED
@@ -35,7 +35,7 @@ var ts = (() => {
35
35
  "src/compiler/corePublic.ts"() {
36
36
  "use strict";
37
37
  versionMajorMinor = "5.3";
38
- version = `${versionMajorMinor}.0-insiders.20230824`;
38
+ version = `${versionMajorMinor}.0-insiders.20230825`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7257,6 +7257,7 @@ ${lanes.join("\n")}
7257
7257
  Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, 1 /* Error */, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"),
7258
7258
  Keywords_cannot_contain_escape_characters: diag(1260, 1 /* Error */, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."),
7259
7259
  Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, 1 /* Error */, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."),
7260
+ Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."),
7260
7261
  Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, 1 /* Error */, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."),
7261
7262
  Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, 1 /* Error */, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."),
7262
7263
  A_rest_element_cannot_follow_another_rest_element: diag(1265, 1 /* Error */, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."),
@@ -18906,6 +18907,9 @@ ${lanes.join("\n")}
18906
18907
  }
18907
18908
  return Debug.fail();
18908
18909
  }
18910
+ function isNamedTupleMemberName(node) {
18911
+ return node.kind === 80 /* Identifier */ || node.kind === 203 /* TemplateLiteralType */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */;
18912
+ }
18909
18913
  var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
18910
18914
  var init_utilities = __esm({
18911
18915
  "src/compiler/utilities.ts"() {
@@ -31125,21 +31129,29 @@ ${lanes.join("\n")}
31125
31129
  }
31126
31130
  return type;
31127
31131
  }
31128
- function isNextTokenColonOrQuestionColon() {
31129
- return nextToken() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
31132
+ function isTokenColonOrQuestionColon() {
31133
+ return token() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
31130
31134
  }
31131
31135
  function isTupleElementName() {
31132
31136
  if (token() === 26 /* DotDotDotToken */) {
31133
- return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon();
31137
+ nextToken();
31134
31138
  }
31135
- return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon();
31139
+ if (token() === 16 /* TemplateHead */) {
31140
+ parseTemplateType();
31141
+ return isTokenColonOrQuestionColon();
31142
+ }
31143
+ if (tokenIsIdentifierOrKeyword(token()) || token() === 15 /* NoSubstitutionTemplateLiteral */) {
31144
+ nextToken();
31145
+ return isTokenColonOrQuestionColon();
31146
+ }
31147
+ return false;
31136
31148
  }
31137
31149
  function parseTupleElementNameOrTupleElementType() {
31138
31150
  if (lookAhead(isTupleElementName)) {
31139
31151
  const pos = getNodePos();
31140
31152
  const hasJSDoc = hasPrecedingJSDocComment();
31141
31153
  const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
31142
- const name = parseIdentifierName();
31154
+ const name = token() === 15 /* NoSubstitutionTemplateLiteral */ ? parseLiteralLikeNode(token()) : token() === 16 /* TemplateHead */ ? parseTemplateType() : parseIdentifierName();
31143
31155
  const questionToken = parseOptionalToken(58 /* QuestionToken */);
31144
31156
  parseExpected(59 /* ColonToken */);
31145
31157
  const type = parseTupleElementType();
@@ -43404,8 +43416,12 @@ ${lanes.join("\n")}
43404
43416
  }
43405
43417
  if (inStrictMode && originalKeywordKind >= 119 /* FirstFutureReservedWord */ && originalKeywordKind <= 127 /* LastFutureReservedWord */) {
43406
43418
  file.bindDiagnostics.push(createDiagnosticForNode2(node, getStrictModeIdentifierMessage(node), declarationNameToString(node)));
43407
- } else if (originalKeywordKind === 135 /* AwaitKeyword */ && (node.flags & 65536 /* AwaitContext */ || isExternalModule(file))) {
43408
- file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
43419
+ } else if (originalKeywordKind === 135 /* AwaitKeyword */) {
43420
+ if (isExternalModule(file) && isInTopLevelContext(node)) {
43421
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module, declarationNameToString(node)));
43422
+ } else if (node.flags & 65536 /* AwaitContext */) {
43423
+ file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
43424
+ }
43409
43425
  } else if (originalKeywordKind === 127 /* YieldKeyword */ && node.flags & 16384 /* YieldContext */) {
43410
43426
  file.bindDiagnostics.push(createDiagnosticForNode2(node, Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here, declarationNameToString(node)));
43411
43427
  }
@@ -50547,10 +50563,11 @@ ${lanes.join("\n")}
50547
50563
  for (let i = 0; i < tupleConstituentNodes.length; i++) {
50548
50564
  const flags = type2.target.elementFlags[i];
50549
50565
  const labeledElementDeclaration = labeledElementDeclarations == null ? void 0 : labeledElementDeclarations[i];
50550
- if (labeledElementDeclaration) {
50566
+ const label = labeledElementDeclaration && getTupleElementLabel(type2, labeledElementDeclaration);
50567
+ if (label) {
50551
50568
  tupleConstituentNodes[i] = factory.createNamedTupleMember(
50552
50569
  flags & 12 /* Variable */ ? factory.createToken(26 /* DotDotDotToken */) : void 0,
50553
- factory.createIdentifier(unescapeLeadingUnderscores(getTupleElementLabel(labeledElementDeclaration))),
50570
+ factory.createIdentifier(unescapeLeadingUnderscores(label)),
50554
50571
  flags & 2 /* Optional */ ? factory.createToken(58 /* QuestionToken */) : void 0,
50555
50572
  flags & 4 /* Rest */ ? factory.createArrayTypeNode(tupleConstituentNodes[i]) : tupleConstituentNodes[i]
50556
50573
  );
@@ -55774,7 +55791,7 @@ ${lanes.join("\n")}
55774
55791
  function getUniqAssociatedNamesFromTupleType(type, restName) {
55775
55792
  const associatedNamesMap = /* @__PURE__ */ new Map();
55776
55793
  return map(type.target.labeledElementDeclarations, (labeledElement, i) => {
55777
- const name = getTupleElementLabel(labeledElement, i, restName);
55794
+ const name = getTupleElementLabel(type, labeledElement, i, restName);
55778
55795
  const prevCounter = associatedNamesMap.get(name);
55779
55796
  if (prevCounter === void 0) {
55780
55797
  associatedNamesMap.set(name, 1);
@@ -74551,11 +74568,18 @@ ${lanes.join("\n")}
74551
74568
  !!declaration && (hasInitializer(declaration) || isOptionalDeclaration(declaration))
74552
74569
  );
74553
74570
  }
74554
- function getTupleElementLabel(d, index, restParameterName = "arg") {
74571
+ function getTupleElementLabel(tupleType, d, index, restParameterName = "arg") {
74555
74572
  if (!d) {
74556
74573
  return `${restParameterName}_${index}`;
74557
74574
  }
74558
- Debug.assert(isIdentifier(d.name));
74575
+ Debug.assert(!isBindingPattern(d.name));
74576
+ if (d.name.kind === 203 /* TemplateLiteralType */) {
74577
+ const label = instantiateType(getTypeFromTypeNode(d.name), tupleType.mapper);
74578
+ return label.flags & 128 /* StringLiteral */ ? escapeLeadingUnderscores(label.value) : typeof index === "number" ? `${restParameterName}_${index}` : void 0;
74579
+ }
74580
+ if (d.name.kind === 15 /* NoSubstitutionTemplateLiteral */) {
74581
+ return escapeLeadingUnderscores(d.name.text);
74582
+ }
74559
74583
  return d.name.escapedText;
74560
74584
  }
74561
74585
  function getParameterNameAtPosition(signature, pos, overrideRestType) {
@@ -74568,7 +74592,7 @@ ${lanes.join("\n")}
74568
74592
  if (isTupleType(restType)) {
74569
74593
  const associatedNames = restType.target.labeledElementDeclarations;
74570
74594
  const index = pos - paramCount;
74571
- return getTupleElementLabel(associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
74595
+ return getTupleElementLabel(restType, associatedNames == null ? void 0 : associatedNames[index], index, restParameter.escapedName);
74572
74596
  }
74573
74597
  return restParameter.escapedName;
74574
74598
  }
@@ -74598,8 +74622,7 @@ ${lanes.join("\n")}
74598
74622
  const index = pos - paramCount;
74599
74623
  const associatedName = associatedNames == null ? void 0 : associatedNames[index];
74600
74624
  const isRestTupleElement = !!(associatedName == null ? void 0 : associatedName.dotDotDotToken);
74601
- if (associatedName) {
74602
- Debug.assert(isIdentifier(associatedName.name));
74625
+ if (associatedName && isIdentifier(associatedName.name)) {
74603
74626
  return { parameter: associatedName.name, parameterName: associatedName.name.escapedText, isRestParameter: isRestTupleElement };
74604
74627
  }
74605
74628
  return void 0;
@@ -78104,6 +78127,9 @@ ${lanes.join("\n")}
78104
78127
  if (node.type.kind === 191 /* RestType */) {
78105
78128
  grammarErrorOnNode(node.type, Diagnostics.A_labeled_tuple_element_is_declared_as_rest_with_a_before_the_name_rather_than_before_the_type);
78106
78129
  }
78130
+ if (node.name.kind === 203 /* TemplateLiteralType */) {
78131
+ checkSourceElement(node.name);
78132
+ }
78107
78133
  checkSourceElement(node.type);
78108
78134
  getTypeFromTypeNode(node);
78109
78135
  }
@@ -87058,7 +87084,7 @@ ${lanes.join("\n")}
87058
87084
  return context.factory.updateNamedTupleMember(
87059
87085
  node,
87060
87086
  tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken,
87061
- Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)),
87087
+ Debug.checkDefined(nodeVisitor(node.name, visitor, isNamedTupleMemberName)),
87062
87088
  tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken,
87063
87089
  Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode))
87064
87090
  );
@@ -121607,6 +121633,7 @@ ${lanes.join("\n")}
121607
121633
  Diagnostics.A_module_cannot_have_multiple_default_exports.code,
121608
121634
  Diagnostics.Another_export_default_is_here.code,
121609
121635
  Diagnostics.The_first_export_default_is_here.code,
121636
+ Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
121610
121637
  Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
121611
121638
  Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
121612
121639
  Diagnostics.constructor_is_a_reserved_word.code,
@@ -184676,6 +184703,7 @@ ${e.message}`;
184676
184703
  isNamedImports: () => isNamedImports,
184677
184704
  isNamedImportsOrExports: () => isNamedImportsOrExports,
184678
184705
  isNamedTupleMember: () => isNamedTupleMember,
184706
+ isNamedTupleMemberName: () => isNamedTupleMemberName,
184679
184707
  isNamespaceBody: () => isNamespaceBody,
184680
184708
  isNamespaceExport: () => isNamespaceExport,
184681
184709
  isNamespaceExportDeclaration: () => isNamespaceExportDeclaration,
@@ -187085,6 +187113,7 @@ ${e.message}`;
187085
187113
  isNamedImports: () => isNamedImports,
187086
187114
  isNamedImportsOrExports: () => isNamedImportsOrExports,
187087
187115
  isNamedTupleMember: () => isNamedTupleMember,
187116
+ isNamedTupleMemberName: () => isNamedTupleMemberName,
187088
187117
  isNamespaceBody: () => isNamespaceBody,
187089
187118
  isNamespaceExport: () => isNamespaceExport,
187090
187119
  isNamespaceExportDeclaration: () => isNamespaceExportDeclaration,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.3";
57
- var version = `${versionMajorMinor}.0-insiders.20230824`;
57
+ var version = `${versionMajorMinor}.0-insiders.20230825`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -5329,6 +5329,7 @@ var Diagnostics = {
5329
5329
  Module_0_can_only_be_default_imported_using_the_1_flag: diag(1259, 1 /* Error */, "Module_0_can_only_be_default_imported_using_the_1_flag_1259", "Module '{0}' can only be default-imported using the '{1}' flag"),
5330
5330
  Keywords_cannot_contain_escape_characters: diag(1260, 1 /* Error */, "Keywords_cannot_contain_escape_characters_1260", "Keywords cannot contain escape characters."),
5331
5331
  Already_included_file_name_0_differs_from_file_name_1_only_in_casing: diag(1261, 1 /* Error */, "Already_included_file_name_0_differs_from_file_name_1_only_in_casing_1261", "Already included file name '{0}' differs from file name '{1}' only in casing."),
5332
+ Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module: diag(1262, 1 /* Error */, "Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module_1262", "Identifier expected. '{0}' is a reserved word at the top-level of a module."),
5332
5333
  Declarations_with_initializers_cannot_also_have_definite_assignment_assertions: diag(1263, 1 /* Error */, "Declarations_with_initializers_cannot_also_have_definite_assignment_assertions_1263", "Declarations with initializers cannot also have definite assignment assertions."),
5333
5334
  Declarations_with_definite_assignment_assertions_must_also_have_type_annotations: diag(1264, 1 /* Error */, "Declarations_with_definite_assignment_assertions_must_also_have_type_annotations_1264", "Declarations with definite assignment assertions must also have type annotations."),
5334
5335
  A_rest_element_cannot_follow_another_rest_element: diag(1265, 1 /* Error */, "A_rest_element_cannot_follow_another_rest_element_1265", "A rest element cannot follow another rest element."),
@@ -11741,6 +11742,9 @@ function getEscapedTextOfJsxNamespacedName(node) {
11741
11742
  function getTextOfJsxNamespacedName(node) {
11742
11743
  return `${idText(node.namespace)}:${idText(node.name)}`;
11743
11744
  }
11745
+ function isNamedTupleMemberName(node) {
11746
+ return node.kind === 80 /* Identifier */ || node.kind === 203 /* TemplateLiteralType */ || node.kind === 15 /* NoSubstitutionTemplateLiteral */;
11747
+ }
11744
11748
 
11745
11749
  // src/compiler/factory/baseNodeFactory.ts
11746
11750
  function createBaseNodeFactory() {
@@ -20513,21 +20517,29 @@ var Parser;
20513
20517
  }
20514
20518
  return type;
20515
20519
  }
20516
- function isNextTokenColonOrQuestionColon() {
20517
- return nextToken() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
20520
+ function isTokenColonOrQuestionColon() {
20521
+ return token() === 59 /* ColonToken */ || token() === 58 /* QuestionToken */ && nextToken() === 59 /* ColonToken */;
20518
20522
  }
20519
20523
  function isTupleElementName() {
20520
20524
  if (token() === 26 /* DotDotDotToken */) {
20521
- return tokenIsIdentifierOrKeyword(nextToken()) && isNextTokenColonOrQuestionColon();
20525
+ nextToken();
20526
+ }
20527
+ if (token() === 16 /* TemplateHead */) {
20528
+ parseTemplateType();
20529
+ return isTokenColonOrQuestionColon();
20530
+ }
20531
+ if (tokenIsIdentifierOrKeyword(token()) || token() === 15 /* NoSubstitutionTemplateLiteral */) {
20532
+ nextToken();
20533
+ return isTokenColonOrQuestionColon();
20522
20534
  }
20523
- return tokenIsIdentifierOrKeyword(token()) && isNextTokenColonOrQuestionColon();
20535
+ return false;
20524
20536
  }
20525
20537
  function parseTupleElementNameOrTupleElementType() {
20526
20538
  if (lookAhead(isTupleElementName)) {
20527
20539
  const pos = getNodePos();
20528
20540
  const hasJSDoc = hasPrecedingJSDocComment();
20529
20541
  const dotDotDotToken = parseOptionalToken(26 /* DotDotDotToken */);
20530
- const name = parseIdentifierName();
20542
+ const name = token() === 15 /* NoSubstitutionTemplateLiteral */ ? parseLiteralLikeNode(token()) : token() === 16 /* TemplateHead */ ? parseTemplateType() : parseIdentifierName();
20531
20543
  const questionToken = parseOptionalToken(58 /* QuestionToken */);
20532
20544
  parseExpected(59 /* ColonToken */);
20533
20545
  const type = parseTupleElementType();
@@ -29682,7 +29694,7 @@ var visitEachChildTable = {
29682
29694
  return context.factory.updateNamedTupleMember(
29683
29695
  node,
29684
29696
  tokenVisitor ? nodeVisitor(node.dotDotDotToken, tokenVisitor, isDotDotDotToken) : node.dotDotDotToken,
29685
- Debug.checkDefined(nodeVisitor(node.name, visitor, isIdentifier)),
29697
+ Debug.checkDefined(nodeVisitor(node.name, visitor, isNamedTupleMemberName)),
29686
29698
  tokenVisitor ? nodeVisitor(node.questionToken, tokenVisitor, isQuestionToken) : node.questionToken,
29687
29699
  Debug.checkDefined(nodeVisitor(node.type, visitor, isTypeNode))
29688
29700
  );
@@ -30794,6 +30806,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
30794
30806
  Diagnostics.A_module_cannot_have_multiple_default_exports.code,
30795
30807
  Diagnostics.Another_export_default_is_here.code,
30796
30808
  Diagnostics.The_first_export_default_is_here.code,
30809
+ Diagnostics.Identifier_expected_0_is_a_reserved_word_at_the_top_level_of_a_module.code,
30797
30810
  Diagnostics.Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode.code,
30798
30811
  Diagnostics.Identifier_expected_0_is_a_reserved_word_that_cannot_be_used_here.code,
30799
30812
  Diagnostics.constructor_is_a_reserved_word.code,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@typescript-deploys/pr-build",
3
3
  "author": "Microsoft Corp.",
4
4
  "homepage": "https://www.typescriptlang.org/",
5
- "version": "5.3.0-pr-55503-5",
5
+ "version": "5.3.0-pr-55452-7",
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": "d94784a967f0f0182da1a9c21967303956d8a92c"
116
+ "gitHead": "70cb7717b6c1bdfb06e172b22e6a6494fe8e5320"
117
117
  }