typescript 4.9.1-beta → 4.9.3

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
@@ -45,7 +45,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  function verb(n) { return function (v) { return step([n, v]); }; }
46
46
  function step(op) {
47
47
  if (f) throw new TypeError("Generator is already executing.");
48
- while (_) try {
48
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
49
49
  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;
50
50
  if (y = 0, t) op = [op[0] & 2, t.value];
51
51
  switch (op[0]) {
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.9";
72
- ts.version = "".concat(ts.versionMajorMinor, ".1-beta");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".3");
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);
@@ -34480,12 +34525,22 @@ var ts;
34480
34525
  return !isCommandLineOnly && category !== undefined && (!categoriesToSkip.includes(category) || compilerOptionsMap.has(name));
34481
34526
  }
34482
34527
  function writeConfigurations() {
34483
- var categorizedOptions = ts.createMultiMap();
34528
+ var categorizedOptions = new ts.Map();
34529
+ categorizedOptions.set(ts.Diagnostics.Projects, []);
34530
+ categorizedOptions.set(ts.Diagnostics.Language_and_Environment, []);
34531
+ categorizedOptions.set(ts.Diagnostics.Modules, []);
34532
+ categorizedOptions.set(ts.Diagnostics.JavaScript_Support, []);
34533
+ categorizedOptions.set(ts.Diagnostics.Emit, []);
34534
+ categorizedOptions.set(ts.Diagnostics.Interop_Constraints, []);
34535
+ categorizedOptions.set(ts.Diagnostics.Type_Checking, []);
34536
+ categorizedOptions.set(ts.Diagnostics.Completeness, []);
34484
34537
  for (var _i = 0, optionDeclarations_1 = ts.optionDeclarations; _i < optionDeclarations_1.length; _i++) {
34485
34538
  var option = optionDeclarations_1[_i];
34486
- var category = option.category;
34487
34539
  if (isAllowedOptionForOutput(option)) {
34488
- categorizedOptions.add(ts.getLocaleSpecificMessage(category), option);
34540
+ var listForCategory = categorizedOptions.get(option.category);
34541
+ if (!listForCategory)
34542
+ categorizedOptions.set(option.category, listForCategory = []);
34543
+ listForCategory.push(option);
34489
34544
  }
34490
34545
  }
34491
34546
  var marginLength = 0;
@@ -34495,7 +34550,7 @@ var ts;
34495
34550
  if (entries.length !== 0) {
34496
34551
  entries.push({ value: "" });
34497
34552
  }
34498
- entries.push({ value: "/* ".concat(category, " */") });
34553
+ entries.push({ value: "/* ".concat(ts.getLocaleSpecificMessage(category), " */") });
34499
34554
  for (var _i = 0, options_1 = options; _i < options_1.length; _i++) {
34500
34555
  var option = options_1[_i];
34501
34556
  var optionName = void 0;
@@ -36224,6 +36279,9 @@ var ts;
36224
36279
  requestContainingDirectory: containingDirectory,
36225
36280
  reportDiagnostic: function (diag) { return void diagnostics.push(diag); },
36226
36281
  };
36282
+ if (traceEnabled && ts.getEmitModuleResolutionKind(compilerOptions) >= ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) <= ts.ModuleResolutionKind.NodeNext) {
36283
+ trace(host, ts.Diagnostics.Resolving_in_0_mode_with_conditions_1, features & NodeResolutionFeatures.EsmMode ? "ESM" : "CJS", conditions.map(function (c) { return "'".concat(c, "'"); }).join(", "));
36284
+ }
36227
36285
  var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
36228
36286
  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
36287
  function tryResolve(extensions) {
@@ -36753,7 +36811,7 @@ var ts;
36753
36811
  }
36754
36812
  if (mainExport) {
36755
36813
  var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, subpath, scope, false);
36756
- return loadModuleFromTargetImportOrExport(mainExport, "", false);
36814
+ return loadModuleFromTargetImportOrExport(mainExport, "", false, ".");
36757
36815
  }
36758
36816
  }
36759
36817
  else if (allKeysStartWithDot(scope.contents.packageJsonContent.exports)) {
@@ -36828,7 +36886,7 @@ var ts;
36828
36886
  var loadModuleFromTargetImportOrExport = getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports);
36829
36887
  if (!ts.endsWith(moduleName, ts.directorySeparator) && moduleName.indexOf("*") === -1 && ts.hasProperty(lookupTable, moduleName)) {
36830
36888
  var target = lookupTable[moduleName];
36831
- return loadModuleFromTargetImportOrExport(target, "", false);
36889
+ return loadModuleFromTargetImportOrExport(target, "", false, moduleName);
36832
36890
  }
36833
36891
  var expandingKeys = ts.sort(ts.filter(ts.getOwnKeys(lookupTable), function (k) { return k.indexOf("*") !== -1 || ts.endsWith(k, "/"); }), comparePatternKeys);
36834
36892
  for (var _i = 0, expandingKeys_1 = expandingKeys; _i < expandingKeys_1.length; _i++) {
@@ -36837,17 +36895,17 @@ var ts;
36837
36895
  var target = lookupTable[potentialTarget];
36838
36896
  var starPos = potentialTarget.indexOf("*");
36839
36897
  var subpath = moduleName.substring(potentialTarget.substring(0, starPos).length, moduleName.length - (potentialTarget.length - 1 - starPos));
36840
- return loadModuleFromTargetImportOrExport(target, subpath, true);
36898
+ return loadModuleFromTargetImportOrExport(target, subpath, true, potentialTarget);
36841
36899
  }
36842
36900
  else if (ts.endsWith(potentialTarget, "*") && ts.startsWith(moduleName, potentialTarget.substring(0, potentialTarget.length - 1))) {
36843
36901
  var target = lookupTable[potentialTarget];
36844
36902
  var subpath = moduleName.substring(potentialTarget.length - 1);
36845
- return loadModuleFromTargetImportOrExport(target, subpath, true);
36903
+ return loadModuleFromTargetImportOrExport(target, subpath, true, potentialTarget);
36846
36904
  }
36847
36905
  else if (ts.startsWith(moduleName, potentialTarget)) {
36848
36906
  var target = lookupTable[potentialTarget];
36849
36907
  var subpath = moduleName.substring(potentialTarget.length);
36850
- return loadModuleFromTargetImportOrExport(target, subpath, false);
36908
+ return loadModuleFromTargetImportOrExport(target, subpath, false, potentialTarget);
36851
36909
  }
36852
36910
  }
36853
36911
  function matchesPatternWithTrailer(target, name) {
@@ -36861,7 +36919,7 @@ var ts;
36861
36919
  }
36862
36920
  function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirectedReference, moduleName, scope, isImports) {
36863
36921
  return loadModuleFromTargetImportOrExport;
36864
- function loadModuleFromTargetImportOrExport(target, subpath, pattern) {
36922
+ function loadModuleFromTargetImportOrExport(target, subpath, pattern, key) {
36865
36923
  if (typeof target === "string") {
36866
36924
  if (!pattern && subpath.length > 0 && !ts.endsWith(target, "/")) {
36867
36925
  if (state.traceEnabled) {
@@ -36872,6 +36930,8 @@ var ts;
36872
36930
  if (!ts.startsWith(target, "./")) {
36873
36931
  if (isImports && !ts.startsWith(target, "../") && !ts.startsWith(target, "/") && !ts.isRootedDiskPath(target)) {
36874
36932
  var combinedLookup = pattern ? target.replace(/\*/g, subpath) : target + subpath;
36933
+ traceIfEnabled(state, ts.Diagnostics.Using_0_subpath_1_with_target_2, "imports", key, combinedLookup);
36934
+ traceIfEnabled(state, ts.Diagnostics.Resolving_module_0_from_1, combinedLookup, scope.packageDirectory + "/");
36875
36935
  var result = nodeModuleNameResolverWorker(state.features, combinedLookup, scope.packageDirectory + "/", state.compilerOptions, state.host, cache, [extensions], redirectedReference);
36876
36936
  return toSearchResult(result.resolvedModule ? { path: result.resolvedModule.resolvedFileName, extension: result.resolvedModule.extension, packageId: result.resolvedModule.packageId, originalPath: result.resolvedModule.originalPath } : undefined);
36877
36937
  }
@@ -36896,6 +36956,9 @@ var ts;
36896
36956
  }
36897
36957
  return toSearchResult(undefined);
36898
36958
  }
36959
+ if (state.traceEnabled) {
36960
+ trace(state.host, ts.Diagnostics.Using_0_subpath_1_with_target_2, isImports ? "imports" : "exports", key, pattern ? target.replace(/\*/g, subpath) : target + subpath);
36961
+ }
36899
36962
  var finalPath = toAbsolutePath(pattern ? resolvedTarget.replace(/\*/g, subpath) : resolvedTarget + subpath);
36900
36963
  var inputLink = tryLoadInputFileForPath(finalPath, subpath, ts.combinePaths(scope.packageDirectory, "package.json"), isImports);
36901
36964
  if (inputLink)
@@ -36905,14 +36968,18 @@ var ts;
36905
36968
  else if (typeof target === "object" && target !== null) {
36906
36969
  if (!Array.isArray(target)) {
36907
36970
  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);
36971
+ var condition = _a[_i];
36972
+ if (condition === "default" || state.conditions.indexOf(condition) >= 0 || isApplicableVersionedTypesKey(state.conditions, condition)) {
36973
+ traceIfEnabled(state, ts.Diagnostics.Matched_0_condition_1, isImports ? "imports" : "exports", condition);
36974
+ var subTarget = target[condition];
36975
+ var result = loadModuleFromTargetImportOrExport(subTarget, subpath, pattern, key);
36912
36976
  if (result) {
36913
36977
  return result;
36914
36978
  }
36915
36979
  }
36980
+ else {
36981
+ traceIfEnabled(state, ts.Diagnostics.Saw_non_matching_condition_0, condition);
36982
+ }
36916
36983
  }
36917
36984
  return undefined;
36918
36985
  }
@@ -36925,7 +36992,7 @@ var ts;
36925
36992
  }
36926
36993
  for (var _b = 0, target_2 = target; _b < target_2.length; _b++) {
36927
36994
  var elem = target_2[_b];
36928
- var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern);
36995
+ var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern, key);
36929
36996
  if (result) {
36930
36997
  return result;
36931
36998
  }
@@ -37276,6 +37343,15 @@ var ts;
37276
37343
  function toSearchResult(value) {
37277
37344
  return value !== undefined ? { value: value } : undefined;
37278
37345
  }
37346
+ function traceIfEnabled(state, diagnostic) {
37347
+ var args = [];
37348
+ for (var _i = 2; _i < arguments.length; _i++) {
37349
+ args[_i - 2] = arguments[_i];
37350
+ }
37351
+ if (state.traceEnabled) {
37352
+ trace.apply(void 0, __spreadArray([state.host, diagnostic], args, false));
37353
+ }
37354
+ }
37279
37355
  })(ts || (ts = {}));
37280
37356
  var ts;
37281
37357
  (function (ts) {
@@ -40580,6 +40656,12 @@ var ts;
40580
40656
  getOptionalType: function () { return optionalType; },
40581
40657
  getPromiseType: function () { return getGlobalPromiseType(false); },
40582
40658
  getPromiseLikeType: function () { return getGlobalPromiseLikeType(false); },
40659
+ getAsyncIterableType: function () {
40660
+ var type = getGlobalAsyncIterableType(false);
40661
+ if (type === emptyGenericType)
40662
+ return undefined;
40663
+ return type;
40664
+ },
40583
40665
  isSymbolAccessible: isSymbolAccessible,
40584
40666
  isArrayType: isArrayType,
40585
40667
  isTupleType: isTupleType,
@@ -41366,8 +41448,8 @@ var ts;
41366
41448
  return symbol;
41367
41449
  }
41368
41450
  if (symbol.flags & 2097152) {
41369
- var target = resolveAlias(symbol);
41370
- if (target === unknownSymbol || target.flags & meaning) {
41451
+ var targetFlags = getAllSymbolFlags(symbol);
41452
+ if (targetFlags & meaning) {
41371
41453
  return symbol;
41372
41454
  }
41373
41455
  }
@@ -41857,8 +41939,8 @@ var ts;
41857
41939
  !checkAndReportErrorForExtendingInterface(errorLocation) &&
41858
41940
  !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) &&
41859
41941
  !checkAndReportErrorForExportingPrimitiveType(errorLocation, name) &&
41942
+ !checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) &&
41860
41943
  !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) &&
41861
- !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) &&
41862
41944
  !checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning)) {
41863
41945
  var suggestion = void 0;
41864
41946
  var suggestedLib = void 0;
@@ -41926,7 +42008,7 @@ var ts;
41926
42008
  }
41927
42009
  }
41928
42010
  if (result && errorLocation && meaning & 111551 && result.flags & 2097152 && !(result.flags & 111551) && !ts.isValidTypeOnlyAliasUseSite(errorLocation)) {
41929
- var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result);
42011
+ var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result, 111551);
41930
42012
  if (typeOnlyDeclaration) {
41931
42013
  var message = typeOnlyDeclaration.kind === 278
41932
42014
  ? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
@@ -42079,7 +42161,7 @@ var ts;
42079
42161
  return false;
42080
42162
  }
42081
42163
  function checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) {
42082
- if (meaning & (111551 & ~1024)) {
42164
+ if (meaning & 111551) {
42083
42165
  if (isPrimitiveTypeName(name)) {
42084
42166
  if (isExtendedByInterface(errorLocation)) {
42085
42167
  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 +42172,8 @@ var ts;
42090
42172
  return true;
42091
42173
  }
42092
42174
  var symbol = resolveSymbol(resolveName(errorLocation, name, 788968 & ~111551, undefined, undefined, false));
42093
- if (symbol && !(symbol.flags & 1024)) {
42175
+ var allFlags = symbol && getAllSymbolFlags(symbol);
42176
+ if (symbol && allFlags !== undefined && !(allFlags & 111551)) {
42094
42177
  var rawName = ts.unescapeLeadingUnderscores(name);
42095
42178
  if (isES2015OrLaterConstructorName(name)) {
42096
42179
  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 +42221,16 @@ var ts;
42138
42221
  }
42139
42222
  return false;
42140
42223
  }
42141
- function checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning) {
42142
- if (meaning & (111551 & ~1024 & ~788968)) {
42143
- var symbol = resolveSymbol(resolveName(errorLocation, name, 1024 & ~111551, undefined, undefined, false));
42224
+ function checkAndReportErrorForUsingNamespaceAsTypeOrValue(errorLocation, name, meaning) {
42225
+ if (meaning & (111551 & ~788968)) {
42226
+ var symbol = resolveSymbol(resolveName(errorLocation, name, 1024, undefined, undefined, false));
42144
42227
  if (symbol) {
42145
42228
  error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_value, ts.unescapeLeadingUnderscores(name));
42146
42229
  return true;
42147
42230
  }
42148
42231
  }
42149
- else if (meaning & (788968 & ~1024 & ~111551)) {
42150
- var symbol = resolveSymbol(resolveName(errorLocation, name, (512 | 1024) & ~788968, undefined, undefined, false));
42232
+ else if (meaning & (788968 & ~111551)) {
42233
+ var symbol = resolveSymbol(resolveName(errorLocation, name, 1536, undefined, undefined, false));
42151
42234
  if (symbol) {
42152
42235
  error(errorLocation, ts.Diagnostics.Cannot_use_namespace_0_as_a_type, ts.unescapeLeadingUnderscores(name));
42153
42236
  return true;
@@ -42678,6 +42761,30 @@ var ts;
42678
42761
  }
42679
42762
  return undefined;
42680
42763
  }
42764
+ function getAllSymbolFlags(symbol) {
42765
+ var flags = symbol.flags;
42766
+ var seenSymbols;
42767
+ while (symbol.flags & 2097152) {
42768
+ var target = resolveAlias(symbol);
42769
+ if (target === unknownSymbol) {
42770
+ return 67108863;
42771
+ }
42772
+ if (target === symbol || (seenSymbols === null || seenSymbols === void 0 ? void 0 : seenSymbols.has(target))) {
42773
+ break;
42774
+ }
42775
+ if (target.flags & 2097152) {
42776
+ if (seenSymbols) {
42777
+ seenSymbols.add(target);
42778
+ }
42779
+ else {
42780
+ seenSymbols = new ts.Set([symbol, target]);
42781
+ }
42782
+ }
42783
+ flags |= target.flags;
42784
+ symbol = target;
42785
+ }
42786
+ return flags;
42787
+ }
42681
42788
  function markSymbolOfAliasDeclarationIfTypeOnly(aliasDeclaration, immediateTarget, finalTarget, overwriteEmpty) {
42682
42789
  if (!aliasDeclaration || ts.isPropertyAccessExpression(aliasDeclaration))
42683
42790
  return false;
@@ -42700,19 +42807,25 @@ var ts;
42700
42807
  }
42701
42808
  return !!aliasDeclarationLinks.typeOnlyDeclaration;
42702
42809
  }
42703
- function getTypeOnlyAliasDeclaration(symbol) {
42810
+ function getTypeOnlyAliasDeclaration(symbol, include) {
42704
42811
  if (!(symbol.flags & 2097152)) {
42705
42812
  return undefined;
42706
42813
  }
42707
42814
  var links = getSymbolLinks(symbol);
42708
- return links.typeOnlyDeclaration || undefined;
42815
+ if (include === undefined) {
42816
+ return links.typeOnlyDeclaration || undefined;
42817
+ }
42818
+ if (links.typeOnlyDeclaration) {
42819
+ return getAllSymbolFlags(resolveAlias(links.typeOnlyDeclaration.symbol)) & include ? links.typeOnlyDeclaration : undefined;
42820
+ }
42821
+ return undefined;
42709
42822
  }
42710
42823
  function markExportAsReferenced(node) {
42711
42824
  var symbol = getSymbolOfNode(node);
42712
42825
  var target = resolveAlias(symbol);
42713
42826
  if (target) {
42714
42827
  var markAlias = target === unknownSymbol ||
42715
- ((target.flags & 111551) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol));
42828
+ ((getAllSymbolFlags(target) & 111551) && !isConstEnumOrConstEnumOnlyModule(target) && !getTypeOnlyAliasDeclaration(symbol, 111551));
42716
42829
  if (markAlias) {
42717
42830
  markAliasSymbolAsReferenced(symbol);
42718
42831
  }
@@ -42726,8 +42839,7 @@ var ts;
42726
42839
  if (!node)
42727
42840
  return ts.Debug.fail();
42728
42841
  if (ts.isInternalModuleImportEqualsDeclaration(node)) {
42729
- var target = resolveSymbol(symbol);
42730
- if (target === unknownSymbol || target.flags & 111551) {
42842
+ if (getAllSymbolFlags(resolveSymbol(symbol)) & 111551) {
42731
42843
  checkExpressionCached(node.moduleReference);
42732
42844
  }
42733
42845
  }
@@ -43457,7 +43569,7 @@ var ts;
43457
43569
  }
43458
43570
  function symbolIsValue(symbol, includeTypeOnlyMembers) {
43459
43571
  return !!(symbol.flags & 111551 ||
43460
- symbol.flags & 2097152 && resolveAlias(symbol).flags & 111551 && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
43572
+ symbol.flags & 2097152 && getAllSymbolFlags(symbol) & 111551 && (includeTypeOnlyMembers || !getTypeOnlyAliasDeclaration(symbol)));
43461
43573
  }
43462
43574
  function findConstructorDeclaration(node) {
43463
43575
  var members = node.members;
@@ -43684,8 +43796,10 @@ var ts;
43684
43796
  if (symbolFromSymbolTable === symbol) {
43685
43797
  return true;
43686
43798
  }
43687
- symbolFromSymbolTable = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 278)) ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
43688
- if (symbolFromSymbolTable.flags & meaning) {
43799
+ var shouldResolveAlias = (symbolFromSymbolTable.flags & 2097152 && !ts.getDeclarationOfKind(symbolFromSymbolTable, 278));
43800
+ symbolFromSymbolTable = shouldResolveAlias ? resolveAlias(symbolFromSymbolTable) : symbolFromSymbolTable;
43801
+ var flags = shouldResolveAlias ? getAllSymbolFlags(symbolFromSymbolTable) : symbolFromSymbolTable.flags;
43802
+ if (flags & meaning) {
43689
43803
  qualify = true;
43690
43804
  return true;
43691
43805
  }
@@ -45791,7 +45905,7 @@ var ts;
45791
45905
  if (!e.propertyName) {
45792
45906
  var indices = ts.indicesOf(statements);
45793
45907
  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]); })) {
45908
+ if (ts.length(associatedIndices) && ts.every(associatedIndices, function (i) { return ts.canHaveExportModifier(statements[i]); })) {
45795
45909
  for (var _i = 0, associatedIndices_1 = associatedIndices; _i < associatedIndices_1.length; _i++) {
45796
45910
  var index_1 = associatedIndices_1[_i];
45797
45911
  statements[index_1] = addExportModifier(statements[index_1]);
@@ -45821,15 +45935,6 @@ var ts;
45821
45935
  }
45822
45936
  return statements;
45823
45937
  }
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
45938
  function addExportModifier(node) {
45834
45939
  var flags = (ts.getEffectiveModifierFlags(node) | 1) & ~2;
45835
45940
  return ts.factory.updateModifiers(node, flags);
@@ -46014,7 +46119,7 @@ var ts;
46014
46119
  (ts.isJSDocTypeAlias(context.enclosingDeclaration) ? ts.getSourceFileOfNode(context.enclosingDeclaration) : context.enclosingDeclaration);
46015
46120
  if (additionalModifierFlags & 1 &&
46016
46121
  enclosingDeclaration_1 && (isExportingScope(enclosingDeclaration_1) || ts.isModuleDeclaration(enclosingDeclaration_1)) &&
46017
- canHaveExportModifier(node)) {
46122
+ ts.canHaveExportModifier(node)) {
46018
46123
  newModifierFlags |= 1;
46019
46124
  }
46020
46125
  if (addingDeclare && !(newModifierFlags & 1) &&
@@ -46067,7 +46172,7 @@ var ts;
46067
46172
  return !symbol.exports ? [] : ts.filter(ts.arrayFrom(symbol.exports.values()), isNamespaceMember);
46068
46173
  }
46069
46174
  function isTypeOnlyNamespace(symbol) {
46070
- return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(resolveSymbol(m).flags & 111551); });
46175
+ return ts.every(getNamespaceMembersForSerialization(symbol), function (m) { return !(getAllSymbolFlags(resolveSymbol(m)) & 111551); });
46071
46176
  }
46072
46177
  function serializeModule(symbol, symbolName, modifierFlags) {
46073
46178
  var members = getNamespaceMembersForSerialization(symbol);
@@ -47940,7 +48045,7 @@ var ts;
47940
48045
  links.type = (exportSymbol === null || exportSymbol === void 0 ? void 0 : exportSymbol.declarations) && isDuplicatedCommonJSExport(exportSymbol.declarations) && symbol.declarations.length ? getFlowTypeFromCommonJSExport(exportSymbol)
47941
48046
  : isDuplicatedCommonJSExport(symbol.declarations) ? autoType
47942
48047
  : declaredType ? declaredType
47943
- : targetSymbol.flags & 111551 ? getTypeOfSymbol(targetSymbol)
48048
+ : getAllSymbolFlags(targetSymbol) & 111551 ? getTypeOfSymbol(targetSymbol)
47944
48049
  : errorType;
47945
48050
  }
47946
48051
  return links.type;
@@ -49575,7 +49680,17 @@ var ts;
49575
49680
  return !!(ts.getObjectFlags(type) & 32 && getMappedTypeModifiers(type) & 4);
49576
49681
  }
49577
49682
  function isGenericMappedType(type) {
49578
- return !!(ts.getObjectFlags(type) & 32) && isGenericIndexType(getConstraintTypeFromMappedType(type));
49683
+ if (ts.getObjectFlags(type) & 32) {
49684
+ var constraint = getConstraintTypeFromMappedType(type);
49685
+ if (isGenericIndexType(constraint)) {
49686
+ return true;
49687
+ }
49688
+ var nameType = getNameTypeFromMappedType(type);
49689
+ if (nameType && isGenericIndexType(instantiateType(nameType, makeUnaryTypeMapper(getTypeParameterFromMappedType(type), constraint)))) {
49690
+ return true;
49691
+ }
49692
+ }
49693
+ return false;
49579
49694
  }
49580
49695
  function resolveStructuredTypeMembers(type) {
49581
49696
  if (!type.members) {
@@ -49974,7 +50089,7 @@ var ts;
49974
50089
  var propSet;
49975
50090
  var indexTypes;
49976
50091
  var isUnion = containingType.flags & 1048576;
49977
- var optionalFlag = isUnion ? 0 : 16777216;
50092
+ var optionalFlag;
49978
50093
  var syntheticFlag = 4;
49979
50094
  var checkFlags = isUnion ? 0 : 8;
49980
50095
  var mergedInstantiations = false;
@@ -49985,11 +50100,14 @@ var ts;
49985
50100
  var prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);
49986
50101
  var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
49987
50102
  if (prop) {
49988
- if (isUnion) {
49989
- optionalFlag |= (prop.flags & 16777216);
49990
- }
49991
- else {
49992
- optionalFlag &= prop.flags;
50103
+ if (prop.flags & 106500) {
50104
+ optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : (optionalFlag = isUnion ? 0 : 16777216);
50105
+ if (isUnion) {
50106
+ optionalFlag |= (prop.flags & 16777216);
50107
+ }
50108
+ else {
50109
+ optionalFlag &= prop.flags;
50110
+ }
49993
50111
  }
49994
50112
  if (!singleProp) {
49995
50113
  singleProp = prop;
@@ -50097,7 +50215,7 @@ var ts;
50097
50215
  propTypes.push(type);
50098
50216
  }
50099
50217
  ts.addRange(propTypes, indexTypes);
50100
- var result = createSymbol(4 | optionalFlag, name, syntheticFlag | checkFlags);
50218
+ var result = createSymbol(4 | (optionalFlag !== null && optionalFlag !== void 0 ? optionalFlag : 0), name, syntheticFlag | checkFlags);
50101
50219
  result.containingType = containingType;
50102
50220
  if (!hasNonUniformValueDeclaration && firstValueDeclaration) {
50103
50221
  result.valueDeclaration = firstValueDeclaration;
@@ -52505,8 +52623,13 @@ var ts;
52505
52623
  return getStringLiteralType(text);
52506
52624
  }
52507
52625
  newTexts.push(text);
52508
- if (ts.every(newTexts, function (t) { return t === ""; }) && ts.every(newTypes, function (t) { return !!(t.flags & 4); })) {
52509
- return stringType;
52626
+ if (ts.every(newTexts, function (t) { return t === ""; })) {
52627
+ if (ts.every(newTypes, function (t) { return !!(t.flags & 4); })) {
52628
+ return stringType;
52629
+ }
52630
+ if (newTypes.length === 1 && isPatternLiteralType(newTypes[0])) {
52631
+ return newTypes[0];
52632
+ }
52510
52633
  }
52511
52634
  var id = "".concat(getTypeListId(newTypes), "|").concat(ts.map(newTexts, function (t) { return t.length; }).join(","), "|").concat(newTexts.join(""));
52512
52635
  var type = templateLiteralTypes.get(id);
@@ -52565,11 +52688,12 @@ var ts;
52565
52688
  }
52566
52689
  function getStringMappingType(symbol, type) {
52567
52690
  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;
52691
+ type.flags & 128 ? getStringLiteralType(applyStringMapping(symbol, type.value)) :
52692
+ type.flags & 134217728 ? getTemplateLiteralType.apply(void 0, applyTemplateStringMapping(symbol, type.texts, type.types)) :
52693
+ type.flags & 268435456 && symbol === type.symbol ? type :
52694
+ type.flags & (1 | 4 | 268435456) || isGenericIndexType(type) ? getStringMappingTypeForGenericType(symbol, type) :
52695
+ isPatternLiteralPlaceholderType(type) ? getStringMappingTypeForGenericType(symbol, getTemplateLiteralType(["", ""], [type])) :
52696
+ type;
52573
52697
  }
52574
52698
  function applyStringMapping(symbol, str) {
52575
52699
  switch (intrinsicTypeKinds.get(symbol.escapedName)) {
@@ -52722,7 +52846,15 @@ var ts;
52722
52846
  return accessFlags & 1 ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
52723
52847
  }
52724
52848
  errorIfWritingToReadonlyIndex(indexInfo);
52725
- return accessFlags & 1 ? getUnionType([indexInfo.type, undefinedType]) : indexInfo.type;
52849
+ if ((accessFlags & 1) &&
52850
+ !(objectType.symbol &&
52851
+ objectType.symbol.flags & (256 | 128) &&
52852
+ (indexType.symbol &&
52853
+ indexType.flags & 1024 &&
52854
+ getParentOfSymbol(indexType.symbol) === objectType.symbol))) {
52855
+ return getUnionType([indexInfo.type, undefinedType]);
52856
+ }
52857
+ return indexInfo.type;
52726
52858
  }
52727
52859
  if (indexType.flags & 131072) {
52728
52860
  return neverType;
@@ -52825,10 +52957,11 @@ var ts;
52825
52957
  accessNode;
52826
52958
  }
52827
52959
  function isPatternLiteralPlaceholderType(type) {
52828
- return !!(type.flags & (1 | 4 | 8 | 64)) || !!(type.flags & 268435456 && isPatternLiteralPlaceholderType(type.type));
52960
+ return !!(type.flags & (1 | 4 | 8 | 64)) || isPatternLiteralType(type);
52829
52961
  }
52830
52962
  function isPatternLiteralType(type) {
52831
- return !!(type.flags & 134217728) && ts.every(type.types, isPatternLiteralPlaceholderType);
52963
+ return !!(type.flags & 134217728) && ts.every(type.types, isPatternLiteralPlaceholderType) ||
52964
+ !!(type.flags & 268435456) && isPatternLiteralPlaceholderType(type.type);
52832
52965
  }
52833
52966
  function isGenericType(type) {
52834
52967
  return !!getGenericObjectFlags(type);
@@ -53056,18 +53189,18 @@ var ts;
53056
53189
  var result;
53057
53190
  var extraTypes;
53058
53191
  var tailCount = 0;
53059
- var _loop_20 = function () {
53192
+ while (true) {
53060
53193
  if (tailCount === 1000) {
53061
53194
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
53062
53195
  result = errorType;
53063
- return "break";
53196
+ break;
53064
53197
  }
53065
53198
  var isUnwrapped = isTypicalNondistributiveConditional(root);
53066
53199
  var checkType = instantiateType(unwrapNondistributiveConditionalTuple(root, getActualTypeVariable(root.checkType)), mapper);
53067
53200
  var checkTypeInstantiable = isGenericType(checkType);
53068
53201
  var extendsType = instantiateType(unwrapNondistributiveConditionalTuple(root, root.extendsType), mapper);
53069
53202
  if (checkType === wildcardType || extendsType === wildcardType) {
53070
- return { value: wildcardType };
53203
+ return wildcardType;
53071
53204
  }
53072
53205
  var combinedMapper = void 0;
53073
53206
  if (root.inferTypeParameters) {
@@ -53083,7 +53216,7 @@ var ts;
53083
53216
  }
53084
53217
  }
53085
53218
  }
53086
- if (!checkTypeInstantiable || !ts.some(root.inferTypeParameters, function (t) { return t === extendsType; })) {
53219
+ if (!checkTypeInstantiable) {
53087
53220
  inferTypes(context.inferences, checkType, instantiateType(extendsType, freshMapper), 512 | 1024);
53088
53221
  }
53089
53222
  var innerMapper = combineTypeMappers(freshMapper, context.mapper);
@@ -53100,23 +53233,23 @@ var ts;
53100
53233
  var newRoot = falseType_1.root;
53101
53234
  if (newRoot.node.parent === root.node && (!newRoot.isDistributive || newRoot.checkType === root.checkType)) {
53102
53235
  root = newRoot;
53103
- return "continue";
53236
+ continue;
53104
53237
  }
53105
53238
  if (canTailRecurse(falseType_1, mapper)) {
53106
- return "continue";
53239
+ continue;
53107
53240
  }
53108
53241
  }
53109
53242
  result = instantiateType(falseType_1, mapper);
53110
- return "break";
53243
+ break;
53111
53244
  }
53112
53245
  if (inferredExtendsType.flags & 3 || isTypeAssignableTo(getRestrictiveInstantiation(checkType), getRestrictiveInstantiation(inferredExtendsType))) {
53113
53246
  var trueType_1 = getTypeFromTypeNode(root.node.trueType);
53114
53247
  var trueMapper = combinedMapper || mapper;
53115
53248
  if (canTailRecurse(trueType_1, trueMapper)) {
53116
- return "continue";
53249
+ continue;
53117
53250
  }
53118
53251
  result = instantiateType(trueType_1, trueMapper);
53119
- return "break";
53252
+ break;
53120
53253
  }
53121
53254
  }
53122
53255
  result = createType(16777216);
@@ -53127,14 +53260,7 @@ var ts;
53127
53260
  result.combinedMapper = combinedMapper;
53128
53261
  result.aliasSymbol = aliasSymbol || root.aliasSymbol;
53129
53262
  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;
53263
+ break;
53138
53264
  }
53139
53265
  return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
53140
53266
  function canTailRecurse(newType, newMapper) {
@@ -55350,7 +55476,7 @@ var ts;
55350
55476
  return 0;
55351
55477
  }
55352
55478
  }
55353
- var isPerformingCommonPropertyChecks = (relation !== comparableRelation || !(source.flags & 1048576) && isLiteralType(source)) &&
55479
+ var isPerformingCommonPropertyChecks = (relation !== comparableRelation || isUnitType(source)) &&
55354
55480
  !(intersectionState & 2) &&
55355
55481
  source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
55356
55482
  target.flags & (524288 | 2097152) && isWeakType(target) &&
@@ -55378,12 +55504,6 @@ var ts;
55378
55504
  var result_7 = skipCaching ?
55379
55505
  unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
55380
55506
  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
55507
  if (result_7) {
55388
55508
  return result_7;
55389
55509
  }
@@ -55492,7 +55612,7 @@ var ts;
55492
55612
  reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
55493
55613
  checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
55494
55614
  }
55495
- var _loop_21 = function (prop) {
55615
+ var _loop_20 = function (prop) {
55496
55616
  if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
55497
55617
  if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
55498
55618
  if (reportErrors) {
@@ -55545,9 +55665,9 @@ var ts;
55545
55665
  };
55546
55666
  for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
55547
55667
  var prop = _b[_i];
55548
- var state_7 = _loop_21(prop);
55549
- if (typeof state_7 === "object")
55550
- return state_7.value;
55668
+ var state_6 = _loop_20(prop);
55669
+ if (typeof state_6 === "object")
55670
+ return state_6.value;
55551
55671
  }
55552
55672
  return false;
55553
55673
  }
@@ -55727,8 +55847,7 @@ var ts;
55727
55847
  if (overflow) {
55728
55848
  return 0;
55729
55849
  }
55730
- var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 : 0);
55731
- var id = getRelationKey(source, target, keyIntersectionState, relation, false);
55850
+ var id = getRelationKey(source, target, intersectionState, relation, false);
55732
55851
  var entry = relation.get(id);
55733
55852
  if (entry !== undefined) {
55734
55853
  if (reportErrors && entry & 2 && !(entry & 4)) {
@@ -55752,7 +55871,7 @@ var ts;
55752
55871
  targetStack = [];
55753
55872
  }
55754
55873
  else {
55755
- var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, keyIntersectionState, relation, true) : undefined;
55874
+ var broadestEquivalentId = id.startsWith("*") ? getRelationKey(source, target, intersectionState, relation, true) : undefined;
55756
55875
  for (var i = 0; i < maybeCount; i++) {
55757
55876
  if (id === maybeKeys[i] || broadestEquivalentId && broadestEquivalentId === maybeKeys[i]) {
55758
55877
  return 3;
@@ -55834,10 +55953,18 @@ var ts;
55834
55953
  function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
55835
55954
  var saveErrorInfo = captureErrorCalculationState();
55836
55955
  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);
55956
+ if (relation !== identityRelation) {
55957
+ if (!result && (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576)) {
55958
+ var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
55959
+ if (constraint && everyType(constraint, function (c) { return c !== source; })) {
55960
+ result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState);
55961
+ }
55962
+ }
55963
+ if (result && !inPropertyCheck && (target.flags & 2097152 && !isGenericObjectType(target) && source.flags & (524288 | 2097152) ||
55964
+ isNonGenericObjectType(target) && !isArrayOrTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 262144); }))) {
55965
+ inPropertyCheck = true;
55966
+ result &= propertiesRelatedTo(source, target, reportErrors, undefined, 0);
55967
+ inPropertyCheck = false;
55841
55968
  }
55842
55969
  }
55843
55970
  if (result) {
@@ -55846,9 +55973,6 @@ var ts;
55846
55973
  return result;
55847
55974
  }
55848
55975
  function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState, saveErrorInfo) {
55849
- if (intersectionState & 4) {
55850
- return propertiesRelatedTo(source, target, reportErrors, undefined, 0);
55851
- }
55852
55976
  var result;
55853
55977
  var originalErrorInfo;
55854
55978
  var varianceCheckFailed = false;
@@ -55934,7 +56058,7 @@ var ts;
55934
56058
  if (relation === comparableRelation && sourceFlags & 262144) {
55935
56059
  var constraint = getConstraintOfTypeParameter(source);
55936
56060
  if (constraint && hasNonCircularBaseConstraint(source)) {
55937
- while (constraint && constraint.flags & 262144) {
56061
+ while (constraint && someType(constraint, function (c) { return !!(c.flags & 262144); })) {
55938
56062
  if (result = isRelatedTo(constraint, target, 1, false)) {
55939
56063
  return result;
55940
56064
  }
@@ -56324,11 +56448,11 @@ var ts;
56324
56448
  }
56325
56449
  var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
56326
56450
  var matchingTypes = [];
56327
- var _loop_22 = function (combination) {
56451
+ var _loop_21 = function (combination) {
56328
56452
  var hasMatch = false;
56329
56453
  outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
56330
56454
  var type = _d[_c];
56331
- var _loop_23 = function (i) {
56455
+ var _loop_22 = function (i) {
56332
56456
  var sourceProperty = sourcePropertiesFiltered[i];
56333
56457
  var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
56334
56458
  if (!targetProperty)
@@ -56341,8 +56465,8 @@ var ts;
56341
56465
  }
56342
56466
  };
56343
56467
  for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
56344
- var state_9 = _loop_23(i);
56345
- switch (state_9) {
56468
+ var state_8 = _loop_22(i);
56469
+ switch (state_8) {
56346
56470
  case "continue-outer": continue outer;
56347
56471
  }
56348
56472
  }
@@ -56355,9 +56479,9 @@ var ts;
56355
56479
  };
56356
56480
  for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
56357
56481
  var combination = discriminantCombinations_1[_a];
56358
- var state_8 = _loop_22(combination);
56359
- if (typeof state_8 === "object")
56360
- return state_8.value;
56482
+ var state_7 = _loop_21(combination);
56483
+ if (typeof state_7 === "object")
56484
+ return state_7.value;
56361
56485
  }
56362
56486
  var result = -1;
56363
56487
  for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
@@ -56441,7 +56565,7 @@ var ts;
56441
56565
  }
56442
56566
  return 0;
56443
56567
  }
56444
- if (!skipOptional && sourceProp.flags & 16777216 && !(targetProp.flags & 16777216)) {
56568
+ if (!skipOptional && sourceProp.flags & 16777216 && targetProp.flags & 106500 && !(targetProp.flags & 16777216)) {
56445
56569
  if (reportErrors) {
56446
56570
  reportError(ts.Diagnostics.Property_0_is_optional_in_type_1_but_required_in_type_2, symbolToString(targetProp), typeToString(source), typeToString(target));
56447
56571
  }
@@ -56999,7 +57123,7 @@ var ts;
56999
57123
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
57000
57124
  links.variances = ts.emptyArray;
57001
57125
  var variances = [];
57002
- var _loop_24 = function (tp) {
57126
+ var _loop_23 = function (tp) {
57003
57127
  var modifiers = getVarianceModifiers(tp);
57004
57128
  var variance = modifiers & 65536 ?
57005
57129
  modifiers & 32768 ? 0 : 1 :
@@ -57030,7 +57154,7 @@ var ts;
57030
57154
  };
57031
57155
  for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
57032
57156
  var tp = typeParameters_2[_i];
57033
- _loop_24(tp);
57157
+ _loop_23(tp);
57034
57158
  }
57035
57159
  links.variances = variances;
57036
57160
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
@@ -57412,8 +57536,7 @@ var ts;
57412
57536
  return !!(type.flags & 109440);
57413
57537
  }
57414
57538
  function isUnitLikeType(type) {
57415
- return type.flags & 2097152 ? ts.some(type.types, isUnitType) :
57416
- !!(type.flags & 109440);
57539
+ return isUnitType(getBaseConstraintOrType(type));
57417
57540
  }
57418
57541
  function extractUnitType(type) {
57419
57542
  return type.flags & 2097152 ? ts.find(type.types, isUnitType) || type : type;
@@ -58178,7 +58301,7 @@ var ts;
58178
58301
  && (!roundTripOnly || s === ts.pseudoBigIntToString({ negative: negative, base10Value: ts.parsePseudoBigInt(scanner.getTokenValue()) }));
58179
58302
  }
58180
58303
  function isMemberOfStringMapping(source, target) {
58181
- if (target.flags & (4 | 3)) {
58304
+ if (target.flags & (4 | 1)) {
58182
58305
  return true;
58183
58306
  }
58184
58307
  if (target.flags & 134217728) {
@@ -58675,7 +58798,7 @@ var ts;
58675
58798
  var matches = inferTypesFromTemplateLiteralType(source, target);
58676
58799
  var types = target.types;
58677
58800
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
58678
- var _loop_25 = function (i) {
58801
+ var _loop_24 = function (i) {
58679
58802
  var source_1 = matches ? matches[i] : neverType;
58680
58803
  var target_3 = types[i];
58681
58804
  if (source_1.flags & 128 && target_3.flags & 8650752) {
@@ -58719,7 +58842,7 @@ var ts;
58719
58842
  inferFromTypes(source_1, target_3);
58720
58843
  };
58721
58844
  for (var i = 0; i < types.length; i++) {
58722
- _loop_25(i);
58845
+ _loop_24(i);
58723
58846
  }
58724
58847
  }
58725
58848
  }
@@ -59126,7 +59249,7 @@ var ts;
59126
59249
  }
59127
59250
  if (ts.isEntityNameExpression(node.argumentExpression)) {
59128
59251
  var symbol = resolveEntityName(node.argumentExpression, 111551, true);
59129
- if (!symbol || !isConstVariable(symbol))
59252
+ if (!symbol || !(isConstVariable(symbol) || (symbol.flags & 8)))
59130
59253
  return undefined;
59131
59254
  var declaration = symbol.valueDeclaration;
59132
59255
  if (declaration === undefined)
@@ -59140,7 +59263,12 @@ var ts;
59140
59263
  }
59141
59264
  if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
59142
59265
  var initializer = ts.getEffectiveInitializer(declaration);
59143
- return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
59266
+ if (initializer) {
59267
+ return tryGetNameFromType(getTypeOfExpression(initializer));
59268
+ }
59269
+ if (ts.isEnumMember(declaration)) {
59270
+ return ts.getTextOfPropertyName(declaration.name);
59271
+ }
59144
59272
  }
59145
59273
  }
59146
59274
  return undefined;
@@ -59194,7 +59322,7 @@ var ts;
59194
59322
  function mapTypesByKeyProperty(types, name) {
59195
59323
  var map = new ts.Map();
59196
59324
  var count = 0;
59197
- var _loop_26 = function (type) {
59325
+ var _loop_25 = function (type) {
59198
59326
  if (type.flags & (524288 | 2097152 | 58982400)) {
59199
59327
  var discriminant = getTypeOfPropertyOfType(type, name);
59200
59328
  if (discriminant) {
@@ -59220,9 +59348,9 @@ var ts;
59220
59348
  };
59221
59349
  for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
59222
59350
  var type = types_15[_i];
59223
- var state_10 = _loop_26(type);
59224
- if (typeof state_10 === "object")
59225
- return state_10.value;
59351
+ var state_9 = _loop_25(type);
59352
+ if (typeof state_9 === "object")
59353
+ return state_9.value;
59226
59354
  }
59227
59355
  return count >= 10 && count * 2 >= types.length ? map : undefined;
59228
59356
  }
@@ -59770,6 +59898,7 @@ var ts;
59770
59898
  ts.isInJSFile(node) && ts.hasInitializer(node) && node.initializer && ts.isFunctionExpressionOrArrowFunction(node.initializer) && ts.getEffectiveReturnTypeNode(node.initializer));
59771
59899
  }
59772
59900
  function getExplicitTypeOfSymbol(symbol, diagnostic) {
59901
+ symbol = resolveSymbol(symbol);
59773
59902
  if (symbol.flags & (16 | 8192 | 32 | 512)) {
59774
59903
  return getTypeOfSymbol(symbol);
59775
59904
  }
@@ -59804,7 +59933,7 @@ var ts;
59804
59933
  switch (node.kind) {
59805
59934
  case 79:
59806
59935
  var symbol = getExportSymbolOfValueSymbolIfExported(getResolvedSymbol(node));
59807
- return getExplicitTypeOfSymbol(symbol.flags & 2097152 ? resolveAlias(symbol) : symbol, diagnostic);
59936
+ return getExplicitTypeOfSymbol(symbol, diagnostic);
59808
59937
  case 108:
59809
59938
  return getExplicitThisType(node);
59810
59939
  case 106:
@@ -60243,7 +60372,7 @@ var ts;
60243
60372
  type = narrowTypeBySwitchOnDiscriminant(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
60244
60373
  }
60245
60374
  else if (expr.kind === 218 && isMatchingReference(reference, expr.expression)) {
60246
- type = narrowBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
60375
+ type = narrowTypeBySwitchOnTypeOf(type, flow.switchStatement, flow.clauseStart, flow.clauseEnd);
60247
60376
  }
60248
60377
  else {
60249
60378
  if (strictNullChecks) {
@@ -60476,7 +60605,7 @@ var ts;
60476
60605
  !!(prop.flags & 16777216) || assumeTrue :
60477
60606
  !!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
60478
60607
  }
60479
- function narrowByInKeyword(type, nameType, assumeTrue) {
60608
+ function narrowTypeByInKeyword(type, nameType, assumeTrue) {
60480
60609
  var name = getPropertyNameFromType(nameType);
60481
60610
  var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, true); });
60482
60611
  if (isKnownProperty) {
@@ -60553,7 +60682,7 @@ var ts;
60553
60682
  return getTypeWithFacts(type, assumeTrue ? 524288 : 65536);
60554
60683
  }
60555
60684
  if (isMatchingReference(reference, target)) {
60556
- return narrowByInKeyword(type, leftType, assumeTrue);
60685
+ return narrowTypeByInKeyword(type, leftType, assumeTrue);
60557
60686
  }
60558
60687
  }
60559
60688
  break;
@@ -60715,7 +60844,7 @@ var ts;
60715
60844
  neverType;
60716
60845
  });
60717
60846
  }
60718
- function narrowBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
60847
+ function narrowTypeBySwitchOnTypeOf(type, switchStatement, clauseStart, clauseEnd) {
60719
60848
  var witnesses = getSwitchClauseTypeOfWitnesses(switchStatement);
60720
60849
  if (!witnesses) {
60721
60850
  return type;
@@ -61042,12 +61171,12 @@ var ts;
61042
61171
  });
61043
61172
  }
61044
61173
  function markAliasReferenced(symbol, location) {
61045
- if (isNonLocalAlias(symbol, 111551) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {
61174
+ if (isNonLocalAlias(symbol, 111551) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol, 111551)) {
61046
61175
  var target = resolveAlias(symbol);
61047
- if (target.flags & 111551) {
61176
+ if (getAllSymbolFlags(target) & (111551 | 1048576)) {
61048
61177
  if (compilerOptions.isolatedModules ||
61049
61178
  ts.shouldPreserveConstEnums(compilerOptions) && isExportOrExportExpression(location) ||
61050
- !isConstEnumOrConstEnumOnlyModule(target)) {
61179
+ !isConstEnumOrConstEnumOnlyModule(getExportSymbolOfValueSymbolIfExported(target))) {
61051
61180
  markAliasSymbolAsReferenced(symbol);
61052
61181
  }
61053
61182
  else {
@@ -61209,7 +61338,7 @@ var ts;
61209
61338
  (isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !isSymbolAssigned(localOrExportSymbol))) {
61210
61339
  flowContainer = getControlFlowContainer(flowContainer);
61211
61340
  }
61212
- var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || ts.isBindingElement(declaration) ||
61341
+ var assumeInitialized = isParameter || isAlias || isOuterVariable || isSpreadDestructuringAssignmentTarget || isModuleExports || isSameScopedBindingElement(node, declaration) ||
61213
61342
  type !== autoType && type !== autoArrayType && (!strictNullChecks || (type.flags & (3 | 16384)) !== 0 ||
61214
61343
  isInTypeQuery(node) || node.parent.kind === 278) ||
61215
61344
  node.parent.kind === 232 ||
@@ -61234,6 +61363,12 @@ var ts;
61234
61363
  }
61235
61364
  return assignmentKind ? getBaseTypeOfLiteralType(flowType) : flowType;
61236
61365
  }
61366
+ function isSameScopedBindingElement(node, declaration) {
61367
+ if (ts.isBindingElement(declaration)) {
61368
+ var bindingElement = ts.findAncestor(node, ts.isBindingElement);
61369
+ return bindingElement && ts.getRootDeclaration(bindingElement) === ts.getRootDeclaration(declaration);
61370
+ }
61371
+ }
61237
61372
  function shouldMarkIdentifierAliasReferenced(node) {
61238
61373
  var _a;
61239
61374
  var parent = node.parent;
@@ -61532,11 +61667,16 @@ var ts;
61532
61667
  var immediateContainer = ts.getSuperContainer(node, true);
61533
61668
  var container = immediateContainer;
61534
61669
  var needToCaptureLexicalThis = false;
61670
+ var inAsyncFunction = false;
61535
61671
  if (!isCallExpression) {
61536
61672
  while (container && container.kind === 216) {
61673
+ if (ts.hasSyntacticModifier(container, 512))
61674
+ inAsyncFunction = true;
61537
61675
  container = ts.getSuperContainer(container, true);
61538
61676
  needToCaptureLexicalThis = languageVersion < 2;
61539
61677
  }
61678
+ if (container && ts.hasSyntacticModifier(container, 512))
61679
+ inAsyncFunction = true;
61540
61680
  }
61541
61681
  var canUseSuperExpression = isLegalUsageOfSuperExpression(container);
61542
61682
  var nodeCheckFlag = 0;
@@ -61575,7 +61715,7 @@ var ts;
61575
61715
  nodeCheckFlag = 256;
61576
61716
  }
61577
61717
  getNodeLinks(node).flags |= nodeCheckFlag;
61578
- if (container.kind === 171 && ts.hasSyntacticModifier(container, 512)) {
61718
+ if (container.kind === 171 && inAsyncFunction) {
61579
61719
  if (ts.isSuperProperty(node.parent) && ts.isAssignmentTarget(node.parent)) {
61580
61720
  getNodeLinks(container).flags |= 4096;
61581
61721
  }
@@ -62195,7 +62335,7 @@ var ts;
62195
62335
  function instantiateContextualType(contextualType, node, contextFlags) {
62196
62336
  if (contextualType && maybeTypeOfKind(contextualType, 465829888)) {
62197
62337
  var inferenceContext = getInferenceContext(node);
62198
- if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences, hasInferenceCandidates)) {
62338
+ if (inferenceContext && contextFlags & 1 && ts.some(inferenceContext.inferences, hasInferenceCandidatesOrDefault)) {
62199
62339
  return instantiateInstantiableTypes(contextualType, inferenceContext.nonFixingMapper);
62200
62340
  }
62201
62341
  if (inferenceContext === null || inferenceContext === void 0 ? void 0 : inferenceContext.returnMapper) {
@@ -64724,7 +64864,7 @@ var ts;
64724
64864
  var spreadIndex = getSpreadArgumentIndex(args);
64725
64865
  if (spreadIndex >= 0) {
64726
64866
  var effectiveArgs_1 = args.slice(0, spreadIndex);
64727
- var _loop_27 = function (i) {
64867
+ var _loop_26 = function (i) {
64728
64868
  var arg = args[i];
64729
64869
  var spreadType = arg.kind === 227 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
64730
64870
  if (spreadType && isTupleType(spreadType)) {
@@ -64740,7 +64880,7 @@ var ts;
64740
64880
  }
64741
64881
  };
64742
64882
  for (var i = spreadIndex; i < args.length; i++) {
64743
- _loop_27(i);
64883
+ _loop_26(i);
64744
64884
  }
64745
64885
  return effectiveArgs_1;
64746
64886
  }
@@ -64990,7 +65130,7 @@ var ts;
64990
65130
  var min_3 = Number.MAX_VALUE;
64991
65131
  var minIndex = 0;
64992
65132
  var i_1 = 0;
64993
- var _loop_28 = function (c) {
65133
+ var _loop_27 = function (c) {
64994
65134
  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
65135
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
64996
65136
  if (diags_2) {
@@ -65008,7 +65148,7 @@ var ts;
65008
65148
  };
65009
65149
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
65010
65150
  var c = candidatesForArgumentError_1[_a];
65011
- _loop_28(c);
65151
+ _loop_27(c);
65012
65152
  }
65013
65153
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
65014
65154
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -65151,7 +65291,7 @@ var ts;
65151
65291
  }
65152
65292
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
65153
65293
  var parameters = [];
65154
- var _loop_29 = function (i) {
65294
+ var _loop_28 = function (i) {
65155
65295
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
65156
65296
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
65157
65297
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -65159,7 +65299,7 @@ var ts;
65159
65299
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
65160
65300
  };
65161
65301
  for (var i = 0; i < maxNonRestParam; i++) {
65162
- _loop_29(i);
65302
+ _loop_28(i);
65163
65303
  }
65164
65304
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
65165
65305
  var flags = 0;
@@ -65994,7 +66134,7 @@ var ts;
65994
66134
  if (symbol && symbol.flags & 2097152) {
65995
66135
  symbol = resolveAlias(symbol);
65996
66136
  }
65997
- return !!(symbol && (symbol.flags & 384) && getEnumKind(symbol) === 1);
66137
+ return !!(symbol && (getAllSymbolFlags(symbol) & 384) && getEnumKind(symbol) === 1);
65998
66138
  }
65999
66139
  return false;
66000
66140
  }
@@ -66619,7 +66759,17 @@ var ts;
66619
66759
  }
66620
66760
  function isExhaustiveSwitchStatement(node) {
66621
66761
  var links = getNodeLinks(node);
66622
- return links.isExhaustive !== undefined ? links.isExhaustive : (links.isExhaustive = computeExhaustiveSwitchStatement(node));
66762
+ if (links.isExhaustive === undefined) {
66763
+ links.isExhaustive = 0;
66764
+ var exhaustive = computeExhaustiveSwitchStatement(node);
66765
+ if (links.isExhaustive === 0) {
66766
+ links.isExhaustive = exhaustive;
66767
+ }
66768
+ }
66769
+ else if (links.isExhaustive === 0) {
66770
+ links.isExhaustive = false;
66771
+ }
66772
+ return links.isExhaustive;
66623
66773
  }
66624
66774
  function computeExhaustiveSwitchStatement(node) {
66625
66775
  if (node.expression.kind === 218) {
@@ -66627,14 +66777,14 @@ var ts;
66627
66777
  if (!witnesses) {
66628
66778
  return false;
66629
66779
  }
66630
- var operandConstraint = getBaseConstraintOrType(getTypeOfExpression(node.expression.expression));
66780
+ var operandConstraint = getBaseConstraintOrType(checkExpressionCached(node.expression.expression));
66631
66781
  var notEqualFacts_2 = getNotEqualFactsFromTypeofSwitch(0, 0, witnesses);
66632
66782
  if (operandConstraint.flags & 3) {
66633
66783
  return (556800 & notEqualFacts_2) === 556800;
66634
66784
  }
66635
66785
  return !someType(operandConstraint, function (t) { return (getTypeFacts(t) & notEqualFacts_2) === notEqualFacts_2; });
66636
66786
  }
66637
- var type = getTypeOfExpression(node.expression);
66787
+ var type = checkExpressionCached(node.expression);
66638
66788
  if (!isLiteralType(type)) {
66639
66789
  return false;
66640
66790
  }
@@ -68144,6 +68294,9 @@ var ts;
68144
68294
  function hasInferenceCandidates(info) {
68145
68295
  return !!(info.candidates || info.contraCandidates);
68146
68296
  }
68297
+ function hasInferenceCandidatesOrDefault(info) {
68298
+ return !!(info.candidates || info.contraCandidates || hasTypeParameterDefault(info.typeParameter));
68299
+ }
68147
68300
  function hasOverlappingInferences(a, b) {
68148
68301
  for (var i = 0; i < a.length; i++) {
68149
68302
  if (hasInferenceCandidates(a[i]) && hasInferenceCandidates(b[i])) {
@@ -68776,7 +68929,7 @@ var ts;
68776
68929
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
68777
68930
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
68778
68931
  var indexSignatureMap_1 = new ts.Map();
68779
- var _loop_30 = function (declaration) {
68932
+ var _loop_29 = function (declaration) {
68780
68933
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
68781
68934
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
68782
68935
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -68791,7 +68944,7 @@ var ts;
68791
68944
  };
68792
68945
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
68793
68946
  var declaration = _a[_i];
68794
- _loop_30(declaration);
68947
+ _loop_29(declaration);
68795
68948
  }
68796
68949
  indexSignatureMap_1.forEach(function (entry) {
68797
68950
  if (entry.declarations.length > 1) {
@@ -69037,7 +69190,7 @@ var ts;
69037
69190
  }
69038
69191
  var symbol = getNodeLinks(node).resolvedSymbol;
69039
69192
  if (symbol) {
69040
- if (ts.some(symbol.declarations, function (d) { return isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
69193
+ if (ts.some(symbol.declarations, function (d) { return ts.isTypeDeclaration(d) && !!(d.flags & 268435456); })) {
69041
69194
  addDeprecatedSuggestion(getDeprecatedSuggestionNode(node), symbol.declarations, symbol.escapedName);
69042
69195
  }
69043
69196
  if (type.flags & 32 && symbol.flags & 8) {
@@ -69571,7 +69724,7 @@ var ts;
69571
69724
  if (isReferenceToType(type, getGlobalPromiseType(false))) {
69572
69725
  return typeAsPromise.promisedTypeOfPromise = getTypeArguments(type)[0];
69573
69726
  }
69574
- if (allTypesAssignableToKind(type, 131068 | 131072)) {
69727
+ if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 | 131072)) {
69575
69728
  return undefined;
69576
69729
  }
69577
69730
  var thenFunction = getTypeOfPropertyOfType(type, "then");
@@ -69627,7 +69780,7 @@ var ts;
69627
69780
  return awaitedType || errorType;
69628
69781
  }
69629
69782
  function isThenableType(type) {
69630
- if (allTypesAssignableToKind(type, 131068 | 131072)) {
69783
+ if (allTypesAssignableToKind(getBaseConstraintOrType(type), 131068 | 131072)) {
69631
69784
  return false;
69632
69785
  }
69633
69786
  var thenFunction = getTypeOfPropertyOfType(type, "then");
@@ -69653,7 +69806,7 @@ var ts;
69653
69806
  if (isGenericObjectType(type)) {
69654
69807
  var baseConstraint = getBaseConstraintOfType(type);
69655
69808
  if (baseConstraint ?
69656
- baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || isThenableType(baseConstraint) :
69809
+ baseConstraint.flags & 3 || isEmptyObjectType(baseConstraint) || someType(baseConstraint, isThenableType) :
69657
69810
  maybeTypeOfKind(type, 8650752)) {
69658
69811
  return true;
69659
69812
  }
@@ -70158,7 +70311,7 @@ var ts;
70158
70311
  }
70159
70312
  function errorUnusedLocal(declaration, name, addDiagnostic) {
70160
70313
  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;
70314
+ 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
70315
  addDiagnostic(declaration, 0, ts.createDiagnosticForNode(node, message, name));
70163
70316
  }
70164
70317
  function isIdentifierThatStartsWithUnderscore(node) {
@@ -71335,7 +71488,13 @@ var ts;
71335
71488
  var message = allowAsyncIterables
71336
71489
  ? ts.Diagnostics.Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator
71337
71490
  : ts.Diagnostics.Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator;
71338
- return errorAndMaybeSuggestAwait(errorNode, !!getAwaitedTypeOfPromise(type), message, typeToString(type));
71491
+ var suggestAwait = !!getAwaitedTypeOfPromise(type)
71492
+ || (!allowAsyncIterables &&
71493
+ ts.isForOfStatement(errorNode.parent) &&
71494
+ errorNode.parent.expression === errorNode &&
71495
+ getGlobalAsyncIterableType(false) !== emptyGenericType &&
71496
+ isTypeAssignableTo(type, getGlobalAsyncIterableType(false)));
71497
+ return errorAndMaybeSuggestAwait(errorNode, suggestAwait, message, typeToString(type));
71339
71498
  }
71340
71499
  function getIterationTypesOfIterator(type, resolver, errorNode, errorOutputContainer) {
71341
71500
  return getIterationTypesOfIteratorWorker(type, resolver, errorNode, errorOutputContainer, false);
@@ -71731,7 +71890,7 @@ var ts;
71731
71890
  var propDeclaration = declaration && declaration.kind === 223 ||
71732
71891
  name && name.kind === 164 ? declaration : undefined;
71733
71892
  var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
71734
- var _loop_31 = function (info) {
71893
+ var _loop_30 = function (info) {
71735
71894
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
71736
71895
  var errorNode = localPropDeclaration || localIndexDeclaration ||
71737
71896
  (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
@@ -71745,7 +71904,7 @@ var ts;
71745
71904
  };
71746
71905
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
71747
71906
  var info = indexInfos_9[_i];
71748
- _loop_31(info);
71907
+ _loop_30(info);
71749
71908
  }
71750
71909
  }
71751
71910
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -71753,7 +71912,7 @@ var ts;
71753
71912
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
71754
71913
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 261) : undefined;
71755
71914
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
71756
- var _loop_32 = function (info) {
71915
+ var _loop_31 = function (info) {
71757
71916
  if (info === checkInfo)
71758
71917
  return "continue";
71759
71918
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -71765,7 +71924,7 @@ var ts;
71765
71924
  };
71766
71925
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
71767
71926
  var info = indexInfos_10[_i];
71768
- _loop_32(info);
71927
+ _loop_31(info);
71769
71928
  }
71770
71929
  }
71771
71930
  function checkTypeNameIsReserved(name, message) {
@@ -71815,7 +71974,7 @@ var ts;
71815
71974
  }
71816
71975
  else {
71817
71976
  ts.forEach(jsdocParameters, function (_a, index) {
71818
- var name = _a.name;
71977
+ var name = _a.name, isNameFirst = _a.isNameFirst;
71819
71978
  if (excludedParameters.has(index) || ts.isIdentifier(name) && parameters.has(name.escapedText)) {
71820
71979
  return;
71821
71980
  }
@@ -71825,7 +71984,9 @@ var ts;
71825
71984
  }
71826
71985
  }
71827
71986
  else {
71828
- errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
71987
+ if (!isNameFirst) {
71988
+ errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
71989
+ }
71829
71990
  }
71830
71991
  });
71831
71992
  }
@@ -72060,7 +72221,7 @@ var ts;
72060
72221
  var baseTypes = baseTypeNode && getBaseTypes(type);
72061
72222
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
72062
72223
  var baseStaticType = getBaseConstructorTypeOfClass(type);
72063
- var _loop_33 = function (member) {
72224
+ var _loop_32 = function (member) {
72064
72225
  if (ts.hasAmbientModifier(member)) {
72065
72226
  return "continue";
72066
72227
  }
@@ -72075,7 +72236,7 @@ var ts;
72075
72236
  };
72076
72237
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
72077
72238
  var member = _a[_i];
72078
- _loop_33(member);
72239
+ _loop_32(member);
72079
72240
  }
72080
72241
  }
72081
72242
  function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
@@ -72150,7 +72311,7 @@ var ts;
72150
72311
  }
72151
72312
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
72152
72313
  var issuedMemberError = false;
72153
- var _loop_34 = function (member) {
72314
+ var _loop_33 = function (member) {
72154
72315
  if (ts.isStatic(member)) {
72155
72316
  return "continue";
72156
72317
  }
@@ -72168,7 +72329,7 @@ var ts;
72168
72329
  };
72169
72330
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
72170
72331
  var member = _a[_i];
72171
- _loop_34(member);
72332
+ _loop_33(member);
72172
72333
  }
72173
72334
  if (!issuedMemberError) {
72174
72335
  checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
@@ -72215,7 +72376,7 @@ var ts;
72215
72376
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
72216
72377
  var _a, _b, _c, _d;
72217
72378
  var baseProperties = getPropertiesOfType(baseType);
72218
- var _loop_35 = function (baseProperty) {
72379
+ var _loop_34 = function (baseProperty) {
72219
72380
  var base = getTargetSymbol(baseProperty);
72220
72381
  if (base.flags & 4194304) {
72221
72382
  return "continue";
@@ -72313,8 +72474,8 @@ var ts;
72313
72474
  };
72314
72475
  basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
72315
72476
  var baseProperty = baseProperties_1[_i];
72316
- var state_11 = _loop_35(baseProperty);
72317
- switch (state_11) {
72477
+ var state_10 = _loop_34(baseProperty);
72478
+ switch (state_10) {
72318
72479
  case "continue-basePropertyCheck": continue basePropertyCheck;
72319
72480
  }
72320
72481
  }
@@ -72800,11 +72961,10 @@ var ts;
72800
72961
  }
72801
72962
  }
72802
72963
  function checkModuleAugmentationElement(node, isGlobalAugmentation) {
72803
- var _a;
72804
72964
  switch (node.kind) {
72805
72965
  case 240:
72806
- for (var _i = 0, _b = node.declarationList.declarations; _i < _b.length; _i++) {
72807
- var decl = _b[_i];
72966
+ for (var _i = 0, _a = node.declarationList.declarations; _i < _a.length; _i++) {
72967
+ var decl = _a[_i];
72808
72968
  checkModuleAugmentationElement(decl, isGlobalAugmentation);
72809
72969
  }
72810
72970
  break;
@@ -72820,8 +72980,8 @@ var ts;
72820
72980
  case 257:
72821
72981
  var name = node.name;
72822
72982
  if (ts.isBindingPattern(name)) {
72823
- for (var _c = 0, _d = name.elements; _c < _d.length; _c++) {
72824
- var el = _d[_c];
72983
+ for (var _b = 0, _c = name.elements; _b < _c.length; _b++) {
72984
+ var el = _c[_b];
72825
72985
  checkModuleAugmentationElement(el, isGlobalAugmentation);
72826
72986
  }
72827
72987
  break;
@@ -72835,13 +72995,6 @@ var ts;
72835
72995
  if (isGlobalAugmentation) {
72836
72996
  return;
72837
72997
  }
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
72998
  break;
72846
72999
  }
72847
73000
  }
@@ -72929,10 +73082,11 @@ var ts;
72929
73082
  }
72930
73083
  return;
72931
73084
  }
73085
+ var targetFlags = getAllSymbolFlags(target);
72932
73086
  var excludedMeanings = (symbol.flags & (111551 | 1048576) ? 111551 : 0) |
72933
73087
  (symbol.flags & 788968 ? 788968 : 0) |
72934
73088
  (symbol.flags & 1920 ? 1920 : 0);
72935
- if (target.flags & excludedMeanings) {
73089
+ if (targetFlags & excludedMeanings) {
72936
73090
  var message = node.kind === 278 ?
72937
73091
  ts.Diagnostics.Export_declaration_conflicts_with_exported_declaration_of_0 :
72938
73092
  ts.Diagnostics.Import_declaration_conflicts_with_local_declaration_of_0;
@@ -72942,7 +73096,7 @@ var ts;
72942
73096
  && !ts.isTypeOnlyImportOrExportDeclaration(node)
72943
73097
  && !(node.flags & 16777216)) {
72944
73098
  var typeOnlyAlias = getTypeOnlyAliasDeclaration(symbol);
72945
- var isType = !(target.flags & 111551);
73099
+ var isType = !(targetFlags & 111551);
72946
73100
  if (isType || typeOnlyAlias) {
72947
73101
  switch (node.kind) {
72948
73102
  case 270:
@@ -73096,13 +73250,14 @@ var ts;
73096
73250
  if (node.moduleReference.kind !== 280) {
73097
73251
  var target = resolveAlias(getSymbolOfNode(node));
73098
73252
  if (target !== unknownSymbol) {
73099
- if (target.flags & 111551) {
73253
+ var targetFlags = getAllSymbolFlags(target);
73254
+ if (targetFlags & 111551) {
73100
73255
  var moduleName = ts.getFirstIdentifier(node.moduleReference);
73101
73256
  if (!(resolveEntityName(moduleName, 111551 | 1920).flags & 1920)) {
73102
73257
  error(moduleName, ts.Diagnostics.Module_0_is_hidden_by_a_local_declaration_with_the_same_name, ts.declarationNameToString(moduleName));
73103
73258
  }
73104
73259
  }
73105
- if (target.flags & 788968) {
73260
+ if (targetFlags & 788968) {
73106
73261
  checkTypeNameIsReserved(node.name, ts.Diagnostics.Import_name_cannot_be_0);
73107
73262
  }
73108
73263
  }
@@ -73229,7 +73384,7 @@ var ts;
73229
73384
  markExportAsReferenced(node);
73230
73385
  }
73231
73386
  var target = symbol && (symbol.flags & 2097152 ? resolveAlias(symbol) : symbol);
73232
- if (!target || target === unknownSymbol || target.flags & 111551) {
73387
+ if (!target || getAllSymbolFlags(target) & 111551) {
73233
73388
  checkExpressionCached(node.propertyName || node.name);
73234
73389
  }
73235
73390
  }
@@ -73273,7 +73428,7 @@ var ts;
73273
73428
  if (sym) {
73274
73429
  markAliasReferenced(sym, id);
73275
73430
  var target = sym.flags & 2097152 ? resolveAlias(sym) : sym;
73276
- if (target === unknownSymbol || target.flags & 111551) {
73431
+ if (getAllSymbolFlags(target) & 111551) {
73277
73432
  checkExpressionCached(node.expression);
73278
73433
  }
73279
73434
  }
@@ -73870,29 +74025,9 @@ var ts;
73870
74025
  }
73871
74026
  function isTypeDeclarationName(name) {
73872
74027
  return name.kind === 79 &&
73873
- isTypeDeclaration(name.parent) &&
74028
+ ts.isTypeDeclaration(name.parent) &&
73874
74029
  ts.getNameOfDeclaration(name.parent) === name;
73875
74030
  }
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
74031
  function isTypeReferenceIdentifier(node) {
73897
74032
  while (node.parent.kind === 163) {
73898
74033
  node = node.parent;
@@ -74287,7 +74422,7 @@ var ts;
74287
74422
  var baseType = ts.firstOrUndefined(getBaseTypes(classType));
74288
74423
  return baseType ? getTypeWithThisArgument(baseType, classType.thisType) : errorType;
74289
74424
  }
74290
- if (isTypeDeclaration(node)) {
74425
+ if (ts.isTypeDeclaration(node)) {
74291
74426
  var symbol = getSymbolOfNode(node);
74292
74427
  return getDeclaredTypeOfSymbol(symbol);
74293
74428
  }
@@ -74445,7 +74580,7 @@ var ts;
74445
74580
  return symbolLinks.exportsSomeValue;
74446
74581
  function isValue(s) {
74447
74582
  s = resolveSymbol(s);
74448
- return s && !!(s.flags & 111551);
74583
+ return s && !!(getAllSymbolFlags(s) & 111551);
74449
74584
  }
74450
74585
  }
74451
74586
  function isNameOfModuleOrEnumDeclaration(node) {
@@ -74484,7 +74619,7 @@ var ts;
74484
74619
  var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
74485
74620
  if (node) {
74486
74621
  var symbol = getReferencedValueOrAliasSymbol(node);
74487
- if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol)) {
74622
+ if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol, 111551)) {
74488
74623
  return getDeclarationOfAliasSymbol(symbol);
74489
74624
  }
74490
74625
  }
@@ -74551,7 +74686,7 @@ var ts;
74551
74686
  case 273:
74552
74687
  case 278:
74553
74688
  var symbol = getSymbolOfNode(node);
74554
- return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol);
74689
+ return !!symbol && isAliasResolvedToValue(symbol) && !getTypeOnlyAliasDeclaration(symbol, 111551);
74555
74690
  case 275:
74556
74691
  var exportClause = node.exportClause;
74557
74692
  return !!exportClause && (ts.isNamespaceExport(exportClause) ||
@@ -74572,6 +74707,7 @@ var ts;
74572
74707
  return isValue && node.moduleReference && !ts.nodeIsMissing(node.moduleReference);
74573
74708
  }
74574
74709
  function isAliasResolvedToValue(symbol) {
74710
+ var _a;
74575
74711
  if (!symbol) {
74576
74712
  return false;
74577
74713
  }
@@ -74579,7 +74715,7 @@ var ts;
74579
74715
  if (target === unknownSymbol) {
74580
74716
  return true;
74581
74717
  }
74582
- return !!(target.flags & 111551) &&
74718
+ return !!(((_a = getAllSymbolFlags(target)) !== null && _a !== void 0 ? _a : -1) & 111551) &&
74583
74719
  (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target));
74584
74720
  }
74585
74721
  function isConstEnumOrConstEnumOnlyModule(s) {
@@ -74594,7 +74730,7 @@ var ts;
74594
74730
  }
74595
74731
  var target = getSymbolLinks(symbol).aliasTarget;
74596
74732
  if (target && ts.getEffectiveModifierFlags(node) & 1 &&
74597
- target.flags & 111551 &&
74733
+ getAllSymbolFlags(target) & 111551 &&
74598
74734
  (ts.shouldPreserveConstEnums(compilerOptions) || !isConstEnumOrConstEnumOnlyModule(target))) {
74599
74735
  return true;
74600
74736
  }
@@ -82400,8 +82536,11 @@ var ts;
82400
82536
  }
82401
82537
  return ts.visitEachChild(node, visitor, context);
82402
82538
  case 174:
82539
+ return doWithContext(1 | 2, visitGetAccessorDeclaration, node);
82403
82540
  case 175:
82541
+ return doWithContext(1 | 2, visitSetAccessorDeclaration, node);
82404
82542
  case 173:
82543
+ return doWithContext(1 | 2, visitConstructorDeclaration, node);
82405
82544
  case 260:
82406
82545
  case 228:
82407
82546
  return doWithContext(1 | 2, visitDefault, node);
@@ -82492,10 +82631,19 @@ var ts;
82492
82631
  }
82493
82632
  return ts.setOriginalNode(ts.setTextRange(factory.createYieldExpression(undefined, ts.visitNode(node.expression, visitor, ts.isExpression)), node), node);
82494
82633
  }
82634
+ function visitConstructorDeclaration(node) {
82635
+ return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
82636
+ }
82495
82637
  function visitMethodDeclaration(node) {
82496
82638
  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
82639
  ? transformAsyncFunctionBody(node)
82498
- : ts.visitFunctionBody(node.body, visitor, context));
82640
+ : transformMethodBody(node));
82641
+ }
82642
+ function visitGetAccessorDeclaration(node) {
82643
+ return factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context), undefined, transformMethodBody(node));
82644
+ }
82645
+ function visitSetAccessorDeclaration(node) {
82646
+ return factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.name, ts.visitParameterList(node.parameters, visitor, context), transformMethodBody(node));
82499
82647
  }
82500
82648
  function visitFunctionDeclaration(node) {
82501
82649
  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 +82727,39 @@ var ts;
82579
82727
  }
82580
82728
  return false;
82581
82729
  }
82730
+ function transformMethodBody(node) {
82731
+ ts.Debug.assertIsDefined(node.body);
82732
+ var savedCapturedSuperProperties = capturedSuperProperties;
82733
+ var savedHasSuperElementAccess = hasSuperElementAccess;
82734
+ capturedSuperProperties = new ts.Set();
82735
+ hasSuperElementAccess = false;
82736
+ var updated = ts.visitFunctionBody(node.body, visitor, context);
82737
+ var originalMethod = ts.getOriginalNode(node, ts.isFunctionLikeDeclaration);
82738
+ var emitSuperHelpers = languageVersion >= 2 &&
82739
+ resolver.getNodeCheckFlags(node) & (4096 | 2048) &&
82740
+ (ts.getFunctionFlags(originalMethod) & 3) !== 3;
82741
+ if (emitSuperHelpers) {
82742
+ enableSubstitutionForAsyncMethodsWithSuper();
82743
+ if (capturedSuperProperties.size) {
82744
+ var variableStatement = createSuperAccessVariableStatement(factory, resolver, node, capturedSuperProperties);
82745
+ substitutedSuperAccessors[ts.getNodeId(variableStatement)] = true;
82746
+ var statements = updated.statements.slice();
82747
+ ts.insertStatementsAfterStandardPrologue(statements, [variableStatement]);
82748
+ updated = factory.updateBlock(updated, statements);
82749
+ }
82750
+ if (hasSuperElementAccess) {
82751
+ if (resolver.getNodeCheckFlags(node) & 4096) {
82752
+ ts.addEmitHelper(updated, ts.advancedAsyncSuperHelper);
82753
+ }
82754
+ else if (resolver.getNodeCheckFlags(node) & 2048) {
82755
+ ts.addEmitHelper(updated, ts.asyncSuperHelper);
82756
+ }
82757
+ }
82758
+ }
82759
+ capturedSuperProperties = savedCapturedSuperProperties;
82760
+ hasSuperElementAccess = savedHasSuperElementAccess;
82761
+ return updated;
82762
+ }
82582
82763
  function transformAsyncFunctionBody(node) {
82583
82764
  resumeLexicalEnvironment();
82584
82765
  var original = ts.getOriginalNode(node, ts.isFunctionLike);
@@ -83132,11 +83313,22 @@ var ts;
83132
83313
  }
83133
83314
  return node;
83134
83315
  }
83135
- function convertForOfStatementHead(node, boundValue) {
83136
- var binding = ts.createForOfBindingStatement(factory, node.initializer, boundValue);
83316
+ function convertForOfStatementHead(node, boundValue, nonUserCode) {
83317
+ var value = factory.createTempVariable(hoistVariableDeclaration);
83318
+ var iteratorValueExpression = factory.createAssignment(value, boundValue);
83319
+ var iteratorValueStatement = factory.createExpressionStatement(iteratorValueExpression);
83320
+ ts.setSourceMapRange(iteratorValueStatement, node.expression);
83321
+ var exitNonUserCodeExpression = factory.createAssignment(nonUserCode, factory.createFalse());
83322
+ var exitNonUserCodeStatement = factory.createExpressionStatement(exitNonUserCodeExpression);
83323
+ ts.setSourceMapRange(exitNonUserCodeStatement, node.expression);
83324
+ var enterNonUserCodeExpression = factory.createAssignment(nonUserCode, factory.createTrue());
83325
+ var enterNonUserCodeStatement = factory.createExpressionStatement(enterNonUserCodeExpression);
83326
+ ts.setSourceMapRange(exitNonUserCodeStatement, node.expression);
83327
+ var statements = [];
83328
+ var binding = ts.createForOfBindingStatement(factory, node.initializer, value);
83329
+ statements.push(ts.visitNode(binding, visitor, ts.isStatement));
83137
83330
  var bodyLocation;
83138
83331
  var statementsLocation;
83139
- var statements = [ts.visitNode(binding, visitor, ts.isStatement)];
83140
83332
  var statement = ts.visitIterationBody(node.statement, visitor, context);
83141
83333
  if (ts.isBlock(statement)) {
83142
83334
  ts.addRange(statements, statement.statements);
@@ -83146,7 +83338,14 @@ var ts;
83146
83338
  else {
83147
83339
  statements.push(statement);
83148
83340
  }
83149
- return ts.setEmitFlags(ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384);
83341
+ var body = ts.setEmitFlags(ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), statementsLocation), true), bodyLocation), 48 | 384);
83342
+ return factory.createBlock([
83343
+ iteratorValueStatement,
83344
+ exitNonUserCodeStatement,
83345
+ factory.createTryStatement(body, undefined, factory.createBlock([
83346
+ enterNonUserCodeStatement
83347
+ ]))
83348
+ ]);
83150
83349
  }
83151
83350
  function createDownlevelAwait(expression) {
83152
83351
  return enclosingFunctionFlags & 1
@@ -83157,6 +83356,8 @@ var ts;
83157
83356
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
83158
83357
  var iterator = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable(undefined);
83159
83358
  var result = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable(undefined);
83359
+ var nonUserCode = factory.createTempVariable(undefined);
83360
+ var done = factory.createTempVariable(hoistVariableDeclaration);
83160
83361
  var errorRecord = factory.createUniqueName("e");
83161
83362
  var catchVariable = factory.getGeneratedNameForNode(errorRecord);
83162
83363
  var returnMethod = factory.createTempVariable(undefined);
@@ -83171,9 +83372,14 @@ var ts;
83171
83372
  factory.inlineExpressions([factory.createAssignment(errorRecord, factory.createVoidZero()), callValues]) :
83172
83373
  callValues;
83173
83374
  var forStatement = ts.setEmitFlags(ts.setTextRange(factory.createForStatement(ts.setEmitFlags(ts.setTextRange(factory.createVariableDeclarationList([
83375
+ factory.createVariableDeclaration(nonUserCode, undefined, undefined, factory.createTrue()),
83174
83376
  ts.setTextRange(factory.createVariableDeclaration(iterator, undefined, undefined, initializer), node.expression),
83175
83377
  factory.createVariableDeclaration(result)
83176
- ]), node.expression), 2097152), factory.createComma(factory.createAssignment(result, createDownlevelAwait(callNext)), factory.createLogicalNot(getDone)), undefined, convertForOfStatementHead(node, getValue)), node), 256);
83378
+ ]), node.expression), 2097152), factory.inlineExpressions([
83379
+ factory.createAssignment(result, createDownlevelAwait(callNext)),
83380
+ factory.createAssignment(done, getDone),
83381
+ factory.createLogicalNot(done)
83382
+ ]), undefined, convertForOfStatementHead(node, getValue, nonUserCode)), node), 256);
83177
83383
  ts.setOriginalNode(forStatement, node);
83178
83384
  return factory.createTryStatement(factory.createBlock([
83179
83385
  factory.restoreEnclosingLabel(forStatement, outermostLabeledStatement)
@@ -83183,7 +83389,7 @@ var ts;
83183
83389
  ])))
83184
83390
  ]), 1)), factory.createBlock([
83185
83391
  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)
83392
+ 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
83393
  ]), undefined, ts.setEmitFlags(factory.createBlock([
83188
83394
  ts.setEmitFlags(factory.createIfStatement(errorRecord, factory.createThrowStatement(factory.createPropertyAccessExpression(errorRecord, "error"))), 1)
83189
83395
  ]), 1))
@@ -84747,11 +84953,13 @@ var ts;
84747
84953
  return ts.visitEachChild(node, visitorWithUnusedExpressionResult, context);
84748
84954
  }
84749
84955
  function visitIdentifier(node) {
84750
- if (!convertedLoopState) {
84751
- return node;
84956
+ if (convertedLoopState) {
84957
+ if (resolver.isArgumentsLocalBinding(node)) {
84958
+ return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
84959
+ }
84752
84960
  }
84753
- if (resolver.isArgumentsLocalBinding(node)) {
84754
- return convertedLoopState.argumentsName || (convertedLoopState.argumentsName = factory.createUniqueName("arguments"));
84961
+ if (node.hasExtendedUnicodeEscape) {
84962
+ return ts.setOriginalNode(ts.setTextRange(factory.createIdentifier(ts.unescapeLeadingUnderscores(node.escapedText)), node), node);
84755
84963
  }
84756
84964
  return node;
84757
84965
  }
@@ -87283,19 +87491,23 @@ var ts;
87283
87491
  }
87284
87492
  function transformAndEmitForInStatement(node) {
87285
87493
  if (containsYield(node)) {
87494
+ var obj = declareLocal();
87286
87495
  var keysArray = declareLocal();
87287
87496
  var key = declareLocal();
87288
87497
  var keysIndex = factory.createLoopVariable();
87289
87498
  var initializer = node.initializer;
87290
87499
  hoistVariableDeclaration(keysIndex);
87500
+ emitAssignment(obj, ts.visitNode(node.expression, visitor, ts.isExpression));
87291
87501
  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]))));
87502
+ emitStatement(factory.createForInStatement(key, obj, factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(keysArray, "push"), undefined, [key]))));
87293
87503
  emitAssignment(keysIndex, factory.createNumericLiteral(0));
87294
87504
  var conditionLabel = defineLabel();
87295
87505
  var incrementLabel = defineLabel();
87296
- var endLabel = beginLoopBlock(incrementLabel);
87506
+ var endLoopLabel = beginLoopBlock(incrementLabel);
87297
87507
  markLabel(conditionLabel);
87298
- emitBreakWhenFalse(endLabel, factory.createLessThan(keysIndex, factory.createPropertyAccessExpression(keysArray, "length")));
87508
+ emitBreakWhenFalse(endLoopLabel, factory.createLessThan(keysIndex, factory.createPropertyAccessExpression(keysArray, "length")));
87509
+ emitAssignment(key, factory.createElementAccessExpression(keysArray, keysIndex));
87510
+ emitBreakWhenFalse(incrementLabel, factory.createBinaryExpression(key, 101, obj));
87299
87511
  var variable = void 0;
87300
87512
  if (ts.isVariableDeclarationList(initializer)) {
87301
87513
  for (var _i = 0, _a = initializer.declarations; _i < _a.length; _i++) {
@@ -87308,7 +87520,7 @@ var ts;
87308
87520
  variable = ts.visitNode(initializer, visitor, ts.isExpression);
87309
87521
  ts.Debug.assert(ts.isLeftHandSideExpression(variable));
87310
87522
  }
87311
- emitAssignment(variable, factory.createElementAccessExpression(keysArray, keysIndex));
87523
+ emitAssignment(variable, key);
87312
87524
  transformAndEmitEmbeddedStatement(node.statement);
87313
87525
  markLabel(incrementLabel);
87314
87526
  emitStatement(factory.createExpressionStatement(factory.createPostfixIncrement(keysIndex)));
@@ -88588,18 +88800,18 @@ var ts;
88588
88800
  return createImportCallExpressionUMD(argument !== null && argument !== void 0 ? argument : factory.createVoidZero(), containsLexicalThis);
88589
88801
  case ts.ModuleKind.CommonJS:
88590
88802
  default:
88591
- return createImportCallExpressionCommonJS(argument, containsLexicalThis);
88803
+ return createImportCallExpressionCommonJS(argument);
88592
88804
  }
88593
88805
  }
88594
88806
  function createImportCallExpressionUMD(arg, containsLexicalThis) {
88595
88807
  needUMDDynamicImportHelper = true;
88596
88808
  if (ts.isSimpleCopiableExpression(arg)) {
88597
88809
  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));
88810
+ return factory.createConditionalExpression(factory.createIdentifier("__syncRequire"), undefined, createImportCallExpressionCommonJS(arg), undefined, createImportCallExpressionAMD(argClone, containsLexicalThis));
88599
88811
  }
88600
88812
  else {
88601
88813
  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)));
88814
+ return factory.createComma(factory.createAssignment(temp, arg), factory.createConditionalExpression(factory.createIdentifier("__syncRequire"), undefined, createImportCallExpressionCommonJS(temp, true), undefined, createImportCallExpressionAMD(temp, containsLexicalThis)));
88603
88815
  }
88604
88816
  }
88605
88817
  function createImportCallExpressionAMD(arg, containsLexicalThis) {
@@ -88628,9 +88840,10 @@ var ts;
88628
88840
  }
88629
88841
  return promise;
88630
88842
  }
88631
- function createImportCallExpressionCommonJS(arg, containsLexicalThis) {
88843
+ function createImportCallExpressionCommonJS(arg, isInlineable) {
88844
+ var temp = arg && !ts.isSimpleInlineableExpression(arg) && !isInlineable ? factory.createTempVariable(hoistVariableDeclaration) : undefined;
88632
88845
  var promiseResolveCall = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Promise"), "resolve"), undefined, []);
88633
- var requireCall = factory.createCallExpression(factory.createIdentifier("require"), undefined, arg ? [arg] : []);
88846
+ var requireCall = factory.createCallExpression(factory.createIdentifier("require"), undefined, temp ? [temp] : arg ? [arg] : []);
88634
88847
  if (ts.getESModuleInterop(compilerOptions)) {
88635
88848
  requireCall = emitHelpers().createImportStarHelper(requireCall);
88636
88849
  }
@@ -88640,11 +88853,9 @@ var ts;
88640
88853
  }
88641
88854
  else {
88642
88855
  func = factory.createFunctionExpression(undefined, undefined, undefined, undefined, [], undefined, factory.createBlock([factory.createReturnStatement(requireCall)]));
88643
- if (containsLexicalThis) {
88644
- ts.setEmitFlags(func, 8);
88645
- }
88646
88856
  }
88647
- return factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, "then"), undefined, [func]);
88857
+ var downleveledImport = factory.createCallExpression(factory.createPropertyAccessExpression(promiseResolveCall, "then"), undefined, [func]);
88858
+ return temp === undefined ? downleveledImport : factory.createCommaListExpression([factory.createAssignment(temp, arg), downleveledImport]);
88648
88859
  }
88649
88860
  function getHelperExpressionForExport(node, innerExpr) {
88650
88861
  if (!ts.getESModuleInterop(compilerOptions) || ts.getEmitFlags(node) & 67108864) {
@@ -97913,14 +98124,16 @@ var ts;
97913
98124
  }
97914
98125
  return setReadFileCache(key, fileName);
97915
98126
  };
97916
- var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersion, onError, shouldCreateNewSourceFile) {
98127
+ var getSourceFileWithCache = getSourceFile ? function (fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile) {
97917
98128
  var key = toPath(fileName);
97918
- var value = sourceFileCache.get(key);
98129
+ var impliedNodeFormat = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions.impliedNodeFormat : undefined;
98130
+ var forImpliedNodeFormat = sourceFileCache.get(impliedNodeFormat);
98131
+ var value = forImpliedNodeFormat === null || forImpliedNodeFormat === void 0 ? void 0 : forImpliedNodeFormat.get(key);
97919
98132
  if (value)
97920
98133
  return value;
97921
- var sourceFile = getSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);
98134
+ var sourceFile = getSourceFile(fileName, languageVersionOrOptions, onError, shouldCreateNewSourceFile);
97922
98135
  if (sourceFile && (ts.isDeclarationFileName(fileName) || ts.fileExtensionIs(fileName, ".json"))) {
97923
- sourceFileCache.set(key, sourceFile);
98136
+ sourceFileCache.set(impliedNodeFormat, (forImpliedNodeFormat || new ts.Map()).set(key, sourceFile));
97924
98137
  }
97925
98138
  return sourceFile;
97926
98139
  } : undefined;
@@ -97944,13 +98157,15 @@ var ts;
97944
98157
  var value = readFileCache.get(key);
97945
98158
  if (value !== undefined && value !== data) {
97946
98159
  readFileCache.delete(key);
97947
- sourceFileCache.delete(key);
98160
+ sourceFileCache.forEach(function (map) { return map.delete(key); });
97948
98161
  }
97949
98162
  else if (getSourceFileWithCache) {
97950
- var sourceFile = sourceFileCache.get(key);
97951
- if (sourceFile && sourceFile.text !== data) {
97952
- sourceFileCache.delete(key);
97953
- }
98163
+ sourceFileCache.forEach(function (map) {
98164
+ var sourceFile = map.get(key);
98165
+ if (sourceFile && sourceFile.text !== data) {
98166
+ map.delete(key);
98167
+ }
98168
+ });
97954
98169
  }
97955
98170
  originalWriteFile.call.apply(originalWriteFile, __spreadArray([host, fileName, data], rest, false));
97956
98171
  };
@@ -101566,7 +101781,7 @@ var ts;
101566
101781
  var canCopyEmitSignatures = compilerOptions.composite &&
101567
101782
  (oldState === null || oldState === void 0 ? void 0 : oldState.emitSignatures) &&
101568
101783
  !outFilePath &&
101569
- !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldCompilerOptions);
101784
+ !ts.compilerOptionsAffectDeclarationPath(compilerOptions, oldState.compilerOptions);
101570
101785
  if (useOldState) {
101571
101786
  (_a = oldState.changedFilesSet) === null || _a === void 0 ? void 0 : _a.forEach(function (value) { return state.changedFilesSet.add(value); });
101572
101787
  if (!outFilePath && oldState.affectedFilesPendingEmit) {
@@ -102588,7 +102803,7 @@ var ts;
102588
102803
  var isNonDirectorySeparatorRoot = rootLength > 1 || dirPath.charCodeAt(0) !== 47;
102589
102804
  if (isNonDirectorySeparatorRoot &&
102590
102805
  dirPath.search(/[a-zA-Z]:/) !== 0 &&
102591
- pathPartForUserCheck.search(/[a-zA-z]\$\//) === 0) {
102806
+ pathPartForUserCheck.search(/[a-zA-Z]\$\//) === 0) {
102592
102807
  nextDirectorySeparator = dirPath.indexOf(ts.directorySeparator, nextDirectorySeparator + 1);
102593
102808
  if (nextDirectorySeparator === -1) {
102594
102809
  return false;
@@ -103678,7 +103893,7 @@ var ts;
103678
103893
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
103679
103894
  });
103680
103895
  var sortedPaths = [];
103681
- var _loop_36 = function (directory) {
103896
+ var _loop_35 = function (directory) {
103682
103897
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
103683
103898
  var pathsInDirectory;
103684
103899
  allFileNames.forEach(function (_a, fileName) {
@@ -103702,9 +103917,9 @@ var ts;
103702
103917
  };
103703
103918
  var out_directory_1;
103704
103919
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
103705
- var state_12 = _loop_36(directory);
103920
+ var state_11 = _loop_35(directory);
103706
103921
  directory = out_directory_1;
103707
- if (state_12 === "break")
103922
+ if (state_11 === "break")
103708
103923
  break;
103709
103924
  }
103710
103925
  if (allFileNames.size) {
@@ -103763,7 +103978,7 @@ var ts;
103763
103978
  }
103764
103979
  function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
103765
103980
  for (var key in paths) {
103766
- var _loop_37 = function (patternText_1) {
103981
+ var _loop_36 = function (patternText_1) {
103767
103982
  var pattern = ts.normalizePath(patternText_1);
103768
103983
  var indexOfStar = pattern.indexOf("*");
103769
103984
  var candidates = allowedEndings.map(function (ending) { return ({
@@ -103794,9 +104009,9 @@ var ts;
103794
104009
  };
103795
104010
  for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
103796
104011
  var patternText_1 = _a[_i];
103797
- var state_13 = _loop_37(patternText_1);
103798
- if (typeof state_13 === "object")
103799
- return state_13.value;
104012
+ var state_12 = _loop_36(patternText_1);
104013
+ if (typeof state_12 === "object")
104014
+ return state_12.value;
103800
104015
  }
103801
104016
  }
103802
104017
  function validateEnding(_a) {
@@ -103865,15 +104080,21 @@ var ts;
103865
104080
  return undefined;
103866
104081
  }
103867
104082
  function tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) {
103868
- var normalizedTargetPath = getPathRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
103869
- if (normalizedTargetPath === undefined) {
104083
+ var normalizedTargetPaths = getPathsRelativeToRootDirs(moduleFileName, rootDirs, getCanonicalFileName);
104084
+ if (normalizedTargetPaths === undefined) {
104085
+ return undefined;
104086
+ }
104087
+ var normalizedSourcePaths = getPathsRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
104088
+ var relativePaths = ts.flatMap(normalizedSourcePaths, function (sourcePath) {
104089
+ return ts.map(normalizedTargetPaths, function (targetPath) { return ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(sourcePath, targetPath, getCanonicalFileName)); });
104090
+ });
104091
+ var shortest = ts.min(relativePaths, ts.compareNumberOfDirectorySeparators);
104092
+ if (!shortest) {
103870
104093
  return undefined;
103871
104094
  }
103872
- var normalizedSourcePath = getPathRelativeToRootDirs(sourceDirectory, rootDirs, getCanonicalFileName);
103873
- var relativePath = normalizedSourcePath !== undefined ? ts.ensurePathIsNonModuleName(ts.getRelativePathFromDirectory(normalizedSourcePath, normalizedTargetPath, getCanonicalFileName)) : normalizedTargetPath;
103874
104095
  return ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeJs
103875
- ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
103876
- : ts.removeFileExtension(relativePath);
104096
+ ? removeExtensionAndIndexPostFix(shortest, ending, compilerOptions)
104097
+ : ts.removeFileExtension(shortest);
103877
104098
  }
103878
104099
  function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, userPreferences, packageNameOnly, overrideMode) {
103879
104100
  var path = _a.path, isRedirect = _a.isRedirect;
@@ -103993,8 +104214,8 @@ var ts;
103993
104214
  }
103994
104215
  }
103995
104216
  }
103996
- function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
103997
- return ts.firstDefined(rootDirs, function (rootDir) {
104217
+ function getPathsRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
104218
+ return ts.mapDefined(rootDirs, function (rootDir) {
103998
104219
  var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
103999
104220
  return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
104000
104221
  });
@@ -106380,7 +106601,9 @@ var ts;
106380
106601
  }
106381
106602
  if (buildInfo.program) {
106382
106603
  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))) {
106604
+ (!project.options.noEmit ?
106605
+ (_b = buildInfo.program.affectedFilesPendingEmit) === null || _b === void 0 ? void 0 : _b.length :
106606
+ ts.some(buildInfo.program.semanticDiagnosticsPerFile, ts.isArray))) {
106384
106607
  return {
106385
106608
  type: ts.UpToDateStatusType.OutOfDateBuildInfo,
106386
106609
  buildInfoFile: buildInfoPath