typescript 5.4.0-dev.20231206 → 5.4.0-dev.20231208

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.20231208`;
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) {
@@ -18832,8 +18839,10 @@ function createNodeFactory(flags, baseFactory2) {
18832
18839
  return update(updated, original);
18833
18840
  }
18834
18841
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
18842
+ const text = typeof value === "number" ? value + "" : value;
18843
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
18835
18844
  const node = createBaseDeclaration(9 /* NumericLiteral */);
18836
- node.text = typeof value === "number" ? value + "" : value;
18845
+ node.text = text;
18837
18846
  node.numericLiteralFlags = numericLiteralFlags;
18838
18847
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
18839
18848
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -28298,8 +28307,7 @@ var Parser;
28298
28307
  function parseJSDocFunctionType() {
28299
28308
  const pos = getNodePos();
28300
28309
  const hasJSDoc = hasPrecedingJSDocComment();
28301
- if (lookAhead(nextTokenIsOpenParen)) {
28302
- nextToken();
28310
+ if (tryParse(nextTokenIsOpenParen)) {
28303
28311
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
28304
28312
  const type = parseReturnType(
28305
28313
  59 /* ColonToken */,
@@ -49561,7 +49569,7 @@ function createTypeChecker(host) {
49561
49569
  return factory.createStringLiteral(name, !!singleQuote);
49562
49570
  }
49563
49571
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
49564
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
49572
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-name)));
49565
49573
  }
49566
49574
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
49567
49575
  }
@@ -53627,11 +53635,10 @@ function createTypeChecker(host) {
53627
53635
  const baseTypes = getBaseTypes(source);
53628
53636
  if (baseTypes.length) {
53629
53637
  if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
53630
- const symbolTable = createSymbolTable();
53631
- for (const symbol of members.values()) {
53632
- if (!(symbol.flags & 262144 /* TypeParameter */)) {
53633
- symbolTable.set(symbol.escapedName, symbol);
53634
- }
53638
+ const symbolTable = createSymbolTable(source.declaredProperties);
53639
+ const sourceIndex = getIndexSymbol(source.symbol);
53640
+ if (sourceIndex) {
53641
+ symbolTable.set("__index" /* Index */, sourceIndex);
53635
53642
  }
53636
53643
  members = symbolTable;
53637
53644
  }
@@ -55494,22 +55501,15 @@ function createTypeChecker(host) {
55494
55501
  }
55495
55502
  }
55496
55503
  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
- }
55504
+ const tags = getJSDocOverloadTags(decl);
55505
+ if (length(tags)) {
55506
+ for (const tag of tags) {
55507
+ const jsDocSignature = tag.typeExpression;
55508
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
55509
+ reportImplicitAny(jsDocSignature, anyType);
55509
55510
  }
55511
+ result.push(getSignatureFromDeclaration(jsDocSignature));
55510
55512
  }
55511
- }
55512
- if (hasJSDocOverloads) {
55513
55513
  continue;
55514
55514
  }
55515
55515
  }
@@ -76660,15 +76660,7 @@ function createTypeChecker(host) {
76660
76660
  }
76661
76661
  }
76662
76662
  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
- }
76663
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
76672
76664
  }
76673
76665
  }
76674
76666
  }
@@ -80058,7 +80050,7 @@ function createTypeChecker(host) {
80058
80050
  error(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
80059
80051
  } else {
80060
80052
  const text = getTextOfPropertyName(member.name);
80061
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
80053
+ if (isNumericLiteralName(text)) {
80062
80054
  error(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
80063
80055
  }
80064
80056
  }
@@ -82657,7 +82649,7 @@ function createTypeChecker(host) {
82657
82649
  if (enumResult)
82658
82650
  return enumResult;
82659
82651
  const literalValue = type.value;
82660
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
82652
+ return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
82661
82653
  }
82662
82654
  function createLiteralConstValue(node, tracker) {
82663
82655
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -89086,7 +89078,7 @@ function transformTypeScript(context) {
89086
89078
  function transformEnumMemberDeclarationValue(member) {
89087
89079
  const value = resolver.getConstantValue(member);
89088
89080
  if (value !== void 0) {
89089
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
89081
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
89090
89082
  } else {
89091
89083
  enableSubstitutionForNonQualifiedEnumMembers();
89092
89084
  if (member.initializer) {
@@ -89616,7 +89608,7 @@ function transformTypeScript(context) {
89616
89608
  const constantValue = tryGetConstEnumValue(node);
89617
89609
  if (constantValue !== void 0) {
89618
89610
  setConstantValue(node, constantValue);
89619
- const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
89611
+ const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
89620
89612
  if (!compilerOptions.removeComments) {
89621
89613
  const originalNode = getOriginalNode(node, isAccessExpression);
89622
89614
  addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
@@ -103406,7 +103398,7 @@ function transformGenerators(context) {
103406
103398
  if (labelExpressions === void 0) {
103407
103399
  labelExpressions = [];
103408
103400
  }
103409
- const expression = factory2.createNumericLiteral(-1);
103401
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
103410
103402
  if (labelExpressions[label] === void 0) {
103411
103403
  labelExpressions[label] = [expression];
103412
103404
  } else {
@@ -109281,7 +109273,8 @@ function transformDeclarations(context) {
109281
109273
  if (shouldStripInternal(m))
109282
109274
  return;
109283
109275
  const constValue = resolver.getConstantValue(m);
109284
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
109276
+ const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
109277
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
109285
109278
  }))
109286
109279
  ));
109287
109280
  }
@@ -111171,6 +111164,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
111171
111164
  );
111172
111165
  if (hint === 3 /* MappedTypeParameter */)
111173
111166
  return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
111167
+ if (hint === 7 /* ImportTypeNodeAttributes */)
111168
+ return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
111174
111169
  if (hint === 5 /* EmbeddedStatement */) {
111175
111170
  Debug.assertNode(node, isEmptyStatement);
111176
111171
  return emitEmptyStatement(
@@ -112147,15 +112142,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
112147
112142
  if (node.attributes) {
112148
112143
  writePunctuation(",");
112149
112144
  writeSpace();
112150
- writePunctuation("{");
112151
- writeSpace();
112152
- writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
112153
- writePunctuation(":");
112154
- writeSpace();
112155
- const elements = node.attributes.elements;
112156
- emitList(node.attributes, elements, 526226 /* ImportAttributes */);
112157
- writeSpace();
112158
- writePunctuation("}");
112145
+ pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
112159
112146
  }
112160
112147
  writePunctuation(")");
112161
112148
  if (node.qualifier) {
@@ -113217,6 +113204,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
113217
113204
  }
113218
113205
  writeTrailingSemicolon();
113219
113206
  }
113207
+ function emitImportTypeNodeAttributes(node) {
113208
+ writePunctuation("{");
113209
+ writeSpace();
113210
+ writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
113211
+ writePunctuation(":");
113212
+ writeSpace();
113213
+ const elements = node.elements;
113214
+ emitList(node, elements, 526226 /* ImportAttributes */);
113215
+ writeSpace();
113216
+ writePunctuation("}");
113217
+ }
113220
113218
  function emitImportAttributes(node) {
113221
113219
  emitTokenWithComment(node.token, node.pos, writeKeyword, node);
113222
113220
  writeSpace();
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.20231208`;
2337
2338
  var Comparison = /* @__PURE__ */ ((Comparison3) => {
2338
2339
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
2339
2340
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -7290,6 +7291,7 @@ var EmitHint = /* @__PURE__ */ ((EmitHint6) => {
7290
7291
  EmitHint6[EmitHint6["Unspecified"] = 4] = "Unspecified";
7291
7292
  EmitHint6[EmitHint6["EmbeddedStatement"] = 5] = "EmbeddedStatement";
7292
7293
  EmitHint6[EmitHint6["JsxAttributeValue"] = 6] = "JsxAttributeValue";
7294
+ EmitHint6[EmitHint6["ImportTypeNodeAttributes"] = 7] = "ImportTypeNodeAttributes";
7293
7295
  return EmitHint6;
7294
7296
  })(EmitHint || {});
7295
7297
  var OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => {
@@ -17757,12 +17759,12 @@ function canHaveJSDoc(node) {
17757
17759
  function getJSDocCommentsAndTags(hostNode, noCache) {
17758
17760
  let result;
17759
17761
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
17760
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
17762
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
17761
17763
  }
17762
17764
  let node = hostNode;
17763
17765
  while (node && node.parent) {
17764
17766
  if (hasJSDocNodes(node)) {
17765
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
17767
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
17766
17768
  }
17767
17769
  if (node.kind === 169 /* Parameter */) {
17768
17770
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -17776,12 +17778,16 @@ function getJSDocCommentsAndTags(hostNode, noCache) {
17776
17778
  }
17777
17779
  return result || emptyArray;
17778
17780
  }
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;
17781
+ function filterOwnedJSDocTags(hostNode, comments) {
17782
+ const lastJsDoc = last(comments);
17783
+ return flatMap(comments, (jsDoc) => {
17784
+ if (jsDoc === lastJsDoc) {
17785
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
17786
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
17787
+ } else {
17788
+ return filter(jsDoc.tags, isJSDocOverloadTag);
17789
+ }
17790
+ });
17785
17791
  }
17786
17792
  function ownsJSDocTag(hostNode, tag) {
17787
17793
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -17820,6 +17826,9 @@ function getEffectiveContainerForJSDocTemplateTag(node) {
17820
17826
  }
17821
17827
  return getHostSignatureFromJSDoc(node);
17822
17828
  }
17829
+ function getJSDocOverloadTags(node) {
17830
+ return getAllJSDocTags(node, isJSDocOverloadTag);
17831
+ }
17823
17832
  function getHostSignatureFromJSDoc(node) {
17824
17833
  const host = getEffectiveJSDocHost(node);
17825
17834
  if (host) {
@@ -23064,8 +23073,10 @@ function createNodeFactory(flags, baseFactory2) {
23064
23073
  return update(updated, original);
23065
23074
  }
23066
23075
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
23076
+ const text = typeof value === "number" ? value + "" : value;
23077
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
23067
23078
  const node = createBaseDeclaration(9 /* NumericLiteral */);
23068
- node.text = typeof value === "number" ? value + "" : value;
23079
+ node.text = text;
23069
23080
  node.numericLiteralFlags = numericLiteralFlags;
23070
23081
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
23071
23082
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -32726,8 +32737,7 @@ var Parser;
32726
32737
  function parseJSDocFunctionType() {
32727
32738
  const pos = getNodePos();
32728
32739
  const hasJSDoc = hasPrecedingJSDocComment();
32729
- if (lookAhead(nextTokenIsOpenParen)) {
32730
- nextToken();
32740
+ if (tryParse(nextTokenIsOpenParen)) {
32731
32741
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
32732
32742
  const type = parseReturnType(
32733
32743
  59 /* ColonToken */,
@@ -54289,7 +54299,7 @@ function createTypeChecker(host) {
54289
54299
  return factory.createStringLiteral(name, !!singleQuote);
54290
54300
  }
54291
54301
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
54292
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
54302
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-name)));
54293
54303
  }
54294
54304
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
54295
54305
  }
@@ -58355,11 +58365,10 @@ function createTypeChecker(host) {
58355
58365
  const baseTypes = getBaseTypes(source);
58356
58366
  if (baseTypes.length) {
58357
58367
  if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
58358
- const symbolTable = createSymbolTable();
58359
- for (const symbol of members.values()) {
58360
- if (!(symbol.flags & 262144 /* TypeParameter */)) {
58361
- symbolTable.set(symbol.escapedName, symbol);
58362
- }
58368
+ const symbolTable = createSymbolTable(source.declaredProperties);
58369
+ const sourceIndex = getIndexSymbol(source.symbol);
58370
+ if (sourceIndex) {
58371
+ symbolTable.set("__index" /* Index */, sourceIndex);
58363
58372
  }
58364
58373
  members = symbolTable;
58365
58374
  }
@@ -60222,22 +60231,15 @@ function createTypeChecker(host) {
60222
60231
  }
60223
60232
  }
60224
60233
  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
- }
60234
+ const tags = getJSDocOverloadTags(decl);
60235
+ if (length(tags)) {
60236
+ for (const tag of tags) {
60237
+ const jsDocSignature = tag.typeExpression;
60238
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
60239
+ reportImplicitAny(jsDocSignature, anyType);
60237
60240
  }
60241
+ result.push(getSignatureFromDeclaration(jsDocSignature));
60238
60242
  }
60239
- }
60240
- if (hasJSDocOverloads) {
60241
60243
  continue;
60242
60244
  }
60243
60245
  }
@@ -81388,15 +81390,7 @@ function createTypeChecker(host) {
81388
81390
  }
81389
81391
  }
81390
81392
  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
- }
81393
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
81400
81394
  }
81401
81395
  }
81402
81396
  }
@@ -84786,7 +84780,7 @@ function createTypeChecker(host) {
84786
84780
  error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
84787
84781
  } else {
84788
84782
  const text = getTextOfPropertyName(member.name);
84789
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
84783
+ if (isNumericLiteralName(text)) {
84790
84784
  error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
84791
84785
  }
84792
84786
  }
@@ -87385,7 +87379,7 @@ function createTypeChecker(host) {
87385
87379
  if (enumResult)
87386
87380
  return enumResult;
87387
87381
  const literalValue = type.value;
87388
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
87382
+ return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
87389
87383
  }
87390
87384
  function createLiteralConstValue(node, tracker) {
87391
87385
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -93985,7 +93979,7 @@ function transformTypeScript(context) {
93985
93979
  function transformEnumMemberDeclarationValue(member) {
93986
93980
  const value = resolver.getConstantValue(member);
93987
93981
  if (value !== void 0) {
93988
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
93982
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
93989
93983
  } else {
93990
93984
  enableSubstitutionForNonQualifiedEnumMembers();
93991
93985
  if (member.initializer) {
@@ -94515,7 +94509,7 @@ function transformTypeScript(context) {
94515
94509
  const constantValue = tryGetConstEnumValue(node);
94516
94510
  if (constantValue !== void 0) {
94517
94511
  setConstantValue(node, constantValue);
94518
- const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
94512
+ const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
94519
94513
  if (!compilerOptions.removeComments) {
94520
94514
  const originalNode = getOriginalNode(node, isAccessExpression);
94521
94515
  addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
@@ -108305,7 +108299,7 @@ function transformGenerators(context) {
108305
108299
  if (labelExpressions === void 0) {
108306
108300
  labelExpressions = [];
108307
108301
  }
108308
- const expression = factory2.createNumericLiteral(-1);
108302
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
108309
108303
  if (labelExpressions[label] === void 0) {
108310
108304
  labelExpressions[label] = [expression];
108311
108305
  } else {
@@ -114180,7 +114174,8 @@ function transformDeclarations(context) {
114180
114174
  if (shouldStripInternal(m))
114181
114175
  return;
114182
114176
  const constValue = resolver.getConstantValue(m);
114183
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
114177
+ const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
114178
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
114184
114179
  }))
114185
114180
  ));
114186
114181
  }
@@ -116081,6 +116076,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
116081
116076
  );
116082
116077
  if (hint === 3 /* MappedTypeParameter */)
116083
116078
  return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
116079
+ if (hint === 7 /* ImportTypeNodeAttributes */)
116080
+ return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
116084
116081
  if (hint === 5 /* EmbeddedStatement */) {
116085
116082
  Debug.assertNode(node, isEmptyStatement);
116086
116083
  return emitEmptyStatement(
@@ -117057,15 +117054,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
117057
117054
  if (node.attributes) {
117058
117055
  writePunctuation(",");
117059
117056
  writeSpace();
117060
- writePunctuation("{");
117061
- writeSpace();
117062
- writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
117063
- writePunctuation(":");
117064
- writeSpace();
117065
- const elements = node.attributes.elements;
117066
- emitList(node.attributes, elements, 526226 /* ImportAttributes */);
117067
- writeSpace();
117068
- writePunctuation("}");
117057
+ pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
117069
117058
  }
117070
117059
  writePunctuation(")");
117071
117060
  if (node.qualifier) {
@@ -118127,6 +118116,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
118127
118116
  }
118128
118117
  writeTrailingSemicolon();
118129
118118
  }
118119
+ function emitImportTypeNodeAttributes(node) {
118120
+ writePunctuation("{");
118121
+ writeSpace();
118122
+ writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
118123
+ writePunctuation(":");
118124
+ writeSpace();
118125
+ const elements = node.elements;
118126
+ emitList(node, elements, 526226 /* ImportAttributes */);
118127
+ writeSpace();
118128
+ writePunctuation("}");
118129
+ }
118130
118130
  function emitImportAttributes(node) {
118131
118131
  emitTokenWithComment(node.token, node.pos, writeKeyword, node);
118132
118132
  writeSpace();
@@ -165962,9 +165962,8 @@ function provideInlayHints(context) {
165962
165962
  break;
165963
165963
  case 181 /* IndexSignature */:
165964
165964
  Debug.assertNode(node, isIndexSignatureDeclaration);
165965
- Debug.assertEqual(node.parameters.length, 1);
165966
165965
  parts.push({ text: "[" });
165967
- visitForDisplayParts(node.parameters[0]);
165966
+ visitDisplayPartList(node.parameters, ", ");
165968
165967
  parts.push({ text: "]" });
165969
165968
  if (node.type) {
165970
165969
  parts.push({ text: ": " });
@@ -173951,6 +173950,7 @@ __export(ts_exports2, {
173951
173950
  getJSDocEnumTag: () => getJSDocEnumTag,
173952
173951
  getJSDocHost: () => getJSDocHost,
173953
173952
  getJSDocImplementsTags: () => getJSDocImplementsTags,
173953
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
173954
173954
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
173955
173955
  getJSDocParameterTags: () => getJSDocParameterTags,
173956
173956
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -188744,6 +188744,7 @@ start(initializeNodeSystem(), require("os").platform());
188744
188744
  getJSDocEnumTag,
188745
188745
  getJSDocHost,
188746
188746
  getJSDocImplementsTags,
188747
+ getJSDocOverloadTags,
188747
188748
  getJSDocOverrideTagNoCache,
188748
188749
  getJSDocParameterTags,
188749
188750
  getJSDocParameterTagsNoCache,
@@ -7896,6 +7896,7 @@ declare namespace ts {
7896
7896
  Unspecified = 4,
7897
7897
  EmbeddedStatement = 5,
7898
7898
  JsxAttributeValue = 6,
7899
+ ImportTypeNodeAttributes = 7,
7899
7900
  }
7900
7901
  enum OuterExpressionKinds {
7901
7902
  Parentheses = 1,
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.20231208`;
39
39
  Comparison = /* @__PURE__ */ ((Comparison3) => {
40
40
  Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
41
41
  Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
@@ -5046,6 +5046,7 @@ ${lanes.join("\n")}
5046
5046
  EmitHint6[EmitHint6["Unspecified"] = 4] = "Unspecified";
5047
5047
  EmitHint6[EmitHint6["EmbeddedStatement"] = 5] = "EmbeddedStatement";
5048
5048
  EmitHint6[EmitHint6["JsxAttributeValue"] = 6] = "JsxAttributeValue";
5049
+ EmitHint6[EmitHint6["ImportTypeNodeAttributes"] = 7] = "ImportTypeNodeAttributes";
5049
5050
  return EmitHint6;
5050
5051
  })(EmitHint || {});
5051
5052
  OuterExpressionKinds = /* @__PURE__ */ ((OuterExpressionKinds2) => {
@@ -15135,12 +15136,12 @@ ${lanes.join("\n")}
15135
15136
  function getJSDocCommentsAndTags(hostNode, noCache) {
15136
15137
  let result;
15137
15138
  if (isVariableLike(hostNode) && hasInitializer(hostNode) && hasJSDocNodes(hostNode.initializer)) {
15138
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(hostNode.initializer.jsDoc)));
15139
+ result = addRange(result, filterOwnedJSDocTags(hostNode, hostNode.initializer.jsDoc));
15139
15140
  }
15140
15141
  let node = hostNode;
15141
15142
  while (node && node.parent) {
15142
15143
  if (hasJSDocNodes(node)) {
15143
- result = addRange(result, filterOwnedJSDocTags(hostNode, last(node.jsDoc)));
15144
+ result = addRange(result, filterOwnedJSDocTags(hostNode, node.jsDoc));
15144
15145
  }
15145
15146
  if (node.kind === 169 /* Parameter */) {
15146
15147
  result = addRange(result, (noCache ? getJSDocParameterTagsNoCache : getJSDocParameterTags)(node));
@@ -15154,12 +15155,16 @@ ${lanes.join("\n")}
15154
15155
  }
15155
15156
  return result || emptyArray;
15156
15157
  }
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;
15158
+ function filterOwnedJSDocTags(hostNode, comments) {
15159
+ const lastJsDoc = last(comments);
15160
+ return flatMap(comments, (jsDoc) => {
15161
+ if (jsDoc === lastJsDoc) {
15162
+ const ownedTags = filter(jsDoc.tags, (tag) => ownsJSDocTag(hostNode, tag));
15163
+ return jsDoc.tags === ownedTags ? [jsDoc] : ownedTags;
15164
+ } else {
15165
+ return filter(jsDoc.tags, isJSDocOverloadTag);
15166
+ }
15167
+ });
15163
15168
  }
15164
15169
  function ownsJSDocTag(hostNode, tag) {
15165
15170
  return !(isJSDocTypeTag(tag) || isJSDocSatisfiesTag(tag)) || !tag.parent || !isJSDoc(tag.parent) || !isParenthesizedExpression(tag.parent.parent) || tag.parent.parent === hostNode;
@@ -15198,6 +15203,9 @@ ${lanes.join("\n")}
15198
15203
  }
15199
15204
  return getHostSignatureFromJSDoc(node);
15200
15205
  }
15206
+ function getJSDocOverloadTags(node) {
15207
+ return getAllJSDocTags(node, isJSDocOverloadTag);
15208
+ }
15201
15209
  function getHostSignatureFromJSDoc(node) {
15202
15210
  const host = getEffectiveJSDocHost(node);
15203
15211
  if (host) {
@@ -20873,8 +20881,10 @@ ${lanes.join("\n")}
20873
20881
  return update(updated, original);
20874
20882
  }
20875
20883
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
20884
+ const text = typeof value === "number" ? value + "" : value;
20885
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
20876
20886
  const node = createBaseDeclaration(9 /* NumericLiteral */);
20877
- node.text = typeof value === "number" ? value + "" : value;
20887
+ node.text = text;
20878
20888
  node.numericLiteralFlags = numericLiteralFlags;
20879
20889
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
20880
20890
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -30793,8 +30803,7 @@ ${lanes.join("\n")}
30793
30803
  function parseJSDocFunctionType() {
30794
30804
  const pos = getNodePos();
30795
30805
  const hasJSDoc = hasPrecedingJSDocComment();
30796
- if (lookAhead(nextTokenIsOpenParen)) {
30797
- nextToken();
30806
+ if (tryParse(nextTokenIsOpenParen)) {
30798
30807
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
30799
30808
  const type = parseReturnType(
30800
30809
  59 /* ColonToken */,
@@ -52051,7 +52060,7 @@ ${lanes.join("\n")}
52051
52060
  return factory.createStringLiteral(name, !!singleQuote);
52052
52061
  }
52053
52062
  if (isNumericLiteralName(name) && startsWith(name, "-")) {
52054
- return factory.createComputedPropertyName(factory.createNumericLiteral(+name));
52063
+ return factory.createComputedPropertyName(factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-name)));
52055
52064
  }
52056
52065
  return createPropertyNameNodeForIdentifierOrLiteral(name, getEmitScriptTarget(compilerOptions), singleQuote, stringNamed, isMethod);
52057
52066
  }
@@ -56117,11 +56126,10 @@ ${lanes.join("\n")}
56117
56126
  const baseTypes = getBaseTypes(source);
56118
56127
  if (baseTypes.length) {
56119
56128
  if (source.symbol && members === getMembersOfSymbol(source.symbol)) {
56120
- const symbolTable = createSymbolTable();
56121
- for (const symbol of members.values()) {
56122
- if (!(symbol.flags & 262144 /* TypeParameter */)) {
56123
- symbolTable.set(symbol.escapedName, symbol);
56124
- }
56129
+ const symbolTable = createSymbolTable(source.declaredProperties);
56130
+ const sourceIndex = getIndexSymbol(source.symbol);
56131
+ if (sourceIndex) {
56132
+ symbolTable.set("__index" /* Index */, sourceIndex);
56125
56133
  }
56126
56134
  members = symbolTable;
56127
56135
  }
@@ -57984,22 +57992,15 @@ ${lanes.join("\n")}
57984
57992
  }
57985
57993
  }
57986
57994
  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
- }
57995
+ const tags = getJSDocOverloadTags(decl);
57996
+ if (length(tags)) {
57997
+ for (const tag of tags) {
57998
+ const jsDocSignature = tag.typeExpression;
57999
+ if (jsDocSignature.type === void 0 && !isConstructorDeclaration(decl)) {
58000
+ reportImplicitAny(jsDocSignature, anyType);
57999
58001
  }
58002
+ result.push(getSignatureFromDeclaration(jsDocSignature));
58000
58003
  }
58001
- }
58002
- if (hasJSDocOverloads) {
58003
58004
  continue;
58004
58005
  }
58005
58006
  }
@@ -79150,15 +79151,7 @@ ${lanes.join("\n")}
79150
79151
  }
79151
79152
  }
79152
79153
  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
- }
79154
+ hasOverloads = length(getJSDocOverloadTags(current)) > 0;
79162
79155
  }
79163
79156
  }
79164
79157
  }
@@ -82548,7 +82541,7 @@ ${lanes.join("\n")}
82548
82541
  error2(member.name, Diagnostics.Computed_property_names_are_not_allowed_in_enums);
82549
82542
  } else {
82550
82543
  const text = getTextOfPropertyName(member.name);
82551
- if (isNumericLiteralName(text) && !isInfinityOrNaNString(text)) {
82544
+ if (isNumericLiteralName(text)) {
82552
82545
  error2(member.name, Diagnostics.An_enum_member_cannot_have_a_numeric_name);
82553
82546
  }
82554
82547
  }
@@ -85147,7 +85140,7 @@ ${lanes.join("\n")}
85147
85140
  if (enumResult)
85148
85141
  return enumResult;
85149
85142
  const literalValue = type.value;
85150
- return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "number" ? factory.createNumericLiteral(literalValue) : factory.createStringLiteral(literalValue);
85143
+ return typeof literalValue === "object" ? factory.createBigIntLiteral(literalValue) : typeof literalValue === "string" ? factory.createStringLiteral(literalValue) : literalValue < 0 ? factory.createPrefixUnaryExpression(41 /* MinusToken */, factory.createNumericLiteral(-literalValue)) : factory.createNumericLiteral(literalValue);
85151
85144
  }
85152
85145
  function createLiteralConstValue(node, tracker) {
85153
85146
  const type = getTypeOfSymbol(getSymbolOfDeclaration(node));
@@ -91927,7 +91920,7 @@ ${lanes.join("\n")}
91927
91920
  function transformEnumMemberDeclarationValue(member) {
91928
91921
  const value = resolver.getConstantValue(member);
91929
91922
  if (value !== void 0) {
91930
- return typeof value === "string" ? factory2.createStringLiteral(value) : factory2.createNumericLiteral(value);
91923
+ return typeof value === "string" ? factory2.createStringLiteral(value) : value < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-value)) : factory2.createNumericLiteral(value);
91931
91924
  } else {
91932
91925
  enableSubstitutionForNonQualifiedEnumMembers();
91933
91926
  if (member.initializer) {
@@ -92457,7 +92450,7 @@ ${lanes.join("\n")}
92457
92450
  const constantValue = tryGetConstEnumValue(node);
92458
92451
  if (constantValue !== void 0) {
92459
92452
  setConstantValue(node, constantValue);
92460
- const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(Math.abs(constantValue))) : factory2.createNumericLiteral(constantValue);
92453
+ const substitute = typeof constantValue === "string" ? factory2.createStringLiteral(constantValue) : constantValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constantValue)) : factory2.createNumericLiteral(constantValue);
92461
92454
  if (!compilerOptions.removeComments) {
92462
92455
  const originalNode = getOriginalNode(node, isAccessExpression);
92463
92456
  addSyntheticTrailingComment(substitute, 3 /* MultiLineCommentTrivia */, ` ${safeMultiLineComment(getTextOfNode(originalNode))} `);
@@ -106340,7 +106333,7 @@ ${lanes.join("\n")}
106340
106333
  if (labelExpressions === void 0) {
106341
106334
  labelExpressions = [];
106342
106335
  }
106343
- const expression = factory2.createNumericLiteral(-1);
106336
+ const expression = factory2.createNumericLiteral(Number.MAX_SAFE_INTEGER);
106344
106337
  if (labelExpressions[label] === void 0) {
106345
106338
  labelExpressions[label] = [expression];
106346
106339
  } else {
@@ -112251,7 +112244,8 @@ ${lanes.join("\n")}
112251
112244
  if (shouldStripInternal(m))
112252
112245
  return;
112253
112246
  const constValue = resolver.getConstantValue(m);
112254
- return preserveJsDoc(factory2.updateEnumMember(m, m.name, constValue !== void 0 ? typeof constValue === "string" ? factory2.createStringLiteral(constValue) : factory2.createNumericLiteral(constValue) : void 0), m);
112247
+ const newInitializer = constValue === void 0 ? void 0 : typeof constValue === "string" ? factory2.createStringLiteral(constValue) : constValue < 0 ? factory2.createPrefixUnaryExpression(41 /* MinusToken */, factory2.createNumericLiteral(-constValue)) : factory2.createNumericLiteral(constValue);
112248
+ return preserveJsDoc(factory2.updateEnumMember(m, m.name, newInitializer), m);
112255
112249
  }))
112256
112250
  ));
112257
112251
  }
@@ -114119,6 +114113,8 @@ ${lanes.join("\n")}
114119
114113
  );
114120
114114
  if (hint === 3 /* MappedTypeParameter */)
114121
114115
  return emitMappedTypeParameter(cast(node, isTypeParameterDeclaration));
114116
+ if (hint === 7 /* ImportTypeNodeAttributes */)
114117
+ return emitImportTypeNodeAttributes(cast(node, isImportAttributes));
114122
114118
  if (hint === 5 /* EmbeddedStatement */) {
114123
114119
  Debug.assertNode(node, isEmptyStatement);
114124
114120
  return emitEmptyStatement(
@@ -115095,15 +115091,7 @@ ${lanes.join("\n")}
115095
115091
  if (node.attributes) {
115096
115092
  writePunctuation(",");
115097
115093
  writeSpace();
115098
- writePunctuation("{");
115099
- writeSpace();
115100
- writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
115101
- writePunctuation(":");
115102
- writeSpace();
115103
- const elements = node.attributes.elements;
115104
- emitList(node.attributes, elements, 526226 /* ImportAttributes */);
115105
- writeSpace();
115106
- writePunctuation("}");
115094
+ pipelineEmit(7 /* ImportTypeNodeAttributes */, node.attributes);
115107
115095
  }
115108
115096
  writePunctuation(")");
115109
115097
  if (node.qualifier) {
@@ -116165,6 +116153,17 @@ ${lanes.join("\n")}
116165
116153
  }
116166
116154
  writeTrailingSemicolon();
116167
116155
  }
116156
+ function emitImportTypeNodeAttributes(node) {
116157
+ writePunctuation("{");
116158
+ writeSpace();
116159
+ writeKeyword(node.token === 132 /* AssertKeyword */ ? "assert" : "with");
116160
+ writePunctuation(":");
116161
+ writeSpace();
116162
+ const elements = node.elements;
116163
+ emitList(node, elements, 526226 /* ImportAttributes */);
116164
+ writeSpace();
116165
+ writePunctuation("}");
116166
+ }
116168
116167
  function emitImportAttributes(node) {
116169
116168
  emitTokenWithComment(node.token, node.pos, writeKeyword, node);
116170
116169
  writeSpace();
@@ -165303,9 +165302,8 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
165303
165302
  break;
165304
165303
  case 181 /* IndexSignature */:
165305
165304
  Debug.assertNode(node, isIndexSignatureDeclaration);
165306
- Debug.assertEqual(node.parameters.length, 1);
165307
165305
  parts.push({ text: "[" });
165308
- visitForDisplayParts(node.parameters[0]);
165306
+ visitDisplayPartList(node.parameters, ", ");
165309
165307
  parts.push({ text: "]" });
165310
165308
  if (node.type) {
165311
165309
  parts.push({ text: ": " });
@@ -185508,6 +185506,7 @@ ${e.message}`;
185508
185506
  getJSDocEnumTag: () => getJSDocEnumTag,
185509
185507
  getJSDocHost: () => getJSDocHost,
185510
185508
  getJSDocImplementsTags: () => getJSDocImplementsTags,
185509
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
185511
185510
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
185512
185511
  getJSDocParameterTags: () => getJSDocParameterTags,
185513
185512
  getJSDocParameterTagsNoCache: () => getJSDocParameterTagsNoCache,
@@ -187922,6 +187921,7 @@ ${e.message}`;
187922
187921
  getJSDocEnumTag: () => getJSDocEnumTag,
187923
187922
  getJSDocHost: () => getJSDocHost,
187924
187923
  getJSDocImplementsTags: () => getJSDocImplementsTags,
187924
+ getJSDocOverloadTags: () => getJSDocOverloadTags,
187925
187925
  getJSDocOverrideTagNoCache: () => getJSDocOverrideTagNoCache,
187926
187926
  getJSDocParameterTags: () => getJSDocParameterTags,
187927
187927
  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.20231208`;
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;
@@ -13050,8 +13054,10 @@ function createNodeFactory(flags, baseFactory2) {
13050
13054
  return update(updated, original);
13051
13055
  }
13052
13056
  function createNumericLiteral(value, numericLiteralFlags = 0 /* None */) {
13057
+ const text = typeof value === "number" ? value + "" : value;
13058
+ Debug.assert(text.charCodeAt(0) !== 45 /* minus */, "Negative numbers should be created in combination with createPrefixUnaryExpression");
13053
13059
  const node = createBaseDeclaration(9 /* NumericLiteral */);
13054
- node.text = typeof value === "number" ? value + "" : value;
13060
+ node.text = text;
13055
13061
  node.numericLiteralFlags = numericLiteralFlags;
13056
13062
  if (numericLiteralFlags & 384 /* BinaryOrOctalSpecifier */)
13057
13063
  node.transformFlags |= 1024 /* ContainsES2015 */;
@@ -17344,6 +17350,9 @@ function isJSDocReadonlyTag(node) {
17344
17350
  function isJSDocOverrideTag(node) {
17345
17351
  return node.kind === 344 /* JSDocOverrideTag */;
17346
17352
  }
17353
+ function isJSDocOverloadTag(node) {
17354
+ return node.kind === 346 /* JSDocOverloadTag */;
17355
+ }
17347
17356
  function isJSDocDeprecatedTag(node) {
17348
17357
  return node.kind === 338 /* JSDocDeprecatedTag */;
17349
17358
  }
@@ -20112,8 +20121,7 @@ var Parser;
20112
20121
  function parseJSDocFunctionType() {
20113
20122
  const pos = getNodePos();
20114
20123
  const hasJSDoc = hasPrecedingJSDocComment();
20115
- if (lookAhead(nextTokenIsOpenParen)) {
20116
- nextToken();
20124
+ if (tryParse(nextTokenIsOpenParen)) {
20117
20125
  const parameters = parseParameters(4 /* Type */ | 32 /* JSDoc */);
20118
20126
  const type = parseReturnType(
20119
20127
  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.20231208",
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": "e3d234cfc8653d14e907ae84f918d5bd18546619"
118
118
  }