typescript 4.9.0-dev.20220919 → 4.9.0-dev.20220921

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.20220919");
72
+ ts.version = "".concat(ts.versionMajorMinor, ".0-dev.20220921");
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  var globals = typeof globalThis !== "undefined" ? globalThis :
@@ -2266,7 +2266,7 @@ var ts;
2266
2266
  if (typeof func !== "function") {
2267
2267
  return "";
2268
2268
  }
2269
- else if (func.hasOwnProperty("name")) {
2269
+ else if (ts.hasProperty(func, "name")) {
2270
2270
  return func.name;
2271
2271
  }
2272
2272
  else {
@@ -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 (!ctor.prototype.hasOwnProperty("__debugKind")) {
2567
+ if (!ts.hasProperty(ctor.prototype, "__debugKind")) {
2568
2568
  Object.defineProperties(ctor.prototype, {
2569
2569
  __tsDebuggerDisplay: {
2570
2570
  value: function () {
@@ -3268,7 +3268,6 @@ var ts;
3268
3268
  var typeCatalog = [];
3269
3269
  var legendPath;
3270
3270
  var legend = [];
3271
- ;
3272
3271
  function startTracing(tracingMode, traceDir, configFilePath) {
3273
3272
  ts.Debug.assert(!ts.tracing, "Tracing already started");
3274
3273
  if (fs === undefined) {
@@ -5854,8 +5853,6 @@ var ts;
5854
5853
  The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts.DiagnosticCategory.Error, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
5855
5854
  The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
5856
5855
  The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),
5857
- The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360", "The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),
5858
- The_right_hand_side_of_an_in_expression_must_not_be_a_primitive: diag(2361, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361", "The right-hand side of an 'in' expression must not be a primitive."),
5859
5856
  The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
5860
5857
  The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
5861
5858
  The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: diag(2364, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access_2364", "The left-hand side of an assignment expression must be a variable or a property access."),
@@ -6104,6 +6101,7 @@ var ts;
6104
6101
  Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, ts.DiagnosticCategory.Error, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."),
6105
6102
  Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation: diag(2636, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation_2636", "Type '{0}' is not assignable to type '{1}' as implied by variance annotation."),
6106
6103
  Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types: diag(2637, ts.DiagnosticCategory.Error, "Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_t_2637", "Variance annotations are only supported in type aliases for object, function, constructor, and mapped types."),
6104
+ Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator: diag(2638, ts.DiagnosticCategory.Error, "Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operato_2638", "Type '{0}' may represent a primitive value, which is not permitted as the right operand of the 'in' operator."),
6107
6105
  Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
6108
6106
  A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
6109
6107
  Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
@@ -6284,6 +6282,7 @@ var ts;
6284
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?"),
6285
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."),
6286
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}'."),
6287
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}'."),
6288
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}'."),
6289
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}'."),
@@ -7226,6 +7225,8 @@ var ts;
7226
7225
  Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
7227
7226
  Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
7228
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."),
7229
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."),
7230
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'."),
7231
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?"),
@@ -7425,7 +7426,7 @@ var ts;
7425
7426
  }
7426
7427
  ts.stringToToken = stringToToken;
7427
7428
  function computeLineStarts(text) {
7428
- var result = new Array();
7429
+ var result = [];
7429
7430
  var pos = 0;
7430
7431
  var lineStart = 0;
7431
7432
  while (pos < text.length) {
@@ -8857,12 +8858,31 @@ var ts;
8857
8858
  pos++;
8858
8859
  return token = 0;
8859
8860
  }
8860
- if (isIdentifierStart(codePointAt(text, pos + 1), languageVersion)) {
8861
+ var charAfterHash = codePointAt(text, pos + 1);
8862
+ if (charAfterHash === 92) {
8863
+ pos++;
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)) {
8861
8881
  pos++;
8862
- scanIdentifier(codePointAt(text, pos), languageVersion);
8882
+ scanIdentifier(charAfterHash, languageVersion);
8863
8883
  }
8864
8884
  else {
8865
- tokenValue = String.fromCharCode(codePointAt(text, pos));
8885
+ tokenValue = "#";
8866
8886
  error(ts.Diagnostics.Invalid_character, pos++, charSize(ch));
8867
8887
  }
8868
8888
  return token = 80;
@@ -10131,7 +10151,7 @@ var ts;
10131
10151
  }
10132
10152
  ts.isToken = isToken;
10133
10153
  function isNodeArray(array) {
10134
- return array.hasOwnProperty("pos") && array.hasOwnProperty("end");
10154
+ return ts.hasProperty(array, "pos") && ts.hasProperty(array, "end");
10135
10155
  }
10136
10156
  ts.isNodeArray = isNodeArray;
10137
10157
  function isLiteralKind(kind) {
@@ -11415,7 +11435,6 @@ var ts;
11415
11435
  return emitNode && emitNode.flags || 0;
11416
11436
  }
11417
11437
  ts.getEmitFlags = getEmitFlags;
11418
- ;
11419
11438
  function getScriptTargetFeatures() {
11420
11439
  return {
11421
11440
  es2015: {
@@ -15506,7 +15525,7 @@ var ts;
15506
15525
  return node.initializer !== undefined;
15507
15526
  }
15508
15527
  function isWatchSet(options) {
15509
- return options.watch && options.hasOwnProperty("watch");
15528
+ return options.watch && ts.hasProperty(options, "watch");
15510
15529
  }
15511
15530
  ts.isWatchSet = isWatchSet;
15512
15531
  function closeFileWatcher(watcher) {
@@ -21716,7 +21735,7 @@ var ts;
21716
21735
  clone.transformFlags = node.transformFlags;
21717
21736
  setOriginalNode(clone, node);
21718
21737
  for (var key in node) {
21719
- if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) {
21738
+ if (ts.hasProperty(clone, key) || !ts.hasProperty(node, key)) {
21720
21739
  continue;
21721
21740
  }
21722
21741
  clone[key] = node[key];
@@ -25760,7 +25779,6 @@ var ts;
25760
25779
  visitNodes(cbNode, cbNodes, node.parameters) ||
25761
25780
  visitNode(cbNode, node.type);
25762
25781
  }
25763
- ;
25764
25782
  function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) {
25765
25783
  return visitNodes(cbNode, cbNodes, node.types);
25766
25784
  }
@@ -26803,7 +26821,7 @@ var ts;
26803
26821
  }
26804
26822
  function parsePrivateIdentifier() {
26805
26823
  var pos = getNodePos();
26806
- var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenText()));
26824
+ var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue()));
26807
26825
  nextToken();
26808
26826
  return finishNode(node, pos);
26809
26827
  }
@@ -35256,7 +35274,7 @@ var ts;
35256
35274
  function convertCompilerOptionsForTelemetry(opts) {
35257
35275
  var out = {};
35258
35276
  for (var key in opts) {
35259
- if (opts.hasOwnProperty(key)) {
35277
+ if (ts.hasProperty(opts, key)) {
35260
35278
  var type = getOptionFromName(key);
35261
35279
  if (type !== undefined) {
35262
35280
  out[key] = getOptionValueWithEmptyStrings(opts[key], type);
@@ -40758,7 +40776,8 @@ var ts;
40758
40776
  var emptyTypeLiteralSymbol = createSymbol(2048, "__type");
40759
40777
  emptyTypeLiteralSymbol.members = ts.createSymbolTable();
40760
40778
  var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
40761
- var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray)]) : unknownType;
40779
+ var unknownEmptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
40780
+ var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType;
40762
40781
  var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
40763
40782
  emptyGenericType.instantiations = new ts.Map();
40764
40783
  var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
@@ -40861,6 +40880,8 @@ var ts;
40861
40880
  var deferredGlobalOmitSymbol;
40862
40881
  var deferredGlobalAwaitedSymbol;
40863
40882
  var deferredGlobalBigIntType;
40883
+ var deferredGlobalNaNSymbol;
40884
+ var deferredGlobalRecordSymbol;
40864
40885
  var allPotentiallyUnusedIdentifiers = new ts.Map();
40865
40886
  var flowLoopStart = 0;
40866
40887
  var flowLoopCount = 0;
@@ -41569,10 +41590,10 @@ var ts;
41569
41590
  return (ts.isAssertionExpression(location) && ts.isConstTypeReference(location.type))
41570
41591
  || (ts.isJSDocTypeTag(location) && ts.isConstTypeReference(location.typeExpression));
41571
41592
  }
41572
- function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions) {
41593
+ function resolveName(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions) {
41573
41594
  if (excludeGlobals === void 0) { excludeGlobals = false; }
41574
- if (getSpellingSuggstions === void 0) { getSpellingSuggstions = true; }
41575
- return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggstions, getSymbol);
41595
+ if (getSpellingSuggestions === void 0) { getSpellingSuggestions = true; }
41596
+ return resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, getSymbol);
41576
41597
  }
41577
41598
  function resolveNameHelper(location, name, meaning, nameNotFoundMessage, nameArg, isUse, excludeGlobals, getSpellingSuggestions, lookup) {
41578
41599
  var _a, _b, _c;
@@ -41683,7 +41704,9 @@ var ts;
41683
41704
  break;
41684
41705
  }
41685
41706
  if (lastLocation && ts.isStatic(lastLocation)) {
41686
- error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);
41707
+ if (nameNotFoundMessage) {
41708
+ error(errorLocation, ts.Diagnostics.Static_members_cannot_reference_class_type_parameters);
41709
+ }
41687
41710
  return undefined;
41688
41711
  }
41689
41712
  break loop;
@@ -41711,7 +41734,9 @@ var ts;
41711
41734
  grandparent = location.parent.parent;
41712
41735
  if (ts.isClassLike(grandparent) || grandparent.kind === 261) {
41713
41736
  if (result = lookup(getSymbolOfNode(grandparent).members, name, meaning & 788968)) {
41714
- error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
41737
+ if (nameNotFoundMessage) {
41738
+ error(errorLocation, ts.Diagnostics.A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type);
41739
+ }
41715
41740
  return undefined;
41716
41741
  }
41717
41742
  }
@@ -41871,7 +41896,7 @@ var ts;
41871
41896
  }
41872
41897
  return undefined;
41873
41898
  }
41874
- else if (checkAndReportErrorForInvalidInitializer()) {
41899
+ else if (nameNotFoundMessage && checkAndReportErrorForInvalidInitializer()) {
41875
41900
  return undefined;
41876
41901
  }
41877
41902
  if (nameNotFoundMessage) {
@@ -47241,7 +47266,6 @@ var ts;
47241
47266
  return container;
47242
47267
  }
47243
47268
  }
47244
- ;
47245
47269
  }
47246
47270
  function getFlowTypeFromCommonJSExport(symbol) {
47247
47271
  var file = ts.getSourceFileOfNode(symbol.declarations[0]);
@@ -50015,7 +50039,11 @@ var ts;
50015
50039
  }
50016
50040
  }
50017
50041
  }
50018
- if (!singleProp || isUnion && (propSet || checkFlags & 48) && checkFlags & (1024 | 512)) {
50042
+ if (!singleProp ||
50043
+ isUnion &&
50044
+ (propSet || checkFlags & 48) &&
50045
+ checkFlags & (1024 | 512) &&
50046
+ !(propSet && getCommonDeclarationsOfSymbols(ts.arrayFrom(propSet.values())))) {
50019
50047
  return undefined;
50020
50048
  }
50021
50049
  if (!propSet && !(checkFlags & 16) && !indexTypes) {
@@ -50105,6 +50133,33 @@ var ts;
50105
50133
  }
50106
50134
  return property;
50107
50135
  }
50136
+ function getCommonDeclarationsOfSymbols(symbols) {
50137
+ var commonDeclarations;
50138
+ var _loop_14 = function (symbol) {
50139
+ if (!symbol.declarations) {
50140
+ return { value: undefined };
50141
+ }
50142
+ if (!commonDeclarations) {
50143
+ commonDeclarations = new ts.Set(symbol.declarations);
50144
+ return "continue";
50145
+ }
50146
+ commonDeclarations.forEach(function (declaration) {
50147
+ if (!ts.contains(symbol.declarations, declaration)) {
50148
+ commonDeclarations.delete(declaration);
50149
+ }
50150
+ });
50151
+ if (commonDeclarations.size === 0) {
50152
+ return { value: undefined };
50153
+ }
50154
+ };
50155
+ for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) {
50156
+ var symbol = symbols_3[_i];
50157
+ var state_4 = _loop_14(symbol);
50158
+ if (typeof state_4 === "object")
50159
+ return state_4.value;
50160
+ }
50161
+ return commonDeclarations;
50162
+ }
50108
50163
  function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {
50109
50164
  var property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
50110
50165
  return property && !(ts.getCheckFlags(property) & 16) ? property : undefined;
@@ -50735,7 +50790,7 @@ var ts;
50735
50790
  function getIndexInfosOfIndexSymbol(indexSymbol) {
50736
50791
  if (indexSymbol.declarations) {
50737
50792
  var indexInfos_4 = [];
50738
- var _loop_14 = function (declaration) {
50793
+ var _loop_15 = function (declaration) {
50739
50794
  if (declaration.parameters.length === 1) {
50740
50795
  var parameter = declaration.parameters[0];
50741
50796
  if (parameter.type) {
@@ -50749,7 +50804,7 @@ var ts;
50749
50804
  };
50750
50805
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
50751
50806
  var declaration = _a[_i];
50752
- _loop_14(declaration);
50807
+ _loop_15(declaration);
50753
50808
  }
50754
50809
  return indexInfos_4;
50755
50810
  }
@@ -50766,7 +50821,7 @@ var ts;
50766
50821
  var _a;
50767
50822
  var inferences;
50768
50823
  if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
50769
- var _loop_15 = function (declaration) {
50824
+ var _loop_16 = function (declaration) {
50770
50825
  if (declaration.parent.kind === 192) {
50771
50826
  var _c = ts.walkUpParenthesizedTypesAndGetParentAndChild(declaration.parent.parent), _d = _c[0], childTypeParameter = _d === void 0 ? declaration.parent : _d, grandParent = _c[1];
50772
50827
  if (grandParent.kind === 180 && !omitTypeReferences) {
@@ -50811,7 +50866,7 @@ var ts;
50811
50866
  };
50812
50867
  for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
50813
50868
  var declaration = _b[_i];
50814
- _loop_15(declaration);
50869
+ _loop_16(declaration);
50815
50870
  }
50816
50871
  }
50817
50872
  return inferences && getIntersectionType(inferences);
@@ -51412,6 +51467,13 @@ var ts;
51412
51467
  function getGlobalBigIntType() {
51413
51468
  return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", 0, false))) || emptyObjectType;
51414
51469
  }
51470
+ function getGlobalNaNSymbol() {
51471
+ return (deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol("NaN", false)));
51472
+ }
51473
+ function getGlobalRecordSymbol() {
51474
+ deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol("Record", 2, true) || unknownSymbol);
51475
+ return deferredGlobalRecordSymbol === unknownSymbol ? undefined : deferredGlobalRecordSymbol;
51476
+ }
51415
51477
  function createTypeFromGenericGlobalType(genericGlobalType, typeArguments) {
51416
51478
  return genericGlobalType !== emptyGenericType ? createTypeReference(genericGlobalType, typeArguments) : emptyObjectType;
51417
51479
  }
@@ -51623,7 +51685,7 @@ var ts;
51623
51685
  var lastRequiredIndex = -1;
51624
51686
  var firstRestIndex = -1;
51625
51687
  var lastOptionalOrRestIndex = -1;
51626
- var _loop_16 = function (i) {
51688
+ var _loop_17 = function (i) {
51627
51689
  var type = elementTypes[i];
51628
51690
  var flags = target.elementFlags[i];
51629
51691
  if (flags & 8) {
@@ -51649,9 +51711,9 @@ var ts;
51649
51711
  }
51650
51712
  };
51651
51713
  for (var i = 0; i < elementTypes.length; i++) {
51652
- var state_4 = _loop_16(i);
51653
- if (typeof state_4 === "object")
51654
- return state_4.value;
51714
+ var state_5 = _loop_17(i);
51715
+ if (typeof state_5 === "object")
51716
+ return state_5.value;
51655
51717
  }
51656
51718
  for (var i = 0; i < lastRequiredIndex; i++) {
51657
51719
  if (expandedFlags[i] & 2)
@@ -51677,7 +51739,7 @@ var ts;
51677
51739
  if (flags & (2 | 4)) {
51678
51740
  lastOptionalOrRestIndex = expandedFlags.length;
51679
51741
  }
51680
- expandedTypes.push(type);
51742
+ expandedTypes.push(flags & 2 ? addOptionality(type, true) : type);
51681
51743
  expandedFlags.push(flags);
51682
51744
  if (expandedDeclarations && declaration) {
51683
51745
  expandedDeclarations.push(declaration);
@@ -51826,7 +51888,7 @@ var ts;
51826
51888
  var templates = ts.filter(types, isPatternLiteralType);
51827
51889
  if (templates.length) {
51828
51890
  var i = types.length;
51829
- var _loop_17 = function () {
51891
+ var _loop_18 = function () {
51830
51892
  i--;
51831
51893
  var t = types[i];
51832
51894
  if (t.flags & 128 && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
@@ -51834,7 +51896,7 @@ var ts;
51834
51896
  }
51835
51897
  };
51836
51898
  while (i > 0) {
51837
- _loop_17();
51899
+ _loop_18();
51838
51900
  }
51839
51901
  }
51840
51902
  }
@@ -51904,14 +51966,14 @@ var ts;
51904
51966
  var namedUnions = [];
51905
51967
  addNamedUnions(namedUnions, types);
51906
51968
  var reducedTypes = [];
51907
- var _loop_18 = function (t) {
51969
+ var _loop_19 = function (t) {
51908
51970
  if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
51909
51971
  reducedTypes.push(t);
51910
51972
  }
51911
51973
  };
51912
51974
  for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
51913
51975
  var t = typeSet_1[_i];
51914
- _loop_18(t);
51976
+ _loop_19(t);
51915
51977
  }
51916
51978
  if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
51917
51979
  return namedUnions[0];
@@ -52993,7 +53055,7 @@ var ts;
52993
53055
  var result;
52994
53056
  var extraTypes;
52995
53057
  var tailCount = 0;
52996
- var _loop_19 = function () {
53058
+ var _loop_20 = function () {
52997
53059
  if (tailCount === 1000) {
52998
53060
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
52999
53061
  result = errorType;
@@ -53067,10 +53129,10 @@ var ts;
53067
53129
  return "break";
53068
53130
  };
53069
53131
  while (true) {
53070
- var state_5 = _loop_19();
53071
- if (typeof state_5 === "object")
53072
- return state_5.value;
53073
- if (state_5 === "break")
53132
+ var state_6 = _loop_20();
53133
+ if (typeof state_6 === "object")
53134
+ return state_6.value;
53135
+ if (state_6 === "break")
53074
53136
  break;
53075
53137
  }
53076
53138
  return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
@@ -55429,7 +55491,7 @@ var ts;
55429
55491
  reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
55430
55492
  checkTypes = reducedTarget.flags & 1048576 ? reducedTarget.types : [reducedTarget];
55431
55493
  }
55432
- var _loop_20 = function (prop) {
55494
+ var _loop_21 = function (prop) {
55433
55495
  if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
55434
55496
  if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
55435
55497
  if (reportErrors) {
@@ -55482,9 +55544,9 @@ var ts;
55482
55544
  };
55483
55545
  for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
55484
55546
  var prop = _b[_i];
55485
- var state_6 = _loop_20(prop);
55486
- if (typeof state_6 === "object")
55487
- return state_6.value;
55547
+ var state_7 = _loop_21(prop);
55548
+ if (typeof state_7 === "object")
55549
+ return state_7.value;
55488
55550
  }
55489
55551
  return false;
55490
55552
  }
@@ -56261,11 +56323,11 @@ var ts;
56261
56323
  }
56262
56324
  var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
56263
56325
  var matchingTypes = [];
56264
- var _loop_21 = function (combination) {
56326
+ var _loop_22 = function (combination) {
56265
56327
  var hasMatch = false;
56266
56328
  outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
56267
56329
  var type = _d[_c];
56268
- var _loop_22 = function (i) {
56330
+ var _loop_23 = function (i) {
56269
56331
  var sourceProperty = sourcePropertiesFiltered[i];
56270
56332
  var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
56271
56333
  if (!targetProperty)
@@ -56278,8 +56340,8 @@ var ts;
56278
56340
  }
56279
56341
  };
56280
56342
  for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
56281
- var state_8 = _loop_22(i);
56282
- switch (state_8) {
56343
+ var state_9 = _loop_23(i);
56344
+ switch (state_9) {
56283
56345
  case "continue-outer": continue outer;
56284
56346
  }
56285
56347
  }
@@ -56292,9 +56354,9 @@ var ts;
56292
56354
  };
56293
56355
  for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
56294
56356
  var combination = discriminantCombinations_1[_a];
56295
- var state_7 = _loop_21(combination);
56296
- if (typeof state_7 === "object")
56297
- return state_7.value;
56357
+ var state_8 = _loop_22(combination);
56358
+ if (typeof state_8 === "object")
56359
+ return state_8.value;
56298
56360
  }
56299
56361
  var result = -1;
56300
56362
  for (var _b = 0, matchingTypes_1 = matchingTypes; _b < matchingTypes_1.length; _b++) {
@@ -56936,7 +56998,7 @@ var ts;
56936
56998
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
56937
56999
  links.variances = ts.emptyArray;
56938
57000
  var variances = [];
56939
- var _loop_23 = function (tp) {
57001
+ var _loop_24 = function (tp) {
56940
57002
  var modifiers = getVarianceModifiers(tp);
56941
57003
  var variance = modifiers & 65536 ?
56942
57004
  modifiers & 32768 ? 0 : 1 :
@@ -56967,7 +57029,7 @@ var ts;
56967
57029
  };
56968
57030
  for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
56969
57031
  var tp = typeParameters_2[_i];
56970
- _loop_23(tp);
57032
+ _loop_24(tp);
56971
57033
  }
56972
57034
  links.variances = variances;
56973
57035
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
@@ -57478,7 +57540,8 @@ var ts;
57478
57540
  function getOptionalType(type, isProperty) {
57479
57541
  if (isProperty === void 0) { isProperty = false; }
57480
57542
  ts.Debug.assert(strictNullChecks);
57481
- return type.flags & 32768 ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
57543
+ var missingOrUndefined = isProperty ? missingType : undefinedType;
57544
+ return type.flags & 32768 || type.flags & 1048576 && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
57482
57545
  }
57483
57546
  function getGlobalNonNullableTypeInstantiation(type) {
57484
57547
  if (!deferredGlobalNonNullableTypeAlias) {
@@ -58611,7 +58674,7 @@ var ts;
58611
58674
  var matches = inferTypesFromTemplateLiteralType(source, target);
58612
58675
  var types = target.types;
58613
58676
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
58614
- var _loop_24 = function (i) {
58677
+ var _loop_25 = function (i) {
58615
58678
  var source_1 = matches ? matches[i] : neverType;
58616
58679
  var target_3 = types[i];
58617
58680
  if (source_1.flags & 128 && target_3.flags & 8650752) {
@@ -58655,7 +58718,7 @@ var ts;
58655
58718
  inferFromTypes(source_1, target_3);
58656
58719
  };
58657
58720
  for (var i = 0; i < types.length; i++) {
58658
- _loop_24(i);
58721
+ _loop_25(i);
58659
58722
  }
58660
58723
  }
58661
58724
  }
@@ -59074,7 +59137,7 @@ var ts;
59074
59137
  return name;
59075
59138
  }
59076
59139
  }
59077
- if (ts.hasOnlyExpressionInitializer(declaration)) {
59140
+ if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
59078
59141
  var initializer = ts.getEffectiveInitializer(declaration);
59079
59142
  return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
59080
59143
  }
@@ -59130,7 +59193,7 @@ var ts;
59130
59193
  function mapTypesByKeyProperty(types, name) {
59131
59194
  var map = new ts.Map();
59132
59195
  var count = 0;
59133
- var _loop_25 = function (type) {
59196
+ var _loop_26 = function (type) {
59134
59197
  if (type.flags & (524288 | 2097152 | 58982400)) {
59135
59198
  var discriminant = getTypeOfPropertyOfType(type, name);
59136
59199
  if (discriminant) {
@@ -59156,9 +59219,9 @@ var ts;
59156
59219
  };
59157
59220
  for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
59158
59221
  var type = types_15[_i];
59159
- var state_9 = _loop_25(type);
59160
- if (typeof state_9 === "object")
59161
- return state_9.value;
59222
+ var state_10 = _loop_26(type);
59223
+ if (typeof state_10 === "object")
59224
+ return state_10.value;
59162
59225
  }
59163
59226
  return count >= 10 && count * 2 >= types.length ? map : undefined;
59164
59227
  }
@@ -60408,18 +60471,22 @@ var ts;
60408
60471
  }
60409
60472
  function isTypePresencePossible(type, propName, assumeTrue) {
60410
60473
  var prop = getPropertyOfType(type, propName);
60411
- if (prop) {
60412
- return prop.flags & 16777216 ? true : assumeTrue;
60413
- }
60414
- return getApplicableIndexInfoForName(type, propName) ? true : !assumeTrue;
60415
- }
60416
- function narrowByInKeyword(type, name, assumeTrue) {
60417
- if (type.flags & 1048576
60418
- || type.flags & 524288 && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
60419
- || ts.isThisTypeParameter(type)
60420
- || type.flags & 2097152 && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
60474
+ return prop ?
60475
+ !!(prop.flags & 16777216) || assumeTrue :
60476
+ !!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
60477
+ }
60478
+ function narrowByInKeyword(type, nameType, assumeTrue) {
60479
+ var name = getPropertyNameFromType(nameType);
60480
+ var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, true); });
60481
+ if (isKnownProperty) {
60421
60482
  return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
60422
60483
  }
60484
+ if (assumeTrue) {
60485
+ var recordSymbol = getGlobalRecordSymbol();
60486
+ if (recordSymbol) {
60487
+ return getIntersectionType([type, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType])]);
60488
+ }
60489
+ }
60423
60490
  return type;
60424
60491
  }
60425
60492
  function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
@@ -60478,15 +60545,14 @@ var ts;
60478
60545
  return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
60479
60546
  }
60480
60547
  var target = getReferenceCandidate(expr.right);
60481
- var leftType = getTypeOfNode(expr.left);
60482
- if (leftType.flags & 128) {
60483
- var name = ts.escapeLeadingUnderscores(leftType.value);
60548
+ var leftType = getTypeOfExpression(expr.left);
60549
+ if (leftType.flags & 8576) {
60484
60550
  if (containsMissingType(type) && ts.isAccessExpression(reference) && isMatchingReference(reference.expression, target) &&
60485
- getAccessedPropertyName(reference) === name) {
60551
+ getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
60486
60552
  return getTypeWithFacts(type, assumeTrue ? 524288 : 65536);
60487
60553
  }
60488
60554
  if (isMatchingReference(reference, target)) {
60489
- return narrowByInKeyword(type, name, assumeTrue);
60555
+ return narrowByInKeyword(type, leftType, assumeTrue);
60490
60556
  }
60491
60557
  }
60492
60558
  break;
@@ -64002,7 +64068,6 @@ var ts;
64002
64068
  }
64003
64069
  return false;
64004
64070
  }
64005
- ;
64006
64071
  var suggestedMethod = ts.isAssignmentTarget(expr) ? "set" : "get";
64007
64072
  if (!hasProp(suggestedMethod)) {
64008
64073
  return undefined;
@@ -64658,7 +64723,7 @@ var ts;
64658
64723
  var spreadIndex = getSpreadArgumentIndex(args);
64659
64724
  if (spreadIndex >= 0) {
64660
64725
  var effectiveArgs_1 = args.slice(0, spreadIndex);
64661
- var _loop_26 = function (i) {
64726
+ var _loop_27 = function (i) {
64662
64727
  var arg = args[i];
64663
64728
  var spreadType = arg.kind === 227 && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
64664
64729
  if (spreadType && isTupleType(spreadType)) {
@@ -64674,7 +64739,7 @@ var ts;
64674
64739
  }
64675
64740
  };
64676
64741
  for (var i = spreadIndex; i < args.length; i++) {
64677
- _loop_26(i);
64742
+ _loop_27(i);
64678
64743
  }
64679
64744
  return effectiveArgs_1;
64680
64745
  }
@@ -64924,7 +64989,7 @@ var ts;
64924
64989
  var min_3 = Number.MAX_VALUE;
64925
64990
  var minIndex = 0;
64926
64991
  var i_1 = 0;
64927
- var _loop_27 = function (c) {
64992
+ var _loop_28 = function (c) {
64928
64993
  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)); };
64929
64994
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0, true, chain_2);
64930
64995
  if (diags_2) {
@@ -64942,7 +65007,7 @@ var ts;
64942
65007
  };
64943
65008
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
64944
65009
  var c = candidatesForArgumentError_1[_a];
64945
- _loop_27(c);
65010
+ _loop_28(c);
64946
65011
  }
64947
65012
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
64948
65013
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -65085,7 +65150,7 @@ var ts;
65085
65150
  }
65086
65151
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
65087
65152
  var parameters = [];
65088
- var _loop_28 = function (i) {
65153
+ var _loop_29 = function (i) {
65089
65154
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
65090
65155
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
65091
65156
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -65093,7 +65158,7 @@ var ts;
65093
65158
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
65094
65159
  };
65095
65160
  for (var i = 0; i < maxNonRestParam; i++) {
65096
- _loop_28(i);
65161
+ _loop_29(i);
65097
65162
  }
65098
65163
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
65099
65164
  var flags = 0;
@@ -67085,6 +67150,9 @@ var ts;
67085
67150
  }
67086
67151
  return booleanType;
67087
67152
  }
67153
+ function hasEmptyObjectIntersection(type) {
67154
+ return someType(type, function (t) { return t === unknownEmptyObjectType || !!(t.flags & 2097152) && ts.some(t.types, isEmptyAnonymousObjectType); });
67155
+ }
67088
67156
  function checkInExpression(left, right, leftType, rightType) {
67089
67157
  if (leftType === silentNeverType || rightType === silentNeverType) {
67090
67158
  return silentNeverType;
@@ -67099,18 +67167,12 @@ var ts;
67099
67167
  }
67100
67168
  }
67101
67169
  else {
67102
- leftType = checkNonNullType(leftType, left);
67103
- if (!(allTypesAssignableToKind(leftType, 402653316 | 296 | 12288) ||
67104
- isTypeAssignableToKind(leftType, 4194304 | 134217728 | 268435456 | 262144))) {
67105
- error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol);
67106
- }
67170
+ checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left);
67107
67171
  }
67108
- rightType = checkNonNullType(rightType, right);
67109
- var rightTypeConstraint = getConstraintOfType(rightType);
67110
- if (!allTypesAssignableToKind(rightType, 67108864 | 58982400) ||
67111
- rightTypeConstraint && (isTypeAssignableToKind(rightType, 3145728) && !allTypesAssignableToKind(rightTypeConstraint, 67108864 | 58982400) ||
67112
- !maybeTypeOfKind(rightTypeConstraint, 67108864 | 58982400 | 524288))) {
67113
- error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive);
67172
+ if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) {
67173
+ if (hasEmptyObjectIntersection(rightType)) {
67174
+ error(right, ts.Diagnostics.Type_0_may_represent_a_primitive_value_which_is_not_permitted_as_the_right_operand_of_the_in_operator, typeToString(rightType));
67175
+ }
67114
67176
  }
67115
67177
  return booleanType;
67116
67178
  }
@@ -67578,6 +67640,7 @@ var ts;
67578
67640
  var eqType = operator === 34 || operator === 36;
67579
67641
  error(errorNode, ts.Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
67580
67642
  }
67643
+ checkNaNEquality(errorNode, operator, left, right);
67581
67644
  reportOperatorErrorUnless(function (left, right) { return isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left); });
67582
67645
  return booleanType;
67583
67646
  case 102:
@@ -67771,6 +67834,26 @@ var ts;
67771
67834
  return undefined;
67772
67835
  }
67773
67836
  }
67837
+ function checkNaNEquality(errorNode, operator, left, right) {
67838
+ var isLeftNaN = isGlobalNaN(ts.skipParentheses(left));
67839
+ var isRightNaN = isGlobalNaN(ts.skipParentheses(right));
67840
+ if (isLeftNaN || isRightNaN) {
67841
+ var err = error(errorNode, ts.Diagnostics.This_condition_will_always_return_0, ts.tokenToString(operator === 36 || operator === 34 ? 95 : 110));
67842
+ if (isLeftNaN && isRightNaN)
67843
+ return;
67844
+ var operatorString = operator === 37 || operator === 35 ? ts.tokenToString(53) : "";
67845
+ var location = isLeftNaN ? right : left;
67846
+ var expression = ts.skipParentheses(location);
67847
+ ts.addRelatedInfo(err, ts.createDiagnosticForNode(location, ts.Diagnostics.Did_you_mean_0, "".concat(operatorString, "Number.isNaN(").concat(ts.isEntityNameExpression(expression) ? ts.entityNameToString(expression) : "...", ")")));
67848
+ }
67849
+ }
67850
+ function isGlobalNaN(expr) {
67851
+ if (ts.isIdentifier(expr) && expr.escapedText === "NaN") {
67852
+ var globalNaNSymbol = getGlobalNaNSymbol();
67853
+ return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr);
67854
+ }
67855
+ return false;
67856
+ }
67774
67857
  }
67775
67858
  function getBaseTypesIfUnrelated(leftType, rightType, isRelated) {
67776
67859
  var effectiveLeft = leftType;
@@ -68692,7 +68775,7 @@ var ts;
68692
68775
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
68693
68776
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
68694
68777
  var indexSignatureMap_1 = new ts.Map();
68695
- var _loop_29 = function (declaration) {
68778
+ var _loop_30 = function (declaration) {
68696
68779
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
68697
68780
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
68698
68781
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -68707,7 +68790,7 @@ var ts;
68707
68790
  };
68708
68791
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
68709
68792
  var declaration = _a[_i];
68710
- _loop_29(declaration);
68793
+ _loop_30(declaration);
68711
68794
  }
68712
68795
  indexSignatureMap_1.forEach(function (entry) {
68713
68796
  if (entry.declarations.length > 1) {
@@ -71647,7 +71730,7 @@ var ts;
71647
71730
  var propDeclaration = declaration && declaration.kind === 223 ||
71648
71731
  name && name.kind === 164 ? declaration : undefined;
71649
71732
  var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
71650
- var _loop_30 = function (info) {
71733
+ var _loop_31 = function (info) {
71651
71734
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
71652
71735
  var errorNode = localPropDeclaration || localIndexDeclaration ||
71653
71736
  (interfaceDeclaration && !ts.some(getBaseTypes(type), function (base) { return !!getPropertyOfObjectType(base, prop.escapedName) && !!getIndexTypeOfType(base, info.keyType); }) ? interfaceDeclaration : undefined);
@@ -71661,7 +71744,7 @@ var ts;
71661
71744
  };
71662
71745
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
71663
71746
  var info = indexInfos_9[_i];
71664
- _loop_30(info);
71747
+ _loop_31(info);
71665
71748
  }
71666
71749
  }
71667
71750
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -71669,7 +71752,7 @@ var ts;
71669
71752
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
71670
71753
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 ? ts.getDeclarationOfKind(type.symbol, 261) : undefined;
71671
71754
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
71672
- var _loop_31 = function (info) {
71755
+ var _loop_32 = function (info) {
71673
71756
  if (info === checkInfo)
71674
71757
  return "continue";
71675
71758
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -71681,7 +71764,7 @@ var ts;
71681
71764
  };
71682
71765
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
71683
71766
  var info = indexInfos_10[_i];
71684
- _loop_31(info);
71767
+ _loop_32(info);
71685
71768
  }
71686
71769
  }
71687
71770
  function checkTypeNameIsReserved(name, message) {
@@ -71976,7 +72059,7 @@ var ts;
71976
72059
  var baseTypes = baseTypeNode && getBaseTypes(type);
71977
72060
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
71978
72061
  var baseStaticType = getBaseConstructorTypeOfClass(type);
71979
- var _loop_32 = function (member) {
72062
+ var _loop_33 = function (member) {
71980
72063
  if (ts.hasAmbientModifier(member)) {
71981
72064
  return "continue";
71982
72065
  }
@@ -71991,7 +72074,7 @@ var ts;
71991
72074
  };
71992
72075
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
71993
72076
  var member = _a[_i];
71994
- _loop_32(member);
72077
+ _loop_33(member);
71995
72078
  }
71996
72079
  }
71997
72080
  function checkExistingMemberForOverrideModifier(node, staticType, baseStaticType, baseWithThis, type, typeWithThis, member, memberIsParameterProperty, reportErrors) {
@@ -72066,7 +72149,7 @@ var ts;
72066
72149
  }
72067
72150
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
72068
72151
  var issuedMemberError = false;
72069
- var _loop_33 = function (member) {
72152
+ var _loop_34 = function (member) {
72070
72153
  if (ts.isStatic(member)) {
72071
72154
  return "continue";
72072
72155
  }
@@ -72084,7 +72167,7 @@ var ts;
72084
72167
  };
72085
72168
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
72086
72169
  var member = _a[_i];
72087
- _loop_33(member);
72170
+ _loop_34(member);
72088
72171
  }
72089
72172
  if (!issuedMemberError) {
72090
72173
  checkTypeAssignableTo(typeWithThis, baseWithThis, node.name || node, broadDiag);
@@ -72131,7 +72214,7 @@ var ts;
72131
72214
  function checkKindsOfPropertyMemberOverrides(type, baseType) {
72132
72215
  var _a, _b, _c, _d;
72133
72216
  var baseProperties = getPropertiesOfType(baseType);
72134
- var _loop_34 = function (baseProperty) {
72217
+ var _loop_35 = function (baseProperty) {
72135
72218
  var base = getTargetSymbol(baseProperty);
72136
72219
  if (base.flags & 4194304) {
72137
72220
  return "continue";
@@ -72229,8 +72312,8 @@ var ts;
72229
72312
  };
72230
72313
  basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
72231
72314
  var baseProperty = baseProperties_1[_i];
72232
- var state_10 = _loop_34(baseProperty);
72233
- switch (state_10) {
72315
+ var state_11 = _loop_35(baseProperty);
72316
+ switch (state_11) {
72234
72317
  case "continue-basePropertyCheck": continue basePropertyCheck;
72235
72318
  }
72236
72319
  }
@@ -74399,7 +74482,7 @@ var ts;
74399
74482
  }
74400
74483
  var node = ts.getParseTreeNode(nodeIn, ts.isIdentifier);
74401
74484
  if (node) {
74402
- var symbol = getReferencedValueSymbol(node);
74485
+ var symbol = getReferencedValueOrAliasSymbol(node);
74403
74486
  if (isNonLocalAlias(symbol, 111551) && !getTypeOnlyAliasDeclaration(symbol)) {
74404
74487
  return getDeclarationOfAliasSymbol(symbol);
74405
74488
  }
@@ -74720,6 +74803,13 @@ var ts;
74720
74803
  }
74721
74804
  return resolveName(location, reference.escapedText, 111551 | 1048576 | 2097152, undefined, undefined, true);
74722
74805
  }
74806
+ function getReferencedValueOrAliasSymbol(reference) {
74807
+ var resolvedSymbol = getNodeLinks(reference).resolvedSymbol;
74808
+ if (resolvedSymbol && resolvedSymbol !== unknownSymbol) {
74809
+ return resolvedSymbol;
74810
+ }
74811
+ return resolveName(reference, reference.escapedText, 111551 | 1048576 | 2097152, undefined, undefined, true, undefined, undefined);
74812
+ }
74723
74813
  function getReferencedValueDeclaration(referenceIn) {
74724
74814
  if (!ts.isGeneratedIdentifier(referenceIn)) {
74725
74815
  var reference = ts.getParseTreeNode(referenceIn, ts.isIdentifier);
@@ -80018,9 +80108,10 @@ var ts;
80018
80108
  return ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node) ? resolver.getConstantValue(node) : undefined;
80019
80109
  }
80020
80110
  function shouldEmitAliasDeclaration(node) {
80021
- return compilerOptions.preserveValueImports
80022
- ? resolver.isValueAliasDeclaration(node)
80023
- : resolver.isReferencedAliasDeclaration(node);
80111
+ return ts.isInJSFile(node) ||
80112
+ (compilerOptions.preserveValueImports
80113
+ ? resolver.isValueAliasDeclaration(node)
80114
+ : resolver.isReferencedAliasDeclaration(node));
80024
80115
  }
80025
80116
  }
80026
80117
  ts.transformTypeScript = transformTypeScript;
@@ -90806,7 +90897,7 @@ var ts;
90806
90897
  var _a;
90807
90898
  var primaryDeclaration = (_a = parentSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.getSourceFileOfNode(d) === containingFile; });
90808
90899
  var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; });
90809
- if (augmentingDeclarations) {
90900
+ if (primaryDeclaration && augmentingDeclarations) {
90810
90901
  for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {
90811
90902
  var augmentations = augmentingDeclarations_1[_i];
90812
90903
  context.addDiagnostic(ts.addRelatedInfo(ts.createDiagnosticForNode(augmentations, ts.Diagnostics.Declaration_augments_declaration_in_another_file_This_cannot_be_serialized), ts.createDiagnosticForNode(primaryDeclaration, ts.Diagnostics.This_is_the_declaration_being_augmented_Consider_moving_the_augmenting_declaration_into_the_same_file)));
@@ -98086,7 +98177,6 @@ var ts;
98086
98177
  return resolutions;
98087
98178
  }
98088
98179
  ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
98089
- ;
98090
98180
  function getModeForFileReference(ref, containingFileMode) {
98091
98181
  return (ts.isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
98092
98182
  }
@@ -103589,7 +103679,7 @@ var ts;
103589
103679
  importedFileFromNodeModules = importedFileFromNodeModules || isInNodeModules;
103590
103680
  });
103591
103681
  var sortedPaths = [];
103592
- var _loop_35 = function (directory) {
103682
+ var _loop_36 = function (directory) {
103593
103683
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
103594
103684
  var pathsInDirectory;
103595
103685
  allFileNames.forEach(function (_a, fileName) {
@@ -103613,9 +103703,9 @@ var ts;
103613
103703
  };
103614
103704
  var out_directory_1;
103615
103705
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
103616
- var state_11 = _loop_35(directory);
103706
+ var state_12 = _loop_36(directory);
103617
103707
  directory = out_directory_1;
103618
- if (state_11 === "break")
103708
+ if (state_12 === "break")
103619
103709
  break;
103620
103710
  }
103621
103711
  if (allFileNames.size) {
@@ -103674,7 +103764,7 @@ var ts;
103674
103764
  }
103675
103765
  function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
103676
103766
  for (var key in paths) {
103677
- var _loop_36 = function (patternText_1) {
103767
+ var _loop_37 = function (patternText_1) {
103678
103768
  var pattern = ts.normalizePath(patternText_1);
103679
103769
  var indexOfStar = pattern.indexOf("*");
103680
103770
  var candidates = allowedEndings.map(function (ending) { return ({
@@ -103705,9 +103795,9 @@ var ts;
103705
103795
  };
103706
103796
  for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
103707
103797
  var patternText_1 = _a[_i];
103708
- var state_12 = _loop_36(patternText_1);
103709
- if (typeof state_12 === "object")
103710
- return state_12.value;
103798
+ var state_13 = _loop_37(patternText_1);
103799
+ if (typeof state_13 === "object")
103800
+ return state_13.value;
103711
103801
  }
103712
103802
  }
103713
103803
  function validateEnding(_a) {
@@ -107301,7 +107391,6 @@ var ts;
107301
107391
  var colors = createColors(sys);
107302
107392
  var header = [];
107303
107393
  var terminalWidth = (_b = (_a = sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(sys)) !== null && _b !== void 0 ? _b : 0;
107304
- ;
107305
107394
  var tsIconLength = 5;
107306
107395
  var tsIconFirstLine = colors.blueBackground(ts.padLeft("", tsIconLength));
107307
107396
  var tsIconSecondLine = colors.blueBackground(colors.brightWhite(ts.padLeft("TS ", tsIconLength)));