typescript 5.0.0-dev.20221212 → 5.0.0-dev.20221213

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
@@ -23,7 +23,7 @@ var __export = (target, all) => {
23
23
 
24
24
  // src/compiler/corePublic.ts
25
25
  var versionMajorMinor = "5.0";
26
- var version = `${versionMajorMinor}.0-dev.20221212`;
26
+ var version = `${versionMajorMinor}.0-dev.20221213`;
27
27
 
28
28
  // src/compiler/core.ts
29
29
  var emptyArray = [];
@@ -3340,14 +3340,15 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3340
3340
  SyntaxKind4[SyntaxKind4["JSDocTypedefTag"] = 348] = "JSDocTypedefTag";
3341
3341
  SyntaxKind4[SyntaxKind4["JSDocSeeTag"] = 349] = "JSDocSeeTag";
3342
3342
  SyntaxKind4[SyntaxKind4["JSDocPropertyTag"] = 350] = "JSDocPropertyTag";
3343
- SyntaxKind4[SyntaxKind4["SyntaxList"] = 351] = "SyntaxList";
3344
- SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 352] = "NotEmittedStatement";
3345
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 353] = "PartiallyEmittedExpression";
3346
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 354] = "CommaListExpression";
3347
- SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 355] = "MergeDeclarationMarker";
3348
- SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 356] = "EndOfDeclarationMarker";
3349
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 357] = "SyntheticReferenceExpression";
3350
- SyntaxKind4[SyntaxKind4["Count"] = 358] = "Count";
3343
+ SyntaxKind4[SyntaxKind4["JSDocThrowsTag"] = 351] = "JSDocThrowsTag";
3344
+ SyntaxKind4[SyntaxKind4["SyntaxList"] = 352] = "SyntaxList";
3345
+ SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 353] = "NotEmittedStatement";
3346
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 354] = "PartiallyEmittedExpression";
3347
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 355] = "CommaListExpression";
3348
+ SyntaxKind4[SyntaxKind4["MergeDeclarationMarker"] = 356] = "MergeDeclarationMarker";
3349
+ SyntaxKind4[SyntaxKind4["EndOfDeclarationMarker"] = 357] = "EndOfDeclarationMarker";
3350
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 358] = "SyntheticReferenceExpression";
3351
+ SyntaxKind4[SyntaxKind4["Count"] = 359] = "Count";
3351
3352
  SyntaxKind4[SyntaxKind4["FirstAssignment"] = 63 /* EqualsToken */] = "FirstAssignment";
3352
3353
  SyntaxKind4[SyntaxKind4["LastAssignment"] = 78 /* CaretEqualsToken */] = "LastAssignment";
3353
3354
  SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 64 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -3376,9 +3377,9 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3376
3377
  SyntaxKind4[SyntaxKind4["LastStatement"] = 256 /* DebuggerStatement */] = "LastStatement";
3377
3378
  SyntaxKind4[SyntaxKind4["FirstNode"] = 163 /* QualifiedName */] = "FirstNode";
3378
3379
  SyntaxKind4[SyntaxKind4["FirstJSDocNode"] = 312 /* JSDocTypeExpression */] = "FirstJSDocNode";
3379
- SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 350 /* JSDocPropertyTag */] = "LastJSDocNode";
3380
+ SyntaxKind4[SyntaxKind4["LastJSDocNode"] = 351 /* JSDocThrowsTag */] = "LastJSDocNode";
3380
3381
  SyntaxKind4[SyntaxKind4["FirstJSDocTagNode"] = 330 /* JSDocTag */] = "FirstJSDocTagNode";
3381
- SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 350 /* JSDocPropertyTag */] = "LastJSDocTagNode";
3382
+ SyntaxKind4[SyntaxKind4["LastJSDocTagNode"] = 351 /* JSDocThrowsTag */] = "LastJSDocTagNode";
3382
3383
  SyntaxKind4[SyntaxKind4["FirstContextualKeyword"] = 126 /* AbstractKeyword */] = "FirstContextualKeyword";
3383
3384
  SyntaxKind4[SyntaxKind4["LastContextualKeyword"] = 162 /* OfKeyword */] = "LastContextualKeyword";
3384
3385
  return SyntaxKind4;
@@ -10365,8 +10366,8 @@ function isExpressionKind(kind) {
10365
10366
  case 227 /* SpreadElement */:
10366
10367
  case 231 /* AsExpression */:
10367
10368
  case 229 /* OmittedExpression */:
10368
- case 354 /* CommaListExpression */:
10369
- case 353 /* PartiallyEmittedExpression */:
10369
+ case 355 /* CommaListExpression */:
10370
+ case 354 /* PartiallyEmittedExpression */:
10370
10371
  case 235 /* SatisfiesExpression */:
10371
10372
  return true;
10372
10373
  default:
@@ -10429,7 +10430,7 @@ function isDeclarationStatementKind(kind) {
10429
10430
  return kind === 259 /* FunctionDeclaration */ || kind === 279 /* MissingDeclaration */ || kind === 260 /* ClassDeclaration */ || kind === 261 /* InterfaceDeclaration */ || kind === 262 /* TypeAliasDeclaration */ || kind === 263 /* EnumDeclaration */ || kind === 264 /* ModuleDeclaration */ || kind === 269 /* ImportDeclaration */ || kind === 268 /* ImportEqualsDeclaration */ || kind === 275 /* ExportDeclaration */ || kind === 274 /* ExportAssignment */ || kind === 267 /* NamespaceExportDeclaration */;
10430
10431
  }
10431
10432
  function isStatementKindButNotDeclarationKind(kind) {
10432
- return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 352 /* NotEmittedStatement */ || kind === 356 /* EndOfDeclarationMarker */ || kind === 355 /* MergeDeclarationMarker */;
10433
+ return kind === 249 /* BreakStatement */ || kind === 248 /* ContinueStatement */ || kind === 256 /* DebuggerStatement */ || kind === 243 /* DoStatement */ || kind === 241 /* ExpressionStatement */ || kind === 239 /* EmptyStatement */ || kind === 246 /* ForInStatement */ || kind === 247 /* ForOfStatement */ || kind === 245 /* ForStatement */ || kind === 242 /* IfStatement */ || kind === 253 /* LabeledStatement */ || kind === 250 /* ReturnStatement */ || kind === 252 /* SwitchStatement */ || kind === 254 /* ThrowStatement */ || kind === 255 /* TryStatement */ || kind === 240 /* VariableStatement */ || kind === 244 /* WhileStatement */ || kind === 251 /* WithStatement */ || kind === 353 /* NotEmittedStatement */ || kind === 357 /* EndOfDeclarationMarker */ || kind === 356 /* MergeDeclarationMarker */;
10433
10434
  }
10434
10435
  function isDeclaration(node) {
10435
10436
  if (node.kind === 165 /* TypeParameter */) {
@@ -10490,10 +10491,10 @@ function isCaseOrDefaultClause(node) {
10490
10491
  return kind === 292 /* CaseClause */ || kind === 293 /* DefaultClause */;
10491
10492
  }
10492
10493
  function isJSDocNode(node) {
10493
- return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 350 /* LastJSDocNode */;
10494
+ return node.kind >= 312 /* FirstJSDocNode */ && node.kind <= 351 /* LastJSDocNode */;
10494
10495
  }
10495
10496
  function isJSDocTag(node) {
10496
- return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 350 /* LastJSDocTagNode */;
10497
+ return node.kind >= 330 /* FirstJSDocTagNode */ && node.kind <= 351 /* LastJSDocTagNode */;
10497
10498
  }
10498
10499
  function isSetAccessor(node) {
10499
10500
  return node.kind === 175 /* SetAccessor */;
@@ -10875,7 +10876,7 @@ function getTokenPosOfNode(node, sourceFile, includeJsDoc) {
10875
10876
  if (includeJsDoc && hasJSDocNodes(node)) {
10876
10877
  return getTokenPosOfNode(node.jsDoc[0], sourceFile);
10877
10878
  }
10878
- if (node.kind === 351 /* SyntaxList */ && node._children.length > 0) {
10879
+ if (node.kind === 352 /* SyntaxList */ && node._children.length > 0) {
10879
10880
  return getTokenPosOfNode(node._children[0], sourceFile, includeJsDoc);
10880
10881
  }
10881
10882
  return skipTrivia(
@@ -11970,7 +11971,7 @@ function isExpressionNode(node) {
11970
11971
  case 233 /* MetaProperty */:
11971
11972
  return true;
11972
11973
  case 230 /* ExpressionWithTypeArguments */:
11973
- return !isHeritageClause(node.parent);
11974
+ return !isHeritageClause(node.parent) && !isJSDocAugmentsTag(node.parent);
11974
11975
  case 163 /* QualifiedName */:
11975
11976
  while (node.parent.kind === 163 /* QualifiedName */) {
11976
11977
  node = node.parent;
@@ -12936,7 +12937,7 @@ function getOperator(expression) {
12936
12937
  }
12937
12938
  function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
12938
12939
  switch (nodeKind) {
12939
- case 354 /* CommaListExpression */:
12940
+ case 355 /* CommaListExpression */:
12940
12941
  return 0 /* Comma */;
12941
12942
  case 227 /* SpreadElement */:
12942
12943
  return 1 /* Spread */;
@@ -13910,7 +13911,18 @@ function tryGetClassExtendingExpressionWithTypeArguments(node) {
13910
13911
  return cls && !cls.isImplements ? cls.class : void 0;
13911
13912
  }
13912
13913
  function tryGetClassImplementingOrExtendingExpressionWithTypeArguments(node) {
13913
- return isExpressionWithTypeArguments(node) && isHeritageClause(node.parent) && isClassLike(node.parent.parent) ? { class: node.parent.parent, isImplements: node.parent.token === 117 /* ImplementsKeyword */ } : void 0;
13914
+ if (isExpressionWithTypeArguments(node)) {
13915
+ if (isHeritageClause(node.parent) && isClassLike(node.parent.parent)) {
13916
+ return { class: node.parent.parent, isImplements: node.parent.token === 117 /* ImplementsKeyword */ };
13917
+ }
13918
+ if (isJSDocAugmentsTag(node.parent)) {
13919
+ const host = getEffectiveJSDocHost(node.parent);
13920
+ if (host && isClassLike(host)) {
13921
+ return { class: host, isImplements: false };
13922
+ }
13923
+ }
13924
+ }
13925
+ return void 0;
13914
13926
  }
13915
13927
  function isAssignmentExpression(node, excludeCompoundAssignment) {
13916
13928
  return isBinaryExpression(node) && (excludeCompoundAssignment ? node.operatorToken.kind === 63 /* EqualsToken */ : isAssignmentOperator(node.operatorToken.kind)) && isLeftHandSideExpression(node.left);
@@ -14358,7 +14370,7 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
14358
14370
  case 209 /* ElementAccessExpression */:
14359
14371
  case 208 /* PropertyAccessExpression */:
14360
14372
  case 232 /* NonNullExpression */:
14361
- case 353 /* PartiallyEmittedExpression */:
14373
+ case 354 /* PartiallyEmittedExpression */:
14362
14374
  case 235 /* SatisfiesExpression */:
14363
14375
  node = node.expression;
14364
14376
  continue;
@@ -15484,7 +15496,7 @@ function getContainingNodeArray(node) {
15484
15496
  return parent.types;
15485
15497
  case 186 /* TupleType */:
15486
15498
  case 206 /* ArrayLiteralExpression */:
15487
- case 354 /* CommaListExpression */:
15499
+ case 355 /* CommaListExpression */:
15488
15500
  case 272 /* NamedImports */:
15489
15501
  case 276 /* NamedExports */:
15490
15502
  return parent.elements;
@@ -15636,6 +15648,23 @@ function canUsePropertyAccess(name, languageVersion) {
15636
15648
  const firstChar = name.charCodeAt(0);
15637
15649
  return firstChar === 35 /* hash */ ? name.length > 1 && isIdentifierStart(name.charCodeAt(1), languageVersion) : isIdentifierStart(firstChar, languageVersion);
15638
15650
  }
15651
+ function isJSDocOptionalParameter(node) {
15652
+ return isInJSFile(node) && (node.type && node.type.kind === 319 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 319 /* JSDocOptionalType */));
15653
+ }
15654
+ function isOptionalDeclaration(declaration) {
15655
+ switch (declaration.kind) {
15656
+ case 169 /* PropertyDeclaration */:
15657
+ case 168 /* PropertySignature */:
15658
+ return !!declaration.questionToken;
15659
+ case 166 /* Parameter */:
15660
+ return !!declaration.questionToken || isJSDocOptionalParameter(declaration);
15661
+ case 350 /* JSDocPropertyTag */:
15662
+ case 343 /* JSDocParameterTag */:
15663
+ return isOptionalJSDocPropertyLikeTag(declaration);
15664
+ default:
15665
+ return false;
15666
+ }
15667
+ }
15639
15668
 
15640
15669
  // src/compiler/factory/baseNodeFactory.ts
15641
15670
  function createBaseNodeFactory() {
@@ -16580,6 +16609,12 @@ function createNodeFactory(flags, baseFactory2) {
16580
16609
  get updateJSDocDeprecatedTag() {
16581
16610
  return getJSDocSimpleTagUpdateFunction(334 /* JSDocDeprecatedTag */);
16582
16611
  },
16612
+ get createJSDocThrowsTag() {
16613
+ return getJSDocTypeLikeTagCreateFunction(351 /* JSDocThrowsTag */);
16614
+ },
16615
+ get updateJSDocThrowsTag() {
16616
+ return getJSDocTypeLikeTagUpdateFunction(351 /* JSDocThrowsTag */);
16617
+ },
16583
16618
  createJSDocUnknownTag,
16584
16619
  updateJSDocUnknownTag,
16585
16620
  createJSDocText,
@@ -19529,18 +19564,18 @@ function createNodeFactory(flags, baseFactory2) {
19529
19564
  return node;
19530
19565
  }
19531
19566
  function createSyntaxList(children) {
19532
- const node = createBaseNode(351 /* SyntaxList */);
19567
+ const node = createBaseNode(352 /* SyntaxList */);
19533
19568
  node._children = children;
19534
19569
  return node;
19535
19570
  }
19536
19571
  function createNotEmittedStatement(original) {
19537
- const node = createBaseNode(352 /* NotEmittedStatement */);
19572
+ const node = createBaseNode(353 /* NotEmittedStatement */);
19538
19573
  node.original = original;
19539
19574
  setTextRange(node, original);
19540
19575
  return node;
19541
19576
  }
19542
19577
  function createPartiallyEmittedExpression(expression, original) {
19543
- const node = createBaseNode(353 /* PartiallyEmittedExpression */);
19578
+ const node = createBaseNode(354 /* PartiallyEmittedExpression */);
19544
19579
  node.expression = expression;
19545
19580
  node.original = original;
19546
19581
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -19562,7 +19597,7 @@ function createNodeFactory(flags, baseFactory2) {
19562
19597
  return node;
19563
19598
  }
19564
19599
  function createCommaListExpression(elements) {
19565
- const node = createBaseNode(354 /* CommaListExpression */);
19600
+ const node = createBaseNode(355 /* CommaListExpression */);
19566
19601
  node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
19567
19602
  node.transformFlags |= propagateChildrenFlags(node.elements);
19568
19603
  return node;
@@ -19571,19 +19606,19 @@ function createNodeFactory(flags, baseFactory2) {
19571
19606
  return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
19572
19607
  }
19573
19608
  function createEndOfDeclarationMarker(original) {
19574
- const node = createBaseNode(356 /* EndOfDeclarationMarker */);
19609
+ const node = createBaseNode(357 /* EndOfDeclarationMarker */);
19575
19610
  node.emitNode = {};
19576
19611
  node.original = original;
19577
19612
  return node;
19578
19613
  }
19579
19614
  function createMergeDeclarationMarker(original) {
19580
- const node = createBaseNode(355 /* MergeDeclarationMarker */);
19615
+ const node = createBaseNode(356 /* MergeDeclarationMarker */);
19581
19616
  node.emitNode = {};
19582
19617
  node.original = original;
19583
19618
  return node;
19584
19619
  }
19585
19620
  function createSyntheticReferenceExpression(expression, thisArg) {
19586
- const node = createBaseNode(357 /* SyntheticReferenceExpression */);
19621
+ const node = createBaseNode(358 /* SyntheticReferenceExpression */);
19587
19622
  node.expression = expression;
19588
19623
  node.thisArg = thisArg;
19589
19624
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -19731,7 +19766,7 @@ function createNodeFactory(flags, baseFactory2) {
19731
19766
  return updateSatisfiesExpression(outerExpression, expression, outerExpression.type);
19732
19767
  case 232 /* NonNullExpression */:
19733
19768
  return updateNonNullExpression(outerExpression, expression);
19734
- case 353 /* PartiallyEmittedExpression */:
19769
+ case 354 /* PartiallyEmittedExpression */:
19735
19770
  return updatePartiallyEmittedExpression(outerExpression, expression);
19736
19771
  }
19737
19772
  }
@@ -20222,7 +20257,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
20222
20257
  case 213 /* TypeAssertionExpression */:
20223
20258
  case 235 /* SatisfiesExpression */:
20224
20259
  case 231 /* AsExpression */:
20225
- case 353 /* PartiallyEmittedExpression */:
20260
+ case 354 /* PartiallyEmittedExpression */:
20226
20261
  case 214 /* ParenthesizedExpression */:
20227
20262
  case 106 /* SuperKeyword */:
20228
20263
  return -2147483648 /* OuterExpressionExcludes */;
@@ -21674,10 +21709,10 @@ function isMetaProperty(node) {
21674
21709
  return node.kind === 233 /* MetaProperty */;
21675
21710
  }
21676
21711
  function isPartiallyEmittedExpression(node) {
21677
- return node.kind === 353 /* PartiallyEmittedExpression */;
21712
+ return node.kind === 354 /* PartiallyEmittedExpression */;
21678
21713
  }
21679
21714
  function isCommaListExpression(node) {
21680
- return node.kind === 354 /* CommaListExpression */;
21715
+ return node.kind === 355 /* CommaListExpression */;
21681
21716
  }
21682
21717
  function isTemplateSpan(node) {
21683
21718
  return node.kind === 236 /* TemplateSpan */;
@@ -21800,10 +21835,10 @@ function isExportSpecifier(node) {
21800
21835
  return node.kind === 278 /* ExportSpecifier */;
21801
21836
  }
21802
21837
  function isNotEmittedStatement(node) {
21803
- return node.kind === 352 /* NotEmittedStatement */;
21838
+ return node.kind === 353 /* NotEmittedStatement */;
21804
21839
  }
21805
21840
  function isSyntheticReference(node) {
21806
- return node.kind === 357 /* SyntheticReferenceExpression */;
21841
+ return node.kind === 358 /* SyntheticReferenceExpression */;
21807
21842
  }
21808
21843
  function isExternalModuleReference(node) {
21809
21844
  return node.kind === 280 /* ExternalModuleReference */;
@@ -21961,6 +21996,9 @@ function isJSDocTemplateTag(node) {
21961
21996
  function isJSDocTypedefTag(node) {
21962
21997
  return node.kind === 348 /* JSDocTypedefTag */;
21963
21998
  }
21999
+ function isJSDocPropertyTag(node) {
22000
+ return node.kind === 350 /* JSDocPropertyTag */;
22001
+ }
21964
22002
  function isJSDocImplementsTag(node) {
21965
22003
  return node.kind === 332 /* JSDocImplementsTag */;
21966
22004
  }
@@ -22259,7 +22297,7 @@ function startsWithUseStrict(statements) {
22259
22297
  return firstStatement !== void 0 && isPrologueDirective(firstStatement) && isUseStrictPrologue(firstStatement);
22260
22298
  }
22261
22299
  function isCommaSequence(node) {
22262
- return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 354 /* CommaListExpression */;
22300
+ return node.kind === 223 /* BinaryExpression */ && node.operatorToken.kind === 27 /* CommaToken */ || node.kind === 355 /* CommaListExpression */;
22263
22301
  }
22264
22302
  function isJSDocTypeAssertion(node) {
22265
22303
  return isParenthesizedExpression(node) && isInJSFile(node) && !!getJSDocTypeTag(node);
@@ -22282,7 +22320,7 @@ function isOuterExpression(node, kinds = 15 /* All */) {
22282
22320
  return (kinds & 2 /* TypeAssertions */) !== 0;
22283
22321
  case 232 /* NonNullExpression */:
22284
22322
  return (kinds & 4 /* NonNullAssertions */) !== 0;
22285
- case 353 /* PartiallyEmittedExpression */:
22323
+ case 354 /* PartiallyEmittedExpression */:
22286
22324
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
22287
22325
  }
22288
22326
  return false;
@@ -23209,7 +23247,7 @@ var forEachChildTable = {
23209
23247
  [279 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
23210
23248
  return visitNodes(cbNode, cbNodes, node.illegalDecorators) || visitNodes(cbNode, cbNodes, node.modifiers);
23211
23249
  },
23212
- [354 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
23250
+ [355 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
23213
23251
  return visitNodes(cbNode, cbNodes, node.elements);
23214
23252
  },
23215
23253
  [281 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
@@ -23277,10 +23315,11 @@ var forEachChildTable = {
23277
23315
  [341 /* JSDocCallbackTag */]: function forEachChildInJSDocCallbackTag(node, cbNode, cbNodes) {
23278
23316
  return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.fullName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
23279
23317
  },
23280
- [344 /* JSDocReturnTag */]: forEachChildInJSDocReturnTag,
23281
- [346 /* JSDocTypeTag */]: forEachChildInJSDocReturnTag,
23282
- [345 /* JSDocThisTag */]: forEachChildInJSDocReturnTag,
23283
- [342 /* JSDocEnumTag */]: forEachChildInJSDocReturnTag,
23318
+ [344 /* JSDocReturnTag */]: forEachChildInJSDocTypeLikeTag,
23319
+ [346 /* JSDocTypeTag */]: forEachChildInJSDocTypeLikeTag,
23320
+ [345 /* JSDocThisTag */]: forEachChildInJSDocTypeLikeTag,
23321
+ [342 /* JSDocEnumTag */]: forEachChildInJSDocTypeLikeTag,
23322
+ [351 /* JSDocThrowsTag */]: forEachChildInJSDocTypeLikeTag,
23284
23323
  [326 /* JSDocSignature */]: function forEachChildInJSDocSignature(node, cbNode, _cbNodes) {
23285
23324
  return forEach(node.typeParameters, cbNode) || forEach(node.parameters, cbNode) || visitNode2(cbNode, node.type);
23286
23325
  },
@@ -23298,7 +23337,7 @@ var forEachChildTable = {
23298
23337
  [339 /* JSDocReadonlyTag */]: forEachChildInJSDocTag,
23299
23338
  [334 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
23300
23339
  [340 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
23301
- [353 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
23340
+ [354 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
23302
23341
  };
23303
23342
  function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
23304
23343
  return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -23339,7 +23378,7 @@ function forEachChildInOptionalRestOrJSDocParameterModifier(node, cbNode, _cbNod
23339
23378
  function forEachChildInJSDocParameterOrPropertyTag(node, cbNode, cbNodes) {
23340
23379
  return visitNode2(cbNode, node.tagName) || (node.isNameFirst ? visitNode2(cbNode, node.name) || visitNode2(cbNode, node.typeExpression) : visitNode2(cbNode, node.typeExpression) || visitNode2(cbNode, node.name)) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
23341
23380
  }
23342
- function forEachChildInJSDocReturnTag(node, cbNode, cbNodes) {
23381
+ function forEachChildInJSDocTypeLikeTag(node, cbNode, cbNodes) {
23343
23382
  return visitNode2(cbNode, node.tagName) || visitNode2(cbNode, node.typeExpression) || (typeof node.comment === "string" ? void 0 : visitNodes(cbNode, cbNodes, node.comment));
23344
23383
  }
23345
23384
  function forEachChildInJSDocLinkCodeOrPlain(node, cbNode, _cbNodes) {
@@ -28622,6 +28661,10 @@ var Parser;
28622
28661
  case "see":
28623
28662
  tag = parseSeeTag(start2, tagName, margin, indentText);
28624
28663
  break;
28664
+ case "exception":
28665
+ case "throws":
28666
+ tag = parseThrowsTag(start2, tagName, margin, indentText);
28667
+ break;
28625
28668
  default:
28626
28669
  tag = parseUnknownTag(start2, tagName, margin, indentText);
28627
28670
  break;
@@ -28874,6 +28917,11 @@ var Parser;
28874
28917
  const comments2 = indent2 !== void 0 && indentText !== void 0 ? parseTrailingTagComments(start2, getNodePos(), indent2, indentText) : void 0;
28875
28918
  return finishNode(factory2.createJSDocSeeTag(tagName, nameExpression, comments2), start2);
28876
28919
  }
28920
+ function parseThrowsTag(start2, tagName, indent2, indentText) {
28921
+ const typeExpression = tryParseTypeExpression();
28922
+ const comment = parseTrailingTagComments(start2, getNodePos(), indent2, indentText);
28923
+ return finishNode(factory2.createJSDocThrowsTag(tagName, typeExpression, comment), start2);
28924
+ }
28877
28925
  function parseAuthorTag(start2, tagName, indent2, indentText) {
28878
28926
  const commentStart = getNodePos();
28879
28927
  const textOnly = parseAuthorNameAndEmail();
@@ -45099,8 +45147,8 @@ function createTypeChecker(host) {
45099
45147
  if (isBindingPattern(declaration.parent)) {
45100
45148
  return getTypeForBindingElement(declaration);
45101
45149
  }
45102
- const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration);
45103
- const isOptional = includeOptionality && (isProperty && !!declaration.questionToken || isParameter(declaration) && (!!declaration.questionToken || isJSDocOptionalParameter(declaration)) || isOptionalJSDocPropertyLikeTag(declaration));
45150
+ const isProperty = isPropertyDeclaration(declaration) && !hasAccessorModifier(declaration) || isPropertySignature(declaration) || isJSDocPropertyTag(declaration);
45151
+ const isOptional = includeOptionality && isOptionalDeclaration(declaration);
45104
45152
  const declaredType = tryGetTypeFromEffectiveTypeNode(declaration);
45105
45153
  if (declaredType) {
45106
45154
  return addOptionality(declaredType, isProperty, isOptional);
@@ -48008,9 +48056,6 @@ function createTypeChecker(host) {
48008
48056
  });
48009
48057
  return result;
48010
48058
  }
48011
- function isJSDocOptionalParameter(node) {
48012
- return isInJSFile(node) && (node.type && node.type.kind === 319 /* JSDocOptionalType */ || getJSDocParameterTags(node).some(({ isBracketed, typeExpression }) => isBracketed || !!typeExpression && typeExpression.type.kind === 319 /* JSDocOptionalType */));
48013
- }
48014
48059
  function tryFindAmbientModule(moduleName, withAugmentations) {
48015
48060
  if (isExternalModuleNameRelative(moduleName)) {
48016
48061
  return void 0;
@@ -74239,13 +74284,13 @@ var visitEachChildTable = {
74239
74284
  visitLexicalEnvironment(node.statements, visitor, context)
74240
74285
  );
74241
74286
  },
74242
- [353 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
74287
+ [354 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
74243
74288
  return context.factory.updatePartiallyEmittedExpression(
74244
74289
  node,
74245
74290
  nodeVisitor(node.expression, visitor, isExpression)
74246
74291
  );
74247
74292
  },
74248
- [354 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
74293
+ [355 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
74249
74294
  return context.factory.updateCommaListExpression(
74250
74295
  node,
74251
74296
  nodesVisitor(node.elements, visitor, isExpression)
@@ -80144,7 +80189,7 @@ function transformES2018(context) {
80144
80189
  return visitObjectLiteralExpression(node);
80145
80190
  case 223 /* BinaryExpression */:
80146
80191
  return visitBinaryExpression(node, expressionResultIsUnused2);
80147
- case 354 /* CommaListExpression */:
80192
+ case 355 /* CommaListExpression */:
80148
80193
  return visitCommaListExpression(node, expressionResultIsUnused2);
80149
80194
  case 295 /* CatchClause */:
80150
80195
  return visitCatchClause(node);
@@ -82340,7 +82385,7 @@ function transformES2015(context) {
82340
82385
  return visitParenthesizedExpression(node, expressionResultIsUnused2);
82341
82386
  case 223 /* BinaryExpression */:
82342
82387
  return visitBinaryExpression(node, expressionResultIsUnused2);
82343
- case 354 /* CommaListExpression */:
82388
+ case 355 /* CommaListExpression */:
82344
82389
  return visitCommaListExpression(node, expressionResultIsUnused2);
82345
82390
  case 14 /* NoSubstitutionTemplateLiteral */:
82346
82391
  case 15 /* TemplateHead */:
@@ -85035,7 +85080,7 @@ function transformGenerators(context) {
85035
85080
  switch (node.kind) {
85036
85081
  case 223 /* BinaryExpression */:
85037
85082
  return visitBinaryExpression(node);
85038
- case 354 /* CommaListExpression */:
85083
+ case 355 /* CommaListExpression */:
85039
85084
  return visitCommaListExpression(node);
85040
85085
  case 224 /* ConditionalExpression */:
85041
85086
  return visitConditionalExpression(node);
@@ -87120,9 +87165,9 @@ function transformModule(context) {
87120
87165
  return visitFunctionDeclaration(node);
87121
87166
  case 260 /* ClassDeclaration */:
87122
87167
  return visitClassDeclaration(node);
87123
- case 355 /* MergeDeclarationMarker */:
87168
+ case 356 /* MergeDeclarationMarker */:
87124
87169
  return visitMergeDeclarationMarker(node);
87125
- case 356 /* EndOfDeclarationMarker */:
87170
+ case 357 /* EndOfDeclarationMarker */:
87126
87171
  return visitEndOfDeclarationMarker(node);
87127
87172
  default:
87128
87173
  return visitor(node);
@@ -87139,7 +87184,7 @@ function transformModule(context) {
87139
87184
  return visitExpressionStatement(node);
87140
87185
  case 214 /* ParenthesizedExpression */:
87141
87186
  return visitParenthesizedExpression(node, valueIsDiscarded);
87142
- case 353 /* PartiallyEmittedExpression */:
87187
+ case 354 /* PartiallyEmittedExpression */:
87143
87188
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
87144
87189
  case 210 /* CallExpression */:
87145
87190
  if (isImportCall(node) && currentSourceFile.impliedNodeFormat === void 0) {
@@ -88914,9 +88959,9 @@ function transformSystemModule(context) {
88914
88959
  return visitCatchClause(node);
88915
88960
  case 238 /* Block */:
88916
88961
  return visitBlock(node);
88917
- case 355 /* MergeDeclarationMarker */:
88962
+ case 356 /* MergeDeclarationMarker */:
88918
88963
  return visitMergeDeclarationMarker(node);
88919
- case 356 /* EndOfDeclarationMarker */:
88964
+ case 357 /* EndOfDeclarationMarker */:
88920
88965
  return visitEndOfDeclarationMarker(node);
88921
88966
  default:
88922
88967
  return visitor(node);
@@ -89064,7 +89109,7 @@ function transformSystemModule(context) {
89064
89109
  return visitExpressionStatement(node);
89065
89110
  case 214 /* ParenthesizedExpression */:
89066
89111
  return visitParenthesizedExpression(node, valueIsDiscarded);
89067
- case 353 /* PartiallyEmittedExpression */:
89112
+ case 354 /* PartiallyEmittedExpression */:
89068
89113
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
89069
89114
  case 223 /* BinaryExpression */:
89070
89115
  if (isDestructuringAssignment(node)) {
@@ -91465,7 +91510,7 @@ function noEmitNotification(hint, node, callback) {
91465
91510
  }
91466
91511
  function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
91467
91512
  var _a2, _b;
91468
- const enabledSyntaxKindFeatures = new Array(358 /* Count */);
91513
+ const enabledSyntaxKindFeatures = new Array(359 /* Count */);
91469
91514
  let lexicalEnvironmentVariableDeclarations;
91470
91515
  let lexicalEnvironmentFunctionDeclarations;
91471
91516
  let lexicalEnvironmentStatements;
@@ -93172,6 +93217,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
93172
93217
  case 344 /* JSDocReturnTag */:
93173
93218
  case 345 /* JSDocThisTag */:
93174
93219
  case 346 /* JSDocTypeTag */:
93220
+ case 351 /* JSDocThrowsTag */:
93175
93221
  return emitJSDocSimpleTypedTag(node);
93176
93222
  case 347 /* JSDocTemplateTag */:
93177
93223
  return emitJSDocTemplateTag(node);
@@ -93179,9 +93225,9 @@ function createPrinter(printerOptions = {}, handlers = {}) {
93179
93225
  return emitJSDocTypedefTag(node);
93180
93226
  case 349 /* JSDocSeeTag */:
93181
93227
  return emitJSDocSeeTag(node);
93182
- case 352 /* NotEmittedStatement */:
93183
- case 356 /* EndOfDeclarationMarker */:
93184
- case 355 /* MergeDeclarationMarker */:
93228
+ case 353 /* NotEmittedStatement */:
93229
+ case 357 /* EndOfDeclarationMarker */:
93230
+ case 356 /* MergeDeclarationMarker */:
93185
93231
  return;
93186
93232
  }
93187
93233
  if (isExpression(node)) {
@@ -93276,18 +93322,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
93276
93322
  return emitJsxSelfClosingElement(node);
93277
93323
  case 285 /* JsxFragment */:
93278
93324
  return emitJsxFragment(node);
93279
- case 351 /* SyntaxList */:
93325
+ case 352 /* SyntaxList */:
93280
93326
  return Debug.fail("SyntaxList should not be printed");
93281
- case 352 /* NotEmittedStatement */:
93327
+ case 353 /* NotEmittedStatement */:
93282
93328
  return;
93283
- case 353 /* PartiallyEmittedExpression */:
93329
+ case 354 /* PartiallyEmittedExpression */:
93284
93330
  return emitPartiallyEmittedExpression(node);
93285
- case 354 /* CommaListExpression */:
93331
+ case 355 /* CommaListExpression */:
93286
93332
  return emitCommaList(node);
93287
- case 355 /* MergeDeclarationMarker */:
93288
- case 356 /* EndOfDeclarationMarker */:
93333
+ case 356 /* MergeDeclarationMarker */:
93334
+ case 357 /* EndOfDeclarationMarker */:
93289
93335
  return;
93290
- case 357 /* SyntheticReferenceExpression */:
93336
+ case 358 /* SyntheticReferenceExpression */:
93291
93337
  return Debug.fail("SyntheticReferenceExpression should not be printed");
93292
93338
  }
93293
93339
  }
@@ -96202,7 +96248,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
96202
96248
  const skipTrailingComments = end < 0 || (emitFlags & 2048 /* NoTrailingComments */) !== 0 || node.kind === 11 /* JsxText */;
96203
96249
  if ((pos > 0 || end > 0) && pos !== end) {
96204
96250
  if (!skipLeadingComments) {
96205
- emitLeadingComments(pos, node.kind !== 352 /* NotEmittedStatement */);
96251
+ emitLeadingComments(pos, node.kind !== 353 /* NotEmittedStatement */);
96206
96252
  }
96207
96253
  if (!skipLeadingComments || pos >= 0 && (emitFlags & 1024 /* NoLeadingComments */) !== 0) {
96208
96254
  containerPos = pos;
@@ -96225,7 +96271,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
96225
96271
  containerPos = savedContainerPos;
96226
96272
  containerEnd = savedContainerEnd;
96227
96273
  declarationListContainerEnd = savedDeclarationListContainerEnd;
96228
- if (!skipTrailingComments && node.kind !== 352 /* NotEmittedStatement */) {
96274
+ if (!skipTrailingComments && node.kind !== 353 /* NotEmittedStatement */) {
96229
96275
  emitTrailingComments(end);
96230
96276
  }
96231
96277
  }
@@ -96477,7 +96523,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
96477
96523
  }
96478
96524
  } else {
96479
96525
  const source = sourceMapRange.source || sourceMapSource;
96480
- if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
96526
+ if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 32 /* NoLeadingSourceMap */) === 0 && sourceMapRange.pos >= 0) {
96481
96527
  emitSourcePos(sourceMapRange.source || sourceMapSource, skipSourceTrivia(source, sourceMapRange.pos));
96482
96528
  }
96483
96529
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
@@ -96492,7 +96538,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
96492
96538
  if (emitFlags & 128 /* NoNestedSourceMaps */) {
96493
96539
  sourceMapsDisabled = false;
96494
96540
  }
96495
- if (node.kind !== 352 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
96541
+ if (node.kind !== 353 /* NotEmittedStatement */ && (emitFlags & 64 /* NoTrailingSourceMap */) === 0 && sourceMapRange.end >= 0) {
96496
96542
  emitSourcePos(sourceMapRange.source || sourceMapSource, sourceMapRange.end);
96497
96543
  }
96498
96544
  }