@typescript-deploys/pr-build 4.9.0-pr-49929-7 → 4.9.0-pr-50776-2

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/tsserver.js CHANGED
@@ -109,7 +109,7 @@ var ts;
109
109
  // The following is baselined as a literal template type without intervention
110
110
  /** The version of the TypeScript compiler release */
111
111
  // eslint-disable-next-line @typescript-eslint/no-inferrable-types
112
- ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220919");
112
+ ts.version = "".concat(ts.versionMajorMinor, ".0-insiders.20220922");
113
113
  /* @internal */
114
114
  var Comparison;
115
115
  (function (Comparison) {
@@ -298,6 +298,11 @@ var ts;
298
298
  return result;
299
299
  }
300
300
  ts.intersperse = intersperse;
301
+ /**
302
+ * Iterates through `array` by index and performs the callback on each element of array until the callback
303
+ * returns a falsey value, then returns false.
304
+ * If no such value is found, the callback is applied to each element of array and `true` is returned.
305
+ */
301
306
  function every(array, callback) {
302
307
  if (array) {
303
308
  for (var i = 0; i < array.length; i++) {
@@ -309,10 +314,6 @@ var ts;
309
314
  return true;
310
315
  }
311
316
  ts.every = every;
312
- function isArrayOf(array, callback) {
313
- return every(array, callback);
314
- }
315
- ts.isArrayOf = isArrayOf;
316
317
  function find(array, predicate, startIndex) {
317
318
  if (array === undefined)
318
319
  return undefined;
@@ -989,7 +990,6 @@ var ts;
989
990
  }
990
991
  ts.sum = sum;
991
992
  function append(to, value) {
992
- // If to is Push<T>, return value is void, so safe to cast to T[].
993
993
  if (value === undefined)
994
994
  return to;
995
995
  if (to === undefined)
@@ -2693,7 +2693,7 @@ var ts;
2693
2693
  if (typeof func !== "function") {
2694
2694
  return "";
2695
2695
  }
2696
- else if (func.hasOwnProperty("name")) {
2696
+ else if (ts.hasProperty(func, "name")) {
2697
2697
  return func.name;
2698
2698
  }
2699
2699
  else {
@@ -3018,7 +3018,7 @@ var ts;
3018
3018
  ];
3019
3019
  for (var _i = 0, nodeConstructors_1 = nodeConstructors; _i < nodeConstructors_1.length; _i++) {
3020
3020
  var ctor = nodeConstructors_1[_i];
3021
- if (!ctor.prototype.hasOwnProperty("__debugKind")) {
3021
+ if (!ts.hasProperty(ctor.prototype, "__debugKind")) {
3022
3022
  Object.defineProperties(ctor.prototype, {
3023
3023
  // for use with vscode-js-debug's new customDescriptionGenerator in launch.json
3024
3024
  __tsDebuggerDisplay: {
@@ -3873,7 +3873,6 @@ var ts;
3873
3873
  var typeCatalog = []; // NB: id is index + 1
3874
3874
  var legendPath;
3875
3875
  var legend = [];
3876
- ;
3877
3876
  /** Starts tracing for the given project. */
3878
3877
  function startTracing(tracingMode, traceDir, configFilePath) {
3879
3878
  ts.Debug.assert(!ts.tracing, "Tracing already started");
@@ -8705,8 +8704,6 @@ var ts;
8705
8704
  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."),
8706
8705
  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."),
8707
8706
  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."),
8708
- 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'."),
8709
- 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."),
8710
8707
  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."),
8711
8708
  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."),
8712
8709
  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."),
@@ -8955,6 +8952,7 @@ var ts;
8955
8952
  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."),
8956
8953
  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."),
8957
8954
  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."),
8955
+ 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."),
8958
8956
  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."),
8959
8957
  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."),
8960
8958
  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."),
@@ -9135,6 +9133,7 @@ var ts;
9135
9133
  _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?"),
9136
9134
  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."),
9137
9135
  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."),
9136
+ This_condition_will_always_return_0: diag(2845, ts.DiagnosticCategory.Error, "This_condition_will_always_return_0_2845", "This condition will always return '{0}'."),
9138
9137
  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}'."),
9139
9138
  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}'."),
9140
9139
  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}'."),
@@ -10077,6 +10076,8 @@ var ts;
10077
10076
  Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
10078
10077
  Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
10079
10078
  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}'"),
10079
+ Use_0: diag(95174, ts.DiagnosticCategory.Message, "Use_0_95174", "Use `{0}`."),
10080
+ Use_Number_isNaN_in_all_conditions: diag(95175, ts.DiagnosticCategory.Message, "Use_Number_isNaN_in_all_conditions_95175", "Use `Number.isNaN` in all conditions."),
10080
10081
  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."),
10081
10082
  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'."),
10082
10083
  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?"),
@@ -10338,7 +10339,7 @@ var ts;
10338
10339
  ts.stringToToken = stringToToken;
10339
10340
  /* @internal */
10340
10341
  function computeLineStarts(text) {
10341
- var result = new Array();
10342
+ var result = [];
10342
10343
  var pos = 0;
10343
10344
  var lineStart = 0;
10344
10345
  while (pos < text.length) {
@@ -10815,7 +10816,9 @@ var ts;
10815
10816
  }
10816
10817
  ts.reduceEachTrailingCommentRange = reduceEachTrailingCommentRange;
10817
10818
  function appendCommentRange(pos, end, kind, hasTrailingNewLine, _state, comments) {
10818
- if (comments === void 0) { comments = []; }
10819
+ if (!comments) {
10820
+ comments = [];
10821
+ }
10819
10822
  comments.push({ kind: kind, pos: pos, end: end, hasTrailingNewLine: hasTrailingNewLine });
10820
10823
  return comments;
10821
10824
  }
@@ -11897,12 +11900,36 @@ var ts;
11897
11900
  pos++;
11898
11901
  return token = 0 /* SyntaxKind.Unknown */;
11899
11902
  }
11900
- if (isIdentifierStart(codePointAt(text, pos + 1), languageVersion)) {
11903
+ var charAfterHash = codePointAt(text, pos + 1);
11904
+ if (charAfterHash === 92 /* CharacterCodes.backslash */) {
11905
+ pos++;
11906
+ var extendedCookedChar_1 = peekExtendedUnicodeEscape();
11907
+ if (extendedCookedChar_1 >= 0 && isIdentifierStart(extendedCookedChar_1, languageVersion)) {
11908
+ pos += 3;
11909
+ tokenFlags |= 8 /* TokenFlags.ExtendedUnicodeEscape */;
11910
+ tokenValue = "#" + scanExtendedUnicodeEscape() + scanIdentifierParts();
11911
+ return token = 80 /* SyntaxKind.PrivateIdentifier */;
11912
+ }
11913
+ var cookedChar_1 = peekUnicodeEscape();
11914
+ if (cookedChar_1 >= 0 && isIdentifierStart(cookedChar_1, languageVersion)) {
11915
+ pos += 6;
11916
+ tokenFlags |= 1024 /* TokenFlags.UnicodeEscape */;
11917
+ tokenValue = "#" + String.fromCharCode(cookedChar_1) + scanIdentifierParts();
11918
+ return token = 80 /* SyntaxKind.PrivateIdentifier */;
11919
+ }
11920
+ pos--;
11921
+ }
11922
+ if (isIdentifierStart(charAfterHash, languageVersion)) {
11901
11923
  pos++;
11902
- scanIdentifier(codePointAt(text, pos), languageVersion);
11924
+ // We're relying on scanIdentifier's behavior and adjusting the token kind after the fact.
11925
+ // Notably absent from this block is the fact that calling a function named "scanIdentifier",
11926
+ // but identifiers don't include '#', and that function doesn't deal with it at all.
11927
+ // This works because 'scanIdentifier' tries to reuse source characters and builds up substrings;
11928
+ // however, it starts at the 'tokenPos' which includes the '#', and will "accidentally" prepend the '#' for us.
11929
+ scanIdentifier(charAfterHash, languageVersion);
11903
11930
  }
11904
11931
  else {
11905
- tokenValue = String.fromCharCode(codePointAt(text, pos));
11932
+ tokenValue = "#";
11906
11933
  error(ts.Diagnostics.Invalid_character, pos++, charSize(ch));
11907
11934
  }
11908
11935
  return token = 80 /* SyntaxKind.PrivateIdentifier */;
@@ -12673,8 +12700,6 @@ var ts;
12673
12700
  return false;
12674
12701
  }
12675
12702
  ts.isEmptyBindingPattern = isEmptyBindingPattern;
12676
- // TODO(jakebailey): It is very weird that we have BindingElement and ArrayBindingElement;
12677
- // we should have ObjectBindingElement and ArrayBindingElement, which are both BindingElement.
12678
12703
  function isEmptyBindingElement(node) {
12679
12704
  if (ts.isOmittedExpression(node)) {
12680
12705
  return true;
@@ -12793,10 +12818,7 @@ var ts;
12793
12818
  node = node.original;
12794
12819
  }
12795
12820
  }
12796
- if (!node || !nodeTest) {
12797
- return node;
12798
- }
12799
- return nodeTest(node) ? node : undefined;
12821
+ return !nodeTest || nodeTest(node) ? node : undefined;
12800
12822
  }
12801
12823
  ts.getOriginalNode = getOriginalNode;
12802
12824
  function findAncestor(node, callback) {
@@ -13474,7 +13496,7 @@ var ts;
13474
13496
  // Node Arrays
13475
13497
  /* @internal */
13476
13498
  function isNodeArray(array) {
13477
- return array.hasOwnProperty("pos") && array.hasOwnProperty("end");
13499
+ return ts.hasProperty(array, "pos") && ts.hasProperty(array, "end");
13478
13500
  }
13479
13501
  ts.isNodeArray = isNodeArray;
13480
13502
  // Literals
@@ -13822,13 +13844,6 @@ var ts;
13822
13844
  return false;
13823
13845
  }
13824
13846
  ts.isDeclarationBindingElement = isDeclarationBindingElement;
13825
- function isBindingOrAssignmentElement(node) {
13826
- return ts.isVariableDeclaration(node)
13827
- || ts.isParameter(node)
13828
- || isObjectBindingOrAssignmentElement(node)
13829
- || isArrayBindingOrAssignmentElement(node);
13830
- }
13831
- ts.isBindingOrAssignmentElement = isBindingOrAssignmentElement;
13832
13847
  /**
13833
13848
  * Determines whether a node is a BindingOrAssignmentPattern
13834
13849
  */
@@ -13877,22 +13892,6 @@ var ts;
13877
13892
  }
13878
13893
  ts.isArrayBindingOrAssignmentPattern = isArrayBindingOrAssignmentPattern;
13879
13894
  /* @internal */
13880
- function isArrayBindingOrAssignmentElement(node) {
13881
- switch (node.kind) {
13882
- case 205 /* SyntaxKind.BindingElement */:
13883
- case 229 /* SyntaxKind.OmittedExpression */: // Elision
13884
- case 227 /* SyntaxKind.SpreadElement */: // AssignmentRestElement
13885
- case 206 /* SyntaxKind.ArrayLiteralExpression */: // ArrayAssignmentPattern
13886
- case 207 /* SyntaxKind.ObjectLiteralExpression */: // ObjectAssignmentPattern
13887
- case 79 /* SyntaxKind.Identifier */: // DestructuringAssignmentTarget
13888
- case 208 /* SyntaxKind.PropertyAccessExpression */: // DestructuringAssignmentTarget
13889
- case 209 /* SyntaxKind.ElementAccessExpression */: // DestructuringAssignmentTarget
13890
- return true;
13891
- }
13892
- return ts.isAssignmentExpression(node, /*excludeCompoundAssignment*/ true); // AssignmentElement
13893
- }
13894
- ts.isArrayBindingOrAssignmentElement = isArrayBindingOrAssignmentElement;
13895
- /* @internal */
13896
13895
  function isPropertyAccessOrQualifiedNameOrImportTypeNode(node) {
13897
13896
  var kind = node.kind;
13898
13897
  return kind === 208 /* SyntaxKind.PropertyAccessExpression */
@@ -14005,23 +14004,6 @@ var ts;
14005
14004
  }
14006
14005
  }
14007
14006
  ts.isUnaryExpressionWithWrite = isUnaryExpressionWithWrite;
14008
- /**
14009
- * See isExpression; not for use in transforms.
14010
- * @internal
14011
- */
14012
- function isLiteralTypeLiteral(node) {
14013
- node = skipPartiallyEmittedExpressions(node);
14014
- switch (skipPartiallyEmittedExpressions(node).kind) {
14015
- case 104 /* SyntaxKind.NullKeyword */:
14016
- case 110 /* SyntaxKind.TrueKeyword */:
14017
- case 95 /* SyntaxKind.FalseKeyword */:
14018
- case 221 /* SyntaxKind.PrefixUnaryExpression */:
14019
- return true;
14020
- default:
14021
- return isLiteralExpression(node);
14022
- }
14023
- }
14024
- ts.isLiteralTypeLiteral = isLiteralTypeLiteral;
14025
14007
  /* @internal */
14026
14008
  /**
14027
14009
  * Determines whether a node is an expression based only on its kind.
@@ -14986,7 +14968,6 @@ var ts;
14986
14968
  return emitNode && emitNode.flags || 0;
14987
14969
  }
14988
14970
  ts.getEmitFlags = getEmitFlags;
14989
- ;
14990
14971
  function getScriptTargetFeatures() {
14991
14972
  return {
14992
14973
  es2015: {
@@ -15301,7 +15282,6 @@ var ts;
15301
15282
  }
15302
15283
  ts.isBlockScope = isBlockScope;
15303
15284
  function isDeclarationWithTypeParameters(node) {
15304
- ts.Debug.type(node);
15305
15285
  switch (node.kind) {
15306
15286
  case 341 /* SyntaxKind.JSDocCallbackTag */:
15307
15287
  case 348 /* SyntaxKind.JSDocTypedefTag */:
@@ -15314,7 +15294,6 @@ var ts;
15314
15294
  }
15315
15295
  ts.isDeclarationWithTypeParameters = isDeclarationWithTypeParameters;
15316
15296
  function isDeclarationWithTypeParameterChildren(node) {
15317
- ts.Debug.type(node);
15318
15297
  switch (node.kind) {
15319
15298
  case 176 /* SyntaxKind.CallSignature */:
15320
15299
  case 177 /* SyntaxKind.ConstructSignature */:
@@ -17773,10 +17752,6 @@ var ts;
17773
17752
  return node.escapedText === "push" || node.escapedText === "unshift";
17774
17753
  }
17775
17754
  ts.isPushOrUnshiftIdentifier = isPushOrUnshiftIdentifier;
17776
- // TODO(jakebailey): this function should not be named this. While it does technically
17777
- // return true if the argument is a ParameterDeclaration, it also returns true for nodes
17778
- // that are children of ParameterDeclarations inside binding elements.
17779
- // Probably, this should be called `rootDeclarationIsParameter`.
17780
17755
  function isParameterDeclaration(node) {
17781
17756
  var root = getRootDeclaration(node);
17782
17757
  return root.kind === 166 /* SyntaxKind.Parameter */;
@@ -19718,7 +19693,7 @@ var ts;
19718
19693
  }
19719
19694
  function isWatchSet(options) {
19720
19695
  // Firefox has Object.prototype.watch
19721
- return options.watch && options.hasOwnProperty("watch");
19696
+ return options.watch && ts.hasProperty(options, "watch");
19722
19697
  }
19723
19698
  ts.isWatchSet = isWatchSet;
19724
19699
  function closeFileWatcher(watcher) {
@@ -19966,7 +19941,6 @@ var ts;
19966
19941
  || kind === 114 /* SyntaxKind.VoidKeyword */
19967
19942
  || kind === 155 /* SyntaxKind.UndefinedKeyword */
19968
19943
  || kind === 144 /* SyntaxKind.NeverKeyword */
19969
- || kind === 139 /* SyntaxKind.IntrinsicKeyword */
19970
19944
  || kind === 230 /* SyntaxKind.ExpressionWithTypeArguments */
19971
19945
  || kind === 315 /* SyntaxKind.JSDocAllType */
19972
19946
  || kind === 316 /* SyntaxKind.JSDocUnknownType */
@@ -22278,11 +22252,6 @@ var ts;
22278
22252
  }
22279
22253
  }
22280
22254
  ts.createParenthesizerRules = createParenthesizerRules;
22281
- function castToNodeArray(nodes) {
22282
- // TODO(jakebailey): Why do we need this helper? GH#49924?
22283
- // Also, why can't I write `isNodeArray<T>` as an expression?
22284
- return ts.cast(nodes, ts.isNodeArray);
22285
- }
22286
22255
  ts.nullParenthesizerRules = {
22287
22256
  getParenthesizeLeftSideOfBinaryForOperator: function (_) { return ts.identity; },
22288
22257
  getParenthesizeRightSideOfBinaryForOperator: function (_) { return ts.identity; },
@@ -22296,23 +22265,23 @@ var ts;
22296
22265
  parenthesizeLeftSideOfAccess: function (expression) { return ts.cast(expression, ts.isLeftHandSideExpression); },
22297
22266
  parenthesizeOperandOfPostfixUnary: function (operand) { return ts.cast(operand, ts.isLeftHandSideExpression); },
22298
22267
  parenthesizeOperandOfPrefixUnary: function (operand) { return ts.cast(operand, ts.isUnaryExpression); },
22299
- parenthesizeExpressionsOfCommaDelimitedList: castToNodeArray,
22268
+ parenthesizeExpressionsOfCommaDelimitedList: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
22300
22269
  parenthesizeExpressionForDisallowedComma: ts.identity,
22301
22270
  parenthesizeExpressionOfExpressionStatement: ts.identity,
22302
22271
  parenthesizeConciseBodyOfArrowFunction: ts.identity,
22303
22272
  parenthesizeCheckTypeOfConditionalType: ts.identity,
22304
22273
  parenthesizeExtendsTypeOfConditionalType: ts.identity,
22305
- parenthesizeConstituentTypesOfUnionType: castToNodeArray,
22274
+ parenthesizeConstituentTypesOfUnionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
22306
22275
  parenthesizeConstituentTypeOfUnionType: ts.identity,
22307
- parenthesizeConstituentTypesOfIntersectionType: castToNodeArray,
22276
+ parenthesizeConstituentTypesOfIntersectionType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
22308
22277
  parenthesizeConstituentTypeOfIntersectionType: ts.identity,
22309
22278
  parenthesizeOperandOfTypeOperator: ts.identity,
22310
22279
  parenthesizeOperandOfReadonlyTypeOperator: ts.identity,
22311
22280
  parenthesizeNonArrayTypeOfPostfixType: ts.identity,
22312
- parenthesizeElementTypesOfTupleType: castToNodeArray,
22281
+ parenthesizeElementTypesOfTupleType: function (nodes) { return ts.cast(nodes, ts.isNodeArray); },
22313
22282
  parenthesizeElementTypeOfTupleType: ts.identity,
22314
22283
  parenthesizeTypeOfOptionalType: ts.identity,
22315
- parenthesizeTypeArguments: function (nodes) { return nodes && castToNodeArray(nodes); },
22284
+ parenthesizeTypeArguments: function (nodes) { return nodes && ts.cast(nodes, ts.isNodeArray); },
22316
22285
  parenthesizeLeadingTypeArgument: ts.identity,
22317
22286
  };
22318
22287
  })(ts || (ts = {}));
@@ -27009,7 +26978,7 @@ var ts;
27009
26978
  clone.transformFlags = node.transformFlags;
27010
26979
  setOriginalNode(clone, node);
27011
26980
  for (var key in node) {
27012
- if (clone.hasOwnProperty(key) || !node.hasOwnProperty(key)) {
26981
+ if (ts.hasProperty(clone, key) || !ts.hasProperty(node, key)) {
27013
26982
  continue;
27014
26983
  }
27015
26984
  clone[key] = node[key];
@@ -31897,7 +31866,6 @@ var ts;
31897
31866
  visitNodes(cbNode, cbNodes, node.parameters) ||
31898
31867
  visitNode(cbNode, node.type);
31899
31868
  }
31900
- ;
31901
31869
  function forEachChildInUnionOrIntersectionType(node, cbNode, cbNodes) {
31902
31870
  return visitNodes(cbNode, cbNodes, node.types);
31903
31871
  }
@@ -33199,7 +33167,7 @@ var ts;
33199
33167
  }
33200
33168
  function parsePrivateIdentifier() {
33201
33169
  var pos = getNodePos();
33202
- var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenText()));
33170
+ var node = factory.createPrivateIdentifier(internPrivateIdentifier(scanner.getTokenValue()));
33203
33171
  nextToken();
33204
33172
  return finishNode(node, pos);
33205
33173
  }
@@ -39297,8 +39265,8 @@ var ts;
39297
39265
  }
39298
39266
  }
39299
39267
  }
39300
- function moveElementEntirelyPastChangeRange(element, delta, oldText, newText, aggressiveChecks) {
39301
- if (ts.isArray(element)) {
39268
+ function moveElementEntirelyPastChangeRange(element, isArray, delta, oldText, newText, aggressiveChecks) {
39269
+ if (isArray) {
39302
39270
  visitArray(element);
39303
39271
  }
39304
39272
  else {
@@ -39306,7 +39274,6 @@ var ts;
39306
39274
  }
39307
39275
  return;
39308
39276
  function visitNode(node) {
39309
- ts.Debug.type(node);
39310
39277
  var text = "";
39311
39278
  if (aggressiveChecks && shouldCheckNode(node)) {
39312
39279
  text = oldText.substring(node.pos, node.end);
@@ -39330,7 +39297,6 @@ var ts;
39330
39297
  checkNodePositions(node, aggressiveChecks);
39331
39298
  }
39332
39299
  function visitArray(array) {
39333
- ts.Debug.type(array);
39334
39300
  array._children = undefined;
39335
39301
  ts.setTextRangePosEnd(array, array.pos + delta, array.end + delta);
39336
39302
  for (var _i = 0, array_9 = array; _i < array_9.length; _i++) {
@@ -39436,12 +39402,11 @@ var ts;
39436
39402
  visitNode(sourceFile);
39437
39403
  return;
39438
39404
  function visitNode(child) {
39439
- ts.Debug.type(child);
39440
39405
  ts.Debug.assert(child.pos <= child.end);
39441
39406
  if (child.pos > changeRangeOldEnd) {
39442
39407
  // Node is entirely past the change range. We need to move both its pos and
39443
39408
  // end, forward or backward appropriately.
39444
- moveElementEntirelyPastChangeRange(child, delta, oldText, newText, aggressiveChecks);
39409
+ moveElementEntirelyPastChangeRange(child, /*isArray*/ false, delta, oldText, newText, aggressiveChecks);
39445
39410
  return;
39446
39411
  }
39447
39412
  // Check if the element intersects the change range. If it does, then it is not
@@ -39467,12 +39432,11 @@ var ts;
39467
39432
  ts.Debug.assert(fullEnd < changeStart);
39468
39433
  }
39469
39434
  function visitArray(array) {
39470
- ts.Debug.type(array);
39471
39435
  ts.Debug.assert(array.pos <= array.end);
39472
39436
  if (array.pos > changeRangeOldEnd) {
39473
39437
  // Array is entirely after the change range. We need to move it, and move any of
39474
39438
  // its children.
39475
- moveElementEntirelyPastChangeRange(array, delta, oldText, newText, aggressiveChecks);
39439
+ moveElementEntirelyPastChangeRange(array, /*isArray*/ true, delta, oldText, newText, aggressiveChecks);
39476
39440
  return;
39477
39441
  }
39478
39442
  // Check if the element intersects the change range. If it does, then it is not
@@ -43074,7 +43038,6 @@ var ts;
43074
43038
  }
43075
43039
  }
43076
43040
  function specToDiagnostic(spec, disallowTrailingRecursion) {
43077
- ts.Debug.assert(typeof spec === "string");
43078
43041
  if (disallowTrailingRecursion && invalidTrailingRecursionPattern.test(spec)) {
43079
43042
  return [ts.Diagnostics.File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0, spec];
43080
43043
  }
@@ -43218,7 +43181,7 @@ var ts;
43218
43181
  function convertCompilerOptionsForTelemetry(opts) {
43219
43182
  var out = {};
43220
43183
  for (var key in opts) {
43221
- if (opts.hasOwnProperty(key)) {
43184
+ if (ts.hasProperty(opts, key)) {
43222
43185
  var type = getOptionFromName(key);
43223
43186
  if (type !== undefined) { // Ignore unknown options
43224
43187
  out[key] = getOptionValueWithEmptyStrings(opts[key], type);
@@ -45290,6 +45253,7 @@ var ts;
45290
45253
  }
45291
45254
  }
45292
45255
  function loadModuleFromSpecificNodeModulesDirectory(extensions, moduleName, nodeModulesDirectory, nodeModulesDirectoryExists, state, cache, redirectedReference) {
45256
+ var _a;
45293
45257
  var candidate = ts.normalizePath(ts.combinePaths(nodeModulesDirectory, moduleName));
45294
45258
  // First look for a nested package.json, as in `node_modules/foo/bar/package.json`.
45295
45259
  var packageInfo = getPackageJsonInfo(candidate, !nodeModulesDirectoryExists, state);
@@ -45304,13 +45268,7 @@ var ts;
45304
45268
  return withPackageId(packageInfo, fromDirectory);
45305
45269
  }
45306
45270
  }
45307
- var _a = parsePackageName(moduleName), packageName = _a.packageName, rest = _a.rest;
45308
45271
  var loader = function (extensions, candidate, onlyRecordFailures, state) {
45309
- var _a;
45310
- // package exports are higher priority than file/directory lookups (and, if there's exports present, blocks them)
45311
- if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45312
- return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45313
- }
45314
45272
  var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
45315
45273
  loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.contents.packageJsonContent, packageInfo && packageInfo.contents.versionPaths);
45316
45274
  if (!pathAndExtension && packageInfo
@@ -45323,19 +45281,24 @@ var ts;
45323
45281
  }
45324
45282
  return withPackageId(packageInfo, pathAndExtension);
45325
45283
  };
45326
- if (rest !== "") { // If "rest" is empty, we just did this search above.
45327
- var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45328
- // Don't use a "types" or "main" from here because we're not loading the root, but a subdirectory -- just here for the packageId and path mappings.
45284
+ var _b = parsePackageName(moduleName), packageName = _b.packageName, rest = _b.rest;
45285
+ var packageDirectory = ts.combinePaths(nodeModulesDirectory, packageName);
45286
+ if (rest !== "") {
45287
+ // Previous `packageInfo` may have been from a nested package.json; ensure we have the one from the package root now.
45329
45288
  packageInfo = getPackageJsonInfo(packageDirectory, !nodeModulesDirectoryExists, state);
45330
- if (packageInfo && packageInfo.contents.versionPaths) {
45331
- if (state.traceEnabled) {
45332
- 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);
45333
- }
45334
- var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45335
- var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45336
- if (fromPaths) {
45337
- return fromPaths.value;
45338
- }
45289
+ }
45290
+ // package exports are higher priority than file/directory/typesVersions lookups and (and, if there's exports present, blocks them)
45291
+ if (packageInfo && packageInfo.contents.packageJsonContent.exports && state.features & NodeResolutionFeatures.Exports) {
45292
+ return (_a = loadModuleFromExports(packageInfo, extensions, ts.combinePaths(".", rest), state, cache, redirectedReference)) === null || _a === void 0 ? void 0 : _a.value;
45293
+ }
45294
+ if (rest !== "" && packageInfo && packageInfo.contents.versionPaths) {
45295
+ if (state.traceEnabled) {
45296
+ 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);
45297
+ }
45298
+ var packageDirectoryExists = nodeModulesDirectoryExists && ts.directoryProbablyExists(packageDirectory, state.host);
45299
+ var fromPaths = tryLoadModuleUsingPaths(extensions, rest, packageDirectory, packageInfo.contents.versionPaths.paths, /*pathPatterns*/ undefined, loader, !packageDirectoryExists, state);
45300
+ if (fromPaths) {
45301
+ return fromPaths.value;
45339
45302
  }
45340
45303
  }
45341
45304
  return loader(extensions, candidate, !nodeModulesDirectoryExists, state);
@@ -49722,7 +49685,8 @@ var ts;
49722
49685
  var emptyTypeLiteralSymbol = createSymbol(2048 /* SymbolFlags.TypeLiteral */, "__type" /* InternalSymbolName.Type */);
49723
49686
  emptyTypeLiteralSymbol.members = ts.createSymbolTable();
49724
49687
  var emptyTypeLiteralType = createAnonymousType(emptyTypeLiteralSymbol, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
49725
- var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray)]) : unknownType;
49688
+ var unknownEmptyObjectType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
49689
+ var unknownUnionType = strictNullChecks ? getUnionType([undefinedType, nullType, unknownEmptyObjectType]) : unknownType;
49726
49690
  var emptyGenericType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
49727
49691
  emptyGenericType.instantiations = new ts.Map();
49728
49692
  var anyFunctionType = createAnonymousType(undefined, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
@@ -49836,6 +49800,8 @@ var ts;
49836
49800
  var deferredGlobalOmitSymbol;
49837
49801
  var deferredGlobalAwaitedSymbol;
49838
49802
  var deferredGlobalBigIntType;
49803
+ var deferredGlobalNaNSymbol;
49804
+ var deferredGlobalRecordSymbol;
49839
49805
  var allPotentiallyUnusedIdentifiers = new ts.Map(); // key is file name
49840
49806
  var flowLoopStart = 0;
49841
49807
  var flowLoopCount = 0;
@@ -49920,7 +49886,7 @@ var ts;
49920
49886
  if (jsxFragmentPragma) {
49921
49887
  var chosenPragma = ts.isArray(jsxFragmentPragma) ? jsxFragmentPragma[0] : jsxFragmentPragma;
49922
49888
  file.localJsxFragmentFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
49923
- ts.visitNode(file.localJsxFragmentFactory, markAsSynthetic, ts.isEntityName);
49889
+ ts.visitNode(file.localJsxFragmentFactory, markAsSynthetic);
49924
49890
  if (file.localJsxFragmentFactory) {
49925
49891
  return file.localJsxFragmentNamespace = ts.getFirstIdentifier(file.localJsxFragmentFactory).escapedText;
49926
49892
  }
@@ -49965,7 +49931,7 @@ var ts;
49965
49931
  if (jsxPragma) {
49966
49932
  var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
49967
49933
  file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
49968
- ts.visitNode(file.localJsxFactory, markAsSynthetic, ts.isEntityName);
49934
+ ts.visitNode(file.localJsxFactory, markAsSynthetic);
49969
49935
  if (file.localJsxFactory) {
49970
49936
  return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
49971
49937
  }
@@ -51624,7 +51590,6 @@ var ts;
51624
51590
  return valueSymbol;
51625
51591
  }
51626
51592
  var result = createSymbol(valueSymbol.flags | typeSymbol.flags, valueSymbol.escapedName);
51627
- ts.Debug.assert(valueSymbol.declarations || typeSymbol.declarations);
51628
51593
  result.declarations = ts.deduplicate(ts.concatenate(valueSymbol.declarations, typeSymbol.declarations), ts.equateValues);
51629
51594
  result.parent = valueSymbol.parent || typeSymbol.parent;
51630
51595
  if (valueSymbol.valueDeclaration)
@@ -53677,7 +53642,6 @@ var ts;
53677
53642
  var objectFlags = ts.getObjectFlags(type);
53678
53643
  if (objectFlags & 4 /* ObjectFlags.Reference */) {
53679
53644
  ts.Debug.assert(!!(type.flags & 524288 /* TypeFlags.Object */));
53680
- ts.Debug.type(type);
53681
53645
  return type.node ? visitAndTransformType(type, typeReferenceToTypeNode) : typeReferenceToTypeNode(type);
53682
53646
  }
53683
53647
  if (type.flags & 262144 /* TypeFlags.TypeParameter */ || objectFlags & 3 /* ObjectFlags.ClassOrInterface */) {
@@ -55136,7 +55100,7 @@ var ts;
55136
55100
  }
55137
55101
  var hadError = false;
55138
55102
  var file = ts.getSourceFileOfNode(existing);
55139
- var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols, ts.isTypeNode);
55103
+ var transformed = ts.visitNode(existing, visitExistingNodeTreeSymbols);
55140
55104
  if (hadError) {
55141
55105
  return undefined;
55142
55106
  }
@@ -55167,7 +55131,7 @@ var ts;
55167
55131
  var typeViaParent = getTypeOfPropertyOfType(getTypeFromTypeNode(node), name.escapedText);
55168
55132
  var overrideTypeNode = typeViaParent && t.typeExpression && getTypeFromTypeNode(t.typeExpression.type) !== typeViaParent ? typeToTypeNodeHelper(typeViaParent, context) : undefined;
55169
55133
  return ts.factory.createPropertySignature(
55170
- /*modifiers*/ undefined, name, t.isBracketed || t.typeExpression && ts.isJSDocOptionalType(t.typeExpression.type) ? ts.factory.createToken(57 /* SyntaxKind.QuestionToken */) : undefined, overrideTypeNode || (t.typeExpression && ts.visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols, ts.isTypeNode)) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
55134
+ /*modifiers*/ undefined, name, t.isBracketed || t.typeExpression && ts.isJSDocOptionalType(t.typeExpression.type) ? ts.factory.createToken(57 /* SyntaxKind.QuestionToken */) : undefined, overrideTypeNode || (t.typeExpression && ts.visitNode(t.typeExpression.type, visitExistingNodeTreeSymbols)) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
55171
55135
  }));
55172
55136
  }
55173
55137
  if (ts.isTypeReferenceNode(node) && ts.isIdentifier(node.typeName) && node.typeName.escapedText === "") {
@@ -55178,18 +55142,18 @@ var ts;
55178
55142
  /*modifiers*/ undefined, [ts.factory.createParameterDeclaration(
55179
55143
  /*modifiers*/ undefined,
55180
55144
  /*dotdotdotToken*/ undefined, "x",
55181
- /*questionToken*/ undefined, ts.visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols, ts.isTypeNode))], ts.visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols))]);
55145
+ /*questionToken*/ undefined, ts.visitNode(node.typeArguments[0], visitExistingNodeTreeSymbols))], ts.visitNode(node.typeArguments[1], visitExistingNodeTreeSymbols))]);
55182
55146
  }
55183
55147
  if (ts.isJSDocFunctionType(node)) {
55184
55148
  if (ts.isJSDocConstructSignature(node)) {
55185
55149
  var newTypeNode_1;
55186
55150
  return ts.factory.createConstructorTypeNode(
55187
- /*modifiers*/ undefined, ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols, ts.isTypeParameterDeclaration), ts.mapDefined(node.parameters, function (p, i) { return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode_1 = p.type, undefined) : ts.factory.createParameterDeclaration(
55151
+ /*modifiers*/ undefined, ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.mapDefined(node.parameters, function (p, i) { return p.name && ts.isIdentifier(p.name) && p.name.escapedText === "new" ? (newTypeNode_1 = p.type, undefined) : ts.factory.createParameterDeclaration(
55188
55152
  /*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols),
55189
55153
  /*initializer*/ undefined); }), ts.visitNode(newTypeNode_1 || node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
55190
55154
  }
55191
55155
  else {
55192
- return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols, ts.isTypeParameterDeclaration), ts.map(node.parameters, function (p, i) { return ts.factory.createParameterDeclaration(
55156
+ return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.map(node.parameters, function (p, i) { return ts.factory.createParameterDeclaration(
55193
55157
  /*modifiers*/ undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols),
55194
55158
  /*initializer*/ undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */));
55195
55159
  }
@@ -55515,6 +55479,7 @@ var ts;
55515
55479
  && symbol.escapedName !== "export=" /* InternalSymbolName.ExportEquals */
55516
55480
  && !(symbol.flags & 4194304 /* SymbolFlags.Prototype */)
55517
55481
  && !(symbol.flags & 32 /* SymbolFlags.Class */)
55482
+ && !(symbol.flags & 8192 /* SymbolFlags.Method */)
55518
55483
  && !isConstMergedWithNSPrintableAsSignatureMerge) {
55519
55484
  if (propertyAsAlias) {
55520
55485
  var createdExport = serializeMaybeAliasAssignment(symbol);
@@ -55644,7 +55609,7 @@ var ts;
55644
55609
  }
55645
55610
  }
55646
55611
  function includePrivateSymbol(symbol) {
55647
- if (ts.some(symbol.declarations, ts.isParameter))
55612
+ if (ts.some(symbol.declarations, ts.isParameterDeclaration))
55648
55613
  return;
55649
55614
  ts.Debug.assertIsDefined(deferredPrivatesStack[deferredPrivatesStack.length - 1]);
55650
55615
  getUnusedName(ts.unescapeLeadingUnderscores(symbol.escapedName), symbol); // Call to cache unique name for symbol
@@ -56031,7 +55996,7 @@ var ts;
56031
55996
  case 268 /* SyntaxKind.ImportEqualsDeclaration */:
56032
55997
  // This _specifically_ only exists to handle json declarations - where we make aliases, but since
56033
55998
  // we emit no declarations for the json document, must not refer to it in the declarations
56034
- if (target.escapedName === "export=" /* InternalSymbolName.ExportEquals */ && ts.some(target.declarations, function (d) { return ts.isSourceFile(d) && ts.isJsonSourceFile(d); })) {
55999
+ if (target.escapedName === "export=" /* InternalSymbolName.ExportEquals */ && ts.some(target.declarations, ts.isJsonSourceFile)) {
56035
56000
  serializeMaybeAliasAssignment(symbol);
56036
56001
  break;
56037
56002
  }
@@ -57196,7 +57161,6 @@ var ts;
57196
57161
  return container;
57197
57162
  }
57198
57163
  }
57199
- ;
57200
57164
  }
57201
57165
  /** Create a synthetic property access flow node after the last statement of the file */
57202
57166
  function getFlowTypeFromCommonJSExport(symbol) {
@@ -60326,7 +60290,7 @@ var ts;
60326
60290
  var isInstantiation = (getTargetSymbol(prop) || prop) === (getTargetSymbol(singleProp) || singleProp);
60327
60291
  // If the symbols are instances of one another with identical types - consider the symbols
60328
60292
  // equivalent and just use the first one, which thus allows us to avoid eliding private
60329
- // members when intersecting a (this-)instantiations of a class with it's raw base or another instance
60293
+ // members when intersecting a (this-)instantiations of a class with its raw base or another instance
60330
60294
  if (isInstantiation && compareProperties(singleProp, prop, function (a, b) { return a === b ? -1 /* Ternary.True */ : 0 /* Ternary.False */; }) === -1 /* Ternary.True */) {
60331
60295
  // If we merged instantiations of a generic type, we replicate the symbol parent resetting behavior we used
60332
60296
  // to do when we recorded multiple distinct symbols so that we still get, eg, `Array<T>.length` printed
@@ -60374,7 +60338,11 @@ var ts;
60374
60338
  }
60375
60339
  }
60376
60340
  }
60377
- if (!singleProp || isUnion && (propSet || checkFlags & 48 /* CheckFlags.Partial */) && checkFlags & (1024 /* CheckFlags.ContainsPrivate */ | 512 /* CheckFlags.ContainsProtected */)) {
60341
+ if (!singleProp ||
60342
+ isUnion &&
60343
+ (propSet || checkFlags & 48 /* CheckFlags.Partial */) &&
60344
+ checkFlags & (1024 /* CheckFlags.ContainsPrivate */ | 512 /* CheckFlags.ContainsProtected */) &&
60345
+ !(propSet && getCommonDeclarationsOfSymbols(ts.arrayFrom(propSet.values())))) {
60378
60346
  // No property was found, or, in a union, a property has a private or protected declaration in one
60379
60347
  // constituent, but is missing or has a different declaration in another constituent.
60380
60348
  return undefined;
@@ -60476,6 +60444,33 @@ var ts;
60476
60444
  }
60477
60445
  return property;
60478
60446
  }
60447
+ function getCommonDeclarationsOfSymbols(symbols) {
60448
+ var commonDeclarations;
60449
+ var _loop_14 = function (symbol) {
60450
+ if (!symbol.declarations) {
60451
+ return { value: undefined };
60452
+ }
60453
+ if (!commonDeclarations) {
60454
+ commonDeclarations = new ts.Set(symbol.declarations);
60455
+ return "continue";
60456
+ }
60457
+ commonDeclarations.forEach(function (declaration) {
60458
+ if (!ts.contains(symbol.declarations, declaration)) {
60459
+ commonDeclarations.delete(declaration);
60460
+ }
60461
+ });
60462
+ if (commonDeclarations.size === 0) {
60463
+ return { value: undefined };
60464
+ }
60465
+ };
60466
+ for (var _i = 0, symbols_3 = symbols; _i < symbols_3.length; _i++) {
60467
+ var symbol = symbols_3[_i];
60468
+ var state_4 = _loop_14(symbol);
60469
+ if (typeof state_4 === "object")
60470
+ return state_4.value;
60471
+ }
60472
+ return commonDeclarations;
60473
+ }
60479
60474
  function getPropertyOfUnionOrIntersectionType(type, name, skipObjectFunctionPropertyAugment) {
60480
60475
  var property = getUnionOrIntersectionProperty(type, name, skipObjectFunctionPropertyAugment);
60481
60476
  // We need to filter out partial properties in union types
@@ -61190,7 +61185,7 @@ var ts;
61190
61185
  function getIndexInfosOfIndexSymbol(indexSymbol) {
61191
61186
  if (indexSymbol.declarations) {
61192
61187
  var indexInfos_4 = [];
61193
- var _loop_14 = function (declaration) {
61188
+ var _loop_15 = function (declaration) {
61194
61189
  if (declaration.parameters.length === 1) {
61195
61190
  var parameter = declaration.parameters[0];
61196
61191
  if (parameter.type) {
@@ -61204,7 +61199,7 @@ var ts;
61204
61199
  };
61205
61200
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
61206
61201
  var declaration = _a[_i];
61207
- _loop_14(declaration);
61202
+ _loop_15(declaration);
61208
61203
  }
61209
61204
  return indexInfos_4;
61210
61205
  }
@@ -61221,7 +61216,7 @@ var ts;
61221
61216
  var _a;
61222
61217
  var inferences;
61223
61218
  if ((_a = typeParameter.symbol) === null || _a === void 0 ? void 0 : _a.declarations) {
61224
- var _loop_15 = function (declaration) {
61219
+ var _loop_16 = function (declaration) {
61225
61220
  if (declaration.parent.kind === 192 /* SyntaxKind.InferType */) {
61226
61221
  // When an 'infer T' declaration is immediately contained in a type reference node
61227
61222
  // (such as 'Foo<infer T>'), T's constraint is inferred from the constraint of the
@@ -61285,7 +61280,7 @@ var ts;
61285
61280
  };
61286
61281
  for (var _i = 0, _b = typeParameter.symbol.declarations; _i < _b.length; _i++) {
61287
61282
  var declaration = _b[_i];
61288
- _loop_15(declaration);
61283
+ _loop_16(declaration);
61289
61284
  }
61290
61285
  }
61291
61286
  return inferences && getIntersectionType(inferences);
@@ -61942,6 +61937,13 @@ var ts;
61942
61937
  function getGlobalBigIntType() {
61943
61938
  return (deferredGlobalBigIntType || (deferredGlobalBigIntType = getGlobalType("BigInt", /*arity*/ 0, /*reportErrors*/ false))) || emptyObjectType;
61944
61939
  }
61940
+ function getGlobalNaNSymbol() {
61941
+ return (deferredGlobalNaNSymbol || (deferredGlobalNaNSymbol = getGlobalValueSymbol("NaN", /*reportErrors*/ false)));
61942
+ }
61943
+ function getGlobalRecordSymbol() {
61944
+ deferredGlobalRecordSymbol || (deferredGlobalRecordSymbol = getGlobalTypeAliasSymbol("Record", /*arity*/ 2, /*reportErrors*/ true) || unknownSymbol);
61945
+ return deferredGlobalRecordSymbol === unknownSymbol ? undefined : deferredGlobalRecordSymbol;
61946
+ }
61945
61947
  /**
61946
61948
  * Instantiates a global type that is generic with some element type, and returns that instantiation.
61947
61949
  */
@@ -62178,7 +62180,7 @@ var ts;
62178
62180
  var lastRequiredIndex = -1;
62179
62181
  var firstRestIndex = -1;
62180
62182
  var lastOptionalOrRestIndex = -1;
62181
- var _loop_16 = function (i) {
62183
+ var _loop_17 = function (i) {
62182
62184
  var type = elementTypes[i];
62183
62185
  var flags = target.elementFlags[i];
62184
62186
  if (flags & 8 /* ElementFlags.Variadic */) {
@@ -62208,9 +62210,9 @@ var ts;
62208
62210
  }
62209
62211
  };
62210
62212
  for (var i = 0; i < elementTypes.length; i++) {
62211
- var state_4 = _loop_16(i);
62212
- if (typeof state_4 === "object")
62213
- return state_4.value;
62213
+ var state_5 = _loop_17(i);
62214
+ if (typeof state_5 === "object")
62215
+ return state_5.value;
62214
62216
  }
62215
62217
  // Turn optional elements preceding the last required element into required elements
62216
62218
  for (var i = 0; i < lastRequiredIndex; i++) {
@@ -62238,7 +62240,7 @@ var ts;
62238
62240
  if (flags & (2 /* ElementFlags.Optional */ | 4 /* ElementFlags.Rest */)) {
62239
62241
  lastOptionalOrRestIndex = expandedFlags.length;
62240
62242
  }
62241
- expandedTypes.push(type);
62243
+ expandedTypes.push(flags & 2 /* ElementFlags.Optional */ ? addOptionality(type, /*isProperty*/ true) : type);
62242
62244
  expandedFlags.push(flags);
62243
62245
  if (expandedDeclarations && declaration) {
62244
62246
  expandedDeclarations.push(declaration);
@@ -62404,7 +62406,7 @@ var ts;
62404
62406
  var templates = ts.filter(types, isPatternLiteralType);
62405
62407
  if (templates.length) {
62406
62408
  var i = types.length;
62407
- var _loop_17 = function () {
62409
+ var _loop_18 = function () {
62408
62410
  i--;
62409
62411
  var t = types[i];
62410
62412
  if (t.flags & 128 /* TypeFlags.StringLiteral */ && ts.some(templates, function (template) { return isTypeMatchedByTemplateLiteralType(t, template); })) {
@@ -62412,7 +62414,7 @@ var ts;
62412
62414
  }
62413
62415
  };
62414
62416
  while (i > 0) {
62415
- _loop_17();
62417
+ _loop_18();
62416
62418
  }
62417
62419
  }
62418
62420
  }
@@ -62489,14 +62491,14 @@ var ts;
62489
62491
  var namedUnions = [];
62490
62492
  addNamedUnions(namedUnions, types);
62491
62493
  var reducedTypes = [];
62492
- var _loop_18 = function (t) {
62494
+ var _loop_19 = function (t) {
62493
62495
  if (!ts.some(namedUnions, function (union) { return containsType(union.types, t); })) {
62494
62496
  reducedTypes.push(t);
62495
62497
  }
62496
62498
  };
62497
62499
  for (var _i = 0, typeSet_1 = typeSet; _i < typeSet_1.length; _i++) {
62498
62500
  var t = typeSet_1[_i];
62499
- _loop_18(t);
62501
+ _loop_19(t);
62500
62502
  }
62501
62503
  if (!aliasSymbol && namedUnions.length === 1 && reducedTypes.length === 0) {
62502
62504
  return namedUnions[0];
@@ -63726,7 +63728,7 @@ var ts;
63726
63728
  var result;
63727
63729
  var extraTypes;
63728
63730
  var tailCount = 0;
63729
- var _loop_19 = function () {
63731
+ var _loop_20 = function () {
63730
63732
  if (tailCount === 1000) {
63731
63733
  error(currentNode, ts.Diagnostics.Type_instantiation_is_excessively_deep_and_possibly_infinite);
63732
63734
  result = errorType;
@@ -63847,10 +63849,10 @@ var ts;
63847
63849
  // another (or, through recursion, possibly the same) conditional type. In the potentially tail-recursive
63848
63850
  // cases we increment the tail recursion counter and stop after 1000 iterations.
63849
63851
  while (true) {
63850
- var state_5 = _loop_19();
63851
- if (typeof state_5 === "object")
63852
- return state_5.value;
63853
- if (state_5 === "break")
63852
+ var state_6 = _loop_20();
63853
+ if (typeof state_6 === "object")
63854
+ return state_6.value;
63855
+ if (state_6 === "break")
63854
63856
  break;
63855
63857
  }
63856
63858
  return extraTypes ? getUnionType(ts.append(extraTypes, result)) : result;
@@ -66465,7 +66467,7 @@ var ts;
66465
66467
  reducedTarget = findMatchingDiscriminantType(source, target, isRelatedTo) || filterPrimitivesIfContainsNonPrimitive(target);
66466
66468
  checkTypes = reducedTarget.flags & 1048576 /* TypeFlags.Union */ ? reducedTarget.types : [reducedTarget];
66467
66469
  }
66468
- var _loop_20 = function (prop) {
66470
+ var _loop_21 = function (prop) {
66469
66471
  if (shouldCheckAsExcessProperty(prop, source.symbol) && !isIgnoredJsxProperty(source, prop)) {
66470
66472
  if (!isKnownProperty(reducedTarget, prop.escapedName, isComparingJsxAttributes)) {
66471
66473
  if (reportErrors) {
@@ -66528,9 +66530,9 @@ var ts;
66528
66530
  };
66529
66531
  for (var _i = 0, _b = getPropertiesOfType(source); _i < _b.length; _i++) {
66530
66532
  var prop = _b[_i];
66531
- var state_6 = _loop_20(prop);
66532
- if (typeof state_6 === "object")
66533
- return state_6.value;
66533
+ var state_7 = _loop_21(prop);
66534
+ if (typeof state_7 === "object")
66535
+ return state_7.value;
66534
66536
  }
66535
66537
  return false;
66536
66538
  }
@@ -67521,11 +67523,11 @@ var ts;
67521
67523
  // constituents of 'target'. If any combination does not have a match then 'source' is not relatable.
67522
67524
  var discriminantCombinations = ts.cartesianProduct(sourceDiscriminantTypes);
67523
67525
  var matchingTypes = [];
67524
- var _loop_21 = function (combination) {
67526
+ var _loop_22 = function (combination) {
67525
67527
  var hasMatch = false;
67526
67528
  outer: for (var _c = 0, _d = target.types; _c < _d.length; _c++) {
67527
67529
  var type = _d[_c];
67528
- var _loop_22 = function (i) {
67530
+ var _loop_23 = function (i) {
67529
67531
  var sourceProperty = sourcePropertiesFiltered[i];
67530
67532
  var targetProperty = getPropertyOfType(type, sourceProperty.escapedName);
67531
67533
  if (!targetProperty)
@@ -67541,8 +67543,8 @@ var ts;
67541
67543
  }
67542
67544
  };
67543
67545
  for (var i = 0; i < sourcePropertiesFiltered.length; i++) {
67544
- var state_8 = _loop_22(i);
67545
- switch (state_8) {
67546
+ var state_9 = _loop_23(i);
67547
+ switch (state_9) {
67546
67548
  case "continue-outer": continue outer;
67547
67549
  }
67548
67550
  }
@@ -67555,9 +67557,9 @@ var ts;
67555
67557
  };
67556
67558
  for (var _a = 0, discriminantCombinations_1 = discriminantCombinations; _a < discriminantCombinations_1.length; _a++) {
67557
67559
  var combination = discriminantCombinations_1[_a];
67558
- var state_7 = _loop_21(combination);
67559
- if (typeof state_7 === "object")
67560
- return state_7.value;
67560
+ var state_8 = _loop_22(combination);
67561
+ if (typeof state_8 === "object")
67562
+ return state_8.value;
67561
67563
  }
67562
67564
  // Compare the remaining non-discriminant properties of each match.
67563
67565
  var result = -1 /* Ternary.True */;
@@ -68262,7 +68264,7 @@ var ts;
68262
68264
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes" /* tracing.Phase.CheckTypes */, "getVariancesWorker", { arity: typeParameters.length, id: getTypeId(getDeclaredTypeOfSymbol(symbol)) });
68263
68265
  links.variances = ts.emptyArray;
68264
68266
  var variances = [];
68265
- var _loop_23 = function (tp) {
68267
+ var _loop_24 = function (tp) {
68266
68268
  var modifiers = getVarianceModifiers(tp);
68267
68269
  var variance = modifiers & 65536 /* ModifierFlags.Out */ ?
68268
68270
  modifiers & 32768 /* ModifierFlags.In */ ? 0 /* VarianceFlags.Invariant */ : 1 /* VarianceFlags.Covariant */ :
@@ -68300,7 +68302,7 @@ var ts;
68300
68302
  };
68301
68303
  for (var _i = 0, typeParameters_2 = typeParameters; _i < typeParameters_2.length; _i++) {
68302
68304
  var tp = typeParameters_2[_i];
68303
- _loop_23(tp);
68305
+ _loop_24(tp);
68304
68306
  }
68305
68307
  links.variances = variances;
68306
68308
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop({ variances: variances.map(ts.Debug.formatVariance) });
@@ -68892,7 +68894,8 @@ var ts;
68892
68894
  function getOptionalType(type, isProperty) {
68893
68895
  if (isProperty === void 0) { isProperty = false; }
68894
68896
  ts.Debug.assert(strictNullChecks);
68895
- return type.flags & 32768 /* TypeFlags.Undefined */ ? type : getUnionType([type, isProperty ? missingType : undefinedType]);
68897
+ var missingOrUndefined = isProperty ? missingType : undefinedType;
68898
+ return type.flags & 32768 /* TypeFlags.Undefined */ || type.flags & 1048576 /* TypeFlags.Union */ && type.types[0] === missingOrUndefined ? type : getUnionType([type, missingOrUndefined]);
68896
68899
  }
68897
68900
  function getGlobalNonNullableTypeInstantiation(type) {
68898
68901
  if (!deferredGlobalNonNullableTypeAlias) {
@@ -70257,7 +70260,7 @@ var ts;
70257
70260
  // upon instantiation, would collapse all the placeholders to just 'string', and an assignment check might
70258
70261
  // succeed. That would be a pointless and confusing outcome.
70259
70262
  if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
70260
- var _loop_24 = function (i) {
70263
+ var _loop_25 = function (i) {
70261
70264
  var source_1 = matches ? matches[i] : neverType;
70262
70265
  var target_3 = types[i];
70263
70266
  // If we are inferring from a string literal type to a type variable whose constraint includes one of the
@@ -70307,7 +70310,7 @@ var ts;
70307
70310
  inferFromTypes(source_1, target_3);
70308
70311
  };
70309
70312
  for (var i = 0; i < types.length; i++) {
70310
- _loop_24(i);
70313
+ _loop_25(i);
70311
70314
  }
70312
70315
  }
70313
70316
  }
@@ -70771,7 +70774,7 @@ var ts;
70771
70774
  return name;
70772
70775
  }
70773
70776
  }
70774
- if (ts.hasOnlyExpressionInitializer(declaration)) {
70777
+ if (ts.hasOnlyExpressionInitializer(declaration) && isBlockScopedNameDeclaredBeforeUse(declaration, node.argumentExpression)) {
70775
70778
  var initializer = ts.getEffectiveInitializer(declaration);
70776
70779
  return initializer && tryGetNameFromType(getTypeOfExpression(initializer));
70777
70780
  }
@@ -70831,7 +70834,7 @@ var ts;
70831
70834
  function mapTypesByKeyProperty(types, name) {
70832
70835
  var map = new ts.Map();
70833
70836
  var count = 0;
70834
- var _loop_25 = function (type) {
70837
+ var _loop_26 = function (type) {
70835
70838
  if (type.flags & (524288 /* TypeFlags.Object */ | 2097152 /* TypeFlags.Intersection */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */)) {
70836
70839
  var discriminant = getTypeOfPropertyOfType(type, name);
70837
70840
  if (discriminant) {
@@ -70857,9 +70860,9 @@ var ts;
70857
70860
  };
70858
70861
  for (var _i = 0, types_15 = types; _i < types_15.length; _i++) {
70859
70862
  var type = types_15[_i];
70860
- var state_9 = _loop_25(type);
70861
- if (typeof state_9 === "object")
70862
- return state_9.value;
70863
+ var state_10 = _loop_26(type);
70864
+ if (typeof state_10 === "object")
70865
+ return state_10.value;
70863
70866
  }
70864
70867
  return count >= 10 && count * 2 >= types.length ? map : undefined;
70865
70868
  }
@@ -72258,18 +72261,26 @@ var ts;
72258
72261
  }
72259
72262
  function isTypePresencePossible(type, propName, assumeTrue) {
72260
72263
  var prop = getPropertyOfType(type, propName);
72261
- if (prop) {
72262
- return prop.flags & 16777216 /* SymbolFlags.Optional */ ? true : assumeTrue;
72263
- }
72264
- return getApplicableIndexInfoForName(type, propName) ? true : !assumeTrue;
72265
- }
72266
- function narrowByInKeyword(type, name, assumeTrue) {
72267
- if (type.flags & 1048576 /* TypeFlags.Union */
72268
- || type.flags & 524288 /* TypeFlags.Object */ && declaredType !== type && !(declaredType === unknownType && isEmptyAnonymousObjectType(type))
72269
- || ts.isThisTypeParameter(type)
72270
- || type.flags & 2097152 /* TypeFlags.Intersection */ && ts.every(type.types, function (t) { return t.symbol !== globalThisSymbol; })) {
72264
+ return prop ?
72265
+ !!(prop.flags & 16777216 /* SymbolFlags.Optional */) || assumeTrue :
72266
+ !!getApplicableIndexInfoForName(type, propName) || !assumeTrue;
72267
+ }
72268
+ function narrowByInKeyword(type, nameType, assumeTrue) {
72269
+ var name = getPropertyNameFromType(nameType);
72270
+ var isKnownProperty = someType(type, function (t) { return isTypePresencePossible(t, name, /*assumeTrue*/ true); });
72271
+ if (isKnownProperty) {
72272
+ // If the check is for a known property (i.e. a property declared in some constituent of
72273
+ // the target type), we filter the target type by presence of absence of the property.
72271
72274
  return filterType(type, function (t) { return isTypePresencePossible(t, name, assumeTrue); });
72272
72275
  }
72276
+ if (assumeTrue) {
72277
+ // If the check is for an unknown property, we intersect the target type with `Record<X, unknown>`,
72278
+ // where X is the name of the property.
72279
+ var recordSymbol = getGlobalRecordSymbol();
72280
+ if (recordSymbol) {
72281
+ return getIntersectionType([type, getTypeAliasInstantiation(recordSymbol, [nameType, unknownType])]);
72282
+ }
72283
+ }
72273
72284
  return type;
72274
72285
  }
72275
72286
  function narrowTypeByBinaryExpression(type, expr, assumeTrue) {
@@ -72328,15 +72339,14 @@ var ts;
72328
72339
  return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
72329
72340
  }
72330
72341
  var target = getReferenceCandidate(expr.right);
72331
- var leftType = getTypeOfNode(expr.left);
72332
- if (leftType.flags & 128 /* TypeFlags.StringLiteral */) {
72333
- var name = ts.escapeLeadingUnderscores(leftType.value);
72342
+ var leftType = getTypeOfExpression(expr.left);
72343
+ if (leftType.flags & 8576 /* TypeFlags.StringOrNumberLiteralOrUnique */) {
72334
72344
  if (containsMissingType(type) && ts.isAccessExpression(reference) && isMatchingReference(reference.expression, target) &&
72335
- getAccessedPropertyName(reference) === name) {
72345
+ getAccessedPropertyName(reference) === getPropertyNameFromType(leftType)) {
72336
72346
  return getTypeWithFacts(type, assumeTrue ? 524288 /* TypeFacts.NEUndefined */ : 65536 /* TypeFacts.EQUndefined */);
72337
72347
  }
72338
72348
  if (isMatchingReference(reference, target)) {
72339
- return narrowByInKeyword(type, name, assumeTrue);
72349
+ return narrowByInKeyword(type, leftType, assumeTrue);
72340
72350
  }
72341
72351
  }
72342
72352
  break;
@@ -74598,7 +74608,7 @@ var ts;
74598
74608
  return left === right || !left ? left
74599
74609
  : compareTypeParametersIdentical(left.typeParameters, right.typeParameters) ? combineSignaturesOfIntersectionMembers(left, right)
74600
74610
  : undefined;
74601
- }) // TODO(jakebailey): This is suspect. Can't pass initialValue as reduceLeft checks argument length.
74611
+ })
74602
74612
  : undefined;
74603
74613
  }
74604
74614
  function combineIntersectionThisParam(left, right, mapper) {
@@ -76506,7 +76516,6 @@ var ts;
76506
76516
  }
76507
76517
  return false;
76508
76518
  }
76509
- ;
76510
76519
  var suggestedMethod = ts.isAssignmentTarget(expr) ? "set" : "get";
76511
76520
  if (!hasProp(suggestedMethod)) {
76512
76521
  return undefined;
@@ -77308,7 +77317,7 @@ var ts;
77308
77317
  if (spreadIndex >= 0) {
77309
77318
  // Create synthetic arguments from spreads of tuple types.
77310
77319
  var effectiveArgs_1 = args.slice(0, spreadIndex);
77311
- var _loop_26 = function (i) {
77320
+ var _loop_27 = function (i) {
77312
77321
  var arg = args[i];
77313
77322
  // We can call checkExpressionCached because spread expressions never have a contextual type.
77314
77323
  var spreadType = arg.kind === 227 /* SyntaxKind.SpreadElement */ && (flowLoopCount ? checkExpression(arg.expression) : checkExpressionCached(arg.expression));
@@ -77325,7 +77334,7 @@ var ts;
77325
77334
  }
77326
77335
  };
77327
77336
  for (var i = spreadIndex; i < args.length; i++) {
77328
- _loop_26(i);
77337
+ _loop_27(i);
77329
77338
  }
77330
77339
  return effectiveArgs_1;
77331
77340
  }
@@ -77654,7 +77663,7 @@ var ts;
77654
77663
  var min_3 = Number.MAX_VALUE;
77655
77664
  var minIndex = 0;
77656
77665
  var i_1 = 0;
77657
- var _loop_27 = function (c) {
77666
+ var _loop_28 = function (c) {
77658
77667
  var chain_2 = function () { return ts.chainDiagnosticMessages(/*details*/ undefined, ts.Diagnostics.Overload_0_of_1_2_gave_the_following_error, i_1 + 1, candidates.length, signatureToString(c)); };
77659
77668
  var diags_2 = getSignatureApplicabilityError(node, args, c, assignableRelation, 0 /* CheckMode.Normal */, /*reportErrors*/ true, chain_2);
77660
77669
  if (diags_2) {
@@ -77672,7 +77681,7 @@ var ts;
77672
77681
  };
77673
77682
  for (var _a = 0, candidatesForArgumentError_1 = candidatesForArgumentError; _a < candidatesForArgumentError_1.length; _a++) {
77674
77683
  var c = candidatesForArgumentError_1[_a];
77675
- _loop_27(c);
77684
+ _loop_28(c);
77676
77685
  }
77677
77686
  var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
77678
77687
  ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
@@ -77830,7 +77839,7 @@ var ts;
77830
77839
  }
77831
77840
  var _a = ts.minAndMax(candidates, getNumNonRestParameters), minArgumentCount = _a.min, maxNonRestParam = _a.max;
77832
77841
  var parameters = [];
77833
- var _loop_28 = function (i) {
77842
+ var _loop_29 = function (i) {
77834
77843
  var symbols = ts.mapDefined(candidates, function (s) { return signatureHasRestParameter(s) ?
77835
77844
  i < s.parameters.length - 1 ? s.parameters[i] : ts.last(s.parameters) :
77836
77845
  i < s.parameters.length ? s.parameters[i] : undefined; });
@@ -77838,7 +77847,7 @@ var ts;
77838
77847
  parameters.push(createCombinedSymbolFromTypes(symbols, ts.mapDefined(candidates, function (candidate) { return tryGetTypeAtPosition(candidate, i); })));
77839
77848
  };
77840
77849
  for (var i = 0; i < maxNonRestParam; i++) {
77841
- _loop_28(i);
77850
+ _loop_29(i);
77842
77851
  }
77843
77852
  var restParameterSymbols = ts.mapDefined(candidates, function (c) { return signatureHasRestParameter(c) ? ts.last(c.parameters) : undefined; });
77844
77853
  var flags = 0 /* SignatureFlags.None */;
@@ -80077,6 +80086,9 @@ var ts;
80077
80086
  }
80078
80087
  return booleanType;
80079
80088
  }
80089
+ function hasEmptyObjectIntersection(type) {
80090
+ return someType(type, function (t) { return t === unknownEmptyObjectType || !!(t.flags & 2097152 /* TypeFlags.Intersection */) && ts.some(t.types, isEmptyAnonymousObjectType); });
80091
+ }
80080
80092
  function checkInExpression(left, right, leftType, rightType) {
80081
80093
  if (leftType === silentNeverType || rightType === silentNeverType) {
80082
80094
  return silentNeverType;
@@ -80093,40 +80105,20 @@ var ts;
80093
80105
  }
80094
80106
  }
80095
80107
  else {
80096
- leftType = checkNonNullType(leftType, left);
80097
- // TypeScript 1.0 spec (April 2014): 4.15.5
80098
- // Require the left operand to be of type Any, the String primitive type, or the Number primitive type.
80099
- if (!(allTypesAssignableToKind(leftType, 402653316 /* TypeFlags.StringLike */ | 296 /* TypeFlags.NumberLike */ | 12288 /* TypeFlags.ESSymbolLike */) ||
80100
- isTypeAssignableToKind(leftType, 4194304 /* TypeFlags.Index */ | 134217728 /* TypeFlags.TemplateLiteral */ | 268435456 /* TypeFlags.StringMapping */ | 262144 /* TypeFlags.TypeParameter */))) {
80101
- 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);
80108
+ // The type of the lef operand must be assignable to string, number, or symbol.
80109
+ checkTypeAssignableTo(checkNonNullType(leftType, left), stringNumberSymbolType, left);
80110
+ }
80111
+ // The type of the right operand must be assignable to 'object'.
80112
+ if (checkTypeAssignableTo(checkNonNullType(rightType, right), nonPrimitiveType, right)) {
80113
+ // The {} type is assignable to the object type, yet {} might represent a primitive type. Here we
80114
+ // detect and error on {} that results from narrowing the unknown type, as well as intersections
80115
+ // that include {} (we know that the other types in such intersections are assignable to object
80116
+ // since we already checked for that).
80117
+ if (hasEmptyObjectIntersection(rightType)) {
80118
+ 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));
80102
80119
  }
80103
80120
  }
80104
- rightType = checkNonNullType(rightType, right);
80105
- // TypeScript 1.0 spec (April 2014): 4.15.5
80106
- // The in operator requires the right operand to be
80107
- //
80108
- // 1. assignable to the non-primitive type,
80109
- // 2. an unconstrained type parameter,
80110
- // 3. a union or intersection including one or more type parameters, whose constituents are all assignable to the
80111
- // the non-primitive type, or are unconstrainted type parameters, or have constraints assignable to the
80112
- // non-primitive type, or
80113
- // 4. a type parameter whose constraint is
80114
- // i. an object type,
80115
- // ii. the non-primitive type, or
80116
- // iii. a union or intersection with at least one constituent assignable to an object or non-primitive type.
80117
- //
80118
- // The divergent behavior for type parameters and unions containing type parameters is a workaround for type
80119
- // parameters not being narrowable. If the right operand is a concrete type, we can error if there is any chance
80120
- // it is a primitive. But if the operand is a type parameter, it cannot be narrowed, so we don't issue an error
80121
- // unless *all* instantiations would result in an error.
80122
- //
80123
80121
  // The result is always of the Boolean primitive type.
80124
- var rightTypeConstraint = getConstraintOfType(rightType);
80125
- if (!allTypesAssignableToKind(rightType, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */) ||
80126
- rightTypeConstraint && (isTypeAssignableToKind(rightType, 3145728 /* TypeFlags.UnionOrIntersection */) && !allTypesAssignableToKind(rightTypeConstraint, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */) ||
80127
- !maybeTypeOfKind(rightTypeConstraint, 67108864 /* TypeFlags.NonPrimitive */ | 58982400 /* TypeFlags.InstantiableNonPrimitive */ | 524288 /* TypeFlags.Object */))) {
80128
- error(right, ts.Diagnostics.The_right_hand_side_of_an_in_expression_must_not_be_a_primitive);
80129
- }
80130
80122
  return booleanType;
80131
80123
  }
80132
80124
  function checkObjectLiteralAssignment(node, sourceType, rightIsThis) {
@@ -80637,6 +80629,7 @@ var ts;
80637
80629
  var eqType = operator === 34 /* SyntaxKind.EqualsEqualsToken */ || operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */;
80638
80630
  error(errorNode, ts.Diagnostics.This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value, eqType ? "false" : "true");
80639
80631
  }
80632
+ checkNaNEquality(errorNode, operator, left, right);
80640
80633
  reportOperatorErrorUnless(function (left, right) { return isTypeEqualityComparableTo(left, right) || isTypeEqualityComparableTo(right, left); });
80641
80634
  return booleanType;
80642
80635
  case 102 /* SyntaxKind.InstanceOfKeyword */:
@@ -80842,6 +80835,26 @@ var ts;
80842
80835
  return undefined;
80843
80836
  }
80844
80837
  }
80838
+ function checkNaNEquality(errorNode, operator, left, right) {
80839
+ var isLeftNaN = isGlobalNaN(ts.skipParentheses(left));
80840
+ var isRightNaN = isGlobalNaN(ts.skipParentheses(right));
80841
+ if (isLeftNaN || isRightNaN) {
80842
+ var err = error(errorNode, ts.Diagnostics.This_condition_will_always_return_0, ts.tokenToString(operator === 36 /* SyntaxKind.EqualsEqualsEqualsToken */ || operator === 34 /* SyntaxKind.EqualsEqualsToken */ ? 95 /* SyntaxKind.FalseKeyword */ : 110 /* SyntaxKind.TrueKeyword */));
80843
+ if (isLeftNaN && isRightNaN)
80844
+ return;
80845
+ var operatorString = operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */ || operator === 35 /* SyntaxKind.ExclamationEqualsToken */ ? ts.tokenToString(53 /* SyntaxKind.ExclamationToken */) : "";
80846
+ var location = isLeftNaN ? right : left;
80847
+ var expression = ts.skipParentheses(location);
80848
+ ts.addRelatedInfo(err, ts.createDiagnosticForNode(location, ts.Diagnostics.Did_you_mean_0, "".concat(operatorString, "Number.isNaN(").concat(ts.isEntityNameExpression(expression) ? ts.entityNameToString(expression) : "...", ")")));
80849
+ }
80850
+ }
80851
+ function isGlobalNaN(expr) {
80852
+ if (ts.isIdentifier(expr) && expr.escapedText === "NaN") {
80853
+ var globalNaNSymbol = getGlobalNaNSymbol();
80854
+ return !!globalNaNSymbol && globalNaNSymbol === getResolvedSymbol(expr);
80855
+ }
80856
+ return false;
80857
+ }
80845
80858
  }
80846
80859
  function getBaseTypesIfUnrelated(leftType, rightType, isRelated) {
80847
80860
  var effectiveLeft = leftType;
@@ -81879,7 +81892,7 @@ var ts;
81879
81892
  var indexSymbol = getIndexSymbol(getSymbolOfNode(node));
81880
81893
  if (indexSymbol === null || indexSymbol === void 0 ? void 0 : indexSymbol.declarations) {
81881
81894
  var indexSignatureMap_1 = new ts.Map();
81882
- var _loop_29 = function (declaration) {
81895
+ var _loop_30 = function (declaration) {
81883
81896
  if (declaration.parameters.length === 1 && declaration.parameters[0].type) {
81884
81897
  forEachType(getTypeFromTypeNode(declaration.parameters[0].type), function (type) {
81885
81898
  var entry = indexSignatureMap_1.get(getTypeId(type));
@@ -81894,7 +81907,7 @@ var ts;
81894
81907
  };
81895
81908
  for (var _i = 0, _a = indexSymbol.declarations; _i < _a.length; _i++) {
81896
81909
  var declaration = _a[_i];
81897
- _loop_29(declaration);
81910
+ _loop_30(declaration);
81898
81911
  }
81899
81912
  indexSignatureMap_1.forEach(function (entry) {
81900
81913
  if (entry.declarations.length > 1) {
@@ -85494,7 +85507,7 @@ var ts;
85494
85507
  var propDeclaration = declaration && declaration.kind === 223 /* SyntaxKind.BinaryExpression */ ||
85495
85508
  name && name.kind === 164 /* SyntaxKind.ComputedPropertyName */ ? declaration : undefined;
85496
85509
  var localPropDeclaration = getParentOfSymbol(prop) === type.symbol ? declaration : undefined;
85497
- var _loop_30 = function (info) {
85510
+ var _loop_31 = function (info) {
85498
85511
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
85499
85512
  // We check only when (a) the property is declared in the containing type, or (b) the applicable index signature is declared
85500
85513
  // in the containing type, or (c) the containing type is an interface and no base interface contains both the property and
@@ -85511,7 +85524,7 @@ var ts;
85511
85524
  };
85512
85525
  for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
85513
85526
  var info = indexInfos_9[_i];
85514
- _loop_30(info);
85527
+ _loop_31(info);
85515
85528
  }
85516
85529
  }
85517
85530
  function checkIndexConstraintForIndexSignature(type, checkInfo) {
@@ -85519,7 +85532,7 @@ var ts;
85519
85532
  var indexInfos = getApplicableIndexInfos(type, checkInfo.keyType);
85520
85533
  var interfaceDeclaration = ts.getObjectFlags(type) & 2 /* ObjectFlags.Interface */ ? ts.getDeclarationOfKind(type.symbol, 261 /* SyntaxKind.InterfaceDeclaration */) : undefined;
85521
85534
  var localCheckDeclaration = declaration && getParentOfSymbol(getSymbolOfNode(declaration)) === type.symbol ? declaration : undefined;
85522
- var _loop_31 = function (info) {
85535
+ var _loop_32 = function (info) {
85523
85536
  if (info === checkInfo)
85524
85537
  return "continue";
85525
85538
  var localIndexDeclaration = info.declaration && getParentOfSymbol(getSymbolOfNode(info.declaration)) === type.symbol ? info.declaration : undefined;
@@ -85534,7 +85547,7 @@ var ts;
85534
85547
  };
85535
85548
  for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
85536
85549
  var info = indexInfos_10[_i];
85537
- _loop_31(info);
85550
+ _loop_32(info);
85538
85551
  }
85539
85552
  }
85540
85553
  function checkTypeNameIsReserved(name, message) {
@@ -85854,7 +85867,7 @@ var ts;
85854
85867
  var baseTypes = baseTypeNode && getBaseTypes(type);
85855
85868
  var baseWithThis = (baseTypes === null || baseTypes === void 0 ? void 0 : baseTypes.length) ? getTypeWithThisArgument(ts.first(baseTypes), type.thisType) : undefined;
85856
85869
  var baseStaticType = getBaseConstructorTypeOfClass(type);
85857
- var _loop_32 = function (member) {
85870
+ var _loop_33 = function (member) {
85858
85871
  if (ts.hasAmbientModifier(member)) {
85859
85872
  return "continue";
85860
85873
  }
@@ -85871,7 +85884,7 @@ var ts;
85871
85884
  };
85872
85885
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
85873
85886
  var member = _a[_i];
85874
- _loop_32(member);
85887
+ _loop_33(member);
85875
85888
  }
85876
85889
  }
85877
85890
  /**
@@ -85959,7 +85972,7 @@ var ts;
85959
85972
  function issueMemberSpecificError(node, typeWithThis, baseWithThis, broadDiag) {
85960
85973
  // iterate over all implemented properties and issue errors on each one which isn't compatible, rather than the class as a whole, if possible
85961
85974
  var issuedMemberError = false;
85962
- var _loop_33 = function (member) {
85975
+ var _loop_34 = function (member) {
85963
85976
  if (ts.isStatic(member)) {
85964
85977
  return "continue";
85965
85978
  }
@@ -85978,7 +85991,7 @@ var ts;
85978
85991
  };
85979
85992
  for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
85980
85993
  var member = _a[_i];
85981
- _loop_33(member);
85994
+ _loop_34(member);
85982
85995
  }
85983
85996
  if (!issuedMemberError) {
85984
85997
  // check again with diagnostics to generate a less-specific error
@@ -86049,7 +86062,7 @@ var ts;
86049
86062
  var _a, _b, _c, _d;
86050
86063
  // NOTE: assignability is checked in checkClassDeclaration
86051
86064
  var baseProperties = getPropertiesOfType(baseType);
86052
- var _loop_34 = function (baseProperty) {
86065
+ var _loop_35 = function (baseProperty) {
86053
86066
  var base = getTargetSymbol(baseProperty);
86054
86067
  if (base.flags & 4194304 /* SymbolFlags.Prototype */) {
86055
86068
  return "continue";
@@ -86159,8 +86172,8 @@ var ts;
86159
86172
  };
86160
86173
  basePropertyCheck: for (var _i = 0, baseProperties_1 = baseProperties; _i < baseProperties_1.length; _i++) {
86161
86174
  var baseProperty = baseProperties_1[_i];
86162
- var state_10 = _loop_34(baseProperty);
86163
- switch (state_10) {
86175
+ var state_11 = _loop_35(baseProperty);
86176
+ switch (state_11) {
86164
86177
  case "continue-basePropertyCheck": continue basePropertyCheck;
86165
86178
  }
86166
86179
  }
@@ -91136,27 +91149,17 @@ var ts;
91136
91149
  })(ts || (ts = {}));
91137
91150
  var ts;
91138
91151
  (function (ts) {
91139
- // TODO(jakebailey): include type guard and non-type guard variants on visitNode and visitNodes
91140
91152
  var _a;
91141
- /**
91142
- * Visits a Node using the supplied visitor, possibly returning a new Node in its place.
91143
- *
91144
- * @param node The Node to visit.
91145
- * @param visitor The callback used to visit the Node.
91146
- * @param test A callback to execute to verify the Node is valid.
91147
- * @param lift An optional callback to execute to lift a NodeArray into a valid Node.
91148
- */
91149
91153
  function visitNode(node, visitor, test, lift) {
91150
- if (node === undefined) {
91151
- // If the input type is undefined, then the output type can be undefined.
91154
+ if (node === undefined || visitor === undefined) {
91155
+ return node;
91156
+ }
91157
+ var visited = visitor(node);
91158
+ if (visited === node) {
91152
91159
  return node;
91153
91160
  }
91154
- var visited = visitor ? visitor(node) : node;
91155
91161
  var visitedNode;
91156
91162
  if (visited === undefined) {
91157
- // If the visited node is undefined, then the visitor must have returned undefined,
91158
- // so the visitor must have been declared as able to return undefined, so TOut must be
91159
- // potentially undefined.
91160
91163
  return undefined;
91161
91164
  }
91162
91165
  else if (ts.isArray(visited)) {
@@ -91169,7 +91172,6 @@ var ts;
91169
91172
  return visitedNode;
91170
91173
  }
91171
91174
  ts.visitNode = visitNode;
91172
- (function (_) { })(visitNode); // Check that visitNode is a NodeVisitor.
91173
91175
  /**
91174
91176
  * Visits a NodeArray using the supplied visitor, possibly returning a new NodeArray in its place.
91175
91177
  *
@@ -91180,8 +91182,7 @@ var ts;
91180
91182
  * @param count An optional value indicating the maximum number of nodes to visit.
91181
91183
  */
91182
91184
  function visitNodes(nodes, visitor, test, start, count) {
91183
- if (nodes === undefined) {
91184
- // If the input type is undefined, then the output type can be undefined.
91185
+ if (nodes === undefined || visitor === undefined) {
91185
91186
  return nodes;
91186
91187
  }
91187
91188
  // Ensure start and count have valid values
@@ -91212,17 +91213,11 @@ var ts;
91212
91213
  ts.setTextRangePosEnd(updatedArray, pos, end);
91213
91214
  return updatedArray;
91214
91215
  }
91215
- // If we are here, updated === nodes. This means that it's still a NodeArray,
91216
- // and also that its contents passed the tests in visitArrayWorker, so has contents
91217
- // of type TOut.
91218
91216
  return nodes;
91219
91217
  }
91220
91218
  ts.visitNodes = visitNodes;
91221
- (function (_) { })(visitNodes); // Check that visitNode is a NodeVisitor.
91222
- /* @internal */
91223
91219
  function visitArray(nodes, visitor, test, start, count) {
91224
91220
  if (nodes === undefined) {
91225
- // If the input type is undefined, then the output type can be undefined.
91226
91221
  return nodes;
91227
91222
  }
91228
91223
  // Ensure start and count have valid values
@@ -91247,7 +91242,7 @@ var ts;
91247
91242
  // Visit each original node.
91248
91243
  for (var i = 0; i < count; i++) {
91249
91244
  var node = nodes[i + start];
91250
- var visited = node !== undefined ? (visitor ? visitor(node) : node) : undefined;
91245
+ var visited = node !== undefined ? visitor(node) : undefined;
91251
91246
  if (updated !== undefined || visited === undefined || visited !== node) {
91252
91247
  if (updated === undefined) {
91253
91248
  // Ensure we have a copy of `nodes`, up to the current index.
@@ -91257,20 +91252,18 @@ var ts;
91257
91252
  if (ts.isArray(visited)) {
91258
91253
  for (var _i = 0, visited_1 = visited; _i < visited_1.length; _i++) {
91259
91254
  var visitedNode = visited_1[_i];
91260
- // void Debug.assertNode(visitedNode, test);
91255
+ void ts.Debug.assertNode(visitedNode, test);
91261
91256
  updated.push(visitedNode);
91262
91257
  }
91263
91258
  }
91264
91259
  else {
91265
- // void Debug.assertNode(visited, test);
91260
+ void ts.Debug.assertNode(visited, test);
91266
91261
  updated.push(visited);
91267
91262
  }
91268
91263
  }
91269
91264
  }
91270
91265
  }
91271
- var result = updated !== null && updated !== void 0 ? updated : nodes;
91272
- ts.Debug.assertEachNode(result, test);
91273
- return result;
91266
+ return updated !== null && updated !== void 0 ? updated : nodes;
91274
91267
  }
91275
91268
  /**
91276
91269
  * Starts a new lexical environment and visits a statement list, ending the lexical environment
@@ -91291,7 +91284,7 @@ var ts;
91291
91284
  context.startLexicalEnvironment();
91292
91285
  if (nodes) {
91293
91286
  context.setLexicalEnvironmentFlags(1 /* LexicalEnvironmentFlags.InParameters */, true);
91294
- updated = nodesVisitor(nodes, visitor, ts.isParameter);
91287
+ updated = nodesVisitor(nodes, visitor, ts.isParameterDeclaration);
91295
91288
  // As of ES2015, any runtime execution of that occurs in for a parameter (such as evaluating an
91296
91289
  // initializer or a binding pattern), occurs in its own lexical scope. As a result, any expression
91297
91290
  // that we might transform that introduces a temporary variable would fail as the temporary variable
@@ -91374,7 +91367,6 @@ var ts;
91374
91367
  if (nodeVisitor === void 0) { nodeVisitor = visitNode; }
91375
91368
  context.startBlockScope();
91376
91369
  var updated = nodeVisitor(body, visitor, ts.isStatement, context.factory.liftToBlock);
91377
- ts.Debug.assert(updated);
91378
91370
  var declarations = context.endBlockScope();
91379
91371
  if (ts.some(declarations)) {
91380
91372
  if (ts.isBlock(updated)) {
@@ -91414,23 +91406,23 @@ var ts;
91414
91406
  return context.factory.updateTypeParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.constraint, visitor, ts.isTypeNode), nodeVisitor(node.default, visitor, ts.isTypeNode));
91415
91407
  },
91416
91408
  _a[166 /* SyntaxKind.Parameter */] = function visitEachChildOfParameterDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
91417
- return context.factory.updateParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isDotDotDotToken), ts.Debug.checkDefined(nodeVisitor(node.name, visitor, ts.isBindingName)), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
91409
+ return context.factory.updateParameterDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.dotDotDotToken, tokenVisitor, ts.isDotDotDotToken), nodeVisitor(node.name, visitor, ts.isBindingName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
91418
91410
  },
91419
91411
  _a[167 /* SyntaxKind.Decorator */] = function visitEachChildOfDecorator(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
91420
91412
  return context.factory.updateDecorator(node, nodeVisitor(node.expression, visitor, ts.isExpression));
91421
91413
  },
91422
91414
  // Type elements
91423
91415
  _a[168 /* SyntaxKind.PropertySignature */] = function visitEachChildOfPropertySignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
91424
- return context.factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodeVisitor(node.type, visitor, ts.isTypeNode));
91416
+ return context.factory.updatePropertySignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isToken), nodeVisitor(node.type, visitor, ts.isTypeNode));
91425
91417
  },
91426
91418
  _a[169 /* SyntaxKind.PropertyDeclaration */] = function visitEachChildOfPropertyDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
91427
91419
  var _a;
91428
- return context.factory.updatePropertyDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), ts.Debug.checkDefined(nodeVisitor(node.name, visitor, ts.isPropertyName)),
91420
+ return context.factory.updatePropertyDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.name, visitor, ts.isPropertyName),
91429
91421
  // QuestionToken and ExclamationToken are mutually exclusive in PropertyDeclaration
91430
91422
  nodeVisitor((_a = node.questionToken) !== null && _a !== void 0 ? _a : node.exclamationToken, tokenVisitor, ts.isQuestionOrExclamationToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodeVisitor(node.initializer, visitor, ts.isExpression));
91431
91423
  },
91432
91424
  _a[170 /* SyntaxKind.MethodSignature */] = function visitEachChildOfMethodSignature(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
91433
- return context.factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameter), nodeVisitor(node.type, visitor, ts.isTypeNode));
91425
+ return context.factory.updateMethodSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
91434
91426
  },
91435
91427
  _a[171 /* SyntaxKind.MethodDeclaration */] = function visitEachChildOfMethodDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, tokenVisitor) {
91436
91428
  return context.factory.updateMethodDeclaration(node, nodesVisitor(node.modifiers, visitor, ts.isModifierLike), nodeVisitor(node.asteriskToken, tokenVisitor, ts.isAsteriskToken), nodeVisitor(node.name, visitor, ts.isPropertyName), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionToken), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), visitParameterList(node.parameters, visitor, context, nodesVisitor), nodeVisitor(node.type, visitor, ts.isTypeNode), visitFunctionBody(node.body, visitor, context, nodeVisitor));
@@ -91450,13 +91442,13 @@ var ts;
91450
91442
  return context.factory.updateClassStaticBlockDeclaration(node, visitFunctionBody(node.body, visitor, context, nodeVisitor));
91451
91443
  },
91452
91444
  _a[176 /* SyntaxKind.CallSignature */] = function visitEachChildOfCallSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
91453
- return context.factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameter), nodeVisitor(node.type, visitor, ts.isTypeNode));
91445
+ return context.factory.updateCallSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
91454
91446
  },
91455
91447
  _a[177 /* SyntaxKind.ConstructSignature */] = function visitEachChildOfConstructSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
91456
- return context.factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameter), nodeVisitor(node.type, visitor, ts.isTypeNode));
91448
+ return context.factory.updateConstructSignature(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
91457
91449
  },
91458
91450
  _a[178 /* SyntaxKind.IndexSignature */] = function visitEachChildOfIndexSignatureDeclaration(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
91459
- return context.factory.updateIndexSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameter), nodeVisitor(node.type, visitor, ts.isTypeNode));
91451
+ return context.factory.updateIndexSignature(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
91460
91452
  },
91461
91453
  // Types
91462
91454
  _a[179 /* SyntaxKind.TypePredicate */] = function visitEachChildOfTypePredicateNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
@@ -91466,10 +91458,10 @@ var ts;
91466
91458
  return context.factory.updateTypeReferenceNode(node, nodeVisitor(node.typeName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
91467
91459
  },
91468
91460
  _a[181 /* SyntaxKind.FunctionType */] = function visitEachChildOfFunctionTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
91469
- return context.factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameter), nodeVisitor(node.type, visitor, ts.isTypeNode));
91461
+ return context.factory.updateFunctionTypeNode(node, nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
91470
91462
  },
91471
91463
  _a[182 /* SyntaxKind.ConstructorType */] = function visitEachChildOfConstructorTypeNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
91472
- return context.factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameter), nodeVisitor(node.type, visitor, ts.isTypeNode));
91464
+ return context.factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
91473
91465
  },
91474
91466
  _a[183 /* SyntaxKind.TypeQuery */] = function visitEachChildOfTypeQueryNode(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
91475
91467
  return context.factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
@@ -91523,7 +91515,7 @@ var ts;
91523
91515
  return context.factory.updateMappedTypeNode(node, nodeVisitor(node.readonlyToken, tokenVisitor, ts.isReadonlyKeywordOrPlusOrMinusToken), nodeVisitor(node.typeParameter, visitor, ts.isTypeParameterDeclaration), nodeVisitor(node.nameType, visitor, ts.isTypeNode), nodeVisitor(node.questionToken, tokenVisitor, ts.isQuestionOrPlusOrMinusToken), nodeVisitor(node.type, visitor, ts.isTypeNode), nodesVisitor(node.members, visitor, ts.isTypeElement));
91524
91516
  },
91525
91517
  _a[198 /* SyntaxKind.LiteralType */] = function visitEachChildOfLiteralTypeNode(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
91526
- return context.factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isLiteralTypeLiteral));
91518
+ return context.factory.updateLiteralTypeNode(node, nodeVisitor(node.literal, visitor, ts.isExpression));
91527
91519
  },
91528
91520
  _a[200 /* SyntaxKind.TemplateLiteralType */] = function visitEachChildOfTemplateLiteralType(node, visitor, context, nodesVisitor, nodeVisitor, _tokenVisitor) {
91529
91521
  return context.factory.updateTemplateLiteralType(node, nodeVisitor(node.head, visitor, ts.isTemplateHead), nodesVisitor(node.templateSpans, visitor, ts.isTemplateLiteralTypeSpan));
@@ -93013,7 +93005,6 @@ var ts;
93013
93005
  };
93014
93006
  if (value) {
93015
93007
  value = ts.visitNode(value, visitor, ts.isExpression);
93016
- ts.Debug.assert(value);
93017
93008
  if (ts.isIdentifier(value) && bindingOrAssignmentElementAssignsToName(node, value.escapedText) ||
93018
93009
  bindingOrAssignmentElementContainsNonLiteralComputedName(node)) {
93019
93010
  // If the right-hand value of the assignment is also an assignment target then
@@ -93240,7 +93231,7 @@ var ts;
93240
93231
  && !(element.transformFlags & (32768 /* TransformFlags.ContainsRestOrSpread */ | 65536 /* TransformFlags.ContainsObjectRestOrSpread */))
93241
93232
  && !(ts.getTargetOfBindingOrAssignmentElement(element).transformFlags & (32768 /* TransformFlags.ContainsRestOrSpread */ | 65536 /* TransformFlags.ContainsObjectRestOrSpread */))
93242
93233
  && !ts.isComputedPropertyName(propertyName)) {
93243
- bindingElements = ts.append(bindingElements, ts.visitNode(element, flattenContext.visitor, ts.isBindingOrAssignmentElement));
93234
+ bindingElements = ts.append(bindingElements, ts.visitNode(element, flattenContext.visitor));
93244
93235
  }
93245
93236
  else {
93246
93237
  if (bindingElements) {
@@ -93421,7 +93412,6 @@ var ts;
93421
93412
  return factory.createArrayBindingPattern(elements);
93422
93413
  }
93423
93414
  function makeArrayAssignmentPattern(factory, elements) {
93424
- ts.Debug.assertEachNode(elements, ts.isArrayBindingOrAssignmentElement);
93425
93415
  return factory.createArrayLiteralExpression(ts.map(elements, factory.converters.convertToArrayAssignmentElement));
93426
93416
  }
93427
93417
  function makeObjectBindingPattern(factory, elements) {
@@ -93429,7 +93419,6 @@ var ts;
93429
93419
  return factory.createObjectBindingPattern(elements);
93430
93420
  }
93431
93421
  function makeObjectAssignmentPattern(factory, elements) {
93432
- ts.Debug.assertEachNode(elements, ts.isObjectBindingOrAssignmentElement);
93433
93422
  return factory.createObjectLiteralExpression(ts.map(elements, factory.converters.convertToObjectAssignmentElement));
93434
93423
  }
93435
93424
  function makeBindingElement(factory, name) {
@@ -93450,7 +93439,6 @@ var ts;
93450
93439
  function processTaggedTemplateExpression(context, node, visitor, currentSourceFile, recordTaggedTemplateString, level) {
93451
93440
  // Visit the tag expression
93452
93441
  var tag = ts.visitNode(node.tag, visitor, ts.isExpression);
93453
- ts.Debug.assert(tag);
93454
93442
  // Build up the template arguments and the raw and cooked strings for the template.
93455
93443
  // We start out with 'undefined' for the first argument and revisit later
93456
93444
  // to avoid walking over the template string twice and shifting all our arguments over after the fact.
@@ -94016,7 +94004,7 @@ var ts;
94016
94004
  return factory.updateSourceFile(node, ts.visitLexicalEnvironment(node.statements, sourceElementVisitor, context, /*start*/ 0, alwaysStrict));
94017
94005
  }
94018
94006
  function visitObjectLiteralExpression(node) {
94019
- return factory.updateObjectLiteralExpression(node, ts.visitNodes(node.properties, getObjectLiteralElementVisitor(node), ts.isObjectLiteralElementLike));
94007
+ return factory.updateObjectLiteralExpression(node, ts.visitNodes(node.properties, getObjectLiteralElementVisitor(node), ts.isObjectLiteralElement));
94020
94008
  }
94021
94009
  function getClassFacts(node, staticProperties) {
94022
94010
  var facts = 0 /* ClassFacts.None */;
@@ -94202,7 +94190,6 @@ var ts;
94202
94190
  for (var _i = 0, parameterDecorators_1 = parameterDecorators; _i < parameterDecorators_1.length; _i++) {
94203
94191
  var parameterDecorator = parameterDecorators_1[_i];
94204
94192
  var expression = ts.visitNode(parameterDecorator.expression, visitor, ts.isExpression);
94205
- ts.Debug.assert(expression);
94206
94193
  var helper = emitHelpers().createParamHelper(expression, parameterOffset);
94207
94194
  ts.setTextRange(helper, parameterDecorator.expression);
94208
94195
  ts.setEmitFlags(helper, 1536 /* EmitFlags.NoComments */);
@@ -94345,7 +94332,6 @@ var ts;
94345
94332
  // - the property has a decorator.
94346
94333
  if (ts.isComputedPropertyName(name) && ((!ts.hasStaticModifier(member) && currentClassHasParameterProperties) || ts.hasDecorators(member))) {
94347
94334
  var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
94348
- ts.Debug.assert(expression);
94349
94335
  var innerExpression = ts.skipPartiallyEmittedExpressions(expression);
94350
94336
  if (!ts.isSimpleInlineableExpression(innerExpression)) {
94351
94337
  var generatedName = factory.getGeneratedNameForNode(name);
@@ -94380,7 +94366,7 @@ var ts;
94380
94366
  * @param node The ExpressionWithTypeArguments to transform.
94381
94367
  */
94382
94368
  function visitExpressionWithTypeArguments(node) {
94383
- return factory.updateExpressionWithTypeArguments(node, ts.Debug.checkDefined(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)),
94369
+ return factory.updateExpressionWithTypeArguments(node, ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression),
94384
94370
  /*typeArguments*/ undefined);
94385
94371
  }
94386
94372
  /**
@@ -94401,7 +94387,7 @@ var ts;
94401
94387
  var decorators = transformAllDecoratorsOfDeclaration(node, parent, allDecorators);
94402
94388
  // Preserve a `declare x` property with decorators to be handled by the decorators transform
94403
94389
  if (isAmbient) {
94404
- return factory.updatePropertyDeclaration(node, ts.concatenate(decorators, factory.createModifiersFromModifierFlags(2 /* ModifierFlags.Ambient */)), ts.Debug.checkDefined(ts.visitNode(node.name, visitor, ts.isPropertyName)),
94390
+ return factory.updatePropertyDeclaration(node, ts.concatenate(decorators, factory.createModifiersFromModifierFlags(2 /* ModifierFlags.Ambient */)), ts.visitNode(node.name, visitor, ts.isPropertyName),
94405
94391
  /*questionOrExclamationToken*/ undefined,
94406
94392
  /*type*/ undefined,
94407
94393
  /*initializer*/ undefined);
@@ -94562,7 +94548,7 @@ var ts;
94562
94548
  return undefined;
94563
94549
  }
94564
94550
  var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), // preserve positions, if available
94565
- node.dotDotDotToken, ts.Debug.checkDefined(ts.visitNode(node.name, visitor, ts.isBindingName)),
94551
+ node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName),
94566
94552
  /*questionToken*/ undefined,
94567
94553
  /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
94568
94554
  if (updated !== node) {
@@ -94614,7 +94600,6 @@ var ts;
94614
94600
  // Make sure we consider all nested cast expressions, e.g.:
94615
94601
  // (<any><number><any>-A).x;
94616
94602
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
94617
- ts.Debug.assert(expression);
94618
94603
  // We have an expression of the form: (<Type>SubExpr). Emitting this as (SubExpr)
94619
94604
  // is really not desirable. We would like to emit the subexpression as-is. Omitting
94620
94605
  // the parentheses, however, could cause change in the semantics of the generated
@@ -94638,17 +94623,14 @@ var ts;
94638
94623
  }
94639
94624
  function visitAssertionExpression(node) {
94640
94625
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
94641
- ts.Debug.assert(expression);
94642
94626
  return factory.createPartiallyEmittedExpression(expression, node);
94643
94627
  }
94644
94628
  function visitNonNullExpression(node) {
94645
94629
  var expression = ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression);
94646
- ts.Debug.assert(expression);
94647
94630
  return factory.createPartiallyEmittedExpression(expression, node);
94648
94631
  }
94649
94632
  function visitSatisfiesExpression(node) {
94650
94633
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
94651
- ts.Debug.assert(expression);
94652
94634
  return factory.createPartiallyEmittedExpression(expression, node);
94653
94635
  }
94654
94636
  function visitCallExpression(node) {
@@ -94661,7 +94643,7 @@ var ts;
94661
94643
  }
94662
94644
  function visitTaggedTemplateExpression(node) {
94663
94645
  return factory.updateTaggedTemplateExpression(node, ts.visitNode(node.tag, visitor, ts.isExpression),
94664
- /*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.isTemplateLiteral));
94646
+ /*typeArguments*/ undefined, ts.visitNode(node.template, visitor, ts.isExpression));
94665
94647
  }
94666
94648
  function visitJsxSelfClosingElement(node) {
94667
94649
  return factory.updateJsxSelfClosingElement(node, ts.visitNode(node.tagName, visitor, ts.isJsxTagNameExpression),
@@ -95691,7 +95673,6 @@ var ts;
95691
95673
  var info = accessPrivateIdentifier(node.left);
95692
95674
  if (info) {
95693
95675
  var receiver = ts.visitNode(node.right, visitor, ts.isExpression);
95694
- ts.Debug.assert(receiver);
95695
95676
  return ts.setOriginalNode(context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node);
95696
95677
  }
95697
95678
  // Private name has not been declared. Subsequent transformers will handle this error
@@ -95708,7 +95689,6 @@ var ts;
95708
95689
  }
95709
95690
  function visitComputedPropertyName(node) {
95710
95691
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
95711
- ts.Debug.assert(expression);
95712
95692
  if (ts.some(pendingExpressions)) {
95713
95693
  if (ts.isParenthesizedExpression(expression)) {
95714
95694
  expression = factory.updateParenthesizedExpression(expression, factory.inlineExpressions(__spreadArray(__spreadArray([], pendingExpressions, true), [expression.expression], false)));
@@ -95788,7 +95768,6 @@ var ts;
95788
95768
  var temp = factory.createTempVariable(hoistVariableDeclaration);
95789
95769
  ts.setSourceMapRange(temp, name.expression);
95790
95770
  var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
95791
- ts.Debug.assert(expression);
95792
95771
  var assignment = factory.createAssignment(temp, expression);
95793
95772
  ts.setSourceMapRange(assignment, name.expression);
95794
95773
  getterName = factory.updateComputedPropertyName(name, factory.inlineExpressions([assignment, temp]));
@@ -95939,7 +95918,6 @@ var ts;
95939
95918
  var info = void 0;
95940
95919
  if (info = accessPrivateIdentifier(operand.name)) {
95941
95920
  var receiver = ts.visitNode(operand.expression, visitor, ts.isExpression);
95942
- ts.Debug.assert(receiver);
95943
95921
  var _a = createCopiableReceiverExpr(receiver), readExpression = _a.readExpression, initializeExpression = _a.initializeExpression;
95944
95922
  var expression = createPrivateIdentifierAccess(info, readExpression);
95945
95923
  var temp = ts.isPrefixUnaryExpression(node) || valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
@@ -96143,17 +96121,14 @@ var ts;
96143
96121
  var superPropertyGet = factory.createReflectGetCall(superClassReference, getterName, classConstructor);
96144
96122
  ts.setOriginalNode(superPropertyGet, node.left);
96145
96123
  ts.setTextRange(superPropertyGet, node.left);
96146
- ts.Debug.assert(expression);
96147
96124
  expression = factory.createBinaryExpression(superPropertyGet, ts.getNonAssignmentOperatorForCompoundAssignment(node.operatorToken.kind), expression);
96148
96125
  ts.setTextRange(expression, node);
96149
96126
  }
96150
96127
  var temp = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
96151
96128
  if (temp) {
96152
- ts.Debug.assert(expression);
96153
96129
  expression = factory.createAssignment(temp, expression);
96154
96130
  ts.setTextRange(temp, node);
96155
96131
  }
96156
- ts.Debug.assert(expression);
96157
96132
  expression = factory.createReflectSetCall(superClassReference, setterName, expression, classConstructor);
96158
96133
  ts.setOriginalNode(expression, node);
96159
96134
  ts.setTextRange(expression, node);
@@ -96913,7 +96888,6 @@ var ts;
96913
96888
  function getPropertyNameExpressionIfNeeded(name, shouldHoist) {
96914
96889
  if (ts.isComputedPropertyName(name)) {
96915
96890
  var expression = ts.visitNode(name.expression, visitor, ts.isExpression);
96916
- ts.Debug.assert(expression);
96917
96891
  var innerExpression = ts.skipPartiallyEmittedExpressions(expression);
96918
96892
  var inlinable = ts.isSimpleInlineableExpression(innerExpression);
96919
96893
  var alreadyTransformed = ts.isAssignmentExpression(innerExpression) && ts.isGeneratedIdentifier(innerExpression.left);
@@ -97237,8 +97211,7 @@ var ts;
97237
97211
  //
97238
97212
  // Transformation:
97239
97213
  // [ { set value(x) { this.#myProp = x; } }.value ] = [ "hello" ];
97240
- return factory.updateArrayLiteralExpression(node, ts.visitNodes(node.elements, visitArrayAssignmentTarget, ts.isExpression) // TODO(jakebailey): the elements property's type looks to be wrong.
97241
- );
97214
+ return factory.updateArrayLiteralExpression(node, ts.visitNodes(node.elements, visitArrayAssignmentTarget, ts.isExpression));
97242
97215
  }
97243
97216
  else {
97244
97217
  // Transforms private names in destructuring assignment object bindings.
@@ -97958,7 +97931,7 @@ var ts;
97958
97931
  /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), ts.visitNodes(node.members, visitor, ts.isClassElement));
97959
97932
  }
97960
97933
  function visitConstructorDeclaration(node) {
97961
- return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNodes(node.parameters, visitor, ts.isParameter), ts.visitNode(node.body, visitor, ts.isBlock));
97934
+ return factory.updateConstructorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration), ts.visitNode(node.body, visitor, ts.isBlock));
97962
97935
  }
97963
97936
  function finishClassElement(updated, original) {
97964
97937
  if (updated !== original) {
@@ -97972,26 +97945,26 @@ var ts;
97972
97945
  function visitMethodDeclaration(node) {
97973
97946
  return finishClassElement(factory.updateMethodDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName),
97974
97947
  /*questionToken*/ undefined,
97975
- /*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter),
97948
+ /*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration),
97976
97949
  /*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)), node);
97977
97950
  }
97978
97951
  function visitGetAccessorDeclaration(node) {
97979
- return finishClassElement(factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNodes(node.parameters, visitor, ts.isParameter),
97952
+ return finishClassElement(factory.updateGetAccessorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration),
97980
97953
  /*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)), node);
97981
97954
  }
97982
97955
  function visitSetAccessorDeclaration(node) {
97983
- return finishClassElement(factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNodes(node.parameters, visitor, ts.isParameter), ts.visitNode(node.body, visitor, ts.isBlock)), node);
97956
+ return finishClassElement(factory.updateSetAccessorDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration), ts.visitNode(node.body, visitor, ts.isBlock)), node);
97984
97957
  }
97985
97958
  function visitPropertyDeclaration(node) {
97986
97959
  if (node.flags & 16777216 /* NodeFlags.Ambient */ || ts.hasSyntacticModifier(node, 2 /* ModifierFlags.Ambient */)) {
97987
97960
  return undefined;
97988
97961
  }
97989
- return finishClassElement(factory.updatePropertyDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.Debug.checkDefined(ts.visitNode(node.name, visitor, ts.isPropertyName)),
97962
+ return finishClassElement(factory.updatePropertyDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), ts.visitNode(node.name, visitor, ts.isPropertyName),
97990
97963
  /*questionOrExclamationToken*/ undefined,
97991
97964
  /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)), node);
97992
97965
  }
97993
97966
  function visitParameterDeclaration(node) {
97994
- var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), node.dotDotDotToken, ts.Debug.checkDefined(ts.visitNode(node.name, visitor, ts.isBindingName)),
97967
+ var updated = factory.updateParameterDeclaration(node, ts.elideNodes(factory, node.modifiers), node.dotDotDotToken, ts.visitNode(node.name, visitor, ts.isBindingName),
97995
97968
  /*questionToken*/ undefined,
97996
97969
  /*type*/ undefined, ts.visitNode(node.initializer, visitor, ts.isExpression));
97997
97970
  if (updated !== node) {
@@ -98165,7 +98138,7 @@ var ts;
98165
98138
  * @param decorator The decorator node.
98166
98139
  */
98167
98140
  function transformDecorator(decorator) {
98168
- return ts.Debug.checkDefined(ts.visitNode(decorator.expression, visitor, ts.isExpression));
98141
+ return ts.visitNode(decorator.expression, visitor, ts.isExpression);
98169
98142
  }
98170
98143
  /**
98171
98144
  * Transforms the decorators of a parameter.
@@ -98476,7 +98449,7 @@ var ts;
98476
98449
  : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
98477
98450
  }
98478
98451
  function visitForOfStatementInAsyncBody(node) {
98479
- return factory.updateForOfStatement(node, ts.visitNode(node.awaitModifier, visitor, ts.isAwaitKeyword), isVariableDeclarationListWithCollidingName(node.initializer)
98452
+ return factory.updateForOfStatement(node, ts.visitNode(node.awaitModifier, visitor, ts.isToken), isVariableDeclarationListWithCollidingName(node.initializer)
98480
98453
  ? visitVariableDeclarationListWithCollidingNames(node.initializer, /*hasReceiver*/ true)
98481
98454
  : ts.visitNode(node.initializer, visitor, ts.isForInitializer), ts.visitNode(node.expression, visitor, ts.isExpression), ts.visitIterationBody(node.statement, asyncBodyVisitor, context));
98482
98455
  }
@@ -98541,7 +98514,7 @@ var ts;
98541
98514
  * @param node The node to visit.
98542
98515
  */
98543
98516
  function visitFunctionExpression(node) {
98544
- return factory.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.asteriskToken, node.name,
98517
+ return factory.updateFunctionExpression(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike), node.asteriskToken, node.name,
98545
98518
  /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
98546
98519
  /*type*/ undefined, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
98547
98520
  ? transformAsyncFunctionBody(node)
@@ -98556,7 +98529,7 @@ var ts;
98556
98529
  * @param node The node to visit.
98557
98530
  */
98558
98531
  function visitArrowFunction(node) {
98559
- return factory.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifier),
98532
+ return factory.updateArrowFunction(node, ts.visitNodes(node.modifiers, visitor, ts.isModifierLike),
98560
98533
  /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, visitor, context),
98561
98534
  /*type*/ undefined, node.equalsGreaterThanToken, ts.getFunctionFlags(node) & 2 /* FunctionFlags.Async */
98562
98535
  ? transformAsyncFunctionBody(node)
@@ -98612,7 +98585,7 @@ var ts;
98612
98585
  }
98613
98586
  function transformInitializedVariable(node) {
98614
98587
  var converted = ts.setSourceMapRange(factory.createAssignment(factory.converters.convertToAssignmentElementTarget(node.name), node.initializer), node);
98615
- return ts.Debug.checkDefined(ts.visitNode(converted, visitor, ts.isExpression));
98588
+ return ts.visitNode(converted, visitor, ts.isExpression);
98616
98589
  }
98617
98590
  function collidesWithParameterName(_a) {
98618
98591
  var name = _a.name;
@@ -99476,7 +99449,7 @@ var ts;
99476
99449
  ? ts.visitNodes(node.modifiers, visitorNoAsyncModifier, ts.isModifierLike)
99477
99450
  : node.modifiers, enclosingFunctionFlags & 2 /* FunctionFlags.Async */
99478
99451
  ? undefined
99479
- : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.isQuestionToken),
99452
+ : node.asteriskToken, ts.visitNode(node.name, visitor, ts.isPropertyName), ts.visitNode(/*questionToken*/ undefined, visitor, ts.isToken),
99480
99453
  /*typeParameters*/ undefined, ts.visitParameterList(node.parameters, parameterVisitor, context),
99481
99454
  /*type*/ undefined, enclosingFunctionFlags & 2 /* FunctionFlags.Async */ && enclosingFunctionFlags & 1 /* FunctionFlags.Generator */
99482
99455
  ? transformAsyncGeneratorFunctionBody(node)
@@ -100365,7 +100338,7 @@ var ts;
100365
100338
  return ts.singleOrUndefined(expressions) || emitHelpers().createAssignHelper(expressions);
100366
100339
  }
100367
100340
  function transformJsxSpreadAttributeToExpression(node) {
100368
- return ts.Debug.checkDefined(ts.visitNode(node.expression, visitor, ts.isExpression));
100341
+ return ts.visitNode(node.expression, visitor, ts.isExpression);
100369
100342
  }
100370
100343
  function transformJsxAttributeToObjectLiteralElement(node) {
100371
100344
  var name = getAttributeName(node);
@@ -102033,7 +102006,6 @@ var ts;
102033
102006
  var sourceMapRange = ts.getSourceMapRange(member);
102034
102007
  var memberFunction = transformFunctionLikeToExpression(member, /*location*/ member, /*name*/ undefined, container);
102035
102008
  var propertyName = ts.visitNode(member.name, visitor, ts.isPropertyName);
102036
- ts.Debug.assert(propertyName);
102037
102009
  var e;
102038
102010
  if (!ts.isPrivateIdentifier(propertyName) && ts.getUseDefineForClassFields(context.getCompilerOptions())) {
102039
102011
  var name = ts.isComputedPropertyName(propertyName) ? propertyName.expression
@@ -102086,7 +102058,6 @@ var ts;
102086
102058
  ts.setEmitFlags(target, 1536 /* EmitFlags.NoComments */ | 32 /* EmitFlags.NoTrailingSourceMap */);
102087
102059
  ts.setSourceMapRange(target, firstAccessor.name);
102088
102060
  var visitedAccessorName = ts.visitNode(firstAccessor.name, visitor, ts.isPropertyName);
102089
- ts.Debug.assert(visitedAccessorName);
102090
102061
  if (ts.isPrivateIdentifier(visitedAccessorName)) {
102091
102062
  return ts.Debug.failBadSyntaxKind(visitedAccessorName, "Encountered unhandled private identifier while transforming ES2015.");
102092
102063
  }
@@ -102361,7 +102332,6 @@ var ts;
102361
102332
  var visited = ts.visitNode(element, i < node.elements.length - 1 ? visitorWithUnusedExpressionResult : visitor, ts.isExpression);
102362
102333
  if (result || visited !== element) {
102363
102334
  result || (result = node.elements.slice(0, i));
102364
- ts.Debug.assert(visited);
102365
102335
  result.push(visited);
102366
102336
  }
102367
102337
  }
@@ -102421,7 +102391,6 @@ var ts;
102421
102391
  var declarations = ts.flatMap(node.declarations, node.flags & 1 /* NodeFlags.Let */
102422
102392
  ? visitVariableDeclarationInLetDeclarationList
102423
102393
  : visitVariableDeclaration);
102424
- ts.Debug.assertEachNode(declarations, ts.isVariableDeclaration); // TODO(jakebailey): side effect of VisitResult.
102425
102394
  var declarationList = factory.createVariableDeclarationList(declarations);
102426
102395
  ts.setOriginalNode(declarationList, node);
102427
102396
  ts.setTextRange(declarationList, node);
@@ -102641,7 +102610,6 @@ var ts;
102641
102610
  }
102642
102611
  else {
102643
102612
  var statement = ts.visitNode(node.statement, visitor, ts.isStatement, factory.liftToBlock);
102644
- ts.Debug.assert(statement);
102645
102613
  if (ts.isBlock(statement)) {
102646
102614
  return factory.updateBlock(statement, ts.setTextRange(factory.createNodeArray(ts.concatenate(statements, statement.statements)), statement.statements));
102647
102615
  }
@@ -102677,7 +102645,6 @@ var ts;
102677
102645
  // Note also that because an extra statement is needed to assign to the LHS,
102678
102646
  // for-of bodies are always emitted as blocks.
102679
102647
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
102680
- ts.Debug.assert(expression);
102681
102648
  // In the case where the user wrote an identifier as the RHS, like this:
102682
102649
  //
102683
102650
  // for (let v of arr) { }
@@ -102703,7 +102670,6 @@ var ts;
102703
102670
  }
102704
102671
  function convertForOfStatementForIterable(node, outermostLabeledStatement, convertedLoopBodyStatements, ancestorFacts) {
102705
102672
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
102706
- ts.Debug.assert(expression);
102707
102673
  var iterator = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(expression) : factory.createTempVariable(/*recordTempVariable*/ undefined);
102708
102674
  var result = ts.isIdentifier(expression) ? factory.getGeneratedNameForNode(iterator) : factory.createTempVariable(/*recordTempVariable*/ undefined);
102709
102675
  var errorRecord = factory.createUniqueName("e");
@@ -103132,7 +103098,6 @@ var ts;
103132
103098
  statements.push(factory.createIfStatement(factory.createPrefixUnaryExpression(53 /* SyntaxKind.ExclamationToken */, ts.visitNode(node.condition, visitor, ts.isExpression)), ts.visitNode(factory.createBreakStatement(), visitor, ts.isStatement)));
103133
103099
  }
103134
103100
  }
103135
- ts.Debug.assert(statement);
103136
103101
  if (ts.isBlock(statement)) {
103137
103102
  ts.addRange(statements, statement.statements);
103138
103103
  }
@@ -103773,9 +103738,7 @@ var ts;
103773
103738
  return ts.map(chunk, visitExpressionOfSpread);
103774
103739
  }
103775
103740
  function visitExpressionOfSpread(node) {
103776
- ts.Debug.assertNode(node, ts.isSpreadElement);
103777
103741
  var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
103778
- ts.Debug.assert(expression);
103779
103742
  // We don't need to pack already packed array literals, or existing calls to the `__read` helper.
103780
103743
  var isCallToReadHelper = ts.isCallToHelper(expression, "___read");
103781
103744
  var kind = isCallToReadHelper || ts.isPackedArrayLiteral(expression) ? 2 /* SpreadSegmentKind.PackedSpread */ : 1 /* SpreadSegmentKind.UnpackedSpread */;
@@ -103843,7 +103806,7 @@ var ts;
103843
103806
  var expression = factory.createStringLiteral(node.head.text);
103844
103807
  for (var _i = 0, _a = node.templateSpans; _i < _a.length; _i++) {
103845
103808
  var span = _a[_i];
103846
- var args = [ts.Debug.checkDefined(ts.visitNode(span.expression, visitor, ts.isExpression))];
103809
+ var args = [ts.visitNode(span.expression, visitor, ts.isExpression)];
103847
103810
  if (span.literal.text.length > 0) {
103848
103811
  args.push(factory.createStringLiteral(span.literal.text));
103849
103812
  }
@@ -104744,7 +104707,7 @@ var ts;
104744
104707
  // .yield resumeLabel
104745
104708
  // .mark resumeLabel
104746
104709
  // _a.b = %sent%;
104747
- target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.Debug.checkDefined(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression))), left.name);
104710
+ target = factory.updatePropertyAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), left.name);
104748
104711
  break;
104749
104712
  case 209 /* SyntaxKind.ElementAccessExpression */:
104750
104713
  // [source]
@@ -104757,7 +104720,7 @@ var ts;
104757
104720
  // .yield resumeLabel
104758
104721
  // .mark resumeLabel
104759
104722
  // _a[_b] = %sent%;
104760
- target = factory.updateElementAccessExpression(left, cacheExpression(ts.Debug.checkDefined(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression))), cacheExpression(ts.Debug.checkDefined(ts.visitNode(left.argumentExpression, visitor, ts.isExpression))));
104723
+ target = factory.updateElementAccessExpression(left, cacheExpression(ts.visitNode(left.expression, visitor, ts.isLeftHandSideExpression)), cacheExpression(ts.visitNode(left.argumentExpression, visitor, ts.isExpression)));
104761
104724
  break;
104762
104725
  default:
104763
104726
  target = ts.visitNode(left, visitor, ts.isExpression);
@@ -105075,7 +105038,7 @@ var ts;
105075
105038
  // .yield resumeLabel
105076
105039
  // .mark resumeLabel
105077
105040
  // a = _a[%sent%]
105078
- return factory.updateElementAccessExpression(node, cacheExpression(ts.Debug.checkDefined(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression))), ts.visitNode(node.argumentExpression, visitor, ts.isExpression));
105041
+ return factory.updateElementAccessExpression(node, cacheExpression(ts.visitNode(node.expression, visitor, ts.isLeftHandSideExpression)), ts.visitNode(node.argumentExpression, visitor, ts.isExpression));
105079
105042
  }
105080
105043
  return ts.visitEachChild(node, visitor, context);
105081
105044
  }
@@ -105092,7 +105055,7 @@ var ts;
105092
105055
  // .mark resumeLabel
105093
105056
  // _b.apply(_a, _c.concat([%sent%, 2]));
105094
105057
  var _a = factory.createCallBinding(node.expression, hoistVariableDeclaration, languageVersion, /*cacheIdentifiers*/ true), target = _a.target, thisArg = _a.thisArg;
105095
- return ts.setOriginalNode(ts.setTextRange(factory.createFunctionApplyCall(cacheExpression(ts.Debug.checkDefined(ts.visitNode(target, visitor, ts.isLeftHandSideExpression))), thisArg, visitElements(node.arguments)), node), node);
105058
+ return ts.setOriginalNode(ts.setTextRange(factory.createFunctionApplyCall(cacheExpression(ts.visitNode(target, visitor, ts.isLeftHandSideExpression)), thisArg, visitElements(node.arguments)), node), node);
105096
105059
  }
105097
105060
  return ts.visitEachChild(node, visitor, context);
105098
105061
  }
@@ -107077,7 +107040,7 @@ var ts;
107077
107040
  */
107078
107041
  function addExportEqualsIfNeeded(statements, emitAsReturn) {
107079
107042
  if (currentModuleInfo.exportEquals) {
107080
- var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, visitor, ts.isExpression);
107043
+ var expressionResult = ts.visitNode(currentModuleInfo.exportEquals.expression, visitor);
107081
107044
  if (expressionResult) {
107082
107045
  if (emitAsReturn) {
107083
107046
  var statement = factory.createReturnStatement(expressionResult);
@@ -107277,7 +107240,7 @@ var ts;
107277
107240
  }
107278
107241
  function visitImportCallExpression(node) {
107279
107242
  var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
107280
- var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor, ts.isExpression);
107243
+ var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor);
107281
107244
  // Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.
107282
107245
  var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
107283
107246
  var containsLexicalThis = !!(node.transformFlags & 16384 /* TransformFlags.ContainsLexicalThis */);
@@ -107625,7 +107588,7 @@ var ts;
107625
107588
  var statements;
107626
107589
  if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
107627
107590
  statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createFunctionDeclaration(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifier), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
107628
- /*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter),
107591
+ /*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor),
107629
107592
  /*type*/ undefined, ts.visitEachChild(node.body, visitor, context)),
107630
107593
  /*location*/ node),
107631
107594
  /*original*/ node));
@@ -107652,7 +107615,7 @@ var ts;
107652
107615
  var statements;
107653
107616
  if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
107654
107617
  statements = ts.append(statements, ts.setOriginalNode(ts.setTextRange(factory.createClassDeclaration(ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifierLike), factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
107655
- /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor, ts.isHeritageClause), ts.visitNodes(node.members, visitor, ts.isClassElement)), node), node));
107618
+ /*typeParameters*/ undefined, ts.visitNodes(node.heritageClauses, visitor), ts.visitNodes(node.members, visitor)), node), node));
107656
107619
  }
107657
107620
  else {
107658
107621
  statements = ts.append(statements, ts.visitEachChild(node, visitor, context));
@@ -107692,7 +107655,7 @@ var ts;
107692
107655
  if (!ts.isBindingPattern(variable.name) && (ts.isArrowFunction(variable.initializer) || ts.isFunctionExpression(variable.initializer) || ts.isClassExpression(variable.initializer))) {
107693
107656
  var expression = factory.createAssignment(ts.setTextRange(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), variable.name),
107694
107657
  /*location*/ variable.name), factory.createIdentifier(ts.getTextOfIdentifierOrLiteral(variable.name)));
107695
- var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, visitor, ts.isExpression));
107658
+ var updatedVariable = factory.createVariableDeclaration(variable.name, variable.exclamationToken, variable.type, ts.visitNode(variable.initializer, visitor));
107696
107659
  variables = ts.append(variables, updatedVariable);
107697
107660
  expressions = ts.append(expressions, expression);
107698
107661
  removeCommentsOnExpressions = true;
@@ -108720,7 +108683,7 @@ var ts;
108720
108683
  function visitFunctionDeclaration(node) {
108721
108684
  if (ts.hasSyntacticModifier(node, 1 /* ModifierFlags.Export */)) {
108722
108685
  hoistedStatements = ts.append(hoistedStatements, factory.updateFunctionDeclaration(node, ts.visitNodes(node.modifiers, modifierVisitor, ts.isModifierLike), node.asteriskToken, factory.getDeclarationName(node, /*allowComments*/ true, /*allowSourceMaps*/ true),
108723
- /*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameter),
108686
+ /*typeParameters*/ undefined, ts.visitNodes(node.parameters, visitor, ts.isParameterDeclaration),
108724
108687
  /*type*/ undefined, ts.visitNode(node.body, visitor, ts.isBlock)));
108725
108688
  }
108726
108689
  else {
@@ -109236,7 +109199,7 @@ var ts;
109236
109199
  return expressions ? factory.inlineExpressions(expressions) : factory.createOmittedExpression();
109237
109200
  }
109238
109201
  else {
109239
- return ts.visitNode(node, discardedValueVisitor, ts.isForInitializer);
109202
+ return ts.visitNode(node, discardedValueVisitor, ts.isExpression);
109240
109203
  }
109241
109204
  }
109242
109205
  /**
@@ -109408,7 +109371,7 @@ var ts;
109408
109371
  // };
109409
109372
  // });
109410
109373
  var externalModuleName = ts.getExternalModuleNameLiteral(factory, node, currentSourceFile, host, resolver, compilerOptions);
109411
- var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor, ts.isExpression);
109374
+ var firstArgument = ts.visitNode(ts.firstOrUndefined(node.arguments), visitor);
109412
109375
  // Only use the external module name if it differs from the first argument. This allows us to preserve the quote style of the argument on output.
109413
109376
  var argument = externalModuleName && (!firstArgument || !ts.isStringLiteral(firstArgument) || firstArgument.text !== externalModuleName.text) ? externalModuleName : firstArgument;
109414
109377
  return factory.createCallExpression(factory.createPropertyAccessExpression(contextObject, factory.createIdentifier("import")),
@@ -110628,7 +110591,7 @@ var ts;
110628
110591
  var _a;
110629
110592
  var primaryDeclaration = (_a = parentSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(function (d) { return ts.getSourceFileOfNode(d) === containingFile; });
110630
110593
  var augmentingDeclarations = ts.filter(symbol.declarations, function (d) { return ts.getSourceFileOfNode(d) !== containingFile; });
110631
- if (augmentingDeclarations) {
110594
+ if (primaryDeclaration && augmentingDeclarations) {
110632
110595
  for (var _i = 0, augmentingDeclarations_1 = augmentingDeclarations; _i < augmentingDeclarations_1.length; _i++) {
110633
110596
  var augmentations = augmentingDeclarations_1[_i];
110634
110597
  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)));
@@ -110683,12 +110646,12 @@ var ts;
110683
110646
  if (ts.isExternalOrCommonJsModule(sourceFile) || ts.isJsonSourceFile(sourceFile)) {
110684
110647
  resultHasExternalModuleIndicator = false; // unused in external module bundle emit (all external modules are within module blocks, therefore are known to be modules)
110685
110648
  needsDeclare = false;
110686
- var statements = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements, ts.isStatement);
110649
+ var statements = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile, /*bundled*/ true)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
110687
110650
  var newFile = factory.updateSourceFile(sourceFile, [factory.createModuleDeclaration([factory.createModifier(136 /* SyntaxKind.DeclareKeyword */)], factory.createStringLiteral(ts.getResolvedExternalModuleName(context.getEmitHost(), sourceFile)), factory.createModuleBlock(ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), sourceFile.statements)))], /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
110688
110651
  return newFile;
110689
110652
  }
110690
110653
  needsDeclare = true;
110691
- var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements, ts.isStatement);
110654
+ var updated = ts.isSourceFileJS(sourceFile) ? factory.createNodeArray(transformDeclarationsForJS(sourceFile)) : ts.visitNodes(sourceFile.statements, visitDeclarationStatements);
110692
110655
  return factory.updateSourceFile(sourceFile, transformAndReplaceLatePaintedStatements(updated), /*isDeclarationFile*/ true, /*referencedFiles*/ [], /*typeReferences*/ [], /*hasNoDefaultLib*/ false, /*libReferences*/ []);
110693
110656
  }), ts.mapDefined(node.prepends, function (prepend) {
110694
110657
  if (prepend.kind === 311 /* SyntaxKind.InputFiles */) {
@@ -110735,7 +110698,7 @@ var ts;
110735
110698
  emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
110736
110699
  }
110737
110700
  else {
110738
- var statements = ts.visitNodes(node.statements, visitDeclarationStatements, ts.isStatement);
110701
+ var statements = ts.visitNodes(node.statements, visitDeclarationStatements);
110739
110702
  combinedStatements = ts.setTextRange(factory.createNodeArray(transformAndReplaceLatePaintedStatements(statements)), node.statements);
110740
110703
  refs.forEach(referenceVisitor);
110741
110704
  emittedImports = ts.filter(combinedStatements, ts.isAnyImportSyntax);
@@ -110833,10 +110796,10 @@ var ts;
110833
110796
  }
110834
110797
  else {
110835
110798
  if (name.kind === 204 /* SyntaxKind.ArrayBindingPattern */) {
110836
- return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement, ts.isArrayBindingElement));
110799
+ return factory.updateArrayBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
110837
110800
  }
110838
110801
  else {
110839
- return factory.updateObjectBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement, ts.isBindingElement));
110802
+ return factory.updateObjectBindingPattern(name, ts.visitNodes(name.elements, visitBindingElement));
110840
110803
  }
110841
110804
  }
110842
110805
  function visitBindingElement(elem) {
@@ -110886,10 +110849,10 @@ var ts;
110886
110849
  (resolver.isRequiredInitializedParameter(node) ||
110887
110850
  resolver.isOptionalUninitializedParameterProperty(node));
110888
110851
  if (type && !shouldUseResolverType) {
110889
- return ts.visitNode(type, visitDeclarationSubtree, ts.isTypeNode);
110852
+ return ts.visitNode(type, visitDeclarationSubtree);
110890
110853
  }
110891
110854
  if (!ts.getParseTreeNode(node)) {
110892
- return type ? ts.visitNode(type, visitDeclarationSubtree, ts.isTypeNode) : factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */);
110855
+ return type ? ts.visitNode(type, visitDeclarationSubtree) : factory.createKeywordTypeNode(131 /* SyntaxKind.AnyKeyword */);
110893
110856
  }
110894
110857
  if (node.kind === 175 /* SyntaxKind.SetAccessor */) {
110895
110858
  // Set accessors with no associated type node (from it's param or get accessor return) are `any` since they are never contextually typed right now
@@ -111002,7 +110965,7 @@ var ts;
111002
110965
  return factory.createNodeArray(newParams || ts.emptyArray);
111003
110966
  }
111004
110967
  function ensureTypeParams(node, params) {
111005
- return ts.hasEffectiveModifier(node, 8 /* ModifierFlags.Private */) ? undefined : ts.visitNodes(params, visitDeclarationSubtree, ts.isTypeParameterDeclaration);
110968
+ return ts.hasEffectiveModifier(node, 8 /* ModifierFlags.Private */) ? undefined : ts.visitNodes(params, visitDeclarationSubtree);
111006
110969
  }
111007
110970
  function isEnclosingDeclaration(node) {
111008
110971
  return ts.isSourceFile(node)
@@ -111134,7 +111097,6 @@ var ts;
111134
111097
  var key = ts.getOriginalNodeId(statement);
111135
111098
  if (lateStatementReplacementMap.has(key)) {
111136
111099
  var result = lateStatementReplacementMap.get(key);
111137
- ts.Debug.type(result);
111138
111100
  lateStatementReplacementMap.delete(key);
111139
111101
  if (result) {
111140
111102
  if (ts.isArray(result) ? ts.some(result, ts.needsScopeMarker) : ts.needsScopeMarker(result)) {
@@ -111282,17 +111244,13 @@ var ts;
111282
111244
  case 191 /* SyntaxKind.ConditionalType */: {
111283
111245
  // We have to process conditional types in a special way because for visibility purposes we need to push a new enclosingDeclaration
111284
111246
  // just for the `infer` types in the true branch. It's an implicit declaration scope that only applies to _part_ of the type.
111285
- var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree, ts.isTypeNode);
111286
- var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree, ts.isTypeNode);
111247
+ var checkType = ts.visitNode(input.checkType, visitDeclarationSubtree);
111248
+ var extendsType = ts.visitNode(input.extendsType, visitDeclarationSubtree);
111287
111249
  var oldEnclosingDecl = enclosingDeclaration;
111288
111250
  enclosingDeclaration = input.trueType;
111289
- var trueType = ts.visitNode(input.trueType, visitDeclarationSubtree, ts.isTypeNode);
111251
+ var trueType = ts.visitNode(input.trueType, visitDeclarationSubtree);
111290
111252
  enclosingDeclaration = oldEnclosingDecl;
111291
- var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree, ts.isTypeNode);
111292
- ts.Debug.assert(checkType);
111293
- ts.Debug.assert(extendsType);
111294
- ts.Debug.assert(trueType);
111295
- ts.Debug.assert(falseType);
111253
+ var falseType = ts.visitNode(input.falseType, visitDeclarationSubtree);
111296
111254
  return cleanup(factory.updateConditionalTypeNode(input, checkType, extendsType, trueType, falseType));
111297
111255
  }
111298
111256
  case 181 /* SyntaxKind.FunctionType */: {
@@ -111430,7 +111388,7 @@ var ts;
111430
111388
  return clean;
111431
111389
  }
111432
111390
  case 261 /* SyntaxKind.InterfaceDeclaration */: {
111433
- return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree, ts.isTypeElement)));
111391
+ return cleanup(factory.updateInterfaceDeclaration(input, ensureModifiers(input), input.name, ensureTypeParams(input, input.typeParameters), transformHeritageClauses(input.heritageClauses), ts.visitNodes(input.members, visitDeclarationSubtree)));
111434
111392
  }
111435
111393
  case 259 /* SyntaxKind.FunctionDeclaration */: {
111436
111394
  // Generators lose their generator-ness, excepting their return type
@@ -111502,7 +111460,7 @@ var ts;
111502
111460
  var oldHasScopeFix = resultHasScopeMarker;
111503
111461
  resultHasScopeMarker = false;
111504
111462
  needsScopeFixMarker = false;
111505
- var statements = ts.visitNodes(inner.statements, visitDeclarationStatements, ts.isStatement);
111463
+ var statements = ts.visitNodes(inner.statements, visitDeclarationStatements);
111506
111464
  var lateStatements = transformAndReplaceLatePaintedStatements(statements);
111507
111465
  if (input.flags & 16777216 /* NodeFlags.Ambient */) {
111508
111466
  needsScopeFixMarker = false; // If it was `declare`'d everything is implicitly exported already, ignore late printed "privates"
@@ -111587,7 +111545,7 @@ var ts;
111587
111545
  /*type*/ undefined,
111588
111546
  /*initializer*/ undefined)
111589
111547
  ] : undefined;
111590
- var memberNodes = ts.concatenate(ts.concatenate(privateIdentifier, parameterProperties), ts.visitNodes(input.members, visitDeclarationSubtree, ts.isClassElement));
111548
+ var memberNodes = ts.concatenate(ts.concatenate(privateIdentifier, parameterProperties), ts.visitNodes(input.members, visitDeclarationSubtree));
111591
111549
  var members = factory.createNodeArray(memberNodes);
111592
111550
  var extendsClause_1 = ts.getEffectiveBaseTypeNode(input);
111593
111551
  if (extendsClause_1 && !ts.isEntityNameExpression(extendsClause_1.expression) && extendsClause_1.expression.kind !== 104 /* SyntaxKind.NullKeyword */) {
@@ -111605,11 +111563,11 @@ var ts;
111605
111563
  if (clause.token === 94 /* SyntaxKind.ExtendsKeyword */) {
111606
111564
  var oldDiag_2 = getSymbolAccessibilityDiagnostic;
111607
111565
  getSymbolAccessibilityDiagnostic = ts.createGetSymbolAccessibilityDiagnosticForNode(clause.types[0]);
111608
- var newClause = factory.updateHeritageClause(clause, ts.map(clause.types, function (t) { return factory.updateExpressionWithTypeArguments(t, newId_1, ts.visitNodes(t.typeArguments, visitDeclarationSubtree, ts.isTypeNode)); }));
111566
+ var newClause = factory.updateHeritageClause(clause, ts.map(clause.types, function (t) { return factory.updateExpressionWithTypeArguments(t, newId_1, ts.visitNodes(t.typeArguments, visitDeclarationSubtree)); }));
111609
111567
  getSymbolAccessibilityDiagnostic = oldDiag_2;
111610
111568
  return newClause;
111611
111569
  }
111612
- return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 104 /* SyntaxKind.NullKeyword */; })), visitDeclarationSubtree, ts.isExpressionWithTypeArguments));
111570
+ return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) { return ts.isEntityNameExpression(t.expression) || t.expression.kind === 104 /* SyntaxKind.NullKeyword */; })), visitDeclarationSubtree));
111613
111571
  }));
111614
111572
  return [statement, cleanup(factory.updateClassDeclaration(input, modifiers, input.name, typeParameters, heritageClauses, members))]; // TODO: GH#18217
111615
111573
  }
@@ -111654,7 +111612,7 @@ var ts;
111654
111612
  function transformVariableStatement(input) {
111655
111613
  if (!ts.forEach(input.declarationList.declarations, getBindingNameVisible))
111656
111614
  return;
111657
- var nodes = ts.visitNodes(input.declarationList.declarations, visitDeclarationSubtree, ts.isVariableDeclaration);
111615
+ var nodes = ts.visitNodes(input.declarationList.declarations, visitDeclarationSubtree);
111658
111616
  if (!ts.length(nodes))
111659
111617
  return;
111660
111618
  return factory.updateVariableStatement(input, factory.createNodeArray(ensureModifiers(input)), factory.updateVariableDeclarationList(input.declarationList, nodes));
@@ -111737,7 +111695,7 @@ var ts;
111737
111695
  function transformHeritageClauses(nodes) {
111738
111696
  return factory.createNodeArray(ts.filter(ts.map(nodes, function (clause) { return factory.updateHeritageClause(clause, ts.visitNodes(factory.createNodeArray(ts.filter(clause.types, function (t) {
111739
111697
  return ts.isEntityNameExpression(t.expression) || (clause.token === 94 /* SyntaxKind.ExtendsKeyword */ && t.expression.kind === 104 /* SyntaxKind.NullKeyword */);
111740
- })), visitDeclarationSubtree, ts.isExpressionWithTypeArguments)); }), function (clause) { return clause.types && !!clause.types.length; }));
111698
+ })), visitDeclarationSubtree)); }), function (clause) { return clause.types && !!clause.types.length; }));
111741
111699
  }
111742
111700
  }
111743
111701
  ts.transformDeclarations = transformDeclarations;
@@ -115456,6 +115414,7 @@ var ts;
115456
115414
  writeTrailingSemicolon();
115457
115415
  }
115458
115416
  function emitExportDeclaration(node) {
115417
+ emitModifiers(node, node.modifiers);
115459
115418
  var nextPos = emitTokenWithComment(93 /* SyntaxKind.ExportKeyword */, node.pos, writeKeyword, node);
115460
115419
  writeSpace();
115461
115420
  if (node.isTypeOnly) {
@@ -118682,7 +118641,6 @@ var ts;
118682
118641
  return resolutions;
118683
118642
  }
118684
118643
  ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
118685
- ;
118686
118644
  /**
118687
118645
  * Calculates the resulting resolution mode for some reference in some file - this is generally the explicitly
118688
118646
  * provided resolution mode in the reference, unless one is not present, in which case it is the mode of the containing file.
@@ -123940,17 +123898,13 @@ var ts;
123940
123898
  var value = filesWithInvalidatedNonRelativeUnresolvedImports.get(path);
123941
123899
  return !!value && !!value.length;
123942
123900
  }
123943
- function createHasInvalidatedResolution(forceAllFilesAsInvalidated) {
123901
+ function createHasInvalidatedResolution(userProvidedHasInvalidatedResolution) {
123944
123902
  // Ensure pending resolutions are applied
123945
123903
  invalidateResolutionsOfFailedLookupLocations();
123946
- if (forceAllFilesAsInvalidated) {
123947
- // Any file asked would have invalidated resolution
123948
- filesWithInvalidatedResolutions = undefined;
123949
- return ts.returnTrue;
123950
- }
123951
123904
  var collected = filesWithInvalidatedResolutions;
123952
123905
  filesWithInvalidatedResolutions = undefined;
123953
- return function (path) { return (!!collected && collected.has(path)) ||
123906
+ return function (path) { return (userProvidedHasInvalidatedResolution === null || userProvidedHasInvalidatedResolution === void 0 ? void 0 : userProvidedHasInvalidatedResolution(path)) ||
123907
+ !!(collected === null || collected === void 0 ? void 0 : collected.has(path)) ||
123954
123908
  isFileWithInvalidatedNonRelativeUnresolvedImports(path); };
123955
123909
  }
123956
123910
  function startCachingPerDirectoryResolution() {
@@ -125059,7 +125013,7 @@ var ts;
125059
125013
  });
125060
125014
  // Sort by paths closest to importing file Name directory
125061
125015
  var sortedPaths = [];
125062
- var _loop_35 = function (directory) {
125016
+ var _loop_36 = function (directory) {
125063
125017
  var directoryStart = ts.ensureTrailingDirectorySeparator(directory);
125064
125018
  var pathsInDirectory;
125065
125019
  allFileNames.forEach(function (_a, fileName) {
@@ -125083,9 +125037,9 @@ var ts;
125083
125037
  };
125084
125038
  var out_directory_1;
125085
125039
  for (var directory = ts.getDirectoryPath(importingFileName); allFileNames.size !== 0;) {
125086
- var state_11 = _loop_35(directory);
125040
+ var state_12 = _loop_36(directory);
125087
125041
  directory = out_directory_1;
125088
- if (state_11 === "break")
125042
+ if (state_12 === "break")
125089
125043
  break;
125090
125044
  }
125091
125045
  if (allFileNames.size) {
@@ -125154,7 +125108,7 @@ var ts;
125154
125108
  }
125155
125109
  function tryGetModuleNameFromPaths(relativeToBaseUrl, paths, allowedEndings, host, compilerOptions) {
125156
125110
  for (var key in paths) {
125157
- var _loop_36 = function (patternText_1) {
125111
+ var _loop_37 = function (patternText_1) {
125158
125112
  var pattern = ts.normalizePath(patternText_1);
125159
125113
  var indexOfStar = pattern.indexOf("*");
125160
125114
  // In module resolution, if `pattern` itself has an extension, a file with that extension is looked up directly,
@@ -125221,9 +125175,9 @@ var ts;
125221
125175
  };
125222
125176
  for (var _i = 0, _a = paths[key]; _i < _a.length; _i++) {
125223
125177
  var patternText_1 = _a[_i];
125224
- var state_12 = _loop_36(patternText_1);
125225
- if (typeof state_12 === "object")
125226
- return state_12.value;
125178
+ var state_13 = _loop_37(patternText_1);
125179
+ if (typeof state_13 === "object")
125180
+ return state_13.value;
125227
125181
  }
125228
125182
  }
125229
125183
  function validateEnding(_a) {
@@ -125628,9 +125582,6 @@ var ts;
125628
125582
  return "".concat(errorDiagnostic.file.fileName);
125629
125583
  });
125630
125584
  return filesInError.map(function (fileName) {
125631
- if (fileName === undefined) {
125632
- return undefined;
125633
- }
125634
125585
  var diagnosticForFileName = ts.find(diagnostics, function (diagnostic) {
125635
125586
  return diagnostic.file !== undefined && diagnostic.file.fileName === fileName;
125636
125587
  });
@@ -126267,8 +126218,6 @@ var ts;
126267
126218
  parseConfigFile();
126268
126219
  newLine = updateNewLine();
126269
126220
  }
126270
- ts.Debug.assert(compilerOptions);
126271
- ts.Debug.assert(rootFileNames);
126272
126221
  var _b = ts.createWatchFactory(host, compilerOptions), watchFile = _b.watchFile, watchDirectory = _b.watchDirectory, writeLog = _b.writeLog;
126273
126222
  var getCanonicalFileName = ts.createGetCanonicalFileName(useCaseSensitiveFileNames);
126274
126223
  writeLog("Current directory: ".concat(currentDirectory, " CaseSensitiveFileNames: ").concat(useCaseSensitiveFileNames));
@@ -126335,6 +126284,7 @@ var ts;
126335
126284
  ts.maybeBind(host, host.getModuleResolutionCache) :
126336
126285
  (function () { return resolutionCache.getModuleResolutionCache(); });
126337
126286
  var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
126287
+ var userProvidedHasInvalidatedResolution = ts.maybeBind(host, host.hasInvalidatedResolution) || ts.returnTrue;
126338
126288
  builderProgram = readBuilderProgram(compilerOptions, compilerHost);
126339
126289
  synchronizeProgram();
126340
126290
  // Update the wild card directory watch
@@ -126392,8 +126342,6 @@ var ts;
126392
126342
  }
126393
126343
  function synchronizeProgram() {
126394
126344
  writeLog("Synchronizing program");
126395
- ts.Debug.assert(compilerOptions);
126396
- ts.Debug.assert(rootFileNames);
126397
126345
  clearInvalidateResolutionsOfFailedLookupLocations();
126398
126346
  var program = getCurrentBuilderProgram();
126399
126347
  if (hasChangedCompilerOptions) {
@@ -126403,7 +126351,7 @@ var ts;
126403
126351
  }
126404
126352
  }
126405
126353
  // All resolutions are invalid if user provided resolutions
126406
- var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
126354
+ var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution ? userProvidedHasInvalidatedResolution : undefined);
126407
126355
  var _a = ts.changeCompilerHostLikeToUseCache(compilerHost, toPath), originalReadFile = _a.originalReadFile, originalFileExists = _a.originalFileExists, originalDirectoryExists = _a.originalDirectoryExists, originalCreateDirectory = _a.originalCreateDirectory, originalWriteFile = _a.originalWriteFile;
126408
126356
  if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, function (fileName) { return compilerHost.fileExists(fileName); }, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
126409
126357
  if (hasChangedConfigFileParsingErrors) {
@@ -126642,8 +126590,6 @@ var ts;
126642
126590
  }
126643
126591
  function reloadFileNamesFromConfigFile() {
126644
126592
  writeLog("Reloading new file names and options");
126645
- ts.Debug.assert(compilerOptions);
126646
- ts.Debug.assert(configFileName);
126647
126593
  reloadLevel = ts.ConfigFileProgramReloadLevel.None;
126648
126594
  rootFileNames = ts.getFileNamesFromConfigSpecs(compilerOptions.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost, extraFileExtensions);
126649
126595
  if (ts.updateErrorForNoInputFiles(rootFileNames, ts.getNormalizedAbsolutePath(configFileName, currentDirectory), compilerOptions.configFile.configFileSpecs, configFileParsingDiagnostics, canConfigFileJsonReportNoInputFiles)) {
@@ -126653,7 +126599,6 @@ var ts;
126653
126599
  synchronizeProgram();
126654
126600
  }
126655
126601
  function reloadConfigFile() {
126656
- ts.Debug.assert(configFileName);
126657
126602
  writeLog("Reloading config file: ".concat(configFileName));
126658
126603
  reloadLevel = ts.ConfigFileProgramReloadLevel.None;
126659
126604
  if (cachedDirectoryStructureHost) {
@@ -126668,7 +126613,6 @@ var ts;
126668
126613
  updateExtendedConfigFilesWatches(toPath(configFileName), compilerOptions, watchOptions, ts.WatchType.ExtendedConfigFile);
126669
126614
  }
126670
126615
  function parseConfigFile() {
126671
- ts.Debug.assert(configFileName);
126672
126616
  setConfigFileParsingResult(ts.getParsedCommandLineOfConfigFile(configFileName, optionsToExtendForConfigFile, parseConfigFileHost, extendedConfigCache || (extendedConfigCache = new ts.Map()), watchOptionsToExtend, extraFileExtensions)); // TODO: GH#18217
126673
126617
  }
126674
126618
  function setConfigFileParsingResult(configFileParseResult) {
@@ -126690,7 +126634,6 @@ var ts;
126690
126634
  // With host implementing getParsedCommandLine we cant just update file names
126691
126635
  if (config.parsedCommandLine && config.reloadLevel === ts.ConfigFileProgramReloadLevel.Partial && !host.getParsedCommandLine) {
126692
126636
  writeLog("Reloading new file names and options");
126693
- ts.Debug.assert(compilerOptions);
126694
126637
  var fileNames = ts.getFileNamesFromConfigSpecs(config.parsedCommandLine.options.configFile.configFileSpecs, ts.getNormalizedAbsolutePath(ts.getDirectoryPath(configFileName), currentDirectory), compilerOptions, parseConfigFileHost);
126695
126638
  config.parsedCommandLine = __assign(__assign({}, config.parsedCommandLine), { fileNames: fileNames });
126696
126639
  config.reloadLevel = undefined;
@@ -126777,8 +126720,7 @@ var ts;
126777
126720
  }
126778
126721
  function watchWildcardDirectory(directory, flags) {
126779
126722
  return watchDirectory(directory, function (fileOrDirectory) {
126780
- ts.Debug.assert(configFileName);
126781
- ts.Debug.assert(compilerOptions);
126723
+ ts.Debug.assert(!!configFileName);
126782
126724
  var fileOrDirectoryPath = toPath(fileOrDirectory);
126783
126725
  // Since the file existence changed, update the sourceFiles cache
126784
126726
  if (cachedDirectoryStructureHost) {
@@ -126808,7 +126750,6 @@ var ts;
126808
126750
  }, flags, watchOptions, ts.WatchType.WildcardDirectory);
126809
126751
  }
126810
126752
  function updateExtendedConfigFilesWatches(forProjectPath, options, watchOptions, watchType) {
126811
- ts.Debug.assert(configFileName);
126812
126753
  ts.updateSharedExtendedConfigFileWatcher(forProjectPath, options, sharedExtendedConfigFileWatchers || (sharedExtendedConfigFileWatchers = new ts.Map()), function (extendedConfigFileName, extendedConfigFilePath) { return watchFile(extendedConfigFileName, function (_fileName, eventKind) {
126813
126754
  var _a;
126814
126755
  updateCachedSystemWithFile(extendedConfigFileName, extendedConfigFilePath, eventKind);
@@ -131532,6 +131473,12 @@ var ts;
131532
131473
  }
131533
131474
  ts.getSynthesizedDeepCloneWithReplacements = getSynthesizedDeepCloneWithReplacements;
131534
131475
  function getSynthesizedDeepCloneWorker(node, replaceNode) {
131476
+ var nodeClone = replaceNode
131477
+ ? function (n) { return getSynthesizedDeepCloneWithReplacements(n, /*includeTrivia*/ true, replaceNode); }
131478
+ : getSynthesizedDeepClone;
131479
+ var nodesClone = replaceNode
131480
+ ? function (ns) { return ns && getSynthesizedDeepClonesWithReplacements(ns, /*includeTrivia*/ true, replaceNode); }
131481
+ : function (ns) { return ns && getSynthesizedDeepClones(ns); };
131535
131482
  var visited = ts.visitEachChild(node, nodeClone, ts.nullTransformationContext, nodesClone, nodeClone);
131536
131483
  if (visited === node) {
131537
131484
  // This only happens for leaf nodes - internal nodes always see their children change.
@@ -131545,16 +131492,6 @@ var ts;
131545
131492
  // would have made.
131546
131493
  visited.parent = undefined;
131547
131494
  return visited;
131548
- function nodeClone(node) {
131549
- return replaceNode
131550
- ? getSynthesizedDeepCloneWithReplacements(node, /*includeTrivia*/ true, replaceNode)
131551
- : getSynthesizedDeepClone(node);
131552
- }
131553
- function nodesClone(nodes) {
131554
- return replaceNode
131555
- ? nodes && getSynthesizedDeepClonesWithReplacements(nodes, /*includeTrivia*/ true, replaceNode)
131556
- : nodes && getSynthesizedDeepClones(nodes);
131557
- }
131558
131495
  }
131559
131496
  function getSynthesizedDeepClones(nodes, includeTrivia) {
131560
131497
  if (includeTrivia === void 0) { includeTrivia = true; }
@@ -132294,7 +132231,7 @@ var ts;
132294
132231
  return false;
132295
132232
  }
132296
132233
  // If the file is a module written in TypeScript, it still might be in a `declare global` augmentation
132297
- return ts.isInJSFile(declaration) || !ts.findAncestor(declaration, function (d) { return ts.isModuleDeclaration(d) && ts.isGlobalScopeAugmentation(d); });
132234
+ return ts.isInJSFile(declaration) || !ts.findAncestor(declaration, ts.isGlobalScopeAugmentation);
132298
132235
  }
132299
132236
  ts.isNonGlobalDeclaration = isNonGlobalDeclaration;
132300
132237
  function isDeprecatedDeclaration(decl) {
@@ -134777,7 +134714,7 @@ var ts;
134777
134714
  if (!dependencies)
134778
134715
  continue;
134779
134716
  for (var dep in dependencies) {
134780
- if (dependencies.hasOwnProperty(dep) && !ts.startsWith(dep, "@types/")) {
134717
+ if (ts.hasProperty(dependencies, dep) && !ts.startsWith(dep, "@types/")) {
134781
134718
  result.push(dep);
134782
134719
  }
134783
134720
  }
@@ -135161,7 +135098,7 @@ var ts;
135161
135098
  return (location === null || location === void 0 ? void 0 : location.kind) === 79 /* SyntaxKind.Identifier */ ? ts.createTextSpanFromNode(location) : undefined;
135162
135099
  }
135163
135100
  function completionInfoFromData(sourceFile, host, program, compilerOptions, log, completionData, preferences, formatContext, position) {
135164
- var symbols = completionData.symbols, contextToken = completionData.contextToken, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation, isJsxIdentifierExpected = completionData.isJsxIdentifierExpected, isRightOfOpenTag = completionData.isRightOfOpenTag, importCompletionNode = completionData.importCompletionNode, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap, hasUnresolvedAutoImports = completionData.hasUnresolvedAutoImports;
135101
+ var symbols = completionData.symbols, contextToken = completionData.contextToken, completionKind = completionData.completionKind, isInSnippetScope = completionData.isInSnippetScope, isNewIdentifierLocation = completionData.isNewIdentifierLocation, location = completionData.location, propertyAccessToConvert = completionData.propertyAccessToConvert, keywordFilters = completionData.keywordFilters, literals = completionData.literals, symbolToOriginInfoMap = completionData.symbolToOriginInfoMap, recommendedCompletion = completionData.recommendedCompletion, isJsxInitializer = completionData.isJsxInitializer, isTypeOnlyLocation = completionData.isTypeOnlyLocation, isJsxIdentifierExpected = completionData.isJsxIdentifierExpected, isRightOfOpenTag = completionData.isRightOfOpenTag, importStatementCompletion = completionData.importStatementCompletion, insideJsDocTagTypeExpression = completionData.insideJsDocTagTypeExpression, symbolToSortTextMap = completionData.symbolToSortTextMap, hasUnresolvedAutoImports = completionData.hasUnresolvedAutoImports;
135165
135102
  // Verify if the file is JSX language variant
135166
135103
  if (ts.getLanguageVariant(sourceFile.scriptKind) === 1 /* LanguageVariant.JSX */) {
135167
135104
  var completionInfo = getJsxClosingTagCompletion(location, sourceFile);
@@ -135175,7 +135112,7 @@ var ts;
135175
135112
  return undefined;
135176
135113
  }
135177
135114
  var uniqueNames = getCompletionEntriesFromSymbols(symbols, entries,
135178
- /*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag);
135115
+ /*replacementToken*/ undefined, contextToken, location, sourceFile, host, program, ts.getEmitScriptTarget(compilerOptions), log, completionKind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, isJsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag);
135179
135116
  if (keywordFilters !== 0 /* KeywordCompletionFilters.None */) {
135180
135117
  for (var _i = 0, _a = getKeywordCompletions(keywordFilters, !insideJsDocTagTypeExpression && ts.isSourceFileJS(sourceFile)); _i < _a.length; _i++) {
135181
135118
  var keywordEntry = _a[_i];
@@ -135293,7 +135230,7 @@ var ts;
135293
135230
  function createCompletionEntryForLiteral(sourceFile, preferences, literal) {
135294
135231
  return { name: completionNameForLiteral(sourceFile, preferences, literal), kind: "string" /* ScriptElementKind.string */, kindModifiers: "" /* ScriptElementKindModifier.none */, sortText: Completions.SortText.LocationPriority };
135295
135232
  }
135296
- function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) {
135233
+ function createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, options, preferences, completionKind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag) {
135297
135234
  var _a, _b;
135298
135235
  var insertText;
135299
135236
  var replacementSpan = ts.getReplacementSpanForContextToken(replacementToken);
@@ -135349,8 +135286,8 @@ var ts;
135349
135286
  }
135350
135287
  if (originIsResolvedExport(origin)) {
135351
135288
  sourceDisplay = [ts.textPart(origin.moduleSpecifier)];
135352
- if (importCompletionNode) {
135353
- (_a = getInsertTextAndReplacementSpanForImportCompletion(name, importCompletionNode, contextToken, origin, useSemicolons, options, preferences), insertText = _a.insertText, replacementSpan = _a.replacementSpan);
135289
+ if (importStatementCompletion) {
135290
+ (_a = getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences), insertText = _a.insertText, replacementSpan = _a.replacementSpan);
135354
135291
  isSnippet = preferences.includeCompletionsWithSnippetText ? true : undefined;
135355
135292
  }
135356
135293
  }
@@ -135405,7 +135342,7 @@ var ts;
135405
135342
  }
135406
135343
  if (originIsExport(origin) || originIsResolvedExport(origin)) {
135407
135344
  data = originToCompletionEntryData(origin);
135408
- hasAction = !importCompletionNode;
135345
+ hasAction = !importStatementCompletion;
135409
135346
  }
135410
135347
  // TODO(drosen): Right now we just permit *all* semantic meanings when calling
135411
135348
  // 'getSymbolKind' which is permissible given that it is backwards compatible; but
@@ -135428,7 +135365,7 @@ var ts;
135428
135365
  labelDetails: labelDetails,
135429
135366
  isSnippet: isSnippet,
135430
135367
  isPackageJsonImport: originIsPackageJsonImport(origin) || undefined,
135431
- isImportStatementCompletion: !!importCompletionNode || undefined,
135368
+ isImportStatementCompletion: !!importStatementCompletion || undefined,
135432
135369
  data: data,
135433
135370
  };
135434
135371
  }
@@ -135630,7 +135567,6 @@ var ts;
135630
135567
  var labelDetails = { detail: signaturePrinter.printNode(4 /* EmitHint.Unspecified */, methodSignature, sourceFile) };
135631
135568
  return { isSnippet: isSnippet, insertText: insertText, labelDetails: labelDetails };
135632
135569
  }
135633
- ;
135634
135570
  function createObjectLiteralMethod(symbol, enclosingDeclaration, sourceFile, program, host, preferences) {
135635
135571
  var declarations = symbol.getDeclarations();
135636
135572
  if (!(declarations && declarations.length)) {
@@ -135801,19 +135737,16 @@ var ts;
135801
135737
  };
135802
135738
  return unresolvedOrigin;
135803
135739
  }
135804
- function getInsertTextAndReplacementSpanForImportCompletion(name, importCompletionNode, contextToken, origin, useSemicolons, options, preferences) {
135805
- var _a, _b, _c;
135806
- var sourceFile = importCompletionNode.getSourceFile();
135807
- var replacementSpan = ts.createTextSpanFromNode(ts.findAncestor(importCompletionNode, ts.or(ts.isImportDeclaration, ts.isImportEqualsDeclaration)) || importCompletionNode, sourceFile);
135740
+ function getInsertTextAndReplacementSpanForImportCompletion(name, importStatementCompletion, origin, useSemicolons, sourceFile, options, preferences) {
135741
+ var replacementSpan = importStatementCompletion.replacementSpan;
135808
135742
  var quotedModuleSpecifier = ts.quote(sourceFile, preferences, origin.moduleSpecifier);
135809
135743
  var exportKind = origin.isDefaultExport ? 1 /* ExportKind.Default */ :
135810
135744
  origin.exportName === "export=" /* InternalSymbolName.ExportEquals */ ? 2 /* ExportKind.ExportEquals */ :
135811
135745
  0 /* ExportKind.Named */;
135812
135746
  var tabStop = preferences.includeCompletionsWithSnippetText ? "$1" : "";
135813
135747
  var importKind = ts.codefix.getImportKind(sourceFile, exportKind, options, /*forceImportKeyword*/ true);
135814
- var isTopLevelTypeOnly = ((_b = (_a = ts.tryCast(importCompletionNode, ts.isImportDeclaration)) === null || _a === void 0 ? void 0 : _a.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || ((_c = ts.tryCast(importCompletionNode, ts.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly);
135815
- var isImportSpecifierTypeOnly = couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
135816
- var topLevelTypeOnlyText = isTopLevelTypeOnly ? " ".concat(ts.tokenToString(154 /* SyntaxKind.TypeKeyword */), " ") : " ";
135748
+ var isImportSpecifierTypeOnly = importStatementCompletion.couldBeTypeOnlyImportSpecifier;
135749
+ var topLevelTypeOnlyText = importStatementCompletion.isTopLevelTypeOnly ? " ".concat(ts.tokenToString(154 /* SyntaxKind.TypeKeyword */), " ") : " ";
135817
135750
  var importSpecifierTypeOnlyText = isImportSpecifierTypeOnly ? "".concat(ts.tokenToString(154 /* SyntaxKind.TypeKeyword */), " ") : "";
135818
135751
  var suffix = useSemicolons ? ";" : "";
135819
135752
  switch (importKind) {
@@ -135847,7 +135780,7 @@ var ts;
135847
135780
  return CompletionSource.TypeOnlyAlias;
135848
135781
  }
135849
135782
  }
135850
- function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importCompletionNode, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) {
135783
+ function getCompletionEntriesFromSymbols(symbols, entries, replacementToken, contextToken, location, sourceFile, host, program, target, log, kind, preferences, compilerOptions, formatContext, isTypeOnlyLocation, propertyAccessToConvert, jsxIdentifierExpected, isJsxInitializer, importStatementCompletion, recommendedCompletion, symbolToOriginInfoMap, symbolToSortTextMap, isJsxIdentifierExpected, isRightOfOpenTag) {
135851
135784
  var _a;
135852
135785
  var start = ts.timestamp();
135853
135786
  var variableDeclaration = getVariableDeclaration(location);
@@ -135868,7 +135801,7 @@ var ts;
135868
135801
  var name = info.name, needsConvertPropertyAccess = info.needsConvertPropertyAccess;
135869
135802
  var originalSortText = (_a = symbolToSortTextMap === null || symbolToSortTextMap === void 0 ? void 0 : symbolToSortTextMap[ts.getSymbolId(symbol)]) !== null && _a !== void 0 ? _a : Completions.SortText.LocationPriority;
135870
135803
  var sortText = (isDeprecated(symbol, typeChecker) ? Completions.SortText.Deprecated(originalSortText) : originalSortText);
135871
- var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importCompletionNode, useSemicolons, compilerOptions, preferences, kind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag);
135804
+ var entry = createCompletionEntry(symbol, sortText, replacementToken, contextToken, location, sourceFile, host, program, name, needsConvertPropertyAccess, origin, recommendedCompletion, propertyAccessToConvert, isJsxInitializer, importStatementCompletion, useSemicolons, compilerOptions, preferences, kind, formatContext, isJsxIdentifierExpected, isRightOfOpenTag);
135872
135805
  if (!entry) {
135873
135806
  continue;
135874
135807
  }
@@ -136059,7 +135992,7 @@ var ts;
136059
135992
  Completions.createCompletionDetails = createCompletionDetails;
136060
135993
  function getCompletionEntryCodeActionsAndSourceDisplay(name, location, contextToken, origin, symbol, program, host, compilerOptions, sourceFile, position, previousToken, formatContext, preferences, data, source, cancellationToken) {
136061
135994
  if (data === null || data === void 0 ? void 0 : data.moduleSpecifier) {
136062
- if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementNode) {
135995
+ if (previousToken && getImportStatementCompletionInfo(contextToken || previousToken).replacementSpan) {
136063
135996
  // Import statement completion: 'import c|'
136064
135997
  return { codeActions: undefined, sourceDisplay: [ts.textPart(data.moduleSpecifier)] };
136065
135998
  }
@@ -136260,34 +136193,34 @@ var ts;
136260
136193
  var isStartingCloseTag = false;
136261
136194
  var isJsxInitializer = false;
136262
136195
  var isJsxIdentifierExpected = false;
136263
- var importCompletionNode;
136196
+ var importStatementCompletion;
136264
136197
  var location = ts.getTouchingPropertyName(sourceFile, position);
136265
136198
  var keywordFilters = 0 /* KeywordCompletionFilters.None */;
136266
136199
  var isNewIdentifierLocation = false;
136267
136200
  var flags = 0 /* CompletionInfoFlags.None */;
136268
136201
  if (contextToken) {
136269
- var importStatementCompletion = getImportStatementCompletionInfo(contextToken);
136270
- isNewIdentifierLocation = importStatementCompletion.isNewIdentifierLocation;
136271
- if (importStatementCompletion.keywordCompletion) {
136272
- if (importStatementCompletion.isKeywordOnlyCompletion) {
136202
+ var importStatementCompletionInfo = getImportStatementCompletionInfo(contextToken);
136203
+ if (importStatementCompletionInfo.keywordCompletion) {
136204
+ if (importStatementCompletionInfo.isKeywordOnlyCompletion) {
136273
136205
  return {
136274
136206
  kind: 4 /* CompletionDataKind.Keywords */,
136275
- keywordCompletions: [keywordToCompletionEntry(importStatementCompletion.keywordCompletion)],
136276
- isNewIdentifierLocation: isNewIdentifierLocation,
136207
+ keywordCompletions: [keywordToCompletionEntry(importStatementCompletionInfo.keywordCompletion)],
136208
+ isNewIdentifierLocation: importStatementCompletionInfo.isNewIdentifierLocation,
136277
136209
  };
136278
136210
  }
136279
- keywordFilters = keywordFiltersFromSyntaxKind(importStatementCompletion.keywordCompletion);
136211
+ keywordFilters = keywordFiltersFromSyntaxKind(importStatementCompletionInfo.keywordCompletion);
136280
136212
  }
136281
- if (importStatementCompletion.replacementNode && preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) {
136213
+ if (importStatementCompletionInfo.replacementSpan && preferences.includeCompletionsForImportStatements && preferences.includeCompletionsWithInsertText) {
136282
136214
  // Import statement completions use `insertText`, and also require the `data` property of `CompletionEntryIdentifier`
136283
136215
  // added in TypeScript 4.3 to be sent back from the client during `getCompletionEntryDetails`. Since this feature
136284
136216
  // is not backward compatible with older clients, the language service defaults to disabling it, allowing newer clients
136285
136217
  // to opt in with the `includeCompletionsForImportStatements` user preference.
136286
- importCompletionNode = importStatementCompletion.replacementNode;
136287
136218
  flags |= 2 /* CompletionInfoFlags.IsImportStatementCompletion */;
136219
+ importStatementCompletion = importStatementCompletionInfo;
136220
+ isNewIdentifierLocation = importStatementCompletionInfo.isNewIdentifierLocation;
136288
136221
  }
136289
136222
  // Bail out if this is a known invalid completion location
136290
- if (!importCompletionNode && isCompletionListBlocker(contextToken)) {
136223
+ if (!importStatementCompletionInfo.replacementSpan && isCompletionListBlocker(contextToken)) {
136291
136224
  log("Returning an empty list because completion was requested in an invalid position.");
136292
136225
  return keywordFilters
136293
136226
  ? keywordCompletionData(keywordFilters, isJsOnlyLocation, isNewIdentifierDefinitionLocation())
@@ -136333,7 +136266,7 @@ var ts;
136333
136266
  return undefined;
136334
136267
  }
136335
136268
  }
136336
- else if (!importCompletionNode && sourceFile.languageVariant === 1 /* LanguageVariant.JSX */) {
136269
+ else if (!importStatementCompletion) {
136337
136270
  // <UI.Test /* completion position */ />
136338
136271
  // If the tagname is a property access expression, we will then walk up to the top most of property access expression.
136339
136272
  // Then, try to get a JSX container and its associated attributes type.
@@ -136476,7 +136409,7 @@ var ts;
136476
136409
  isTypeOnlyLocation: isTypeOnlyLocation,
136477
136410
  isJsxIdentifierExpected: isJsxIdentifierExpected,
136478
136411
  isRightOfOpenTag: isRightOfOpenTag,
136479
- importCompletionNode: importCompletionNode,
136412
+ importStatementCompletion: importStatementCompletion,
136480
136413
  hasUnresolvedAutoImports: hasUnresolvedAutoImports,
136481
136414
  flags: flags,
136482
136415
  };
@@ -136730,7 +136663,7 @@ var ts;
136730
136663
  return 1 /* GlobalsSearch.Success */;
136731
136664
  }
136732
136665
  function tryGetImportCompletionSymbols() {
136733
- if (!importCompletionNode)
136666
+ if (!importStatementCompletion)
136734
136667
  return 0 /* GlobalsSearch.Continue */;
136735
136668
  isNewIdentifierLocation = true;
136736
136669
  collectAutoImports();
@@ -136813,7 +136746,7 @@ var ts;
136813
136746
  }
136814
136747
  function shouldOfferImportCompletions() {
136815
136748
  // If already typing an import statement, provide completions for it.
136816
- if (importCompletionNode)
136749
+ if (importStatementCompletion)
136817
136750
  return true;
136818
136751
  // If current completion is for non-contextual Object literal shortahands, ignore auto-import symbols
136819
136752
  if (isNonContextualObjectLiteral)
@@ -136843,7 +136776,7 @@ var ts;
136843
136776
  }
136844
136777
  function isTypeOnlyCompletion() {
136845
136778
  return insideJsDocTagTypeExpression
136846
- || !!importCompletionNode && ts.isTypeOnlyImportOrExportDeclaration(location.parent)
136779
+ || !!importStatementCompletion && ts.isTypeOnlyImportOrExportDeclaration(location.parent)
136847
136780
  || !isContextTokenValueLocation(contextToken) &&
136848
136781
  (ts.isPossiblyTypeArgumentPosition(contextToken, sourceFile, typeChecker)
136849
136782
  || ts.isPartOfTypeNode(location)
@@ -136893,8 +136826,7 @@ var ts;
136893
136826
  flags |= 1 /* CompletionInfoFlags.MayIncludeAutoImports */;
136894
136827
  // import { type | -> token text should be blank
136895
136828
  var isAfterTypeOnlyImportSpecifierModifier = previousToken === contextToken
136896
- && importCompletionNode
136897
- && couldBeTypeOnlyImportSpecifier(importCompletionNode, contextToken);
136829
+ && importStatementCompletion;
136898
136830
  var lowerCaseTokenText = isAfterTypeOnlyImportSpecifierModifier ? "" :
136899
136831
  previousToken && ts.isIdentifier(previousToken) ? previousToken.text.toLowerCase() :
136900
136832
  "";
@@ -136902,14 +136834,14 @@ var ts;
136902
136834
  var exportInfo = ts.getExportInfoMap(sourceFile, host, program, preferences, cancellationToken);
136903
136835
  var packageJsonAutoImportProvider = (_b = host.getPackageJsonAutoImportProvider) === null || _b === void 0 ? void 0 : _b.call(host);
136904
136836
  var packageJsonFilter = detailsEntryId ? undefined : ts.createPackageJsonImportFilter(sourceFile, preferences, host);
136905
- resolvingModuleSpecifiers("collectAutoImports", host, importSpecifierResolver || (importSpecifierResolver = ts.codefix.createImportSpecifierResolver(sourceFile, program, host, preferences)), program, position, preferences, !!importCompletionNode, ts.isValidTypeOnlyAliasUseSite(location), function (context) {
136837
+ resolvingModuleSpecifiers("collectAutoImports", host, importSpecifierResolver || (importSpecifierResolver = ts.codefix.createImportSpecifierResolver(sourceFile, program, host, preferences)), program, position, preferences, !!importStatementCompletion, ts.isValidTypeOnlyAliasUseSite(location), function (context) {
136906
136838
  exportInfo.search(sourceFile.path,
136907
136839
  /*preferCapitalized*/ isRightOfOpenTag, function (symbolName, targetFlags) {
136908
136840
  if (!ts.isIdentifierText(symbolName, ts.getEmitScriptTarget(host.getCompilationSettings())))
136909
136841
  return false;
136910
136842
  if (!detailsEntryId && ts.isStringANonContextualKeyword(symbolName))
136911
136843
  return false;
136912
- if (!isTypeOnlyLocation && !importCompletionNode && !(targetFlags & 111551 /* SymbolFlags.Value */))
136844
+ if (!isTypeOnlyLocation && !importStatementCompletion && !(targetFlags & 111551 /* SymbolFlags.Value */))
136913
136845
  return false;
136914
136846
  if (isTypeOnlyLocation && !(targetFlags & (1536 /* SymbolFlags.Module */ | 788968 /* SymbolFlags.Type */)))
136915
136847
  return false;
@@ -136990,7 +136922,7 @@ var ts;
136990
136922
  return;
136991
136923
  }
136992
136924
  symbolToOriginInfoMap[symbols.length] = origin;
136993
- symbolToSortTextMap[symbolId] = importCompletionNode ? Completions.SortText.LocationPriority : Completions.SortText.AutoImportSuggestions;
136925
+ symbolToSortTextMap[symbolId] = importStatementCompletion ? Completions.SortText.LocationPriority : Completions.SortText.AutoImportSuggestions;
136994
136926
  symbols.push(symbol);
136995
136927
  }
136996
136928
  /* Mutates `symbols` and `symbolToOriginInfoMap`. */
@@ -138257,6 +138189,7 @@ var ts;
138257
138189
  return undefined;
138258
138190
  }
138259
138191
  function getImportStatementCompletionInfo(contextToken) {
138192
+ var _a, _b, _c;
138260
138193
  var keywordCompletion;
138261
138194
  var isKeywordOnlyCompletion = false;
138262
138195
  var candidate = getCandidate();
@@ -138264,9 +138197,9 @@ var ts;
138264
138197
  isKeywordOnlyCompletion: isKeywordOnlyCompletion,
138265
138198
  keywordCompletion: keywordCompletion,
138266
138199
  isNewIdentifierLocation: !!(candidate || keywordCompletion === 154 /* SyntaxKind.TypeKeyword */),
138267
- replacementNode: candidate && ts.rangeIsOnSingleLine(candidate, candidate.getSourceFile())
138268
- ? candidate
138269
- : undefined
138200
+ isTopLevelTypeOnly: !!((_b = (_a = ts.tryCast(candidate, ts.isImportDeclaration)) === null || _a === void 0 ? void 0 : _a.importClause) === null || _b === void 0 ? void 0 : _b.isTypeOnly) || !!((_c = ts.tryCast(candidate, ts.isImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.isTypeOnly),
138201
+ couldBeTypeOnlyImportSpecifier: !!candidate && couldBeTypeOnlyImportSpecifier(candidate, contextToken),
138202
+ replacementSpan: getSingleLineReplacementSpanForImportCompletionNode(candidate),
138270
138203
  };
138271
138204
  function getCandidate() {
138272
138205
  var parent = contextToken.parent;
@@ -138308,14 +138241,71 @@ var ts;
138308
138241
  return undefined;
138309
138242
  }
138310
138243
  }
138244
+ function getSingleLineReplacementSpanForImportCompletionNode(node) {
138245
+ var _a, _b, _c;
138246
+ if (!node)
138247
+ return undefined;
138248
+ var top = (_a = ts.findAncestor(node, ts.or(ts.isImportDeclaration, ts.isImportEqualsDeclaration))) !== null && _a !== void 0 ? _a : node;
138249
+ var sourceFile = top.getSourceFile();
138250
+ if (ts.rangeIsOnSingleLine(top, sourceFile)) {
138251
+ return ts.createTextSpanFromNode(top, sourceFile);
138252
+ }
138253
+ // ImportKeyword was necessarily on one line; ImportSpecifier was necessarily parented in an ImportDeclaration
138254
+ ts.Debug.assert(top.kind !== 100 /* SyntaxKind.ImportKeyword */ && top.kind !== 273 /* SyntaxKind.ImportSpecifier */);
138255
+ // Guess which point in the import might actually be a later statement parsed as part of the import
138256
+ // during parser recovery - either in the middle of named imports, or the module specifier.
138257
+ var potentialSplitPoint = top.kind === 269 /* SyntaxKind.ImportDeclaration */
138258
+ ? (_c = getPotentiallyInvalidImportSpecifier((_b = top.importClause) === null || _b === void 0 ? void 0 : _b.namedBindings)) !== null && _c !== void 0 ? _c : top.moduleSpecifier
138259
+ : top.moduleReference;
138260
+ var withoutModuleSpecifier = {
138261
+ pos: top.getFirstToken().getStart(),
138262
+ end: potentialSplitPoint.pos,
138263
+ };
138264
+ // The module specifier/reference was previously found to be missing, empty, or
138265
+ // not a string literal - in this last case, it's likely that statement on a following
138266
+ // line was parsed as the module specifier of a partially-typed import, e.g.
138267
+ // import Foo|
138268
+ // interface Blah {}
138269
+ // This appears to be a multiline-import, and editors can't replace multiple lines.
138270
+ // But if everything but the "module specifier" is on one line, by this point we can
138271
+ // assume that the "module specifier" is actually just another statement, and return
138272
+ // the single-line range of the import excluding that probable statement.
138273
+ if (ts.rangeIsOnSingleLine(withoutModuleSpecifier, sourceFile)) {
138274
+ return ts.createTextSpanFromRange(withoutModuleSpecifier);
138275
+ }
138276
+ }
138277
+ // Tries to identify the first named import that is not really a named import, but rather
138278
+ // just parser recovery for a situation like:
138279
+ // import { Foo|
138280
+ // interface Bar {}
138281
+ // in which `Foo`, `interface`, and `Bar` are all parsed as import specifiers. The caller
138282
+ // will also check if this token is on a separate line from the rest of the import.
138283
+ function getPotentiallyInvalidImportSpecifier(namedBindings) {
138284
+ var _a;
138285
+ return ts.find((_a = ts.tryCast(namedBindings, ts.isNamedImports)) === null || _a === void 0 ? void 0 : _a.elements, function (e) {
138286
+ var _a;
138287
+ return !e.propertyName &&
138288
+ ts.isStringANonContextualKeyword(e.name.text) &&
138289
+ ((_a = ts.findPrecedingToken(e.name.pos, namedBindings.getSourceFile(), namedBindings)) === null || _a === void 0 ? void 0 : _a.kind) !== 27 /* SyntaxKind.CommaToken */;
138290
+ });
138291
+ }
138311
138292
  function couldBeTypeOnlyImportSpecifier(importSpecifier, contextToken) {
138312
138293
  return ts.isImportSpecifier(importSpecifier)
138313
138294
  && (importSpecifier.isTypeOnly || contextToken === importSpecifier.name && ts.isTypeKeywordTokenOrIdentifier(contextToken));
138314
138295
  }
138315
138296
  function canCompleteFromNamedBindings(namedBindings) {
138316
- return isModuleSpecifierMissingOrEmpty(namedBindings.parent.parent.moduleSpecifier)
138317
- && (ts.isNamespaceImport(namedBindings) || namedBindings.elements.length < 2)
138318
- && !namedBindings.parent.name;
138297
+ if (!isModuleSpecifierMissingOrEmpty(namedBindings.parent.parent.moduleSpecifier) || namedBindings.parent.name) {
138298
+ return false;
138299
+ }
138300
+ if (ts.isNamedImports(namedBindings)) {
138301
+ // We can only complete on named imports if there are no other named imports already,
138302
+ // but parser recovery sometimes puts later statements in the named imports list, so
138303
+ // we try to only consider the probably-valid ones.
138304
+ var invalidNamedImport = getPotentiallyInvalidImportSpecifier(namedBindings);
138305
+ var validImports = invalidNamedImport ? namedBindings.elements.indexOf(invalidNamedImport) : namedBindings.elements.length;
138306
+ return validImports < 2;
138307
+ }
138308
+ return true;
138319
138309
  }
138320
138310
  function isModuleSpecifierMissingOrEmpty(specifier) {
138321
138311
  var _a;
@@ -138334,7 +138324,6 @@ var ts;
138334
138324
  function isArrowFunctionBody(node) {
138335
138325
  return node.parent && ts.isArrowFunction(node.parent) && node.parent.body === node;
138336
138326
  }
138337
- ;
138338
138327
  /** True if symbol is a type or a module containing at least one type. */
138339
138328
  function symbolCanBeReferencedAtTypeLocation(symbol, checker, seenModules) {
138340
138329
  if (seenModules === void 0) { seenModules = new ts.Map(); }
@@ -138618,7 +138607,7 @@ var ts;
138618
138607
  // If we're an accessibility modifier, we're in an instance member and should search
138619
138608
  // the constructor's parameter list for instance members as well.
138620
138609
  if (modifierFlag & (28 /* ModifierFlags.AccessibilityModifier */ | 64 /* ModifierFlags.Readonly */)) {
138621
- var constructor = ts.find(container.members, ts.isConstructorDeclaration); // TODO(jakebailey): GH#49924 ???
138610
+ var constructor = ts.find(container.members, ts.isConstructorDeclaration);
138622
138611
  if (constructor) {
138623
138612
  return __spreadArray(__spreadArray([], nodes, true), constructor.parameters, true);
138624
138613
  }
@@ -146351,6 +146340,10 @@ var ts;
146351
146340
  pushSelectionCommentRange(comment.pos, comment.end);
146352
146341
  }
146353
146342
  if (positionShouldSnapToNode(sourceFile, pos, node)) {
146343
+ if (ts.isFunctionBody(node)
146344
+ && ts.isFunctionLikeDeclaration(parentNode) && !ts.positionsAreOnSameLine(node.getStart(sourceFile), node.getEnd(), sourceFile)) {
146345
+ pushSelectionRange(node.getStart(sourceFile), node.getEnd());
146346
+ }
146354
146347
  // 1. Blocks are effectively redundant with SyntaxLists.
146355
146348
  // 2. TemplateSpans, along with the SyntaxLists containing them, are a somewhat unintuitive grouping
146356
146349
  // of things that should be considered independently.
@@ -147502,7 +147495,7 @@ var ts;
147502
147495
  return name === "undefined";
147503
147496
  }
147504
147497
  function isHintableDeclaration(node) {
147505
- if ((ts.isParameter(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node)) && node.initializer) {
147498
+ if ((ts.isParameterDeclaration(node) || ts.isVariableDeclaration(node) && ts.isVarConst(node)) && node.initializer) {
147506
147499
  var initializer = ts.skipParentheses(node.initializer);
147507
147500
  return !(isHintableLiteral(initializer) || ts.isNewExpression(initializer) || ts.isObjectLiteralExpression(initializer) || ts.isAssertionExpression(initializer));
147508
147501
  }
@@ -149415,19 +149408,19 @@ var ts;
149415
149408
  return function (context) { return context.options && context.options[optionName] === optionValue; };
149416
149409
  }
149417
149410
  function isOptionEnabled(optionName) {
149418
- return function (context) { return context.options && context.options.hasOwnProperty(optionName) && !!context.options[optionName]; };
149411
+ return function (context) { return context.options && ts.hasProperty(context.options, optionName) && !!context.options[optionName]; };
149419
149412
  }
149420
149413
  function isOptionDisabled(optionName) {
149421
- return function (context) { return context.options && context.options.hasOwnProperty(optionName) && !context.options[optionName]; };
149414
+ return function (context) { return context.options && ts.hasProperty(context.options, optionName) && !context.options[optionName]; };
149422
149415
  }
149423
149416
  function isOptionDisabledOrUndefined(optionName) {
149424
- return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !context.options[optionName]; };
149417
+ return function (context) { return !context.options || !ts.hasProperty(context.options, optionName) || !context.options[optionName]; };
149425
149418
  }
149426
149419
  function isOptionDisabledOrUndefinedOrTokensOnSameLine(optionName) {
149427
- return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !context.options[optionName] || context.TokensAreOnSameLine(); };
149420
+ return function (context) { return !context.options || !ts.hasProperty(context.options, optionName) || !context.options[optionName] || context.TokensAreOnSameLine(); };
149428
149421
  }
149429
149422
  function isOptionEnabledOrUndefined(optionName) {
149430
- return function (context) { return !context.options || !context.options.hasOwnProperty(optionName) || !!context.options[optionName]; };
149423
+ return function (context) { return !context.options || !ts.hasProperty(context.options, optionName) || !!context.options[optionName]; };
149431
149424
  }
149432
149425
  function isForContext(context) {
149433
149426
  return context.contextNode.kind === 245 /* SyntaxKind.ForStatement */;
@@ -152743,7 +152736,6 @@ var ts;
152743
152736
  if (!visited) {
152744
152737
  return visited;
152745
152738
  }
152746
- ts.Debug.assert(nodes);
152747
152739
  // clone nodearray if necessary
152748
152740
  var nodeArray = visited === nodes ? ts.factory.createNodeArray(visited.slice(0)) : visited;
152749
152741
  ts.setTextRangePosEnd(nodeArray, getPos(nodes), getEnd(nodes));
@@ -154032,31 +154024,22 @@ var ts;
154032
154024
  var param = _a[_i];
154033
154025
  if (!param.type) {
154034
154026
  var paramType = ts.getJSDocType(param);
154035
- if (paramType) {
154036
- var transformedType = transformJSDocType(paramType);
154037
- ts.Debug.assertNode(transformedType, ts.isTypeNode);
154038
- changes.tryInsertTypeAnnotation(sourceFile, param, transformedType);
154039
- }
154027
+ if (paramType)
154028
+ changes.tryInsertTypeAnnotation(sourceFile, param, transformJSDocType(paramType));
154040
154029
  }
154041
154030
  }
154042
154031
  if (needParens)
154043
154032
  changes.insertNodeAfter(sourceFile, ts.last(decl.parameters), ts.factory.createToken(21 /* SyntaxKind.CloseParenToken */));
154044
154033
  if (!decl.type) {
154045
154034
  var returnType = ts.getJSDocReturnType(decl);
154046
- if (returnType) {
154047
- var transformedType = transformJSDocType(returnType);
154048
- ts.Debug.assertNode(transformedType, ts.isTypeNode);
154049
- changes.tryInsertTypeAnnotation(sourceFile, decl, transformedType);
154050
- }
154051
- ;
154035
+ if (returnType)
154036
+ changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(returnType));
154052
154037
  }
154053
154038
  }
154054
154039
  else {
154055
154040
  var jsdocType = ts.Debug.checkDefined(ts.getJSDocType(decl), "A JSDocType for this declaration should exist"); // If not defined, shouldn't have been an error to fix
154056
154041
  ts.Debug.assert(!decl.type, "The JSDocType decl should have a type"); // If defined, shouldn't have been an error to fix.
154057
- var transformedType = transformJSDocType(jsdocType);
154058
- ts.Debug.assertNode(transformedType, ts.isTypeNode);
154059
- changes.tryInsertTypeAnnotation(sourceFile, decl, transformedType);
154042
+ changes.tryInsertTypeAnnotation(sourceFile, decl, transformJSDocType(jsdocType));
154060
154043
  }
154061
154044
  }
154062
154045
  function isDeclarationWithType(node) {
@@ -157059,7 +157042,7 @@ var ts;
157059
157042
  var related = ts.find(diag.relatedInformation, function (related) { return related.code === ts.Diagnostics.This_type_parameter_might_need_an_extends_0_constraint.code; });
157060
157043
  if (related === undefined || related.file === undefined || related.start === undefined || related.length === undefined)
157061
157044
  return;
157062
- var declaration = findAncestorMatchingSpan(related.file, ts.createTextSpan(related.start, related.length));
157045
+ var declaration = codefix.findAncestorMatchingSpan(related.file, ts.createTextSpan(related.start, related.length));
157063
157046
  if (declaration === undefined)
157064
157047
  return;
157065
157048
  if (ts.isIdentifier(declaration) && ts.isTypeParameterDeclaration(declaration.parent)) {
@@ -157093,14 +157076,6 @@ var ts;
157093
157076
  }
157094
157077
  }
157095
157078
  }
157096
- function findAncestorMatchingSpan(sourceFile, span) {
157097
- var end = ts.textSpanEnd(span);
157098
- var token = ts.getTokenAtPosition(sourceFile, span.start);
157099
- while (token.end < end) {
157100
- token = token.parent;
157101
- }
157102
- return token;
157103
- }
157104
157079
  function tryGetConstraintFromDiagnosticMessage(messageText) {
157105
157080
  var _a = ts.flattenDiagnosticMessageText(messageText, "\n", 0).match(/`extends (.*)`/) || [], _ = _a[0], constraint = _a[1];
157106
157081
  return constraint;
@@ -157981,7 +157956,7 @@ var ts;
157981
157956
  return { kind: InfoKind.TypeLikeDeclaration, token: token, call: call, modifierFlags: modifierFlags, parentDeclaration: declaration, declSourceFile: declSourceFile, isJSFile: isJSFile };
157982
157957
  }
157983
157958
  var enumDeclaration = ts.find(symbol.declarations, ts.isEnumDeclaration);
157984
- if (enumDeclaration && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
157959
+ if (enumDeclaration && !(leftExpressionType.flags & 1056 /* TypeFlags.EnumLike */) && !ts.isPrivateIdentifier(token) && !isSourceFileFromLibrary(program, enumDeclaration.getSourceFile())) {
157985
157960
  return { kind: InfoKind.Enum, token: token, parentDeclaration: enumDeclaration };
157986
157961
  }
157987
157962
  return undefined;
@@ -158646,6 +158621,63 @@ var ts;
158646
158621
  })(ts || (ts = {}));
158647
158622
  /* @internal */
158648
158623
  var ts;
158624
+ (function (ts) {
158625
+ var codefix;
158626
+ (function (codefix) {
158627
+ var fixId = "fixNaNEquality";
158628
+ var errorCodes = [
158629
+ ts.Diagnostics.This_condition_will_always_return_0.code,
158630
+ ];
158631
+ codefix.registerCodeFix({
158632
+ errorCodes: errorCodes,
158633
+ getCodeActions: function (context) {
158634
+ var sourceFile = context.sourceFile, span = context.span, program = context.program;
158635
+ var info = getInfo(program, sourceFile, span);
158636
+ if (info === undefined)
158637
+ return;
158638
+ var suggestion = info.suggestion, expression = info.expression, arg = info.arg;
158639
+ var changes = ts.textChanges.ChangeTracker.with(context, function (t) { return doChange(t, sourceFile, arg, expression); });
158640
+ return [codefix.createCodeFixAction(fixId, changes, [ts.Diagnostics.Use_0, suggestion], fixId, ts.Diagnostics.Use_Number_isNaN_in_all_conditions)];
158641
+ },
158642
+ fixIds: [fixId],
158643
+ getAllCodeActions: function (context) {
158644
+ return codefix.codeFixAll(context, errorCodes, function (changes, diag) {
158645
+ var info = getInfo(context.program, diag.file, ts.createTextSpan(diag.start, diag.length));
158646
+ if (info) {
158647
+ doChange(changes, diag.file, info.arg, info.expression);
158648
+ }
158649
+ });
158650
+ }
158651
+ });
158652
+ function getInfo(program, sourceFile, span) {
158653
+ var diag = ts.find(program.getSemanticDiagnostics(sourceFile), function (diag) { return diag.start === span.start && diag.length === span.length; });
158654
+ if (diag === undefined || diag.relatedInformation === undefined)
158655
+ return;
158656
+ var related = ts.find(diag.relatedInformation, function (related) { return related.code === ts.Diagnostics.Did_you_mean_0.code; });
158657
+ if (related === undefined || related.file === undefined || related.start === undefined || related.length === undefined)
158658
+ return;
158659
+ var token = codefix.findAncestorMatchingSpan(related.file, ts.createTextSpan(related.start, related.length));
158660
+ if (token === undefined)
158661
+ return;
158662
+ if (ts.isExpression(token) && ts.isBinaryExpression(token.parent)) {
158663
+ return { suggestion: getSuggestion(related.messageText), expression: token.parent, arg: token };
158664
+ }
158665
+ return undefined;
158666
+ }
158667
+ function doChange(changes, sourceFile, arg, expression) {
158668
+ var callExpression = ts.factory.createCallExpression(ts.factory.createPropertyAccessExpression(ts.factory.createIdentifier("Number"), ts.factory.createIdentifier("isNaN")), /*typeArguments*/ undefined, [arg]);
158669
+ var operator = expression.operatorToken.kind;
158670
+ changes.replaceNode(sourceFile, expression, operator === 37 /* SyntaxKind.ExclamationEqualsEqualsToken */ || operator === 35 /* SyntaxKind.ExclamationEqualsToken */
158671
+ ? ts.factory.createPrefixUnaryExpression(53 /* SyntaxKind.ExclamationToken */, callExpression) : callExpression);
158672
+ }
158673
+ function getSuggestion(messageText) {
158674
+ var _a = ts.flattenDiagnosticMessageText(messageText, "\n", 0).match(/\'(.*)\'/) || [], _ = _a[0], suggestion = _a[1];
158675
+ return suggestion;
158676
+ }
158677
+ })(codefix = ts.codefix || (ts.codefix = {}));
158678
+ })(ts || (ts = {}));
158679
+ /* @internal */
158680
+ var ts;
158649
158681
  (function (ts) {
158650
158682
  var codefix;
158651
158683
  (function (codefix) {
@@ -161332,11 +161364,12 @@ var ts;
161332
161364
  */
161333
161365
  function tryGetAutoImportableReferenceFromTypeNode(importTypeNode, scriptTarget) {
161334
161366
  var symbols;
161335
- var typeNode = ts.visitNode(importTypeNode, visit, ts.isTypeNode);
161367
+ var typeNode = ts.visitNode(importTypeNode, visit);
161336
161368
  if (symbols && typeNode) {
161337
161369
  return { typeNode: typeNode, symbols: symbols };
161338
161370
  }
161339
161371
  function visit(node) {
161372
+ var _a;
161340
161373
  if (ts.isLiteralImportTypeNode(node) && node.qualifier) {
161341
161374
  // Symbol for the left-most thing after the dot
161342
161375
  var firstIdentifier = ts.getFirstIdentifier(node.qualifier);
@@ -161345,7 +161378,7 @@ var ts;
161345
161378
  ? replaceFirstIdentifierOfEntityName(node.qualifier, ts.factory.createIdentifier(name))
161346
161379
  : node.qualifier;
161347
161380
  symbols = ts.append(symbols, firstIdentifier.symbol);
161348
- var typeArguments = ts.visitNodes(node.typeArguments, visit, ts.isTypeNode);
161381
+ var typeArguments = (_a = node.typeArguments) === null || _a === void 0 ? void 0 : _a.map(visit);
161349
161382
  return ts.factory.createTypeReferenceNode(qualifier, typeArguments);
161350
161383
  }
161351
161384
  return ts.visitEachChild(node, visit, ts.nullTransformationContext);
@@ -161362,6 +161395,15 @@ var ts;
161362
161395
  symbols.forEach(function (s) { return importAdder.addImportFromExportedSymbol(s, /*isValidTypeOnlyUseSite*/ true); });
161363
161396
  }
161364
161397
  codefix.importSymbols = importSymbols;
161398
+ function findAncestorMatchingSpan(sourceFile, span) {
161399
+ var end = ts.textSpanEnd(span);
161400
+ var token = ts.getTokenAtPosition(sourceFile, span.start);
161401
+ while (token.end < end) {
161402
+ token = token.parent;
161403
+ }
161404
+ return token;
161405
+ }
161406
+ codefix.findAncestorMatchingSpan = findAncestorMatchingSpan;
161365
161407
  })(codefix = ts.codefix || (ts.codefix = {}));
161366
161408
  })(ts || (ts = {}));
161367
161409
  /* @internal */
@@ -162420,7 +162462,6 @@ var ts;
162420
162462
  return { edits: edits, renameFilename: undefined, renameLocation: undefined };
162421
162463
  },
162422
162464
  });
162423
- ;
162424
162465
  function getInfo(context, considerPartialSpans) {
162425
162466
  if (considerPartialSpans === void 0) { considerPartialSpans = true; }
162426
162467
  var file = context.file, program = context.program;
@@ -162897,7 +162938,6 @@ var ts;
162897
162938
  });
162898
162939
  return { edits: edits, renameFilename: undefined, renameLocation: undefined };
162899
162940
  }
162900
- ;
162901
162941
  function isValidExpression(node) {
162902
162942
  return ts.isBinaryExpression(node) || ts.isConditionalExpression(node);
162903
162943
  }
@@ -162945,7 +162985,6 @@ var ts;
162945
162985
  if (expression.operatorToken.kind !== 55 /* SyntaxKind.AmpersandAmpersandToken */) {
162946
162986
  return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Can_only_convert_logical_AND_access_chains) };
162947
162987
  }
162948
- ;
162949
162988
  var finalExpression = getFinalExpressionInChain(expression.right);
162950
162989
  if (!finalExpression)
162951
162990
  return { error: ts.getLocaleSpecificMessage(ts.Diagnostics.Could_not_find_convertible_access_expression) };
@@ -164462,7 +164501,7 @@ var ts;
164462
164501
  var statements = ts.factory.createNodeArray(ts.isBlock(body) ? body.statements.slice(0) : [ts.isStatement(body) ? body : ts.factory.createReturnStatement(ts.skipParentheses(body))]);
164463
164502
  // rewrite body if either there are writes that should be propagated back via return statements or there are substitutions
164464
164503
  if (hasWritesOrVariableDeclarations || substitutions.size) {
164465
- var rewrittenStatements = ts.visitNodes(statements, visitor, ts.isStatement).slice();
164504
+ var rewrittenStatements = ts.visitNodes(statements, visitor).slice();
164466
164505
  if (hasWritesOrVariableDeclarations && !hasReturn && ts.isStatement(body)) {
164467
164506
  // add return at the end to propagate writes back in case if control flow falls out of the function body
164468
164507
  // it is ok to know that range has at least one return since it we only allow unconditional returns
@@ -165289,7 +165328,6 @@ var ts;
165289
165328
  (function (ts) {
165290
165329
  var refactor;
165291
165330
  (function (refactor) {
165292
- ;
165293
165331
  /**
165294
165332
  * Checks if some refactor info has refactor error info.
165295
165333
  */
@@ -165394,7 +165432,6 @@ var ts;
165394
165432
  // Imports will be copied to the new file anyway, and may still be needed in the old file.
165395
165433
  // Prologue directives will be copied to the new file and should be left in the old file.
165396
165434
  return !isPureImport(statement) && !ts.isPrologueDirective(statement);
165397
- ;
165398
165435
  }
165399
165436
  function isPureImport(node) {
165400
165437
  switch (node.kind) {
@@ -175449,7 +175486,7 @@ var ts;
175449
175486
  // raw is now fixed and ready
175450
175487
  this.safelist = raw.typesMap;
175451
175488
  for (var key in raw.simpleMap) {
175452
- if (raw.simpleMap.hasOwnProperty(key)) {
175489
+ if (ts.hasProperty(raw.simpleMap, key)) {
175453
175490
  this.legacySafelist.set(key, raw.simpleMap[key].toLowerCase());
175454
175491
  }
175455
175492
  }
@@ -178863,7 +178900,6 @@ var ts;
178863
178900
  }
178864
178901
  return ts.deduplicate(outputs, ts.equateValues);
178865
178902
  }
178866
- ;
178867
178903
  function createDocumentSpanSet() {
178868
178904
  return ts.createSet(function (_a) {
178869
178905
  var textSpan = _a.textSpan;
@@ -183983,7 +184019,7 @@ var ts;
183983
184019
  (name === undefined || typeof name === "string" || ts.isPropertyName(name)) &&
183984
184020
  (questionToken === undefined || typeof questionToken === "object" && ts.isQuestionToken(questionToken)) &&
183985
184021
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
183986
- (parameters === undefined || ts.isArrayOf(parameters, ts.isParameter)) &&
184022
+ (parameters === undefined || !ts.some(parameters, ts.isTypeParameterDeclaration)) &&
183987
184023
  (type === undefined || !ts.isArray(type)) &&
183988
184024
  (body === undefined || ts.isBlock(body));
183989
184025
  },
@@ -183993,7 +184029,7 @@ var ts;
183993
184029
  (asteriskToken === undefined || typeof asteriskToken === "object" && ts.isAsteriskToken(asteriskToken)) &&
183994
184030
  (name === undefined || typeof name === "string" || ts.isPropertyName(name)) &&
183995
184031
  (questionToken === undefined || !ts.isArray(questionToken)) &&
183996
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184032
+ (typeParameters === undefined || !ts.some(typeParameters, ts.isParameter)) &&
183997
184033
  (parameters === undefined || ts.isArray(parameters)) &&
183998
184034
  (type === undefined || ts.isTypeNode(type)) &&
183999
184035
  (body === undefined || ts.isBlock(body));
@@ -184020,7 +184056,7 @@ var ts;
184020
184056
  (name === undefined || typeof name === "string" || ts.isPropertyName(name)) &&
184021
184057
  (questionToken === undefined || typeof questionToken === "object" && ts.isQuestionToken(questionToken)) &&
184022
184058
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184023
- (parameters === undefined || ts.isArrayOf(parameters, ts.isParameter)) &&
184059
+ (parameters === undefined || !ts.some(parameters, ts.isTypeParameterDeclaration)) &&
184024
184060
  (type === undefined || !ts.isArray(type)) &&
184025
184061
  (body === undefined || ts.isBlock(body));
184026
184062
  },
@@ -184030,7 +184066,7 @@ var ts;
184030
184066
  (asteriskToken === undefined || typeof asteriskToken === "object" && ts.isAsteriskToken(asteriskToken)) &&
184031
184067
  (name === undefined || typeof name === "string" || ts.isPropertyName(name)) &&
184032
184068
  (questionToken === undefined || !ts.isArray(questionToken)) &&
184033
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184069
+ (typeParameters === undefined || !ts.some(typeParameters, ts.isParameter)) &&
184034
184070
  (parameters === undefined || ts.isArray(parameters)) &&
184035
184071
  (type === undefined || ts.isTypeNode(type)) &&
184036
184072
  (body === undefined || ts.isBlock(body));
@@ -184053,14 +184089,14 @@ var ts;
184053
184089
  0: function (_a) {
184054
184090
  var modifiers = _a[0], parameters = _a[1], body = _a[2], other = _a[3];
184055
184091
  return (other === undefined) &&
184056
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184057
- (parameters === undefined || ts.isArrayOf(parameters, ts.isParameter)) &&
184092
+ (modifiers === undefined || !ts.some(modifiers, ts.isDecorator)) &&
184093
+ (parameters === undefined || !ts.some(parameters, ts.isModifier)) &&
184058
184094
  (body === undefined || !ts.isArray(body));
184059
184095
  },
184060
184096
  1: function (_a) {
184061
184097
  var decorators = _a[0], modifiers = _a[1], parameters = _a[2], body = _a[3];
184062
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184063
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184098
+ return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
184099
+ (modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
184064
184100
  (parameters === undefined || ts.isArray(parameters)) &&
184065
184101
  (body === undefined || ts.isBlock(body));
184066
184102
  },
@@ -184082,14 +184118,14 @@ var ts;
184082
184118
  0: function (_a) {
184083
184119
  var modifiers = _a[1], parameters = _a[2], body = _a[3], other = _a[4];
184084
184120
  return (other === undefined) &&
184085
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184086
- (parameters === undefined || ts.isArrayOf(parameters, ts.isParameter)) &&
184121
+ (modifiers === undefined || !ts.some(modifiers, ts.isDecorator)) &&
184122
+ (parameters === undefined || !ts.some(parameters, ts.isModifier)) &&
184087
184123
  (body === undefined || !ts.isArray(body));
184088
184124
  },
184089
184125
  1: function (_a) {
184090
184126
  var decorators = _a[1], modifiers = _a[2], parameters = _a[3], body = _a[4];
184091
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184092
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184127
+ return (decorators === undefined || !ts.some(decorators, ts.isModifier)) &&
184128
+ (modifiers === undefined || !ts.some(modifiers, ts.isParameter)) &&
184093
184129
  (parameters === undefined || ts.isArray(parameters)) &&
184094
184130
  (body === undefined || ts.isBlock(body));
184095
184131
  },
@@ -184231,14 +184267,14 @@ var ts;
184231
184267
  0: function (_a) {
184232
184268
  var modifiers = _a[0], parameters = _a[1], type = _a[2], other = _a[3];
184233
184269
  return (other === undefined) &&
184234
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184235
- (parameters === undefined || ts.isArrayOf(parameters, ts.isParameter)) &&
184270
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184271
+ (parameters === undefined || ts.every(parameters, ts.isParameter)) &&
184236
184272
  (type === undefined || !ts.isArray(type));
184237
184273
  },
184238
184274
  1: function (_a) {
184239
184275
  var decorators = _a[0], modifiers = _a[1], parameters = _a[2], type = _a[3];
184240
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184241
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184276
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184277
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184242
184278
  (parameters === undefined || ts.isArray(parameters)) &&
184243
184279
  (type === undefined || ts.isTypeNode(type));
184244
184280
  },
@@ -184260,14 +184296,14 @@ var ts;
184260
184296
  0: function (_a) {
184261
184297
  var modifiers = _a[1], parameters = _a[2], type = _a[3], other = _a[4];
184262
184298
  return (other === undefined) &&
184263
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184264
- (parameters === undefined || ts.isArrayOf(parameters, ts.isParameter)) &&
184299
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184300
+ (parameters === undefined || ts.every(parameters, ts.isParameter)) &&
184265
184301
  (type === undefined || !ts.isArray(type));
184266
184302
  },
184267
184303
  1: function (_a) {
184268
184304
  var decorators = _a[1], modifiers = _a[2], parameters = _a[3], type = _a[4];
184269
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184270
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184305
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184306
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184271
184307
  (parameters === undefined || ts.isArray(parameters)) &&
184272
184308
  (type === undefined || ts.isTypeNode(type));
184273
184309
  },
@@ -184345,15 +184381,15 @@ var ts;
184345
184381
  return (other === undefined) &&
184346
184382
  (name === undefined || !ts.isArray(name)) &&
184347
184383
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184348
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184349
- (members === undefined || ts.isArrayOf(members, ts.isClassElement));
184384
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184385
+ (members === undefined || ts.every(members, ts.isClassElement));
184350
184386
  },
184351
184387
  1: function (_a) {
184352
184388
  var modifiers = _a[1], name = _a[2], typeParameters = _a[3], heritageClauses = _a[4], members = _a[5];
184353
184389
  return (modifiers === undefined || ts.isArray(modifiers)) &&
184354
184390
  (name === undefined || !ts.isArray(name)) &&
184355
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184356
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184391
+ (typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
184392
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184357
184393
  (members === undefined || ts.isArray(members));
184358
184394
  },
184359
184395
  })
@@ -184376,15 +184412,15 @@ var ts;
184376
184412
  return (other === undefined) &&
184377
184413
  (name === undefined || !ts.isArray(name)) &&
184378
184414
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184379
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184380
- (members === undefined || ts.isArrayOf(members, ts.isClassElement));
184415
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184416
+ (members === undefined || ts.every(members, ts.isClassElement));
184381
184417
  },
184382
184418
  1: function (_a) {
184383
184419
  var modifiers = _a[2], name = _a[3], typeParameters = _a[4], heritageClauses = _a[5], members = _a[6];
184384
184420
  return (modifiers === undefined || ts.isArray(modifiers)) &&
184385
184421
  (name === undefined || !ts.isArray(name)) &&
184386
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184387
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184422
+ (typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
184423
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184388
184424
  (members === undefined || ts.isArray(members));
184389
184425
  },
184390
184426
  })
@@ -184408,7 +184444,7 @@ var ts;
184408
184444
  (asteriskToken === undefined || !ts.isArray(asteriskToken)) &&
184409
184445
  (name === undefined || typeof name === "string" || ts.isIdentifier(name)) &&
184410
184446
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184411
- (parameters === undefined || ts.isArrayOf(parameters, ts.isParameter)) &&
184447
+ (parameters === undefined || ts.every(parameters, ts.isParameter)) &&
184412
184448
  (type === undefined || !ts.isArray(type)) &&
184413
184449
  (body === undefined || ts.isBlock(body));
184414
184450
  },
@@ -184417,7 +184453,7 @@ var ts;
184417
184453
  return (modifiers === undefined || ts.isArray(modifiers)) &&
184418
184454
  (asteriskToken === undefined || typeof asteriskToken !== "string" && ts.isAsteriskToken(asteriskToken)) &&
184419
184455
  (name === undefined || !ts.isArray(name)) &&
184420
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184456
+ (typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
184421
184457
  (parameters === undefined || ts.isArray(parameters)) &&
184422
184458
  (type === undefined || ts.isTypeNode(type)) &&
184423
184459
  (body === undefined || ts.isBlock(body));
@@ -184443,7 +184479,7 @@ var ts;
184443
184479
  (asteriskToken === undefined || !ts.isArray(asteriskToken)) &&
184444
184480
  (name === undefined || ts.isIdentifier(name)) &&
184445
184481
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184446
- (parameters === undefined || ts.isArrayOf(parameters, ts.isParameter)) &&
184482
+ (parameters === undefined || ts.every(parameters, ts.isParameter)) &&
184447
184483
  (type === undefined || !ts.isArray(type)) &&
184448
184484
  (body === undefined || ts.isBlock(body));
184449
184485
  },
@@ -184452,7 +184488,7 @@ var ts;
184452
184488
  return (modifiers === undefined || ts.isArray(modifiers)) &&
184453
184489
  (asteriskToken === undefined || typeof asteriskToken !== "string" && ts.isAsteriskToken(asteriskToken)) &&
184454
184490
  (name === undefined || !ts.isArray(name)) &&
184455
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184491
+ (typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
184456
184492
  (parameters === undefined || ts.isArray(parameters)) &&
184457
184493
  (type === undefined || ts.isTypeNode(type)) &&
184458
184494
  (body === undefined || ts.isBlock(body));
@@ -184477,8 +184513,8 @@ var ts;
184477
184513
  return (other === undefined) &&
184478
184514
  (name === undefined || !ts.isArray(name)) &&
184479
184515
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184480
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184481
- (members === undefined || ts.isArrayOf(members, ts.isClassElement));
184516
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184517
+ (members === undefined || ts.every(members, ts.isClassElement));
184482
184518
  },
184483
184519
  1: function () { return true; },
184484
184520
  })
@@ -184501,15 +184537,15 @@ var ts;
184501
184537
  return (other === undefined) &&
184502
184538
  (name === undefined || !ts.isArray(name)) &&
184503
184539
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184504
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184505
- (members === undefined || ts.isArrayOf(members, ts.isClassElement));
184540
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184541
+ (members === undefined || ts.every(members, ts.isClassElement));
184506
184542
  },
184507
184543
  1: function (_a) {
184508
184544
  var modifiers = _a[2], name = _a[3], typeParameters = _a[4], heritageClauses = _a[5], members = _a[6];
184509
184545
  return (modifiers === undefined || ts.isArray(modifiers)) &&
184510
184546
  (name === undefined || !ts.isArray(name)) &&
184511
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184512
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184547
+ (typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
184548
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184513
184549
  (members === undefined || ts.isArray(members));
184514
184550
  },
184515
184551
  })
@@ -184530,19 +184566,19 @@ var ts;
184530
184566
  0: function (_a) {
184531
184567
  var modifiers = _a[0], name = _a[1], typeParameters = _a[2], heritageClauses = _a[3], members = _a[4], other = _a[5];
184532
184568
  return (other === undefined) &&
184533
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184569
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184534
184570
  (name === undefined || !ts.isArray(name)) &&
184535
184571
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184536
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184537
- (members === undefined || ts.isArrayOf(members, ts.isTypeElement));
184572
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184573
+ (members === undefined || ts.every(members, ts.isTypeElement));
184538
184574
  },
184539
184575
  1: function (_a) {
184540
184576
  var decorators = _a[0], modifiers = _a[1], name = _a[2], typeParameters = _a[3], heritageClauses = _a[4], members = _a[5];
184541
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184577
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184542
184578
  (modifiers === undefined || ts.isArray(modifiers)) &&
184543
184579
  (name === undefined || !ts.isArray(name)) &&
184544
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184545
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184580
+ (typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
184581
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184546
184582
  (members === undefined || ts.every(members, ts.isTypeElement));
184547
184583
  },
184548
184584
  })
@@ -184563,19 +184599,19 @@ var ts;
184563
184599
  0: function (_a) {
184564
184600
  var modifiers = _a[1], name = _a[2], typeParameters = _a[3], heritageClauses = _a[4], members = _a[5], other = _a[6];
184565
184601
  return (other === undefined) &&
184566
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184602
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184567
184603
  (name === undefined || !ts.isArray(name)) &&
184568
184604
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184569
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184570
- (members === undefined || ts.isArrayOf(members, ts.isTypeElement));
184605
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184606
+ (members === undefined || ts.every(members, ts.isTypeElement));
184571
184607
  },
184572
184608
  1: function (_a) {
184573
184609
  var decorators = _a[1], modifiers = _a[2], name = _a[3], typeParameters = _a[4], heritageClauses = _a[5], members = _a[6];
184574
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184610
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184575
184611
  (modifiers === undefined || ts.isArray(modifiers)) &&
184576
184612
  (name === undefined || !ts.isArray(name)) &&
184577
- (typeParameters === undefined || ts.isArrayOf(typeParameters, ts.isTypeParameterDeclaration)) &&
184578
- (heritageClauses === undefined || ts.isArrayOf(heritageClauses, ts.isHeritageClause)) &&
184613
+ (typeParameters === undefined || ts.every(typeParameters, ts.isTypeParameterDeclaration)) &&
184614
+ (heritageClauses === undefined || ts.every(heritageClauses, ts.isHeritageClause)) &&
184579
184615
  (members === undefined || ts.every(members, ts.isTypeElement));
184580
184616
  },
184581
184617
  })
@@ -184596,14 +184632,14 @@ var ts;
184596
184632
  0: function (_a) {
184597
184633
  var modifiers = _a[0], name = _a[1], typeParameters = _a[2], type = _a[3], other = _a[4];
184598
184634
  return (other === undefined) &&
184599
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184635
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184600
184636
  (name === undefined || !ts.isArray(name)) &&
184601
184637
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184602
184638
  (type === undefined || !ts.isArray(type));
184603
184639
  },
184604
184640
  1: function (_a) {
184605
184641
  var decorators = _a[0], modifiers = _a[1], name = _a[2], typeParameters = _a[3], type = _a[4];
184606
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184642
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184607
184643
  (modifiers === undefined || ts.isArray(modifiers)) &&
184608
184644
  (name === undefined || !ts.isArray(name)) &&
184609
184645
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
@@ -184627,14 +184663,14 @@ var ts;
184627
184663
  0: function (_a) {
184628
184664
  var modifiers = _a[1], name = _a[2], typeParameters = _a[3], type = _a[4], other = _a[5];
184629
184665
  return (other === undefined) &&
184630
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184666
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184631
184667
  (name === undefined || !ts.isArray(name)) &&
184632
184668
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
184633
184669
  (type === undefined || !ts.isArray(type));
184634
184670
  },
184635
184671
  1: function (_a) {
184636
184672
  var decorators = _a[1], modifiers = _a[2], name = _a[3], typeParameters = _a[4], type = _a[5];
184637
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184673
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184638
184674
  (modifiers === undefined || ts.isArray(modifiers)) &&
184639
184675
  (name === undefined || !ts.isArray(name)) &&
184640
184676
  (typeParameters === undefined || ts.isArray(typeParameters)) &&
@@ -184658,13 +184694,13 @@ var ts;
184658
184694
  0: function (_a) {
184659
184695
  var modifiers = _a[0], name = _a[1], members = _a[2], other = _a[3];
184660
184696
  return (other === undefined) &&
184661
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184697
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184662
184698
  (name === undefined || !ts.isArray(name)) &&
184663
184699
  (members === undefined || ts.isArray(members));
184664
184700
  },
184665
184701
  1: function (_a) {
184666
184702
  var decorators = _a[0], modifiers = _a[1], name = _a[2], members = _a[3];
184667
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184703
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184668
184704
  (modifiers === undefined || ts.isArray(modifiers)) &&
184669
184705
  (name === undefined || !ts.isArray(name)) &&
184670
184706
  (members === undefined || ts.isArray(members));
@@ -184687,13 +184723,13 @@ var ts;
184687
184723
  0: function (_a) {
184688
184724
  var modifiers = _a[1], name = _a[2], members = _a[3], other = _a[4];
184689
184725
  return (other === undefined) &&
184690
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184726
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184691
184727
  (name === undefined || !ts.isArray(name)) &&
184692
184728
  (members === undefined || ts.isArray(members));
184693
184729
  },
184694
184730
  1: function (_a) {
184695
184731
  var decorators = _a[1], modifiers = _a[2], name = _a[3], members = _a[4];
184696
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184732
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184697
184733
  (modifiers === undefined || ts.isArray(modifiers)) &&
184698
184734
  (name === undefined || !ts.isArray(name)) &&
184699
184735
  (members === undefined || ts.isArray(members));
@@ -184716,14 +184752,14 @@ var ts;
184716
184752
  0: function (_a) {
184717
184753
  var modifiers = _a[0], name = _a[1], body = _a[2], flags = _a[3], other = _a[4];
184718
184754
  return (other === undefined) &&
184719
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184755
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184720
184756
  (name !== undefined && !ts.isArray(name)) &&
184721
184757
  (body === undefined || ts.isModuleBody(body)) &&
184722
184758
  (flags === undefined || typeof flags === "number");
184723
184759
  },
184724
184760
  1: function (_a) {
184725
184761
  var decorators = _a[0], modifiers = _a[1], name = _a[2], body = _a[3], flags = _a[4];
184726
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184762
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184727
184763
  (modifiers === undefined || ts.isArray(modifiers)) &&
184728
184764
  (name !== undefined && ts.isModuleName(name)) &&
184729
184765
  (body === undefined || typeof body === "object") &&
@@ -184747,13 +184783,13 @@ var ts;
184747
184783
  0: function (_a) {
184748
184784
  var modifiers = _a[1], name = _a[2], body = _a[3], other = _a[4];
184749
184785
  return (other === undefined) &&
184750
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184786
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184751
184787
  (name === undefined || !ts.isArray(name)) &&
184752
184788
  (body === undefined || ts.isModuleBody(body));
184753
184789
  },
184754
184790
  1: function (_a) {
184755
184791
  var decorators = _a[1], modifiers = _a[2], name = _a[3], body = _a[4];
184756
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184792
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184757
184793
  (modifiers === undefined || ts.isArray(modifiers)) &&
184758
184794
  (name !== undefined && ts.isModuleName(name)) &&
184759
184795
  (body === undefined || ts.isModuleBody(body));
@@ -184776,14 +184812,14 @@ var ts;
184776
184812
  0: function (_a) {
184777
184813
  var modifiers = _a[0], isTypeOnly = _a[1], name = _a[2], moduleReference = _a[3], other = _a[4];
184778
184814
  return (other === undefined) &&
184779
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184815
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184780
184816
  (isTypeOnly === undefined || typeof isTypeOnly === "boolean") &&
184781
184817
  (typeof name !== "boolean") &&
184782
184818
  (typeof moduleReference !== "string");
184783
184819
  },
184784
184820
  1: function (_a) {
184785
184821
  var decorators = _a[0], modifiers = _a[1], isTypeOnly = _a[2], name = _a[3], moduleReference = _a[4];
184786
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184822
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184787
184823
  (modifiers === undefined || ts.isArray(modifiers)) &&
184788
184824
  (isTypeOnly === undefined || typeof isTypeOnly === "boolean") &&
184789
184825
  (typeof name === "string" || ts.isIdentifier(name)) &&
@@ -184807,14 +184843,14 @@ var ts;
184807
184843
  0: function (_a) {
184808
184844
  var modifiers = _a[1], isTypeOnly = _a[2], name = _a[3], moduleReference = _a[4], other = _a[5];
184809
184845
  return (other === undefined) &&
184810
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184846
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184811
184847
  (isTypeOnly === undefined || typeof isTypeOnly === "boolean") &&
184812
184848
  (typeof name !== "boolean") &&
184813
184849
  (typeof moduleReference !== "string");
184814
184850
  },
184815
184851
  1: function (_a) {
184816
184852
  var decorators = _a[1], modifiers = _a[2], isTypeOnly = _a[3], name = _a[4], moduleReference = _a[5];
184817
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184853
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184818
184854
  (modifiers === undefined || ts.isArray(modifiers)) &&
184819
184855
  (isTypeOnly === undefined || typeof isTypeOnly === "boolean") &&
184820
184856
  (typeof name === "string" || ts.isIdentifier(name)) &&
@@ -184838,14 +184874,14 @@ var ts;
184838
184874
  0: function (_a) {
184839
184875
  var modifiers = _a[0], importClause = _a[1], moduleSpecifier = _a[2], assertClause = _a[3], other = _a[4];
184840
184876
  return (other === undefined) &&
184841
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184877
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184842
184878
  (importClause === undefined || !ts.isArray(importClause)) &&
184843
184879
  (moduleSpecifier !== undefined && ts.isExpression(moduleSpecifier)) &&
184844
184880
  (assertClause === undefined || ts.isAssertClause(assertClause));
184845
184881
  },
184846
184882
  1: function (_a) {
184847
184883
  var decorators = _a[0], modifiers = _a[1], importClause = _a[2], moduleSpecifier = _a[3], assertClause = _a[4];
184848
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184884
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184849
184885
  (modifiers === undefined || ts.isArray(modifiers)) &&
184850
184886
  (importClause === undefined || ts.isImportClause(importClause)) &&
184851
184887
  (moduleSpecifier !== undefined && ts.isExpression(moduleSpecifier)) &&
@@ -184869,14 +184905,14 @@ var ts;
184869
184905
  0: function (_a) {
184870
184906
  var modifiers = _a[1], importClause = _a[2], moduleSpecifier = _a[3], assertClause = _a[4], other = _a[5];
184871
184907
  return (other === undefined) &&
184872
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184908
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184873
184909
  (importClause === undefined || !ts.isArray(importClause)) &&
184874
184910
  (moduleSpecifier === undefined || ts.isExpression(moduleSpecifier)) &&
184875
184911
  (assertClause === undefined || ts.isAssertClause(assertClause));
184876
184912
  },
184877
184913
  1: function (_a) {
184878
184914
  var decorators = _a[1], modifiers = _a[2], importClause = _a[3], moduleSpecifier = _a[4], assertClause = _a[5];
184879
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184915
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184880
184916
  (modifiers === undefined || ts.isArray(modifiers)) &&
184881
184917
  (importClause === undefined || ts.isImportClause(importClause)) &&
184882
184918
  (moduleSpecifier !== undefined && ts.isExpression(moduleSpecifier)) &&
@@ -184900,13 +184936,13 @@ var ts;
184900
184936
  0: function (_a) {
184901
184937
  var modifiers = _a[0], isExportEquals = _a[1], expression = _a[2], other = _a[3];
184902
184938
  return (other === undefined) &&
184903
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184939
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184904
184940
  (isExportEquals === undefined || typeof isExportEquals === "boolean") &&
184905
184941
  (typeof expression === "object");
184906
184942
  },
184907
184943
  1: function (_a) {
184908
184944
  var decorators = _a[0], modifiers = _a[1], isExportEquals = _a[2], expression = _a[3];
184909
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184945
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184910
184946
  (modifiers === undefined || ts.isArray(modifiers)) &&
184911
184947
  (isExportEquals === undefined || typeof isExportEquals === "boolean") &&
184912
184948
  (expression !== undefined && ts.isExpression(expression));
@@ -184929,12 +184965,12 @@ var ts;
184929
184965
  0: function (_a) {
184930
184966
  var modifiers = _a[1], expression = _a[2], other = _a[3];
184931
184967
  return (other === undefined) &&
184932
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184968
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184933
184969
  (expression !== undefined && !ts.isArray(expression));
184934
184970
  },
184935
184971
  1: function (_a) {
184936
184972
  var decorators = _a[1], modifiers = _a[2], expression = _a[3];
184937
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
184973
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184938
184974
  (modifiers === undefined || ts.isArray(modifiers)) &&
184939
184975
  (expression !== undefined && ts.isExpression(expression));
184940
184976
  },
@@ -184956,7 +184992,7 @@ var ts;
184956
184992
  0: function (_a) {
184957
184993
  var modifiers = _a[0], isTypeOnly = _a[1], exportClause = _a[2], moduleSpecifier = _a[3], assertClause = _a[4], other = _a[5];
184958
184994
  return (other === undefined) &&
184959
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
184995
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184960
184996
  (typeof isTypeOnly === "boolean") &&
184961
184997
  (typeof exportClause !== "boolean") &&
184962
184998
  (moduleSpecifier === undefined || ts.isExpression(moduleSpecifier)) &&
@@ -184964,7 +185000,7 @@ var ts;
184964
185000
  },
184965
185001
  1: function (_a) {
184966
185002
  var decorators = _a[0], modifiers = _a[1], isTypeOnly = _a[2], exportClause = _a[3], moduleSpecifier = _a[4], assertClause = _a[5];
184967
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
185003
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
184968
185004
  (modifiers === undefined || ts.isArray(modifiers)) &&
184969
185005
  (typeof isTypeOnly === "boolean") &&
184970
185006
  (exportClause === undefined || ts.isNamedExportBindings(exportClause)) &&
@@ -184989,7 +185025,7 @@ var ts;
184989
185025
  0: function (_a) {
184990
185026
  var modifiers = _a[1], isTypeOnly = _a[2], exportClause = _a[3], moduleSpecifier = _a[4], assertClause = _a[5], other = _a[6];
184991
185027
  return (other === undefined) &&
184992
- (modifiers === undefined || ts.isArrayOf(modifiers, ts.isModifier)) &&
185028
+ (modifiers === undefined || ts.every(modifiers, ts.isModifier)) &&
184993
185029
  (typeof isTypeOnly === "boolean") &&
184994
185030
  (typeof exportClause !== "boolean") &&
184995
185031
  (moduleSpecifier === undefined || ts.isExpression(moduleSpecifier)) &&
@@ -184997,7 +185033,7 @@ var ts;
184997
185033
  },
184998
185034
  1: function (_a) {
184999
185035
  var decorators = _a[1], modifiers = _a[2], isTypeOnly = _a[3], exportClause = _a[4], moduleSpecifier = _a[5], assertClause = _a[6];
185000
- return (decorators === undefined || ts.isArrayOf(decorators, ts.isDecorator)) &&
185036
+ return (decorators === undefined || ts.every(decorators, ts.isDecorator)) &&
185001
185037
  (modifiers === undefined || ts.isArray(modifiers)) &&
185002
185038
  (typeof isTypeOnly === "boolean") &&
185003
185039
  (exportClause === undefined || ts.isNamedExportBindings(exportClause)) &&