typescript 5.4.0-dev.20231206 → 5.4.0-dev.20231207

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.4";
21
- var version = `${versionMajorMinor}.0-dev.20231206`;
21
+ var version = `${versionMajorMinor}.0-dev.20231207`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -13866,12 +13866,12 @@ function canHaveJSDoc(node) {
13866
13866
  function getJSDocCommentsAndTags(hostNode, noCache) {
13867
13867
  let result;
13868
13868
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
13869
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
13869
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
13870
13870
  }
13871
13871
  let node = hostNode;
13872
13872
  while (node && node.parent) {
13873
13873
  if (hasJSDocNodes(node)) {
13874
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
13874
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
13875
13875
  }
13876
13876
  if (node.kind === 169 /* Parameter */) {
13877
13877
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -13885,12 +13885,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
13885
13885
  }
13886
13886
  return result || emptyArray;
13887
13887
  }
13888
- function filterOwnedJSDocTags(hostNode, jsDoc) {
13889
- if (isJSDoc(jsDoc)) {
13890
- const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
13891
- return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
13892
- }
13893
- return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
13888
+ function filterOwnedJSDocTags(hostNode, comments) {
13889
+ const lastJsDoc = last(comments);
13890
+ return flatMap(comments, (jsDoc) => {
13891
+ if (jsDoc === lastJsDoc) {
13892
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
13893
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
13894
+ } else {
13895
+ return filter(jsDoc.tags, isJSDocOverloadTag);
13896
+ }
13897
+ });
13894
13898
  }
13895
13899
  function ownsJSDocTag(hostNode, tag) {
13896
13900
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -13929,6 +13933,9 @@ function getEffectiveContainerForJSDocTemplateTag(node) {
13929
13933
  }
13930
13934
  return getHostSignatureFromJSDoc(node);
13931
13935
  }
13936
+ function getJSDocOverloadTags(node) {
13937
+ return getAllJSDocTags(node, isJSDocOverloadTag);
13938
+ }
13932
13939
  function getHostSignatureFromJSDoc(node) {
13933
13940
  const host = getEffectiveJSDocHost(node);
13934
13941
  if (host) {
@@ -28298,8 +28305,7 @@ var Parser;
28298
28305
  function parseJSDocFunctionType() {
28299
28306
  const pos = getNodePos();
28300
28307
  const hasJSDoc = hasPrecedingJSDocComment();
28301
- if (lookAhead(nextTokenIsOpenParen)) {
28302
- nextToken();
28308
+ if (tryParse(nextTokenIsOpenParen)) {
28303
28309
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
28304
28310
  const type = parseReturnType(
28305
28311
  59 /* ColonToken */,
@@ -55494,22 +55500,15 @@ function createTypeChecker(host) {
55494
55500
  }
55495
55501
  }
55496
55502
  if (isInJSFile(decl) && decl.jsDoc) {
55497
- let hasJSDocOverloads = false;
55498
- for (const node of decl.jsDoc) {
55499
- if (node.tags) {
55500
- for (const tag of node.tags) {
55501
- if (isJSDocOverloadTag(tag)) {
55502
- const jsDocSignature = tag.typeExpression;
55503
- if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
55504
- reportImplicitAny(jsDocSignature, anyType);
55505
- }
55506
- result.push(getSignatureFromDeclaration(jsDocSignature));
55507
- hasJSDocOverloads = true;
55508
- }
55503
+ const tags = getJSDocOverloadTags(decl);
55504
+ if (length(tags)) {
55505
+ for (const tag of tags) {
55506
+ const jsDocSignature = tag.typeExpression;
55507
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
55508
+ reportImplicitAny(jsDocSignature, anyType);
55509
55509
  }
55510
+ result.push(getSignatureFromDeclaration(jsDocSignature));
55510
55511
  }
55511
- }
55512
- if (hasJSDocOverloads) {
55513
55512
  continue;
55514
55513
  }
55515
55514
  }
@@ -76660,15 +76659,7 @@ function createTypeChecker(host) {
76660
76659
  }
76661
76660
  }
76662
76661
  if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
76663
- for (const node2 of current.jsDoc) {
76664
- if (node2.tags) {
76665
- for (const tag of node2.tags) {
76666
- if (isJSDocOverloadTag(tag)) {
76667
- hasOverloads = true;
76668
- }
76669
- }
76670
- }
76671
- }
76662
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
76672
76663
  }
76673
76664
  }
76674
76665
  }
@@ -80058,7 +80049,7 @@ function createTypeChecker(host) {
80058
80049
  error(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
80059
80050
  } else {
80060
80051
  const text = getTextOfPropertyName(member.name);
80061
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
80052
+ if (isNumericLiteralName(text)) {
80062
80053
  error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
80063
80054
  }
80064
80055
  }
package/lib/tsserver.js CHANGED
@@ -822,6 +822,7 @@ __export(server_exports, {
822
822
  getJSDocEnumTag: () => getJSDocEnumTag,
823
823
  getJSDocHost: () => getJSDocHost,
824
824
  getJSDocImplementsTags: () => getJSDocImplementsTags,
825
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
825
826
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
826
827
  getJSDocParameterTags: () => getJSDocParameterTags,
827
828
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -2333,7 +2334,7 @@ module.exports = __toCommonJS(server_exports);
2333
2334
 
2334
2335
  // src/compiler/corePublic.ts
2335
2336
  var versionMajorMinor = "5.4";
2336
- var version = `${versionMajorMinor}.0-dev.20231206`;
2337
+ var version = `${versionMajorMinor}.0-dev.20231207`;
2337
2338
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2338
2339
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2339
2340
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -17757,12 +17758,12 @@ function canHaveJSDoc(node) {
17757
17758
  function getJSDocCommentsAndTags(hostNode, noCache) {
17758
17759
  let result;
17759
17760
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
17760
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
17761
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
17761
17762
  }
17762
17763
  let node = hostNode;
17763
17764
  while (node && node.parent) {
17764
17765
  if (hasJSDocNodes(node)) {
17765
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
17766
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
17766
17767
  }
17767
17768
  if (node.kind === 169 /* Parameter */) {
17768
17769
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -17776,12 +17777,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
17776
17777
  }
17777
17778
  return result || emptyArray;
17778
17779
  }
17779
- function filterOwnedJSDocTags(hostNode, jsDoc) {
17780
- if (isJSDoc(jsDoc)) {
17781
- const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
17782
- return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
17783
- }
17784
- return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
17780
+ function filterOwnedJSDocTags(hostNode, comments) {
17781
+ const lastJsDoc = last(comments);
17782
+ return flatMap(comments, (jsDoc) => {
17783
+ if (jsDoc === lastJsDoc) {
17784
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
17785
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
17786
+ } else {
17787
+ return filter(jsDoc.tags, isJSDocOverloadTag);
17788
+ }
17789
+ });
17785
17790
  }
17786
17791
  function ownsJSDocTag(hostNode, tag) {
17787
17792
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -17820,6 +17825,9 @@ function getEffectiveContainerForJSDocTemplateTag(node) {
17820
17825
  }
17821
17826
  return getHostSignatureFromJSDoc(node);
17822
17827
  }
17828
+ function getJSDocOverloadTags(node) {
17829
+ return getAllJSDocTags(node, isJSDocOverloadTag);
17830
+ }
17823
17831
  function getHostSignatureFromJSDoc(node) {
17824
17832
  const host = getEffectiveJSDocHost(node);
17825
17833
  if (host) {
@@ -32726,8 +32734,7 @@ var Parser;
32726
32734
  function parseJSDocFunctionType() {
32727
32735
  const pos = getNodePos();
32728
32736
  const hasJSDoc = hasPrecedingJSDocComment();
32729
- if (lookAhead(nextTokenIsOpenParen)) {
32730
- nextToken();
32737
+ if (tryParse(nextTokenIsOpenParen)) {
32731
32738
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
32732
32739
  const type = parseReturnType(
32733
32740
  59 /* ColonToken */,
@@ -60222,22 +60229,15 @@ function createTypeChecker(host) {
60222
60229
  }
60223
60230
  }
60224
60231
  if (isInJSFile(decl) && decl.jsDoc) {
60225
- let hasJSDocOverloads = false;
60226
- for (const node of decl.jsDoc) {
60227
- if (node.tags) {
60228
- for (const tag of node.tags) {
60229
- if (isJSDocOverloadTag(tag)) {
60230
- const jsDocSignature = tag.typeExpression;
60231
- if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
60232
- reportImplicitAny(jsDocSignature, anyType);
60233
- }
60234
- result.push(getSignatureFromDeclaration(jsDocSignature));
60235
- hasJSDocOverloads = true;
60236
- }
60232
+ const tags = getJSDocOverloadTags(decl);
60233
+ if (length(tags)) {
60234
+ for (const tag of tags) {
60235
+ const jsDocSignature = tag.typeExpression;
60236
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
60237
+ reportImplicitAny(jsDocSignature, anyType);
60237
60238
  }
60239
+ result.push(getSignatureFromDeclaration(jsDocSignature));
60238
60240
  }
60239
- }
60240
- if (hasJSDocOverloads) {
60241
60241
  continue;
60242
60242
  }
60243
60243
  }
@@ -81388,15 +81388,7 @@ function createTypeChecker(host) {
81388
81388
  }
81389
81389
  }
81390
81390
  if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
81391
- for (const node2 of current.jsDoc) {
81392
- if (node2.tags) {
81393
- for (const tag of node2.tags) {
81394
- if (isJSDocOverloadTag(tag)) {
81395
- hasOverloads = true;
81396
- }
81397
- }
81398
- }
81399
- }
81391
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
81400
81392
  }
81401
81393
  }
81402
81394
  }
@@ -84786,7 +84778,7 @@ function createTypeChecker(host) {
84786
84778
  error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
84787
84779
  } else {
84788
84780
  const text = getTextOfPropertyName(member.name);
84789
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
84781
+ if (isNumericLiteralName(text)) {
84790
84782
  error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
84791
84783
  }
84792
84784
  }
@@ -173951,6 +173943,7 @@ __export(ts_exports2, {
173951
173943
  getJSDocEnumTag: () => getJSDocEnumTag,
173952
173944
  getJSDocHost: () => getJSDocHost,
173953
173945
  getJSDocImplementsTags: () => getJSDocImplementsTags,
173946
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
173954
173947
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
173955
173948
  getJSDocParameterTags: () => getJSDocParameterTags,
173956
173949
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -188744,6 +188737,7 @@ start(initializeNodeSystem(), require("os").platform());
188744
188737
  getJSDocEnumTag,
188745
188738
  getJSDocHost,
188746
188739
  getJSDocImplementsTags,
188740
+ getJSDocOverloadTags,
188747
188741
  getJSDocOverrideTagNoCache,
188748
188742
  getJSDocParameterTags,
188749
188743
  getJSDocParameterTagsNoCache,
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.4";
38
- version = `${versionMajorMinor}.0-dev.20231206`;
38
+ version = `${versionMajorMinor}.0-dev.20231207`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -15135,12 +15135,12 @@ ${lanes.join("\n")}
15135
15135
  function getJSDocCommentsAndTags(hostNode, noCache) {
15136
15136
  let result;
15137
15137
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
15138
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
15138
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
15139
15139
  }
15140
15140
  let node = hostNode;
15141
15141
  while (node && node.parent) {
15142
15142
  if (hasJSDocNodes(node)) {
15143
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
15143
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
15144
15144
  }
15145
15145
  if (node.kind === 169 /* Parameter */) {
15146
15146
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -15154,12 +15154,16 @@ ${lanes.join("\n")}
15154
15154
  }
15155
15155
  return result || emptyArray;
15156
15156
  }
15157
- function filterOwnedJSDocTags(hostNode, jsDoc) {
15158
- if (isJSDoc(jsDoc)) {
15159
- const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
15160
- return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
15161
- }
15162
- return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
15157
+ function filterOwnedJSDocTags(hostNode, comments) {
15158
+ const lastJsDoc = last(comments);
15159
+ return flatMap(comments, (jsDoc) => {
15160
+ if (jsDoc === lastJsDoc) {
15161
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
15162
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
15163
+ } else {
15164
+ return filter(jsDoc.tags, isJSDocOverloadTag);
15165
+ }
15166
+ });
15163
15167
  }
15164
15168
  function ownsJSDocTag(hostNode, tag) {
15165
15169
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -15198,6 +15202,9 @@ ${lanes.join("\n")}
15198
15202
  }
15199
15203
  return getHostSignatureFromJSDoc(node);
15200
15204
  }
15205
+ function getJSDocOverloadTags(node) {
15206
+ return getAllJSDocTags(node, isJSDocOverloadTag);
15207
+ }
15201
15208
  function getHostSignatureFromJSDoc(node) {
15202
15209
  const host = getEffectiveJSDocHost(node);
15203
15210
  if (host) {
@@ -30793,8 +30800,7 @@ ${lanes.join("\n")}
30793
30800
  function parseJSDocFunctionType() {
30794
30801
  const pos = getNodePos();
30795
30802
  const hasJSDoc = hasPrecedingJSDocComment();
30796
- if (lookAhead(nextTokenIsOpenParen)) {
30797
- nextToken();
30803
+ if (tryParse(nextTokenIsOpenParen)) {
30798
30804
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
30799
30805
  const type = parseReturnType(
30800
30806
  59 /* ColonToken */,
@@ -57984,22 +57990,15 @@ ${lanes.join("\n")}
57984
57990
  }
57985
57991
  }
57986
57992
  if (isInJSFile(decl) && decl.jsDoc) {
57987
- let hasJSDocOverloads = false;
57988
- for (const node of decl.jsDoc) {
57989
- if (node.tags) {
57990
- for (const tag of node.tags) {
57991
- if (isJSDocOverloadTag(tag)) {
57992
- const jsDocSignature = tag.typeExpression;
57993
- if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
57994
- reportImplicitAny(jsDocSignature, anyType);
57995
- }
57996
- result.push(getSignatureFromDeclaration(jsDocSignature));
57997
- hasJSDocOverloads = true;
57998
- }
57993
+ const tags = getJSDocOverloadTags(decl);
57994
+ if (length(tags)) {
57995
+ for (const tag of tags) {
57996
+ const jsDocSignature = tag.typeExpression;
57997
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
57998
+ reportImplicitAny(jsDocSignature, anyType);
57999
57999
  }
58000
+ result.push(getSignatureFromDeclaration(jsDocSignature));
58000
58001
  }
58001
- }
58002
- if (hasJSDocOverloads) {
58003
58002
  continue;
58004
58003
  }
58005
58004
  }
@@ -79150,15 +79149,7 @@ ${lanes.join("\n")}
79150
79149
  }
79151
79150
  }
79152
79151
  if (isInJSFile(current) && isFunctionLike(current) && current.jsDoc) {
79153
- for (const node2 of current.jsDoc) {
79154
- if (node2.tags) {
79155
- for (const tag of node2.tags) {
79156
- if (isJSDocOverloadTag(tag)) {
79157
- hasOverloads = true;
79158
- }
79159
- }
79160
- }
79161
- }
79152
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
79162
79153
  }
79163
79154
  }
79164
79155
  }
@@ -82548,7 +82539,7 @@ ${lanes.join("\n")}
82548
82539
  error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
82549
82540
  } else {
82550
82541
  const text = getTextOfPropertyName(member.name);
82551
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
82542
+ if (isNumericLiteralName(text)) {
82552
82543
  error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
82553
82544
  }
82554
82545
  }
@@ -185508,6 +185499,7 @@ ${e.message}`;
185508
185499
  getJSDocEnumTag: () => getJSDocEnumTag,
185509
185500
  getJSDocHost: () => getJSDocHost,
185510
185501
  getJSDocImplementsTags: () => getJSDocImplementsTags,
185502
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
185511
185503
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
185512
185504
  getJSDocParameterTags: () => getJSDocParameterTags,
185513
185505
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -187922,6 +187914,7 @@ ${e.message}`;
187922
187914
  getJSDocEnumTag: () => getJSDocEnumTag,
187923
187915
  getJSDocHost: () => getJSDocHost,
187924
187916
  getJSDocImplementsTags: () => getJSDocImplementsTags,
187917
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
187925
187918
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
187926
187919
  getJSDocParameterTags: () => getJSDocParameterTags,
187927
187920
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -54,7 +54,7 @@ var path = __toESM(require("path"));
54
54
 
55
55
  // src/compiler/corePublic.ts
56
56
  var versionMajorMinor = "5.4";
57
- var version = `${versionMajorMinor}.0-dev.20231206`;
57
+ var version = `${versionMajorMinor}.0-dev.20231207`;
58
58
 
59
59
  // src/compiler/core.ts
60
60
  var emptyArray = [];
@@ -10581,12 +10581,12 @@ function canHaveJSDoc(node) {
10581
10581
  function getJSDocCommentsAndTags(hostNode, noCache) {
10582
10582
  let result;
10583
10583
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
10584
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
10584
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
10585
10585
  }
10586
10586
  let node = hostNode;
10587
10587
  while (node && node.parent) {
10588
10588
  if (hasJSDocNodes(node)) {
10589
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
10589
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
10590
10590
  }
10591
10591
  if (node.kind === 169 /* Parameter */) {
10592
10592
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -10600,12 +10600,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
10600
10600
  }
10601
10601
  return result || emptyArray;
10602
10602
  }
10603
- function filterOwnedJSDocTags(hostNode, jsDoc) {
10604
- if (isJSDoc(jsDoc)) {
10605
- const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
10606
- return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
10607
- }
10608
- return ownsJSDocTag(hostNode, jsDoc) ? [jsDoc] : void 0;
10603
+ function filterOwnedJSDocTags(hostNode, comments) {
10604
+ const lastJsDoc = last(comments);
10605
+ return flatMap(comments, (jsDoc) => {
10606
+ if (jsDoc === lastJsDoc) {
10607
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
10608
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
10609
+ } else {
10610
+ return filter(jsDoc.tags, isJSDocOverloadTag);
10611
+ }
10612
+ });
10609
10613
  }
10610
10614
  function ownsJSDocTag(hostNode, tag) {
10611
10615
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -17344,6 +17348,9 @@ function isJSDocReadonlyTag(node) {
17344
17348
  function isJSDocOverrideTag(node) {
17345
17349
  return node.kind === 344 /* JSDocOverrideTag */;
17346
17350
  }
17351
+ function isJSDocOverloadTag(node) {
17352
+ return node.kind === 346 /* JSDocOverloadTag */;
17353
+ }
17347
17354
  function isJSDocDeprecatedTag(node) {
17348
17355
  return node.kind === 338 /* JSDocDeprecatedTag */;
17349
17356
  }
@@ -20112,8 +20119,7 @@ var Parser;
20112
20119
  function parseJSDocFunctionType() {
20113
20120
  const pos = getNodePos();
20114
20121
  const hasJSDoc = hasPrecedingJSDocComment();
20115
- if (lookAhead(nextTokenIsOpenParen)) {
20116
- nextToken();
20122
+ if (tryParse(nextTokenIsOpenParen)) {
20117
20123
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
20118
20124
  const type = parseReturnType(
20119
20125
  59 /* ColonToken */,
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.4.0-dev.20231206",
5
+ "version": "5.4.0-dev.20231207",
6
6
  "license": "Apache-2.0",
7
7
  "description": "TypeScript is a language for application scale JavaScript development",
8
8
  "keywords": [
@@ -114,5 +114,5 @@
114
114
  "node": "20.1.0",
115
115
  "npm": "8.19.4"
116
116
  },
117
- "gitHead": "1d7c0c977abcb076d6f491ed091834baff6d41f8"
117
+ "gitHead": "20c0f4052681cdbdba3357a50822915b6ef4c3d6"
118
118
  }