@typescript-deploys/pr-build 4.6.0-pr-47126-8 → 4.6.0-pr-47550-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/tsc.js CHANGED
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  var ts;
70
70
  (function (ts) {
71
71
  ts.versionMajorMinor = "4.6";
72
- ts.version = ts.versionMajorMinor + ".0-insiders.20220107";
72
+ ts.version = ts.versionMajorMinor + ".0-insiders.20220121";
73
73
  var NativeCollections;
74
74
  (function (NativeCollections) {
75
75
  function tryGetNativeMap() {
@@ -1855,14 +1855,6 @@ var ts;
1855
1855
  }
1856
1856
  return s.slice(0, end + 1);
1857
1857
  }
1858
- function startWhitespaceCount(s) {
1859
- for (var i = 0; i < s.length; i++) {
1860
- if (!ts.isWhiteSpaceLike(s.charCodeAt(i)))
1861
- return i;
1862
- }
1863
- return s.length;
1864
- }
1865
- ts.startWhitespaceCount = startWhitespaceCount;
1866
1858
  })(ts || (ts = {}));
1867
1859
  var ts;
1868
1860
  (function (ts) {
@@ -4179,9 +4171,13 @@ var ts;
4179
4171
  }
4180
4172
  ts.getFileWatcherEventKind = getFileWatcherEventKind;
4181
4173
  ts.ignoredPaths = ["/node_modules/.", "/.git", "/.#"];
4182
- ts.sysLog = ts.noop;
4174
+ var curSysLog = ts.noop;
4175
+ function sysLog(s) {
4176
+ return curSysLog(s);
4177
+ }
4178
+ ts.sysLog = sysLog;
4183
4179
  function setSysLog(logger) {
4184
- ts.sysLog = logger;
4180
+ curSysLog = logger;
4185
4181
  }
4186
4182
  ts.setSysLog = setSysLog;
4187
4183
  function createDirectoryWatcherSupportingRecursive(_a) {
@@ -4301,7 +4297,7 @@ var ts;
4301
4297
  }
4302
4298
  function onTimerToUpdateChildWatches() {
4303
4299
  timerToUpdateChildWatches = undefined;
4304
- ts.sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
4300
+ sysLog("sysLog:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size);
4305
4301
  var start = ts.timestamp();
4306
4302
  var invokeMap = new ts.Map();
4307
4303
  while (!timerToUpdateChildWatches && cacheToUpdateChildWatches.size) {
@@ -4312,7 +4308,7 @@ var ts;
4312
4308
  var hasChanges = updateChildWatches(dirName, dirPath, options);
4313
4309
  invokeCallbacks(dirPath, invokeMap, hasChanges ? undefined : fileNames);
4314
4310
  }
4315
- ts.sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
4311
+ sysLog("sysLog:: invokingWatchers:: Elapsed:: " + (ts.timestamp() - start) + "ms:: " + cacheToUpdateChildWatches.size);
4316
4312
  callbackCache.forEach(function (callbacks, rootDirName) {
4317
4313
  var existing = invokeMap.get(rootDirName);
4318
4314
  if (existing) {
@@ -4328,7 +4324,7 @@ var ts;
4328
4324
  }
4329
4325
  });
4330
4326
  var elapsed = ts.timestamp() - start;
4331
- ts.sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
4327
+ sysLog("sysLog:: Elapsed:: " + elapsed + "ms:: onTimerToUpdateChildWatches:: " + cacheToUpdateChildWatches.size + " " + timerToUpdateChildWatches);
4332
4328
  }
4333
4329
  function removeChildWatches(parentWatcher) {
4334
4330
  if (!parentWatcher)
@@ -4830,7 +4826,7 @@ var ts;
4830
4826
  }
4831
4827
  };
4832
4828
  function invokeCallbackAndUpdateWatcher(createWatcher) {
4833
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
4829
+ sysLog("sysLog:: " + fileOrDirectory + ":: Changing watcher to " + (createWatcher === watchPresentFileSystemEntry ? "Present" : "Missing") + "FileSystemEntryWatcher");
4834
4830
  callback("rename", "");
4835
4831
  if (watcher) {
4836
4832
  watcher.close();
@@ -4847,7 +4843,7 @@ var ts;
4847
4843
  }
4848
4844
  }
4849
4845
  if (hitSystemWatcherLimit) {
4850
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
4846
+ sysLog("sysLog:: " + fileOrDirectory + ":: Defaulting to fsWatchFile");
4851
4847
  return watchPresentFileSystemEntryWithFsWatchFile();
4852
4848
  }
4853
4849
  try {
@@ -4859,7 +4855,7 @@ var ts;
4859
4855
  }
4860
4856
  catch (e) {
4861
4857
  hitSystemWatcherLimit || (hitSystemWatcherLimit = e.code === "ENOSPC");
4862
- ts.sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
4858
+ sysLog("sysLog:: " + fileOrDirectory + ":: Changing to fsWatchFile");
4863
4859
  return watchPresentFileSystemEntryWithFsWatchFile();
4864
4860
  }
4865
4861
  }
@@ -5427,6 +5423,7 @@ var ts;
5427
5423
  Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
5428
5424
  The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
5429
5425
  Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
5426
+ catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
5430
5427
  The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
5431
5428
  The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
5432
5429
  Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", undefined, true),
@@ -5510,7 +5507,7 @@ var ts;
5510
5507
  Parameter_0_cannot_reference_identifier_1_declared_after_it: diag(2373, ts.DiagnosticCategory.Error, "Parameter_0_cannot_reference_identifier_1_declared_after_it_2373", "Parameter '{0}' cannot reference identifier '{1}' declared after it."),
5511
5508
  Duplicate_index_signature_for_type_0: diag(2374, ts.DiagnosticCategory.Error, "Duplicate_index_signature_for_type_0_2374", "Duplicate index signature for type '{0}'."),
5512
5509
  Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2375, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefi_2375", "Type '{0}' is not assignable to type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),
5513
- A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2376, ts.DiagnosticCategory.Error, "A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_proper_2376", "A 'super' call must be the first statement in the constructor when a class contains initialized properties, parameter properties, or private identifiers."),
5510
+ A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2376, ts.DiagnosticCategory.Error, "A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_2376", "A 'super' call must be the first statement in the constructor to refer to 'super' or 'this' when a derived class contains initialized properties, parameter properties, or private identifiers."),
5514
5511
  Constructors_for_derived_classes_must_contain_a_super_call: diag(2377, ts.DiagnosticCategory.Error, "Constructors_for_derived_classes_must_contain_a_super_call_2377", "Constructors for derived classes must contain a 'super' call."),
5515
5512
  A_get_accessor_must_return_a_value: diag(2378, ts.DiagnosticCategory.Error, "A_get_accessor_must_return_a_value_2378", "A 'get' accessor must return a value."),
5516
5513
  Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties: diag(2379, ts.DiagnosticCategory.Error, "Argument_of_type_0_is_not_assignable_to_parameter_of_type_1_with_exactOptionalPropertyTypes_Colon_tr_2379", "Argument of type '{0}' is not assignable to parameter of type '{1}' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties."),
@@ -5533,6 +5530,7 @@ var ts;
5533
5530
  constructor_cannot_be_used_as_a_parameter_property_name: diag(2398, ts.DiagnosticCategory.Error, "constructor_cannot_be_used_as_a_parameter_property_name_2398", "'constructor' cannot be used as a parameter property name."),
5534
5531
  Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: diag(2399, ts.DiagnosticCategory.Error, "Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference_2399", "Duplicate identifier '_this'. Compiler uses variable declaration '_this' to capture 'this' reference."),
5535
5532
  Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: diag(2400, ts.DiagnosticCategory.Error, "Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference_2400", "Expression resolves to variable declaration '_this' that compiler uses to capture 'this' reference."),
5533
+ A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers: diag(2401, ts.DiagnosticCategory.Error, "A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_in_2401", "A 'super' call must be a root-level statement within a constructor of a derived class that contains initialized properties, parameter properties, or private identifiers."),
5536
5534
  Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: diag(2402, ts.DiagnosticCategory.Error, "Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference_2402", "Expression resolves to '_super' that compiler uses to capture base class reference."),
5537
5535
  Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: diag(2403, ts.DiagnosticCategory.Error, "Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_t_2403", "Subsequent variable declarations must have the same type. Variable '{0}' must be of type '{1}', but here has type '{2}'."),
5538
5536
  The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: diag(2404, ts.DiagnosticCategory.Error, "The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation_2404", "The left-hand side of a 'for...in' statement cannot use a type annotation."),
@@ -5814,12 +5812,12 @@ var ts;
5814
5812
  Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: diag(2725, ts.DiagnosticCategory.Error, "Class_name_cannot_be_Object_when_targeting_ES5_with_module_0_2725", "Class name cannot be 'Object' when targeting ES5 with module {0}."),
5815
5813
  Cannot_find_lib_definition_for_0: diag(2726, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_2726", "Cannot find lib definition for '{0}'."),
5816
5814
  Cannot_find_lib_definition_for_0_Did_you_mean_1: diag(2727, ts.DiagnosticCategory.Error, "Cannot_find_lib_definition_for_0_Did_you_mean_1_2727", "Cannot find lib definition for '{0}'. Did you mean '{1}'?"),
5817
- _0_is_declared_here_Colon: diag(2728, ts.DiagnosticCategory.Message, "_0_is_declared_here_Colon_2728", "'{0}' is declared here:"),
5815
+ _0_is_declared_here: diag(2728, ts.DiagnosticCategory.Message, "_0_is_declared_here_2728", "'{0}' is declared here."),
5818
5816
  Property_0_is_used_before_its_initialization: diag(2729, ts.DiagnosticCategory.Error, "Property_0_is_used_before_its_initialization_2729", "Property '{0}' is used before its initialization."),
5819
5817
  An_arrow_function_cannot_have_a_this_parameter: diag(2730, ts.DiagnosticCategory.Error, "An_arrow_function_cannot_have_a_this_parameter_2730", "An arrow function cannot have a 'this' parameter."),
5820
5818
  Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_in_String: diag(2731, ts.DiagnosticCategory.Error, "Implicit_conversion_of_a_symbol_to_a_string_will_fail_at_runtime_Consider_wrapping_this_expression_i_2731", "Implicit conversion of a 'symbol' to a 'string' will fail at runtime. Consider wrapping this expression in 'String(...)'."),
5821
5819
  Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension: diag(2732, ts.DiagnosticCategory.Error, "Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension_2732", "Cannot find module '{0}'. Consider using '--resolveJsonModule' to import module with '.json' extension."),
5822
- Property_0_was_also_declared_here_Colon: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_Colon_2733", "Property '{0}' was also declared here:"),
5820
+ Property_0_was_also_declared_here: diag(2733, ts.DiagnosticCategory.Error, "Property_0_was_also_declared_here_2733", "Property '{0}' was also declared here."),
5823
5821
  Are_you_missing_a_semicolon: diag(2734, ts.DiagnosticCategory.Error, "Are_you_missing_a_semicolon_2734", "Are you missing a semicolon?"),
5824
5822
  Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1: diag(2735, ts.DiagnosticCategory.Error, "Did_you_mean_for_0_to_be_constrained_to_type_new_args_Colon_any_1_2735", "Did you mean for '{0}' to be constrained to type 'new (...args: any[]) => {1}'?"),
5825
5823
  Operator_0_cannot_be_applied_to_type_1: diag(2736, ts.DiagnosticCategory.Error, "Operator_0_cannot_be_applied_to_type_1_2736", "Operator '{0}' cannot be applied to type '{1}'."),
@@ -5913,6 +5911,7 @@ var ts;
5913
5911
  Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Consider adding an extension to the import path."),
5914
5912
  Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node12_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.Error, "Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_n_2835", "Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node12' or 'nodenext'. Did you mean '{0}'?"),
5915
5913
  Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
5914
+ Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
5916
5915
  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}'."),
5917
5916
  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}'."),
5918
5917
  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}'."),
@@ -6250,7 +6249,7 @@ var ts;
6250
6249
  Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: diag(6200, ts.DiagnosticCategory.Error, "Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0_6200", "Definitions of the following identifiers conflict with those in another file: {0}"),
6251
6250
  Conflicts_are_in_this_file: diag(6201, ts.DiagnosticCategory.Message, "Conflicts_are_in_this_file_6201", "Conflicts are in this file."),
6252
6251
  Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: diag(6202, ts.DiagnosticCategory.Error, "Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0_6202", "Project references may not form a circular graph. Cycle detected: {0}"),
6253
- _0_was_also_declared_here_Colon: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_Colon_6203", "'{0}' was also declared here:"),
6252
+ _0_was_also_declared_here: diag(6203, ts.DiagnosticCategory.Message, "_0_was_also_declared_here_6203", "'{0}' was also declared here."),
6254
6253
  and_here: diag(6204, ts.DiagnosticCategory.Message, "and_here_6204", "and here."),
6255
6254
  All_type_parameters_are_unused: diag(6205, ts.DiagnosticCategory.Error, "All_type_parameters_are_unused_6205", "All type parameters are unused."),
6256
6255
  package_json_has_a_typesVersions_field_with_version_specific_path_mappings: diag(6206, ts.DiagnosticCategory.Message, "package_json_has_a_typesVersions_field_with_version_specific_path_mappings_6206", "'package.json' has a 'typesVersions' field with version-specific path mappings."),
@@ -6306,7 +6305,7 @@ var ts;
6306
6305
  Completeness: diag(6257, ts.DiagnosticCategory.Message, "Completeness_6257", "Completeness"),
6307
6306
  _0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file: diag(6258, ts.DiagnosticCategory.Error, "_0_should_be_set_inside_the_compilerOptions_object_of_the_config_json_file_6258", "'{0}' should be set inside the 'compilerOptions' object of the config json file"),
6308
6307
  Found_1_error_in_1: diag(6259, ts.DiagnosticCategory.Message, "Found_1_error_in_1_6259", "Found 1 error in {1}"),
6309
- Found_0_errors_in_1_file: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_file_6260", "Found {0} errors in 1 file."),
6308
+ Found_0_errors_in_the_same_file_starting_at_Colon_1: diag(6260, ts.DiagnosticCategory.Message, "Found_0_errors_in_the_same_file_starting_at_Colon_1_6260", "Found {0} errors in the same file, starting at: {1}"),
6310
6309
  Found_0_errors_in_1_files: diag(6261, ts.DiagnosticCategory.Message, "Found_0_errors_in_1_files_6261", "Found {0} errors in {1} files."),
6311
6310
  Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve: diag(6270, ts.DiagnosticCategory.Message, "Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve_6270", "Directory '{0}' has no containing package.json scope. Imports will not resolve."),
6312
6311
  Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1: diag(6271, ts.DiagnosticCategory.Message, "Import_specifier_0_does_not_exist_in_package_json_scope_at_path_1_6271", "Import specifier '{0}' does not exist in package.json scope at path '{1}'."),
@@ -11932,6 +11931,28 @@ var ts;
11932
11931
  }
11933
11932
  }
11934
11933
  ts.getThisContainer = getThisContainer;
11934
+ function isThisContainerOrFunctionBlock(node) {
11935
+ switch (node.kind) {
11936
+ case 213:
11937
+ case 255:
11938
+ case 212:
11939
+ case 166:
11940
+ return true;
11941
+ case 234:
11942
+ switch (node.parent.kind) {
11943
+ case 170:
11944
+ case 168:
11945
+ case 171:
11946
+ case 172:
11947
+ return true;
11948
+ default:
11949
+ return false;
11950
+ }
11951
+ default:
11952
+ return false;
11953
+ }
11954
+ }
11955
+ ts.isThisContainerOrFunctionBlock = isThisContainerOrFunctionBlock;
11935
11956
  function isInTopLevelContext(node) {
11936
11957
  if (ts.isIdentifier(node) && (ts.isClassDeclaration(node.parent) || ts.isFunctionDeclaration(node.parent)) && node.parent.name === node) {
11937
11958
  node = node.parent;
@@ -12262,7 +12283,7 @@ var ts;
12262
12283
  }
12263
12284
  ts.getExternalModuleImportEqualsDeclarationExpression = getExternalModuleImportEqualsDeclarationExpression;
12264
12285
  function getExternalModuleRequireArgument(node) {
12265
- return isRequireVariableDeclaration(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
12286
+ return isVariableDeclarationInitializedToBareOrAccessedRequire(node) && getLeftmostAccessExpression(node.initializer).arguments[0];
12266
12287
  }
12267
12288
  ts.getExternalModuleRequireArgument = getExternalModuleRequireArgument;
12268
12289
  function isInternalModuleImportEqualsDeclaration(node) {
@@ -12316,17 +12337,26 @@ var ts;
12316
12337
  return !requireStringLiteralLikeArgument || ts.isStringLiteralLike(arg);
12317
12338
  }
12318
12339
  ts.isRequireCall = isRequireCall;
12319
- function isRequireVariableDeclaration(node) {
12340
+ function isVariableDeclarationInitializedToRequire(node) {
12341
+ return isVariableDeclarationInitializedWithRequireHelper(node, false);
12342
+ }
12343
+ ts.isVariableDeclarationInitializedToRequire = isVariableDeclarationInitializedToRequire;
12344
+ function isVariableDeclarationInitializedToBareOrAccessedRequire(node) {
12345
+ return isVariableDeclarationInitializedWithRequireHelper(node, true);
12346
+ }
12347
+ ts.isVariableDeclarationInitializedToBareOrAccessedRequire = isVariableDeclarationInitializedToBareOrAccessedRequire;
12348
+ function isVariableDeclarationInitializedWithRequireHelper(node, allowAccessedRequire) {
12320
12349
  if (node.kind === 202) {
12321
12350
  node = node.parent.parent;
12322
12351
  }
12323
- return ts.isVariableDeclaration(node) && !!node.initializer && isRequireCall(getLeftmostAccessExpression(node.initializer), true);
12352
+ return ts.isVariableDeclaration(node) &&
12353
+ !!node.initializer &&
12354
+ isRequireCall(allowAccessedRequire ? getLeftmostAccessExpression(node.initializer) : node.initializer, true);
12324
12355
  }
12325
- ts.isRequireVariableDeclaration = isRequireVariableDeclaration;
12326
12356
  function isRequireVariableStatement(node) {
12327
12357
  return ts.isVariableStatement(node)
12328
12358
  && node.declarationList.declarations.length > 0
12329
- && ts.every(node.declarationList.declarations, function (decl) { return isRequireVariableDeclaration(decl); });
12359
+ && ts.every(node.declarationList.declarations, function (decl) { return isVariableDeclarationInitializedToRequire(decl); });
12330
12360
  }
12331
12361
  ts.isRequireVariableStatement = isRequireVariableStatement;
12332
12362
  function isSingleOrDoubleQuote(charCode) {
@@ -15286,7 +15316,7 @@ var ts;
15286
15316
  getSourceMapSourceConstructor: function () { return SourceMapSource; },
15287
15317
  };
15288
15318
  function setObjectAllocator(alloc) {
15289
- ts.objectAllocator = alloc;
15319
+ Object.assign(ts.objectAllocator, alloc);
15290
15320
  }
15291
15321
  ts.setObjectAllocator = setObjectAllocator;
15292
15322
  function formatStringFromArgs(text, args, baseIndex) {
@@ -15294,12 +15324,19 @@ var ts;
15294
15324
  return text.replace(/{(\d+)}/g, function (_match, index) { return "" + ts.Debug.checkDefined(args[+index + baseIndex]); });
15295
15325
  }
15296
15326
  ts.formatStringFromArgs = formatStringFromArgs;
15327
+ var localizedDiagnosticMessages;
15297
15328
  function setLocalizedDiagnosticMessages(messages) {
15298
- ts.localizedDiagnosticMessages = messages;
15329
+ localizedDiagnosticMessages = messages;
15299
15330
  }
15300
15331
  ts.setLocalizedDiagnosticMessages = setLocalizedDiagnosticMessages;
15332
+ function maybeSetLocalizedDiagnosticMessages(getMessages) {
15333
+ if (!localizedDiagnosticMessages && getMessages) {
15334
+ localizedDiagnosticMessages = getMessages();
15335
+ }
15336
+ }
15337
+ ts.maybeSetLocalizedDiagnosticMessages = maybeSetLocalizedDiagnosticMessages;
15301
15338
  function getLocaleSpecificMessage(message) {
15302
- return ts.localizedDiagnosticMessages && ts.localizedDiagnosticMessages[message.key] || message.message;
15339
+ return localizedDiagnosticMessages && localizedDiagnosticMessages[message.key] || message.message;
15303
15340
  }
15304
15341
  ts.getLocaleSpecificMessage = getLocaleSpecificMessage;
15305
15342
  function createDetachedDiagnostic(fileName, start, length, message) {
@@ -15687,16 +15724,6 @@ var ts;
15687
15724
  (symlinkedDirectories || (symlinkedDirectories = new ts.Map())).set(symlinkPath, real);
15688
15725
  }
15689
15726
  },
15690
- setSymlinkedDirectoryFromSymlinkedFile: function (symlink, real) {
15691
- this.setSymlinkedFile(ts.toPath(symlink, cwd, getCanonicalFileName), real);
15692
- var _a = guessDirectorySymlink(real, symlink, cwd, getCanonicalFileName) || ts.emptyArray, commonResolved = _a[0], commonOriginal = _a[1];
15693
- if (commonResolved && commonOriginal) {
15694
- this.setSymlinkedDirectory(commonOriginal, {
15695
- real: commonResolved,
15696
- realPath: ts.toPath(commonResolved, cwd, getCanonicalFileName),
15697
- });
15698
- }
15699
- },
15700
15727
  setSymlinksFromResolutions: function (files, typeReferenceDirectives) {
15701
15728
  var _this = this;
15702
15729
  var _a;
@@ -16534,9 +16561,19 @@ var ts;
16534
16561
  }
16535
16562
  ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
16536
16563
  function escapeSnippetText(text) {
16537
- return text.replace(/\$/gm, "\\$");
16564
+ return text.replace(/\$/gm, function () { return "\\$"; });
16538
16565
  }
16539
16566
  ts.escapeSnippetText = escapeSnippetText;
16567
+ function isNumericLiteralName(name) {
16568
+ return (+name).toString() === name;
16569
+ }
16570
+ ts.isNumericLiteralName = isNumericLiteralName;
16571
+ function createPropertyNameNodeForIdentifierOrLiteral(name, target, singleQuote, stringNamed) {
16572
+ return ts.isIdentifierText(name, target) ? ts.factory.createIdentifier(name) :
16573
+ !stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
16574
+ ts.factory.createStringLiteral(name, !!singleQuote);
16575
+ }
16576
+ ts.createPropertyNameNodeForIdentifierOrLiteral = createPropertyNameNodeForIdentifierOrLiteral;
16540
16577
  function isThisTypeParameter(type) {
16541
16578
  return !!(type.flags & 262144 && type.isThisType);
16542
16579
  }
@@ -20933,7 +20970,7 @@ var ts;
20933
20970
  return getExportName(node, allowComments, allowSourceMaps);
20934
20971
  }
20935
20972
  function copyPrologue(source, target, ensureUseStrict, visitor) {
20936
- var offset = copyStandardPrologue(source, target, ensureUseStrict);
20973
+ var offset = copyStandardPrologue(source, target, 0, ensureUseStrict);
20937
20974
  return copyCustomPrologue(source, target, offset, visitor);
20938
20975
  }
20939
20976
  function isUseStrictPrologue(node) {
@@ -20942,10 +20979,10 @@ var ts;
20942
20979
  function createUseStrictPrologue() {
20943
20980
  return ts.startOnNewLine(createExpressionStatement(createStringLiteral("use strict")));
20944
20981
  }
20945
- function copyStandardPrologue(source, target, ensureUseStrict) {
20982
+ function copyStandardPrologue(source, target, statementOffset, ensureUseStrict) {
20983
+ if (statementOffset === void 0) { statementOffset = 0; }
20946
20984
  ts.Debug.assert(target.length === 0, "Prologue directives should be at the first statement in the target statements array");
20947
20985
  var foundUseStrict = false;
20948
- var statementOffset = 0;
20949
20986
  var numStatements = source.length;
20950
20987
  while (statementOffset < numStatements) {
20951
20988
  var statement = source[statementOffset];
@@ -22095,7 +22132,7 @@ var ts;
22095
22132
  importName: "__createBinding",
22096
22133
  scoped: false,
22097
22134
  priority: 1,
22098
- text: "\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));"
22135
+ text: "\n var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n }) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n }));"
22099
22136
  };
22100
22137
  ts.setModuleDefaultHelper = {
22101
22138
  name: "typescript:commonjscreatevalue",
@@ -26889,18 +26926,18 @@ var ts;
26889
26926
  function parseInitializer() {
26890
26927
  return parseOptional(63) ? parseAssignmentExpressionOrHigher() : undefined;
26891
26928
  }
26892
- function parseAssignmentExpressionOrHigher() {
26929
+ function parseAssignmentExpressionOrHigher(parsingConditionalTrueSide) {
26893
26930
  if (isYieldExpression()) {
26894
26931
  return parseYieldExpression();
26895
26932
  }
26896
- var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
26933
+ var arrowExpression = tryParseParenthesizedArrowFunctionExpression(parsingConditionalTrueSide) || tryParseAsyncSimpleArrowFunctionExpression();
26897
26934
  if (arrowExpression) {
26898
26935
  return arrowExpression;
26899
26936
  }
26900
26937
  var pos = getNodePos();
26901
26938
  var expr = parseBinaryExpressionOrHigher(0);
26902
26939
  if (expr.kind === 79 && token() === 38) {
26903
- return parseSimpleArrowFunctionExpression(pos, expr, undefined);
26940
+ return parseSimpleArrowFunctionExpression(pos, expr, undefined, parsingConditionalTrueSide);
26904
26941
  }
26905
26942
  if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
26906
26943
  return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
@@ -26931,24 +26968,24 @@ var ts;
26931
26968
  return finishNode(factory.createYieldExpression(undefined, undefined), pos);
26932
26969
  }
26933
26970
  }
26934
- function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
26971
+ function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier, parsingConditionalTrueSide) {
26935
26972
  ts.Debug.assert(token() === 38, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
26936
26973
  var parameter = factory.createParameterDeclaration(undefined, undefined, undefined, identifier, undefined, undefined, undefined);
26937
26974
  finishNode(parameter, identifier.pos);
26938
26975
  var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
26939
26976
  var equalsGreaterThanToken = parseExpectedToken(38);
26940
- var body = parseArrowFunctionExpressionBody(!!asyncModifier);
26977
+ var body = parseArrowFunctionExpressionBody(!!asyncModifier, parsingConditionalTrueSide);
26941
26978
  var node = factory.createArrowFunction(asyncModifier, undefined, parameters, undefined, equalsGreaterThanToken, body);
26942
26979
  return addJSDocComment(finishNode(node, pos));
26943
26980
  }
26944
- function tryParseParenthesizedArrowFunctionExpression() {
26981
+ function tryParseParenthesizedArrowFunctionExpression(parsingConditionalTrueSide) {
26945
26982
  var triState = isParenthesizedArrowFunctionExpression();
26946
26983
  if (triState === 0) {
26947
26984
  return undefined;
26948
26985
  }
26949
26986
  return triState === 1 ?
26950
- parseParenthesizedArrowFunctionExpression(true) :
26951
- tryParse(parsePossibleParenthesizedArrowFunctionExpression);
26987
+ parseParenthesizedArrowFunctionExpression(true, parsingConditionalTrueSide) :
26988
+ tryParse(function () { return parsePossibleParenthesizedArrowFunctionExpression(parsingConditionalTrueSide); });
26952
26989
  }
26953
26990
  function isParenthesizedArrowFunctionExpression() {
26954
26991
  if (token() === 20 || token() === 29 || token() === 131) {
@@ -27042,24 +27079,24 @@ var ts;
27042
27079
  return 2;
27043
27080
  }
27044
27081
  }
27045
- function parsePossibleParenthesizedArrowFunctionExpression() {
27082
+ function parsePossibleParenthesizedArrowFunctionExpression(parsingConditionalTrueSide) {
27046
27083
  var tokenPos = scanner.getTokenPos();
27047
27084
  if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
27048
27085
  return undefined;
27049
27086
  }
27050
- var result = parseParenthesizedArrowFunctionExpression(false);
27087
+ var result = parseParenthesizedArrowFunctionExpression(false, parsingConditionalTrueSide);
27051
27088
  if (!result) {
27052
27089
  (notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
27053
27090
  }
27054
27091
  return result;
27055
27092
  }
27056
- function tryParseAsyncSimpleArrowFunctionExpression() {
27093
+ function tryParseAsyncSimpleArrowFunctionExpression(parsingConditionalTrueSide) {
27057
27094
  if (token() === 131) {
27058
27095
  if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1) {
27059
27096
  var pos = getNodePos();
27060
27097
  var asyncModifier = parseModifiersForArrowFunction();
27061
27098
  var expr = parseBinaryExpressionOrHigher(0);
27062
- return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
27099
+ return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier, parsingConditionalTrueSide);
27063
27100
  }
27064
27101
  }
27065
27102
  return undefined;
@@ -27077,7 +27114,7 @@ var ts;
27077
27114
  }
27078
27115
  return 0;
27079
27116
  }
27080
- function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
27117
+ function parseParenthesizedArrowFunctionExpression(allowAmbiguity, parsingConditionalTrueSide) {
27081
27118
  var pos = getNodePos();
27082
27119
  var hasJSDoc = hasPrecedingJSDocComment();
27083
27120
  var modifiers = parseModifiersForArrowFunction();
@@ -27096,6 +27133,10 @@ var ts;
27096
27133
  return undefined;
27097
27134
  }
27098
27135
  }
27136
+ if (parsingConditionalTrueSide && token() === 58) {
27137
+ ts.Debug.assert(!allowAmbiguity);
27138
+ return undefined;
27139
+ }
27099
27140
  var type = parseReturnType(58, false);
27100
27141
  if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
27101
27142
  return undefined;
@@ -27116,7 +27157,7 @@ var ts;
27116
27157
  var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
27117
27158
  return withJSDoc(finishNode(node, pos), hasJSDoc);
27118
27159
  }
27119
- function parseArrowFunctionExpressionBody(isAsync) {
27160
+ function parseArrowFunctionExpressionBody(isAsync, parsingConditionalTrueSide) {
27120
27161
  if (token() === 18) {
27121
27162
  return parseFunctionBlock(isAsync ? 2 : 0);
27122
27163
  }
@@ -27130,8 +27171,8 @@ var ts;
27130
27171
  var savedTopLevel = topLevel;
27131
27172
  topLevel = false;
27132
27173
  var node = isAsync
27133
- ? doInAwaitContext(parseAssignmentExpressionOrHigher)
27134
- : doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
27174
+ ? doInAwaitContext(function () { return parseAssignmentExpressionOrHigher(parsingConditionalTrueSide); })
27175
+ : doOutsideOfAwaitContext(function () { return parseAssignmentExpressionOrHigher(parsingConditionalTrueSide); });
27135
27176
  topLevel = savedTopLevel;
27136
27177
  return node;
27137
27178
  }
@@ -27141,8 +27182,8 @@ var ts;
27141
27182
  return leftOperand;
27142
27183
  }
27143
27184
  var colonToken;
27144
- return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
27145
- ? parseAssignmentExpressionOrHigher()
27185
+ return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, function () { return parseAssignmentExpressionOrHigher(true); }), colonToken = parseExpectedToken(58), ts.nodeIsPresent(colonToken)
27186
+ ? parseAssignmentExpressionOrHigher(false)
27146
27187
  : createMissingNode(79, false, ts.Diagnostics._0_expected, ts.tokenToString(58))), pos);
27147
27188
  }
27148
27189
  function parseBinaryExpressionOrHigher(precedence) {
@@ -28149,7 +28190,7 @@ var ts;
28149
28190
  var catchClause = token() === 83 ? parseCatchClause() : undefined;
28150
28191
  var finallyBlock;
28151
28192
  if (!catchClause || token() === 96) {
28152
- parseExpected(96);
28193
+ parseExpected(96, ts.Diagnostics.catch_or_finally_expected);
28153
28194
  finallyBlock = parseBlock(false);
28154
28195
  }
28155
28196
  return withJSDoc(finishNode(factory.createTryStatement(tryBlock, catchClause, finallyBlock), pos), hasJSDoc);
@@ -29073,7 +29114,7 @@ var ts;
29073
29114
  var pos = getNodePos();
29074
29115
  var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10);
29075
29116
  parseExpected(58);
29076
- var value = parseLiteralLikeNode(10);
29117
+ var value = parseAssignmentExpressionOrHigher();
29077
29118
  return finishNode(factory.createAssertEntry(name, value), pos);
29078
29119
  }
29079
29120
  function parseAssertClause() {
@@ -33517,7 +33558,7 @@ var ts;
33517
33558
  ? 1 : 0
33518
33559
  };
33519
33560
  }
33520
- if (ts.isImplicitGlob(spec)) {
33561
+ if (ts.isImplicitGlob(spec.substring(spec.lastIndexOf(ts.directorySeparator) + 1))) {
33521
33562
  return {
33522
33563
  key: useCaseSensitiveFileNames ? spec : ts.toFileNameLowerCase(spec),
33523
33564
  flags: 1
@@ -33844,9 +33885,7 @@ var ts;
33844
33885
  }
33845
33886
  }
33846
33887
  var failedLookupLocations = [];
33847
- var features = ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
33848
- ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
33849
- NodeResolutionFeatures.None;
33888
+ var features = getDefaultNodeResolutionFeatures(options);
33850
33889
  var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: ["node", "require", "types"] };
33851
33890
  var resolved = primaryLookup();
33852
33891
  var primary = true;
@@ -33929,6 +33968,30 @@ var ts;
33929
33968
  }
33930
33969
  }
33931
33970
  ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective;
33971
+ function getDefaultNodeResolutionFeatures(options) {
33972
+ return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 ? NodeResolutionFeatures.Node12Default :
33973
+ ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
33974
+ NodeResolutionFeatures.None;
33975
+ }
33976
+ function resolvePackageNameToPackageJson(packageName, containingDirectory, options, host, cache) {
33977
+ var moduleResolutionState = {
33978
+ compilerOptions: options,
33979
+ host: host,
33980
+ traceEnabled: isTraceEnabled(options, host),
33981
+ failedLookupLocations: [],
33982
+ packageJsonInfoCache: cache === null || cache === void 0 ? void 0 : cache.getPackageJsonInfoCache(),
33983
+ conditions: ts.emptyArray,
33984
+ features: NodeResolutionFeatures.None,
33985
+ };
33986
+ return ts.forEachAncestorDirectory(containingDirectory, function (ancestorDirectory) {
33987
+ if (ts.getBaseFileName(ancestorDirectory) !== "node_modules") {
33988
+ var nodeModulesFolder = ts.combinePaths(ancestorDirectory, "node_modules");
33989
+ var candidate = ts.combinePaths(nodeModulesFolder, packageName);
33990
+ return getPackageJsonInfo(candidate, false, moduleResolutionState);
33991
+ }
33992
+ });
33993
+ }
33994
+ ts.resolvePackageNameToPackageJson = resolvePackageNameToPackageJson;
33932
33995
  function getAutomaticTypeDirectiveNames(options, host) {
33933
33996
  if (options.types) {
33934
33997
  return options.types;
@@ -34388,10 +34451,6 @@ var ts;
34388
34451
  return resolvedModule.resolvedFileName;
34389
34452
  }
34390
34453
  ts.resolveJSModule = resolveJSModule;
34391
- function tryResolveJSModule(moduleName, initialDir, host) {
34392
- return tryResolveJSModuleWorker(moduleName, initialDir, host).resolvedModule;
34393
- }
34394
- ts.tryResolveJSModule = tryResolveJSModule;
34395
34454
  var NodeResolutionFeatures;
34396
34455
  (function (NodeResolutionFeatures) {
34397
34456
  NodeResolutionFeatures[NodeResolutionFeatures["None"] = 0] = "None";
@@ -34665,6 +34724,91 @@ var ts;
34665
34724
  var versionPaths = packageInfo && packageInfo.versionPaths;
34666
34725
  return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths));
34667
34726
  }
34727
+ function getEntrypointsFromPackageJsonInfo(packageJsonInfo, options, host, cache, resolveJs) {
34728
+ if (!resolveJs && packageJsonInfo.resolvedEntrypoints !== undefined) {
34729
+ return packageJsonInfo.resolvedEntrypoints;
34730
+ }
34731
+ var entrypoints;
34732
+ var extensions = resolveJs ? Extensions.JavaScript : Extensions.TypeScript;
34733
+ var features = getDefaultNodeResolutionFeatures(options);
34734
+ var requireState = {
34735
+ compilerOptions: options,
34736
+ host: host,
34737
+ traceEnabled: isTraceEnabled(options, host),
34738
+ failedLookupLocations: [],
34739
+ packageJsonInfoCache: cache === null || cache === void 0 ? void 0 : cache.getPackageJsonInfoCache(),
34740
+ conditions: ["node", "require", "types"],
34741
+ features: features,
34742
+ };
34743
+ var requireResolution = loadNodeModuleFromDirectoryWorker(extensions, packageJsonInfo.packageDirectory, false, requireState, packageJsonInfo.packageJsonContent, packageJsonInfo.versionPaths);
34744
+ entrypoints = ts.append(entrypoints, requireResolution === null || requireResolution === void 0 ? void 0 : requireResolution.path);
34745
+ if (features & NodeResolutionFeatures.Exports && packageJsonInfo.packageJsonContent.exports) {
34746
+ for (var _i = 0, _a = [["node", "import", "types"], ["node", "require", "types"]]; _i < _a.length; _i++) {
34747
+ var conditions = _a[_i];
34748
+ var exportState = __assign(__assign({}, requireState), { failedLookupLocations: [], conditions: conditions });
34749
+ var exportResolutions = loadEntrypointsFromExportMap(packageJsonInfo, packageJsonInfo.packageJsonContent.exports, exportState, extensions);
34750
+ if (exportResolutions) {
34751
+ for (var _b = 0, exportResolutions_1 = exportResolutions; _b < exportResolutions_1.length; _b++) {
34752
+ var resolution = exportResolutions_1[_b];
34753
+ entrypoints = ts.appendIfUnique(entrypoints, resolution.path);
34754
+ }
34755
+ }
34756
+ }
34757
+ }
34758
+ return packageJsonInfo.resolvedEntrypoints = entrypoints || false;
34759
+ }
34760
+ ts.getEntrypointsFromPackageJsonInfo = getEntrypointsFromPackageJsonInfo;
34761
+ function loadEntrypointsFromExportMap(scope, exports, state, extensions) {
34762
+ var entrypoints;
34763
+ if (ts.isArray(exports)) {
34764
+ for (var _i = 0, exports_1 = exports; _i < exports_1.length; _i++) {
34765
+ var target = exports_1[_i];
34766
+ loadEntrypointsFromTargetExports(target);
34767
+ }
34768
+ }
34769
+ else if (typeof exports === "object" && exports !== null && allKeysStartWithDot(exports)) {
34770
+ for (var key in exports) {
34771
+ loadEntrypointsFromTargetExports(exports[key]);
34772
+ }
34773
+ }
34774
+ else {
34775
+ loadEntrypointsFromTargetExports(exports);
34776
+ }
34777
+ return entrypoints;
34778
+ function loadEntrypointsFromTargetExports(target) {
34779
+ var _a, _b;
34780
+ if (typeof target === "string" && ts.startsWith(target, "./") && target.indexOf("*") === -1) {
34781
+ var partsAfterFirst = ts.getPathComponents(target).slice(2);
34782
+ if (partsAfterFirst.indexOf("..") >= 0 || partsAfterFirst.indexOf(".") >= 0 || partsAfterFirst.indexOf("node_modules") >= 0) {
34783
+ return false;
34784
+ }
34785
+ var resolvedTarget = ts.combinePaths(scope.packageDirectory, target);
34786
+ var finalPath = ts.getNormalizedAbsolutePath(resolvedTarget, (_b = (_a = state.host).getCurrentDirectory) === null || _b === void 0 ? void 0 : _b.call(_a));
34787
+ var result = loadJSOrExactTSFileName(extensions, finalPath, false, state);
34788
+ if (result) {
34789
+ entrypoints = ts.appendIfUnique(entrypoints, result, function (a, b) { return a.path === b.path; });
34790
+ return true;
34791
+ }
34792
+ }
34793
+ else if (Array.isArray(target)) {
34794
+ for (var _i = 0, target_1 = target; _i < target_1.length; _i++) {
34795
+ var t = target_1[_i];
34796
+ var success = loadEntrypointsFromTargetExports(t);
34797
+ if (success) {
34798
+ return true;
34799
+ }
34800
+ }
34801
+ }
34802
+ else if (typeof target === "object" && target !== null) {
34803
+ return ts.forEach(ts.getOwnKeys(target), function (key) {
34804
+ if (key === "default" || ts.contains(state.conditions, key) || isApplicableVersionedTypesKey(state.conditions, key)) {
34805
+ loadEntrypointsFromTargetExports(target[key]);
34806
+ return true;
34807
+ }
34808
+ });
34809
+ }
34810
+ }
34811
+ }
34668
34812
  function getPackageScopeForPath(fileName, packageJsonInfoCache, host, options) {
34669
34813
  var state = {
34670
34814
  host: host,
@@ -34716,7 +34860,7 @@ var ts;
34716
34860
  trace(host, ts.Diagnostics.Found_package_json_at_0, packageJsonPath);
34717
34861
  }
34718
34862
  var versionPaths = readPackageJsonTypesVersionPaths(packageJsonContent, state);
34719
- var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths };
34863
+ var result = { packageDirectory: packageDirectory, packageJsonContent: packageJsonContent, versionPaths: versionPaths, resolvedEntrypoints: undefined };
34720
34864
  (_b = state.packageJsonInfoCache) === null || _b === void 0 ? void 0 : _b.setPackageJsonInfo(packageJsonPath, result);
34721
34865
  return result;
34722
34866
  }
@@ -34998,8 +35142,8 @@ var ts;
34998
35142
  }
34999
35143
  return toSearchResult(undefined);
35000
35144
  }
35001
- for (var _d = 0, target_1 = target; _d < target_1.length; _d++) {
35002
- var elem = target_1[_d];
35145
+ for (var _d = 0, target_2 = target; _d < target_2.length; _d++) {
35146
+ var elem = target_2[_d];
35003
35147
  var result = loadModuleFromTargetImportOrExport(elem, subpath, pattern);
35004
35148
  if (result) {
35005
35149
  return result;
@@ -36458,22 +36602,27 @@ var ts;
36458
36602
  }
36459
36603
  return state;
36460
36604
  }
36461
- function onLeft(left, state, _node) {
36605
+ function onLeft(left, state, node) {
36462
36606
  if (!state.skip) {
36463
- return maybeBind(left);
36607
+ var maybeBound = maybeBind(left);
36608
+ if (node.operatorToken.kind === 27) {
36609
+ maybeBindExpressionFlowIfCall(left);
36610
+ }
36611
+ return maybeBound;
36464
36612
  }
36465
36613
  }
36466
- function onOperator(operatorToken, state, node) {
36614
+ function onOperator(operatorToken, state, _node) {
36467
36615
  if (!state.skip) {
36468
- if (operatorToken.kind === 27) {
36469
- maybeBindExpressionFlowIfCall(node.left);
36470
- }
36471
36616
  bind(operatorToken);
36472
36617
  }
36473
36618
  }
36474
- function onRight(right, state, _node) {
36619
+ function onRight(right, state, node) {
36475
36620
  if (!state.skip) {
36476
- return maybeBind(right);
36621
+ var maybeBound = maybeBind(right);
36622
+ if (node.operatorToken.kind === 27) {
36623
+ maybeBindExpressionFlowIfCall(right);
36624
+ }
36625
+ return maybeBound;
36477
36626
  }
36478
36627
  }
36479
36628
  function onExit(node, state) {
@@ -37104,6 +37253,8 @@ var ts;
37104
37253
  return;
37105
37254
  }
37106
37255
  ts.setParent(node, parent);
37256
+ if (ts.tracing)
37257
+ node.tracingPath = file.path;
37107
37258
  var saveInStrictMode = inStrictMode;
37108
37259
  bindWorker(node);
37109
37260
  if (node.kind > 159) {
@@ -37809,7 +37960,7 @@ var ts;
37809
37960
  checkStrictModeEvalOrArguments(node, node.name);
37810
37961
  }
37811
37962
  if (!ts.isBindingPattern(node.name)) {
37812
- if (ts.isInJSFile(node) && ts.isRequireVariableDeclaration(node) && !ts.getJSDocTypeTag(node)) {
37963
+ if (ts.isInJSFile(node) && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node) && !ts.getJSDocTypeTag(node)) {
37813
37964
  declareSymbolAndAddToSymbolTable(node, 2097152, 2097152);
37814
37965
  }
37815
37966
  else if (ts.isBlockOrCatchScoped(node)) {
@@ -38308,6 +38459,7 @@ var ts;
38308
38459
  var location = ts.getParseTreeNode(locationIn);
38309
38460
  return location ? getTypeOfSymbolAtLocation(symbol, location) : errorType;
38310
38461
  },
38462
+ getTypeOfSymbol: getTypeOfSymbol,
38311
38463
  getSymbolsOfParameterPropertyDeclaration: function (parameterIn, parameterName) {
38312
38464
  var parameter = ts.getParseTreeNode(parameterIn, ts.isParameter);
38313
38465
  if (parameter === undefined)
@@ -39153,7 +39305,7 @@ var ts;
39153
39305
  if (adjustedNode === errorNode)
39154
39306
  return "continue";
39155
39307
  err.relatedInformation = err.relatedInformation || [];
39156
- var leadingMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics._0_was_also_declared_here_Colon, symbolName);
39308
+ var leadingMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics._0_was_also_declared_here, symbolName);
39157
39309
  var followOnMessage = ts.createDiagnosticForNode(adjustedNode, ts.Diagnostics.and_here);
39158
39310
  if (ts.length(err.relatedInformation) >= 5 || ts.some(err.relatedInformation, function (r) { return ts.compareDiagnostics(r, followOnMessage) === 0 || ts.compareDiagnostics(r, leadingMessage) === 0; }))
39159
39311
  return "continue";
@@ -39747,7 +39899,7 @@ var ts;
39747
39899
  var diagnostic = createError(errorLocation, message, diagnosticName(nameArg), suggestionName);
39748
39900
  addErrorOrSuggestion(!isUncheckedJS, diagnostic);
39749
39901
  if (suggestion.valueDeclaration) {
39750
- ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here_Colon, suggestionName));
39902
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
39751
39903
  }
39752
39904
  }
39753
39905
  }
@@ -40044,7 +40196,7 @@ var ts;
40044
40196
  }
40045
40197
  }
40046
40198
  if (diagnosticMessage) {
40047
- ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics._0_is_declared_here_Colon, declarationName));
40199
+ ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(declaration, ts.Diagnostics._0_is_declared_here, declarationName));
40048
40200
  }
40049
40201
  }
40050
40202
  }
@@ -40086,7 +40238,7 @@ var ts;
40086
40238
  && isAliasableOrJsExpression(node.parent.right)
40087
40239
  || node.kind === 295
40088
40240
  || node.kind === 294 && isAliasableOrJsExpression(node.initializer)
40089
- || ts.isRequireVariableDeclaration(node);
40241
+ || ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node);
40090
40242
  }
40091
40243
  function isAliasableOrJsExpression(e) {
40092
40244
  return ts.isAliasableExpression(e) || ts.isFunctionExpression(e) && isJSConstructor(e);
@@ -40316,7 +40468,7 @@ var ts;
40316
40468
  var suggestionName = symbolToString(suggestion);
40317
40469
  var diagnostic = error(name, ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2, moduleName, declarationName, suggestionName);
40318
40470
  if (suggestion.valueDeclaration) {
40319
- ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here_Colon, suggestionName));
40471
+ ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestionName));
40320
40472
  }
40321
40473
  }
40322
40474
  else {
@@ -40348,7 +40500,7 @@ var ts;
40348
40500
  error(name, ts.Diagnostics.Module_0_declares_1_locally_but_it_is_not_exported, moduleName, declarationName);
40349
40501
  if (localSymbol.declarations) {
40350
40502
  ts.addRelatedInfo.apply(void 0, __spreadArray([diagnostic], ts.map(localSymbol.declarations, function (decl, index) {
40351
- return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics._0_is_declared_here_Colon : ts.Diagnostics.and_here, declarationName);
40503
+ return ts.createDiagnosticForNode(decl, index === 0 ? ts.Diagnostics._0_is_declared_here : ts.Diagnostics.and_here, declarationName);
40352
40504
  }), false));
40353
40505
  }
40354
40506
  }
@@ -40778,8 +40930,13 @@ var ts;
40778
40930
  var mode = contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
40779
40931
  var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, mode);
40780
40932
  var resolutionDiagnostic = resolvedModule && ts.getResolutionDiagnostic(compilerOptions, resolvedModule);
40781
- var sourceFile = resolvedModule && !resolutionDiagnostic && host.getSourceFile(resolvedModule.resolvedFileName);
40933
+ var sourceFile = resolvedModule
40934
+ && (!resolutionDiagnostic || resolutionDiagnostic === ts.Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set)
40935
+ && host.getSourceFile(resolvedModule.resolvedFileName);
40782
40936
  if (sourceFile) {
40937
+ if (resolutionDiagnostic) {
40938
+ error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
40939
+ }
40783
40940
  if (sourceFile.symbol) {
40784
40941
  if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
40785
40942
  errorOnImplicitAnyModule(false, errorNode, resolvedModule, moduleReference);
@@ -40942,7 +41099,7 @@ var ts;
40942
41099
  if (!sigs || !sigs.length) {
40943
41100
  sigs = getSignaturesOfStructuredType(type, 1);
40944
41101
  }
40945
- if ((sigs && sigs.length) || getPropertyOfType(type, "default")) {
41102
+ if ((sigs && sigs.length) || getPropertyOfType(type, "default", true)) {
40946
41103
  var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, reference);
40947
41104
  return cloneTypeAsModuleType(symbol, moduleType, referenceParent);
40948
41105
  }
@@ -41782,6 +41939,7 @@ var ts;
41782
41939
  getCommonSourceDirectory: !!host.getCommonSourceDirectory ? function () { return host.getCommonSourceDirectory(); } : function () { return ""; },
41783
41940
  getCurrentDirectory: function () { return host.getCurrentDirectory(); },
41784
41941
  getSymlinkCache: ts.maybeBind(host, host.getSymlinkCache),
41942
+ getPackageJsonInfoCache: function () { var _a; return (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host); },
41785
41943
  useCaseSensitiveFileNames: ts.maybeBind(host, host.useCaseSensitiveFileNames),
41786
41944
  redirectTargetsMap: host.redirectTargetsMap,
41787
41945
  getProjectReferenceRedirect: function (fileName) { return host.getProjectReferenceRedirect(fileName); },
@@ -42946,8 +43104,8 @@ var ts;
42946
43104
  }
42947
43105
  else {
42948
43106
  if (parent && getExportsOfSymbol(parent)) {
42949
- var exports_1 = getExportsOfSymbol(parent);
42950
- ts.forEachEntry(exports_1, function (ex, name) {
43107
+ var exports_2 = getExportsOfSymbol(parent);
43108
+ ts.forEachEntry(exports_2, function (ex, name) {
42951
43109
  if (getSymbolIfSameReference(ex, symbol) && !isLateBoundName(name) && name !== "export=") {
42952
43110
  symbolName = ts.unescapeLeadingUnderscores(name);
42953
43111
  return true;
@@ -43105,31 +43263,26 @@ var ts;
43105
43263
  }
43106
43264
  var rawName = ts.unescapeLeadingUnderscores(symbol.escapedName);
43107
43265
  var stringNamed = !!ts.length(symbol.declarations) && ts.every(symbol.declarations, isStringNamed);
43108
- return createPropertyNameNodeForIdentifierOrLiteral(rawName, stringNamed, singleQuote);
43266
+ return ts.createPropertyNameNodeForIdentifierOrLiteral(rawName, ts.getEmitScriptTarget(compilerOptions), singleQuote, stringNamed);
43109
43267
  }
43110
43268
  function getPropertyNameNodeForSymbolFromNameType(symbol, context, singleQuote) {
43111
43269
  var nameType = getSymbolLinks(symbol).nameType;
43112
43270
  if (nameType) {
43113
43271
  if (nameType.flags & 384) {
43114
43272
  var name = "" + nameType.value;
43115
- if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
43273
+ if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
43116
43274
  return ts.factory.createStringLiteral(name, !!singleQuote);
43117
43275
  }
43118
- if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
43276
+ if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
43119
43277
  return ts.factory.createComputedPropertyName(ts.factory.createNumericLiteral(+name));
43120
43278
  }
43121
- return createPropertyNameNodeForIdentifierOrLiteral(name);
43279
+ return ts.createPropertyNameNodeForIdentifierOrLiteral(name, ts.getEmitScriptTarget(compilerOptions));
43122
43280
  }
43123
43281
  if (nameType.flags & 8192) {
43124
43282
  return ts.factory.createComputedPropertyName(symbolToExpression(nameType.symbol, context, 111551));
43125
43283
  }
43126
43284
  }
43127
43285
  }
43128
- function createPropertyNameNodeForIdentifierOrLiteral(name, stringNamed, singleQuote) {
43129
- return ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) ? ts.factory.createIdentifier(name) :
43130
- !stringNamed && isNumericLiteralName(name) && +name >= 0 ? ts.factory.createNumericLiteral(+name) :
43131
- ts.factory.createStringLiteral(name, !!singleQuote);
43132
- }
43133
43286
  function cloneNodeBuilderContext(context) {
43134
43287
  var initial = __assign({}, context);
43135
43288
  if (initial.typeParameterNames) {
@@ -44325,10 +44478,10 @@ var ts;
44325
44478
  if (nameType) {
44326
44479
  if (nameType.flags & 384) {
44327
44480
  var name = "" + nameType.value;
44328
- if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !isNumericLiteralName(name)) {
44481
+ if (!ts.isIdentifierText(name, ts.getEmitScriptTarget(compilerOptions)) && !ts.isNumericLiteralName(name)) {
44329
44482
  return "\"" + ts.escapeString(name, 34) + "\"";
44330
44483
  }
44331
- if (isNumericLiteralName(name) && ts.startsWith(name, "-")) {
44484
+ if (ts.isNumericLiteralName(name) && ts.startsWith(name, "-")) {
44332
44485
  return "[" + name + "]";
44333
44486
  }
44334
44487
  return name;
@@ -45119,8 +45272,8 @@ var ts;
45119
45272
  if (s.valueDeclaration && exportedMember.valueDeclaration && ts.getSourceFileOfNode(s.valueDeclaration) !== ts.getSourceFileOfNode(exportedMember.valueDeclaration)) {
45120
45273
  var unescapedName = ts.unescapeLeadingUnderscores(s.escapedName);
45121
45274
  var exportedMemberName = ((_a = ts.tryCast(exportedMember.valueDeclaration, ts.isNamedDeclaration)) === null || _a === void 0 ? void 0 : _a.name) || exportedMember.valueDeclaration;
45122
- ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics._0_was_also_declared_here_Colon, unescapedName));
45123
- ts.addRelatedInfo(error(exportedMemberName, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(s.valueDeclaration, ts.Diagnostics._0_was_also_declared_here_Colon, unescapedName));
45275
+ ts.addRelatedInfo(error(s.valueDeclaration, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(exportedMemberName, ts.Diagnostics._0_was_also_declared_here, unescapedName));
45276
+ ts.addRelatedInfo(error(exportedMemberName, ts.Diagnostics.Duplicate_identifier_0, unescapedName), ts.createDiagnosticForNode(s.valueDeclaration, ts.Diagnostics._0_was_also_declared_here, unescapedName));
45124
45277
  }
45125
45278
  var union = createSymbol(s.flags | exportedMember.flags, name);
45126
45279
  union.type = getUnionType([getTypeOfSymbol(s), getTypeOfSymbol(exportedMember)]);
@@ -46370,7 +46523,7 @@ var ts;
46370
46523
  if (lateSymbol.flags & getExcludedSymbolFlags(symbolFlags) || earlySymbol) {
46371
46524
  var declarations = earlySymbol ? ts.concatenate(earlySymbol.declarations, lateSymbol.declarations) : lateSymbol.declarations;
46372
46525
  var name_4 = !(type.flags & 8192) && ts.unescapeLeadingUnderscores(memberName) || ts.declarationNameToString(declName);
46373
- ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Property_0_was_also_declared_here_Colon, name_4); });
46526
+ ts.forEach(declarations, function (declaration) { return error(ts.getNameOfDeclaration(declaration) || declaration, ts.Diagnostics.Property_0_was_also_declared_here, name_4); });
46374
46527
  error(declName || decl, ts.Diagnostics.Duplicate_property_0, name_4);
46375
46528
  lateSymbol = createSymbol(0, memberName, 4096);
46376
46529
  }
@@ -47303,6 +47456,9 @@ var ts;
47303
47456
  return simplified !== type ? simplified : getConstraintOfType(type);
47304
47457
  }
47305
47458
  function getConstraintFromIndexedAccess(type) {
47459
+ if (isMappedTypeGenericIndexedAccess(type)) {
47460
+ return substituteIndexedMappedType(type.objectType, type.indexType);
47461
+ }
47306
47462
  var indexConstraint = getSimplifiedTypeOrConstraint(type.indexType);
47307
47463
  if (indexConstraint && indexConstraint !== type.indexType) {
47308
47464
  var indexedAccess = getIndexedAccessTypeOrUndefined(type.objectType, indexConstraint, type.accessFlags);
@@ -47471,6 +47627,9 @@ var ts;
47471
47627
  return constraint ? getStringMappingType(t.symbol, constraint) : stringType;
47472
47628
  }
47473
47629
  if (t.flags & 8388608) {
47630
+ if (isMappedTypeGenericIndexedAccess(t)) {
47631
+ return getBaseConstraint(substituteIndexedMappedType(t.objectType, t.indexType));
47632
+ }
47474
47633
  var baseObjectType = getBaseConstraint(t.objectType);
47475
47634
  var baseIndexType = getBaseConstraint(t.indexType);
47476
47635
  var baseIndexedAccess = baseObjectType && baseIndexType && getIndexedAccessTypeOrUndefined(baseObjectType, baseIndexType, t.accessFlags);
@@ -47537,9 +47696,7 @@ var ts;
47537
47696
  !isGenericMappedType(type.objectType) && isGenericIndexType(type.indexType);
47538
47697
  }
47539
47698
  function getApparentType(type) {
47540
- var t = !(type.flags & 465829888) ? type :
47541
- isMappedTypeGenericIndexedAccess(type) ? substituteIndexedMappedType(type.objectType, type.indexType) :
47542
- getBaseConstraintOfType(type) || unknownType;
47699
+ var t = !(type.flags & 465829888) ? type : getBaseConstraintOfType(type) || unknownType;
47543
47700
  return ts.getObjectFlags(t) & 32 ? getApparentTypeOfMappedType(t) :
47544
47701
  t.flags & 2097152 ? getApparentTypeOfIntersectionType(t) :
47545
47702
  t.flags & 402653316 ? globalStringType :
@@ -47826,7 +47983,7 @@ var ts;
47826
47983
  function isApplicableIndexType(source, target) {
47827
47984
  return isTypeAssignableTo(source, target) ||
47828
47985
  target === stringType && isTypeAssignableTo(source, numberType) ||
47829
- target === numberType && !!(source.flags & 128) && isNumericLiteralName(source.value);
47986
+ target === numberType && !!(source.flags & 128) && ts.isNumericLiteralName(source.value);
47830
47987
  }
47831
47988
  function getIndexInfosOfStructuredType(type) {
47832
47989
  if (type.flags & 3670016) {
@@ -50129,7 +50286,7 @@ var ts;
50129
50286
  getFlowTypeOfReference(accessExpression, propType) :
50130
50287
  propType;
50131
50288
  }
50132
- if (everyType(objectType, isTupleType) && isNumericLiteralName(propName) && +propName >= 0) {
50289
+ if (everyType(objectType, isTupleType) && ts.isNumericLiteralName(propName) && +propName >= 0) {
50133
50290
  if (accessNode && everyType(objectType, function (t) { return !t.target.hasRestElement; }) && !(accessFlags & 16)) {
50134
50291
  var indexNode = getIndexNodeForAccessExpression(accessNode);
50135
50292
  if (isTupleType(objectType)) {
@@ -50384,7 +50541,7 @@ var ts;
50384
50541
  return everyType(indexType, function (t) {
50385
50542
  if (t.flags & 384) {
50386
50543
  var propName = getPropertyNameFromType(t);
50387
- if (isNumericLiteralName(propName)) {
50544
+ if (ts.isNumericLiteralName(propName)) {
50388
50545
  var index = +propName;
50389
50546
  return index >= 0 && index < limit;
50390
50547
  }
@@ -53410,6 +53567,15 @@ var ts;
53410
53567
  resetErrorInfo(saveErrorInfo);
53411
53568
  return result;
53412
53569
  }
53570
+ if (isMappedTypeGenericIndexedAccess(source)) {
53571
+ var indexConstraint = getConstraintOfType(source.indexType);
53572
+ if (indexConstraint) {
53573
+ if (result = isRelatedTo(getIndexedAccessType(source.objectType, indexConstraint), target, 1, reportErrors)) {
53574
+ resetErrorInfo(saveErrorInfo);
53575
+ return result;
53576
+ }
53577
+ }
53578
+ }
53413
53579
  }
53414
53580
  }
53415
53581
  else if (source.flags & 4194304) {
@@ -53469,7 +53635,7 @@ var ts;
53469
53635
  }
53470
53636
  }
53471
53637
  else {
53472
- var distributiveConstraint = getConstraintOfDistributiveConditionalType(source);
53638
+ var distributiveConstraint = hasNonCircularBaseConstraint(source) ? getConstraintOfDistributiveConditionalType(source) : undefined;
53473
53639
  if (distributiveConstraint) {
53474
53640
  if (result = isRelatedTo(distributiveConstraint, target, 1, reportErrors)) {
53475
53641
  resetErrorInfo(saveErrorInfo);
@@ -53782,7 +53948,7 @@ var ts;
53782
53948
  var propName = symbolToString(unmatchedProperty);
53783
53949
  reportError.apply(void 0, __spreadArray([ts.Diagnostics.Property_0_is_missing_in_type_1_but_required_in_type_2, propName], getTypeNamesForErrorDisplay(source, target), false));
53784
53950
  if (ts.length(unmatchedProperty.declarations)) {
53785
- associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here_Colon, propName));
53951
+ associateRelatedInfo(ts.createDiagnosticForNode(unmatchedProperty.declarations[0], ts.Diagnostics._0_is_declared_here, propName));
53786
53952
  }
53787
53953
  if (shouldSkipElaboration && errorInfo) {
53788
53954
  overrideNextErrorInfo++;
@@ -53927,7 +54093,7 @@ var ts;
53927
54093
  for (var _b = 0, _c = excludeProperties(properties, excludedProperties); _b < _c.length; _b++) {
53928
54094
  var targetProp = _c[_b];
53929
54095
  var name = targetProp.escapedName;
53930
- if (!(targetProp.flags & 4194304) && (!numericNamesOnly || isNumericLiteralName(name) || name === "length")) {
54096
+ if (!(targetProp.flags & 4194304) && (!numericNamesOnly || ts.isNumericLiteralName(name) || name === "length")) {
53931
54097
  var sourceProp = getPropertyOfType(source, name);
53932
54098
  if (sourceProp && sourceProp !== targetProp) {
53933
54099
  var related = propertyRelatedTo(source, target, sourceProp, targetProp, getNonMissingTypeOfSymbol, reportErrors, intersectionState, relation === comparableRelation);
@@ -53996,7 +54162,8 @@ var ts;
53996
54162
  var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
53997
54163
  var sourceObjectFlags = ts.getObjectFlags(source);
53998
54164
  var targetObjectFlags = ts.getObjectFlags(target);
53999
- if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source.symbol === target.symbol) {
54165
+ if (sourceObjectFlags & 64 && targetObjectFlags & 64 && source.symbol === target.symbol ||
54166
+ sourceObjectFlags & 4 && targetObjectFlags & 4 && source.target === target.target) {
54000
54167
  for (var i = 0; i < targetSignatures.length; i++) {
54001
54168
  var related = signatureRelatedTo(sourceSignatures[i], targetSignatures[i], true, reportErrors, incompatibleReporter(sourceSignatures[i], targetSignatures[i]));
54002
54169
  if (!related) {
@@ -54877,9 +55044,12 @@ var ts;
54877
55044
  && ((target.flags & (8 | 4 | 16)) !== 0);
54878
55045
  }
54879
55046
  function isObjectTypeWithInferableIndex(type) {
54880
- return type.flags & 2097152 ? ts.every(type.types, isObjectTypeWithInferableIndex) :
54881
- !!(type.symbol && (type.symbol.flags & (4096 | 2048 | 384 | 512)) !== 0 &&
54882
- !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 1024 && isObjectTypeWithInferableIndex(type.source));
55047
+ return type.flags & 2097152
55048
+ ? ts.every(type.types, isObjectTypeWithInferableIndex)
55049
+ : !!(type.symbol
55050
+ && (type.symbol.flags & (4096 | 2048 | 384 | 512)) !== 0
55051
+ && !(type.symbol.flags & 32)
55052
+ && !typeHasCallOrConstructSignatures(type)) || !!(ts.getObjectFlags(type) & 1024 && isObjectTypeWithInferableIndex(type.source));
54883
55053
  }
54884
55054
  function createSymbolWithType(source, type) {
54885
55055
  var symbol = createSymbol(source.flags, source.escapedName, ts.getCheckFlags(source) & 8);
@@ -56527,10 +56697,21 @@ var ts;
56527
56697
  }
56528
56698
  if (flags & 2097152) {
56529
56699
  ignoreObjects || (ignoreObjects = maybeTypeOfKind(type, 131068));
56530
- return ts.reduceLeft(type.types, function (facts, t) { return facts & getTypeFacts(t, ignoreObjects); }, 16777215);
56700
+ return getIntersectionTypeFacts(type, ignoreObjects);
56531
56701
  }
56532
56702
  return 16777215;
56533
56703
  }
56704
+ function getIntersectionTypeFacts(type, ignoreObjects) {
56705
+ var oredFacts = 0;
56706
+ var andedFacts = 16777215;
56707
+ for (var _i = 0, _a = type.types; _i < _a.length; _i++) {
56708
+ var t = _a[_i];
56709
+ var f = getTypeFacts(t, ignoreObjects);
56710
+ oredFacts |= f;
56711
+ andedFacts &= f;
56712
+ }
56713
+ return oredFacts & 8288 | andedFacts & 16768927;
56714
+ }
56534
56715
  function getTypeWithFacts(type, include) {
56535
56716
  return filterType(type, function (t) { return (getTypeFacts(t) & include) !== 0; });
56536
56717
  }
@@ -59146,7 +59327,7 @@ var ts;
59146
59327
  }
59147
59328
  if (isTupleType(t)) {
59148
59329
  var restType = getRestTypeOfTupleType(t);
59149
- if (restType && isNumericLiteralName(name) && +name >= 0) {
59330
+ if (restType && ts.isNumericLiteralName(name) && +name >= 0) {
59150
59331
  return restType;
59151
59332
  }
59152
59333
  }
@@ -59689,10 +59870,10 @@ var ts;
59689
59870
  case 161:
59690
59871
  return isNumericComputedName(name);
59691
59872
  case 79:
59692
- return isNumericLiteralName(name.escapedText);
59873
+ return ts.isNumericLiteralName(name.escapedText);
59693
59874
  case 8:
59694
59875
  case 10:
59695
- return isNumericLiteralName(name.text);
59876
+ return ts.isNumericLiteralName(name.text);
59696
59877
  default:
59697
59878
  return false;
59698
59879
  }
@@ -59700,9 +59881,6 @@ var ts;
59700
59881
  function isNumericComputedName(name) {
59701
59882
  return isTypeAssignableToKind(checkComputedPropertyName(name), 296);
59702
59883
  }
59703
- function isNumericLiteralName(name) {
59704
- return (+name).toString() === name;
59705
- }
59706
59884
  function checkComputedPropertyName(node) {
59707
59885
  var links = getNodeLinks(node.expression);
59708
59886
  if (!links.resolvedType) {
@@ -59731,7 +59909,7 @@ var ts;
59731
59909
  function isSymbolWithNumericName(symbol) {
59732
59910
  var _a;
59733
59911
  var firstDecl = (_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a[0];
59734
- return isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
59912
+ return ts.isNumericLiteralName(symbol.escapedName) || (firstDecl && ts.isNamedDeclaration(firstDecl) && isNumericName(firstDecl.name));
59735
59913
  }
59736
59914
  function isSymbolWithSymbolName(symbol) {
59737
59915
  var _a;
@@ -60859,7 +61037,7 @@ var ts;
60859
61037
  diagnosticMessage = error(right, ts.Diagnostics.Class_0_used_before_its_declaration, declarationName);
60860
61038
  }
60861
61039
  if (diagnosticMessage) {
60862
- ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics._0_is_declared_here_Colon, declarationName));
61040
+ ts.addRelatedInfo(diagnosticMessage, ts.createDiagnosticForNode(valueDeclaration, ts.Diagnostics._0_is_declared_here, declarationName));
60863
61041
  }
60864
61042
  }
60865
61043
  function isInPropertyInitializerOrClassStaticBlock(node) {
@@ -60949,7 +61127,7 @@ var ts;
60949
61127
  var suggestedName = ts.symbolName(suggestion);
60950
61128
  var message = isUncheckedJS ? ts.Diagnostics.Property_0_may_not_exist_on_type_1_Did_you_mean_2 : ts.Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2;
60951
61129
  errorInfo = ts.chainDiagnosticMessages(errorInfo, message, missingProperty, container, suggestedName);
60952
- relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here_Colon, suggestedName);
61130
+ relatedInfo = suggestion.valueDeclaration && ts.createDiagnosticForNode(suggestion.valueDeclaration, ts.Diagnostics._0_is_declared_here, suggestedName);
60953
61131
  }
60954
61132
  else {
60955
61133
  var diagnostic = containerSeemsToBeEmptyDomElement(containingType)
@@ -61607,7 +61785,7 @@ var ts;
61607
61785
  var diag = ts.createDiagnosticForNode(node.tagName, ts.Diagnostics.Tag_0_expects_at_least_1_arguments_but_the_JSX_factory_2_provides_at_most_3, ts.entityNameToString(node.tagName), absoluteMinArgCount, ts.entityNameToString(factory), maxParamCount);
61608
61786
  var tagNameDeclaration = (_a = getSymbolAtLocation(node.tagName)) === null || _a === void 0 ? void 0 : _a.valueDeclaration;
61609
61787
  if (tagNameDeclaration) {
61610
- ts.addRelatedInfo(diag, ts.createDiagnosticForNode(tagNameDeclaration, ts.Diagnostics._0_is_declared_here_Colon, ts.entityNameToString(node.tagName)));
61788
+ ts.addRelatedInfo(diag, ts.createDiagnosticForNode(tagNameDeclaration, ts.Diagnostics._0_is_declared_here, ts.entityNameToString(node.tagName)));
61611
61789
  }
61612
61790
  if (errorOutputContainer && errorOutputContainer.skipLogging) {
61613
61791
  (errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
@@ -65123,7 +65301,7 @@ var ts;
65123
65301
  }
65124
65302
  }
65125
65303
  function checkExpression(node, checkMode, forceTuple) {
65126
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end });
65304
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkExpression", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
65127
65305
  var saveCurrentNode = currentNode;
65128
65306
  currentNode = node;
65129
65307
  instantiationCount = 0;
@@ -65703,25 +65881,29 @@ var ts;
65703
65881
  if (classExtendsNull) {
65704
65882
  error(superCall, ts.Diagnostics.A_constructor_cannot_contain_a_super_call_when_its_class_extends_null);
65705
65883
  }
65706
- var superCallShouldBeFirst = (ts.getEmitScriptTarget(compilerOptions) !== 99 || !useDefineForClassFields) &&
65884
+ var superCallShouldBeRootLevel = (ts.getEmitScriptTarget(compilerOptions) !== 99 || !useDefineForClassFields) &&
65707
65885
  (ts.some(node.parent.members, isInstancePropertyWithInitializerOrPrivateIdentifierProperty) ||
65708
65886
  ts.some(node.parameters, function (p) { return ts.hasSyntacticModifier(p, 16476); }));
65709
- if (superCallShouldBeFirst) {
65710
- var statements = node.body.statements;
65711
- var superCallStatement = void 0;
65712
- for (var _i = 0, statements_4 = statements; _i < statements_4.length; _i++) {
65713
- var statement = statements_4[_i];
65714
- if (statement.kind === 237 && ts.isSuperCall(statement.expression)) {
65715
- superCallStatement = statement;
65716
- break;
65887
+ if (superCallShouldBeRootLevel) {
65888
+ if (!superCallIsRootLevelInConstructor(superCall, node.body)) {
65889
+ error(superCall, ts.Diagnostics.A_super_call_must_be_a_root_level_statement_within_a_constructor_of_a_derived_class_that_contains_initialized_properties_parameter_properties_or_private_identifiers);
65890
+ }
65891
+ else {
65892
+ var superCallStatement = void 0;
65893
+ for (var _i = 0, _a = node.body.statements; _i < _a.length; _i++) {
65894
+ var statement = _a[_i];
65895
+ if (ts.isExpressionStatement(statement) && ts.isSuperCall(ts.skipOuterExpressions(statement.expression))) {
65896
+ superCallStatement = statement;
65897
+ break;
65898
+ }
65899
+ if (!ts.isPrologueDirective(statement) && nodeImmediatelyReferencesSuperOrThis(statement)) {
65900
+ break;
65901
+ }
65717
65902
  }
65718
- if (!ts.isPrologueDirective(statement)) {
65719
- break;
65903
+ if (superCallStatement === undefined) {
65904
+ error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_to_refer_to_super_or_this_when_a_derived_class_contains_initialized_properties_parameter_properties_or_private_identifiers);
65720
65905
  }
65721
65906
  }
65722
- if (!superCallStatement) {
65723
- error(node, ts.Diagnostics.A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_parameter_properties_or_private_identifiers);
65724
- }
65725
65907
  }
65726
65908
  }
65727
65909
  else if (!classExtendsNull) {
@@ -65729,6 +65911,19 @@ var ts;
65729
65911
  }
65730
65912
  }
65731
65913
  }
65914
+ function superCallIsRootLevelInConstructor(superCall, body) {
65915
+ var superCallParent = ts.walkUpParenthesizedExpressions(superCall.parent);
65916
+ return ts.isExpressionStatement(superCallParent) && superCallParent.parent === body;
65917
+ }
65918
+ function nodeImmediatelyReferencesSuperOrThis(node) {
65919
+ if (node.kind === 106 || node.kind === 108) {
65920
+ return true;
65921
+ }
65922
+ if (ts.isThisContainerOrFunctionBlock(node)) {
65923
+ return false;
65924
+ }
65925
+ return !!ts.forEachChild(node, nodeImmediatelyReferencesSuperOrThis);
65926
+ }
65732
65927
  function checkAccessorDeclaration(node) {
65733
65928
  if (produceDiagnostics) {
65734
65929
  if (!checkGrammarFunctionLikeDeclaration(node) && !checkGrammarAccessor(node))
@@ -67363,7 +67558,7 @@ var ts;
67363
67558
  return;
67364
67559
  }
67365
67560
  var symbol = getSymbolOfNode(node);
67366
- if (symbol.flags & 2097152 && ts.isRequireVariableDeclaration(node)) {
67561
+ if (symbol.flags & 2097152 && ts.isVariableDeclarationInitializedToBareOrAccessedRequire(node)) {
67367
67562
  checkAliasSymbol(node);
67368
67563
  return;
67369
67564
  }
@@ -67415,7 +67610,7 @@ var ts;
67415
67610
  var declName = ts.declarationNameToString(nextDeclarationName);
67416
67611
  var err = error(nextDeclarationName, message, declName, typeToString(firstType), typeToString(nextType));
67417
67612
  if (firstDeclaration) {
67418
- ts.addRelatedInfo(err, ts.createDiagnosticForNode(firstDeclaration, ts.Diagnostics._0_was_also_declared_here_Colon, declName));
67613
+ ts.addRelatedInfo(err, ts.createDiagnosticForNode(firstDeclaration, ts.Diagnostics._0_was_also_declared_here, declName));
67419
67614
  }
67420
67615
  }
67421
67616
  function areDeclarationFlagsIdentical(left, right) {
@@ -67435,7 +67630,7 @@ var ts;
67435
67630
  return ts.getSelectedEffectiveModifierFlags(left, interestingFlags) === ts.getSelectedEffectiveModifierFlags(right, interestingFlags);
67436
67631
  }
67437
67632
  function checkVariableDeclaration(node) {
67438
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end });
67633
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkVariableDeclaration", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
67439
67634
  checkGrammarVariableDeclaration(node);
67440
67635
  checkVariableLikeDeclaration(node);
67441
67636
  ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
@@ -69044,7 +69239,7 @@ var ts;
69044
69239
  }
69045
69240
  else {
69046
69241
  var text = ts.getTextOfPropertyName(member.name);
69047
- if (isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
69242
+ if (ts.isNumericLiteralName(text) && !ts.isInfinityOrNaNString(text)) {
69048
69243
  error(member.name, ts.Diagnostics.An_enum_member_cannot_have_a_numeric_name);
69049
69244
  }
69050
69245
  }
@@ -69424,6 +69619,17 @@ var ts;
69424
69619
  return false;
69425
69620
  }
69426
69621
  }
69622
+ if (!ts.isImportEqualsDeclaration(node) && node.assertClause) {
69623
+ var hasError = false;
69624
+ for (var _i = 0, _a = node.assertClause.elements; _i < _a.length; _i++) {
69625
+ var clause = _a[_i];
69626
+ if (!ts.isStringLiteral(clause.value)) {
69627
+ hasError = true;
69628
+ error(clause.value, ts.Diagnostics.Import_assertion_values_must_be_string_literal_expressions);
69629
+ }
69630
+ }
69631
+ return !hasError;
69632
+ }
69427
69633
  return true;
69428
69634
  }
69429
69635
  function checkAliasSymbol(node) {
@@ -69763,9 +69969,9 @@ var ts;
69763
69969
  error(declaration, ts.Diagnostics.An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements);
69764
69970
  }
69765
69971
  }
69766
- var exports_2 = getExportsOfModule(moduleSymbol);
69767
- if (exports_2) {
69768
- exports_2.forEach(function (_a, id) {
69972
+ var exports_3 = getExportsOfModule(moduleSymbol);
69973
+ if (exports_3) {
69974
+ exports_3.forEach(function (_a, id) {
69769
69975
  var declarations = _a.declarations, flags = _a.flags;
69770
69976
  if (id === "__export") {
69771
69977
  return;
@@ -70059,7 +70265,7 @@ var ts;
70059
70265
  }
70060
70266
  }
70061
70267
  function checkDeferredNode(node) {
70062
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end });
70268
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("check", "checkDeferredNode", { kind: node.kind, pos: node.pos, end: node.end, path: node.tracingPath });
70063
70269
  var saveCurrentNode = currentNode;
70064
70270
  currentNode = node;
70065
70271
  instantiationCount = 0;
@@ -73639,7 +73845,7 @@ var ts;
73639
73845
  return factory.updateAssertClause(node, nodesVisitor(node.elements, visitor, ts.isAssertEntry), node.multiLine);
73640
73846
  case 293:
73641
73847
  ts.Debug.type(node);
73642
- return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.isStringLiteral));
73848
+ return factory.updateAssertEntry(node, nodeVisitor(node.name, visitor, ts.isAssertionKey), nodeVisitor(node.value, visitor, ts.isExpressionNode));
73643
73849
  case 266:
73644
73850
  ts.Debug.type(node);
73645
73851
  return factory.updateImportClause(node, node.isTypeOnly, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.namedBindings, visitor, ts.isNamedImportBindings));
@@ -74592,25 +74798,26 @@ var ts;
74592
74798
  }
74593
74799
  }
74594
74800
  ts.getNonAssignmentOperatorForCompoundAssignment = getNonAssignmentOperatorForCompoundAssignment;
74595
- function addPrologueDirectivesAndInitialSuperCall(factory, ctor, result, visitor) {
74596
- if (ctor.body) {
74597
- var statements = ctor.body.statements;
74598
- var index = factory.copyPrologue(statements, result, false, visitor);
74599
- if (index === statements.length) {
74600
- return index;
74601
- }
74602
- var superIndex = ts.findIndex(statements, function (s) { return ts.isExpressionStatement(s) && ts.isSuperCall(s.expression); }, index);
74603
- if (superIndex > -1) {
74604
- for (var i = index; i <= superIndex; i++) {
74605
- result.push(ts.visitNode(statements[i], visitor, ts.isStatement));
74606
- }
74607
- return superIndex + 1;
74801
+ function getSuperCallFromStatement(statement) {
74802
+ if (!ts.isExpressionStatement(statement)) {
74803
+ return undefined;
74804
+ }
74805
+ var expression = ts.skipParentheses(statement.expression);
74806
+ return ts.isSuperCall(expression)
74807
+ ? expression
74808
+ : undefined;
74809
+ }
74810
+ ts.getSuperCallFromStatement = getSuperCallFromStatement;
74811
+ function findSuperStatementIndex(statements, indexAfterLastPrologueStatement) {
74812
+ for (var i = indexAfterLastPrologueStatement; i < statements.length; i += 1) {
74813
+ var statement = statements[i];
74814
+ if (getSuperCallFromStatement(statement)) {
74815
+ return i;
74608
74816
  }
74609
- return index;
74610
74817
  }
74611
- return 0;
74818
+ return -1;
74612
74819
  }
74613
- ts.addPrologueDirectivesAndInitialSuperCall = addPrologueDirectivesAndInitialSuperCall;
74820
+ ts.findSuperStatementIndex = findSuperStatementIndex;
74614
74821
  function getProperties(node, requireInitializer, isStatic) {
74615
74822
  return ts.filter(node.members, function (m) { return isInitializedOrStaticProperty(m, requireInitializer, isStatic); });
74616
74823
  }
@@ -75813,6 +76020,7 @@ var ts;
75813
76020
  case 176:
75814
76021
  case 133:
75815
76022
  return factory.createIdentifier("Boolean");
76023
+ case 197:
75816
76024
  case 149:
75817
76025
  return factory.createIdentifier("String");
75818
76026
  case 147:
@@ -76050,11 +76258,20 @@ var ts;
76050
76258
  return ts.visitFunctionBody(body, visitor, context);
76051
76259
  }
76052
76260
  var statements = [];
76053
- var indexOfFirstStatement = 0;
76054
76261
  resumeLexicalEnvironment();
76055
- indexOfFirstStatement = ts.addPrologueDirectivesAndInitialSuperCall(factory, constructor, statements, visitor);
76056
- ts.addRange(statements, ts.map(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment));
76057
- ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, indexOfFirstStatement));
76262
+ var indexAfterLastPrologueStatement = factory.copyPrologue(body.statements, statements, false, visitor);
76263
+ var superStatementIndex = ts.findSuperStatementIndex(body.statements, indexAfterLastPrologueStatement);
76264
+ if (superStatementIndex >= 0) {
76265
+ ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, indexAfterLastPrologueStatement, superStatementIndex + 1 - indexAfterLastPrologueStatement));
76266
+ }
76267
+ var parameterPropertyAssignments = ts.mapDefined(parametersWithPropertyAssignments, transformParameterWithPropertyAssignment);
76268
+ if (superStatementIndex >= 0) {
76269
+ ts.addRange(statements, parameterPropertyAssignments);
76270
+ }
76271
+ else {
76272
+ statements = ts.addRange(parameterPropertyAssignments, statements);
76273
+ }
76274
+ ts.addRange(statements, ts.visitNodes(body.statements, visitor, ts.isStatement, superStatementIndex + 1));
76058
76275
  statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
76059
76276
  var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), body.statements), true);
76060
76277
  ts.setTextRange(block, body);
@@ -77436,6 +77653,7 @@ var ts;
77436
77653
  return ts.startOnNewLine(ts.setOriginalNode(ts.setTextRange(factory.createConstructorDeclaration(undefined, undefined, parameters !== null && parameters !== void 0 ? parameters : [], body), constructor || node), constructor));
77437
77654
  }
77438
77655
  function transformConstructorBody(node, constructor, isDerivedClass) {
77656
+ var _a;
77439
77657
  var properties = ts.getProperties(node, false, false);
77440
77658
  if (!useDefineForClassFields) {
77441
77659
  properties = ts.filter(properties, function (property) { return !!property.initializer || ts.isPrivateIdentifier(property.name); });
@@ -77446,34 +77664,65 @@ var ts;
77446
77664
  return ts.visitFunctionBody(undefined, visitor, context);
77447
77665
  }
77448
77666
  resumeLexicalEnvironment();
77449
- var indexOfFirstStatement = 0;
77667
+ var needsSyntheticConstructor = !constructor && isDerivedClass;
77668
+ var indexOfFirstStatementAfterSuper = 0;
77669
+ var prologueStatementCount = 0;
77670
+ var superStatementIndex = -1;
77450
77671
  var statements = [];
77451
- if (!constructor && isDerivedClass) {
77452
- statements.push(factory.createExpressionStatement(factory.createCallExpression(factory.createSuper(), undefined, [factory.createSpreadElement(factory.createIdentifier("arguments"))])));
77672
+ if ((_a = constructor === null || constructor === void 0 ? void 0 : constructor.body) === null || _a === void 0 ? void 0 : _a.statements) {
77673
+ prologueStatementCount = factory.copyPrologue(constructor.body.statements, statements, false, visitor);
77674
+ superStatementIndex = ts.findSuperStatementIndex(constructor.body.statements, prologueStatementCount);
77675
+ if (superStatementIndex >= 0) {
77676
+ indexOfFirstStatementAfterSuper = superStatementIndex + 1;
77677
+ statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, prologueStatementCount), true), ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, prologueStatementCount, indexOfFirstStatementAfterSuper - prologueStatementCount), true), statements.slice(prologueStatementCount), true);
77678
+ }
77453
77679
  }
77454
- if (constructor) {
77455
- indexOfFirstStatement = ts.addPrologueDirectivesAndInitialSuperCall(factory, constructor, statements, visitor);
77680
+ if (needsSyntheticConstructor) {
77681
+ statements.push(factory.createExpressionStatement(factory.createCallExpression(factory.createSuper(), undefined, [factory.createSpreadElement(factory.createIdentifier("arguments"))])));
77456
77682
  }
77683
+ var parameterPropertyDeclarationCount = 0;
77457
77684
  if (constructor === null || constructor === void 0 ? void 0 : constructor.body) {
77458
- var afterParameterProperties = ts.findIndex(constructor.body.statements, function (s) { return !ts.isParameterPropertyDeclaration(ts.getOriginalNode(s), constructor); }, indexOfFirstStatement);
77459
- if (afterParameterProperties === -1) {
77460
- afterParameterProperties = constructor.body.statements.length;
77685
+ if (useDefineForClassFields) {
77686
+ statements = statements.filter(function (statement) { return !ts.isParameterPropertyDeclaration(ts.getOriginalNode(statement), constructor); });
77461
77687
  }
77462
- if (afterParameterProperties > indexOfFirstStatement) {
77463
- if (!useDefineForClassFields) {
77464
- ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement, afterParameterProperties - indexOfFirstStatement));
77688
+ else {
77689
+ for (var _i = 0, _b = constructor.body.statements; _i < _b.length; _i++) {
77690
+ var statement = _b[_i];
77691
+ if (ts.isParameterPropertyDeclaration(ts.getOriginalNode(statement), constructor)) {
77692
+ parameterPropertyDeclarationCount++;
77693
+ }
77694
+ }
77695
+ if (parameterPropertyDeclarationCount > 0) {
77696
+ var parameterProperties = ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatementAfterSuper, parameterPropertyDeclarationCount);
77697
+ if (superStatementIndex >= 0) {
77698
+ ts.addRange(statements, parameterProperties);
77699
+ }
77700
+ else if (needsSyntheticConstructor) {
77701
+ statements = __spreadArray(__spreadArray([
77702
+ statements[0]
77703
+ ], parameterProperties, true), statements.slice(1), true);
77704
+ }
77705
+ else {
77706
+ statements = __spreadArray(__spreadArray([], parameterProperties, true), statements, true);
77707
+ }
77708
+ indexOfFirstStatementAfterSuper += parameterPropertyDeclarationCount;
77465
77709
  }
77466
- indexOfFirstStatement = afterParameterProperties;
77467
77710
  }
77468
77711
  }
77469
77712
  var receiver = factory.createThis();
77470
77713
  addMethodStatements(statements, privateMethodsAndAccessors, receiver);
77471
77714
  addPropertyOrClassStaticBlockStatements(statements, properties, receiver);
77472
77715
  if (constructor) {
77473
- ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, indexOfFirstStatement));
77716
+ ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitBodyStatement, ts.isStatement, indexOfFirstStatementAfterSuper + prologueStatementCount));
77474
77717
  }
77475
77718
  statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
77476
77719
  return ts.setTextRange(factory.createBlock(ts.setTextRange(factory.createNodeArray(statements), constructor ? constructor.body.statements : node.members), true), constructor ? constructor.body : undefined);
77720
+ function visitBodyStatement(statement) {
77721
+ if (useDefineForClassFields && ts.isParameterPropertyDeclaration(ts.getOriginalNode(statement), constructor)) {
77722
+ return undefined;
77723
+ }
77724
+ return visitor(statement);
77725
+ }
77477
77726
  }
77478
77727
  function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
77479
77728
  for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
@@ -77488,6 +77737,8 @@ var ts;
77488
77737
  ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
77489
77738
  ts.setCommentRange(statement, property);
77490
77739
  ts.setOriginalNode(statement, property);
77740
+ ts.setSyntheticLeadingComments(expression, undefined);
77741
+ ts.setSyntheticTrailingComments(expression, undefined);
77491
77742
  statements.push(statement);
77492
77743
  }
77493
77744
  }
@@ -79594,10 +79845,16 @@ var ts;
79594
79845
  var _a;
79595
79846
  var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
79596
79847
  var isStaticChildren = ts.length(nonWhitespaceChildren) > 1 || !!((_a = nonWhitespaceChildren[0]) === null || _a === void 0 ? void 0 : _a.dotDotDotToken);
79597
- var args = [tagName, objectProperties, !keyAttr ? factory.createVoidZero() : transformJsxAttributeInitializer(keyAttr.initializer)];
79848
+ var args = [tagName, objectProperties];
79849
+ if (keyAttr) {
79850
+ args.push(transformJsxAttributeInitializer(keyAttr.initializer));
79851
+ }
79598
79852
  if (compilerOptions.jsx === 5) {
79599
79853
  var originalFile = ts.getOriginalNode(currentSourceFile);
79600
79854
  if (originalFile && ts.isSourceFile(originalFile)) {
79855
+ if (keyAttr === undefined) {
79856
+ args.push(factory.createVoidZero());
79857
+ }
79601
79858
  args.push(isStaticChildren ? factory.createTrue() : factory.createFalse());
79602
79859
  var lineCol = ts.getLineAndCharacterOfPosition(originalFile, location.pos);
79603
79860
  args.push(factory.createObjectLiteralExpression([
@@ -80532,40 +80789,47 @@ var ts;
80532
80789
  var prologue = [];
80533
80790
  var statements = [];
80534
80791
  resumeLexicalEnvironment();
80535
- var statementOffset = 0;
80792
+ var existingPrologue = ts.takeWhile(constructor.body.statements, ts.isPrologueDirective);
80793
+ var _a = findSuperCallAndStatementIndex(constructor.body.statements, existingPrologue), superCall = _a.superCall, superStatementIndex = _a.superStatementIndex;
80794
+ var postSuperStatementsStart = superStatementIndex === -1 ? existingPrologue.length : superStatementIndex + 1;
80795
+ var statementOffset = postSuperStatementsStart;
80536
80796
  if (!hasSynthesizedSuper)
80537
- statementOffset = factory.copyStandardPrologue(constructor.body.statements, prologue, false);
80538
- addDefaultValueAssignmentsIfNeeded(statements, constructor);
80539
- addRestParameterIfNeeded(statements, constructor, hasSynthesizedSuper);
80797
+ statementOffset = factory.copyStandardPrologue(constructor.body.statements, prologue, statementOffset, false);
80540
80798
  if (!hasSynthesizedSuper)
80541
- statementOffset = factory.copyCustomPrologue(constructor.body.statements, statements, statementOffset, visitor);
80799
+ statementOffset = factory.copyCustomPrologue(constructor.body.statements, statements, statementOffset, visitor, undefined);
80542
80800
  var superCallExpression;
80543
80801
  if (hasSynthesizedSuper) {
80544
80802
  superCallExpression = createDefaultSuperCallOrThis();
80545
80803
  }
80546
- else if (isDerivedClass && statementOffset < constructor.body.statements.length) {
80547
- var firstStatement = constructor.body.statements[statementOffset];
80548
- if (ts.isExpressionStatement(firstStatement) && ts.isSuperCall(firstStatement.expression)) {
80549
- superCallExpression = visitImmediateSuperCallInBody(firstStatement.expression);
80550
- }
80804
+ else if (superCall) {
80805
+ superCallExpression = visitSuperCallInBody(superCall);
80551
80806
  }
80552
80807
  if (superCallExpression) {
80553
80808
  hierarchyFacts |= 8192;
80554
- statementOffset++;
80555
80809
  }
80810
+ addDefaultValueAssignmentsIfNeeded(prologue, constructor);
80811
+ addRestParameterIfNeeded(prologue, constructor, hasSynthesizedSuper);
80556
80812
  ts.addRange(statements, ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, statementOffset));
80557
80813
  factory.mergeLexicalEnvironment(prologue, endLexicalEnvironment());
80558
80814
  insertCaptureNewTargetIfNeeded(prologue, constructor, false);
80559
- if (isDerivedClass) {
80560
- if (superCallExpression && statementOffset === constructor.body.statements.length && !(constructor.body.transformFlags & 8192)) {
80561
- var superCall = ts.cast(ts.cast(superCallExpression, ts.isBinaryExpression).left, ts.isCallExpression);
80815
+ if (isDerivedClass || superCallExpression) {
80816
+ if (superCallExpression && postSuperStatementsStart === constructor.body.statements.length && !(constructor.body.transformFlags & 8192)) {
80817
+ var superCall_1 = ts.cast(ts.cast(superCallExpression, ts.isBinaryExpression).left, ts.isCallExpression);
80562
80818
  var returnStatement = factory.createReturnStatement(superCallExpression);
80563
- ts.setCommentRange(returnStatement, ts.getCommentRange(superCall));
80564
- ts.setEmitFlags(superCall, 1536);
80819
+ ts.setCommentRange(returnStatement, ts.getCommentRange(superCall_1));
80820
+ ts.setEmitFlags(superCall_1, 1536);
80565
80821
  statements.push(returnStatement);
80566
80822
  }
80567
80823
  else {
80568
- insertCaptureThisForNode(statements, constructor, superCallExpression || createActualThis());
80824
+ if (superStatementIndex <= existingPrologue.length) {
80825
+ insertCaptureThisForNode(statements, constructor, superCallExpression || createActualThis());
80826
+ }
80827
+ else {
80828
+ insertCaptureThisForNode(prologue, constructor, createActualThis());
80829
+ if (superCallExpression) {
80830
+ insertSuperThisCaptureThisForNode(statements, superCallExpression);
80831
+ }
80832
+ }
80569
80833
  if (!isSufficientlyCoveredByReturnStatements(constructor.body)) {
80570
80834
  statements.push(factory.createReturnStatement(factory.createUniqueName("_this", 16 | 32)));
80571
80835
  }
@@ -80574,9 +80838,23 @@ var ts;
80574
80838
  else {
80575
80839
  insertCaptureThisForNodeIfNeeded(prologue, constructor);
80576
80840
  }
80577
- var block = factory.createBlock(ts.setTextRange(factory.createNodeArray(ts.concatenate(prologue, statements)), constructor.body.statements), true);
80578
- ts.setTextRange(block, constructor.body);
80579
- return block;
80841
+ var body = factory.createBlock(ts.setTextRange(factory.createNodeArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], existingPrologue, true), prologue, true), (superStatementIndex <= existingPrologue.length ? ts.emptyArray : ts.visitNodes(constructor.body.statements, visitor, ts.isStatement, existingPrologue.length, superStatementIndex)), true), statements, true)), constructor.body.statements), true);
80842
+ ts.setTextRange(body, constructor.body);
80843
+ return body;
80844
+ }
80845
+ function findSuperCallAndStatementIndex(originalBodyStatements, existingPrologue) {
80846
+ for (var i = existingPrologue.length; i < originalBodyStatements.length; i += 1) {
80847
+ var superCall = ts.getSuperCallFromStatement(originalBodyStatements[i]);
80848
+ if (superCall) {
80849
+ return {
80850
+ superCall: superCall,
80851
+ superStatementIndex: i,
80852
+ };
80853
+ }
80854
+ }
80855
+ return {
80856
+ superStatementIndex: -1,
80857
+ };
80580
80858
  }
80581
80859
  function isSufficientlyCoveredByReturnStatements(statement) {
80582
80860
  if (statement.kind === 246) {
@@ -80703,6 +80981,12 @@ var ts;
80703
80981
  }
80704
80982
  return false;
80705
80983
  }
80984
+ function insertSuperThisCaptureThisForNode(statements, superExpression) {
80985
+ enableSubstitutionsForCapturedThis();
80986
+ var assignSuperExpression = factory.createExpressionStatement(factory.createBinaryExpression(factory.createThis(), 63, superExpression));
80987
+ ts.insertStatementAfterCustomPrologue(statements, assignSuperExpression);
80988
+ ts.setCommentRange(assignSuperExpression, ts.getOriginalNode(superExpression).parent);
80989
+ }
80706
80990
  function insertCaptureThisForNode(statements, node, initializer) {
80707
80991
  enableSubstitutionsForCapturedThis();
80708
80992
  var captureThisStatement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
@@ -80912,7 +81196,7 @@ var ts;
80912
81196
  var statementOffset;
80913
81197
  resumeLexicalEnvironment();
80914
81198
  if (ts.isBlock(body)) {
80915
- statementOffset = factory.copyStandardPrologue(body.statements, prologue, false);
81199
+ statementOffset = factory.copyStandardPrologue(body.statements, prologue, 0, false);
80916
81200
  statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor, ts.isHoistedFunction);
80917
81201
  statementOffset = factory.copyCustomPrologue(body.statements, statements, statementOffset, visitor, ts.isHoistedVariableStatement);
80918
81202
  }
@@ -81829,7 +82113,7 @@ var ts;
81829
82113
  ts.addRange(statements, classStatements, 1);
81830
82114
  return factory.restoreOuterExpressions(node.expression, factory.restoreOuterExpressions(variable.initializer, factory.restoreOuterExpressions(aliasAssignment && aliasAssignment.right, factory.updateCallExpression(call, factory.restoreOuterExpressions(call.expression, factory.updateFunctionExpression(func, undefined, undefined, undefined, undefined, func.parameters, undefined, factory.updateBlock(func.body, statements))), undefined, call.arguments))));
81831
82115
  }
81832
- function visitImmediateSuperCallInBody(node) {
82116
+ function visitSuperCallInBody(node) {
81833
82117
  return visitCallExpressionWithPotentialCapturedThisAssignment(node, false);
81834
82118
  }
81835
82119
  function visitCallExpressionWithPotentialCapturedThisAssignment(node, assignToCapturedThis) {
@@ -93440,8 +93724,8 @@ var ts;
93440
93724
  var gutterSeparator = " ";
93441
93725
  var resetEscapeSequence = "\u001b[0m";
93442
93726
  var ellipsis = "...";
93443
- var bullet = "● ";
93444
93727
  var halfIndent = " ";
93728
+ var indent = " ";
93445
93729
  function getCategoryFormat(category) {
93446
93730
  switch (category) {
93447
93731
  case ts.DiagnosticCategory.Error: return ForegroundColorEscapeSequences.Red;
@@ -93454,21 +93738,14 @@ var ts;
93454
93738
  return formatStyle + text + resetEscapeSequence;
93455
93739
  }
93456
93740
  ts.formatColorAndReset = formatColorAndReset;
93457
- function formatCodeSpan(file, start, length, indent, underlineColor, host) {
93741
+ function formatCodeSpan(file, start, length, indent, squiggleColor, host) {
93458
93742
  var _a = ts.getLineAndCharacterOfPosition(file, start), firstLine = _a.line, firstLineChar = _a.character;
93459
93743
  var _b = ts.getLineAndCharacterOfPosition(file, start + length), lastLine = _b.line, lastLineChar = _b.character;
93460
93744
  var lastLineInFile = ts.getLineAndCharacterOfPosition(file, file.text.length).line;
93461
- var gutterWidth = 1;
93462
93745
  var hasMoreThanFiveLines = (lastLine - firstLine) >= 4;
93463
- var whitespaceToTrim = Number.MAX_VALUE;
93464
- for (var i = firstLine; i <= lastLine; i++) {
93465
- if (hasMoreThanFiveLines && firstLine + 1 < i && i < lastLine - 1) {
93466
- i = lastLine - 1;
93467
- }
93468
- var lineStart = ts.getPositionOfLineAndCharacter(file, i, 0);
93469
- var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
93470
- var lineContent = file.text.slice(lineStart, lineEnd);
93471
- whitespaceToTrim = Math.min(whitespaceToTrim, ts.startWhitespaceCount(lineContent));
93746
+ var gutterWidth = (lastLine + 1 + "").length;
93747
+ if (hasMoreThanFiveLines) {
93748
+ gutterWidth = Math.max(ellipsis.length, gutterWidth);
93472
93749
  }
93473
93750
  var context = "";
93474
93751
  for (var i = firstLine; i <= lastLine; i++) {
@@ -93481,24 +93758,21 @@ var ts;
93481
93758
  var lineEnd = i < lastLineInFile ? ts.getPositionOfLineAndCharacter(file, i + 1, 0) : file.text.length;
93482
93759
  var lineContent = file.text.slice(lineStart, lineEnd);
93483
93760
  lineContent = ts.trimStringEnd(lineContent);
93484
- lineContent = lineContent.slice(whitespaceToTrim);
93485
93761
  lineContent = lineContent.replace(/\t/g, " ");
93486
- var gutterLine = "|";
93487
- context += indent + ts.padLeft(gutterLine, gutterWidth) + gutterSeparator;
93762
+ context += indent + formatColorAndReset(ts.padLeft(i + 1 + "", gutterWidth), gutterStyleSequence) + gutterSeparator;
93488
93763
  context += lineContent + host.getNewLine();
93489
- context += indent + ts.padLeft("", gutterWidth) + gutterSeparator;
93490
- context += underlineColor;
93764
+ context += indent + formatColorAndReset(ts.padLeft("", gutterWidth), gutterStyleSequence) + gutterSeparator;
93765
+ context += squiggleColor;
93491
93766
  if (i === firstLine) {
93492
93767
  var lastCharForLine = i === lastLine ? lastLineChar : undefined;
93493
- context += lineContent.slice(0, firstLineChar - whitespaceToTrim).replace(/\S/g, " ");
93494
- var amendedLastChar = lastCharForLine ? lastCharForLine - whitespaceToTrim : undefined;
93495
- context += lineContent.slice(firstLineChar - whitespaceToTrim, amendedLastChar).replace(/./g, "▔");
93768
+ context += lineContent.slice(0, firstLineChar).replace(/\S/g, " ");
93769
+ context += lineContent.slice(firstLineChar, lastCharForLine).replace(/./g, "~");
93496
93770
  }
93497
93771
  else if (i === lastLine) {
93498
- context += lineContent.slice(0, lastLineChar).replace(/./g, "▔");
93772
+ context += lineContent.slice(0, lastLineChar).replace(/./g, "~");
93499
93773
  }
93500
93774
  else {
93501
- context += lineContent.replace(/./g, "▔");
93775
+ context += lineContent.replace(/./g, "~");
93502
93776
  }
93503
93777
  context += resetEscapeSequence;
93504
93778
  }
@@ -93518,50 +93792,41 @@ var ts;
93518
93792
  }
93519
93793
  ts.formatLocation = formatLocation;
93520
93794
  function formatDiagnosticsWithColorAndContext(diagnostics, host) {
93521
- var _a, _b;
93522
- var terminalWidth = (_b = (_a = ts.sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(ts.sys)) !== null && _b !== void 0 ? _b : 0;
93523
- var indent = terminalWidth < 60 ? "" : halfIndent;
93524
93795
  var output = "";
93525
93796
  for (var _i = 0, diagnostics_4 = diagnostics; _i < diagnostics_4.length; _i++) {
93526
93797
  var diagnostic = diagnostics_4[_i];
93527
- var diagnosticCode = "TS" + diagnostic.code;
93528
93798
  if (diagnostic.file) {
93529
93799
  var file = diagnostic.file, start = diagnostic.start;
93530
- var location = formatLocation(file, start, host);
93531
- var locationLength = location.replace(/\u001b[[0-9]+m/g, "").length;
93532
- var codeLength = diagnosticCode.length;
93533
- output += bullet + location;
93534
- var defaultPad = codeLength + 1;
93535
- var padWidth = terminalWidth < 60 ? defaultPad : terminalWidth - (bullet.length + locationLength + codeLength);
93536
- if (padWidth < diagnosticCode.length)
93537
- padWidth = defaultPad;
93538
- output += ts.padLeft(diagnosticCode, padWidth);
93539
- output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, indent, getCategoryFormat(diagnostic.category), host);
93800
+ output += formatLocation(file, start, host);
93801
+ output += " - ";
93802
+ }
93803
+ output += formatColorAndReset(ts.diagnosticCategoryName(diagnostic), getCategoryFormat(diagnostic.category));
93804
+ output += formatColorAndReset(" TS" + diagnostic.code + ": ", ForegroundColorEscapeSequences.Grey);
93805
+ output += flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine());
93806
+ if (diagnostic.file) {
93540
93807
  output += host.getNewLine();
93808
+ output += formatCodeSpan(diagnostic.file, diagnostic.start, diagnostic.length, "", getCategoryFormat(diagnostic.category), host);
93541
93809
  }
93542
- var diagnosticText = flattenDiagnosticMessageText(diagnostic.messageText, host.getNewLine(), 0, true);
93543
- diagnosticText = ts.map(diagnosticText.split(host.getNewLine()), function (text) { return indent + text; }).join(host.getNewLine());
93544
- output += diagnosticText;
93545
- output += host.getNewLine();
93546
93810
  if (diagnostic.relatedInformation) {
93547
93811
  output += host.getNewLine();
93548
- for (var _c = 0, _d = diagnostic.relatedInformation; _c < _d.length; _c++) {
93549
- var _e = _d[_c], file = _e.file, start = _e.start, length_9 = _e.length, messageText = _e.messageText;
93550
- output += ts.trimStringStart(flattenDiagnosticMessageText(messageText, host.getNewLine(), 0, true));
93812
+ for (var _a = 0, _b = diagnostic.relatedInformation; _a < _b.length; _a++) {
93813
+ var _c = _b[_a], file = _c.file, start = _c.start, length_9 = _c.length, messageText = _c.messageText;
93551
93814
  if (file) {
93552
- output += " " + formatLocation(file, start, host);
93553
93815
  output += host.getNewLine();
93554
- output += formatCodeSpan(file, start, length_9, indent + " ", ForegroundColorEscapeSequences.Cyan, host);
93816
+ output += halfIndent + formatLocation(file, start, host);
93817
+ output += formatCodeSpan(file, start, length_9, indent, ForegroundColorEscapeSequences.Cyan, host);
93555
93818
  }
93819
+ output += host.getNewLine();
93820
+ output += indent + flattenDiagnosticMessageText(messageText, host.getNewLine());
93556
93821
  }
93557
93822
  }
93823
+ output += host.getNewLine();
93558
93824
  }
93559
93825
  return output;
93560
93826
  }
93561
93827
  ts.formatDiagnosticsWithColorAndContext = formatDiagnosticsWithColorAndContext;
93562
- function flattenDiagnosticMessageText(diag, newLine, indent, pretty) {
93828
+ function flattenDiagnosticMessageText(diag, newLine, indent) {
93563
93829
  if (indent === void 0) { indent = 0; }
93564
- if (pretty === void 0) { pretty = false; }
93565
93830
  if (ts.isString(diag)) {
93566
93831
  return diag;
93567
93832
  }
@@ -93571,14 +93836,9 @@ var ts;
93571
93836
  var result = "";
93572
93837
  if (indent) {
93573
93838
  result += newLine;
93574
- var indentsToReplaceWithNewLines = pretty ? 1 : 0;
93575
- if (indent > indentsToReplaceWithNewLines) {
93576
- for (var i = indentsToReplaceWithNewLines; i < indent; i++) {
93577
- result += " ";
93578
- }
93839
+ for (var i = 0; i < indent; i++) {
93840
+ result += " ";
93579
93841
  }
93580
- else
93581
- result += newLine;
93582
93842
  }
93583
93843
  result += diag.messageText;
93584
93844
  indent++;
@@ -98441,11 +98701,12 @@ var ts;
98441
98701
  };
98442
98702
  }
98443
98703
  function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
98704
+ var _a;
98444
98705
  if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node12
98445
98706
  && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
98446
98707
  return false;
98447
98708
  }
98448
- return ts.getImpliedNodeFormatForFile(importingSourceFileName, undefined, getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
98709
+ return ts.getImpliedNodeFormatForFile(importingSourceFileName, (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host), getModuleResolutionHost(host), compilerOptions) !== ts.ModuleKind.CommonJS;
98449
98710
  }
98450
98711
  function getModuleResolutionHost(host) {
98451
98712
  var _a;
@@ -98458,27 +98719,27 @@ var ts;
98458
98719
  useCaseSensitiveFileNames: (_a = host.useCaseSensitiveFileNames) === null || _a === void 0 ? void 0 : _a.call(host),
98459
98720
  };
98460
98721
  }
98461
- function updateModuleSpecifier(compilerOptions, importingSourceFileName, toFileName, host, oldImportSpecifier) {
98462
- var res = getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {});
98722
+ function updateModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, oldImportSpecifier) {
98723
+ var res = getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferencesForUpdate(compilerOptions, oldImportSpecifier, importingSourceFileName, host), {});
98463
98724
  if (res === oldImportSpecifier)
98464
98725
  return undefined;
98465
98726
  return res;
98466
98727
  }
98467
98728
  moduleSpecifiers_1.updateModuleSpecifier = updateModuleSpecifier;
98468
98729
  function getModuleSpecifier(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host) {
98469
- return getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {});
98730
+ return getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, getPreferences(host, {}, compilerOptions, importingSourceFile), {});
98470
98731
  }
98471
98732
  moduleSpecifiers_1.getModuleSpecifier = getModuleSpecifier;
98472
- function getNodeModulesPackageName(compilerOptions, importingSourceFileName, nodeModulesFileName, host, preferences) {
98473
- var info = getInfo(importingSourceFileName, host);
98474
- var modulePaths = getAllModulePaths(importingSourceFileName, nodeModulesFileName, host, preferences);
98475
- return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions, true); });
98733
+ function getNodeModulesPackageName(compilerOptions, importingSourceFile, nodeModulesFileName, host, preferences) {
98734
+ var info = getInfo(importingSourceFile.path, host);
98735
+ var modulePaths = getAllModulePaths(importingSourceFile.path, nodeModulesFileName, host, preferences);
98736
+ return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, true); });
98476
98737
  }
98477
98738
  moduleSpecifiers_1.getNodeModulesPackageName = getNodeModulesPackageName;
98478
- function getModuleSpecifierWorker(compilerOptions, importingSourceFileName, toFileName, host, preferences, userPreferences) {
98739
+ function getModuleSpecifierWorker(compilerOptions, importingSourceFile, importingSourceFileName, toFileName, host, preferences, userPreferences) {
98479
98740
  var info = getInfo(importingSourceFileName, host);
98480
98741
  var modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences);
98481
- return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions); }) ||
98742
+ return ts.firstDefined(modulePaths, function (modulePath) { return tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions); }) ||
98482
98743
  getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
98483
98744
  }
98484
98745
  function tryGetModuleSpecifiersFromCache(moduleSymbol, importingSourceFile, host, userPreferences) {
@@ -98537,7 +98798,7 @@ var ts;
98537
98798
  var relativeSpecifiers;
98538
98799
  for (var _i = 0, modulePaths_1 = modulePaths; _i < modulePaths_1.length; _i++) {
98539
98800
  var modulePath = modulePaths_1[_i];
98540
- var specifier = tryGetModuleNameAsNodeModule(modulePath, info, host, compilerOptions);
98801
+ var specifier = tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions);
98541
98802
  nodeModulesSpecifiers = ts.append(nodeModulesSpecifiers, specifier);
98542
98803
  if (specifier && modulePath.isRedirect) {
98543
98804
  return nodeModulesSpecifiers;
@@ -98867,7 +99128,7 @@ var ts;
98867
99128
  ? removeExtensionAndIndexPostFix(relativePath, ending, compilerOptions)
98868
99129
  : ts.removeFileExtension(relativePath);
98869
99130
  }
98870
- function tryGetModuleNameAsNodeModule(_a, _b, host, options, packageNameOnly) {
99131
+ function tryGetModuleNameAsNodeModule(_a, _b, importingSourceFile, host, options, packageNameOnly) {
98871
99132
  var path = _a.path, isRedirect = _a.isRedirect;
98872
99133
  var getCanonicalFileName = _b.getCanonicalFileName, sourceDirectory = _b.sourceDirectory;
98873
99134
  if (!host.fileExists || !host.readFile) {
@@ -98918,15 +99179,22 @@ var ts;
98918
99179
  var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
98919
99180
  return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? undefined : packageName;
98920
99181
  function tryDirectoryWithPackageJson(packageRootIndex) {
99182
+ var _a, _b;
98921
99183
  var packageRootPath = path.substring(0, packageRootIndex);
98922
99184
  var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
98923
99185
  var moduleFileToTry = path;
98924
- if (host.fileExists(packageJsonPath)) {
98925
- var packageJsonContent = JSON.parse(host.readFile(packageJsonPath));
99186
+ var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
99187
+ if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
99188
+ var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
98926
99189
  if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
98927
- var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string" ? tryGetModuleNameFromExports(options, path, packageRootPath, packageJsonContent.name, packageJsonContent.exports, ["node", "types"]) : undefined;
99190
+ var conditions = ["node", importingSourceFile.impliedNodeFormat === ts.ModuleKind.ESNext ? "import" : "require", "types"];
99191
+ var fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
99192
+ ? tryGetModuleNameFromExports(options, path, packageRootPath, ts.getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)
99193
+ : undefined;
98928
99194
  if (fromExports) {
98929
- var withJsExtension = !ts.hasTSFileExtension(fromExports.moduleFileToTry) ? fromExports : { moduleFileToTry: ts.removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
99195
+ var withJsExtension = !ts.hasTSFileExtension(fromExports.moduleFileToTry)
99196
+ ? fromExports
99197
+ : { moduleFileToTry: ts.removeFileExtension(fromExports.moduleFileToTry) + tryGetJSExtensionForFile(fromExports.moduleFileToTry, options) };
98930
99198
  return __assign(__assign({}, withJsExtension), { verbatimFromExports: true });
98931
99199
  }
98932
99200
  if (packageJsonContent.exports) {
@@ -99018,7 +99286,7 @@ var ts;
99018
99286
  function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
99019
99287
  return ts.firstDefined(rootDirs, function (rootDir) {
99020
99288
  var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
99021
- return isPathRelativeToParent(relativePath) ? undefined : relativePath;
99289
+ return relativePath !== undefined && isPathRelativeToParent(relativePath) ? undefined : relativePath;
99022
99290
  });
99023
99291
  }
99024
99292
  function removeExtensionAndIndexPostFix(fileName, ending, options) {
@@ -99184,25 +99452,34 @@ var ts;
99184
99452
  ts.Diagnostics.Found_0_errors_Watching_for_file_changes;
99185
99453
  }
99186
99454
  ts.getWatchErrorSummaryDiagnosticMessage = getWatchErrorSummaryDiagnosticMessage;
99187
- function getErrorSummaryText(errorCount, filesInError, newLine) {
99455
+ function prettyPathForFileError(error, cwd) {
99456
+ var line = ts.formatColorAndReset(":" + error.line, ts.ForegroundColorEscapeSequences.Grey);
99457
+ if (ts.pathIsAbsolute(error.fileName) && ts.pathIsAbsolute(cwd)) {
99458
+ return ts.getRelativePathFromDirectory(cwd, error.fileName, false) + line;
99459
+ }
99460
+ return error.fileName + line;
99461
+ }
99462
+ function getErrorSummaryText(errorCount, filesInError, newLine, host) {
99188
99463
  if (errorCount === 0)
99189
99464
  return "";
99190
99465
  var nonNilFiles = filesInError.filter(function (fileInError) { return fileInError !== undefined; });
99191
99466
  var distinctFileNamesWithLines = nonNilFiles.map(function (fileInError) { return fileInError.fileName + ":" + fileInError.line; })
99192
99467
  .filter(function (value, index, self) { return self.indexOf(value) === index; });
99468
+ var firstFileReference = nonNilFiles[0] && prettyPathForFileError(nonNilFiles[0], host.getCurrentDirectory());
99193
99469
  var d = errorCount === 1 ?
99194
99470
  ts.createCompilerDiagnostic(filesInError[0] !== undefined ?
99195
99471
  ts.Diagnostics.Found_1_error_in_1 :
99196
- ts.Diagnostics.Found_1_error, errorCount, distinctFileNamesWithLines[0]) :
99472
+ ts.Diagnostics.Found_1_error, errorCount, firstFileReference) :
99197
99473
  ts.createCompilerDiagnostic(distinctFileNamesWithLines.length === 0 ?
99198
99474
  ts.Diagnostics.Found_0_errors :
99199
99475
  distinctFileNamesWithLines.length === 1 ?
99200
- ts.Diagnostics.Found_0_errors_in_1_file :
99201
- ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length);
99202
- return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + (errorCount > 1 ? createTabularErrorsDisplay(nonNilFiles) : "");
99476
+ ts.Diagnostics.Found_0_errors_in_the_same_file_starting_at_Colon_1 :
99477
+ ts.Diagnostics.Found_0_errors_in_1_files, errorCount, distinctFileNamesWithLines.length === 1 ? firstFileReference : distinctFileNamesWithLines.length);
99478
+ var suffix = distinctFileNamesWithLines.length > 1 ? createTabularErrorsDisplay(nonNilFiles, host) : "";
99479
+ return "" + newLine + ts.flattenDiagnosticMessageText(d.messageText, newLine) + newLine + newLine + suffix;
99203
99480
  }
99204
99481
  ts.getErrorSummaryText = getErrorSummaryText;
99205
- function createTabularErrorsDisplay(filesInError) {
99482
+ function createTabularErrorsDisplay(filesInError, host) {
99206
99483
  var distinctFiles = filesInError.filter(function (value, index, self) { return index === self.findIndex(function (file) { return (file === null || file === void 0 ? void 0 : file.fileName) === (value === null || value === void 0 ? void 0 : value.fileName); }); });
99207
99484
  if (distinctFiles.length === 0)
99208
99485
  return "";
@@ -99221,7 +99498,8 @@ var ts;
99221
99498
  var leftPadding = errorCountDigitsLength < leftPaddingGoal ?
99222
99499
  " ".repeat(leftPaddingGoal - errorCountDigitsLength)
99223
99500
  : "";
99224
- tabularData += "" + leftPadding + errorCount + " " + file.fileName + ":" + file.line + "\n";
99501
+ var fileRef = prettyPathForFileError(file, host.getCurrentDirectory());
99502
+ tabularData += "" + leftPadding + errorCount + " " + fileRef + "\n";
99225
99503
  });
99226
99504
  return tabularData;
99227
99505
  }
@@ -99603,7 +99881,7 @@ var ts;
99603
99881
  var system = input.system || ts.sys;
99604
99882
  var host = input.host || (input.host = ts.createIncrementalCompilerHost(input.options, system));
99605
99883
  var builderProgram = ts.createIncrementalProgram(input);
99606
- var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine)); } : undefined);
99884
+ var exitStatus = emitFilesAndReportErrorsAndGetExitStatus(builderProgram, input.reportDiagnostic || createDiagnosticReporter(system), function (s) { return host.trace && host.trace(s); }, input.reportErrorSummary || input.options.pretty ? function (errorCount, filesInError) { return system.write(getErrorSummaryText(errorCount, filesInError, system.newLine, host)); } : undefined);
99607
99885
  if (input.afterProgramEmitAndDiagnostics)
99608
99886
  input.afterProgramEmitAndDiagnostics(builderProgram);
99609
99887
  return exitStatus;
@@ -99686,6 +99964,7 @@ var ts;
99686
99964
  var sharedExtendedConfigFileWatchers;
99687
99965
  var extendedConfigCache = host.extendedConfigCache;
99688
99966
  var changesAffectResolution = false;
99967
+ var reportFileChangeDetectedOnCreateProgram = false;
99689
99968
  var sourceFilesCache = new ts.Map();
99690
99969
  var missingFilePathsRequestedForRelease;
99691
99970
  var hasChangedCompilerOptions = false;
@@ -99839,14 +100118,21 @@ var ts;
99839
100118
  var hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution || changesAffectResolution);
99840
100119
  if (ts.isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
99841
100120
  if (hasChangedConfigFileParsingErrors) {
100121
+ if (reportFileChangeDetectedOnCreateProgram) {
100122
+ reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
100123
+ }
99842
100124
  builderProgram = createProgram(undefined, undefined, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
99843
100125
  hasChangedConfigFileParsingErrors = false;
99844
100126
  }
99845
100127
  }
99846
100128
  else {
100129
+ if (reportFileChangeDetectedOnCreateProgram) {
100130
+ reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
100131
+ }
99847
100132
  createNewProgram(hasInvalidatedResolution);
99848
100133
  }
99849
100134
  changesAffectResolution = false;
100135
+ reportFileChangeDetectedOnCreateProgram = false;
99850
100136
  if (host.afterProgramCreate && program !== builderProgram) {
99851
100137
  host.afterProgramCreate(builderProgram);
99852
100138
  }
@@ -100025,7 +100311,7 @@ var ts;
100025
100311
  }
100026
100312
  function updateProgramWithWatchStatus() {
100027
100313
  timerToUpdateProgram = undefined;
100028
- reportWatchDiagnostic(ts.Diagnostics.File_change_detected_Starting_incremental_compilation);
100314
+ reportFileChangeDetectedOnCreateProgram = true;
100029
100315
  updateProgram();
100030
100316
  }
100031
100317
  function updateProgram() {
@@ -102313,7 +102599,7 @@ var ts;
102313
102599
  }
102314
102600
  function createReportErrorSummary(sys, options) {
102315
102601
  return shouldBePretty(sys, options) ?
102316
- function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine)); } :
102602
+ function (errorCount, filesInError) { return sys.write(ts.getErrorSummaryText(errorCount, filesInError, sys.newLine, sys)); } :
102317
102603
  undefined;
102318
102604
  }
102319
102605
  function performCompilation(sys, cb, reportDiagnostic, config) {