typescript 5.7.0-dev.20240829 → 5.7.0-dev.20240831

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.7";
21
- var version = `${versionMajorMinor}.0-dev.20240829`;
21
+ var version = `${versionMajorMinor}.0-dev.20240831`;
22
22
 
23
23
  // src/compiler/core.ts
24
24
  var emptyArray = [];
@@ -426,7 +426,10 @@ function deduplicateSorted(array, comparer) {
426
426
  for (let i = 1; i < array.length; i++) {
427
427
  const next = array[i];
428
428
  switch (comparer(next, last2)) {
429
+ // equality comparison
429
430
  case true:
431
+ // relational comparison
432
+ // falls through
430
433
  case 0 /* EqualTo */:
431
434
  continue;
432
435
  case -1 /* LessThan */:
@@ -1079,7 +1082,7 @@ function findBestPatternMatch(values, getPattern, candidate) {
1079
1082
  for (let i = 0; i < values.length; i++) {
1080
1083
  const v = values[i];
1081
1084
  const pattern = getPattern(v);
1082
- if (isPatternMatch(pattern, candidate) && pattern.prefix.length > longestMatchPrefixLength) {
1085
+ if (pattern.prefix.length > longestMatchPrefixLength && isPatternMatch(pattern, candidate)) {
1083
1086
  longestMatchPrefixLength = pattern.prefix.length;
1084
1087
  matchedValue = v;
1085
1088
  }
@@ -3285,10 +3288,11 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
3285
3288
  SyntaxKind4[SyntaxKind4["JSDocImportTag"] = 351] = "JSDocImportTag";
3286
3289
  SyntaxKind4[SyntaxKind4["SyntaxList"] = 352] = "SyntaxList";
3287
3290
  SyntaxKind4[SyntaxKind4["NotEmittedStatement"] = 353] = "NotEmittedStatement";
3288
- SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 354] = "PartiallyEmittedExpression";
3289
- SyntaxKind4[SyntaxKind4["CommaListExpression"] = 355] = "CommaListExpression";
3290
- SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 356] = "SyntheticReferenceExpression";
3291
- SyntaxKind4[SyntaxKind4["Count"] = 357] = "Count";
3291
+ SyntaxKind4[SyntaxKind4["NotEmittedTypeElement"] = 354] = "NotEmittedTypeElement";
3292
+ SyntaxKind4[SyntaxKind4["PartiallyEmittedExpression"] = 355] = "PartiallyEmittedExpression";
3293
+ SyntaxKind4[SyntaxKind4["CommaListExpression"] = 356] = "CommaListExpression";
3294
+ SyntaxKind4[SyntaxKind4["SyntheticReferenceExpression"] = 357] = "SyntheticReferenceExpression";
3295
+ SyntaxKind4[SyntaxKind4["Count"] = 358] = "Count";
3292
3296
  SyntaxKind4[SyntaxKind4["FirstAssignment"] = 64 /* EqualsToken */] = "FirstAssignment";
3293
3297
  SyntaxKind4[SyntaxKind4["LastAssignment"] = 79 /* CaretEqualsToken */] = "LastAssignment";
3294
3298
  SyntaxKind4[SyntaxKind4["FirstCompoundAssignment"] = 65 /* PlusEqualsToken */] = "FirstCompoundAssignment";
@@ -4609,6 +4613,7 @@ function createSystemWatchFunctions({
4609
4613
  return generateWatchFileOptions(4 /* UseFsEvents */, 2 /* DynamicPriority */, options);
4610
4614
  case "UseFsEventsOnParentDirectory":
4611
4615
  useNonPollingWatchers2 = true;
4616
+ // fall through
4612
4617
  default:
4613
4618
  return useNonPollingWatchers2 ? (
4614
4619
  // Use notifications from FS to watch with falling back to fs.watchFile
@@ -8135,6 +8140,7 @@ function computeLineStarts(text) {
8135
8140
  if (text.charCodeAt(pos) === 10 /* lineFeed */) {
8136
8141
  pos++;
8137
8142
  }
8143
+ // falls through
8138
8144
  case 10 /* lineFeed */:
8139
8145
  result.push(lineStart);
8140
8146
  lineStart = pos;
@@ -8239,6 +8245,7 @@ function skipTrivia(text, pos, stopAfterLineBreak, stopAtComments, inJSDoc) {
8239
8245
  if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) {
8240
8246
  pos++;
8241
8247
  }
8248
+ // falls through
8242
8249
  case 10 /* lineFeed */:
8243
8250
  pos++;
8244
8251
  if (stopAfterLineBreak) {
@@ -8385,6 +8392,7 @@ function iterateCommentRanges(reduce, text, pos, trailing, cb, state, initial) {
8385
8392
  if (text.charCodeAt(pos + 1) === 10 /* lineFeed */) {
8386
8393
  pos++;
8387
8394
  }
8395
+ // falls through
8388
8396
  case 10 /* lineFeed */:
8389
8397
  pos++;
8390
8398
  if (trailing) {
@@ -8950,12 +8958,16 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
8950
8958
  if (pos >= end || !isDigit(charCodeUnchecked(pos))) {
8951
8959
  return "\0";
8952
8960
  }
8961
+ // '\01', '\011'
8962
+ // falls through
8953
8963
  case 49 /* _1 */:
8954
8964
  case 50 /* _2 */:
8955
8965
  case 51 /* _3 */:
8956
8966
  if (pos < end && isOctalDigit(charCodeUnchecked(pos))) {
8957
8967
  pos++;
8958
8968
  }
8969
+ // '\17', '\177'
8970
+ // falls through
8959
8971
  case 52 /* _4 */:
8960
8972
  case 53 /* _5 */:
8961
8973
  case 54 /* _6 */:
@@ -9053,10 +9065,13 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9053
9065
  }
9054
9066
  tokenFlags |= 4096 /* HexEscape */;
9055
9067
  return String.fromCharCode(parseInt(text.substring(start2 + 2, pos), 16));
9068
+ // when encountering a LineContinuation (i.e. a backslash and a line terminator sequence),
9069
+ // the line terminator is interpreted to be "the empty code unit sequence".
9056
9070
  case 13 /* carriageReturn */:
9057
9071
  if (pos < end && charCodeUnchecked(pos) === 10 /* lineFeed */) {
9058
9072
  pos++;
9059
9073
  }
9074
+ // falls through
9060
9075
  case 10 /* lineFeed */:
9061
9076
  case 8232 /* lineSeparator */:
9062
9077
  case 8233 /* paragraphSeparator */:
@@ -9487,6 +9502,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
9487
9502
  tokenFlags |= 256 /* OctalSpecifier */;
9488
9503
  return token = checkBigIntSuffix();
9489
9504
  }
9505
+ // falls through
9490
9506
  case 49 /* _1 */:
9491
9507
  case 50 /* _2 */:
9492
9508
  case 51 /* _3 */:
@@ -10006,6 +10022,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10006
10022
  break;
10007
10023
  }
10008
10024
  }
10025
+ // falls through
10009
10026
  case 42 /* asterisk */:
10010
10027
  case 43 /* plus */:
10011
10028
  case 63 /* question */:
@@ -10036,6 +10053,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10036
10053
  if (isInGroup) {
10037
10054
  return;
10038
10055
  }
10056
+ // falls through
10039
10057
  case 93 /* closeBracket */:
10040
10058
  case 125 /* closeBrace */:
10041
10059
  if (anyUnicodeModeOrNonAnnexB || ch === 41 /* closeParen */) {
@@ -10098,6 +10116,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10098
10116
  error(Diagnostics.q_is_only_available_inside_character_class, pos - 2, 2);
10099
10117
  break;
10100
10118
  }
10119
+ // falls through
10101
10120
  default:
10102
10121
  Debug.assert(scanCharacterClassEscape() || scanDecimalEscape() || scanCharacterEscape(
10103
10122
  /*atomEscape*/
@@ -10235,6 +10254,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10235
10254
  let start2 = pos;
10236
10255
  let operand;
10237
10256
  switch (text.slice(pos, pos + 2)) {
10257
+ // TODO: don't use slice
10238
10258
  case "--":
10239
10259
  case "&&":
10240
10260
  error(Diagnostics.Expected_a_class_set_operand);
@@ -10340,6 +10360,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10340
10360
  }
10341
10361
  start2 = pos;
10342
10362
  switch (text.slice(pos, pos + 2)) {
10363
+ // TODO: don't use slice
10343
10364
  case "--":
10344
10365
  case "&&":
10345
10366
  error(Diagnostics.Operators_must_not_be_mixed_within_a_character_class_Wrap_it_in_a_nested_class_instead, pos, 2);
@@ -10437,6 +10458,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10437
10458
  }
10438
10459
  }
10439
10460
  pos--;
10461
+ // falls through
10440
10462
  default:
10441
10463
  return scanClassSetCharacter();
10442
10464
  }
@@ -10583,6 +10605,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10583
10605
  return true;
10584
10606
  case 80 /* P */:
10585
10607
  isCharacterComplement = true;
10608
+ // falls through
10586
10609
  case 112 /* p */:
10587
10610
  pos++;
10588
10611
  if (charCodeChecked(pos) === 123 /* openBrace */) {
@@ -10890,6 +10913,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
10890
10913
  if (charCodeUnchecked(pos) === 10 /* lineFeed */) {
10891
10914
  pos++;
10892
10915
  }
10916
+ // falls through
10893
10917
  case 10 /* lineFeed */:
10894
10918
  tokenFlags |= 1 /* PrecedingLineBreak */;
10895
10919
  return token = 4 /* NewLineTrivia */;
@@ -11116,6 +11140,7 @@ function getDefaultLibFileName(options) {
11116
11140
  return "lib.es2016.full.d.ts";
11117
11141
  case 2 /* ES2015 */:
11118
11142
  return "lib.es6.d.ts";
11143
+ // We don't use lib.es2015.full.d.ts due to breaking change.
11119
11144
  default:
11120
11145
  return "lib.d.ts";
11121
11146
  }
@@ -11915,7 +11940,7 @@ function isModifierLike(node) {
11915
11940
  }
11916
11941
  function isTypeElement(node) {
11917
11942
  const kind = node.kind;
11918
- return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */;
11943
+ return kind === 180 /* ConstructSignature */ || kind === 179 /* CallSignature */ || kind === 171 /* PropertySignature */ || kind === 173 /* MethodSignature */ || kind === 181 /* IndexSignature */ || kind === 177 /* GetAccessor */ || kind === 178 /* SetAccessor */ || kind === 354 /* NotEmittedTypeElement */;
11919
11944
  }
11920
11945
  function isObjectLiteralElementLike(node) {
11921
11946
  const kind = node.kind;
@@ -11974,7 +11999,9 @@ function isObjectBindingOrAssignmentElement(node) {
11974
11999
  switch (node.kind) {
11975
12000
  case 208 /* BindingElement */:
11976
12001
  case 303 /* PropertyAssignment */:
12002
+ // AssignmentProperty
11977
12003
  case 304 /* ShorthandPropertyAssignment */:
12004
+ // AssignmentProperty
11978
12005
  case 305 /* SpreadAssignment */:
11979
12006
  return true;
11980
12007
  }
@@ -11992,11 +12019,17 @@ function isArrayBindingOrAssignmentElement(node) {
11992
12019
  switch (node.kind) {
11993
12020
  case 208 /* BindingElement */:
11994
12021
  case 232 /* OmittedExpression */:
12022
+ // Elision
11995
12023
  case 230 /* SpreadElement */:
12024
+ // AssignmentRestElement
11996
12025
  case 209 /* ArrayLiteralExpression */:
12026
+ // ArrayAssignmentPattern
11997
12027
  case 210 /* ObjectLiteralExpression */:
12028
+ // ObjectAssignmentPattern
11998
12029
  case 80 /* Identifier */:
12030
+ // DestructuringAssignmentTarget
11999
12031
  case 211 /* PropertyAccessExpression */:
12032
+ // DestructuringAssignmentTarget
12000
12033
  case 212 /* ElementAccessExpression */:
12001
12034
  return true;
12002
12035
  }
@@ -12057,6 +12090,7 @@ function isLeftHandSideExpressionKind(kind) {
12057
12090
  case 218 /* FunctionExpression */:
12058
12091
  case 80 /* Identifier */:
12059
12092
  case 81 /* PrivateIdentifier */:
12093
+ // technically this is only an Expression if it's in a `#field in expr` BinaryExpression
12060
12094
  case 14 /* RegularExpressionLiteral */:
12061
12095
  case 9 /* NumericLiteral */:
12062
12096
  case 10 /* BigIntLiteral */:
@@ -12072,6 +12106,7 @@ function isLeftHandSideExpressionKind(kind) {
12072
12106
  case 233 /* ExpressionWithTypeArguments */:
12073
12107
  case 236 /* MetaProperty */:
12074
12108
  case 102 /* ImportKeyword */:
12109
+ // technically this is only an Expression if it's in a CallExpression
12075
12110
  case 282 /* MissingDeclaration */:
12076
12111
  return true;
12077
12112
  default:
@@ -12118,8 +12153,8 @@ function isExpressionKind(kind) {
12118
12153
  case 230 /* SpreadElement */:
12119
12154
  case 234 /* AsExpression */:
12120
12155
  case 232 /* OmittedExpression */:
12121
- case 355 /* CommaListExpression */:
12122
- case 354 /* PartiallyEmittedExpression */:
12156
+ case 356 /* CommaListExpression */:
12157
+ case 355 /* PartiallyEmittedExpression */:
12123
12158
  case 238 /* SatisfiesExpression */:
12124
12159
  return true;
12125
12160
  default:
@@ -13738,6 +13773,8 @@ function getErrorSpanForNode(sourceFile, node) {
13738
13773
  }
13739
13774
  return getSpanOfTokenAtPosition(sourceFile, pos2);
13740
13775
  }
13776
+ // This list is a work in progress. Add missing node kinds to improve their error
13777
+ // spans.
13741
13778
  case 260 /* VariableDeclaration */:
13742
13779
  case 208 /* BindingElement */:
13743
13780
  case 263 /* ClassDeclaration */:
@@ -13909,6 +13946,8 @@ function isPartOfTypeNode(node) {
13909
13946
  return isPartOfTypeExpressionWithTypeArguments(node);
13910
13947
  case 168 /* TypeParameter */:
13911
13948
  return node.parent.kind === 200 /* MappedType */ || node.parent.kind === 195 /* InferType */;
13949
+ // Identifiers and qualified names may be type nodes, depending on their context. Climb
13950
+ // above them to find the lowest container
13912
13951
  case 80 /* Identifier */:
13913
13952
  if (node.parent.kind === 166 /* QualifiedName */ && node.parent.right === node) {
13914
13953
  node = node.parent;
@@ -13916,6 +13955,7 @@ function isPartOfTypeNode(node) {
13916
13955
  node = node.parent;
13917
13956
  }
13918
13957
  Debug.assert(node.kind === 80 /* Identifier */ || node.kind === 166 /* QualifiedName */ || node.kind === 211 /* PropertyAccessExpression */, "'node' was expected to be a qualified name, identifier or property access in 'isPartOfTypeNode'.");
13958
+ // falls through
13919
13959
  case 166 /* QualifiedName */:
13920
13960
  case 211 /* PropertyAccessExpression */:
13921
13961
  case 110 /* ThisKeyword */: {
@@ -14181,6 +14221,7 @@ function getThisContainer(node, includeArrowFunctions, includeClassComputedPrope
14181
14221
  if (!includeArrowFunctions) {
14182
14222
  continue;
14183
14223
  }
14224
+ // falls through
14184
14225
  case 262 /* FunctionDeclaration */:
14185
14226
  case 218 /* FunctionExpression */:
14186
14227
  case 267 /* ModuleDeclaration */:
@@ -14203,6 +14244,8 @@ function getThisContainer(node, includeArrowFunctions, includeClassComputedPrope
14203
14244
  }
14204
14245
  function isThisContainerOrFunctionBlock(node) {
14205
14246
  switch (node.kind) {
14247
+ // Arrow functions use the same scope, but may do so in a "delayed" manner
14248
+ // For example, `const getThis = () => this` may be before a super() call in a derived constructor
14206
14249
  case 219 /* ArrowFunction */:
14207
14250
  case 262 /* FunctionDeclaration */:
14208
14251
  case 218 /* FunctionExpression */:
@@ -14269,6 +14312,7 @@ function getSuperContainer(node, stopOnFunctions) {
14269
14312
  if (!stopOnFunctions) {
14270
14313
  continue;
14271
14314
  }
14315
+ // falls through
14272
14316
  case 172 /* PropertyDeclaration */:
14273
14317
  case 171 /* PropertySignature */:
14274
14318
  case 174 /* MethodDeclaration */:
@@ -14322,6 +14366,7 @@ function getEntityNameFromTypeNode(node) {
14322
14366
  return node.typeName;
14323
14367
  case 233 /* ExpressionWithTypeArguments */:
14324
14368
  return isEntityNameExpression(node.expression) ? node.expression : void 0;
14369
+ // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s.
14325
14370
  case 80 /* Identifier */:
14326
14371
  case 166 /* QualifiedName */:
14327
14372
  return node;
@@ -14486,6 +14531,7 @@ function isExpressionNode(node) {
14486
14531
  if (node.parent.kind === 186 /* TypeQuery */ || isJSDocLinkLike(node.parent) || isJSDocNameReference(node.parent) || isJSDocMemberName(node.parent) || isJSXTagName(node)) {
14487
14532
  return true;
14488
14533
  }
14534
+ // falls through
14489
14535
  case 9 /* NumericLiteral */:
14490
14536
  case 10 /* BigIntLiteral */:
14491
14537
  case 11 /* StringLiteral */:
@@ -15490,6 +15536,7 @@ function getFunctionFlags(node) {
15490
15536
  if (node.asteriskToken) {
15491
15537
  flags |= 1 /* Generator */;
15492
15538
  }
15539
+ // falls through
15493
15540
  case 219 /* ArrowFunction */:
15494
15541
  if (hasSyntacticModifier(node, 1024 /* Async */)) {
15495
15542
  flags |= 2 /* Async */;
@@ -15724,7 +15771,7 @@ function getOperator(expression) {
15724
15771
  }
15725
15772
  function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
15726
15773
  switch (nodeKind) {
15727
- case 355 /* CommaListExpression */:
15774
+ case 356 /* CommaListExpression */:
15728
15775
  return 0 /* Comma */;
15729
15776
  case 230 /* SpreadElement */:
15730
15777
  return 1 /* Spread */;
@@ -15756,6 +15803,7 @@ function getOperatorPrecedence(nodeKind, operatorKind, hasArguments) {
15756
15803
  default:
15757
15804
  return getBinaryOperatorPrecedence(operatorKind);
15758
15805
  }
15806
+ // TODO: Should prefix `++` and `--` be moved to the `Update` precedence?
15759
15807
  case 216 /* TypeAssertionExpression */:
15760
15808
  case 235 /* NonNullExpression */:
15761
15809
  case 224 /* PrefixUnaryExpression */:
@@ -17254,11 +17302,12 @@ function getLeftmostExpression(node, stopAtCallExpressions) {
17254
17302
  if (stopAtCallExpressions) {
17255
17303
  return node;
17256
17304
  }
17305
+ // falls through
17257
17306
  case 234 /* AsExpression */:
17258
17307
  case 212 /* ElementAccessExpression */:
17259
17308
  case 211 /* PropertyAccessExpression */:
17260
17309
  case 235 /* NonNullExpression */:
17261
- case 354 /* PartiallyEmittedExpression */:
17310
+ case 355 /* PartiallyEmittedExpression */:
17262
17311
  case 238 /* SatisfiesExpression */:
17263
17312
  node = node.expression;
17264
17313
  continue;
@@ -18398,8 +18447,33 @@ function tryParsePattern(pattern) {
18398
18447
  suffix: pattern.substr(indexOfStar + 1)
18399
18448
  };
18400
18449
  }
18450
+ var parsedPatternsCache = /* @__PURE__ */ new WeakMap();
18401
18451
  function tryParsePatterns(paths) {
18402
- return mapDefined(getOwnKeys(paths), (path) => tryParsePattern(path));
18452
+ let result = parsedPatternsCache.get(paths);
18453
+ if (result !== void 0) {
18454
+ return result;
18455
+ }
18456
+ let matchableStringSet;
18457
+ let patterns;
18458
+ const pathList = getOwnKeys(paths);
18459
+ for (const path of pathList) {
18460
+ const patternOrStr = tryParsePattern(path);
18461
+ if (patternOrStr === void 0) {
18462
+ continue;
18463
+ } else if (typeof patternOrStr === "string") {
18464
+ (matchableStringSet ?? (matchableStringSet = /* @__PURE__ */ new Set())).add(patternOrStr);
18465
+ } else {
18466
+ (patterns ?? (patterns = [])).push(patternOrStr);
18467
+ }
18468
+ }
18469
+ parsedPatternsCache.set(
18470
+ paths,
18471
+ result = {
18472
+ matchableStringSet,
18473
+ patterns
18474
+ }
18475
+ );
18476
+ return result;
18403
18477
  }
18404
18478
  function positionIsSynthesized(pos) {
18405
18479
  return !(pos >= 0);
@@ -18424,15 +18498,13 @@ var emptyFileSystemEntries = {
18424
18498
  files: emptyArray,
18425
18499
  directories: emptyArray
18426
18500
  };
18427
- function matchPatternOrExact(patternOrStrings, candidate) {
18428
- const patterns = [];
18429
- for (const patternOrString of patternOrStrings) {
18430
- if (patternOrString === candidate) {
18431
- return candidate;
18432
- }
18433
- if (!isString(patternOrString)) {
18434
- patterns.push(patternOrString);
18435
- }
18501
+ function matchPatternOrExact(parsedPatterns, candidate) {
18502
+ const { matchableStringSet, patterns } = parsedPatterns;
18503
+ if (matchableStringSet == null ? void 0 : matchableStringSet.has(candidate)) {
18504
+ return candidate;
18505
+ }
18506
+ if (patterns === void 0 || patterns.length === 0) {
18507
+ return void 0;
18436
18508
  }
18437
18509
  return findBestPatternMatch(patterns, (_) => _, candidate);
18438
18510
  }
@@ -18509,6 +18581,7 @@ function isJsonEqual(a, b) {
18509
18581
  function parsePseudoBigInt(stringValue) {
18510
18582
  let log2Base;
18511
18583
  switch (stringValue.charCodeAt(1)) {
18584
+ // "x" in "0x123"
18512
18585
  case 98 /* b */:
18513
18586
  case 66 /* B */:
18514
18587
  log2Base = 1;
@@ -18746,7 +18819,7 @@ function getContainingNodeArray(node) {
18746
18819
  return parent.types;
18747
18820
  case 189 /* TupleType */:
18748
18821
  case 209 /* ArrayLiteralExpression */:
18749
- case 355 /* CommaListExpression */:
18822
+ case 356 /* CommaListExpression */:
18750
18823
  case 275 /* NamedImports */:
18751
18824
  case 279 /* NamedExports */:
18752
18825
  return parent.elements;
@@ -19179,6 +19252,7 @@ function createNameResolver({
19179
19252
  switch (location.kind) {
19180
19253
  case 307 /* SourceFile */:
19181
19254
  if (!isExternalOrCommonJsModule(location)) break;
19255
+ // falls through
19182
19256
  case 267 /* ModuleDeclaration */:
19183
19257
  const moduleExports = ((_a = getSymbolOfDeclaration(location)) == null ? void 0 : _a.exports) || emptySymbols;
19184
19258
  if (location.kind === 307 /* SourceFile */ || isModuleDeclaration(location) && location.flags & 33554432 /* Ambient */ && !isGlobalScopeAugmentation(location)) {
@@ -19262,6 +19336,14 @@ function createNameResolver({
19262
19336
  }
19263
19337
  }
19264
19338
  break;
19339
+ // It is not legal to reference a class's own type parameters from a computed property name that
19340
+ // belongs to the class. For example:
19341
+ //
19342
+ // function foo<T>() { return '' }
19343
+ // class C<T> { // <-- Class's own type parameter T
19344
+ // [foo<T>()]() { } // <-- Reference to T from class's own computed property
19345
+ // }
19346
+ //
19265
19347
  case 167 /* ComputedPropertyName */:
19266
19348
  grandparent = location.parent.parent;
19267
19349
  if (isClassLike(grandparent) || grandparent.kind === 264 /* InterfaceDeclaration */) {
@@ -19277,6 +19359,7 @@ function createNameResolver({
19277
19359
  if (getEmitScriptTarget(compilerOptions) >= 2 /* ES2015 */) {
19278
19360
  break;
19279
19361
  }
19362
+ // falls through
19280
19363
  case 174 /* MethodDeclaration */:
19281
19364
  case 176 /* Constructor */:
19282
19365
  case 177 /* GetAccessor */:
@@ -19921,6 +20004,7 @@ function createParenthesizerRules(factory2) {
19921
20004
  function parenthesizeConstituentTypeOfUnionType(type) {
19922
20005
  switch (type.kind) {
19923
20006
  case 192 /* UnionType */:
20007
+ // Not strictly necessary, but a union containing a union should have been flattened
19924
20008
  case 193 /* IntersectionType */:
19925
20009
  return factory2.createParenthesizedType(type);
19926
20010
  }
@@ -20691,6 +20775,7 @@ function createNodeFactory(flags, baseFactory2) {
20691
20775
  createSyntheticExpression,
20692
20776
  createSyntaxList,
20693
20777
  createNotEmittedStatement,
20778
+ createNotEmittedTypeElement,
20694
20779
  createPartiallyEmittedExpression,
20695
20780
  updatePartiallyEmittedExpression,
20696
20781
  createCommaListExpression,
@@ -23717,7 +23802,7 @@ function createNodeFactory(flags, baseFactory2) {
23717
23802
  return node;
23718
23803
  }
23719
23804
  function createPartiallyEmittedExpression(expression, original) {
23720
- const node = createBaseNode(354 /* PartiallyEmittedExpression */);
23805
+ const node = createBaseNode(355 /* PartiallyEmittedExpression */);
23721
23806
  node.expression = expression;
23722
23807
  node.original = original;
23723
23808
  node.transformFlags |= propagateChildFlags(node.expression) | 1 /* ContainsTypeScript */;
@@ -23727,6 +23812,9 @@ function createNodeFactory(flags, baseFactory2) {
23727
23812
  function updatePartiallyEmittedExpression(node, expression) {
23728
23813
  return node.expression !== expression ? update(createPartiallyEmittedExpression(expression, node.original), node) : node;
23729
23814
  }
23815
+ function createNotEmittedTypeElement() {
23816
+ return createBaseNode(354 /* NotEmittedTypeElement */);
23817
+ }
23730
23818
  function flattenCommaElements(node) {
23731
23819
  if (nodeIsSynthesized(node) && !isParseTreeNode(node) && !node.original && !node.emitNode && !node.id) {
23732
23820
  if (isCommaListExpression(node)) {
@@ -23739,7 +23827,7 @@ function createNodeFactory(flags, baseFactory2) {
23739
23827
  return node;
23740
23828
  }
23741
23829
  function createCommaListExpression(elements) {
23742
- const node = createBaseNode(355 /* CommaListExpression */);
23830
+ const node = createBaseNode(356 /* CommaListExpression */);
23743
23831
  node.elements = createNodeArray(sameFlatMap(elements, flattenCommaElements));
23744
23832
  node.transformFlags |= propagateChildrenFlags(node.elements);
23745
23833
  return node;
@@ -23748,7 +23836,7 @@ function createNodeFactory(flags, baseFactory2) {
23748
23836
  return node.elements !== elements ? update(createCommaListExpression(elements), node) : node;
23749
23837
  }
23750
23838
  function createSyntheticReferenceExpression(expression, thisArg) {
23751
- const node = createBaseNode(356 /* SyntheticReferenceExpression */);
23839
+ const node = createBaseNode(357 /* SyntheticReferenceExpression */);
23752
23840
  node.expression = expression;
23753
23841
  node.thisArg = thisArg;
23754
23842
  node.transformFlags |= propagateChildFlags(node.expression) | propagateChildFlags(node.thisArg);
@@ -23995,7 +24083,7 @@ function createNodeFactory(flags, baseFactory2) {
23995
24083
  return updateNonNullExpression(outerExpression, expression);
23996
24084
  case 233 /* ExpressionWithTypeArguments */:
23997
24085
  return updateExpressionWithTypeArguments(outerExpression, expression, outerExpression.typeArguments);
23998
- case 354 /* PartiallyEmittedExpression */:
24086
+ case 355 /* PartiallyEmittedExpression */:
23999
24087
  return updatePartiallyEmittedExpression(outerExpression, expression);
24000
24088
  }
24001
24089
  }
@@ -24540,7 +24628,7 @@ function getTransformFlagsSubtreeExclusions(kind) {
24540
24628
  case 216 /* TypeAssertionExpression */:
24541
24629
  case 238 /* SatisfiesExpression */:
24542
24630
  case 234 /* AsExpression */:
24543
- case 354 /* PartiallyEmittedExpression */:
24631
+ case 355 /* PartiallyEmittedExpression */:
24544
24632
  case 217 /* ParenthesizedExpression */:
24545
24633
  case 108 /* SuperKeyword */:
24546
24634
  return -2147483648 /* OuterExpressionExcludes */;
@@ -26181,10 +26269,10 @@ function isMetaProperty(node) {
26181
26269
  return node.kind === 236 /* MetaProperty */;
26182
26270
  }
26183
26271
  function isPartiallyEmittedExpression(node) {
26184
- return node.kind === 354 /* PartiallyEmittedExpression */;
26272
+ return node.kind === 355 /* PartiallyEmittedExpression */;
26185
26273
  }
26186
26274
  function isCommaListExpression(node) {
26187
- return node.kind === 355 /* CommaListExpression */;
26275
+ return node.kind === 356 /* CommaListExpression */;
26188
26276
  }
26189
26277
  function isTemplateSpan(node) {
26190
26278
  return node.kind === 239 /* TemplateSpan */;
@@ -26313,7 +26401,7 @@ function isNotEmittedStatement(node) {
26313
26401
  return node.kind === 353 /* NotEmittedStatement */;
26314
26402
  }
26315
26403
  function isSyntheticReference(node) {
26316
- return node.kind === 356 /* SyntheticReferenceExpression */;
26404
+ return node.kind === 357 /* SyntheticReferenceExpression */;
26317
26405
  }
26318
26406
  function isExternalModuleReference(node) {
26319
26407
  return node.kind === 283 /* ExternalModuleReference */;
@@ -26894,7 +26982,7 @@ function isOuterExpression(node, kinds = 31 /* All */) {
26894
26982
  return (kinds & 16 /* ExpressionsWithTypeArguments */) !== 0;
26895
26983
  case 235 /* NonNullExpression */:
26896
26984
  return (kinds & 4 /* NonNullAssertions */) !== 0;
26897
- case 354 /* PartiallyEmittedExpression */:
26985
+ case 355 /* PartiallyEmittedExpression */:
26898
26986
  return (kinds & 8 /* PartiallyEmittedExpressions */) !== 0;
26899
26987
  }
26900
26988
  return false;
@@ -27334,10 +27422,13 @@ var BinaryExpressionState;
27334
27422
  switch (currentState) {
27335
27423
  case enter:
27336
27424
  if (machine.onLeft) return left;
27425
+ // falls through
27337
27426
  case left:
27338
27427
  if (machine.onOperator) return operator;
27428
+ // falls through
27339
27429
  case operator:
27340
27430
  if (machine.onRight) return right;
27431
+ // falls through
27341
27432
  case right:
27342
27433
  return exit;
27343
27434
  case exit:
@@ -27965,7 +28056,7 @@ var forEachChildTable = {
27965
28056
  [282 /* MissingDeclaration */]: function forEachChildInMissingDeclaration(node, cbNode, cbNodes) {
27966
28057
  return visitNodes(cbNode, cbNodes, node.modifiers);
27967
28058
  },
27968
- [355 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
28059
+ [356 /* CommaListExpression */]: function forEachChildInCommaListExpression(node, cbNode, cbNodes) {
27969
28060
  return visitNodes(cbNode, cbNodes, node.elements);
27970
28061
  },
27971
28062
  [284 /* JsxElement */]: function forEachChildInJsxElement(node, cbNode, cbNodes) {
@@ -28061,7 +28152,7 @@ var forEachChildTable = {
28061
28152
  [331 /* JSDocDeprecatedTag */]: forEachChildInJSDocTag,
28062
28153
  [337 /* JSDocOverrideTag */]: forEachChildInJSDocTag,
28063
28154
  [351 /* JSDocImportTag */]: forEachChildInJSDocImportTag,
28064
- [354 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
28155
+ [355 /* PartiallyEmittedExpression */]: forEachChildInPartiallyEmittedExpression
28065
28156
  };
28066
28157
  function forEachChildInCallOrConstructSignature(node, cbNode, cbNodes) {
28067
28158
  return visitNodes(cbNode, cbNodes, node.typeParameters) || visitNodes(cbNode, cbNodes, node.parameters) || visitNode2(cbNode, node.type);
@@ -28416,6 +28507,7 @@ var Parser;
28416
28507
  expression2 = parseLiteralNode();
28417
28508
  break;
28418
28509
  }
28510
+ // falls through
28419
28511
  default:
28420
28512
  expression2 = parseObjectLiteralExpression();
28421
28513
  break;
@@ -29337,6 +29429,7 @@ var Parser;
29337
29429
  case 25 /* DotToken */:
29338
29430
  return true;
29339
29431
  }
29432
+ // falls through
29340
29433
  case 11 /* ArgumentExpressions */:
29341
29434
  return token() === 26 /* DotDotDotToken */ || isStartOfExpression();
29342
29435
  case 16 /* Parameters */:
@@ -29370,6 +29463,7 @@ var Parser;
29370
29463
  return true;
29371
29464
  case 26 /* Count */:
29372
29465
  return Debug.fail("ParsingContext.Count used as a context");
29466
+ // Not a real context, only a marker.
29373
29467
  default:
29374
29468
  Debug.assertNever(parsingContext2, "Non-exhaustive case in 'isListElement'.");
29375
29469
  }
@@ -29686,6 +29780,7 @@ var Parser;
29686
29780
  case 3 /* SwitchClauseStatements */:
29687
29781
  return parseErrorAtCurrentToken(Diagnostics.Statement_expected);
29688
29782
  case 18 /* RestProperties */:
29783
+ // fallthrough
29689
29784
  case 4 /* TypeMembers */:
29690
29785
  return parseErrorAtCurrentToken(Diagnostics.Property_or_signature_expected);
29691
29786
  case 5 /* ClassMembers */:
@@ -29733,6 +29828,7 @@ var Parser;
29733
29828
  return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
29734
29829
  case 26 /* Count */:
29735
29830
  return Debug.fail("ParsingContext.Count used as a context");
29831
+ // Not a real context, only a marker.
29736
29832
  default:
29737
29833
  Debug.assertNever(context);
29738
29834
  }
@@ -30657,10 +30753,12 @@ var Parser;
30657
30753
  return tryParse(parseKeywordAndNoDot) || parseTypeReference();
30658
30754
  case 67 /* AsteriskEqualsToken */:
30659
30755
  scanner.reScanAsteriskEqualsToken();
30756
+ // falls through
30660
30757
  case 42 /* AsteriskToken */:
30661
30758
  return parseJSDocAllType();
30662
30759
  case 61 /* QuestionQuestionToken */:
30663
30760
  scanner.reScanQuestionToken();
30761
+ // falls through
30664
30762
  case 58 /* QuestionToken */:
30665
30763
  return parseJSDocUnknownOrNullableType();
30666
30764
  case 100 /* FunctionKeyword */:
@@ -31538,6 +31636,7 @@ var Parser;
31538
31636
  if (isAwaitExpression2()) {
31539
31637
  return parseAwaitExpression();
31540
31638
  }
31639
+ // falls through
31541
31640
  default:
31542
31641
  return parseUpdateExpression();
31543
31642
  }
@@ -31557,6 +31656,8 @@ var Parser;
31557
31656
  if (languageVariant !== 1 /* JSX */) {
31558
31657
  return false;
31559
31658
  }
31659
+ // We are in JSX context and the token is part of JSXElement.
31660
+ // falls through
31560
31661
  default:
31561
31662
  return true;
31562
31663
  }
@@ -32130,10 +32231,16 @@ var Parser;
32130
32231
  }
32131
32232
  function canFollowTypeArgumentsInExpression() {
32132
32233
  switch (token()) {
32234
+ // These tokens can follow a type argument list in a call expression.
32133
32235
  case 21 /* OpenParenToken */:
32236
+ // foo<x>(
32134
32237
  case 15 /* NoSubstitutionTemplateLiteral */:
32238
+ // foo<T> `...`
32135
32239
  case 16 /* TemplateHead */:
32136
32240
  return true;
32241
+ // A type argument list followed by `<` never makes sense, and a type argument list followed
32242
+ // by `>` is ambiguous with a (re-scanned) `>>` operator, so we disqualify both. Also, in
32243
+ // this context, `+` and `-` are unary operators, not binary operators.
32137
32244
  case 30 /* LessThanToken */:
32138
32245
  case 32 /* GreaterThanToken */:
32139
32246
  case 40 /* PlusToken */:
@@ -32151,6 +32258,7 @@ var Parser;
32151
32258
  false
32152
32259
  );
32153
32260
  }
32261
+ // falls through
32154
32262
  case 9 /* NumericLiteral */:
32155
32263
  case 10 /* BigIntLiteral */:
32156
32264
  case 11 /* StringLiteral */:
@@ -32654,6 +32762,27 @@ var Parser;
32654
32762
  return isUsingDeclaration();
32655
32763
  case 135 /* AwaitKeyword */:
32656
32764
  return isAwaitUsingDeclaration();
32765
+ // 'declare', 'module', 'namespace', 'interface'* and 'type' are all legal JavaScript identifiers;
32766
+ // however, an identifier cannot be followed by another identifier on the same line. This is what we
32767
+ // count on to parse out the respective declarations. For instance, we exploit this to say that
32768
+ //
32769
+ // namespace n
32770
+ //
32771
+ // can be none other than the beginning of a namespace declaration, but need to respect that JavaScript sees
32772
+ //
32773
+ // namespace
32774
+ // n
32775
+ //
32776
+ // as the identifier 'namespace' on one line followed by the identifier 'n' on another.
32777
+ // We need to look one token ahead to see if it permissible to try parsing a declaration.
32778
+ //
32779
+ // *Note*: 'interface' is actually a strict mode reserved word. So while
32780
+ //
32781
+ // "use strict"
32782
+ // interface
32783
+ // I {}
32784
+ //
32785
+ // could be legal, it would add complexity for very little gain.
32657
32786
  case 120 /* InterfaceKeyword */:
32658
32787
  case 156 /* TypeKeyword */:
32659
32788
  return nextTokenIsIdentifierOnSameLine();
@@ -32726,6 +32855,9 @@ var Parser;
32726
32855
  case 111 /* ThrowKeyword */:
32727
32856
  case 113 /* TryKeyword */:
32728
32857
  case 89 /* DebuggerKeyword */:
32858
+ // 'catch' and 'finally' do not actually indicate that the code is part of a statement,
32859
+ // however, we say they are here so that we may gracefully parse them and error later.
32860
+ // falls through
32729
32861
  case 85 /* CatchKeyword */:
32730
32862
  case 98 /* FinallyKeyword */:
32731
32863
  return true;
@@ -32864,6 +32996,8 @@ var Parser;
32864
32996
  case 111 /* ThrowKeyword */:
32865
32997
  return parseThrowStatement();
32866
32998
  case 113 /* TryKeyword */:
32999
+ // Include 'catch' and 'finally' for error recovery.
33000
+ // falls through
32867
33001
  case 85 /* CatchKeyword */:
32868
33002
  case 98 /* FinallyKeyword */:
32869
33003
  return parseTryStatement();
@@ -33282,10 +33416,15 @@ var Parser;
33282
33416
  }
33283
33417
  switch (token()) {
33284
33418
  case 21 /* OpenParenToken */:
33419
+ // Method declaration
33285
33420
  case 30 /* LessThanToken */:
33421
+ // Generic Method declaration
33286
33422
  case 54 /* ExclamationToken */:
33423
+ // Non-null assertion on property name
33287
33424
  case 59 /* ColonToken */:
33425
+ // Type Annotation for declaration
33288
33426
  case 64 /* EqualsToken */:
33427
+ // Initializer for declaration
33289
33428
  case 58 /* QuestionToken */:
33290
33429
  return true;
33291
33430
  default:
@@ -34192,6 +34331,7 @@ var Parser;
34192
34331
  linkEnd = scanner.getTokenEnd();
34193
34332
  break;
34194
34333
  }
34334
+ // fallthrough if it's not a {@link sequence
34195
34335
  default:
34196
34336
  state = 2 /* SavingComments */;
34197
34337
  pushComment(scanner.getTokenText());
@@ -34450,6 +34590,8 @@ var Parser;
34450
34590
  indent2 += 1;
34451
34591
  break;
34452
34592
  }
34593
+ // record the * as a comment
34594
+ // falls through
34453
34595
  default:
34454
34596
  if (state !== 3 /* SavingBackticks */) {
34455
34597
  state = 2 /* SavingComments */;
@@ -35530,6 +35672,7 @@ function processPragmasIntoFields(context, reportDiagnostic) {
35530
35672
  case "jsximportsource":
35531
35673
  case "jsxruntime":
35532
35674
  return;
35675
+ // Accessed directly
35533
35676
  default:
35534
35677
  Debug.fail("Unhandled pragma kind");
35535
35678
  }
@@ -37383,6 +37526,7 @@ function parseOptionValue(args, i, diagnostics, opt, options, errors) {
37383
37526
  case "listOrElement":
37384
37527
  Debug.fail("listOrElement not supported here");
37385
37528
  break;
37529
+ // If not a primitive, the possible types are specified in what is effectively a map of options.
37386
37530
  default:
37387
37531
  options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
37388
37532
  i++;
@@ -37716,6 +37860,7 @@ function convertToJson(sourceFile, rootExpression, errors, returnValue, jsonConv
37716
37860
  return false;
37717
37861
  case 106 /* NullKeyword */:
37718
37862
  return null;
37863
+ // eslint-disable-line no-restricted-syntax
37719
37864
  case 11 /* StringLiteral */:
37720
37865
  if (!isDoubleQuotedString(valueExpression)) {
37721
37866
  errors.push(createDiagnosticForNodeInSourceFile(sourceFile, valueExpression, Diagnostics.String_literal_with_double_quotes_expected));
@@ -38180,8 +38325,6 @@ function parseJsonConfigFileContentWorker(json, sourceFile, host, basePath, exis
38180
38325
  validatedFilesSpecBeforeSubstitution,
38181
38326
  validatedIncludeSpecsBeforeSubstitution,
38182
38327
  validatedExcludeSpecsBeforeSubstitution,
38183
- pathPatterns: void 0,
38184
- // Initialized on first use
38185
38328
  isDefaultIncludeSpec
38186
38329
  };
38187
38330
  }
@@ -39806,8 +39949,7 @@ function tryLoadModuleUsingOptionalResolutionSettings(extensions, moduleName, co
39806
39949
  }
39807
39950
  }
39808
39951
  function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state) {
39809
- var _a;
39810
- const { baseUrl, paths, configFile } = state.compilerOptions;
39952
+ const { baseUrl, paths } = state.compilerOptions;
39811
39953
  if (paths && !pathIsRelative(moduleName)) {
39812
39954
  if (state.traceEnabled) {
39813
39955
  if (baseUrl) {
@@ -39816,7 +39958,7 @@ function tryLoadModuleUsingPathsIfEligible(extensions, moduleName, loader, state
39816
39958
  trace(state.host, Diagnostics.paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0, moduleName);
39817
39959
  }
39818
39960
  const baseDirectory = getPathsBasePath(state.compilerOptions, state.host);
39819
- const pathPatterns = (configFile == null ? void 0 : configFile.configFileSpecs) ? (_a = configFile.configFileSpecs).pathPatterns || (_a.pathPatterns = tryParsePatterns(paths)) : void 0;
39961
+ const pathPatterns = tryParsePatterns(paths);
39820
39962
  return tryLoadModuleUsingPaths(
39821
39963
  extensions,
39822
39964
  moduleName,
@@ -40488,17 +40630,8 @@ function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFail
40488
40630
  if (state.traceEnabled) {
40489
40631
  trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, moduleName);
40490
40632
  }
40491
- const result = tryLoadModuleUsingPaths(
40492
- extensions,
40493
- moduleName,
40494
- candidate,
40495
- versionPaths.paths,
40496
- /*pathPatterns*/
40497
- void 0,
40498
- loader,
40499
- onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex,
40500
- state
40501
- );
40633
+ const pathPatterns = tryParsePatterns(versionPaths.paths);
40634
+ const result = tryLoadModuleUsingPaths(extensions, moduleName, candidate, versionPaths.paths, pathPatterns, loader, onlyRecordFailuresForPackageFile || onlyRecordFailuresForIndex, state);
40502
40635
  if (result) {
40503
40636
  return removeIgnoredPackageId(result.value);
40504
40637
  }
@@ -41090,17 +41223,8 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
41090
41223
  trace(state.host, Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, versionPaths.version, version, rest);
41091
41224
  }
41092
41225
  const packageDirectoryExists = nodeModulesDirectoryExists && directoryProbablyExists(packageDirectory, state.host);
41093
- const fromPaths = tryLoadModuleUsingPaths(
41094
- extensions,
41095
- rest,
41096
- packageDirectory,
41097
- versionPaths.paths,
41098
- /*pathPatterns*/
41099
- void 0,
41100
- loader,
41101
- !packageDirectoryExists,
41102
- state
41103
- );
41226
+ const pathPatterns = tryParsePatterns(versionPaths.paths);
41227
+ const fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, versionPaths.paths, pathPatterns, loader, !packageDirectoryExists, state);
41104
41228
  if (fromPaths) {
41105
41229
  return fromPaths.value;
41106
41230
  }
@@ -41108,7 +41232,6 @@ function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, node
41108
41232
  return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
41109
41233
  }
41110
41234
  function tryLoadModuleUsingPaths(extensions, moduleName, baseDirectory, paths, pathPatterns, loader, onlyRecordFailures, state) {
41111
- pathPatterns || (pathPatterns = tryParsePatterns(paths));
41112
41235
  const matchedPattern = matchPatternOrExact(pathPatterns, moduleName);
41113
41236
  if (matchedPattern) {
41114
41237
  const matchedStar = isString(matchedPattern) ? void 0 : matchedText(matchedPattern, moduleName);
@@ -41369,20 +41492,24 @@ function getModuleInstanceStateCached(node, visited = /* @__PURE__ */ new Map())
41369
41492
  }
41370
41493
  function getModuleInstanceStateWorker(node, visited) {
41371
41494
  switch (node.kind) {
41495
+ // 1. interface declarations, type alias declarations
41372
41496
  case 264 /* InterfaceDeclaration */:
41373
41497
  case 265 /* TypeAliasDeclaration */:
41374
41498
  return 0 /* NonInstantiated */;
41499
+ // 2. const enum declarations
41375
41500
  case 266 /* EnumDeclaration */:
41376
41501
  if (isEnumConst(node)) {
41377
41502
  return 2 /* ConstEnumOnly */;
41378
41503
  }
41379
41504
  break;
41505
+ // 3. non-exported import declarations
41380
41506
  case 272 /* ImportDeclaration */:
41381
41507
  case 271 /* ImportEqualsDeclaration */:
41382
41508
  if (!hasSyntacticModifier(node, 32 /* Export */)) {
41383
41509
  return 0 /* NonInstantiated */;
41384
41510
  }
41385
41511
  break;
41512
+ // 4. Export alias declarations pointing at only uninstantiated modules or things uninstantiated modules contain
41386
41513
  case 278 /* ExportDeclaration */:
41387
41514
  const exportDeclaration = node;
41388
41515
  if (!exportDeclaration.moduleSpecifier && exportDeclaration.exportClause && exportDeclaration.exportClause.kind === 279 /* NamedExports */) {
@@ -41399,6 +41526,7 @@ function getModuleInstanceStateWorker(node, visited) {
41399
41526
  return state;
41400
41527
  }
41401
41528
  break;
41529
+ // 5. other uninstantiated module declarations.
41402
41530
  case 268 /* ModuleBlock */: {
41403
41531
  let state = 0 /* NonInstantiated */;
41404
41532
  forEachChild(node, (n) => {
@@ -41997,6 +42125,7 @@ function createBinder() {
41997
42125
  case 351 /* JSDocImportTag */:
41998
42126
  bindJSDocImportTag(node);
41999
42127
  break;
42128
+ // In source files and blocks, bind functions first to match hoisting that occurs at runtime
42000
42129
  case 307 /* SourceFile */: {
42001
42130
  bindEachFunctionsFirst(node.statements);
42002
42131
  bind(node.endOfFileToken);
@@ -42017,6 +42146,7 @@ function createBinder() {
42017
42146
  case 303 /* PropertyAssignment */:
42018
42147
  case 230 /* SpreadElement */:
42019
42148
  inAssignmentPattern = saveInAssignmentPattern;
42149
+ // falls through
42020
42150
  default:
42021
42151
  bindEachChild(node);
42022
42152
  break;
@@ -42038,6 +42168,7 @@ function createBinder() {
42038
42168
  if (isJSDocTypeAssertion(expr)) {
42039
42169
  return false;
42040
42170
  }
42171
+ // fallthrough
42041
42172
  case 235 /* NonNullExpression */:
42042
42173
  return isNarrowingExpression(expr.expression);
42043
42174
  case 226 /* BinaryExpression */:
@@ -42869,6 +43000,10 @@ function createBinder() {
42869
43000
  }
42870
43001
  function declareSymbolAndAddToSymbolTable(node, symbolFlags, symbolExcludes) {
42871
43002
  switch (container.kind) {
43003
+ // Modules, source files, and classes need specialized handling for how their
43004
+ // members are declared (for example, a member of a class will go into a specific
43005
+ // symbol table depending on if it is static or not). We defer to specialized
43006
+ // handlers to take care of declaring these child members.
42872
43007
  case 267 /* ModuleDeclaration */:
42873
43008
  return declareModuleMember(node, symbolFlags, symbolExcludes);
42874
43009
  case 307 /* SourceFile */:
@@ -43010,6 +43145,7 @@ function createBinder() {
43010
43145
  declareModuleMember(node, symbolFlags, symbolExcludes);
43011
43146
  break;
43012
43147
  }
43148
+ // falls through
43013
43149
  default:
43014
43150
  Debug.assertNode(blockScopeContainer, canHaveLocals);
43015
43151
  if (!blockScopeContainer.locals) {
@@ -43330,6 +43466,7 @@ function createBinder() {
43330
43466
  }
43331
43467
  function bindWorker(node) {
43332
43468
  switch (node.kind) {
43469
+ /* Strict mode checks */
43333
43470
  case 80 /* Identifier */:
43334
43471
  if (node.flags & 4096 /* IdentifierIsInJSDocNamespace */) {
43335
43472
  let parentNode = node.parent;
@@ -43339,6 +43476,7 @@ function createBinder() {
43339
43476
  bindBlockScopedDeclaration(parentNode, 524288 /* TypeAlias */, 788968 /* TypeAliasExcludes */);
43340
43477
  break;
43341
43478
  }
43479
+ // falls through
43342
43480
  case 110 /* ThisKeyword */:
43343
43481
  if (currentFlow && (isExpression(node) || parent.kind === 304 /* ShorthandPropertyAssignment */)) {
43344
43482
  node.flowNode = currentFlow;
@@ -43427,6 +43565,7 @@ function createBinder() {
43427
43565
  return;
43428
43566
  case 182 /* TypePredicate */:
43429
43567
  break;
43568
+ // Binding the children will handle everything
43430
43569
  case 168 /* TypeParameter */:
43431
43570
  return bindTypeParameter(node);
43432
43571
  case 169 /* Parameter */:
@@ -43491,6 +43630,7 @@ function createBinder() {
43491
43630
  return bindObjectDefinePrototypeProperty(node);
43492
43631
  case 0 /* None */:
43493
43632
  break;
43633
+ // Nothing to do
43494
43634
  default:
43495
43635
  return Debug.fail("Unknown call expression assignment declaration kind");
43496
43636
  }
@@ -43498,6 +43638,7 @@ function createBinder() {
43498
43638
  bindCallExpression(node);
43499
43639
  }
43500
43640
  break;
43641
+ // Members of classes, interfaces, and modules
43501
43642
  case 231 /* ClassExpression */:
43502
43643
  case 263 /* ClassDeclaration */:
43503
43644
  inStrictMode = true;
@@ -43510,10 +43651,12 @@ function createBinder() {
43510
43651
  return bindEnumDeclaration(node);
43511
43652
  case 267 /* ModuleDeclaration */:
43512
43653
  return bindModuleDeclaration(node);
43654
+ // Jsx-attributes
43513
43655
  case 292 /* JsxAttributes */:
43514
43656
  return bindJsxAttributes(node);
43515
43657
  case 291 /* JsxAttribute */:
43516
43658
  return bindJsxAttribute(node, 4 /* Property */, 0 /* PropertyExcludes */);
43659
+ // Imports and exports
43517
43660
  case 271 /* ImportEqualsDeclaration */:
43518
43661
  case 274 /* NamespaceImport */:
43519
43662
  case 276 /* ImportSpecifier */:
@@ -43534,6 +43677,7 @@ function createBinder() {
43534
43677
  if (!isFunctionLikeOrClassStaticBlockDeclaration(node.parent)) {
43535
43678
  return;
43536
43679
  }
43680
+ // falls through
43537
43681
  case 268 /* ModuleBlock */:
43538
43682
  return updateStrictModeStatementList(node.statements);
43539
43683
  case 341 /* JSDocParameterTag */:
@@ -43543,6 +43687,7 @@ function createBinder() {
43543
43687
  if (node.parent.kind !== 322 /* JSDocTypeLiteral */) {
43544
43688
  break;
43545
43689
  }
43690
+ // falls through
43546
43691
  case 348 /* JSDocPropertyTag */:
43547
43692
  const propTag = node;
43548
43693
  const flags = propTag.isBracketed || propTag.typeExpression && propTag.typeExpression.type.kind === 316 /* JSDocOptionalType */ ? 4 /* Property */ | 16777216 /* Optional */ : 4 /* Property */;
@@ -43755,6 +43900,7 @@ function createBinder() {
43755
43900
  declareSymbolAndAddToSymbolTable(node, 1 /* FunctionScopedVariable */, 111550 /* FunctionScopedVariableExcludes */);
43756
43901
  }
43757
43902
  break;
43903
+ // Namespaces are not allowed in javascript files, so do nothing here
43758
43904
  case 267 /* ModuleDeclaration */:
43759
43905
  break;
43760
43906
  default:
@@ -44251,6 +44397,7 @@ function getContainerFlags(node) {
44251
44397
  if (isObjectLiteralOrClassExpressionMethodOrAccessor(node)) {
44252
44398
  return 1 /* IsContainer */ | 4 /* IsControlFlowContainer */ | 32 /* HasLocals */ | 8 /* IsFunctionLike */ | 128 /* IsObjectLiteralOrClassExpressionMethodOrAccessor */;
44253
44399
  }
44400
+ // falls through
44254
44401
  case 176 /* Constructor */:
44255
44402
  case 262 /* FunctionDeclaration */:
44256
44403
  case 173 /* MethodSignature */:
@@ -47304,6 +47451,7 @@ function createTypeChecker(host) {
47304
47451
  if (isEntityNameExpression(node.expression)) {
47305
47452
  return node.expression;
47306
47453
  }
47454
+ // falls through
47307
47455
  default:
47308
47456
  return void 0;
47309
47457
  }
@@ -49159,6 +49307,7 @@ function createTypeChecker(host) {
49159
49307
  if (!isExternalOrCommonJsModule(location)) {
49160
49308
  break;
49161
49309
  }
49310
+ // falls through
49162
49311
  case 267 /* ModuleDeclaration */:
49163
49312
  const sym = getSymbolOfDeclaration(location);
49164
49313
  if (result = callback(
@@ -50581,6 +50730,9 @@ function createTypeChecker(host) {
50581
50730
  }
50582
50731
  function createTypeNodesFromResolvedType(resolvedType) {
50583
50732
  if (checkTruncationLength(context)) {
50733
+ if (context.flags & 1 /* NoTruncation */) {
50734
+ return [addSyntheticTrailingComment(factory.createNotEmittedTypeElement(), 3 /* MultiLineCommentTrivia */, "elided")];
50735
+ }
50584
50736
  return [factory.createPropertySignature(
50585
50737
  /*modifiers*/
50586
50738
  void 0,
@@ -50618,15 +50770,20 @@ function createTypeChecker(host) {
50618
50770
  }
50619
50771
  }
50620
50772
  if (checkTruncationLength(context) && i + 2 < properties.length - 1) {
50621
- typeElements.push(factory.createPropertySignature(
50622
- /*modifiers*/
50623
- void 0,
50624
- `... ${properties.length - i} more ...`,
50625
- /*questionToken*/
50626
- void 0,
50627
- /*type*/
50628
- void 0
50629
- ));
50773
+ if (context.flags & 1 /* NoTruncation */) {
50774
+ const typeElement = typeElements.pop();
50775
+ typeElements.push(addSyntheticTrailingComment(typeElement, 3 /* MultiLineCommentTrivia */, `... ${properties.length - i} more elided ...`));
50776
+ } else {
50777
+ typeElements.push(factory.createPropertySignature(
50778
+ /*modifiers*/
50779
+ void 0,
50780
+ `... ${properties.length - i} more ...`,
50781
+ /*questionToken*/
50782
+ void 0,
50783
+ /*type*/
50784
+ void 0
50785
+ ));
50786
+ }
50630
50787
  addPropertyToElementList(properties[properties.length - 1], context, typeElements);
50631
50788
  break;
50632
50789
  }
@@ -50644,7 +50801,7 @@ function createTypeChecker(host) {
50644
50801
  void 0
50645
50802
  );
50646
50803
  }
50647
- return factory.createKeywordTypeNode(133 /* AnyKeyword */);
50804
+ return addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "elided");
50648
50805
  }
50649
50806
  function shouldUsePlaceholderForProperty(propertySymbol, context) {
50650
50807
  var _a;
@@ -50780,15 +50937,17 @@ function createTypeChecker(host) {
50780
50937
  if (some(types)) {
50781
50938
  if (checkTruncationLength(context)) {
50782
50939
  if (!isBareList) {
50783
- return [factory.createTypeReferenceNode(
50784
- "...",
50785
- /*typeArguments*/
50786
- void 0
50787
- )];
50940
+ return [
50941
+ context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, "elided") : factory.createTypeReferenceNode(
50942
+ "...",
50943
+ /*typeArguments*/
50944
+ void 0
50945
+ )
50946
+ ];
50788
50947
  } else if (types.length > 2) {
50789
50948
  return [
50790
50949
  typeToTypeNodeHelper(types[0], context),
50791
- factory.createTypeReferenceNode(
50950
+ context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, `... ${types.length - 2} more elided ...`) : factory.createTypeReferenceNode(
50792
50951
  `... ${types.length - 2} more ...`,
50793
50952
  /*typeArguments*/
50794
50953
  void 0
@@ -50804,11 +50963,13 @@ function createTypeChecker(host) {
50804
50963
  for (const type of types) {
50805
50964
  i++;
50806
50965
  if (checkTruncationLength(context) && i + 2 < types.length - 1) {
50807
- result.push(factory.createTypeReferenceNode(
50808
- `... ${types.length - i} more ...`,
50809
- /*typeArguments*/
50810
- void 0
50811
- ));
50966
+ result.push(
50967
+ context.flags & 1 /* NoTruncation */ ? addSyntheticLeadingComment(factory.createKeywordTypeNode(133 /* AnyKeyword */), 3 /* MultiLineCommentTrivia */, `... ${types.length - i} more elided ...`) : factory.createTypeReferenceNode(
50968
+ `... ${types.length - i} more ...`,
50969
+ /*typeArguments*/
50970
+ void 0
50971
+ )
50972
+ );
50812
50973
  const typeNode2 = typeToTypeNodeHelper(types[types.length - 1], context);
50813
50974
  if (typeNode2) {
50814
50975
  result.push(typeNode2);
@@ -53403,6 +53564,7 @@ function createTypeChecker(host) {
53403
53564
  );
53404
53565
  break;
53405
53566
  }
53567
+ // else fall through and treat commonjs require just like import=
53406
53568
  case 271 /* ImportEqualsDeclaration */:
53407
53569
  if (target.escapedName === "export=" /* ExportEquals */ && some(target.declarations, (d) => isSourceFile(d) && isJsonSourceFile(d))) {
53408
53570
  serializeMaybeAliasAssignment(symbol);
@@ -54175,6 +54337,7 @@ function createTypeChecker(host) {
54175
54337
  if (isBindingPattern(node.name) && !node.name.elements.length) {
54176
54338
  return false;
54177
54339
  }
54340
+ // falls through
54178
54341
  case 267 /* ModuleDeclaration */:
54179
54342
  case 263 /* ClassDeclaration */:
54180
54343
  case 264 /* InterfaceDeclaration */:
@@ -54199,6 +54362,8 @@ function createTypeChecker(host) {
54199
54362
  if (hasEffectiveModifier(node, 2 /* Private */ | 4 /* Protected */)) {
54200
54363
  return false;
54201
54364
  }
54365
+ // Public properties/methods are visible if its parents are visible, so:
54366
+ // falls through
54202
54367
  case 176 /* Constructor */:
54203
54368
  case 180 /* ConstructSignature */:
54204
54369
  case 179 /* CallSignature */:
@@ -54216,14 +54381,20 @@ function createTypeChecker(host) {
54216
54381
  case 196 /* ParenthesizedType */:
54217
54382
  case 202 /* NamedTupleMember */:
54218
54383
  return isDeclarationVisible(node.parent);
54384
+ // Default binding, import specifier and namespace import is visible
54385
+ // only on demand so by default it is not visible
54219
54386
  case 273 /* ImportClause */:
54220
54387
  case 274 /* NamespaceImport */:
54221
54388
  case 276 /* ImportSpecifier */:
54222
54389
  return false;
54390
+ // Type parameters are always visible
54223
54391
  case 168 /* TypeParameter */:
54392
+ // Source file and namespace export are always visible
54393
+ // falls through
54224
54394
  case 307 /* SourceFile */:
54225
54395
  case 270 /* NamespaceExportDeclaration */:
54226
54396
  return true;
54397
+ // Export assignments do not create name bindings outside the module
54227
54398
  case 277 /* ExportAssignment */:
54228
54399
  return false;
54229
54400
  default:
@@ -61773,6 +61944,9 @@ function createTypeChecker(host) {
61773
61944
  return getTypeFromTemplateTypeNode(node);
61774
61945
  case 205 /* ImportType */:
61775
61946
  return getTypeFromImportTypeNode(node);
61947
+ // This function assumes that an identifier, qualified name, or property access expression is a type expression
61948
+ // Callers should first ensure this by calling `isPartOfTypeNode`
61949
+ // TODO(rbuckton): These aren't valid TypeNodes, but we treat them as such because of `isPartOfTypeNode`, which returns `true` for things that aren't `TypeNode`s.
61776
61950
  case 80 /* Identifier */:
61777
61951
  case 166 /* QualifiedName */:
61778
61952
  case 211 /* PropertyAccessExpression */:
@@ -62020,6 +62194,7 @@ function createTypeChecker(host) {
62020
62194
  return !!tp.isThisType;
62021
62195
  case 80 /* Identifier */:
62022
62196
  return !tp.isThisType && isPartOfTypeNode(node2) && maybeTypeParameterReference(node2) && getTypeFromTypeNodeWorker(node2) === tp;
62197
+ // use worker because we're looking for === equality
62023
62198
  case 186 /* TypeQuery */:
62024
62199
  const entityName = node2.exprName;
62025
62200
  const firstIdentifier = getFirstIdentifier(entityName);
@@ -62439,6 +62614,7 @@ function createTypeChecker(host) {
62439
62614
  if (!isConstAssertion(node)) {
62440
62615
  break;
62441
62616
  }
62617
+ // fallthrough
62442
62618
  case 294 /* JsxExpression */:
62443
62619
  case 217 /* ParenthesizedExpression */:
62444
62620
  return elaborateError(node.expression, source, target, relation, headMessage, containingMessageChain, errorOutputContainer);
@@ -63534,7 +63710,7 @@ function createTypeChecker(host) {
63534
63710
  const [sourceType, targetType] = getTypeNamesForErrorDisplay(source2, target2);
63535
63711
  let generalizedSource = source2;
63536
63712
  let generalizedSourceType = sourceType;
63537
- if (isLiteralType(source2) && !typeCouldHaveTopLevelSingletonTypes(target2)) {
63713
+ if (!(target2.flags & 131072 /* Never */) && isLiteralType(source2) && !typeCouldHaveTopLevelSingletonTypes(target2)) {
63538
63714
  generalizedSource = getBaseTypeOfLiteralType(source2);
63539
63715
  Debug.assert(!isTypeAssignableTo(generalizedSource, target2), "generalized source shouldn't be assignable");
63540
63716
  generalizedSourceType = getTypeNameForErrorDisplay(generalizedSource);
@@ -67758,6 +67934,7 @@ function createTypeChecker(host) {
67758
67934
  if (isCallExpression(node.parent)) {
67759
67935
  return Diagnostics.Cannot_find_name_0_Did_you_mean_to_write_this_in_an_async_function;
67760
67936
  }
67937
+ // falls through
67761
67938
  default:
67762
67939
  if (node.parent.kind === 304 /* ShorthandPropertyAssignment */) {
67763
67940
  return Diagnostics.No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer;
@@ -67791,6 +67968,7 @@ function createTypeChecker(host) {
67791
67968
  const symbol = getResolvedSymbol(node);
67792
67969
  return symbol !== unknownSymbol ? `${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}|${getSymbolId(symbol)}` : void 0;
67793
67970
  }
67971
+ // falls through
67794
67972
  case 110 /* ThisKeyword */:
67795
67973
  return `0|${flowContainer ? getNodeId(flowContainer) : "-1"}|${getTypeId(declaredType)}|${getTypeId(initialType)}`;
67796
67974
  case 235 /* NonNullExpression */:
@@ -69344,6 +69522,9 @@ function createTypeChecker(host) {
69344
69522
  break;
69345
69523
  case 28 /* CommaToken */:
69346
69524
  return narrowType(type, expr.right, assumeTrue);
69525
+ // Ordinarily we won't see && and || expressions in control flow analysis because the Binder breaks those
69526
+ // expressions down to individual conditional control flows. However, we may encounter them when analyzing
69527
+ // aliased conditional expressions.
69347
69528
  case 56 /* AmpersandAmpersandToken */:
69348
69529
  return assumeTrue ? narrowType(
69349
69530
  narrowType(
@@ -69787,6 +69968,7 @@ function createTypeChecker(host) {
69787
69968
  }
69788
69969
  }
69789
69970
  }
69971
+ // falls through
69790
69972
  case 110 /* ThisKeyword */:
69791
69973
  case 108 /* SuperKeyword */:
69792
69974
  case 211 /* PropertyAccessExpression */:
@@ -77605,6 +77787,7 @@ function createTypeChecker(host) {
77605
77787
  hasError = true;
77606
77788
  break;
77607
77789
  }
77790
+ // fallthrough
77608
77791
  case 7 /* ES2022 */:
77609
77792
  case 99 /* ESNext */:
77610
77793
  case 200 /* Preserve */:
@@ -77612,6 +77795,7 @@ function createTypeChecker(host) {
77612
77795
  if (languageVersion >= 4 /* ES2017 */) {
77613
77796
  break;
77614
77797
  }
77798
+ // fallthrough
77615
77799
  default:
77616
77800
  span ?? (span = getSpanOfTokenAtPosition(sourceFile, node.pos));
77617
77801
  const message = isAwaitExpression(node) ? Diagnostics.Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher : Diagnostics.Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher;
@@ -78029,9 +78213,13 @@ function createTypeChecker(host) {
78029
78213
  return true;
78030
78214
  }
78031
78215
  return false;
78216
+ // Some forms listed here for clarity
78032
78217
  case 222 /* VoidExpression */:
78218
+ // Explicit opt-out
78033
78219
  case 216 /* TypeAssertionExpression */:
78220
+ // Not SEF, but can produce useful type warnings
78034
78221
  case 234 /* AsExpression */:
78222
+ // Not SEF, but can produce useful type warnings
78035
78223
  default:
78036
78224
  return false;
78037
78225
  }
@@ -79277,6 +79465,7 @@ function createTypeChecker(host) {
79277
79465
  if (node.expression.kind === 102 /* ImportKeyword */) {
79278
79466
  return checkImportCallExpression(node);
79279
79467
  }
79468
+ // falls through
79280
79469
  case 214 /* NewExpression */:
79281
79470
  return checkCallExpression(node, checkMode);
79282
79471
  case 215 /* TaggedTemplateExpression */:
@@ -79646,6 +79835,7 @@ function createTypeChecker(host) {
79646
79835
  if (useDefineForClassFields) {
79647
79836
  break;
79648
79837
  }
79838
+ // fall through
79649
79839
  case "prototype":
79650
79840
  const message = Diagnostics.Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1;
79651
79841
  const className = getNameOfSymbolAsWritten(getSymbolOfDeclaration(node));
@@ -80389,6 +80579,8 @@ function createTypeChecker(host) {
80389
80579
  switch (d.kind) {
80390
80580
  case 264 /* InterfaceDeclaration */:
80391
80581
  case 265 /* TypeAliasDeclaration */:
80582
+ // A jsdoc typedef and callback are, by definition, type aliases.
80583
+ // falls through
80392
80584
  case 346 /* JSDocTypedefTag */:
80393
80585
  case 338 /* JSDocCallbackTag */:
80394
80586
  case 340 /* JSDocEnumTag */:
@@ -80409,6 +80601,8 @@ function createTypeChecker(host) {
80409
80601
  return 1 /* ExportValue */;
80410
80602
  }
80411
80603
  d = expression;
80604
+ // The below options all declare an Alias, which is allowed to merge with other values within the importing module.
80605
+ // falls through
80412
80606
  case 271 /* ImportEqualsDeclaration */:
80413
80607
  case 274 /* NamespaceImport */:
80414
80608
  case 273 /* ImportClause */:
@@ -80422,6 +80616,7 @@ function createTypeChecker(host) {
80422
80616
  case 208 /* BindingElement */:
80423
80617
  case 262 /* FunctionDeclaration */:
80424
80618
  case 276 /* ImportSpecifier */:
80619
+ // https://github.com/Microsoft/TypeScript/pull/7591
80425
80620
  case 80 /* Identifier */:
80426
80621
  return 1 /* ExportValue */;
80427
80622
  case 173 /* MethodSignature */:
@@ -80770,6 +80965,7 @@ function createTypeChecker(host) {
80770
80965
  headMessage = Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
80771
80966
  break;
80772
80967
  }
80968
+ // falls through
80773
80969
  case 169 /* Parameter */:
80774
80970
  headMessage = Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
80775
80971
  break;
@@ -83991,6 +84187,7 @@ function createTypeChecker(host) {
83991
84187
  break;
83992
84188
  case 271 /* ImportEqualsDeclaration */:
83993
84189
  if (isInternalModuleImportEqualsDeclaration(node)) break;
84190
+ // falls through
83994
84191
  case 272 /* ImportDeclaration */:
83995
84192
  grammarErrorOnFirstToken(node, Diagnostics.Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module);
83996
84193
  break;
@@ -84003,6 +84200,7 @@ function createTypeChecker(host) {
84003
84200
  }
84004
84201
  break;
84005
84202
  }
84203
+ // falls through
84006
84204
  case 263 /* ClassDeclaration */:
84007
84205
  case 266 /* EnumDeclaration */:
84008
84206
  case 262 /* FunctionDeclaration */:
@@ -84679,6 +84877,7 @@ function createTypeChecker(host) {
84679
84877
  return checkJSDocPropertyTag(node);
84680
84878
  case 317 /* JSDocFunctionType */:
84681
84879
  checkJSDocFunctionType(node);
84880
+ // falls through
84682
84881
  case 315 /* JSDocNonNullableType */:
84683
84882
  case 314 /* JSDocNullableType */:
84684
84883
  case 312 /* JSDocAllType */:
@@ -85102,6 +85301,7 @@ function createTypeChecker(host) {
85102
85301
  switch (location.kind) {
85103
85302
  case 307 /* SourceFile */:
85104
85303
  if (!isExternalModule(location)) break;
85304
+ // falls through
85105
85305
  case 267 /* ModuleDeclaration */:
85106
85306
  copyLocallyVisibleExportSymbols(getSymbolOfDeclaration(location).exports, meaning & 2623475 /* ModuleMember */);
85107
85307
  break;
@@ -85113,6 +85313,9 @@ function createTypeChecker(host) {
85113
85313
  if (className) {
85114
85314
  copySymbol(location.symbol, meaning);
85115
85315
  }
85316
+ // this fall-through is necessary because we would like to handle
85317
+ // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration.
85318
+ // falls through
85116
85319
  case 263 /* ClassDeclaration */:
85117
85320
  case 264 /* InterfaceDeclaration */:
85118
85321
  if (!isStaticSymbol) {
@@ -85221,6 +85424,7 @@ function createTypeChecker(host) {
85221
85424
  if (isPropertyAccessExpression(entityName.parent) && getLeftmostAccessExpression(entityName.parent) === entityName) {
85222
85425
  return void 0;
85223
85426
  }
85427
+ // falls through
85224
85428
  case 4 /* ThisProperty */:
85225
85429
  case 2 /* ModuleExports */:
85226
85430
  return getSymbolOfDeclaration(entityName.parent.parent);
@@ -85514,6 +85718,7 @@ function createTypeChecker(host) {
85514
85718
  if (!isThisInTypeQuery(node)) {
85515
85719
  return getSymbolOfNameOrPropertyAccessExpression(node);
85516
85720
  }
85721
+ // falls through
85517
85722
  case 110 /* ThisKeyword */:
85518
85723
  const container = getThisContainer(
85519
85724
  node,
@@ -85531,6 +85736,7 @@ function createTypeChecker(host) {
85531
85736
  if (isInExpressionContext(node)) {
85532
85737
  return checkExpression(node).symbol;
85533
85738
  }
85739
+ // falls through
85534
85740
  case 197 /* ThisType */:
85535
85741
  return getTypeFromThisTypeNode(node).symbol;
85536
85742
  case 108 /* SuperKeyword */:
@@ -85553,6 +85759,7 @@ function createTypeChecker(host) {
85553
85759
  if (isCallExpression(parent) && isBindableObjectDefinePropertyCall(parent) && parent.arguments[1] === node) {
85554
85760
  return getSymbolOfDeclaration(parent);
85555
85761
  }
85762
+ // falls through
85556
85763
  case 9 /* NumericLiteral */:
85557
85764
  const objectType = isElementAccessExpression(parent) ? parent.argumentExpression === node ? getTypeOfExpression(parent.expression) : void 0 : isLiteralTypeNode(parent) && isIndexedAccessTypeNode(grandParent) ? getTypeFromTypeNode(grandParent.objectType) : void 0;
85558
85765
  return objectType && getPropertyOfType(objectType, escapeLeadingUnderscores(node.text));
@@ -85582,6 +85789,7 @@ function createTypeChecker(host) {
85582
85789
  const symbol = getIntrinsicTagSymbol(node.parent);
85583
85790
  return symbol === unknownSymbol ? void 0 : symbol;
85584
85791
  }
85792
+ // falls through
85585
85793
  default:
85586
85794
  return void 0;
85587
85795
  }
@@ -87676,6 +87884,7 @@ function createTypeChecker(host) {
87676
87884
  );
87677
87885
  break;
87678
87886
  }
87887
+ // fallthrough
87679
87888
  case 7 /* ES2022 */:
87680
87889
  case 99 /* ESNext */:
87681
87890
  case 200 /* Preserve */:
@@ -87683,6 +87892,7 @@ function createTypeChecker(host) {
87683
87892
  if (languageVersion >= 4 /* ES2017 */) {
87684
87893
  break;
87685
87894
  }
87895
+ // fallthrough
87686
87896
  default:
87687
87897
  diagnostics.add(
87688
87898
  createDiagnosticForNode(forInOrOfStatement.awaitModifier, Diagnostics.Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher)
@@ -89859,13 +90069,13 @@ var visitEachChildTable = {
89859
90069
  );
89860
90070
  },
89861
90071
  // Transformation nodes
89862
- [354 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
90072
+ [355 /* PartiallyEmittedExpression */]: function visitEachChildOfPartiallyEmittedExpression(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
89863
90073
  return context.factory.updatePartiallyEmittedExpression(
89864
90074
  node,
89865
90075
  Debug.checkDefined(nodeVisitor(node.expression, visitor, isExpression))
89866
90076
  );
89867
90077
  },
89868
- [355 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
90078
+ [356 /* CommaListExpression */]: function visitEachChildOfCommaListExpression(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
89869
90079
  return context.factory.updateCommaListExpression(
89870
90080
  node,
89871
90081
  nodesVisitor(node.elements, visitor, isExpression)
@@ -91789,6 +91999,8 @@ function transformTypeScript(context) {
91789
91999
  case 148 /* ReadonlyKeyword */:
91790
92000
  case 103 /* InKeyword */:
91791
92001
  case 147 /* OutKeyword */:
92002
+ // TypeScript accessibility and readonly modifiers are elided
92003
+ // falls through
91792
92004
  case 188 /* ArrayType */:
91793
92005
  case 189 /* TupleType */:
91794
92006
  case 190 /* OptionalType */:
@@ -91817,6 +92029,8 @@ function transformTypeScript(context) {
91817
92029
  case 199 /* IndexedAccessType */:
91818
92030
  case 200 /* MappedType */:
91819
92031
  case 201 /* LiteralType */:
92032
+ // TypeScript type nodes are elided.
92033
+ // falls through
91820
92034
  case 181 /* IndexSignature */:
91821
92035
  return void 0;
91822
92036
  case 265 /* TypeAliasDeclaration */:
@@ -93499,7 +93713,7 @@ function transformClassFields(context) {
93499
93713
  /*discarded*/
93500
93714
  true
93501
93715
  );
93502
- case 355 /* CommaListExpression */:
93716
+ case 356 /* CommaListExpression */:
93503
93717
  return visitCommaListExpression(
93504
93718
  node,
93505
93719
  /*discarded*/
@@ -95439,6 +95653,7 @@ function transformClassFields(context) {
95439
95653
  if (isArrowFunction(original) || getEmitFlags(node) & 524288 /* AsyncFunctionBody */) {
95440
95654
  break;
95441
95655
  }
95656
+ // falls through
95442
95657
  case 262 /* FunctionDeclaration */:
95443
95658
  case 176 /* Constructor */:
95444
95659
  case 177 /* GetAccessor */:
@@ -95714,6 +95929,7 @@ function createRuntimeTypeSerializer(context) {
95714
95929
  case 197 /* ThisType */:
95715
95930
  case 205 /* ImportType */:
95716
95931
  break;
95932
+ // handle JSDoc types from an invalid parse
95717
95933
  case 312 /* JSDocAllType */:
95718
95934
  case 313 /* JSDocUnknownType */:
95719
95935
  case 317 /* JSDocFunctionType */:
@@ -96559,6 +96775,7 @@ function transformESDecorators(context) {
96559
96775
  return Debug.fail("Not supported outside of a class. Use 'classElementVisitor' instead.");
96560
96776
  case 169 /* Parameter */:
96561
96777
  return visitParameterDeclaration(node);
96778
+ // Support NamedEvaluation to ensure the correct class name for class expressions.
96562
96779
  case 226 /* BinaryExpression */:
96563
96780
  return visitBinaryExpression(
96564
96781
  node,
@@ -96579,7 +96796,7 @@ function transformESDecorators(context) {
96579
96796
  return visitForStatement(node);
96580
96797
  case 244 /* ExpressionStatement */:
96581
96798
  return visitExpressionStatement(node);
96582
- case 355 /* CommaListExpression */:
96799
+ case 356 /* CommaListExpression */:
96583
96800
  return visitCommaListExpression(
96584
96801
  node,
96585
96802
  /*discarded*/
@@ -96591,7 +96808,7 @@ function transformESDecorators(context) {
96591
96808
  /*discarded*/
96592
96809
  false
96593
96810
  );
96594
- case 354 /* PartiallyEmittedExpression */:
96811
+ case 355 /* PartiallyEmittedExpression */:
96595
96812
  return visitPartiallyEmittedExpression(
96596
96813
  node,
96597
96814
  /*discarded*/
@@ -96615,6 +96832,7 @@ function transformESDecorators(context) {
96615
96832
  case 167 /* ComputedPropertyName */:
96616
96833
  return visitComputedPropertyName(node);
96617
96834
  case 174 /* MethodDeclaration */:
96835
+ // object literal methods and accessors
96618
96836
  case 178 /* SetAccessor */:
96619
96837
  case 177 /* GetAccessor */:
96620
96838
  case 218 /* FunctionExpression */:
@@ -96677,7 +96895,7 @@ function transformESDecorators(context) {
96677
96895
  /*discarded*/
96678
96896
  true
96679
96897
  );
96680
- case 355 /* CommaListExpression */:
96898
+ case 356 /* CommaListExpression */:
96681
96899
  return visitCommaListExpression(
96682
96900
  node,
96683
96901
  /*discarded*/
@@ -99259,7 +99477,7 @@ function transformES2018(context) {
99259
99477
  return visitObjectLiteralExpression(node);
99260
99478
  case 226 /* BinaryExpression */:
99261
99479
  return visitBinaryExpression(node, expressionResultIsUnused2);
99262
- case 355 /* CommaListExpression */:
99480
+ case 356 /* CommaListExpression */:
99263
99481
  return visitCommaListExpression(node, expressionResultIsUnused2);
99264
99482
  case 299 /* CatchClause */:
99265
99483
  return visitCatchClause(node);
@@ -102399,6 +102617,7 @@ function transformES2015(context) {
102399
102617
  switch (node.kind) {
102400
102618
  case 126 /* StaticKeyword */:
102401
102619
  return void 0;
102620
+ // elide static keyword
102402
102621
  case 263 /* ClassDeclaration */:
102403
102622
  return visitClassDeclaration(node);
102404
102623
  case 231 /* ClassExpression */:
@@ -102477,7 +102696,7 @@ function transformES2015(context) {
102477
102696
  return visitParenthesizedExpression(node, expressionResultIsUnused2);
102478
102697
  case 226 /* BinaryExpression */:
102479
102698
  return visitBinaryExpression(node, expressionResultIsUnused2);
102480
- case 355 /* CommaListExpression */:
102699
+ case 356 /* CommaListExpression */:
102481
102700
  return visitCommaListExpression(node, expressionResultIsUnused2);
102482
102701
  case 15 /* NoSubstitutionTemplateLiteral */:
102483
102702
  case 16 /* TemplateHead */:
@@ -102861,12 +103080,14 @@ function transformES2015(context) {
102861
103080
  return false;
102862
103081
  }
102863
103082
  switch (node.kind) {
103083
+ // stop at function boundaries
102864
103084
  case 219 /* ArrowFunction */:
102865
103085
  case 218 /* FunctionExpression */:
102866
103086
  case 262 /* FunctionDeclaration */:
102867
103087
  case 176 /* Constructor */:
102868
103088
  case 175 /* ClassStaticBlockDeclaration */:
102869
103089
  return false;
103090
+ // only step into computed property names for class and object literal elements
102870
103091
  case 177 /* GetAccessor */:
102871
103092
  case 178 /* SetAccessor */:
102872
103093
  case 174 /* MethodDeclaration */:
@@ -103075,12 +103296,14 @@ function transformES2015(context) {
103075
103296
  return factory2.createPartiallyEmittedExpression(node.right, node);
103076
103297
  }
103077
103298
  switch (node.kind) {
103299
+ // stop at function boundaries
103078
103300
  case 219 /* ArrowFunction */:
103079
103301
  case 218 /* FunctionExpression */:
103080
103302
  case 262 /* FunctionDeclaration */:
103081
103303
  case 176 /* Constructor */:
103082
103304
  case 175 /* ClassStaticBlockDeclaration */:
103083
103305
  return node;
103306
+ // only step into computed property names for class and object literal elements
103084
103307
  case 177 /* GetAccessor */:
103085
103308
  case 178 /* SetAccessor */:
103086
103309
  case 174 /* MethodDeclaration */:
@@ -103126,12 +103349,14 @@ function transformES2015(context) {
103126
103349
  );
103127
103350
  }
103128
103351
  switch (node.kind) {
103352
+ // stop at function boundaries
103129
103353
  case 219 /* ArrowFunction */:
103130
103354
  case 218 /* FunctionExpression */:
103131
103355
  case 262 /* FunctionDeclaration */:
103132
103356
  case 176 /* Constructor */:
103133
103357
  case 175 /* ClassStaticBlockDeclaration */:
103134
103358
  return node;
103359
+ // only step into computed property names for class and object literal elements
103135
103360
  case 177 /* GetAccessor */:
103136
103361
  case 178 /* SetAccessor */:
103137
103362
  case 174 /* MethodDeclaration */:
@@ -105763,7 +105988,7 @@ function transformGenerators(context) {
105763
105988
  switch (node.kind) {
105764
105989
  case 226 /* BinaryExpression */:
105765
105990
  return visitBinaryExpression(node);
105766
- case 355 /* CommaListExpression */:
105991
+ case 356 /* CommaListExpression */:
105767
105992
  return visitCommaListExpression(node);
105768
105993
  case 227 /* ConditionalExpression */:
105769
105994
  return visitConditionalExpression(node);
@@ -108154,7 +108379,7 @@ function transformModule(context) {
108154
108379
  return visitExpressionStatement(node);
108155
108380
  case 217 /* ParenthesizedExpression */:
108156
108381
  return visitParenthesizedExpression(node, valueIsDiscarded);
108157
- case 354 /* PartiallyEmittedExpression */:
108382
+ case 355 /* PartiallyEmittedExpression */:
108158
108383
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
108159
108384
  case 213 /* CallExpression */:
108160
108385
  if (isImportCall(node) && host.shouldTransformImportCall(currentSourceFile)) {
@@ -109914,6 +110139,7 @@ function transformSystemModule(context) {
109914
110139
  if (!entry.importClause) {
109915
110140
  break;
109916
110141
  }
110142
+ // falls through
109917
110143
  case 271 /* ImportEqualsDeclaration */:
109918
110144
  Debug.assert(importVariableName !== void 0);
109919
110145
  statements.push(
@@ -110548,7 +110774,7 @@ function transformSystemModule(context) {
110548
110774
  return visitExpressionStatement(node);
110549
110775
  case 217 /* ParenthesizedExpression */:
110550
110776
  return visitParenthesizedExpression(node, valueIsDiscarded);
110551
- case 354 /* PartiallyEmittedExpression */:
110777
+ case 355 /* PartiallyEmittedExpression */:
110552
110778
  return visitPartiallyEmittedExpression(node, valueIsDiscarded);
110553
110779
  case 226 /* BinaryExpression */:
110554
110780
  if (isDestructuringAssignment(node)) {
@@ -112147,6 +112373,7 @@ function transformDeclarations(context) {
112147
112373
  case 265 /* TypeAliasDeclaration */:
112148
112374
  case 266 /* EnumDeclaration */:
112149
112375
  return !resolver.isDeclarationVisible(node);
112376
+ // The following should be doing their own visibility checks based on filtering their members
112150
112377
  case 260 /* VariableDeclaration */:
112151
112378
  return !getBindingNameVisible(node);
112152
112379
  case 271 /* ImportEqualsDeclaration */:
@@ -113428,7 +113655,7 @@ function noEmitNotification(hint, node, callback) {
113428
113655
  }
113429
113656
  function transformNodes(resolver, host, factory2, options, nodes, transformers, allowDtsFiles) {
113430
113657
  var _a, _b;
113431
- const enabledSyntaxKindFeatures = new Array(357 /* Count */);
113658
+ const enabledSyntaxKindFeatures = new Array(358 /* Count */);
113432
113659
  let lexicalEnvironmentVariableDeclarations;
113433
113660
  let lexicalEnvironmentFunctionDeclarations;
113434
113661
  let lexicalEnvironmentStatements;
@@ -114631,6 +114858,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114631
114858
  if (onEmitNode !== noEmitNotification && (!isEmitNotificationEnabled || isEmitNotificationEnabled(node))) {
114632
114859
  return pipelineEmitWithNotification;
114633
114860
  }
114861
+ // falls through
114634
114862
  case 1 /* Substitution */:
114635
114863
  if (substituteNode !== noEmitSubstitution && (lastSubstitution = substituteNode(emitHint, node) || node) !== node) {
114636
114864
  if (currentParenthesizerRule) {
@@ -114638,14 +114866,17 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114638
114866
  }
114639
114867
  return pipelineEmitWithSubstitution;
114640
114868
  }
114869
+ // falls through
114641
114870
  case 2 /* Comments */:
114642
114871
  if (shouldEmitComments(node)) {
114643
114872
  return pipelineEmitWithComments;
114644
114873
  }
114874
+ // falls through
114645
114875
  case 3 /* SourceMaps */:
114646
114876
  if (shouldEmitSourceMaps(node)) {
114647
114877
  return pipelineEmitWithSourceMaps;
114648
114878
  }
114879
+ // falls through
114649
114880
  case 4 /* Emit */:
114650
114881
  return pipelineEmitWithHint;
114651
114882
  default:
@@ -114697,6 +114928,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114697
114928
  }
114698
114929
  if (hint === 4 /* Unspecified */) {
114699
114930
  switch (node.kind) {
114931
+ // Pseudo-literals
114700
114932
  case 16 /* TemplateHead */:
114701
114933
  case 17 /* TemplateMiddle */:
114702
114934
  case 18 /* TemplateTail */:
@@ -114705,20 +114937,26 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114705
114937
  /*jsxAttributeEscape*/
114706
114938
  false
114707
114939
  );
114940
+ // Identifiers
114708
114941
  case 80 /* Identifier */:
114709
114942
  return emitIdentifier(node);
114943
+ // PrivateIdentifiers
114710
114944
  case 81 /* PrivateIdentifier */:
114711
114945
  return emitPrivateIdentifier(node);
114946
+ // Parse tree nodes
114947
+ // Names
114712
114948
  case 166 /* QualifiedName */:
114713
114949
  return emitQualifiedName(node);
114714
114950
  case 167 /* ComputedPropertyName */:
114715
114951
  return emitComputedPropertyName(node);
114952
+ // Signature elements
114716
114953
  case 168 /* TypeParameter */:
114717
114954
  return emitTypeParameter(node);
114718
114955
  case 169 /* Parameter */:
114719
114956
  return emitParameter(node);
114720
114957
  case 170 /* Decorator */:
114721
114958
  return emitDecorator(node);
114959
+ // Type members
114722
114960
  case 171 /* PropertySignature */:
114723
114961
  return emitPropertySignature(node);
114724
114962
  case 172 /* PropertyDeclaration */:
@@ -114740,6 +114978,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114740
114978
  return emitConstructSignature(node);
114741
114979
  case 181 /* IndexSignature */:
114742
114980
  return emitIndexSignature(node);
114981
+ // Types
114743
114982
  case 182 /* TypePredicate */:
114744
114983
  return emitTypePredicate(node);
114745
114984
  case 183 /* TypeReference */:
@@ -114758,6 +114997,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114758
114997
  return emitTupleType(node);
114759
114998
  case 190 /* OptionalType */:
114760
114999
  return emitOptionalType(node);
115000
+ // SyntaxKind.RestType is handled below
114761
115001
  case 192 /* UnionType */:
114762
115002
  return emitUnionType(node);
114763
115003
  case 193 /* IntersectionType */:
@@ -114788,16 +115028,19 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114788
115028
  return emitTemplateTypeSpan(node);
114789
115029
  case 205 /* ImportType */:
114790
115030
  return emitImportTypeNode(node);
115031
+ // Binding patterns
114791
115032
  case 206 /* ObjectBindingPattern */:
114792
115033
  return emitObjectBindingPattern(node);
114793
115034
  case 207 /* ArrayBindingPattern */:
114794
115035
  return emitArrayBindingPattern(node);
114795
115036
  case 208 /* BindingElement */:
114796
115037
  return emitBindingElement(node);
115038
+ // Misc
114797
115039
  case 239 /* TemplateSpan */:
114798
115040
  return emitTemplateSpan(node);
114799
115041
  case 240 /* SemicolonClassElement */:
114800
115042
  return emitSemicolonClassElement();
115043
+ // Statements
114801
115044
  case 241 /* Block */:
114802
115045
  return emitBlock(node);
114803
115046
  case 243 /* VariableStatement */:
@@ -114839,6 +115082,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114839
115082
  return emitTryStatement(node);
114840
115083
  case 259 /* DebuggerStatement */:
114841
115084
  return emitDebuggerStatement(node);
115085
+ // Declarations
114842
115086
  case 260 /* VariableDeclaration */:
114843
115087
  return emitVariableDeclaration(node);
114844
115088
  case 261 /* VariableDeclarationList */:
@@ -114889,8 +115133,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114889
115133
  return emitImportAttribute(node);
114890
115134
  case 282 /* MissingDeclaration */:
114891
115135
  return;
115136
+ // Module references
114892
115137
  case 283 /* ExternalModuleReference */:
114893
115138
  return emitExternalModuleReference(node);
115139
+ // JSX (non-expression)
114894
115140
  case 12 /* JsxText */:
114895
115141
  return emitJsxText(node);
114896
115142
  case 286 /* JsxOpeningElement */:
@@ -114909,6 +115155,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114909
115155
  return emitJsxExpression(node);
114910
115156
  case 295 /* JsxNamespacedName */:
114911
115157
  return emitJsxNamespacedName(node);
115158
+ // Clauses
114912
115159
  case 296 /* CaseClause */:
114913
115160
  return emitCaseClause(node);
114914
115161
  case 297 /* DefaultClause */:
@@ -114917,18 +115164,22 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114917
115164
  return emitHeritageClause(node);
114918
115165
  case 299 /* CatchClause */:
114919
115166
  return emitCatchClause(node);
115167
+ // Property assignments
114920
115168
  case 303 /* PropertyAssignment */:
114921
115169
  return emitPropertyAssignment(node);
114922
115170
  case 304 /* ShorthandPropertyAssignment */:
114923
115171
  return emitShorthandPropertyAssignment(node);
114924
115172
  case 305 /* SpreadAssignment */:
114925
115173
  return emitSpreadAssignment(node);
115174
+ // Enum
114926
115175
  case 306 /* EnumMember */:
114927
115176
  return emitEnumMember(node);
115177
+ // Top-level nodes
114928
115178
  case 307 /* SourceFile */:
114929
115179
  return emitSourceFile(node);
114930
115180
  case 308 /* Bundle */:
114931
115181
  return Debug.fail("Bundles should be printed using printBundle");
115182
+ // JSDoc nodes (only used in codefixes currently)
114932
115183
  case 309 /* JSDocTypeExpression */:
114933
115184
  return emitJSDocTypeExpression(node);
114934
115185
  case 310 /* JSDocNameReference */:
@@ -114966,6 +115217,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114966
115217
  case 330 /* JSDocAuthorTag */:
114967
115218
  case 331 /* JSDocDeprecatedTag */:
114968
115219
  return;
115220
+ // SyntaxKind.JSDocClassTag (see JSDocTag, above)
114969
115221
  case 333 /* JSDocPublicTag */:
114970
115222
  case 334 /* JSDocPrivateTag */:
114971
115223
  case 335 /* JSDocProtectedTag */:
@@ -114975,6 +115227,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114975
115227
  return emitJSDocCallbackTag(node);
114976
115228
  case 339 /* JSDocOverloadTag */:
114977
115229
  return emitJSDocOverloadTag(node);
115230
+ // SyntaxKind.JSDocEnumTag (see below)
114978
115231
  case 341 /* JSDocParameterTag */:
114979
115232
  case 348 /* JSDocPropertyTag */:
114980
115233
  return emitJSDocPropertyLikeTag(node);
@@ -114993,7 +115246,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
114993
115246
  return emitJSDocSeeTag(node);
114994
115247
  case 351 /* JSDocImportTag */:
114995
115248
  return emitJSDocImportTag(node);
115249
+ // SyntaxKind.JSDocPropertyTag (see JSDocParameterTag, above)
115250
+ // Transformation nodes
114996
115251
  case 353 /* NotEmittedStatement */:
115252
+ case 354 /* NotEmittedTypeElement */:
114997
115253
  return;
114998
115254
  }
114999
115255
  if (isExpression(node)) {
@@ -115011,6 +115267,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115011
115267
  }
115012
115268
  if (hint === 1 /* Expression */) {
115013
115269
  switch (node.kind) {
115270
+ // Literals
115014
115271
  case 9 /* NumericLiteral */:
115015
115272
  case 10 /* BigIntLiteral */:
115016
115273
  return emitNumericOrBigIntLiteral(node);
@@ -115022,10 +115279,12 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115022
115279
  /*jsxAttributeEscape*/
115023
115280
  false
115024
115281
  );
115282
+ // Identifiers
115025
115283
  case 80 /* Identifier */:
115026
115284
  return emitIdentifier(node);
115027
115285
  case 81 /* PrivateIdentifier */:
115028
115286
  return emitPrivateIdentifier(node);
115287
+ // Expressions
115029
115288
  case 209 /* ArrayLiteralExpression */:
115030
115289
  return emitArrayLiteralExpression(node);
115031
115290
  case 210 /* ObjectLiteralExpression */:
@@ -115088,21 +115347,24 @@ function createPrinter(printerOptions = {}, handlers = {}) {
115088
115347
  return Debug.fail("SyntheticExpression should never be printed.");
115089
115348
  case 282 /* MissingDeclaration */:
115090
115349
  return;
115350
+ // JSX
115091
115351
  case 284 /* JsxElement */:
115092
115352
  return emitJsxElement(node);
115093
115353
  case 285 /* JsxSelfClosingElement */:
115094
115354
  return emitJsxSelfClosingElement(node);
115095
115355
  case 288 /* JsxFragment */:
115096
115356
  return emitJsxFragment(node);
115357
+ // Synthesized list
115097
115358
  case 352 /* SyntaxList */:
115098
115359
  return Debug.fail("SyntaxList should not be printed");
115360
+ // Transformation nodes
115099
115361
  case 353 /* NotEmittedStatement */:
115100
115362
  return;
115101
- case 354 /* PartiallyEmittedExpression */:
115363
+ case 355 /* PartiallyEmittedExpression */:
115102
115364
  return emitPartiallyEmittedExpression(node);
115103
- case 355 /* CommaListExpression */:
115365
+ case 356 /* CommaListExpression */:
115104
115366
  return emitCommaList(node);
115105
- case 356 /* SyntheticReferenceExpression */:
115367
+ case 357 /* SyntheticReferenceExpression */:
115106
115368
  return Debug.fail("SyntheticReferenceExpression should not be printed");
115107
115369
  }
115108
115370
  }
@@ -121239,6 +121501,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121239
121501
  diagnostics.push(createDiagnosticForNode2(node, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, "?"));
121240
121502
  return "skip";
121241
121503
  }
121504
+ // falls through
121242
121505
  case 173 /* MethodSignature */:
121243
121506
  case 176 /* Constructor */:
121244
121507
  case 177 /* GetAccessor */:
@@ -121370,6 +121633,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121370
121633
  diagnostics.push(createDiagnosticForNodeArray2(nodes, Diagnostics.Type_parameter_declarations_can_only_be_used_in_TypeScript_files));
121371
121634
  return "skip";
121372
121635
  }
121636
+ // falls through
121373
121637
  case 243 /* VariableStatement */:
121374
121638
  if (nodes === parent.modifiers) {
121375
121639
  checkModifiers(parent.modifiers, parent.kind === 243 /* VariableStatement */);
@@ -121412,6 +121676,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121412
121676
  if (isConstValid) {
121413
121677
  continue;
121414
121678
  }
121679
+ // to report error,
121680
+ // falls through
121415
121681
  case 125 /* PublicKeyword */:
121416
121682
  case 123 /* PrivateKeyword */:
121417
121683
  case 124 /* ProtectedKeyword */:
@@ -121423,6 +121689,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
121423
121689
  case 147 /* OutKeyword */:
121424
121690
  diagnostics.push(createDiagnosticForNode2(modifier, Diagnostics.The_0_modifier_can_only_be_used_in_TypeScript_files, tokenToString(modifier.kind)));
121425
121691
  break;
121692
+ // These are all legal modifiers.
121426
121693
  case 126 /* StaticKeyword */:
121427
121694
  case 95 /* ExportKeyword */:
121428
121695
  case 90 /* DefaultKeyword */:
@@ -126828,6 +127095,7 @@ function getSourceFileVersionAsHashFromText(host, text) {
126828
127095
  if (pos && text.charCodeAt(pos - 1) === 13 /* carriageReturn */) {
126829
127096
  pos--;
126830
127097
  }
127098
+ // falls through
126831
127099
  case 13 /* carriageReturn */:
126832
127100
  break;
126833
127101
  default:
@@ -128314,6 +128582,7 @@ function createBuildOrUpdateInvalidedProject(state, project, projectPath, projec
128314
128582
  queueReferencingProjects(state, project, projectPath, projectIndex, config, buildOrder, Debug.checkDefined(buildResult));
128315
128583
  step++;
128316
128584
  break;
128585
+ // Should never be done
128317
128586
  case 3 /* Done */:
128318
128587
  default:
128319
128588
  assertType(step);
@@ -128854,6 +129123,7 @@ function queueReferencingProjects(state, project, projectPath, projectIndex, con
128854
129123
  status.type = 2 /* UpToDateWithUpstreamTypes */;
128855
129124
  break;
128856
129125
  }
129126
+ // falls through
128857
129127
  case 15 /* UpToDateWithInputFileText */:
128858
129128
  case 2 /* UpToDateWithUpstreamTypes */:
128859
129129
  if (!(buildResult & 2 /* DeclarationOutputUnchanged */)) {
@@ -129371,6 +129641,8 @@ function reportUpToDateStatus(state, configFileName, status) {
129371
129641
  relName(state, configFileName)
129372
129642
  );
129373
129643
  case 16 /* ContainerOnly */:
129644
+ // Don't report status on "solution" projects
129645
+ // falls through
129374
129646
  case 13 /* ComputingUpstream */:
129375
129647
  break;
129376
129648
  default: