typescript 4.9.0-dev.20220920 → 4.9.0-dev.20220922

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
@@ -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, ".0-dev.20220920");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220922");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -2564,7 +2564,7 @@ var ts;
2564
2564
  ];
2565
2565
  for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) {
2566
2566
  var ctor = nodeConstructors_1[_i];
2567
- if (!ts.hasProperty(ctor, "__debugKind")) {
2567
+ if (!ts.hasProperty(ctor.prototype, "__debugKind")) {
2568
2568
  Object.defineProperties(ctor.prototype, {
2569
2569
  __tsDebuggerDisplay: {
2570
2570
  value: function () {
@@ -6282,6 +6282,7 @@ var ts;
6282
6282
  _0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, ts.DiagnosticCategory.Error, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
6283
6283
  We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, ts.DiagnosticCategory.Error, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
6284
6284
  Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, ts.DiagnosticCategory.Error, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
6285
+ This_condition_will_always_return_0: diag(2845, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."),
6285
6286
  Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
6286
6287
  Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
6287
6288
  Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
@@ -7224,6 +7225,8 @@ var ts;
7224
7225
  Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
7225
7226
  Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
7226
7227
  Rename_param_tag_name_0_to_1: diag(95173, ts.DiagnosticCategory.Message, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"),
7228
+ Use_0: diag(95174, ts.DiagnosticCategory.Message, "Use_0_95174", "Use `{0}`."),
7229
+ Use_Number_isNaN_in_all_conditions: diag(95175, ts.DiagnosticCategory.Message, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."),
7227
7230
  No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
7228
7231
  Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
7229
7232
  JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
@@ -8855,12 +8858,31 @@ var ts;
8855
8858
  pos++;
8856
8859
  return token = 0;
8857
8860
  }
8858
- if (isIdentifierStart(codePointAt(text, pos + 1), languageVersion)) {
8861
+ var charAfterHash = codePointAt(text, pos + 1);
8862
+ if (charAfterHash === 92) {
8859
8863
  pos++;
8860
- scanIdentifier(codePointAt(text, pos), languageVersion);
8864
+ var extendedCookedChar_1 = peekExtendedUnicodeEscape();
8865
+ if (extendedCookedChar_1 >= 0 && isIdentifierStart(extendedCookedChar_1, languageVersion)) {
8866
+ pos += 3;
8867
+ tokenFlags |= 8;
8868
+ tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
8869
+ return token = 80;
8870
+ }
8871
+ var cookedChar_1 = peekUnicodeEscape();
8872
+ if (cookedChar_1 >= 0 && isIdentifierStart(cookedChar_1, languageVersion)) {
8873
+ pos += 6;
8874
+ tokenFlags |= 1024;
8875
+ tokenValue = "#" + String.fromCharCode(cookedChar_1) + scanIdentifierParts();
8876
+ return token = 80;
8877
+ }
8878
+ pos--;
8879
+ }
8880
+ if (isIdentifierStart(charAfterHash, languageVersion)) {
8881
+ pos++;
8882
+ scanIdentifier(charAfterHash, languageVersion);
8861
8883
  }
8862
8884
  else {
8863
- tokenValue = String.fromCharCode(codePointAt(text, pos));
8885
+ tokenValue = "#";
8864
8886
  error(ts.Diagnostics.Invalid_character, pos++, charSize(ch));
8865
8887
  }
8866
8888
  return token = 80;
@@ -26799,7 +26821,7 @@ var ts;
26799
26821
  }
26800
26822
  function parsePrivateIdentifier() {
26801
26823
  var pos = getNodePos();
26802
- var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenText()));
26824
+ var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue()));
26803
26825
  nextToken();
26804
26826
  return finishNode(node, pos);
26805
26827
  }
@@ -37062,6 +37084,7 @@ var ts;
37062
37084
  }
37063
37085
  }
37064
37086
  function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
37087
+ var _a;
37065
37088
  var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
37066
37089
  var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
37067
37090
  if (!(state.features & NodeResolutionFeatures.Exports)) {
@@ -37074,12 +37097,7 @@ var ts;
37074
37097
  return withPackageId(packageInfo, fromDirectory);
37075
37098
  }
37076
37099
  }
37077
- var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
37078
37100
  var loader = function (extensions, candidate, onlyRecordFailures, state) {
37079
- var _a;
37080
- if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
37081
- return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
37082
- }
37083
37101
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
37084
37102
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
37085
37103
  if (!pathAndExtension && packageInfo
@@ -37089,18 +37107,22 @@ var ts;
37089
37107
  }
37090
37108
  return withPackageId(packageInfo, pathAndExtension);
37091
37109
  };
37110
+ var _b = parsePackageName(moduleName), packageName = _b.packageName, rest = _b.rest;
37111
+ var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
37092
37112
  if (rest !== "") {
37093
- var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
37094
37113
  packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
37095
- if (packageInfo && packageInfo.contents.versionPaths) {
37096
- if (state.traceEnabled) {
37097
- trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
37098
- }
37099
- var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
37100
- var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, undefined, loader, !packageDirectoryExists, state);
37101
- if (fromPaths) {
37102
- return fromPaths.value;
37103
- }
37114
+ }
37115
+ if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
37116
+ return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
37117
+ }
37118
+ if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) {
37119
+ if (state.traceEnabled) {
37120
+ trace(state.host, ts.Diagnostics.package_json_has_a_typesVersions_entry_0_that_matches_compiler_version_1_looking_for_a_pattern_to_match_module_name_2, packageInfo.contents.versionPaths.version, ts.version, rest);
37121
+ }
37122
+ var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
37123
+ var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, undefined, loader, !packageDirectoryExists, state);
37124
+ if (fromPaths) {
37125
+ return fromPaths.value;
37104
37126
  }
37105
37127
  }
37106
37128
  return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
@@ -40858,6 +40880,7 @@ var ts;
40858
40880
  var deferredGlobalOmitSymbol;
40859
40881
  var deferredGlobalAwaitedSymbol;
40860
40882
  var deferredGlobalBigIntType;
40883
+ var deferredGlobalNaNSymbol;
40861
40884
  var deferredGlobalRecordSymbol;
40862
40885
  var allPotentiallyUnusedIdentifiers = new ts.Map();
40863
40886
  var flowLoopStart = 0;
@@ -45875,6 +45898,7 @@ var ts;
45875
45898
  && symbol.escapedName !== "export="
45876
45899
  && !(symbol.flags & 4194304)
45877
45900
  && !(symbol.flags & 32)
45901
+ && !(symbol.flags & 8192)
45878
45902
  && !isConstMergedWithNSPrintableAsSignatureMerge) {
45879
45903
  if (propertyAsAlias) {
45880
45904
  var createdExport = serializeMaybeAliasAssignment(symbol);
@@ -50016,7 +50040,11 @@ var ts;
50016
50040
  }
50017
50041
  }
50018
50042
  }
50019
- if (!singleProp || isUnion && (propSet || checkFlags & 48) && checkFlags & (1024 | 512)) {
50043
+ if (!singleProp ||
50044
+ isUnion &&
50045
+ (propSet || checkFlags & 48) &&
50046
+ checkFlags & (1024 | 512) &&
50047
+ !(propSet && getCommonDeclarationsOfSymbols(ts.arrayFrom(propSet.values())))) {
50020
50048
  return undefined;
50021
50049
  }
50022
50050
  if (!propSet && !(checkFlags & 16) && !indexTypes) {
@@ -50106,6 +50134,33 @@ var ts;
50106
50134
  }
50107
50135
  return property;
50108
50136
  }
50137
+ function getCommonDeclarationsOfSymbols(symbols) {
50138
+ var commonDeclarations;
50139
+ var _loop_14 = function (symbol) {
50140
+ if (!symbol.declarations) {
50141
+ return { value: undefined };
50142
+ }
50143
+ if (!commonDeclarations) {
50144
+ commonDeclarations = new ts.Set(symbol.declarations);
50145
+ return "continue";
50146
+ }
50147
+ commonDeclarations.forEach(function (declaration) {
50148
+ if (!ts.contains(symbol.declarations, declaration)) {
50149
+ commonDeclarations.delete(declaration);
50150
+ }
50151
+ });
50152
+ if (commonDeclarations.size === 0) {
50153
+ return { value: undefined };
50154
+ }
50155
+ };
50156
+ for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) {
50157
+ var symbol = symbols_3[_i];
50158
+ var state_4 = _loop_14(symbol);
50159
+ if (typeof state_4 === "object")
50160
+ return state_4.value;
50161
+ }
50162
+ return commonDeclarations;
50163
+ }
50109
50164
  function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {
50110
50165
  var property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
50111
50166
  return property && !(ts.getCheckFlags(property) & 16) ? property : undefined;
@@ -50736,7 +50791,7 @@ var ts;
50736
50791
  function getIndexInfosOfIndexSymbol(indexSymbol) {
50737
50792
  if (indexSymbol.declarations) {
50738
50793
  var indexInfos_4 = [];
50739
- var _loop_14 = function (declaration) {
50794
+ var _loop_15 = function (declaration) {
50740
50795
  if (declaration.parameters.length === 1) {
50741
50796
  var parameter = declaration.parameters[0];
50742
50797
  if (parameter.type) {
@@ -50750,7 +50805,7 @@ var ts;
50750
50805
  };
50751
50806
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
50752
50807
  var declaration = _a[_i];
50753
- _loop_14(declaration);
50808
+ _loop_15(declaration);
50754
50809
  }
50755
50810
  return indexInfos_4;
50756
50811
  }
@@ -50767,7 +50822,7 @@ var ts;
50767
50822
  var _a;
50768
50823
  var inferences;
50769
50824
  if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
50770
- var _loop_15 = function (declaration) {
50825
+ var _loop_16 = function (declaration) {
50771
50826
  if (declaration.parent.kind === 192) {
50772
50827
  var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
50773
50828
  if (grandParent.kind === 180 && !omitTypeReferences) {
@@ -50812,7 +50867,7 @@ var ts;
50812
50867
  };
50813
50868
  for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
50814
50869
  var declaration = _b[_i];
50815
- _loop_15(declaration);
50870
+ _loop_16(declaration);
50816
50871
  }
50817
50872
  }
50818
50873
  return inferences && getIntersectionType(inferences);
@@ -51413,6 +51468,9 @@ var ts;
51413
51468
  function getGlobalBigIntType() {
51414
51469
  return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", 0, false))) || emptyObjectType;
51415
51470
  }
51471
+ function getGlobalNaNSymbol() {
51472
+ return (deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol("NaN", false)));
51473
+ }
51416
51474
  function getGlobalRecordSymbol() {
51417
51475
  deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol("Record", 2, true) || unknownSymbol);
51418
51476
  return deferredGlobalRecordSymbol === unknownSymbol ? undefined : deferredGlobalRecordSymbol;
@@ -51628,7 +51686,7 @@ var ts;
51628
51686
  var lastRequiredIndex = -1;
51629
51687
  var firstRestIndex = -1;
51630
51688
  var lastOptionalOrRestIndex = -1;
51631
- var _loop_16 = function (i) {
51689
+ var _loop_17 = function (i) {
51632
51690
  var type = elementTypes[i];
51633
51691
  var flags = target.elementFlags[i];
51634
51692
  if (flags & 8) {
@@ -51654,9 +51712,9 @@ var ts;
51654
51712
  }
51655
51713
  };
51656
51714
  for (var i = 0; i < elementTypes.length; i++) {
51657
- var state_4 = _loop_16(i);
51658
- if (typeof state_4 === "object")
51659
- return state_4.value;
51715
+ var state_5 = _loop_17(i);
51716
+ if (typeof state_5 === "object")
51717
+ return state_5.value;
51660
51718
  }
51661
51719
  for (var i = 0; i < lastRequiredIndex; i++) {
51662
51720
  if (expandedFlags[i] & 2)
@@ -51682,7 +51740,7 @@ var ts;
51682
51740
  if (flags & (2 | 4)) {
51683
51741
  lastOptionalOrRestIndex = expandedFlags.length;
51684
51742
  }
51685
- expandedTypes.push(type);
51743
+ expandedTypes.push(flags & 2 ? addOptionality(type, true) : type);
51686
51744
  expandedFlags.push(flags);
51687
51745
  if (expandedDeclarations && declaration) {
51688
51746
  expandedDeclarations.push(declaration);
@@ -51831,7 +51889,7 @@ var ts;
51831
51889
  var templates = ts.filter(types, isPatternLiteralType);
51832
51890
  if (templates.length) {
51833
51891
  var i = types.length;
51834
- var _loop_17 = function () {
51892
+ var _loop_18 = function () {
51835
51893
  i--;
51836
51894
  var t = types[i];
51837
51895
  if (t.flags & 128 && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
@@ -51839,7 +51897,7 @@ var ts;
51839
51897
  }
51840
51898
  };
51841
51899
  while (i > 0) {
51842
- _loop_17();
51900
+ _loop_18();
51843
51901
  }
51844
51902
  }
51845
51903
  }
@@ -51909,14 +51967,14 @@ var ts;
51909
51967
  var namedUnions = [];
51910
51968
  addNamedUnions(namedUnions, types);
51911
51969
  var reducedTypes = [];
51912
- var _loop_18 = function (t) {
51970
+ var _loop_19 = function (t) {
51913
51971
  if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
51914
51972
  reducedTypes.push(t);
51915
51973
  }
51916
51974
  };
51917
51975
  for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
51918
51976
  var t = typeSet_1[_i];
51919
- _loop_18(t);
51977
+ _loop_19(t);
51920
51978
  }
51921
51979
  if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
51922
51980
  return namedUnions[0];
@@ -52998,7 +53056,7 @@ var ts;
52998
53056
  var result;
52999
53057
  var extraTypes;
53000
53058
  var tailCount = 0;
53001
- var _loop_19 = function () {
53059
+ var _loop_20 = function () {
53002
53060
  if (tailCount === 1000) {
53003
53061
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
53004
53062
  result = errorType;
@@ -53072,10 +53130,10 @@ var ts;
53072
53130
  return "break";
53073
53131
  };
53074
53132
  while (true) {
53075
- var state_5 = _loop_19();
53076
- if (typeof state_5 === "object")
53077
- return state_5.value;
53078
- if (state_5 === "break")
53133
+ var state_6 = _loop_20();
53134
+ if (typeof state_6 === "object")
53135
+ return state_6.value;
53136
+ if (state_6 === "break")
53079
53137
  break;
53080
53138
  }
53081
53139
  return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
@@ -55434,7 +55492,7 @@ var ts;
55434
55492
  reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
55435
55493
  checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
55436
55494
  }
55437
- var _loop_20 = function (prop) {
55495
+ var _loop_21 = function (prop) {
55438
55496
  if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
55439
55497
  if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
55440
55498
  if (reportErrors) {
@@ -55487,9 +55545,9 @@ var ts;
55487
55545
  };
55488
55546
  for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
55489
55547
  var prop = _b[_i];
55490
- var state_6 = _loop_20(prop);
55491
- if (typeof state_6 === "object")
55492
- return state_6.value;
55548
+ var state_7 = _loop_21(prop);
55549
+ if (typeof state_7 === "object")
55550
+ return state_7.value;
55493
55551
  }
55494
55552
  return false;
55495
55553
  }
@@ -56266,11 +56324,11 @@ var ts;
56266
56324
  }
56267
56325
  var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
56268
56326
  var matchingTypes = [];
56269
- var _loop_21 = function (combination) {
56327
+ var _loop_22 = function (combination) {
56270
56328
  var hasMatch = false;
56271
56329
  outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
56272
56330
  var type = _d[_c];
56273
- var _loop_22 = function (i) {
56331
+ var _loop_23 = function (i) {
56274
56332
  var sourceProperty = sourcePropertiesFiltered[i];
56275
56333
  var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
56276
56334
  if (!targetProperty)
@@ -56283,8 +56341,8 @@ var ts;
56283
56341
  }
56284
56342
  };
56285
56343
  for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
56286
- var state_8 = _loop_22(i);
56287
- switch (state_8) {
56344
+ var state_9 = _loop_23(i);
56345
+ switch (state_9) {
56288
56346
  case "continue-outer": continue outer;
56289
56347
  }
56290
56348
  }
@@ -56297,9 +56355,9 @@ var ts;
56297
56355
  };
56298
56356
  for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
56299
56357
  var combination = discriminantCombinations_1[_a];
56300
- var state_7 = _loop_21(combination);
56301
- if (typeof state_7 === "object")
56302
- return state_7.value;
56358
+ var state_8 = _loop_22(combination);
56359
+ if (typeof state_8 === "object")
56360
+ return state_8.value;
56303
56361
  }
56304
56362
  var result = -1;
56305
56363
  for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
@@ -56941,7 +56999,7 @@ var ts;
56941
56999
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
56942
57000
  links.variances = ts.emptyArray;
56943
57001
  var variances = [];
56944
- var _loop_23 = function (tp) {
57002
+ var _loop_24 = function (tp) {
56945
57003
  var modifiers = getVarianceModifiers(tp);
56946
57004
  var variance = modifiers & 65536 ?
56947
57005
  modifiers & 32768 ? 0 : 1 :
@@ -56972,7 +57030,7 @@ var ts;
56972
57030
  };
56973
57031
  for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
56974
57032
  var tp = typeParameters_2[_i];
56975
- _loop_23(tp);
57033
+ _loop_24(tp);
56976
57034
  }
56977
57035
  links.variances = variances;
56978
57036
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
@@ -57483,7 +57541,8 @@ var ts;
57483
57541
  function getOptionalType(type, isProperty) {
57484
57542
  if (isProperty === void 0) { isProperty = false; }
57485
57543
  ts.Debug.assert(strictNullChecks);
57486
- return type.flags & 32768 ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
57544
+ var missingOrUndefined = isProperty ? missingType : undefinedType;
57545
+ return type.flags & 32768 || type.flags & 1048576 && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
57487
57546
  }
57488
57547
  function getGlobalNonNullableTypeInstantiation(type) {
57489
57548
  if (!deferredGlobalNonNullableTypeAlias) {
@@ -58616,7 +58675,7 @@ var ts;
58616
58675
  var matches = inferTypesFromTemplateLiteralType(source, target);
58617
58676
  var types = target.types;
58618
58677
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
58619
- var _loop_24 = function (i) {
58678
+ var _loop_25 = function (i) {
58620
58679
  var source_1 = matches ? matches[i] : neverType;
58621
58680
  var target_3 = types[i];
58622
58681
  if (source_1.flags & 128 && target_3.flags & 8650752) {
@@ -58660,7 +58719,7 @@ var ts;
58660
58719
  inferFromTypes(source_1, target_3);
58661
58720
  };
58662
58721
  for (var i = 0; i < types.length; i++) {
58663
- _loop_24(i);
58722
+ _loop_25(i);
58664
58723
  }
58665
58724
  }
58666
58725
  }
@@ -59079,7 +59138,7 @@ var ts;
59079
59138
  return name;
59080
59139
  }
59081
59140
  }
59082
- if (ts.hasOnlyExpressionInitializer(declaration)) {
59141
+ if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
59083
59142
  var initializer = ts.getEffectiveInitializer(declaration);
59084
59143
  return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
59085
59144
  }
@@ -59135,7 +59194,7 @@ var ts;
59135
59194
  function mapTypesByKeyProperty(types, name) {
59136
59195
  var map = new ts.Map();
59137
59196
  var count = 0;
59138
- var _loop_25 = function (type) {
59197
+ var _loop_26 = function (type) {
59139
59198
  if (type.flags & (524288 | 2097152 | 58982400)) {
59140
59199
  var discriminant = getTypeOfPropertyOfType(type, name);
59141
59200
  if (discriminant) {
@@ -59161,9 +59220,9 @@ var ts;
59161
59220
  };
59162
59221
  for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
59163
59222
  var type = types_15[_i];
59164
- var state_9 = _loop_25(type);
59165
- if (typeof state_9 === "object")
59166
- return state_9.value;
59223
+ var state_10 = _loop_26(type);
59224
+ if (typeof state_10 === "object")
59225
+ return state_10.value;
59167
59226
  }
59168
59227
  return count >= 10 && count * 2 >= types.length ? map : undefined;
59169
59228
  }
@@ -64665,7 +64724,7 @@ var ts;
64665
64724
  var spreadIndex = getSpreadArgumentIndex(args);
64666
64725
  if (spreadIndex >= 0) {
64667
64726
  var effectiveArgs_1 = args.slice(0, spreadIndex);
64668
- var _loop_26 = function (i) {
64727
+ var _loop_27 = function (i) {
64669
64728
  var arg = args[i];
64670
64729
  var spreadType = arg.kind === 227 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
64671
64730
  if (spreadType && isTupleType(spreadType)) {
@@ -64681,7 +64740,7 @@ var ts;
64681
64740
  }
64682
64741
  };
64683
64742
  for (var i = spreadIndex; i < args.length; i++) {
64684
- _loop_26(i);
64743
+ _loop_27(i);
64685
64744
  }
64686
64745
  return effectiveArgs_1;
64687
64746
  }
@@ -64931,7 +64990,7 @@ var ts;
64931
64990
  var min_3 = Number.MAX_VALUE;
64932
64991
  var minIndex = 0;
64933
64992
  var i_1 = 0;
64934
- var _loop_27 = function (c) {
64993
+ var _loop_28 = function (c) {
64935
64994
  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)); };
64936
64995
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
64937
64996
  if (diags_2) {
@@ -64949,7 +65008,7 @@ var ts;
64949
65008
  };
64950
65009
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
64951
65010
  var c = candidatesForArgumentError_1[_a];
64952
- _loop_27(c);
65011
+ _loop_28(c);
64953
65012
  }
64954
65013
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
64955
65014
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -65092,7 +65151,7 @@ var ts;
65092
65151
  }
65093
65152
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
65094
65153
  var parameters = [];
65095
- var _loop_28 = function (i) {
65154
+ var _loop_29 = function (i) {
65096
65155
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
65097
65156
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
65098
65157
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -65100,7 +65159,7 @@ var ts;
65100
65159
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
65101
65160
  };
65102
65161
  for (var i = 0; i < maxNonRestParam; i++) {
65103
- _loop_28(i);
65162
+ _loop_29(i);
65104
65163
  }
65105
65164
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
65106
65165
  var flags = 0;
@@ -67582,6 +67641,7 @@ var ts;
67582
67641
  var eqType = operator === 34 || operator === 36;
67583
67642
  error(errorNode, ts.Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
67584
67643
  }
67644
+ checkNaNEquality(errorNode, operator, left, right);
67585
67645
  reportOperatorErrorUnless(function (left, right) { return isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left); });
67586
67646
  return booleanType;
67587
67647
  case 102:
@@ -67775,6 +67835,26 @@ var ts;
67775
67835
  return undefined;
67776
67836
  }
67777
67837
  }
67838
+ function checkNaNEquality(errorNode, operator, left, right) {
67839
+ var isLeftNaN = isGlobalNaN(ts.skipParentheses(left));
67840
+ var isRightNaN = isGlobalNaN(ts.skipParentheses(right));
67841
+ if (isLeftNaN || isRightNaN) {
67842
+ var err = error(errorNode, ts.Diagnostics.This_condition_will_always_return_0, ts.tokenToString(operator === 36 || operator === 34 ? 95 : 110));
67843
+ if (isLeftNaN && isRightNaN)
67844
+ return;
67845
+ var operatorString = operator === 37 || operator === 35 ? ts.tokenToString(53) : "";
67846
+ var location = isLeftNaN ? right : left;
67847
+ var expression = ts.skipParentheses(location);
67848
+ ts.addRelatedInfo(err, ts.createDiagnosticForNode(location, ts.Diagnostics.Did_you_mean_0, "".concat(operatorString, "Number.isNaN(").concat(ts.isEntityNameExpression(expression) ? ts.entityNameToString(expression) : "...", ")")));
67849
+ }
67850
+ }
67851
+ function isGlobalNaN(expr) {
67852
+ if (ts.isIdentifier(expr) && expr.escapedText === "NaN") {
67853
+ var globalNaNSymbol = getGlobalNaNSymbol();
67854
+ return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr);
67855
+ }
67856
+ return false;
67857
+ }
67778
67858
  }
67779
67859
  function getBaseTypesIfUnrelated(leftType, rightType, isRelated) {
67780
67860
  var effectiveLeft = leftType;
@@ -68696,7 +68776,7 @@ var ts;
68696
68776
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
68697
68777
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
68698
68778
  var indexSignatureMap_1 = new ts.Map();
68699
- var _loop_29 = function (declaration) {
68779
+ var _loop_30 = function (declaration) {
68700
68780
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
68701
68781
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
68702
68782
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -68711,7 +68791,7 @@ var ts;
68711
68791
  };
68712
68792
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
68713
68793
  var declaration = _a[_i];
68714
- _loop_29(declaration);
68794
+ _loop_30(declaration);
68715
68795
  }
68716
68796
  indexSignatureMap_1.forEach(function (entry) {
68717
68797
  if (entry.declarations.length > 1) {
@@ -71651,7 +71731,7 @@ var ts;
71651
71731
  var propDeclaration = declaration && declaration.kind === 223 ||
71652
71732
  name && name.kind === 164 ? declaration : undefined;
71653
71733
  var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
71654
- var _loop_30 = function (info) {
71734
+ var _loop_31 = function (info) {
71655
71735
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
71656
71736
  var errorNode = localPropDeclaration || localIndexDeclaration ||
71657
71737
  (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
@@ -71665,7 +71745,7 @@ var ts;
71665
71745
  };
71666
71746
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
71667
71747
  var info = indexInfos_9[_i];
71668
- _loop_30(info);
71748
+ _loop_31(info);
71669
71749
  }
71670
71750
  }
71671
71751
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -71673,7 +71753,7 @@ var ts;
71673
71753
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
71674
71754
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 261) : undefined;
71675
71755
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
71676
- var _loop_31 = function (info) {
71756
+ var _loop_32 = function (info) {
71677
71757
  if (info === checkInfo)
71678
71758
  return "continue";
71679
71759
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -71685,7 +71765,7 @@ var ts;
71685
71765
  };
71686
71766
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
71687
71767
  var info = indexInfos_10[_i];
71688
- _loop_31(info);
71768
+ _loop_32(info);
71689
71769
  }
71690
71770
  }
71691
71771
  function checkTypeNameIsReserved(name, message) {
@@ -71980,7 +72060,7 @@ var ts;
71980
72060
  var baseTypes = baseTypeNode && getBaseTypes(type);
71981
72061
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
71982
72062
  var baseStaticType = getBaseConstructorTypeOfClass(type);
71983
- var _loop_32 = function (member) {
72063
+ var _loop_33 = function (member) {
71984
72064
  if (ts.hasAmbientModifier(member)) {
71985
72065
  return "continue";
71986
72066
  }
@@ -71995,7 +72075,7 @@ var ts;
71995
72075
  };
71996
72076
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
71997
72077
  var member = _a[_i];
71998
- _loop_32(member);
72078
+ _loop_33(member);
71999
72079
  }
72000
72080
  }
72001
72081
  function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
@@ -72070,7 +72150,7 @@ var ts;
72070
72150
  }
72071
72151
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
72072
72152
  var issuedMemberError = false;
72073
- var _loop_33 = function (member) {
72153
+ var _loop_34 = function (member) {
72074
72154
  if (ts.isStatic(member)) {
72075
72155
  return "continue";
72076
72156
  }
@@ -72088,7 +72168,7 @@ var ts;
72088
72168
  };
72089
72169
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
72090
72170
  var member = _a[_i];
72091
- _loop_33(member);
72171
+ _loop_34(member);
72092
72172
  }
72093
72173
  if (!issuedMemberError) {
72094
72174
  checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
@@ -72135,7 +72215,7 @@ var ts;
72135
72215
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
72136
72216
  var _a, _b, _c, _d;
72137
72217
  var baseProperties = getPropertiesOfType(baseType);
72138
- var _loop_34 = function (baseProperty) {
72218
+ var _loop_35 = function (baseProperty) {
72139
72219
  var base = getTargetSymbol(baseProperty);
72140
72220
  if (base.flags & 4194304) {
72141
72221
  return "continue";
@@ -72233,8 +72313,8 @@ var ts;
72233
72313
  };
72234
72314
  basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
72235
72315
  var baseProperty = baseProperties_1[_i];
72236
- var state_10 = _loop_34(baseProperty);
72237
- switch (state_10) {
72316
+ var state_11 = _loop_35(baseProperty);
72317
+ switch (state_11) {
72238
72318
  case "continue-basePropertyCheck": continue basePropertyCheck;
72239
72319
  }
72240
72320
  }
@@ -95215,6 +95295,7 @@ var ts;
95215
95295
  writeTrailingSemicolon();
95216
95296
  }
95217
95297
  function emitExportDeclaration(node) {
95298
+ emitModifiers(node, node.modifiers);
95218
95299
  var nextPos = emitTokenWithComment(93, node.pos, writeKeyword, node);
95219
95300
  writeSpace();
95220
95301
  if (node.isTypeOnly) {
@@ -103600,7 +103681,7 @@ var ts;
103600
103681
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
103601
103682
  });
103602
103683
  var sortedPaths = [];
103603
- var _loop_35 = function (directory) {
103684
+ var _loop_36 = function (directory) {
103604
103685
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
103605
103686
  var pathsInDirectory;
103606
103687
  allFileNames.forEach(function (_a, fileName) {
@@ -103624,9 +103705,9 @@ var ts;
103624
103705
  };
103625
103706
  var out_directory_1;
103626
103707
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
103627
- var state_11 = _loop_35(directory);
103708
+ var state_12 = _loop_36(directory);
103628
103709
  directory = out_directory_1;
103629
- if (state_11 === "break")
103710
+ if (state_12 === "break")
103630
103711
  break;
103631
103712
  }
103632
103713
  if (allFileNames.size) {
@@ -103685,7 +103766,7 @@ var ts;
103685
103766
  }
103686
103767
  function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
103687
103768
  for (var key in paths) {
103688
- var _loop_36 = function (patternText_1) {
103769
+ var _loop_37 = function (patternText_1) {
103689
103770
  var pattern = ts.normalizePath(patternText_1);
103690
103771
  var indexOfStar = pattern.indexOf("*");
103691
103772
  var candidates = allowedEndings.map(function (ending) { return ({
@@ -103716,9 +103797,9 @@ var ts;
103716
103797
  };
103717
103798
  for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
103718
103799
  var patternText_1 = _a[_i];
103719
- var state_12 = _loop_36(patternText_1);
103720
- if (typeof state_12 === "object")
103721
- return state_12.value;
103800
+ var state_13 = _loop_37(patternText_1);
103801
+ if (typeof state_13 === "object")
103802
+ return state_13.value;
103722
103803
  }
103723
103804
  }
103724
103805
  function validateEnding(_a) {