typescript 4.9.1-beta → 5.0.0-dev.20221101

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
@@ -68,8 +68,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
68
68
  };
69
69
  var ts;
70
70
  (function (ts) {
71
- ts.versionMajorMinor = "4.9";
72
- ts.version = "".concat(ts.versionMajorMinor, ".1-beta");
71
+ ts.versionMajorMinor = "5.0";
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20221101");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -1606,8 +1606,8 @@ var ts;
1606
1606
  return compareValues(a === null || a === void 0 ? void 0 : a.start, b === null || b === void 0 ? void 0 : b.start) || compareValues(a === null || a === void 0 ? void 0 : a.length, b === null || b === void 0 ? void 0 : b.length);
1607
1607
  }
1608
1608
  ts.compareTextSpans = compareTextSpans;
1609
- function min(a, b, compare) {
1610
- return compare(a, b) === -1 ? a : b;
1609
+ function min(items, compare) {
1610
+ return reduceLeft(items, function (x, y) { return compare(x, y) === -1 ? x : y; });
1611
1611
  }
1612
1612
  ts.min = min;
1613
1613
  function compareStringsCaseInsensitive(a, b) {
@@ -2744,7 +2744,9 @@ var ts;
2744
2744
  (function (ts) {
2745
2745
  var versionRegExp = /^(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\.(0|[1-9]\d*)(?:\-([a-z0-9-.]+))?(?:\+([a-z0-9-.]+))?)?)?$/i;
2746
2746
  var prereleaseRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)(?:\.(?:0|[1-9]\d*|[a-z-][a-z0-9-]*))*$/i;
2747
+ var prereleasePartRegExp = /^(?:0|[1-9]\d*|[a-z-][a-z0-9-]*)$/i;
2747
2748
  var buildRegExp = /^[a-z0-9-]+(?:\.[a-z0-9-]+)*$/i;
2749
+ var buildPartRegExp = /^[a-z0-9-]+$/i;
2748
2750
  var numericIdentifierRegExp = /^(0|[1-9]\d*)$/;
2749
2751
  var Version = (function () {
2750
2752
  function Version(major, minor, patch, prerelease, build) {
@@ -2759,13 +2761,15 @@ var ts;
2759
2761
  ts.Debug.assert(major >= 0, "Invalid argument: major");
2760
2762
  ts.Debug.assert(minor >= 0, "Invalid argument: minor");
2761
2763
  ts.Debug.assert(patch >= 0, "Invalid argument: patch");
2762
- ts.Debug.assert(!prerelease || prereleaseRegExp.test(prerelease), "Invalid argument: prerelease");
2763
- ts.Debug.assert(!build || buildRegExp.test(build), "Invalid argument: build");
2764
+ var prereleaseArray = prerelease ? ts.isArray(prerelease) ? prerelease : prerelease.split(".") : ts.emptyArray;
2765
+ var buildArray = build ? ts.isArray(build) ? build : build.split(".") : ts.emptyArray;
2766
+ ts.Debug.assert(ts.every(prereleaseArray, function (s) { return prereleasePartRegExp.test(s); }), "Invalid argument: prerelease");
2767
+ ts.Debug.assert(ts.every(buildArray, function (s) { return buildPartRegExp.test(s); }), "Invalid argument: build");
2764
2768
  this.major = major;
2765
2769
  this.minor = minor;
2766
2770
  this.patch = patch;
2767
- this.prerelease = prerelease ? prerelease.split(".") : ts.emptyArray;
2768
- this.build = build ? build.split(".") : ts.emptyArray;
2771
+ this.prerelease = prereleaseArray;
2772
+ this.build = buildArray;
2769
2773
  }
2770
2774
  Version.tryParse = function (text) {
2771
2775
  var result = tryParseComponents(text);
@@ -2792,6 +2796,10 @@ var ts;
2792
2796
  default: return ts.Debug.assertNever(field);
2793
2797
  }
2794
2798
  };
2799
+ Version.prototype.with = function (fields) {
2800
+ var _a = fields.major, major = _a === void 0 ? this.major : _a, _b = fields.minor, minor = _b === void 0 ? this.minor : _b, _c = fields.patch, patch = _c === void 0 ? this.patch : _c, _d = fields.prerelease, prerelease = _d === void 0 ? this.prerelease : _d, _e = fields.build, build = _e === void 0 ? this.build : _e;
2801
+ return new Version(major, minor, patch, prerelease, build);
2802
+ };
2795
2803
  Version.prototype.toString = function () {
2796
2804
  var result = "".concat(this.major, ".").concat(this.minor, ".").concat(this.patch);
2797
2805
  if (ts.some(this.prerelease))
@@ -2800,7 +2808,7 @@ var ts;
2800
2808
  result += "+".concat(this.build.join("."));
2801
2809
  return result;
2802
2810
  };
2803
- Version.zero = new Version(0, 0, 0);
2811
+ Version.zero = new Version(0, 0, 0, ["0"]);
2804
2812
  return Version;
2805
2813
  }());
2806
2814
  ts.Version = Version;
@@ -2950,19 +2958,20 @@ var ts;
2950
2958
  break;
2951
2959
  case "<":
2952
2960
  case ">=":
2953
- comparators.push(createComparator(operator, version));
2961
+ comparators.push(isWildcard(minor) || isWildcard(patch) ? createComparator(operator, version.with({ prerelease: "0" })) :
2962
+ createComparator(operator, version));
2954
2963
  break;
2955
2964
  case "<=":
2956
2965
  case ">":
2957
- comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major")) :
2958
- isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor")) :
2966
+ comparators.push(isWildcard(minor) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("major").with({ prerelease: "0" })) :
2967
+ isWildcard(patch) ? createComparator(operator === "<=" ? "<" : ">=", version.increment("minor").with({ prerelease: "0" })) :
2959
2968
  createComparator(operator, version));
2960
2969
  break;
2961
2970
  case "=":
2962
2971
  case undefined:
2963
2972
  if (isWildcard(minor) || isWildcard(patch)) {
2964
- comparators.push(createComparator(">=", version));
2965
- comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor")));
2973
+ comparators.push(createComparator(">=", version.with({ prerelease: "0" })));
2974
+ comparators.push(createComparator("<", version.increment(isWildcard(minor) ? "major" : "minor").with({ prerelease: "0" })));
2966
2975
  }
2967
2976
  else {
2968
2977
  comparators.push(createComparator("=", version));
@@ -4213,7 +4222,7 @@ var ts;
4213
4222
  };
4214
4223
  }
4215
4224
  function createSystemWatchFunctions(_a) {
4216
- var pollingWatchFileWorker = _a.pollingWatchFileWorker, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatchWorker = _a.fsWatchWorker, fileSystemEntryExists = _a.fileSystemEntryExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, defaultWatchFileKind = _a.defaultWatchFileKind, inodeWatching = _a.inodeWatching, sysLog = _a.sysLog;
4225
+ var pollingWatchFileWorker = _a.pollingWatchFileWorker, getModifiedTime = _a.getModifiedTime, setTimeout = _a.setTimeout, clearTimeout = _a.clearTimeout, fsWatchWorker = _a.fsWatchWorker, fileSystemEntryExists = _a.fileSystemEntryExists, useCaseSensitiveFileNames = _a.useCaseSensitiveFileNames, getCurrentDirectory = _a.getCurrentDirectory, fsSupportsRecursiveFsWatch = _a.fsSupportsRecursiveFsWatch, getAccessibleSortedChildDirectories = _a.getAccessibleSortedChildDirectories, realpath = _a.realpath, tscWatchFile = _a.tscWatchFile, useNonPollingWatchers = _a.useNonPollingWatchers, tscWatchDirectory = _a.tscWatchDirectory, inodeWatching = _a.inodeWatching, sysLog = _a.sysLog;
4217
4226
  var pollingWatches = new ts.Map();
4218
4227
  var fsWatches = new ts.Map();
4219
4228
  var fsWatchesRecursive = new ts.Map();
@@ -4272,7 +4281,7 @@ var ts;
4272
4281
  default:
4273
4282
  return useNonPollingWatchers ?
4274
4283
  generateWatchFileOptions(ts.WatchFileKind.UseFsEventsOnParentDirectory, ts.PollingWatchKind.PriorityInterval, options) :
4275
- { watchFile: (defaultWatchFileKind === null || defaultWatchFileKind === void 0 ? void 0 : defaultWatchFileKind()) || ts.WatchFileKind.UseFsEvents };
4284
+ { watchFile: ts.WatchFileKind.UseFsEvents };
4276
4285
  }
4277
4286
  }
4278
4287
  function generateWatchFileOptions(watchFile, fallbackPolling, options) {
@@ -4495,7 +4504,6 @@ var ts;
4495
4504
  tscWatchFile: process.env.TSC_WATCHFILE,
4496
4505
  useNonPollingWatchers: process.env.TSC_NONPOLLING_WATCHER,
4497
4506
  tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
4498
- defaultWatchFileKind: function () { var _a, _b; return (_b = (_a = sys).defaultWatchFileKind) === null || _b === void 0 ? void 0 : _b.call(_a); },
4499
4507
  inodeWatching: isLinuxOrMacOs,
4500
4508
  sysLog: sysLog,
4501
4509
  }), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory;
@@ -6741,6 +6749,10 @@ var ts;
6741
6749
  Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted: diag(6399, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitte_6399", "Project '{0}' is out of date because buildinfo file '{1}' indicates that some of the changes were not emitted"),
6742
6750
  Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_files: diag(6400, ts.DiagnosticCategory.Message, "Project_0_is_up_to_date_but_needs_to_update_timestamps_of_output_files_that_are_older_than_input_fil_6400", "Project '{0}' is up to date but needs to update timestamps of output files that are older than input files"),
6743
6751
  Project_0_is_out_of_date_because_there_was_error_reading_file_1: diag(6401, ts.DiagnosticCategory.Message, "Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401", "Project '{0}' is out of date because there was error reading file '{1}'"),
6752
+ Resolving_in_0_mode_with_conditions_1: diag(6402, ts.DiagnosticCategory.Message, "Resolving_in_0_mode_with_conditions_1_6402", "Resolving in {0} mode with conditions {1}."),
6753
+ Matched_0_condition_1: diag(6403, ts.DiagnosticCategory.Message, "Matched_0_condition_1_6403", "Matched '{0}' condition '{1}'."),
6754
+ Using_0_subpath_1_with_target_2: diag(6404, ts.DiagnosticCategory.Message, "Using_0_subpath_1_with_target_2_6404", "Using '{0}' subpath '{1}' with target '{2}'."),
6755
+ Saw_non_matching_condition_0: diag(6405, ts.DiagnosticCategory.Message, "Saw_non_matching_condition_0_6405", "Saw non-matching condition '{0}'."),
6744
6756
  The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: diag(6500, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1_6500", "The expected type comes from property '{0}' which is declared here on type '{1}'"),
6745
6757
  The_expected_type_comes_from_this_index_signature: diag(6501, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_this_index_signature_6501", "The expected type comes from this index signature."),
6746
6758
  The_expected_type_comes_from_the_return_type_of_this_signature: diag(6502, ts.DiagnosticCategory.Message, "The_expected_type_comes_from_the_return_type_of_this_signature_6502", "The expected type comes from the return type of this signature."),
@@ -7057,6 +7069,8 @@ var ts;
7057
7069
  Remove_type_from_import_of_0_from_1: diag(90056, ts.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", "Remove 'type' from import of '{0}' from \"{1}\""),
7058
7070
  Add_import_from_0: diag(90057, ts.DiagnosticCategory.Message, "Add_import_from_0_90057", "Add import from \"{0}\""),
7059
7071
  Update_import_from_0: diag(90058, ts.DiagnosticCategory.Message, "Update_import_from_0_90058", "Update import from \"{0}\""),
7072
+ Export_0_from_module_1: diag(90059, ts.DiagnosticCategory.Message, "Export_0_from_module_1_90059", "Export '{0}' from module '{1}'"),
7073
+ Export_all_referenced_locals: diag(90060, ts.DiagnosticCategory.Message, "Export_all_referenced_locals_90060", "Export all referenced locals"),
7060
7074
  Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
7061
7075
  Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
7062
7076
  Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
@@ -8341,7 +8355,7 @@ var ts;
8341
8355
  return -1;
8342
8356
  }
8343
8357
  function peekExtendedUnicodeEscape() {
8344
- if (languageVersion >= 2 && codePointAt(text, pos + 1) === 117 && codePointAt(text, pos + 2) === 123) {
8358
+ if (codePointAt(text, pos + 1) === 117 && codePointAt(text, pos + 2) === 123) {
8345
8359
  var start_2 = pos;
8346
8360
  pos += 3;
8347
8361
  var escapedValueString = scanMinimumNumberOfHexDigits(1, false);
@@ -17276,6 +17290,32 @@ var ts;
17276
17290
  return parameter.kind === 343 ? (_a = parameter.typeExpression) === null || _a === void 0 ? void 0 : _a.type : parameter.type;
17277
17291
  }
17278
17292
  ts.getParameterTypeNode = getParameterTypeNode;
17293
+ function isTypeDeclaration(node) {
17294
+ switch (node.kind) {
17295
+ case 165:
17296
+ case 260:
17297
+ case 261:
17298
+ case 262:
17299
+ case 263:
17300
+ case 348:
17301
+ case 341:
17302
+ case 342:
17303
+ return true;
17304
+ case 270:
17305
+ return node.isTypeOnly;
17306
+ case 273:
17307
+ case 278:
17308
+ return node.parent.parent.isTypeOnly;
17309
+ default:
17310
+ return false;
17311
+ }
17312
+ }
17313
+ ts.isTypeDeclaration = isTypeDeclaration;
17314
+ function canHaveExportModifier(node) {
17315
+ return ts.isEnumDeclaration(node) || ts.isVariableStatement(node) || ts.isFunctionDeclaration(node) || ts.isClassDeclaration(node)
17316
+ || ts.isInterfaceDeclaration(node) || isTypeDeclaration(node) || (ts.isModuleDeclaration(node) && !isExternalModuleAugmentation(node) && !isGlobalScopeAugmentation(node));
17317
+ }
17318
+ ts.canHaveExportModifier = canHaveExportModifier;
17279
17319
  })(ts || (ts = {}));
17280
17320
  var ts;
17281
17321
  (function (ts) {
@@ -18476,7 +18516,7 @@ var ts;
18476
18516
  nextAutoGenerateId++;
18477
18517
  return node;
18478
18518
  }
18479
- function createIdentifier(text, typeArguments, originalKeywordKind) {
18519
+ function createIdentifier(text, typeArguments, originalKeywordKind, hasExtendedUnicodeEscape) {
18480
18520
  var node = createBaseIdentifier(text, originalKeywordKind);
18481
18521
  if (typeArguments) {
18482
18522
  node.typeArguments = createNodeArray(typeArguments);
@@ -18484,6 +18524,10 @@ var ts;
18484
18524
  if (node.originalKeywordKind === 133) {
18485
18525
  node.transformFlags |= 67108864;
18486
18526
  }
18527
+ if (hasExtendedUnicodeEscape) {
18528
+ node.hasExtendedUnicodeEscape = hasExtendedUnicodeEscape;
18529
+ node.transformFlags |= 1024;
18530
+ }
18487
18531
  return node;
18488
18532
  }
18489
18533
  function updateIdentifier(node, typeArguments) {
@@ -23160,7 +23204,7 @@ var ts;
23160
23204
  importName: "__generator",
23161
23205
  scoped: false,
23162
23206
  priority: 6,
23163
- text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };"
23207
+ text: "\n var __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n };"
23164
23208
  };
23165
23209
  ts.createBindingHelper = {
23166
23210
  name: "typescript:commonjscreatebinding",
@@ -26751,8 +26795,9 @@ var ts;
26751
26795
  var pos = getNodePos();
26752
26796
  var originalKeywordKind = token();
26753
26797
  var text = internIdentifier(scanner.getTokenValue());
26798
+ var hasExtendedUnicodeEscape = scanner.hasExtendedUnicodeEscape();
26754
26799
  nextTokenWithoutCheck();
26755
- return finishNode(factory.createIdentifier(text, undefined, originalKeywordKind), pos);
26800
+ return finishNode(factory.createIdentifier(text, undefined, originalKeywordKind, hasExtendedUnicodeEscape), pos);
26756
26801
  }
26757
26802
  if (token() === 80) {
26758
26803
  parseErrorAtCurrentToken(privateIdentifierDiagnosticMessage || ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
@@ -32724,9 +32769,6 @@ var ts;
32724
32769
  name: "listFilesOnly",
32725
32770
  type: "boolean",
32726
32771
  category: ts.Diagnostics.Command_line_Options,
32727
- affectsSemanticDiagnostics: true,
32728
- affectsEmit: true,
32729
- affectsMultiFileEmitBuildInfo: true,
32730
32772
  isCommandLineOnly: true,
32731
32773
  description: ts.Diagnostics.Print_names_of_files_that_are_part_of_the_compilation_and_then_stop_processing,
32732
32774
  defaultValueDescription: false,
@@ -34350,6 +34392,7 @@ var ts;
34350
34392
  return (__assign(__assign({}, prev), (_a = {}, _a[cur[0]] = cur[1], _a)));
34351
34393
  }, {}));
34352
34394
  }
34395
+ ts.optionMapToObject = optionMapToObject;
34353
34396
  function filterSameAsDefaultInclude(specs) {
34354
34397
  if (!ts.length(specs))
34355
34398
  return undefined;
@@ -34398,6 +34441,7 @@ var ts;
34398
34441
  function serializeCompilerOptions(options, pathOptions) {
34399
34442
  return serializeOptionBaseObject(options, getOptionsNameMap(), pathOptions);
34400
34443
  }
34444
+ ts.serializeCompilerOptions = serializeCompilerOptions;
34401
34445
  function serializeWatchOptions(options) {
34402
34446
  return serializeOptionBaseObject(options, getWatchOptionsNameMap());
34403
34447
  }
@@ -34480,12 +34524,22 @@ var ts;
34480
34524
  return !isCommandLineOnly && category !== undefined && (!categoriesToSkip.includes(category) || compilerOptionsMap.has(name));
34481
34525
  }
34482
34526
  function writeConfigurations() {
34483
- var categorizedOptions = ts.createMultiMap();
34527
+ var categorizedOptions = new ts.Map();
34528
+ categorizedOptions.set(ts.Diagnostics.Projects, []);
34529
+ categorizedOptions.set(ts.Diagnostics.Language_and_Environment, []);
34530
+ categorizedOptions.set(ts.Diagnostics.Modules, []);
34531
+ categorizedOptions.set(ts.Diagnostics.JavaScript_Support, []);
34532
+ categorizedOptions.set(ts.Diagnostics.Emit, []);
34533
+ categorizedOptions.set(ts.Diagnostics.Interop_Constraints, []);
34534
+ categorizedOptions.set(ts.Diagnostics.Type_Checking, []);
34535
+ categorizedOptions.set(ts.Diagnostics.Completeness, []);
34484
34536
  for (var _i = 0, optionDeclarations_1 = ts.optionDeclarations; _i < optionDeclarations_1.length; _i++) {
34485
34537
  var option = optionDeclarations_1[_i];
34486
- var category = option.category;
34487
34538
  if (isAllowedOptionForOutput(option)) {
34488
- categorizedOptions.add(ts.getLocaleSpecificMessage(category), option);
34539
+ var listForCategory = categorizedOptions.get(option.category);
34540
+ if (!listForCategory)
34541
+ categorizedOptions.set(option.category, listForCategory = []);
34542
+ listForCategory.push(option);
34489
34543
  }
34490
34544
  }
34491
34545
  var marginLength = 0;
@@ -34495,7 +34549,7 @@ var ts;
34495
34549
  if (entries.length !== 0) {
34496
34550
  entries.push({ value: "" });
34497
34551
  }
34498
- entries.push({ value: "/* ".concat(category, " */") });
34552
+ entries.push({ value: "/* ".concat(ts.getLocaleSpecificMessage(category), " */") });
34499
34553
  for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
34500
34554
  var option = options_1[_i];
34501
34555
  var optionName = void 0;
@@ -36224,6 +36278,9 @@ var ts;
36224
36278
  requestContainingDirectory: containingDirectory,
36225
36279
  reportDiagnostic: function (diag) { return void diagnostics.push(diag); },
36226
36280
  };
36281
+ if (traceEnabled && ts.getEmitModuleResolutionKind(compilerOptions) >= ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) <= ts.ModuleResolutionKind.NodeNext) {
36282
+ trace(host, ts.Diagnostics.Resolving_in_0_mode_with_conditions_1, features & NodeResolutionFeatures.EsmMode ? "ESM" : "CJS", conditions.map(function (c) { return "'".concat(c, "'"); }).join(", "));
36283
+ }
36227
36284
  var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
36228
36285
  return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, affectingLocations, diagnostics, state.resultFromCache);
36229
36286
  function tryResolve(extensions) {
@@ -36753,7 +36810,7 @@ var ts;
36753
36810
  }
36754
36811
  if (mainExport) {
36755
36812
  var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, subpath, scope, false);
36756
- return loadModuleFromTargetImportOrExport(mainExport, "", false);
36813
+ return loadModuleFromTargetImportOrExport(mainExport, "", false, ".");
36757
36814
  }
36758
36815
  }
36759
36816
  else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports)) {
@@ -36828,7 +36885,7 @@ var ts;
36828
36885
  var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
36829
36886
  if (!ts.endsWith(moduleName, ts.directorySeparator) && moduleName.indexOf("*") === -1 && ts.hasProperty(lookupTable, moduleName)) {
36830
36887
  var target = lookupTable[moduleName];
36831
- return loadModuleFromTargetImportOrExport(target, "", false);
36888
+ return loadModuleFromTargetImportOrExport(target, "", false, moduleName);
36832
36889
  }
36833
36890
  var expandingKeys = ts.sort(ts.filter(ts.getOwnKeys(lookupTable), function (k) { return k.indexOf("*") !== -1 || ts.endsWith(k, "/"); }), comparePatternKeys);
36834
36891
  for (var _i = 0, expandingKeys_1 = expandingKeys; _i < expandingKeys_1.length; _i++) {
@@ -36837,17 +36894,17 @@ var ts;
36837
36894
  var target = lookupTable[potentialTarget];
36838
36895
  var starPos = potentialTarget.indexOf("*");
36839
36896
  var subpath = moduleName.substring(potentialTarget.substring(0, starPos).length, moduleName.length - (potentialTarget.length - 1 - starPos));
36840
- return loadModuleFromTargetImportOrExport(target, subpath, true);
36897
+ return loadModuleFromTargetImportOrExport(target, subpath, true, potentialTarget);
36841
36898
  }
36842
36899
  else if (ts.endsWith(potentialTarget, "*") && ts.startsWith(moduleName, potentialTarget.substring(0, potentialTarget.length - 1))) {
36843
36900
  var target = lookupTable[potentialTarget];
36844
36901
  var subpath = moduleName.substring(potentialTarget.length - 1);
36845
- return loadModuleFromTargetImportOrExport(target, subpath, true);
36902
+ return loadModuleFromTargetImportOrExport(target, subpath, true, potentialTarget);
36846
36903
  }
36847
36904
  else if (ts.startsWith(moduleName, potentialTarget)) {
36848
36905
  var target = lookupTable[potentialTarget];
36849
36906
  var subpath = moduleName.substring(potentialTarget.length);
36850
- return loadModuleFromTargetImportOrExport(target, subpath, false);
36907
+ return loadModuleFromTargetImportOrExport(target, subpath, false, potentialTarget);
36851
36908
  }
36852
36909
  }
36853
36910
  function matchesPatternWithTrailer(target, name) {
@@ -36861,7 +36918,7 @@ var ts;
36861
36918
  }
36862
36919
  function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) {
36863
36920
  return loadModuleFromTargetImportOrExport;
36864
- function loadModuleFromTargetImportOrExport(target, subpath, pattern) {
36921
+ function loadModuleFromTargetImportOrExport(target, subpath, pattern, key) {
36865
36922
  if (typeof target === "string") {
36866
36923
  if (!pattern && subpath.length > 0 && !ts.endsWith(target, "/")) {
36867
36924
  if (state.traceEnabled) {
@@ -36872,6 +36929,8 @@ var ts;
36872
36929
  if (!ts.startsWith(target, "./")) {
36873
36930
  if (isImports && !ts.startsWith(target, "../") && !ts.startsWith(target, "/") && !ts.isRootedDiskPath(target)) {
36874
36931
  var combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath;
36932
+ traceIfEnabled(state, ts.Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
36933
+ traceIfEnabled(state, ts.Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
36875
36934
  var result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, [extensions], redirectedReference);
36876
36935
  return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : undefined);
36877
36936
  }
@@ -36896,6 +36955,9 @@ var ts;
36896
36955
  }
36897
36956
  return toSearchResult(undefined);
36898
36957
  }
36958
+ if (state.traceEnabled) {
36959
+ trace(state.host, ts.Diagnostics.Using_0_subpath_1_with_target_2, isImports ? "imports" : "exports", key, pattern ? target.replace(/\*/g, subpath) : target + subpath);
36960
+ }
36899
36961
  var finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath);
36900
36962
  var inputLink = tryLoadInputFileForPath(finalPath, subpath, ts.combinePaths(scope.packageDirectory, "package.json"), isImports);
36901
36963
  if (inputLink)
@@ -36905,14 +36967,18 @@ var ts;
36905
36967
  else if (typeof target === "object" && target !== null) {
36906
36968
  if (!Array.isArray(target)) {
36907
36969
  for (var _i = 0, _a = ts.getOwnKeys(target); _i < _a.length; _i++) {
36908
- var key = _a[_i];
36909
- if (key === "default" || state.conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(state.conditions, key)) {
36910
- var subTarget = target[key];
36911
- var result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern);
36970
+ var condition = _a[_i];
36971
+ if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) {
36972
+ traceIfEnabled(state, ts.Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
36973
+ var subTarget = target[condition];
36974
+ var result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
36912
36975
  if (result) {
36913
36976
  return result;
36914
36977
  }
36915
36978
  }
36979
+ else {
36980
+ traceIfEnabled(state, ts.Diagnostics.Saw_non_matching_condition_0, condition);
36981
+ }
36916
36982
  }
36917
36983
  return undefined;
36918
36984
  }
@@ -36925,7 +36991,7 @@ var ts;
36925
36991
  }
36926
36992
  for (var _b = 0, target_2 = target; _b < target_2.length; _b++) {
36927
36993
  var elem = target_2[_b];
36928
- var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern);
36994
+ var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern, key);
36929
36995
  if (result) {
36930
36996
  return result;
36931
36997
  }
@@ -37276,6 +37342,15 @@ var ts;
37276
37342
  function toSearchResult(value) {
37277
37343
  return value !== undefined ? { value: value } : undefined;
37278
37344
  }
37345
+ function traceIfEnabled(state, diagnostic) {
37346
+ var args = [];
37347
+ for (var _i = 2; _i < arguments.length; _i++) {
37348
+ args[_i - 2] = arguments[_i];
37349
+ }
37350
+ if (state.traceEnabled) {
37351
+ trace.apply(void 0, __spreadArray([state.host, diagnostic], args, false));
37352
+ }
37353
+ }
37279
37354
  })(ts || (ts = {}));
37280
37355
  var ts;
37281
37356
  (function (ts) {
@@ -40580,6 +40655,12 @@ var ts;
40580
40655
  getOptionalType: function () { return optionalType; },
40581
40656
  getPromiseType: function () { return getGlobalPromiseType(false); },
40582
40657
  getPromiseLikeType: function () { return getGlobalPromiseLikeType(false); },
40658
+ getAsyncIterableType: function () {
40659
+ var type = getGlobalAsyncIterableType(false);
40660
+ if (type === emptyGenericType)
40661
+ return undefined;
40662
+ return type;
40663
+ },
40583
40664
  isSymbolAccessible: isSymbolAccessible,
40584
40665
  isArrayType: isArrayType,
40585
40666
  isTupleType: isTupleType,
@@ -41366,8 +41447,8 @@ var ts;
41366
41447
  return symbol;
41367
41448
  }
41368
41449
  if (symbol.flags & 2097152) {
41369
- var target = resolveAlias(symbol);
41370
- if (target === unknownSymbol || target.flags & meaning) {
41450
+ var targetFlags = getAllSymbolFlags(symbol);
41451
+ if (targetFlags & meaning) {
41371
41452
  return symbol;
41372
41453
  }
41373
41454
  }
@@ -41857,8 +41938,8 @@ var ts;
41857
41938
  !checkAndReportErrorForExtendingInterface(errorLocation) &&
41858
41939
  !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) &&
41859
41940
  !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) &&
41941
+ !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) &&
41860
41942
  !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) &&
41861
- !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
41862
41943
  !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
41863
41944
  var suggestion = void 0;
41864
41945
  var suggestedLib = void 0;
@@ -41926,7 +42007,7 @@ var ts;
41926
42007
  }
41927
42008
  }
41928
42009
  if (result && errorLocation && meaning & 111551 && result.flags & 2097152 && !(result.flags & 111551) && !ts.isValidTypeOnlyAliasUseSite(errorLocation)) {
41929
- var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result);
42010
+ var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551);
41930
42011
  if (typeOnlyDeclaration) {
41931
42012
  var message = typeOnlyDeclaration.kind === 278
41932
42013
  ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
@@ -42079,7 +42160,7 @@ var ts;
42079
42160
  return false;
42080
42161
  }
42081
42162
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
42082
- if (meaning & (111551 & ~1024)) {
42163
+ if (meaning & 111551) {
42083
42164
  if (isPrimitiveTypeName(name)) {
42084
42165
  if (isExtendedByInterface(errorLocation)) {
42085
42166
  error(errorLocation, ts.Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes, ts.unescapeLeadingUnderscores(name));
@@ -42090,7 +42171,8 @@ var ts;
42090
42171
  return true;
42091
42172
  }
42092
42173
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 & ~111551, undefined, undefined, false));
42093
- if (symbol && !(symbol.flags & 1024)) {
42174
+ var allFlags = symbol && getAllSymbolFlags(symbol);
42175
+ if (symbol && allFlags !== undefined && !(allFlags & 111551)) {
42094
42176
  var rawName = ts.unescapeLeadingUnderscores(name);
42095
42177
  if (isES2015OrLaterConstructorName(name)) {
42096
42178
  error(errorLocation, ts.Diagnostics._0_only_refers_to_a_type_but_is_being_used_as_a_value_here_Do_you_need_to_change_your_target_library_Try_changing_the_lib_compiler_option_to_es2015_or_later, rawName);
@@ -42138,16 +42220,16 @@ var ts;
42138
42220
  }
42139
42221
  return false;
42140
42222
  }
42141
- function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) {
42142
- if (meaning & (111551 & ~1024 & ~788968)) {
42143
- var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~111551, undefined, undefined, false));
42223
+ function checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) {
42224
+ if (meaning & (111551 & ~788968)) {
42225
+ var symbol = resolveSymbol(resolveName(errorLocation, name, 1024, undefined, undefined, false));
42144
42226
  if (symbol) {
42145
42227
  error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, ts.unescapeLeadingUnderscores(name));
42146
42228
  return true;
42147
42229
  }
42148
42230
  }
42149
- else if (meaning & (788968 & ~1024 & ~111551)) {
42150
- var symbol = resolveSymbol(resolveName(errorLocation, name, (512 | 1024) & ~788968, undefined, undefined, false));
42231
+ else if (meaning & (788968 & ~111551)) {
42232
+ var symbol = resolveSymbol(resolveName(errorLocation, name, 1536, undefined, undefined, false));
42151
42233
  if (symbol) {
42152
42234
  error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, ts.unescapeLeadingUnderscores(name));
42153
42235
  return true;
@@ -42678,6 +42760,30 @@ var ts;
42678
42760
  }
42679
42761
  return undefined;
42680
42762
  }
42763
+ function getAllSymbolFlags(symbol) {
42764
+ var flags = symbol.flags;
42765
+ var seenSymbols;
42766
+ while (symbol.flags & 2097152) {
42767
+ var target = resolveAlias(symbol);
42768
+ if (target === unknownSymbol) {
42769
+ return 67108863;
42770
+ }
42771
+ if (target === symbol || (seenSymbols === null || seenSymbols === void 0 ? void 0 : seenSymbols.has(target))) {
42772
+ break;
42773
+ }
42774
+ if (target.flags & 2097152) {
42775
+ if (seenSymbols) {
42776
+ seenSymbols.add(target);
42777
+ }
42778
+ else {
42779
+ seenSymbols = new ts.Set([symbol, target]);
42780
+ }
42781
+ }
42782
+ flags |= target.flags;
42783
+ symbol = target;
42784
+ }
42785
+ return flags;
42786
+ }
42681
42787
  function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {
42682
42788
  if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration))
42683
42789
  return false;
@@ -42700,19 +42806,25 @@ var ts;
42700
42806
  }
42701
42807
  return !!aliasDeclarationLinks.typeOnlyDeclaration;
42702
42808
  }
42703
- function getTypeOnlyAliasDeclaration(symbol) {
42809
+ function getTypeOnlyAliasDeclaration(symbol, include) {
42704
42810
  if (!(symbol.flags & 2097152)) {
42705
42811
  return undefined;
42706
42812
  }
42707
42813
  var links = getSymbolLinks(symbol);
42708
- return links.typeOnlyDeclaration || undefined;
42814
+ if (include === undefined) {
42815
+ return links.typeOnlyDeclaration || undefined;
42816
+ }
42817
+ if (links.typeOnlyDeclaration) {
42818
+ return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : undefined;
42819
+ }
42820
+ return undefined;
42709
42821
  }
42710
42822
  function markExportAsReferenced(node) {
42711
42823
  var symbol = getSymbolOfNode(node);
42712
42824
  var target = resolveAlias(symbol);
42713
42825
  if (target) {
42714
42826
  var markAlias = target === unknownSymbol ||
42715
- ((target.flags & 111551) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol));
42827
+ ((getAllSymbolFlags(target) & 111551) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol, 111551));
42716
42828
  if (markAlias) {
42717
42829
  markAliasSymbolAsReferenced(symbol);
42718
42830
  }
@@ -42726,8 +42838,7 @@ var ts;
42726
42838
  if (!node)
42727
42839
  return ts.Debug.fail();
42728
42840
  if (ts.isInternalModuleImportEqualsDeclaration(node)) {
42729
- var target = resolveSymbol(symbol);
42730
- if (target === unknownSymbol || target.flags & 111551) {
42841
+ if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551) {
42731
42842
  checkExpressionCached(node.moduleReference);
42732
42843
  }
42733
42844
  }
@@ -43457,7 +43568,7 @@ var ts;
43457
43568
  }
43458
43569
  function symbolIsValue(symbol, includeTypeOnlyMembers) {
43459
43570
  return !!(symbol.flags & 111551 ||
43460
- symbol.flags & 2097152 && resolveAlias(symbol).flags & 111551 && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
43571
+ symbol.flags & 2097152 && getAllSymbolFlags(symbol) & 111551 && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
43461
43572
  }
43462
43573
  function findConstructorDeclaration(node) {
43463
43574
  var members = node.members;
@@ -43684,8 +43795,10 @@ var ts;
43684
43795
  if (symbolFromSymbolTable === symbol) {
43685
43796
  return true;
43686
43797
  }
43687
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 278)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
43688
- if (symbolFromSymbolTable.flags & meaning) {
43798
+ var shouldResolveAlias = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 278));
43799
+ symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
43800
+ var flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
43801
+ if (flags & meaning) {
43689
43802
  qualify = true;
43690
43803
  return true;
43691
43804
  }
@@ -45791,7 +45904,7 @@ var ts;
45791
45904
  if (!e.propertyName) {
45792
45905
  var indices = ts.indicesOf(statements);
45793
45906
  var associatedIndices = ts.filter(indices, function (i) { return ts.nodeHasName(statements[i], e.name); });
45794
- if (ts.length(associatedIndices) && ts.every(associatedIndices, function (i) { return canHaveExportModifier(statements[i]); })) {
45907
+ if (ts.length(associatedIndices) && ts.every(associatedIndices, function (i) { return ts.canHaveExportModifier(statements[i]); })) {
45795
45908
  for (var _i = 0, associatedIndices_1 = associatedIndices; _i < associatedIndices_1.length; _i++) {
45796
45909
  var index_1 = associatedIndices_1[_i];
45797
45910
  statements[index_1] = addExportModifier(statements[index_1]);
@@ -45821,15 +45934,6 @@ var ts;
45821
45934
  }
45822
45935
  return statements;
45823
45936
  }
45824
- function canHaveExportModifier(node) {
45825
- return ts.isEnumDeclaration(node) ||
45826
- ts.isVariableStatement(node) ||
45827
- ts.isFunctionDeclaration(node) ||
45828
- ts.isClassDeclaration(node) ||
45829
- (ts.isModuleDeclaration(node) && !ts.isExternalModuleAugmentation(node) && !ts.isGlobalScopeAugmentation(node)) ||
45830
- ts.isInterfaceDeclaration(node) ||
45831
- isTypeDeclaration(node);
45832
- }
45833
45937
  function addExportModifier(node) {
45834
45938
  var flags = (ts.getEffectiveModifierFlags(node) | 1) & ~2;
45835
45939
  return ts.factory.updateModifiers(node, flags);
@@ -46014,7 +46118,7 @@ var ts;
46014
46118
  (ts.isJSDocTypeAlias(context.enclosingDeclaration) ? ts.getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
46015
46119
  if (additionalModifierFlags & 1 &&
46016
46120
  enclosingDeclaration_1 && (isExportingScope(enclosingDeclaration_1) || ts.isModuleDeclaration(enclosingDeclaration_1)) &&
46017
- canHaveExportModifier(node)) {
46121
+ ts.canHaveExportModifier(node)) {
46018
46122
  newModifierFlags |= 1;
46019
46123
  }
46020
46124
  if (addingDeclare && !(newModifierFlags & 1) &&
@@ -46067,7 +46171,7 @@ var ts;
46067
46171
  return !symbol.exports ? [] : ts.filter(ts.arrayFrom(symbol.exports.values()), isNamespaceMember);
46068
46172
  }
46069
46173
  function isTypeOnlyNamespace(symbol) {
46070
- return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(resolveSymbol(m).flags & 111551); });
46174
+ return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(getAllSymbolFlags(resolveSymbol(m)) & 111551); });
46071
46175
  }
46072
46176
  function serializeModule(symbol, symbolName, modifierFlags) {
46073
46177
  var members = getNamespaceMembersForSerialization(symbol);
@@ -47659,13 +47763,27 @@ var ts;
47659
47763
  return getTypeFromTypeNode(typeNode);
47660
47764
  }
47661
47765
  }
47766
+ function isParameterOfContextSensitiveSignature(symbol) {
47767
+ var decl = symbol.valueDeclaration;
47768
+ if (!decl) {
47769
+ return false;
47770
+ }
47771
+ if (ts.isBindingElement(decl)) {
47772
+ decl = ts.walkUpBindingElementsAndPatterns(decl);
47773
+ }
47774
+ if (ts.isParameter(decl)) {
47775
+ return isContextSensitiveFunctionOrObjectLiteralMethod(decl.parent);
47776
+ }
47777
+ return false;
47778
+ }
47662
47779
  function getTypeOfVariableOrParameterOrProperty(symbol) {
47663
47780
  var links = getSymbolLinks(symbol);
47664
47781
  if (!links.type) {
47665
47782
  var type = getTypeOfVariableOrParameterOrPropertyWorker(symbol);
47666
- if (!links.type) {
47783
+ if (!links.type && !isParameterOfContextSensitiveSignature(symbol)) {
47667
47784
  links.type = type;
47668
47785
  }
47786
+ return type;
47669
47787
  }
47670
47788
  return links.type;
47671
47789
  }
@@ -47940,7 +48058,7 @@ var ts;
47940
48058
  links.type = (exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol)
47941
48059
  : isDuplicatedCommonJSExport(symbol.declarations) ? autoType
47942
48060
  : declaredType ? declaredType
47943
- : targetSymbol.flags & 111551 ? getTypeOfSymbol(targetSymbol)
48061
+ : getAllSymbolFlags(targetSymbol) & 111551 ? getTypeOfSymbol(targetSymbol)
47944
48062
  : errorType;
47945
48063
  }
47946
48064
  return links.type;
@@ -49575,7 +49693,17 @@ var ts;
49575
49693
  return !!(ts.getObjectFlags(type) & 32 && getMappedTypeModifiers(type) & 4);
49576
49694
  }
49577
49695
  function isGenericMappedType(type) {
49578
- return !!(ts.getObjectFlags(type) & 32) && isGenericIndexType(getConstraintTypeFromMappedType(type));
49696
+ if (ts.getObjectFlags(type) & 32) {
49697
+ var constraint = getConstraintTypeFromMappedType(type);
49698
+ if (isGenericIndexType(constraint)) {
49699
+ return true;
49700
+ }
49701
+ var nameType = getNameTypeFromMappedType(type);
49702
+ if (nameType && isGenericIndexType(instantiateType(nameType, makeUnaryTypeMapper(getTypeParameterFromMappedType(type), constraint)))) {
49703
+ return true;
49704
+ }
49705
+ }
49706
+ return false;
49579
49707
  }
49580
49708
  function resolveStructuredTypeMembers(type) {
49581
49709
  if (!type.members) {
@@ -49974,7 +50102,7 @@ var ts;
49974
50102
  var propSet;
49975
50103
  var indexTypes;
49976
50104
  var isUnion = containingType.flags & 1048576;
49977
- var optionalFlag = isUnion ? 0 : 16777216;
50105
+ var optionalFlag;
49978
50106
  var syntheticFlag = 4;
49979
50107
  var checkFlags = isUnion ? 0 : 8;
49980
50108
  var mergedInstantiations = false;
@@ -49985,11 +50113,14 @@ var ts;
49985
50113
  var prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);
49986
50114
  var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
49987
50115
  if (prop) {
49988
- if (isUnion) {
49989
- optionalFlag |= (prop.flags & 16777216);
49990
- }
49991
- else {
49992
- optionalFlag &= prop.flags;
50116
+ if (prop.flags & 106500) {
50117
+ optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : (optionalFlag = isUnion ? 0 : 16777216);
50118
+ if (isUnion) {
50119
+ optionalFlag |= (prop.flags & 16777216);
50120
+ }
50121
+ else {
50122
+ optionalFlag &= prop.flags;
50123
+ }
49993
50124
  }
49994
50125
  if (!singleProp) {
49995
50126
  singleProp = prop;
@@ -50097,7 +50228,7 @@ var ts;
50097
50228
  propTypes.push(type);
50098
50229
  }
50099
50230
  ts.addRange(propTypes, indexTypes);
50100
- var result = createSymbol(4 | optionalFlag, name, syntheticFlag | checkFlags);
50231
+ var result = createSymbol(4 | (optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : 0), name, syntheticFlag | checkFlags);
50101
50232
  result.containingType = containingType;
50102
50233
  if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
50103
50234
  result.valueDeclaration = firstValueDeclaration;
@@ -52505,8 +52636,13 @@ var ts;
52505
52636
  return getStringLiteralType(text);
52506
52637
  }
52507
52638
  newTexts.push(text);
52508
- if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4); })) {
52509
- return stringType;
52639
+ if (ts.every(newTexts, function (t) { return t === ""; })) {
52640
+ if (ts.every(newTypes, function (t) { return !!(t.flags & 4); })) {
52641
+ return stringType;
52642
+ }
52643
+ if (newTypes.length === 1 && isPatternLiteralType(newTypes[0])) {
52644
+ return newTypes[0];
52645
+ }
52510
52646
  }
52511
52647
  var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
52512
52648
  var type = templateLiteralTypes.get(id);
@@ -52565,11 +52701,12 @@ var ts;
52565
52701
  }
52566
52702
  function getStringMappingType(symbol, type) {
52567
52703
  return type.flags & (1048576 | 131072) ? mapType(type, function (t) { return getStringMappingType(symbol, t); }) :
52568
- type.flags & 268435456 && symbol === type.symbol ? type :
52569
- isGenericIndexType(type) || isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, isPatternLiteralPlaceholderType(type) && !(type.flags & 268435456) ? getTemplateLiteralType(["", ""], [type]) : type) :
52570
- type.flags & 128 ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
52571
- type.flags & 134217728 ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
52572
- type;
52704
+ type.flags & 128 ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
52705
+ type.flags & 134217728 ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
52706
+ type.flags & 268435456 && symbol === type.symbol ? type :
52707
+ type.flags & (1 | 4 | 268435456) || isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
52708
+ isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, getTemplateLiteralType(["", ""], [type])) :
52709
+ type;
52573
52710
  }
52574
52711
  function applyStringMapping(symbol, str) {
52575
52712
  switch (intrinsicTypeKinds.get(symbol.escapedName)) {
@@ -52722,7 +52859,15 @@ var ts;
52722
52859
  return accessFlags & 1 ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
52723
52860
  }
52724
52861
  errorIfWritingToReadonlyIndex(indexInfo);
52725
- return accessFlags & 1 ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
52862
+ if ((accessFlags & 1) &&
52863
+ !(objectType.symbol &&
52864
+ objectType.symbol.flags & (256 | 128) &&
52865
+ (indexType.symbol &&
52866
+ indexType.flags & 1024 &&
52867
+ getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
52868
+ return getUnionType([indexInfo.type, undefinedType]);
52869
+ }
52870
+ return indexInfo.type;
52726
52871
  }
52727
52872
  if (indexType.flags & 131072) {
52728
52873
  return neverType;
@@ -52825,10 +52970,11 @@ var ts;
52825
52970
  accessNode;
52826
52971
  }
52827
52972
  function isPatternLiteralPlaceholderType(type) {
52828
- return !!(type.flags & (1 | 4 | 8 | 64)) || !!(type.flags & 268435456 && isPatternLiteralPlaceholderType(type.type));
52973
+ return !!(type.flags & (1 | 4 | 8 | 64)) || isPatternLiteralType(type);
52829
52974
  }
52830
52975
  function isPatternLiteralType(type) {
52831
- return !!(type.flags & 134217728) && ts.every(type.types, isPatternLiteralPlaceholderType);
52976
+ return !!(type.flags & 134217728) && ts.every(type.types, isPatternLiteralPlaceholderType) ||
52977
+ !!(type.flags & 268435456) && isPatternLiteralPlaceholderType(type.type);
52832
52978
  }
52833
52979
  function isGenericType(type) {
52834
52980
  return !!getGenericObjectFlags(type);
@@ -53056,18 +53202,18 @@ var ts;
53056
53202
  var result;
53057
53203
  var extraTypes;
53058
53204
  var tailCount = 0;
53059
- var _loop_20 = function () {
53205
+ while (true) {
53060
53206
  if (tailCount === 1000) {
53061
53207
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
53062
53208
  result = errorType;
53063
- return "break";
53209
+ break;
53064
53210
  }
53065
53211
  var isUnwrapped = isTypicalNondistributiveConditional(root);
53066
53212
  var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
53067
53213
  var checkTypeInstantiable = isGenericType(checkType);
53068
53214
  var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
53069
53215
  if (checkType === wildcardType || extendsType === wildcardType) {
53070
- return { value: wildcardType };
53216
+ return wildcardType;
53071
53217
  }
53072
53218
  var combinedMapper = void 0;
53073
53219
  if (root.inferTypeParameters) {
@@ -53083,7 +53229,7 @@ var ts;
53083
53229
  }
53084
53230
  }
53085
53231
  }
53086
- if (!checkTypeInstantiable || !ts.some(root.inferTypeParameters, function (t) { return t === extendsType; })) {
53232
+ if (!checkTypeInstantiable) {
53087
53233
  inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 | 1024);
53088
53234
  }
53089
53235
  var innerMapper = combineTypeMappers(freshMapper, context.mapper);
@@ -53100,23 +53246,23 @@ var ts;
53100
53246
  var newRoot = falseType_1.root;
53101
53247
  if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {
53102
53248
  root = newRoot;
53103
- return "continue";
53249
+ continue;
53104
53250
  }
53105
53251
  if (canTailRecurse(falseType_1, mapper)) {
53106
- return "continue";
53252
+ continue;
53107
53253
  }
53108
53254
  }
53109
53255
  result = instantiateType(falseType_1, mapper);
53110
- return "break";
53256
+ break;
53111
53257
  }
53112
53258
  if (inferredExtendsType.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
53113
53259
  var trueType_1 = getTypeFromTypeNode(root.node.trueType);
53114
53260
  var trueMapper = combinedMapper || mapper;
53115
53261
  if (canTailRecurse(trueType_1, trueMapper)) {
53116
- return "continue";
53262
+ continue;
53117
53263
  }
53118
53264
  result = instantiateType(trueType_1, trueMapper);
53119
- return "break";
53265
+ break;
53120
53266
  }
53121
53267
  }
53122
53268
  result = createType(16777216);
@@ -53127,14 +53273,7 @@ var ts;
53127
53273
  result.combinedMapper = combinedMapper;
53128
53274
  result.aliasSymbol = aliasSymbol || root.aliasSymbol;
53129
53275
  result.aliasTypeArguments = aliasSymbol ? aliasTypeArguments : instantiateTypes(root.aliasTypeArguments, mapper);
53130
- return "break";
53131
- };
53132
- while (true) {
53133
- var state_6 = _loop_20();
53134
- if (typeof state_6 === "object")
53135
- return state_6.value;
53136
- if (state_6 === "break")
53137
- break;
53276
+ break;
53138
53277
  }
53139
53278
  return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
53140
53279
  function canTailRecurse(newType, newMapper) {
@@ -55350,7 +55489,7 @@ var ts;
55350
55489
  return 0;
55351
55490
  }
55352
55491
  }
55353
- var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576) && isLiteralType(source)) &&
55492
+ var isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source)) &&
55354
55493
  !(intersectionState & 2) &&
55355
55494
  source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
55356
55495
  target.flags & (524288 | 2097152) && isWeakType(target) &&
@@ -55378,12 +55517,6 @@ var ts;
55378
55517
  var result_7 = skipCaching ?
55379
55518
  unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
55380
55519
  recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
55381
- if (result_7 && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
55382
- isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144); }))) {
55383
- inPropertyCheck = true;
55384
- result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
55385
- inPropertyCheck = false;
55386
- }
55387
55520
  if (result_7) {
55388
55521
  return result_7;
55389
55522
  }
@@ -55492,7 +55625,7 @@ var ts;
55492
55625
  reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
55493
55626
  checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
55494
55627
  }
55495
- var _loop_21 = function (prop) {
55628
+ var _loop_20 = function (prop) {
55496
55629
  if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
55497
55630
  if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
55498
55631
  if (reportErrors) {
@@ -55545,9 +55678,9 @@ var ts;
55545
55678
  };
55546
55679
  for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
55547
55680
  var prop = _b[_i];
55548
- var state_7 = _loop_21(prop);
55549
- if (typeof state_7 === "object")
55550
- return state_7.value;
55681
+ var state_6 = _loop_20(prop);
55682
+ if (typeof state_6 === "object")
55683
+ return state_6.value;
55551
55684
  }
55552
55685
  return false;
55553
55686
  }
@@ -55727,8 +55860,7 @@ var ts;
55727
55860
  if (overflow) {
55728
55861
  return 0;
55729
55862
  }
55730
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 : 0);
55731
- var id = getRelationKey(source, target, keyIntersectionState, relation, false);
55863
+ var id = getRelationKey(source, target, intersectionState, relation, false);
55732
55864
  var entry = relation.get(id);
55733
55865
  if (entry !== undefined) {
55734
55866
  if (reportErrors && entry & 2 && !(entry & 4)) {
@@ -55752,7 +55884,7 @@ var ts;
55752
55884
  targetStack = [];
55753
55885
  }
55754
55886
  else {
55755
- var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, true) : undefined;
55887
+ var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, intersectionState, relation, true) : undefined;
55756
55888
  for (var i = 0; i < maybeCount; i++) {
55757
55889
  if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
55758
55890
  return 3;
@@ -55834,10 +55966,18 @@ var ts;
55834
55966
  function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
55835
55967
  var saveErrorInfo = captureErrorCalculationState();
55836
55968
  var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState, saveErrorInfo);
55837
- if (!result && (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576)) {
55838
- var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
55839
- if (constraint && !(constraint.flags & 131072) && everyType(constraint, function (c) { return c !== source; })) {
55840
- result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState);
55969
+ if (relation !== identityRelation) {
55970
+ if (!result && (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576)) {
55971
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
55972
+ if (constraint && everyType(constraint, function (c) { return c !== source; })) {
55973
+ result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState);
55974
+ }
55975
+ }
55976
+ if (result && !inPropertyCheck && (target.flags & 2097152 && !isGenericObjectType(target) && source.flags & (524288 | 2097152) ||
55977
+ isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144); }))) {
55978
+ inPropertyCheck = true;
55979
+ result &= propertiesRelatedTo(source, target, reportErrors, undefined, 0);
55980
+ inPropertyCheck = false;
55841
55981
  }
55842
55982
  }
55843
55983
  if (result) {
@@ -55846,9 +55986,6 @@ var ts;
55846
55986
  return result;
55847
55987
  }
55848
55988
  function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState, saveErrorInfo) {
55849
- if (intersectionState & 4) {
55850
- return propertiesRelatedTo(source, target, reportErrors, undefined, 0);
55851
- }
55852
55989
  var result;
55853
55990
  var originalErrorInfo;
55854
55991
  var varianceCheckFailed = false;
@@ -55934,7 +56071,7 @@ var ts;
55934
56071
  if (relation === comparableRelation && sourceFlags & 262144) {
55935
56072
  var constraint = getConstraintOfTypeParameter(source);
55936
56073
  if (constraint && hasNonCircularBaseConstraint(source)) {
55937
- while (constraint && constraint.flags & 262144) {
56074
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144); })) {
55938
56075
  if (result = isRelatedTo(constraint, target, 1, false)) {
55939
56076
  return result;
55940
56077
  }
@@ -56324,11 +56461,11 @@ var ts;
56324
56461
  }
56325
56462
  var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
56326
56463
  var matchingTypes = [];
56327
- var _loop_22 = function (combination) {
56464
+ var _loop_21 = function (combination) {
56328
56465
  var hasMatch = false;
56329
56466
  outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
56330
56467
  var type = _d[_c];
56331
- var _loop_23 = function (i) {
56468
+ var _loop_22 = function (i) {
56332
56469
  var sourceProperty = sourcePropertiesFiltered[i];
56333
56470
  var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
56334
56471
  if (!targetProperty)
@@ -56341,8 +56478,8 @@ var ts;
56341
56478
  }
56342
56479
  };
56343
56480
  for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
56344
- var state_9 = _loop_23(i);
56345
- switch (state_9) {
56481
+ var state_8 = _loop_22(i);
56482
+ switch (state_8) {
56346
56483
  case "continue-outer": continue outer;
56347
56484
  }
56348
56485
  }
@@ -56355,9 +56492,9 @@ var ts;
56355
56492
  };
56356
56493
  for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
56357
56494
  var combination = discriminantCombinations_1[_a];
56358
- var state_8 = _loop_22(combination);
56359
- if (typeof state_8 === "object")
56360
- return state_8.value;
56495
+ var state_7 = _loop_21(combination);
56496
+ if (typeof state_7 === "object")
56497
+ return state_7.value;
56361
56498
  }
56362
56499
  var result = -1;
56363
56500
  for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
@@ -56441,7 +56578,7 @@ var ts;
56441
56578
  }
56442
56579
  return 0;
56443
56580
  }
56444
- if (!skipOptional && sourceProp.flags & 16777216 && !(targetProp.flags & 16777216)) {
56581
+ if (!skipOptional && sourceProp.flags & 16777216 && targetProp.flags & 106500 && !(targetProp.flags & 16777216)) {
56445
56582
  if (reportErrors) {
56446
56583
  reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target));
56447
56584
  }
@@ -56999,7 +57136,7 @@ var ts;
56999
57136
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
57000
57137
  links.variances = ts.emptyArray;
57001
57138
  var variances = [];
57002
- var _loop_24 = function (tp) {
57139
+ var _loop_23 = function (tp) {
57003
57140
  var modifiers = getVarianceModifiers(tp);
57004
57141
  var variance = modifiers & 65536 ?
57005
57142
  modifiers & 32768 ? 0 : 1 :
@@ -57030,7 +57167,7 @@ var ts;
57030
57167
  };
57031
57168
  for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
57032
57169
  var tp = typeParameters_2[_i];
57033
- _loop_24(tp);
57170
+ _loop_23(tp);
57034
57171
  }
57035
57172
  links.variances = variances;
57036
57173
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
@@ -57412,8 +57549,7 @@ var ts;
57412
57549
  return !!(type.flags & 109440);
57413
57550
  }
57414
57551
  function isUnitLikeType(type) {
57415
- return type.flags & 2097152 ? ts.some(type.types, isUnitType) :
57416
- !!(type.flags & 109440);
57552
+ return isUnitType(getBaseConstraintOrType(type));
57417
57553
  }
57418
57554
  function extractUnitType(type) {
57419
57555
  return type.flags & 2097152 ? ts.find(type.types, isUnitType) || type : type;
@@ -58178,7 +58314,7 @@ var ts;
58178
58314
  && (!roundTripOnly || s === ts.pseudoBigIntToString({ negative: negative, base10Value: ts.parsePseudoBigInt(scanner.getTokenValue()) }));
58179
58315
  }
58180
58316
  function isMemberOfStringMapping(source, target) {
58181
- if (target.flags & (4 | 3)) {
58317
+ if (target.flags & (4 | 1)) {
58182
58318
  return true;
58183
58319
  }
58184
58320
  if (target.flags & 134217728) {
@@ -58675,7 +58811,7 @@ var ts;
58675
58811
  var matches = inferTypesFromTemplateLiteralType(source, target);
58676
58812
  var types = target.types;
58677
58813
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
58678
- var _loop_25 = function (i) {
58814
+ var _loop_24 = function (i) {
58679
58815
  var source_1 = matches ? matches[i] : neverType;
58680
58816
  var target_3 = types[i];
58681
58817
  if (source_1.flags & 128 && target_3.flags & 8650752) {
@@ -58719,7 +58855,7 @@ var ts;
58719
58855
  inferFromTypes(source_1, target_3);
58720
58856
  };
58721
58857
  for (var i = 0; i < types.length; i++) {
58722
- _loop_25(i);
58858
+ _loop_24(i);
58723
58859
  }
58724
58860
  }
58725
58861
  }
@@ -59126,7 +59262,7 @@ var ts;
59126
59262
  }
59127
59263
  if (ts.isEntityNameExpression(node.argumentExpression)) {
59128
59264
  var symbol = resolveEntityName(node.argumentExpression, 111551, true);
59129
- if (!symbol || !isConstVariable(symbol))
59265
+ if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8)))
59130
59266
  return undefined;
59131
59267
  var declaration = symbol.valueDeclaration;
59132
59268
  if (declaration === undefined)
@@ -59140,7 +59276,12 @@ var ts;
59140
59276
  }
59141
59277
  if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
59142
59278
  var initializer = ts.getEffectiveInitializer(declaration);
59143
- return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
59279
+ if (initializer) {
59280
+ return tryGetNameFromType(getTypeOfExpression(initializer));
59281
+ }
59282
+ if (ts.isEnumMember(declaration)) {
59283
+ return ts.getTextOfPropertyName(declaration.name);
59284
+ }
59144
59285
  }
59145
59286
  }
59146
59287
  return undefined;
@@ -59194,7 +59335,7 @@ var ts;
59194
59335
  function mapTypesByKeyProperty(types, name) {
59195
59336
  var map = new ts.Map();
59196
59337
  var count = 0;
59197
- var _loop_26 = function (type) {
59338
+ var _loop_25 = function (type) {
59198
59339
  if (type.flags & (524288 | 2097152 | 58982400)) {
59199
59340
  var discriminant = getTypeOfPropertyOfType(type, name);
59200
59341
  if (discriminant) {
@@ -59220,9 +59361,9 @@ var ts;
59220
59361
  };
59221
59362
  for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
59222
59363
  var type = types_15[_i];
59223
- var state_10 = _loop_26(type);
59224
- if (typeof state_10 === "object")
59225
- return state_10.value;
59364
+ var state_9 = _loop_25(type);
59365
+ if (typeof state_9 === "object")
59366
+ return state_9.value;
59226
59367
  }
59227
59368
  return count >= 10 && count * 2 >= types.length ? map : undefined;
59228
59369
  }
@@ -59770,6 +59911,7 @@ var ts;
59770
59911
  ts.isInJSFile(node) && ts.hasInitializer(node) && node.initializer && ts.isFunctionExpressionOrArrowFunction(node.initializer) && ts.getEffectiveReturnTypeNode(node.initializer));
59771
59912
  }
59772
59913
  function getExplicitTypeOfSymbol(symbol, diagnostic) {
59914
+ symbol = resolveSymbol(symbol);
59773
59915
  if (symbol.flags & (16 | 8192 | 32 | 512)) {
59774
59916
  return getTypeOfSymbol(symbol);
59775
59917
  }
@@ -59804,7 +59946,7 @@ var ts;
59804
59946
  switch (node.kind) {
59805
59947
  case 79:
59806
59948
  var symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node));
59807
- return getExplicitTypeOfSymbol(symbol.flags & 2097152 ? resolveAlias(symbol) : symbol, diagnostic);
59949
+ return getExplicitTypeOfSymbol(symbol, diagnostic);
59808
59950
  case 108:
59809
59951
  return getExplicitThisType(node);
59810
59952
  case 106:
@@ -60243,7 +60385,7 @@ var ts;
60243
60385
  type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
60244
60386
  }
60245
60387
  else if (expr.kind === 218 && isMatchingReference(reference, expr.expression)) {
60246
- type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
60388
+ type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
60247
60389
  }
60248
60390
  else {
60249
60391
  if (strictNullChecks) {
@@ -60476,7 +60618,7 @@ var ts;
60476
60618
  !!(prop.flags & 16777216) || assumeTrue :
60477
60619
  !!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
60478
60620
  }
60479
- function narrowByInKeyword(type, nameType, assumeTrue) {
60621
+ function narrowTypeByInKeyword(type, nameType, assumeTrue) {
60480
60622
  var name = getPropertyNameFromType(nameType);
60481
60623
  var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, true); });
60482
60624
  if (isKnownProperty) {
@@ -60553,7 +60695,7 @@ var ts;
60553
60695
  return getTypeWithFacts(type, assumeTrue ? 524288 : 65536);
60554
60696
  }
60555
60697
  if (isMatchingReference(reference, target)) {
60556
- return narrowByInKeyword(type, leftType, assumeTrue);
60698
+ return narrowTypeByInKeyword(type, leftType, assumeTrue);
60557
60699
  }
60558
60700
  }
60559
60701
  break;
@@ -60715,7 +60857,7 @@ var ts;
60715
60857
  neverType;
60716
60858
  });
60717
60859
  }
60718
- function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
60860
+ function narrowTypeBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
60719
60861
  var witnesses = getSwitchClauseTypeOfWitnesses(switchStatement);
60720
60862
  if (!witnesses) {
60721
60863
  return type;
@@ -61042,12 +61184,12 @@ var ts;
61042
61184
  });
61043
61185
  }
61044
61186
  function markAliasReferenced(symbol, location) {
61045
- if (isNonLocalAlias(symbol, 111551) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {
61187
+ if (isNonLocalAlias(symbol, 111551) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551)) {
61046
61188
  var target = resolveAlias(symbol);
61047
- if (target.flags & 111551) {
61189
+ if (getAllSymbolFlags(target) & (111551 | 1048576)) {
61048
61190
  if (compilerOptions.isolatedModules ||
61049
61191
  ts.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) ||
61050
- !isConstEnumOrConstEnumOnlyModule(target)) {
61192
+ !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) {
61051
61193
  markAliasSymbolAsReferenced(symbol);
61052
61194
  }
61053
61195
  else {
@@ -61209,7 +61351,7 @@ var ts;
61209
61351
  (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !isSymbolAssigned(localOrExportSymbol))) {
61210
61352
  flowContainer = getControlFlowContainer(flowContainer);
61211
61353
  }
61212
- var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) ||
61354
+ var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) ||
61213
61355
  type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 | 16384)) !== 0 ||
61214
61356
  isInTypeQuery(node) || node.parent.kind === 278) ||
61215
61357
  node.parent.kind === 232 ||
@@ -61234,6 +61376,12 @@ var ts;
61234
61376
  }
61235
61377
  return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType;
61236
61378
  }
61379
+ function isSameScopedBindingElement(node, declaration) {
61380
+ if (ts.isBindingElement(declaration)) {
61381
+ var bindingElement = ts.findAncestor(node, ts.isBindingElement);
61382
+ return bindingElement && ts.getRootDeclaration(bindingElement) === ts.getRootDeclaration(declaration);
61383
+ }
61384
+ }
61237
61385
  function shouldMarkIdentifierAliasReferenced(node) {
61238
61386
  var _a;
61239
61387
  var parent = node.parent;
@@ -61532,11 +61680,16 @@ var ts;
61532
61680
  var immediateContainer = ts.getSuperContainer(node, true);
61533
61681
  var container = immediateContainer;
61534
61682
  var needToCaptureLexicalThis = false;
61683
+ var inAsyncFunction = false;
61535
61684
  if (!isCallExpression) {
61536
61685
  while (container && container.kind === 216) {
61686
+ if (ts.hasSyntacticModifier(container, 512))
61687
+ inAsyncFunction = true;
61537
61688
  container = ts.getSuperContainer(container, true);
61538
61689
  needToCaptureLexicalThis = languageVersion < 2;
61539
61690
  }
61691
+ if (container && ts.hasSyntacticModifier(container, 512))
61692
+ inAsyncFunction = true;
61540
61693
  }
61541
61694
  var canUseSuperExpression = isLegalUsageOfSuperExpression(container);
61542
61695
  var nodeCheckFlag = 0;
@@ -61575,7 +61728,7 @@ var ts;
61575
61728
  nodeCheckFlag = 256;
61576
61729
  }
61577
61730
  getNodeLinks(node).flags |= nodeCheckFlag;
61578
- if (container.kind === 171 && ts.hasSyntacticModifier(container, 512)) {
61731
+ if (container.kind === 171 && inAsyncFunction) {
61579
61732
  if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
61580
61733
  getNodeLinks(container).flags |= 4096;
61581
61734
  }
@@ -62195,7 +62348,7 @@ var ts;
62195
62348
  function instantiateContextualType(contextualType, node, contextFlags) {
62196
62349
  if (contextualType && maybeTypeOfKind(contextualType, 465829888)) {
62197
62350
  var inferenceContext = getInferenceContext(node);
62198
- if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
62351
+ if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
62199
62352
  return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
62200
62353
  }
62201
62354
  if (inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.returnMapper) {
@@ -64724,7 +64877,7 @@ var ts;
64724
64877
  var spreadIndex = getSpreadArgumentIndex(args);
64725
64878
  if (spreadIndex >= 0) {
64726
64879
  var effectiveArgs_1 = args.slice(0, spreadIndex);
64727
- var _loop_27 = function (i) {
64880
+ var _loop_26 = function (i) {
64728
64881
  var arg = args[i];
64729
64882
  var spreadType = arg.kind === 227 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
64730
64883
  if (spreadType && isTupleType(spreadType)) {
@@ -64740,7 +64893,7 @@ var ts;
64740
64893
  }
64741
64894
  };
64742
64895
  for (var i = spreadIndex; i < args.length; i++) {
64743
- _loop_27(i);
64896
+ _loop_26(i);
64744
64897
  }
64745
64898
  return effectiveArgs_1;
64746
64899
  }
@@ -64990,7 +65143,7 @@ var ts;
64990
65143
  var min_3 = Number.MAX_VALUE;
64991
65144
  var minIndex = 0;
64992
65145
  var i_1 = 0;
64993
- var _loop_28 = function (c) {
65146
+ var _loop_27 = function (c) {
64994
65147
  var chain_2 = function () { return ts.chainDiagnosticMessages(undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
64995
65148
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
64996
65149
  if (diags_2) {
@@ -65008,7 +65161,7 @@ var ts;
65008
65161
  };
65009
65162
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
65010
65163
  var c = candidatesForArgumentError_1[_a];
65011
- _loop_28(c);
65164
+ _loop_27(c);
65012
65165
  }
65013
65166
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
65014
65167
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -65151,7 +65304,7 @@ var ts;
65151
65304
  }
65152
65305
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
65153
65306
  var parameters = [];
65154
- var _loop_29 = function (i) {
65307
+ var _loop_28 = function (i) {
65155
65308
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
65156
65309
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
65157
65310
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -65159,7 +65312,7 @@ var ts;
65159
65312
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
65160
65313
  };
65161
65314
  for (var i = 0; i < maxNonRestParam; i++) {
65162
- _loop_29(i);
65315
+ _loop_28(i);
65163
65316
  }
65164
65317
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
65165
65318
  var flags = 0;
@@ -65994,7 +66147,7 @@ var ts;
65994
66147
  if (symbol && symbol.flags & 2097152) {
65995
66148
  symbol = resolveAlias(symbol);
65996
66149
  }
65997
- return !!(symbol && (symbol.flags & 384) && getEnumKind(symbol) === 1);
66150
+ return !!(symbol && (getAllSymbolFlags(symbol) & 384) && getEnumKind(symbol) === 1);
65998
66151
  }
65999
66152
  return false;
66000
66153
  }
@@ -66619,7 +66772,17 @@ var ts;
66619
66772
  }
66620
66773
  function isExhaustiveSwitchStatement(node) {
66621
66774
  var links = getNodeLinks(node);
66622
- return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node));
66775
+ if (links.isExhaustive === undefined) {
66776
+ links.isExhaustive = 0;
66777
+ var exhaustive = computeExhaustiveSwitchStatement(node);
66778
+ if (links.isExhaustive === 0) {
66779
+ links.isExhaustive = exhaustive;
66780
+ }
66781
+ }
66782
+ else if (links.isExhaustive === 0) {
66783
+ links.isExhaustive = false;
66784
+ }
66785
+ return links.isExhaustive;
66623
66786
  }
66624
66787
  function computeExhaustiveSwitchStatement(node) {
66625
66788
  if (node.expression.kind === 218) {
@@ -66627,14 +66790,14 @@ var ts;
66627
66790
  if (!witnesses) {
66628
66791
  return false;
66629
66792
  }
66630
- var operandConstraint = getBaseConstraintOrType(getTypeOfExpression(node.expression.expression));
66793
+ var operandConstraint = getBaseConstraintOrType(checkExpressionCached(node.expression.expression));
66631
66794
  var notEqualFacts_2 = getNotEqualFactsFromTypeofSwitch(0, 0, witnesses);
66632
66795
  if (operandConstraint.flags & 3) {
66633
66796
  return (556800 & notEqualFacts_2) === 556800;
66634
66797
  }
66635
66798
  return !someType(operandConstraint, function (t) { return (getTypeFacts(t) & notEqualFacts_2) === notEqualFacts_2; });
66636
66799
  }
66637
- var type = getTypeOfExpression(node.expression);
66800
+ var type = checkExpressionCached(node.expression);
66638
66801
  if (!isLiteralType(type)) {
66639
66802
  return false;
66640
66803
  }
@@ -68144,6 +68307,9 @@ var ts;
68144
68307
  function hasInferenceCandidates(info) {
68145
68308
  return !!(info.candidates || info.contraCandidates);
68146
68309
  }
68310
+ function hasInferenceCandidatesOrDefault(info) {
68311
+ return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
68312
+ }
68147
68313
  function hasOverlappingInferences(a, b) {
68148
68314
  for (var i = 0; i < a.length; i++) {
68149
68315
  if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
@@ -68776,7 +68942,7 @@ var ts;
68776
68942
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
68777
68943
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
68778
68944
  var indexSignatureMap_1 = new ts.Map();
68779
- var _loop_30 = function (declaration) {
68945
+ var _loop_29 = function (declaration) {
68780
68946
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
68781
68947
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
68782
68948
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -68791,7 +68957,7 @@ var ts;
68791
68957
  };
68792
68958
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
68793
68959
  var declaration = _a[_i];
68794
- _loop_30(declaration);
68960
+ _loop_29(declaration);
68795
68961
  }
68796
68962
  indexSignatureMap_1.forEach(function (entry) {
68797
68963
  if (entry.declarations.length > 1) {
@@ -69037,7 +69203,7 @@ var ts;
69037
69203
  }
69038
69204
  var symbol = getNodeLinks(node).resolvedSymbol;
69039
69205
  if (symbol) {
69040
- if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
69206
+ if (ts.some(symbol.declarations, function (d) { return ts.isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
69041
69207
  addDeprecatedSuggestion(getDeprecatedSuggestionNode(node), symbol.declarations, symbol.escapedName);
69042
69208
  }
69043
69209
  if (type.flags & 32 && symbol.flags & 8) {
@@ -69571,7 +69737,7 @@ var ts;
69571
69737
  if (isReferenceToType(type, getGlobalPromiseType(false))) {
69572
69738
  return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0];
69573
69739
  }
69574
- if (allTypesAssignableToKind(type, 131068 | 131072)) {
69740
+ if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 | 131072)) {
69575
69741
  return undefined;
69576
69742
  }
69577
69743
  var thenFunction = getTypeOfPropertyOfType(type, "then");
@@ -69627,7 +69793,7 @@ var ts;
69627
69793
  return awaitedType || errorType;
69628
69794
  }
69629
69795
  function isThenableType(type) {
69630
- if (allTypesAssignableToKind(type, 131068 | 131072)) {
69796
+ if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 | 131072)) {
69631
69797
  return false;
69632
69798
  }
69633
69799
  var thenFunction = getTypeOfPropertyOfType(type, "then");
@@ -69653,7 +69819,7 @@ var ts;
69653
69819
  if (isGenericObjectType(type)) {
69654
69820
  var baseConstraint = getBaseConstraintOfType(type);
69655
69821
  if (baseConstraint ?
69656
- baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || isThenableType(baseConstraint) :
69822
+ baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || someType(baseConstraint, isThenableType) :
69657
69823
  maybeTypeOfKind(type, 8650752)) {
69658
69824
  return true;
69659
69825
  }
@@ -70158,7 +70324,7 @@ var ts;
70158
70324
  }
70159
70325
  function errorUnusedLocal(declaration, name, addDiagnostic) {
70160
70326
  var node = ts.getNameOfDeclaration(declaration) || declaration;
70161
- var message = isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
70327
+ var message = ts.isTypeDeclaration(declaration) ? ts.Diagnostics._0_is_declared_but_never_used : ts.Diagnostics._0_is_declared_but_its_value_is_never_read;
70162
70328
  addDiagnostic(declaration, 0, ts.createDiagnosticForNode(node, message, name));
70163
70329
  }
70164
70330
  function isIdentifierThatStartsWithUnderscore(node) {
@@ -71335,7 +71501,13 @@ var ts;
71335
71501
  var message = allowAsyncIterables
71336
71502
  ? ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator
71337
71503
  : ts.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;
71338
- return errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));
71504
+ var suggestAwait = !!getAwaitedTypeOfPromise(type)
71505
+ || (!allowAsyncIterables &&
71506
+ ts.isForOfStatement(errorNode.parent) &&
71507
+ errorNode.parent.expression === errorNode &&
71508
+ getGlobalAsyncIterableType(false) !== emptyGenericType &&
71509
+ isTypeAssignableTo(type, getGlobalAsyncIterableType(false)));
71510
+ return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type));
71339
71511
  }
71340
71512
  function getIterationTypesOfIterator(type, resolver, errorNode, errorOutputContainer) {
71341
71513
  return getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, false);
@@ -71731,7 +71903,7 @@ var ts;
71731
71903
  var propDeclaration = declaration && declaration.kind === 223 ||
71732
71904
  name && name.kind === 164 ? declaration : undefined;
71733
71905
  var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
71734
- var _loop_31 = function (info) {
71906
+ var _loop_30 = function (info) {
71735
71907
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
71736
71908
  var errorNode = localPropDeclaration || localIndexDeclaration ||
71737
71909
  (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
@@ -71745,7 +71917,7 @@ var ts;
71745
71917
  };
71746
71918
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
71747
71919
  var info = indexInfos_9[_i];
71748
- _loop_31(info);
71920
+ _loop_30(info);
71749
71921
  }
71750
71922
  }
71751
71923
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -71753,7 +71925,7 @@ var ts;
71753
71925
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
71754
71926
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 261) : undefined;
71755
71927
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
71756
- var _loop_32 = function (info) {
71928
+ var _loop_31 = function (info) {
71757
71929
  if (info === checkInfo)
71758
71930
  return "continue";
71759
71931
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -71765,7 +71937,7 @@ var ts;
71765
71937
  };
71766
71938
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
71767
71939
  var info = indexInfos_10[_i];
71768
- _loop_32(info);
71940
+ _loop_31(info);
71769
71941
  }
71770
71942
  }
71771
71943
  function checkTypeNameIsReserved(name, message) {
@@ -71815,7 +71987,7 @@ var ts;
71815
71987
  }
71816
71988
  else {
71817
71989
  ts.forEach(jsdocParameters, function (_a, index) {
71818
- var name = _a.name;
71990
+ var name = _a.name, isNameFirst = _a.isNameFirst;
71819
71991
  if (excludedParameters.has(index) || ts.isIdentifier(name) && parameters.has(name.escapedText)) {
71820
71992
  return;
71821
71993
  }
@@ -71825,7 +71997,9 @@ var ts;
71825
71997
  }
71826
71998
  }
71827
71999
  else {
71828
- errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
72000
+ if (!isNameFirst) {
72001
+ errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
72002
+ }
71829
72003
  }
71830
72004
  });
71831
72005
  }
@@ -72060,7 +72234,7 @@ var ts;
72060
72234
  var baseTypes = baseTypeNode && getBaseTypes(type);
72061
72235
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
72062
72236
  var baseStaticType = getBaseConstructorTypeOfClass(type);
72063
- var _loop_33 = function (member) {
72237
+ var _loop_32 = function (member) {
72064
72238
  if (ts.hasAmbientModifier(member)) {
72065
72239
  return "continue";
72066
72240
  }
@@ -72075,7 +72249,7 @@ var ts;
72075
72249
  };
72076
72250
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
72077
72251
  var member = _a[_i];
72078
- _loop_33(member);
72252
+ _loop_32(member);
72079
72253
  }
72080
72254
  }
72081
72255
  function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
@@ -72150,7 +72324,7 @@ var ts;
72150
72324
  }
72151
72325
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
72152
72326
  var issuedMemberError = false;
72153
- var _loop_34 = function (member) {
72327
+ var _loop_33 = function (member) {
72154
72328
  if (ts.isStatic(member)) {
72155
72329
  return "continue";
72156
72330
  }
@@ -72168,7 +72342,7 @@ var ts;
72168
72342
  };
72169
72343
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
72170
72344
  var member = _a[_i];
72171
- _loop_34(member);
72345
+ _loop_33(member);
72172
72346
  }
72173
72347
  if (!issuedMemberError) {
72174
72348
  checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
@@ -72215,7 +72389,7 @@ var ts;
72215
72389
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
72216
72390
  var _a, _b, _c, _d;
72217
72391
  var baseProperties = getPropertiesOfType(baseType);
72218
- var _loop_35 = function (baseProperty) {
72392
+ var _loop_34 = function (baseProperty) {
72219
72393
  var base = getTargetSymbol(baseProperty);
72220
72394
  if (base.flags & 4194304) {
72221
72395
  return "continue";
@@ -72313,8 +72487,8 @@ var ts;
72313
72487
  };
72314
72488
  basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
72315
72489
  var baseProperty = baseProperties_1[_i];
72316
- var state_11 = _loop_35(baseProperty);
72317
- switch (state_11) {
72490
+ var state_10 = _loop_34(baseProperty);
72491
+ switch (state_10) {
72318
72492
  case "continue-basePropertyCheck": continue basePropertyCheck;
72319
72493
  }
72320
72494
  }
@@ -72800,11 +72974,10 @@ var ts;
72800
72974
  }
72801
72975
  }
72802
72976
  function checkModuleAugmentationElement(node, isGlobalAugmentation) {
72803
- var _a;
72804
72977
  switch (node.kind) {
72805
72978
  case 240:
72806
- for (var _i = 0, _b = node.declarationList.declarations; _i < _b.length; _i++) {
72807
- var decl = _b[_i];
72979
+ for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
72980
+ var decl = _a[_i];
72808
72981
  checkModuleAugmentationElement(decl, isGlobalAugmentation);
72809
72982
  }
72810
72983
  break;
@@ -72820,8 +72993,8 @@ var ts;
72820
72993
  case 257:
72821
72994
  var name = node.name;
72822
72995
  if (ts.isBindingPattern(name)) {
72823
- for (var _c = 0, _d = name.elements; _c < _d.length; _c++) {
72824
- var el = _d[_c];
72996
+ for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {
72997
+ var el = _c[_b];
72825
72998
  checkModuleAugmentationElement(el, isGlobalAugmentation);
72826
72999
  }
72827
73000
  break;
@@ -72835,13 +73008,6 @@ var ts;
72835
73008
  if (isGlobalAugmentation) {
72836
73009
  return;
72837
73010
  }
72838
- var symbol = getSymbolOfNode(node);
72839
- if (symbol) {
72840
- var reportError = !(symbol.flags & 33554432);
72841
- if (!reportError) {
72842
- reportError = !!((_a = symbol.parent) === null || _a === void 0 ? void 0 : _a.declarations) && ts.isExternalModuleAugmentation(symbol.parent.declarations[0]);
72843
- }
72844
- }
72845
73011
  break;
72846
73012
  }
72847
73013
  }
@@ -72929,10 +73095,11 @@ var ts;
72929
73095
  }
72930
73096
  return;
72931
73097
  }
73098
+ var targetFlags = getAllSymbolFlags(target);
72932
73099
  var excludedMeanings = (symbol.flags & (111551 | 1048576) ? 111551 : 0) |
72933
73100
  (symbol.flags & 788968 ? 788968 : 0) |
72934
73101
  (symbol.flags & 1920 ? 1920 : 0);
72935
- if (target.flags & excludedMeanings) {
73102
+ if (targetFlags & excludedMeanings) {
72936
73103
  var message = node.kind === 278 ?
72937
73104
  ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
72938
73105
  ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
@@ -72942,7 +73109,7 @@ var ts;
72942
73109
  && !ts.isTypeOnlyImportOrExportDeclaration(node)
72943
73110
  && !(node.flags & 16777216)) {
72944
73111
  var typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
72945
- var isType = !(target.flags & 111551);
73112
+ var isType = !(targetFlags & 111551);
72946
73113
  if (isType || typeOnlyAlias) {
72947
73114
  switch (node.kind) {
72948
73115
  case 270:
@@ -73096,13 +73263,14 @@ var ts;
73096
73263
  if (node.moduleReference.kind !== 280) {
73097
73264
  var target = resolveAlias(getSymbolOfNode(node));
73098
73265
  if (target !== unknownSymbol) {
73099
- if (target.flags & 111551) {
73266
+ var targetFlags = getAllSymbolFlags(target);
73267
+ if (targetFlags & 111551) {
73100
73268
  var moduleName = ts.getFirstIdentifier(node.moduleReference);
73101
73269
  if (!(resolveEntityName(moduleName, 111551 | 1920).flags & 1920)) {
73102
73270
  error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName));
73103
73271
  }
73104
73272
  }
73105
- if (target.flags & 788968) {
73273
+ if (targetFlags & 788968) {
73106
73274
  checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0);
73107
73275
  }
73108
73276
  }
@@ -73229,7 +73397,7 @@ var ts;
73229
73397
  markExportAsReferenced(node);
73230
73398
  }
73231
73399
  var target = symbol && (symbol.flags & 2097152 ? resolveAlias(symbol) : symbol);
73232
- if (!target || target === unknownSymbol || target.flags & 111551) {
73400
+ if (!target || getAllSymbolFlags(target) & 111551) {
73233
73401
  checkExpressionCached(node.propertyName || node.name);
73234
73402
  }
73235
73403
  }
@@ -73273,7 +73441,7 @@ var ts;
73273
73441
  if (sym) {
73274
73442
  markAliasReferenced(sym, id);
73275
73443
  var target = sym.flags & 2097152 ? resolveAlias(sym) : sym;
73276
- if (target === unknownSymbol || target.flags & 111551) {
73444
+ if (getAllSymbolFlags(target) & 111551) {
73277
73445
  checkExpressionCached(node.expression);
73278
73446
  }
73279
73447
  }
@@ -73870,29 +74038,9 @@ var ts;
73870
74038
  }
73871
74039
  function isTypeDeclarationName(name) {
73872
74040
  return name.kind === 79 &&
73873
- isTypeDeclaration(name.parent) &&
74041
+ ts.isTypeDeclaration(name.parent) &&
73874
74042
  ts.getNameOfDeclaration(name.parent) === name;
73875
74043
  }
73876
- function isTypeDeclaration(node) {
73877
- switch (node.kind) {
73878
- case 165:
73879
- case 260:
73880
- case 261:
73881
- case 262:
73882
- case 263:
73883
- case 348:
73884
- case 341:
73885
- case 342:
73886
- return true;
73887
- case 270:
73888
- return node.isTypeOnly;
73889
- case 273:
73890
- case 278:
73891
- return node.parent.parent.isTypeOnly;
73892
- default:
73893
- return false;
73894
- }
73895
- }
73896
74044
  function isTypeReferenceIdentifier(node) {
73897
74045
  while (node.parent.kind === 163) {
73898
74046
  node = node.parent;
@@ -74287,7 +74435,7 @@ var ts;
74287
74435
  var baseType = ts.firstOrUndefined(getBaseTypes(classType));
74288
74436
  return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType;
74289
74437
  }
74290
- if (isTypeDeclaration(node)) {
74438
+ if (ts.isTypeDeclaration(node)) {
74291
74439
  var symbol = getSymbolOfNode(node);
74292
74440
  return getDeclaredTypeOfSymbol(symbol);
74293
74441
  }
@@ -74445,7 +74593,7 @@ var ts;
74445
74593
  return symbolLinks.exportsSomeValue;
74446
74594
  function isValue(s) {
74447
74595
  s = resolveSymbol(s);
74448
- return s && !!(s.flags & 111551);
74596
+ return s && !!(getAllSymbolFlags(s) & 111551);
74449
74597
  }
74450
74598
  }
74451
74599
  function isNameOfModuleOrEnumDeclaration(node) {
@@ -74484,7 +74632,7 @@ var ts;
74484
74632
  var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
74485
74633
  if (node) {
74486
74634
  var symbol = getReferencedValueOrAliasSymbol(node);
74487
- if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol)) {
74635
+ if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol, 111551)) {
74488
74636
  return getDeclarationOfAliasSymbol(symbol);
74489
74637
  }
74490
74638
  }
@@ -74551,7 +74699,7 @@ var ts;
74551
74699
  case 273:
74552
74700
  case 278:
74553
74701
  var symbol = getSymbolOfNode(node);
74554
- return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol);
74702
+ return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551);
74555
74703
  case 275:
74556
74704
  var exportClause = node.exportClause;
74557
74705
  return !!exportClause && (ts.isNamespaceExport(exportClause) ||
@@ -74572,6 +74720,7 @@ var ts;
74572
74720
  return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference);
74573
74721
  }
74574
74722
  function isAliasResolvedToValue(symbol) {
74723
+ var _a;
74575
74724
  if (!symbol) {
74576
74725
  return false;
74577
74726
  }
@@ -74579,7 +74728,7 @@ var ts;
74579
74728
  if (target === unknownSymbol) {
74580
74729
  return true;
74581
74730
  }
74582
- return !!(target.flags & 111551) &&
74731
+ return !!(((_a = getAllSymbolFlags(target)) !== null && _a !== void 0 ? _a : -1) & 111551) &&
74583
74732
  (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
74584
74733
  }
74585
74734
  function isConstEnumOrConstEnumOnlyModule(s) {
@@ -74594,7 +74743,7 @@ var ts;
74594
74743
  }
74595
74744
  var target = getSymbolLinks(symbol).aliasTarget;
74596
74745
  if (target && ts.getEffectiveModifierFlags(node) & 1 &&
74597
- target.flags & 111551 &&
74746
+ getAllSymbolFlags(target) & 111551 &&
74598
74747
  (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
74599
74748
  return true;
74600
74749
  }
@@ -82400,8 +82549,11 @@ var ts;
82400
82549
  }
82401
82550
  return ts.visitEachChild(node, visitor, context);
82402
82551
  case 174:
82552
+ return doWithContext(1 | 2, visitGetAccessorDeclaration, node);
82403
82553
  case 175:
82554
+ return doWithContext(1 | 2, visitSetAccessorDeclaration, node);
82404
82555
  case 173:
82556
+ return doWithContext(1 | 2, visitConstructorDeclaration, node);
82405
82557
  case 260:
82406
82558
  case 228:
82407
82559
  return doWithContext(1 | 2, visitDefault, node);
@@ -82492,10 +82644,19 @@ var ts;
82492
82644
  }
82493
82645
  return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node);
82494
82646
  }
82647
+ function visitConstructorDeclaration(node) {
82648
+ return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
82649
+ }
82495
82650
  function visitMethodDeclaration(node) {
82496
82651
  return factory.updateMethodDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.asteriskToken, node.name, undefined, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2
82497
82652
  ? transformAsyncFunctionBody(node)
82498
- : ts.visitFunctionBody(node.body, visitor, context));
82653
+ : transformMethodBody(node));
82654
+ }
82655
+ function visitGetAccessorDeclaration(node) {
82656
+ return factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context), undefined, transformMethodBody(node));
82657
+ }
82658
+ function visitSetAccessorDeclaration(node) {
82659
+ return factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
82499
82660
  }
82500
82661
  function visitFunctionDeclaration(node) {
82501
82662
  return factory.updateFunctionDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.asteriskToken, node.name, undefined, ts.visitParameterList(node.parameters, visitor, context), undefined, ts.getFunctionFlags(node) & 2
@@ -82579,6 +82740,39 @@ var ts;
82579
82740
  }
82580
82741
  return false;
82581
82742
  }
82743
+ function transformMethodBody(node) {
82744
+ ts.Debug.assertIsDefined(node.body);
82745
+ var savedCapturedSuperProperties = capturedSuperProperties;
82746
+ var savedHasSuperElementAccess = hasSuperElementAccess;
82747
+ capturedSuperProperties = new ts.Set();
82748
+ hasSuperElementAccess = false;
82749
+ var updated = ts.visitFunctionBody(node.body, visitor, context);
82750
+ var originalMethod = ts.getOriginalNode(node, ts.isFunctionLikeDeclaration);
82751
+ var emitSuperHelpers = languageVersion >= 2 &&
82752
+ resolver.getNodeCheckFlags(node) & (4096 | 2048) &&
82753
+ (ts.getFunctionFlags(originalMethod) & 3) !== 3;
82754
+ if (emitSuperHelpers) {
82755
+ enableSubstitutionForAsyncMethodsWithSuper();
82756
+ if (capturedSuperProperties.size) {
82757
+ var variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
82758
+ substitutedSuperAccessors[ts.getNodeId(variableStatement)] = true;
82759
+ var statements = updated.statements.slice();
82760
+ ts.insertStatementsAfterStandardPrologue(statements, [variableStatement]);
82761
+ updated = factory.updateBlock(updated, statements);
82762
+ }
82763
+ if (hasSuperElementAccess) {
82764
+ if (resolver.getNodeCheckFlags(node) & 4096) {
82765
+ ts.addEmitHelper(updated, ts.advancedAsyncSuperHelper);
82766
+ }
82767
+ else if (resolver.getNodeCheckFlags(node) & 2048) {
82768
+ ts.addEmitHelper(updated, ts.asyncSuperHelper);
82769
+ }
82770
+ }
82771
+ }
82772
+ capturedSuperProperties = savedCapturedSuperProperties;
82773
+ hasSuperElementAccess = savedHasSuperElementAccess;
82774
+ return updated;
82775
+ }
82582
82776
  function transformAsyncFunctionBody(node) {
82583
82777
  resumeLexicalEnvironment();
82584
82778
  var original = ts.getOriginalNode(node, ts.isFunctionLike);
@@ -83132,11 +83326,22 @@ var ts;
83132
83326
  }
83133
83327
  return node;
83134
83328
  }
83135
- function convertForOfStatementHead(node, boundValue) {
83136
- var binding = ts.createForOfBindingStatement(factory, node.initializer, boundValue);
83329
+ function convertForOfStatementHead(node, boundValue, nonUserCode) {
83330
+ var value = factory.createTempVariable(hoistVariableDeclaration);
83331
+ var iteratorValueExpression = factory.createAssignment(value, boundValue);
83332
+ var iteratorValueStatement = factory.createExpressionStatement(iteratorValueExpression);
83333
+ ts.setSourceMapRange(iteratorValueStatement, node.expression);
83334
+ var exitNonUserCodeExpression = factory.createAssignment(nonUserCode, factory.createFalse());
83335
+ var exitNonUserCodeStatement = factory.createExpressionStatement(exitNonUserCodeExpression);
83336
+ ts.setSourceMapRange(exitNonUserCodeStatement, node.expression);
83337
+ var enterNonUserCodeExpression = factory.createAssignment(nonUserCode, factory.createTrue());
83338
+ var enterNonUserCodeStatement = factory.createExpressionStatement(enterNonUserCodeExpression);
83339
+ ts.setSourceMapRange(exitNonUserCodeStatement, node.expression);
83340
+ var statements = [];
83341
+ var binding = ts.createForOfBindingStatement(factory, node.initializer, value);
83342
+ statements.push(ts.visitNode(binding, visitor, ts.isStatement));
83137
83343
  var bodyLocation;
83138
83344
  var statementsLocation;
83139
- var statements = [ts.visitNode(binding, visitor, ts.isStatement)];
83140
83345
  var statement = ts.visitIterationBody(node.statement, visitor, context);
83141
83346
  if (ts.isBlock(statement)) {
83142
83347
  ts.addRange(statements, statement.statements);
@@ -83146,7 +83351,14 @@ var ts;
83146
83351
  else {
83147
83352
  statements.push(statement);
83148
83353
  }
83149
- return ts.setEmitFlags(ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384);
83354
+ var body = ts.setEmitFlags(ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384);
83355
+ return factory.createBlock([
83356
+ iteratorValueStatement,
83357
+ exitNonUserCodeStatement,
83358
+ factory.createTryStatement(body, undefined, factory.createBlock([
83359
+ enterNonUserCodeStatement
83360
+ ]))
83361
+ ]);
83150
83362
  }
83151
83363
  function createDownlevelAwait(expression) {
83152
83364
  return enclosingFunctionFlags & 1
@@ -83157,6 +83369,8 @@ var ts;
83157
83369
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
83158
83370
  var iterator = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable(undefined);
83159
83371
  var result = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable(undefined);
83372
+ var nonUserCode = factory.createTempVariable(undefined);
83373
+ var done = factory.createTempVariable(hoistVariableDeclaration);
83160
83374
  var errorRecord = factory.createUniqueName("e");
83161
83375
  var catchVariable = factory.getGeneratedNameForNode(errorRecord);
83162
83376
  var returnMethod = factory.createTempVariable(undefined);
@@ -83171,9 +83385,14 @@ var ts;
83171
83385
  factory.inlineExpressions([factory.createAssignment(errorRecord, factory.createVoidZero()), callValues]) :
83172
83386
  callValues;
83173
83387
  var forStatement = ts.setEmitFlags(ts.setTextRange(factory.createForStatement(ts.setEmitFlags(ts.setTextRange(factory.createVariableDeclarationList([
83388
+ factory.createVariableDeclaration(nonUserCode, undefined, undefined, factory.createTrue()),
83174
83389
  ts.setTextRange(factory.createVariableDeclaration(iterator, undefined, undefined, initializer), node.expression),
83175
83390
  factory.createVariableDeclaration(result)
83176
- ]), node.expression), 2097152), factory.createComma(factory.createAssignment(result, createDownlevelAwait(callNext)), factory.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
83391
+ ]), node.expression), 2097152), factory.inlineExpressions([
83392
+ factory.createAssignment(result, createDownlevelAwait(callNext)),
83393
+ factory.createAssignment(done, getDone),
83394
+ factory.createLogicalNot(done)
83395
+ ]), undefined, convertForOfStatementHead(node, getValue, nonUserCode)), node), 256);
83177
83396
  ts.setOriginalNode(forStatement, node);
83178
83397
  return factory.createTryStatement(factory.createBlock([
83179
83398
  factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
@@ -83183,7 +83402,7 @@ var ts;
83183
83402
  ])))
83184
83403
  ]), 1)), factory.createBlock([
83185
83404
  factory.createTryStatement(factory.createBlock([
83186
- ts.setEmitFlags(factory.createIfStatement(factory.createLogicalAnd(factory.createLogicalAnd(result, factory.createLogicalNot(getDone)), factory.createAssignment(returnMethod, factory.createPropertyAccessExpression(iterator, "return"))), factory.createExpressionStatement(createDownlevelAwait(callReturn))), 1)
83405
+ ts.setEmitFlags(factory.createIfStatement(factory.createLogicalAnd(factory.createLogicalAnd(factory.createLogicalNot(nonUserCode), factory.createLogicalNot(done)), factory.createAssignment(returnMethod, factory.createPropertyAccessExpression(iterator, "return"))), factory.createExpressionStatement(createDownlevelAwait(callReturn))), 1)
83187
83406
  ]), undefined, ts.setEmitFlags(factory.createBlock([
83188
83407
  ts.setEmitFlags(factory.createIfStatement(errorRecord, factory.createThrowStatement(factory.createPropertyAccessExpression(errorRecord, "error"))), 1)
83189
83408
  ]), 1))
@@ -84747,11 +84966,13 @@ var ts;
84747
84966
  return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
84748
84967
  }
84749
84968
  function visitIdentifier(node) {
84750
- if (!convertedLoopState) {
84751
- return node;
84969
+ if (convertedLoopState) {
84970
+ if (resolver.isArgumentsLocalBinding(node)) {
84971
+ return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
84972
+ }
84752
84973
  }
84753
- if (resolver.isArgumentsLocalBinding(node)) {
84754
- return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
84974
+ if (node.hasExtendedUnicodeEscape) {
84975
+ return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
84755
84976
  }
84756
84977
  return node;
84757
84978
  }
@@ -87283,19 +87504,23 @@ var ts;
87283
87504
  }
87284
87505
  function transformAndEmitForInStatement(node) {
87285
87506
  if (containsYield(node)) {
87507
+ var obj = declareLocal();
87286
87508
  var keysArray = declareLocal();
87287
87509
  var key = declareLocal();
87288
87510
  var keysIndex = factory.createLoopVariable();
87289
87511
  var initializer = node.initializer;
87290
87512
  hoistVariableDeclaration(keysIndex);
87513
+ emitAssignment(obj, ts.visitNode(node.expression, visitor, ts.isExpression));
87291
87514
  emitAssignment(keysArray, factory.createArrayLiteralExpression());
87292
- emitStatement(factory.createForInStatement(key, ts.visitNode(node.expression, visitor, ts.isExpression), factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(keysArray, "push"), undefined, [key]))));
87515
+ emitStatement(factory.createForInStatement(key, obj, factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(keysArray, "push"), undefined, [key]))));
87293
87516
  emitAssignment(keysIndex, factory.createNumericLiteral(0));
87294
87517
  var conditionLabel = defineLabel();
87295
87518
  var incrementLabel = defineLabel();
87296
- var endLabel = beginLoopBlock(incrementLabel);
87519
+ var endLoopLabel = beginLoopBlock(incrementLabel);
87297
87520
  markLabel(conditionLabel);
87298
- emitBreakWhenFalse(endLabel, factory.createLessThan(keysIndex, factory.createPropertyAccessExpression(keysArray, "length")));
87521
+ emitBreakWhenFalse(endLoopLabel, factory.createLessThan(keysIndex, factory.createPropertyAccessExpression(keysArray, "length")));
87522
+ emitAssignment(key, factory.createElementAccessExpression(keysArray, keysIndex));
87523
+ emitBreakWhenFalse(incrementLabel, factory.createBinaryExpression(key, 101, obj));
87299
87524
  var variable = void 0;
87300
87525
  if (ts.isVariableDeclarationList(initializer)) {
87301
87526
  for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) {
@@ -87308,7 +87533,7 @@ var ts;
87308
87533
  variable = ts.visitNode(initializer, visitor, ts.isExpression);
87309
87534
  ts.Debug.assert(ts.isLeftHandSideExpression(variable));
87310
87535
  }
87311
- emitAssignment(variable, factory.createElementAccessExpression(keysArray, keysIndex));
87536
+ emitAssignment(variable, key);
87312
87537
  transformAndEmitEmbeddedStatement(node.statement);
87313
87538
  markLabel(incrementLabel);
87314
87539
  emitStatement(factory.createExpressionStatement(factory.createPostfixIncrement(keysIndex)));
@@ -88588,18 +88813,18 @@ var ts;
88588
88813
  return createImportCallExpressionUMD(argument !== null && argument !== void 0 ? argument : factory.createVoidZero(), containsLexicalThis);
88589
88814
  case ts.ModuleKind.CommonJS:
88590
88815
  default:
88591
- return createImportCallExpressionCommonJS(argument, containsLexicalThis);
88816
+ return createImportCallExpressionCommonJS(argument);
88592
88817
  }
88593
88818
  }
88594
88819
  function createImportCallExpressionUMD(arg, containsLexicalThis) {
88595
88820
  needUMDDynamicImportHelper = true;
88596
88821
  if (ts.isSimpleCopiableExpression(arg)) {
88597
88822
  var argClone = ts.isGeneratedIdentifier(arg) ? arg : ts.isStringLiteral(arg) ? factory.createStringLiteralFromNode(arg) : ts.setEmitFlags(ts.setTextRange(factory.cloneNode(arg), arg), 1536);
88598
- return factory.createConditionalExpression(factory.createIdentifier("__syncRequire"), undefined, createImportCallExpressionCommonJS(arg, containsLexicalThis), undefined, createImportCallExpressionAMD(argClone, containsLexicalThis));
88823
+ return factory.createConditionalExpression(factory.createIdentifier("__syncRequire"), undefined, createImportCallExpressionCommonJS(arg), undefined, createImportCallExpressionAMD(argClone, containsLexicalThis));
88599
88824
  }
88600
88825
  else {
88601
88826
  var temp = factory.createTempVariable(hoistVariableDeclaration);
88602
- return factory.createComma(factory.createAssignment(temp, arg), factory.createConditionalExpression(factory.createIdentifier("__syncRequire"), undefined, createImportCallExpressionCommonJS(temp, containsLexicalThis), undefined, createImportCallExpressionAMD(temp, containsLexicalThis)));
88827
+ return factory.createComma(factory.createAssignment(temp, arg), factory.createConditionalExpression(factory.createIdentifier("__syncRequire"), undefined, createImportCallExpressionCommonJS(temp, true), undefined, createImportCallExpressionAMD(temp, containsLexicalThis)));
88603
88828
  }
88604
88829
  }
88605
88830
  function createImportCallExpressionAMD(arg, containsLexicalThis) {
@@ -88628,9 +88853,10 @@ var ts;
88628
88853
  }
88629
88854
  return promise;
88630
88855
  }
88631
- function createImportCallExpressionCommonJS(arg, containsLexicalThis) {
88856
+ function createImportCallExpressionCommonJS(arg, isInlineable) {
88857
+ var temp = arg && !ts.isSimpleInlineableExpression(arg) && !isInlineable ? factory.createTempVariable(hoistVariableDeclaration) : undefined;
88632
88858
  var promiseResolveCall = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Promise"), "resolve"), undefined, []);
88633
- var requireCall = factory.createCallExpression(factory.createIdentifier("require"), undefined, arg ? [arg] : []);
88859
+ var requireCall = factory.createCallExpression(factory.createIdentifier("require"), undefined, temp ? [temp] : arg ? [arg] : []);
88634
88860
  if (ts.getESModuleInterop(compilerOptions)) {
88635
88861
  requireCall = emitHelpers().createImportStarHelper(requireCall);
88636
88862
  }
@@ -88640,11 +88866,9 @@ var ts;
88640
88866
  }
88641
88867
  else {
88642
88868
  func = factory.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, factory.createBlock([factory.createReturnStatement(requireCall)]));
88643
- if (containsLexicalThis) {
88644
- ts.setEmitFlags(func, 8);
88645
- }
88646
88869
  }
88647
- return factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, "then"), undefined, [func]);
88870
+ var downleveledImport = factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, "then"), undefined, [func]);
88871
+ return temp === undefined ? downleveledImport : factory.createCommaListExpression([factory.createAssignment(temp, arg), downleveledImport]);
88648
88872
  }
88649
88873
  function getHelperExpressionForExport(node, innerExpr) {
88650
88874
  if (!ts.getESModuleInterop(compilerOptions) || ts.getEmitFlags(node) & 67108864) {
@@ -97913,14 +98137,16 @@ var ts;
97913
98137
  }
97914
98138
  return setReadFileCache(key, fileName);
97915
98139
  };
97916
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {
98140
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
97917
98141
  var key = toPath(fileName);
97918
- var value = sourceFileCache.get(key);
98142
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
98143
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
98144
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
97919
98145
  if (value)
97920
98146
  return value;
97921
- var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);
98147
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
97922
98148
  if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json"))) {
97923
- sourceFileCache.set(key, sourceFile);
98149
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set(key, sourceFile));
97924
98150
  }
97925
98151
  return sourceFile;
97926
98152
  } : undefined;
@@ -97944,13 +98170,15 @@ var ts;
97944
98170
  var value = readFileCache.get(key);
97945
98171
  if (value !== undefined && value !== data) {
97946
98172
  readFileCache.delete(key);
97947
- sourceFileCache.delete(key);
98173
+ sourceFileCache.forEach(function (map) { return map.delete(key); });
97948
98174
  }
97949
98175
  else if (getSourceFileWithCache) {
97950
- var sourceFile = sourceFileCache.get(key);
97951
- if (sourceFile && sourceFile.text !== data) {
97952
- sourceFileCache.delete(key);
97953
- }
98176
+ sourceFileCache.forEach(function (map) {
98177
+ var sourceFile = map.get(key);
98178
+ if (sourceFile && sourceFile.text !== data) {
98179
+ map.delete(key);
98180
+ }
98181
+ });
97954
98182
  }
97955
98183
  originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
97956
98184
  };
@@ -101566,7 +101794,7 @@ var ts;
101566
101794
  var canCopyEmitSignatures = compilerOptions.composite &&
101567
101795
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
101568
101796
  !outFilePath &&
101569
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
101797
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
101570
101798
  if (useOldState) {
101571
101799
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
101572
101800
  if (!outFilePath && oldState.affectedFilesPendingEmit) {
@@ -102003,7 +102231,8 @@ var ts;
102003
102231
  for (var _b = 0, _c = state.affectedFilesPendingEmit.slice(state.affectedFilesPendingEmitIndex).sort(ts.compareStringsCaseSensitive); _b < _c.length; _b++) {
102004
102232
  var path = _c[_b];
102005
102233
  if (ts.tryAddToSet(seenFiles, path)) {
102006
- (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push([toFileId(path), state.affectedFilesPendingEmitKind.get(path)]);
102234
+ var fileId = toFileId(path), emitKind = state.affectedFilesPendingEmitKind.get(path);
102235
+ (affectedFilesPendingEmit || (affectedFilesPendingEmit = [])).push(emitKind === 1 ? fileId : [fileId]);
102007
102236
  }
102008
102237
  }
102009
102238
  }
@@ -102408,6 +102637,10 @@ var ts;
102408
102637
  { version: fileInfo.version, signature: fileInfo.signature === false ? undefined : fileInfo.version, affectsGlobalScope: fileInfo.affectsGlobalScope, impliedFormat: fileInfo.impliedFormat };
102409
102638
  }
102410
102639
  ts.toBuilderStateFileInfo = toBuilderStateFileInfo;
102640
+ function toBuilderFileEmit(value) {
102641
+ return ts.isNumber(value) ? 1 : 0;
102642
+ }
102643
+ ts.toBuilderFileEmit = toBuilderFileEmit;
102411
102644
  function createBuilderProgramUsingProgramBuildInfo(program, buildInfoPath, host) {
102412
102645
  var _a, _b, _c, _d;
102413
102646
  var buildInfoDirectory = ts.getDirectoryPath(ts.getNormalizedAbsolutePath(buildInfoPath, host.getCurrentDirectory()));
@@ -102449,8 +102682,8 @@ var ts;
102449
102682
  exportedModulesMap: toManyToManyPathMap(program.exportedModulesMap),
102450
102683
  semanticDiagnosticsPerFile: program.semanticDiagnosticsPerFile && ts.arrayToMap(program.semanticDiagnosticsPerFile, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, function (value) { return ts.isNumber(value) ? ts.emptyArray : value[1]; }),
102451
102684
  hasReusableDiagnostic: true,
102452
- affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }),
102453
- affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(value[0]); }, function (value) { return value[1]; }),
102685
+ affectedFilesPendingEmit: ts.map(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }),
102686
+ affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && ts.arrayToMap(program.affectedFilesPendingEmit, function (value) { return toFilePath(ts.isNumber(value) ? value : value[0]); }, toBuilderFileEmit),
102454
102687
  affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
102455
102688
  changedFilesSet: new ts.Set(ts.map(program.changeFileSet, toFilePath)),
102456
102689
  latestChangedDtsFile: latestChangedDtsFile,
@@ -102588,7 +102821,7 @@ var ts;
102588
102821
  var isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47;
102589
102822
  if (isNonDirectorySeparatorRoot &&
102590
102823
  dirPath.search(/[a-zA-Z]:/) !== 0 &&
102591
- pathPartForUserCheck.search(/[a-zA-z]\$\//) === 0) {
102824
+ pathPartForUserCheck.search(/[a-zA-Z]\$\//) === 0) {
102592
102825
  nextDirectorySeparator = dirPath.indexOf(ts.directorySeparator, nextDirectorySeparator + 1);
102593
102826
  if (nextDirectorySeparator === -1) {
102594
102827
  return false;
@@ -103678,7 +103911,7 @@ var ts;
103678
103911
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
103679
103912
  });
103680
103913
  var sortedPaths = [];
103681
- var _loop_36 = function (directory) {
103914
+ var _loop_35 = function (directory) {
103682
103915
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
103683
103916
  var pathsInDirectory;
103684
103917
  allFileNames.forEach(function (_a, fileName) {
@@ -103702,9 +103935,9 @@ var ts;
103702
103935
  };
103703
103936
  var out_directory_1;
103704
103937
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
103705
- var state_12 = _loop_36(directory);
103938
+ var state_11 = _loop_35(directory);
103706
103939
  directory = out_directory_1;
103707
- if (state_12 === "break")
103940
+ if (state_11 === "break")
103708
103941
  break;
103709
103942
  }
103710
103943
  if (allFileNames.size) {
@@ -103763,7 +103996,7 @@ var ts;
103763
103996
  }
103764
103997
  function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
103765
103998
  for (var key in paths) {
103766
- var _loop_37 = function (patternText_1) {
103999
+ var _loop_36 = function (patternText_1) {
103767
104000
  var pattern = ts.normalizePath(patternText_1);
103768
104001
  var indexOfStar = pattern.indexOf("*");
103769
104002
  var candidates = allowedEndings.map(function (ending) { return ({
@@ -103794,9 +104027,9 @@ var ts;
103794
104027
  };
103795
104028
  for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
103796
104029
  var patternText_1 = _a[_i];
103797
- var state_13 = _loop_37(patternText_1);
103798
- if (typeof state_13 === "object")
103799
- return state_13.value;
104030
+ var state_12 = _loop_36(patternText_1);
104031
+ if (typeof state_12 === "object")
104032
+ return state_12.value;
103800
104033
  }
103801
104034
  }
103802
104035
  function validateEnding(_a) {
@@ -103865,15 +104098,21 @@ var ts;
103865
104098
  return undefined;
103866
104099
  }
103867
104100
  function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) {
103868
- var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
103869
- if (normalizedTargetPath === undefined) {
104101
+ var normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
104102
+ if (normalizedTargetPaths === undefined) {
104103
+ return undefined;
104104
+ }
104105
+ var normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
104106
+ var relativePaths = ts.flatMap(normalizedSourcePaths, function (sourcePath) {
104107
+ return ts.map(normalizedTargetPaths, function (targetPath) { return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName)); });
104108
+ });
104109
+ var shortest = ts.min(relativePaths, ts.compareNumberOfDirectorySeparators);
104110
+ if (!shortest) {
103870
104111
  return undefined;
103871
104112
  }
103872
- var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
103873
- var relativePath = normalizedSourcePath !== undefined ? ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(normalizedSourcePath, normalizedTargetPath, getCanonicalFileName)) : normalizedTargetPath;
103874
104113
  return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs
103875
- ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
103876
- : ts.removeFileExtension(relativePath);
104114
+ ? removeExtensionAndIndexPostFix(shortest, ending, compilerOptions)
104115
+ : ts.removeFileExtension(shortest);
103877
104116
  }
103878
104117
  function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
103879
104118
  var path = _a.path, isRedirect = _a.isRedirect;
@@ -103993,8 +104232,8 @@ var ts;
103993
104232
  }
103994
104233
  }
103995
104234
  }
103996
- function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
103997
- return ts.firstDefined(rootDirs, function (rootDir) {
104235
+ function getPathsRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
104236
+ return ts.mapDefined(rootDirs, function (rootDir) {
103998
104237
  var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
103999
104238
  return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
104000
104239
  });
@@ -106380,7 +106619,9 @@ var ts;
106380
106619
  }
106381
106620
  if (buildInfo.program) {
106382
106621
  if (((_a = buildInfo.program.changeFileSet) === null || _a === void 0 ? void 0 : _a.length) ||
106383
- (!project.options.noEmit && ((_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length))) {
106622
+ (!project.options.noEmit ?
106623
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
106624
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
106384
106625
  return {
106385
106626
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
106386
106627
  buildInfoFile: buildInfoPath