@typescript-deploys/pr-build 5.3.0-pr-52972-6 → 5.3.0-pr-54242-4
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/lib.dom.d.ts +4 -0
- package/lib/lib.es5.d.ts +9 -1
- package/lib/lib.webworker.d.ts +2 -0
- package/lib/tsc.js +625 -518
- package/lib/tsserver.js +796 -623
- package/lib/typescript.d.ts +96 -32
- package/lib/typescript.js +790 -618
- package/lib/typingsInstaller.js +192 -126
- package/package.json +2 -2
package/lib/tsc.js
CHANGED
|
@@ -18,7 +18,7 @@ and limitations under the License.
|
|
|
18
18
|
|
|
19
19
|
// src/compiler/corePublic.ts
|
|
20
20
|
var versionMajorMinor = "5.3";
|
|
21
|
-
var version = `${versionMajorMinor}.0-insiders.
|
|
21
|
+
var version = `${versionMajorMinor}.0-insiders.20230922`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3312,9 +3312,12 @@ var SyntaxKind = /* @__PURE__ */ ((SyntaxKind4) => {
|
|
|
3312
3312
|
SyntaxKind4[SyntaxKind4["DefaultClause"] = 297] = "DefaultClause";
|
|
3313
3313
|
SyntaxKind4[SyntaxKind4["HeritageClause"] = 298] = "HeritageClause";
|
|
3314
3314
|
SyntaxKind4[SyntaxKind4["CatchClause"] = 299] = "CatchClause";
|
|
3315
|
-
SyntaxKind4[SyntaxKind4["
|
|
3316
|
-
SyntaxKind4[SyntaxKind4["
|
|
3317
|
-
SyntaxKind4[SyntaxKind4["
|
|
3315
|
+
SyntaxKind4[SyntaxKind4["ImportAttributes"] = 300] = "ImportAttributes";
|
|
3316
|
+
SyntaxKind4[SyntaxKind4["ImportAttribute"] = 301] = "ImportAttribute";
|
|
3317
|
+
SyntaxKind4[SyntaxKind4["ImportTypeAttributes"] = 302] = "ImportTypeAttributes";
|
|
3318
|
+
SyntaxKind4[SyntaxKind4["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
|
|
3319
|
+
SyntaxKind4[SyntaxKind4["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
|
|
3320
|
+
SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 302 /* ImportTypeAttributes */] = "ImportTypeAssertionContainer";
|
|
3318
3321
|
SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
3319
3322
|
SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
3320
3323
|
SyntaxKind4[SyntaxKind4["SpreadAssignment"] = 305] = "SpreadAssignment";
|
|
@@ -5691,6 +5694,7 @@ var Diagnostics = {
|
|
|
5691
5694
|
_0_expected: diag(1005, 1 /* Error */, "_0_expected_1005", "'{0}' expected."),
|
|
5692
5695
|
A_file_cannot_have_a_reference_to_itself: diag(1006, 1 /* Error */, "A_file_cannot_have_a_reference_to_itself_1006", "A file cannot have a reference to itself."),
|
|
5693
5696
|
The_parser_expected_to_find_a_1_to_match_the_0_token_here: diag(1007, 1 /* Error */, "The_parser_expected_to_find_a_1_to_match_the_0_token_here_1007", "The parser expected to find a '{1}' to match the '{0}' token here."),
|
|
5697
|
+
The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword: diag(1008, 1 /* Error */, "The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword_1008", "The 'assert' keyword in import attributes is deprecated and has been replaced by the 'with' keyword."),
|
|
5694
5698
|
Trailing_comma_not_allowed: diag(1009, 1 /* Error */, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
|
|
5695
5699
|
Asterisk_Slash_expected: diag(1010, 1 /* Error */, "Asterisk_Slash_expected_1010", "'*/' expected."),
|
|
5696
5700
|
An_element_access_expression_should_take_an_argument: diag(1011, 1 /* Error */, "An_element_access_expression_should_take_an_argument_1011", "An element access expression should take an argument."),
|
|
@@ -6054,7 +6058,7 @@ var Diagnostics = {
|
|
|
6054
6058
|
_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),
|
|
6055
6059
|
_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),
|
|
6056
6060
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
6057
|
-
|
|
6061
|
+
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),
|
|
6058
6062
|
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, 1 /* 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"),
|
|
6059
6063
|
resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, 1 /* Error */, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
6060
6064
|
resolution_mode_should_be_either_require_or_import: diag(1453, 1 /* Error */, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
@@ -6066,6 +6070,9 @@ var Diagnostics = {
|
|
|
6066
6070
|
File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module: diag(1459, 3 /* Message */, "File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459", `File is CommonJS module because '{0}' has field "type" whose value is not "module"`),
|
|
6067
6071
|
File_is_CommonJS_module_because_0_does_not_have_field_type: diag(1460, 3 /* Message */, "File_is_CommonJS_module_because_0_does_not_have_field_type_1460", `File is CommonJS module because '{0}' does not have field "type"`),
|
|
6068
6072
|
File_is_CommonJS_module_because_package_json_was_not_found: diag(1461, 3 /* Message */, "File_is_CommonJS_module_because_package_json_was_not_found_1461", "File is CommonJS module because 'package.json' was not found"),
|
|
6073
|
+
resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1462, 1 /* Error */, "resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1462", "'resolution-mode' attribute are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
6074
|
+
resolution_mode_is_the_only_valid_key_for_type_import_attributes: diag(1463, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_attributes_1463", "`resolution-mode` is the only valid key for type import attributes."),
|
|
6075
|
+
Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1464, 1 /* Error */, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - `resolution-mode` - with value `import` or `require`."),
|
|
6069
6076
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1 /* 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."),
|
|
6070
6077
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: diag(1471, 1 /* 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 with 'require'. Use an ECMAScript import instead."),
|
|
6071
6078
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -6092,6 +6099,7 @@ var Diagnostics = {
|
|
|
6092
6099
|
The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
|
|
6093
6100
|
The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
|
|
6094
6101
|
_0_modifier_cannot_appear_on_an_await_using_declaration: diag(1495, 1 /* Error */, "_0_modifier_cannot_appear_on_an_await_using_declaration_1495", "'{0}' modifier cannot appear on an 'await using' declaration."),
|
|
6102
|
+
Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal or number literal expected."),
|
|
6095
6103
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
6096
6104
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
6097
6105
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -6621,6 +6629,7 @@ var Diagnostics = {
|
|
|
6621
6629
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
6622
6630
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
6623
6631
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, 1 /* Error */, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
6632
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823", "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
6624
6633
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
6625
6634
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* 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 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
6626
6635
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, 1 /* 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 'node16' or 'nodenext'. Did you mean '{0}'?"),
|
|
@@ -6629,7 +6638,6 @@ var Diagnostics = {
|
|
|
6629
6638
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
6630
6639
|
This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
|
|
6631
6640
|
An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
|
|
6632
|
-
The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, 1 /* Error */, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6633
6641
|
_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
|
|
6634
6642
|
We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
|
|
6635
6643
|
Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2844, 1 /* Error */, "Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844", "Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
@@ -6642,6 +6650,9 @@ var Diagnostics = {
|
|
|
6642
6650
|
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
|
|
6643
6651
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
6644
6652
|
Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher: diag(2854, 1 /* Error */, "Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_sys_2854", "Top-level 'await using' statements are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
6653
|
+
Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls: diag(2855, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls_2855", "Import attributes are not allowed on statements that transpile to CommonJS 'require' calls."),
|
|
6654
|
+
Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2856, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2856", "Import attributes cannot be used with type-only imports or exports."),
|
|
6655
|
+
Import_attribute_values_must_be_string_literal_expressions: diag(2857, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2857", "Import attribute values must be string literal expressions."),
|
|
6645
6656
|
Import_declaration_0_is_using_private_name_1: diag(4e3, 1 /* Error */, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
6646
6657
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, 1 /* 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}'."),
|
|
6647
6658
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, 1 /* 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}'."),
|
|
@@ -6750,7 +6761,6 @@ var Diagnostics = {
|
|
|
6750
6761
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
6751
6762
|
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
6752
6763
|
Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4124, 1 /* Error */, "Compiler_option_0_of_value_1_is_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_w_4124", "Compiler option '{0}' of value '{1}' is unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6753
|
-
resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(4125, 1 /* Error */, "resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_wi_4125", "'resolution-mode' assertions are unstable. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6754
6764
|
The_current_host_does_not_support_the_0_option: diag(5001, 1 /* Error */, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
6755
6765
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, 1 /* Error */, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
6756
6766
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, 1 /* Error */, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -7689,7 +7699,7 @@ var Diagnostics = {
|
|
|
7689
7699
|
Could_not_convert_to_arrow_function: diag(95151, 3 /* Message */, "Could_not_convert_to_arrow_function_95151", "Could not convert to arrow function"),
|
|
7690
7700
|
Could_not_convert_to_named_function: diag(95152, 3 /* Message */, "Could_not_convert_to_named_function_95152", "Could not convert to named function"),
|
|
7691
7701
|
Could_not_convert_to_anonymous_function: diag(95153, 3 /* Message */, "Could_not_convert_to_anonymous_function_95153", "Could not convert to anonymous function"),
|
|
7692
|
-
|
|
7702
|
+
Can_only_convert_string_concatenations_and_string_literals: diag(95154, 3 /* Message */, "Can_only_convert_string_concatenations_and_string_literals_95154", "Can only convert string concatenations and string literals"),
|
|
7693
7703
|
Selection_is_not_a_valid_statement_or_statements: diag(95155, 3 /* Message */, "Selection_is_not_a_valid_statement_or_statements_95155", "Selection is not a valid statement or statements"),
|
|
7694
7704
|
Add_missing_function_declaration_0: diag(95156, 3 /* Message */, "Add_missing_function_declaration_0_95156", "Add missing function declaration '{0}'"),
|
|
7695
7705
|
Add_all_missing_function_declarations: diag(95157, 3 /* Message */, "Add_all_missing_function_declarations_95157", "Add all missing function declarations"),
|
|
@@ -7933,7 +7943,7 @@ var unicodeESNextIdentifierStart = [65, 90, 97, 122, 170, 170, 181, 181, 186, 18
|
|
|
7933
7943
|
var unicodeESNextIdentifierPart = [48, 57, 65, 90, 95, 95, 97, 122, 170, 170, 181, 181, 183, 183, 186, 186, 192, 214, 216, 246, 248, 705, 710, 721, 736, 740, 748, 748, 750, 750, 768, 884, 886, 887, 890, 893, 895, 895, 902, 906, 908, 908, 910, 929, 931, 1013, 1015, 1153, 1155, 1159, 1162, 1327, 1329, 1366, 1369, 1369, 1376, 1416, 1425, 1469, 1471, 1471, 1473, 1474, 1476, 1477, 1479, 1479, 1488, 1514, 1519, 1522, 1552, 1562, 1568, 1641, 1646, 1747, 1749, 1756, 1759, 1768, 1770, 1788, 1791, 1791, 1808, 1866, 1869, 1969, 1984, 2037, 2042, 2042, 2045, 2045, 2048, 2093, 2112, 2139, 2144, 2154, 2208, 2228, 2230, 2237, 2259, 2273, 2275, 2403, 2406, 2415, 2417, 2435, 2437, 2444, 2447, 2448, 2451, 2472, 2474, 2480, 2482, 2482, 2486, 2489, 2492, 2500, 2503, 2504, 2507, 2510, 2519, 2519, 2524, 2525, 2527, 2531, 2534, 2545, 2556, 2556, 2558, 2558, 2561, 2563, 2565, 2570, 2575, 2576, 2579, 2600, 2602, 2608, 2610, 2611, 2613, 2614, 2616, 2617, 2620, 2620, 2622, 2626, 2631, 2632, 2635, 2637, 2641, 2641, 2649, 2652, 2654, 2654, 2662, 2677, 2689, 2691, 2693, 2701, 2703, 2705, 2707, 2728, 2730, 2736, 2738, 2739, 2741, 2745, 2748, 2757, 2759, 2761, 2763, 2765, 2768, 2768, 2784, 2787, 2790, 2799, 2809, 2815, 2817, 2819, 2821, 2828, 2831, 2832, 2835, 2856, 2858, 2864, 2866, 2867, 2869, 2873, 2876, 2884, 2887, 2888, 2891, 2893, 2902, 2903, 2908, 2909, 2911, 2915, 2918, 2927, 2929, 2929, 2946, 2947, 2949, 2954, 2958, 2960, 2962, 2965, 2969, 2970, 2972, 2972, 2974, 2975, 2979, 2980, 2984, 2986, 2990, 3001, 3006, 3010, 3014, 3016, 3018, 3021, 3024, 3024, 3031, 3031, 3046, 3055, 3072, 3084, 3086, 3088, 3090, 3112, 3114, 3129, 3133, 3140, 3142, 3144, 3146, 3149, 3157, 3158, 3160, 3162, 3168, 3171, 3174, 3183, 3200, 3203, 3205, 3212, 3214, 3216, 3218, 3240, 3242, 3251, 3253, 3257, 3260, 3268, 3270, 3272, 3274, 3277, 3285, 3286, 3294, 3294, 3296, 3299, 3302, 3311, 3313, 3314, 3328, 3331, 3333, 3340, 3342, 3344, 3346, 3396, 3398, 3400, 3402, 3406, 3412, 3415, 3423, 3427, 3430, 3439, 3450, 3455, 3458, 3459, 3461, 3478, 3482, 3505, 3507, 3515, 3517, 3517, 3520, 3526, 3530, 3530, 3535, 3540, 3542, 3542, 3544, 3551, 3558, 3567, 3570, 3571, 3585, 3642, 3648, 3662, 3664, 3673, 3713, 3714, 3716, 3716, 3718, 3722, 3724, 3747, 3749, 3749, 3751, 3773, 3776, 3780, 3782, 3782, 3784, 3789, 3792, 3801, 3804, 3807, 3840, 3840, 3864, 3865, 3872, 3881, 3893, 3893, 3895, 3895, 3897, 3897, 3902, 3911, 3913, 3948, 3953, 3972, 3974, 3991, 3993, 4028, 4038, 4038, 4096, 4169, 4176, 4253, 4256, 4293, 4295, 4295, 4301, 4301, 4304, 4346, 4348, 4680, 4682, 4685, 4688, 4694, 4696, 4696, 4698, 4701, 4704, 4744, 4746, 4749, 4752, 4784, 4786, 4789, 4792, 4798, 4800, 4800, 4802, 4805, 4808, 4822, 4824, 4880, 4882, 4885, 4888, 4954, 4957, 4959, 4969, 4977, 4992, 5007, 5024, 5109, 5112, 5117, 5121, 5740, 5743, 5759, 5761, 5786, 5792, 5866, 5870, 5880, 5888, 5900, 5902, 5908, 5920, 5940, 5952, 5971, 5984, 5996, 5998, 6e3, 6002, 6003, 6016, 6099, 6103, 6103, 6108, 6109, 6112, 6121, 6155, 6157, 6160, 6169, 6176, 6264, 6272, 6314, 6320, 6389, 6400, 6430, 6432, 6443, 6448, 6459, 6470, 6509, 6512, 6516, 6528, 6571, 6576, 6601, 6608, 6618, 6656, 6683, 6688, 6750, 6752, 6780, 6783, 6793, 6800, 6809, 6823, 6823, 6832, 6845, 6912, 6987, 6992, 7001, 7019, 7027, 7040, 7155, 7168, 7223, 7232, 7241, 7245, 7293, 7296, 7304, 7312, 7354, 7357, 7359, 7376, 7378, 7380, 7418, 7424, 7673, 7675, 7957, 7960, 7965, 7968, 8005, 8008, 8013, 8016, 8023, 8025, 8025, 8027, 8027, 8029, 8029, 8031, 8061, 8064, 8116, 8118, 8124, 8126, 8126, 8130, 8132, 8134, 8140, 8144, 8147, 8150, 8155, 8160, 8172, 8178, 8180, 8182, 8188, 8255, 8256, 8276, 8276, 8305, 8305, 8319, 8319, 8336, 8348, 8400, 8412, 8417, 8417, 8421, 8432, 8450, 8450, 8455, 8455, 8458, 8467, 8469, 8469, 8472, 8477, 8484, 8484, 8486, 8486, 8488, 8488, 8490, 8505, 8508, 8511, 8517, 8521, 8526, 8526, 8544, 8584, 11264, 11310, 11312, 11358, 11360, 11492, 11499, 11507, 11520, 11557, 11559, 11559, 11565, 11565, 11568, 11623, 11631, 11631, 11647, 11670, 11680, 11686, 11688, 11694, 11696, 11702, 11704, 11710, 11712, 11718, 11720, 11726, 11728, 11734, 11736, 11742, 11744, 11775, 12293, 12295, 12321, 12335, 12337, 12341, 12344, 12348, 12353, 12438, 12441, 12447, 12449, 12538, 12540, 12543, 12549, 12591, 12593, 12686, 12704, 12730, 12784, 12799, 13312, 19893, 19968, 40943, 40960, 42124, 42192, 42237, 42240, 42508, 42512, 42539, 42560, 42607, 42612, 42621, 42623, 42737, 42775, 42783, 42786, 42888, 42891, 42943, 42946, 42950, 42999, 43047, 43072, 43123, 43136, 43205, 43216, 43225, 43232, 43255, 43259, 43259, 43261, 43309, 43312, 43347, 43360, 43388, 43392, 43456, 43471, 43481, 43488, 43518, 43520, 43574, 43584, 43597, 43600, 43609, 43616, 43638, 43642, 43714, 43739, 43741, 43744, 43759, 43762, 43766, 43777, 43782, 43785, 43790, 43793, 43798, 43808, 43814, 43816, 43822, 43824, 43866, 43868, 43879, 43888, 44010, 44012, 44013, 44016, 44025, 44032, 55203, 55216, 55238, 55243, 55291, 63744, 64109, 64112, 64217, 64256, 64262, 64275, 64279, 64285, 64296, 64298, 64310, 64312, 64316, 64318, 64318, 64320, 64321, 64323, 64324, 64326, 64433, 64467, 64829, 64848, 64911, 64914, 64967, 65008, 65019, 65024, 65039, 65056, 65071, 65075, 65076, 65101, 65103, 65136, 65140, 65142, 65276, 65296, 65305, 65313, 65338, 65343, 65343, 65345, 65370, 65382, 65470, 65474, 65479, 65482, 65487, 65490, 65495, 65498, 65500, 65536, 65547, 65549, 65574, 65576, 65594, 65596, 65597, 65599, 65613, 65616, 65629, 65664, 65786, 65856, 65908, 66045, 66045, 66176, 66204, 66208, 66256, 66272, 66272, 66304, 66335, 66349, 66378, 66384, 66426, 66432, 66461, 66464, 66499, 66504, 66511, 66513, 66517, 66560, 66717, 66720, 66729, 66736, 66771, 66776, 66811, 66816, 66855, 66864, 66915, 67072, 67382, 67392, 67413, 67424, 67431, 67584, 67589, 67592, 67592, 67594, 67637, 67639, 67640, 67644, 67644, 67647, 67669, 67680, 67702, 67712, 67742, 67808, 67826, 67828, 67829, 67840, 67861, 67872, 67897, 67968, 68023, 68030, 68031, 68096, 68099, 68101, 68102, 68108, 68115, 68117, 68119, 68121, 68149, 68152, 68154, 68159, 68159, 68192, 68220, 68224, 68252, 68288, 68295, 68297, 68326, 68352, 68405, 68416, 68437, 68448, 68466, 68480, 68497, 68608, 68680, 68736, 68786, 68800, 68850, 68864, 68903, 68912, 68921, 69376, 69404, 69415, 69415, 69424, 69456, 69600, 69622, 69632, 69702, 69734, 69743, 69759, 69818, 69840, 69864, 69872, 69881, 69888, 69940, 69942, 69951, 69956, 69958, 69968, 70003, 70006, 70006, 70016, 70084, 70089, 70092, 70096, 70106, 70108, 70108, 70144, 70161, 70163, 70199, 70206, 70206, 70272, 70278, 70280, 70280, 70282, 70285, 70287, 70301, 70303, 70312, 70320, 70378, 70384, 70393, 70400, 70403, 70405, 70412, 70415, 70416, 70419, 70440, 70442, 70448, 70450, 70451, 70453, 70457, 70459, 70468, 70471, 70472, 70475, 70477, 70480, 70480, 70487, 70487, 70493, 70499, 70502, 70508, 70512, 70516, 70656, 70730, 70736, 70745, 70750, 70751, 70784, 70853, 70855, 70855, 70864, 70873, 71040, 71093, 71096, 71104, 71128, 71133, 71168, 71232, 71236, 71236, 71248, 71257, 71296, 71352, 71360, 71369, 71424, 71450, 71453, 71467, 71472, 71481, 71680, 71738, 71840, 71913, 71935, 71935, 72096, 72103, 72106, 72151, 72154, 72161, 72163, 72164, 72192, 72254, 72263, 72263, 72272, 72345, 72349, 72349, 72384, 72440, 72704, 72712, 72714, 72758, 72760, 72768, 72784, 72793, 72818, 72847, 72850, 72871, 72873, 72886, 72960, 72966, 72968, 72969, 72971, 73014, 73018, 73018, 73020, 73021, 73023, 73031, 73040, 73049, 73056, 73061, 73063, 73064, 73066, 73102, 73104, 73105, 73107, 73112, 73120, 73129, 73440, 73462, 73728, 74649, 74752, 74862, 74880, 75075, 77824, 78894, 82944, 83526, 92160, 92728, 92736, 92766, 92768, 92777, 92880, 92909, 92912, 92916, 92928, 92982, 92992, 92995, 93008, 93017, 93027, 93047, 93053, 93071, 93760, 93823, 93952, 94026, 94031, 94087, 94095, 94111, 94176, 94177, 94179, 94179, 94208, 100343, 100352, 101106, 110592, 110878, 110928, 110930, 110948, 110951, 110960, 111355, 113664, 113770, 113776, 113788, 113792, 113800, 113808, 113817, 113821, 113822, 119141, 119145, 119149, 119154, 119163, 119170, 119173, 119179, 119210, 119213, 119362, 119364, 119808, 119892, 119894, 119964, 119966, 119967, 119970, 119970, 119973, 119974, 119977, 119980, 119982, 119993, 119995, 119995, 119997, 120003, 120005, 120069, 120071, 120074, 120077, 120084, 120086, 120092, 120094, 120121, 120123, 120126, 120128, 120132, 120134, 120134, 120138, 120144, 120146, 120485, 120488, 120512, 120514, 120538, 120540, 120570, 120572, 120596, 120598, 120628, 120630, 120654, 120656, 120686, 120688, 120712, 120714, 120744, 120746, 120770, 120772, 120779, 120782, 120831, 121344, 121398, 121403, 121452, 121461, 121461, 121476, 121476, 121499, 121503, 121505, 121519, 122880, 122886, 122888, 122904, 122907, 122913, 122915, 122916, 122918, 122922, 123136, 123180, 123184, 123197, 123200, 123209, 123214, 123214, 123584, 123641, 124928, 125124, 125136, 125142, 125184, 125259, 125264, 125273, 126464, 126467, 126469, 126495, 126497, 126498, 126500, 126500, 126503, 126503, 126505, 126514, 126516, 126519, 126521, 126521, 126523, 126523, 126530, 126530, 126535, 126535, 126537, 126537, 126539, 126539, 126541, 126543, 126545, 126546, 126548, 126548, 126551, 126551, 126553, 126553, 126555, 126555, 126557, 126557, 126559, 126559, 126561, 126562, 126564, 126564, 126567, 126570, 126572, 126578, 126580, 126583, 126585, 126588, 126590, 126590, 126592, 126601, 126603, 126619, 126625, 126627, 126629, 126633, 126635, 126651, 131072, 173782, 173824, 177972, 177984, 178205, 178208, 183969, 183984, 191456, 194560, 195101, 917760, 917999];
|
|
7934
7944
|
var commentDirectiveRegExSingleLine = /^\/\/\/?\s*@(ts-expect-error|ts-ignore)/;
|
|
7935
7945
|
var commentDirectiveRegExMultiLine = /^(?:\/|\*)*\s*@(ts-expect-error|ts-ignore)/;
|
|
7936
|
-
var
|
|
7946
|
+
var jsDocSeeOrLink = /@(?:see|link)/i;
|
|
7937
7947
|
function lookupInUnicodeMap(code, map2) {
|
|
7938
7948
|
if (code < map2[0]) {
|
|
7939
7949
|
return false;
|
|
@@ -8419,7 +8429,8 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8419
8429
|
var tokenFlags;
|
|
8420
8430
|
var commentDirectives;
|
|
8421
8431
|
var inJSDocType = 0;
|
|
8422
|
-
var
|
|
8432
|
+
var scriptKind = 0 /* Unknown */;
|
|
8433
|
+
var jsDocParsingMode = 0 /* ParseAll */;
|
|
8423
8434
|
setText(text, start, length2);
|
|
8424
8435
|
var scanner = {
|
|
8425
8436
|
getTokenFullStart: () => fullStartPos,
|
|
@@ -8463,14 +8474,15 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
8463
8474
|
setText,
|
|
8464
8475
|
setScriptTarget,
|
|
8465
8476
|
setLanguageVariant,
|
|
8477
|
+
setScriptKind,
|
|
8478
|
+
setJSDocParsingMode,
|
|
8466
8479
|
setOnError,
|
|
8467
8480
|
resetTokenState,
|
|
8468
8481
|
setTextPos: resetTokenState,
|
|
8469
8482
|
setInJSDocType,
|
|
8470
8483
|
tryScan,
|
|
8471
8484
|
lookAhead,
|
|
8472
|
-
scanRange
|
|
8473
|
-
setSkipNonSemanticJSDoc
|
|
8485
|
+
scanRange
|
|
8474
8486
|
};
|
|
8475
8487
|
if (Debug.isDebugging) {
|
|
8476
8488
|
Object.defineProperty(scanner, "__debugShowCurrentPositionInText", {
|
|
@@ -9258,7 +9270,7 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9258
9270
|
tokenFlags |= 1 /* PrecedingLineBreak */;
|
|
9259
9271
|
}
|
|
9260
9272
|
}
|
|
9261
|
-
if (isJSDoc2 && (
|
|
9273
|
+
if (isJSDoc2 && shouldParseJSDoc()) {
|
|
9262
9274
|
tokenFlags |= 2 /* PrecedingJSDocComment */;
|
|
9263
9275
|
}
|
|
9264
9276
|
commentDirectives = appendIfCommentDirective(commentDirectives, text.slice(lastLineStart, pos), commentDirectiveRegExMultiLine, lastLineStart);
|
|
@@ -9517,6 +9529,21 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9517
9529
|
}
|
|
9518
9530
|
}
|
|
9519
9531
|
}
|
|
9532
|
+
function shouldParseJSDoc() {
|
|
9533
|
+
switch (jsDocParsingMode) {
|
|
9534
|
+
case 0 /* ParseAll */:
|
|
9535
|
+
return true;
|
|
9536
|
+
case 1 /* ParseNone */:
|
|
9537
|
+
return false;
|
|
9538
|
+
}
|
|
9539
|
+
if (scriptKind !== 3 /* TS */ && scriptKind !== 4 /* TSX */) {
|
|
9540
|
+
return true;
|
|
9541
|
+
}
|
|
9542
|
+
if (jsDocParsingMode === 3 /* ParseForTypeInfo */) {
|
|
9543
|
+
return false;
|
|
9544
|
+
}
|
|
9545
|
+
return jsDocSeeOrLink.test(text.slice(fullStartPos, pos));
|
|
9546
|
+
}
|
|
9520
9547
|
function reScanInvalidIdentifier() {
|
|
9521
9548
|
Debug.assert(token === 0 /* Unknown */, "'reScanInvalidIdentifier' should only be called when the current token is 'SyntaxKind.Unknown'.");
|
|
9522
9549
|
pos = tokenStart = fullStartPos;
|
|
@@ -9931,8 +9958,11 @@ function createScanner(languageVersion, skipTrivia2, languageVariant = 0 /* Stan
|
|
|
9931
9958
|
function setLanguageVariant(variant) {
|
|
9932
9959
|
languageVariant = variant;
|
|
9933
9960
|
}
|
|
9934
|
-
function
|
|
9935
|
-
|
|
9961
|
+
function setScriptKind(kind) {
|
|
9962
|
+
scriptKind = kind;
|
|
9963
|
+
}
|
|
9964
|
+
function setJSDocParsingMode(kind) {
|
|
9965
|
+
jsDocParsingMode = kind;
|
|
9936
9966
|
}
|
|
9937
9967
|
function resetTokenState(position) {
|
|
9938
9968
|
Debug.assert(position >= 0);
|
|
@@ -10665,7 +10695,7 @@ function isTypeOnlyExportDeclaration(node) {
|
|
|
10665
10695
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
10666
10696
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
10667
10697
|
}
|
|
10668
|
-
function
|
|
10698
|
+
function isImportAttributeName(node) {
|
|
10669
10699
|
return isStringLiteral(node) || isIdentifier(node);
|
|
10670
10700
|
}
|
|
10671
10701
|
function isGeneratedIdentifier(node) {
|
|
@@ -11431,22 +11461,6 @@ function usingSingleLineStringWriter(action) {
|
|
|
11431
11461
|
function getFullWidth(node) {
|
|
11432
11462
|
return node.end - node.pos;
|
|
11433
11463
|
}
|
|
11434
|
-
function getResolvedModule(sourceFile, moduleNameText, mode) {
|
|
11435
|
-
var _a, _b;
|
|
11436
|
-
return (_b = (_a = sourceFile == null ? void 0 : sourceFile.resolvedModules) == null ? void 0 : _a.get(moduleNameText, mode)) == null ? void 0 : _b.resolvedModule;
|
|
11437
|
-
}
|
|
11438
|
-
function setResolvedModule(sourceFile, moduleNameText, resolvedModule, mode) {
|
|
11439
|
-
if (!sourceFile.resolvedModules) {
|
|
11440
|
-
sourceFile.resolvedModules = createModeAwareCache();
|
|
11441
|
-
}
|
|
11442
|
-
sourceFile.resolvedModules.set(moduleNameText, mode, resolvedModule);
|
|
11443
|
-
}
|
|
11444
|
-
function setResolvedTypeReferenceDirective(sourceFile, typeReferenceDirectiveName, resolvedTypeReferenceDirective, mode) {
|
|
11445
|
-
if (!sourceFile.resolvedTypeReferenceDirectiveNames) {
|
|
11446
|
-
sourceFile.resolvedTypeReferenceDirectiveNames = createModeAwareCache();
|
|
11447
|
-
}
|
|
11448
|
-
sourceFile.resolvedTypeReferenceDirectiveNames.set(typeReferenceDirectiveName, mode, resolvedTypeReferenceDirective);
|
|
11449
|
-
}
|
|
11450
11464
|
function projectReferenceIsEqualTo(oldRef, newRef) {
|
|
11451
11465
|
return oldRef.path === newRef.path && !oldRef.prepend === !newRef.prepend && !oldRef.circular === !newRef.circular;
|
|
11452
11466
|
}
|
|
@@ -11454,8 +11468,8 @@ function moduleResolutionIsEqualTo(oldResolution, newResolution) {
|
|
|
11454
11468
|
return oldResolution === newResolution || oldResolution.resolvedModule === newResolution.resolvedModule || !!oldResolution.resolvedModule && !!newResolution.resolvedModule && oldResolution.resolvedModule.isExternalLibraryImport === newResolution.resolvedModule.isExternalLibraryImport && oldResolution.resolvedModule.extension === newResolution.resolvedModule.extension && oldResolution.resolvedModule.resolvedFileName === newResolution.resolvedModule.resolvedFileName && oldResolution.resolvedModule.originalPath === newResolution.resolvedModule.originalPath && packageIdIsEqual(oldResolution.resolvedModule.packageId, newResolution.resolvedModule.packageId) && oldResolution.node10Result === newResolution.node10Result;
|
|
11455
11469
|
}
|
|
11456
11470
|
function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
|
|
11457
|
-
var _a
|
|
11458
|
-
const node10Result = (
|
|
11471
|
+
var _a;
|
|
11472
|
+
const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
|
|
11459
11473
|
const result = node10Result ? chainDiagnosticMessages(
|
|
11460
11474
|
/*details*/
|
|
11461
11475
|
void 0,
|
|
@@ -11497,14 +11511,14 @@ function packageIdToString(packageId) {
|
|
|
11497
11511
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
11498
11512
|
return oldResolution === newResolution || oldResolution.resolvedTypeReferenceDirective === newResolution.resolvedTypeReferenceDirective || !!oldResolution.resolvedTypeReferenceDirective && !!newResolution.resolvedTypeReferenceDirective && oldResolution.resolvedTypeReferenceDirective.resolvedFileName === newResolution.resolvedTypeReferenceDirective.resolvedFileName && !!oldResolution.resolvedTypeReferenceDirective.primary === !!newResolution.resolvedTypeReferenceDirective.primary && oldResolution.resolvedTypeReferenceDirective.originalPath === newResolution.resolvedTypeReferenceDirective.originalPath;
|
|
11499
11513
|
}
|
|
11500
|
-
function hasChangesInResolutions(names, newSourceFile, newResolutions,
|
|
11514
|
+
function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
|
|
11501
11515
|
Debug.assert(names.length === newResolutions.length);
|
|
11502
11516
|
for (let i = 0; i < names.length; i++) {
|
|
11503
11517
|
const newResolution = newResolutions[i];
|
|
11504
11518
|
const entry = names[i];
|
|
11505
11519
|
const name = nameAndModeGetter.getName(entry);
|
|
11506
11520
|
const mode = nameAndModeGetter.getMode(entry, newSourceFile);
|
|
11507
|
-
const oldResolution =
|
|
11521
|
+
const oldResolution = getOldResolution(name, mode);
|
|
11508
11522
|
const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
|
|
11509
11523
|
if (changed) {
|
|
11510
11524
|
return true;
|
|
@@ -14731,9 +14745,6 @@ function getIndentString(level) {
|
|
|
14731
14745
|
function getIndentSize() {
|
|
14732
14746
|
return indentStrings[1].length;
|
|
14733
14747
|
}
|
|
14734
|
-
function isNightly() {
|
|
14735
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
14736
|
-
}
|
|
14737
14748
|
function createTextWriter(newLine) {
|
|
14738
14749
|
var output;
|
|
14739
14750
|
var indent2;
|
|
@@ -16470,14 +16481,11 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
16470
16481
|
(symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
|
|
16471
16482
|
}
|
|
16472
16483
|
},
|
|
16473
|
-
setSymlinksFromResolutions(
|
|
16474
|
-
var _a, _b;
|
|
16484
|
+
setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) {
|
|
16475
16485
|
Debug.assert(!hasProcessedResolutions);
|
|
16476
16486
|
hasProcessedResolutions = true;
|
|
16477
|
-
|
|
16478
|
-
|
|
16479
|
-
(_b = file.resolvedTypeReferenceDirectiveNames) == null ? void 0 : _b.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16480
|
-
}
|
|
16487
|
+
forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule));
|
|
16488
|
+
forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16481
16489
|
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16482
16490
|
},
|
|
16483
16491
|
hasProcessedResolutions: () => hasProcessedResolutions
|
|
@@ -17453,6 +17461,13 @@ function getPropertyNameFromType(type) {
|
|
|
17453
17461
|
function isExpandoPropertyDeclaration(declaration) {
|
|
17454
17462
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
17455
17463
|
}
|
|
17464
|
+
function hasResolutionModeOverride(node) {
|
|
17465
|
+
var _a;
|
|
17466
|
+
if (node === void 0) {
|
|
17467
|
+
return false;
|
|
17468
|
+
}
|
|
17469
|
+
return !!getResolutionModeOverride(isImportTypeNode(node) ? (_a = node.attributes) == null ? void 0 : _a.attributes : node.attributes);
|
|
17470
|
+
}
|
|
17456
17471
|
|
|
17457
17472
|
// src/compiler/factory/baseNodeFactory.ts
|
|
17458
17473
|
function createBaseNodeFactory() {
|
|
@@ -18324,6 +18339,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18324
18339
|
updateAssertEntry,
|
|
18325
18340
|
createImportTypeAssertionContainer,
|
|
18326
18341
|
updateImportTypeAssertionContainer,
|
|
18342
|
+
createImportTypeAttributes,
|
|
18343
|
+
updateImportTypeAttributes,
|
|
18344
|
+
createImportAttributes,
|
|
18345
|
+
updateImportAttributes,
|
|
18346
|
+
createImportAttribute,
|
|
18347
|
+
updateImportAttribute,
|
|
18327
18348
|
createNamespaceImport,
|
|
18328
18349
|
updateNamespaceImport,
|
|
18329
18350
|
createNamespaceExport,
|
|
@@ -19592,18 +19613,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19592
19613
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
19593
19614
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
19594
19615
|
}
|
|
19595
|
-
function createImportTypeNode(argument,
|
|
19616
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
19596
19617
|
const node = createBaseNode(205 /* ImportType */);
|
|
19597
19618
|
node.argument = argument;
|
|
19598
|
-
node.assertions =
|
|
19619
|
+
node.attributes = node.assertions = attributes;
|
|
19599
19620
|
node.qualifier = qualifier;
|
|
19600
19621
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
19601
19622
|
node.isTypeOf = isTypeOf;
|
|
19602
19623
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
19603
19624
|
return node;
|
|
19604
19625
|
}
|
|
19605
|
-
function updateImportTypeNode(node, argument,
|
|
19606
|
-
return node.argument !== argument || node.
|
|
19626
|
+
function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
|
|
19627
|
+
return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node;
|
|
19607
19628
|
}
|
|
19608
19629
|
function createParenthesizedType(type) {
|
|
19609
19630
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -20733,19 +20754,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20733
20754
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
20734
20755
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
20735
20756
|
}
|
|
20736
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
20757
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
20737
20758
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
20738
20759
|
node.modifiers = asNodeArray(modifiers);
|
|
20739
20760
|
node.importClause = importClause;
|
|
20740
20761
|
node.moduleSpecifier = moduleSpecifier;
|
|
20741
|
-
node.assertClause =
|
|
20762
|
+
node.attributes = node.assertClause = attributes;
|
|
20742
20763
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
20743
20764
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
20744
20765
|
node.jsDoc = void 0;
|
|
20745
20766
|
return node;
|
|
20746
20767
|
}
|
|
20747
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
20748
|
-
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
20768
|
+
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
|
|
20769
|
+
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node;
|
|
20749
20770
|
}
|
|
20750
20771
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
20751
20772
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -20766,6 +20787,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20766
20787
|
const node = createBaseNode(300 /* AssertClause */);
|
|
20767
20788
|
node.elements = createNodeArray(elements);
|
|
20768
20789
|
node.multiLine = multiLine;
|
|
20790
|
+
node.token = 132 /* AssertKeyword */;
|
|
20769
20791
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
20770
20792
|
return node;
|
|
20771
20793
|
}
|
|
@@ -20791,6 +20813,36 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20791
20813
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
20792
20814
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
20793
20815
|
}
|
|
20816
|
+
function createImportTypeAttributes(attributes, multiLine) {
|
|
20817
|
+
const node = createBaseNode(302 /* ImportTypeAttributes */);
|
|
20818
|
+
node.attributes = node.assertClause = attributes;
|
|
20819
|
+
node.multiLine = multiLine;
|
|
20820
|
+
return node;
|
|
20821
|
+
}
|
|
20822
|
+
function updateImportTypeAttributes(node, attributes, multiLine) {
|
|
20823
|
+
return node.attributes !== attributes || node.multiLine !== multiLine ? update(createImportTypeAttributes(attributes, multiLine), node) : node;
|
|
20824
|
+
}
|
|
20825
|
+
function createImportAttributes(elements, multiLine, token) {
|
|
20826
|
+
const node = createBaseNode(300 /* ImportAttributes */);
|
|
20827
|
+
node.token = token ?? 118 /* WithKeyword */;
|
|
20828
|
+
node.elements = createNodeArray(elements);
|
|
20829
|
+
node.multiLine = multiLine;
|
|
20830
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
20831
|
+
return node;
|
|
20832
|
+
}
|
|
20833
|
+
function updateImportAttributes(node, elements, multiLine) {
|
|
20834
|
+
return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node;
|
|
20835
|
+
}
|
|
20836
|
+
function createImportAttribute(name, value) {
|
|
20837
|
+
const node = createBaseNode(301 /* ImportAttribute */);
|
|
20838
|
+
node.name = name;
|
|
20839
|
+
node.value = value;
|
|
20840
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
20841
|
+
return node;
|
|
20842
|
+
}
|
|
20843
|
+
function updateImportAttribute(node, name, value) {
|
|
20844
|
+
return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;
|
|
20845
|
+
}
|
|
20794
20846
|
function createNamespaceImport(name) {
|
|
20795
20847
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
20796
20848
|
node.name = name;
|
|
@@ -20851,20 +20903,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20851
20903
|
function updateExportAssignment(node, modifiers, expression) {
|
|
20852
20904
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node;
|
|
20853
20905
|
}
|
|
20854
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
20906
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
20855
20907
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
20856
20908
|
node.modifiers = asNodeArray(modifiers);
|
|
20857
20909
|
node.isTypeOnly = isTypeOnly;
|
|
20858
20910
|
node.exportClause = exportClause;
|
|
20859
20911
|
node.moduleSpecifier = moduleSpecifier;
|
|
20860
|
-
node.assertClause =
|
|
20912
|
+
node.attributes = node.assertClause = attributes;
|
|
20861
20913
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
20862
20914
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
20863
20915
|
node.jsDoc = void 0;
|
|
20864
20916
|
return node;
|
|
20865
20917
|
}
|
|
20866
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
20867
|
-
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
20918
|
+
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
20919
|
+
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node;
|
|
20868
20920
|
}
|
|
20869
20921
|
function finishUpdateExportDeclaration(updated, original) {
|
|
20870
20922
|
if (updated !== original) {
|
|
@@ -21462,7 +21514,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
21462
21514
|
node.imports = void 0;
|
|
21463
21515
|
node.moduleAugmentations = void 0;
|
|
21464
21516
|
node.ambientModuleNames = void 0;
|
|
21465
|
-
node.resolvedModules = void 0;
|
|
21466
21517
|
node.classifiableNames = void 0;
|
|
21467
21518
|
node.impliedNodeFormat = void 0;
|
|
21468
21519
|
return node;
|
|
@@ -22192,7 +22243,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22192
22243
|
} else {
|
|
22193
22244
|
modifierArray = modifiers;
|
|
22194
22245
|
}
|
|
22195
|
-
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.
|
|
22246
|
+
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node);
|
|
22196
22247
|
}
|
|
22197
22248
|
function updateModifierLike(node, modifierArray) {
|
|
22198
22249
|
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : Debug.assertNever(node);
|
|
@@ -24416,14 +24467,14 @@ function isImportDeclaration(node) {
|
|
|
24416
24467
|
function isImportClause(node) {
|
|
24417
24468
|
return node.kind === 273 /* ImportClause */;
|
|
24418
24469
|
}
|
|
24419
|
-
function
|
|
24420
|
-
return node.kind === 302 /*
|
|
24470
|
+
function isImportTypeAttributes(node) {
|
|
24471
|
+
return node.kind === 302 /* ImportTypeAttributes */;
|
|
24421
24472
|
}
|
|
24422
|
-
function
|
|
24423
|
-
return node.kind === 300 /*
|
|
24473
|
+
function isImportAttributes(node) {
|
|
24474
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
24424
24475
|
}
|
|
24425
|
-
function
|
|
24426
|
-
return node.kind === 301 /*
|
|
24476
|
+
function isImportAttribute(node) {
|
|
24477
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
24427
24478
|
}
|
|
24428
24479
|
function isNamespaceImport(node) {
|
|
24429
24480
|
return node.kind === 274 /* NamespaceImport */;
|
|
@@ -25099,7 +25150,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
25099
25150
|
namedBindings
|
|
25100
25151
|
),
|
|
25101
25152
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
25102
|
-
/*
|
|
25153
|
+
/*attributes*/
|
|
25103
25154
|
void 0
|
|
25104
25155
|
);
|
|
25105
25156
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -25853,10 +25904,10 @@ var forEachChildTable = {
|
|
|
25853
25904
|
return visitNode2(cbNode, node.typeParameter);
|
|
25854
25905
|
},
|
|
25855
25906
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
25856
|
-
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.
|
|
25907
|
+
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
25857
25908
|
},
|
|
25858
|
-
[302 /*
|
|
25859
|
-
return visitNode2(cbNode, node.
|
|
25909
|
+
[302 /* ImportTypeAttributes */]: function forEachChildInImportTypeAttributes(node, cbNode, _cbNodes) {
|
|
25910
|
+
return visitNode2(cbNode, node.attributes);
|
|
25860
25911
|
},
|
|
25861
25912
|
[196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
|
|
25862
25913
|
[198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
|
|
@@ -26027,15 +26078,15 @@ var forEachChildTable = {
|
|
|
26027
26078
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
26028
26079
|
},
|
|
26029
26080
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
26030
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
26081
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
26031
26082
|
},
|
|
26032
26083
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
26033
26084
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
26034
26085
|
},
|
|
26035
|
-
[300 /*
|
|
26086
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
26036
26087
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
26037
26088
|
},
|
|
26038
|
-
[301 /*
|
|
26089
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
26039
26090
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
26040
26091
|
},
|
|
26041
26092
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -26050,7 +26101,7 @@ var forEachChildTable = {
|
|
|
26050
26101
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
26051
26102
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
26052
26103
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
26053
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
26104
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
26054
26105
|
},
|
|
26055
26106
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
26056
26107
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -26289,7 +26340,7 @@ function gatherPossibleChildren(node) {
|
|
|
26289
26340
|
function setExternalModuleIndicator(sourceFile) {
|
|
26290
26341
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
26291
26342
|
}
|
|
26292
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind
|
|
26343
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
26293
26344
|
var _a, _b, _c, _d;
|
|
26294
26345
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
26295
26346
|
tracing.Phase.Parse,
|
|
@@ -26304,7 +26355,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26304
26355
|
const {
|
|
26305
26356
|
languageVersion,
|
|
26306
26357
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
26307
|
-
impliedNodeFormat: format
|
|
26358
|
+
impliedNodeFormat: format,
|
|
26359
|
+
jsDocParsingMode
|
|
26308
26360
|
} = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
|
|
26309
26361
|
if (languageVersion === 100 /* JSON */) {
|
|
26310
26362
|
result = Parser.parseSourceFile(
|
|
@@ -26316,7 +26368,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26316
26368
|
setParentNodes,
|
|
26317
26369
|
6 /* JSON */,
|
|
26318
26370
|
noop,
|
|
26319
|
-
|
|
26371
|
+
jsDocParsingMode
|
|
26320
26372
|
);
|
|
26321
26373
|
} else {
|
|
26322
26374
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -26332,7 +26384,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26332
26384
|
setParentNodes,
|
|
26333
26385
|
scriptKind,
|
|
26334
26386
|
setIndicator,
|
|
26335
|
-
|
|
26387
|
+
jsDocParsingMode
|
|
26336
26388
|
);
|
|
26337
26389
|
}
|
|
26338
26390
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -26451,7 +26503,7 @@ var Parser;
|
|
|
26451
26503
|
var contextFlags;
|
|
26452
26504
|
var topLevel = true;
|
|
26453
26505
|
var parseErrorBeforeNextFinishedNode = false;
|
|
26454
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride,
|
|
26506
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
|
|
26455
26507
|
var _a;
|
|
26456
26508
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
26457
26509
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -26473,9 +26525,8 @@ var Parser;
|
|
|
26473
26525
|
result2.pragmas = emptyMap;
|
|
26474
26526
|
return result2;
|
|
26475
26527
|
}
|
|
26476
|
-
|
|
26477
|
-
|
|
26478
|
-
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, skipNonSemanticJSDoc);
|
|
26528
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, scriptKind2, jsDocParsingMode);
|
|
26529
|
+
const result = parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicatorOverride || setExternalModuleIndicator, jsDocParsingMode);
|
|
26479
26530
|
clearState();
|
|
26480
26531
|
return result;
|
|
26481
26532
|
}
|
|
@@ -26488,8 +26539,7 @@ var Parser;
|
|
|
26488
26539
|
/*syntaxCursor*/
|
|
26489
26540
|
void 0,
|
|
26490
26541
|
1 /* JS */,
|
|
26491
|
-
/*
|
|
26492
|
-
false
|
|
26542
|
+
0 /* ParseAll */
|
|
26493
26543
|
);
|
|
26494
26544
|
nextToken();
|
|
26495
26545
|
const entityName = parseEntityName(
|
|
@@ -26502,15 +26552,7 @@ var Parser;
|
|
|
26502
26552
|
}
|
|
26503
26553
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
26504
26554
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
26505
|
-
initializeState(
|
|
26506
|
-
fileName2,
|
|
26507
|
-
sourceText2,
|
|
26508
|
-
languageVersion2,
|
|
26509
|
-
syntaxCursor2,
|
|
26510
|
-
6 /* JSON */,
|
|
26511
|
-
/*skipNonSemanticJSDoc*/
|
|
26512
|
-
false
|
|
26513
|
-
);
|
|
26555
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
|
|
26514
26556
|
sourceFlags = contextFlags;
|
|
26515
26557
|
nextToken();
|
|
26516
26558
|
const pos = getNodePos();
|
|
@@ -26591,7 +26633,7 @@ var Parser;
|
|
|
26591
26633
|
return result;
|
|
26592
26634
|
}
|
|
26593
26635
|
Parser2.parseJsonText = parseJsonText2;
|
|
26594
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind,
|
|
26636
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
|
|
26595
26637
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
26596
26638
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
26597
26639
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -26627,13 +26669,15 @@ var Parser;
|
|
|
26627
26669
|
scanner.setOnError(scanError);
|
|
26628
26670
|
scanner.setScriptTarget(languageVersion);
|
|
26629
26671
|
scanner.setLanguageVariant(languageVariant);
|
|
26630
|
-
scanner.
|
|
26672
|
+
scanner.setScriptKind(scriptKind);
|
|
26673
|
+
scanner.setJSDocParsingMode(_jsDocParsingMode);
|
|
26631
26674
|
}
|
|
26632
26675
|
function clearState() {
|
|
26633
26676
|
scanner.clearCommentDirectives();
|
|
26634
26677
|
scanner.setText("");
|
|
26635
26678
|
scanner.setOnError(void 0);
|
|
26636
|
-
scanner.
|
|
26679
|
+
scanner.setScriptKind(0 /* Unknown */);
|
|
26680
|
+
scanner.setJSDocParsingMode(0 /* ParseAll */);
|
|
26637
26681
|
sourceText = void 0;
|
|
26638
26682
|
languageVersion = void 0;
|
|
26639
26683
|
syntaxCursor = void 0;
|
|
@@ -26647,7 +26691,7 @@ var Parser;
|
|
|
26647
26691
|
notParenthesizedArrow = void 0;
|
|
26648
26692
|
topLevel = true;
|
|
26649
26693
|
}
|
|
26650
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2,
|
|
26694
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
|
|
26651
26695
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
26652
26696
|
if (isDeclarationFile) {
|
|
26653
26697
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -26666,7 +26710,7 @@ var Parser;
|
|
|
26666
26710
|
sourceFile.identifierCount = identifierCount;
|
|
26667
26711
|
sourceFile.identifiers = identifiers;
|
|
26668
26712
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
26669
|
-
sourceFile.
|
|
26713
|
+
sourceFile.jsDocParsingMode = jsDocParsingMode;
|
|
26670
26714
|
if (jsDocDiagnostics) {
|
|
26671
26715
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
26672
26716
|
}
|
|
@@ -27322,7 +27366,7 @@ var Parser;
|
|
|
27322
27366
|
function isLiteralPropertyName() {
|
|
27323
27367
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
27324
27368
|
}
|
|
27325
|
-
function
|
|
27369
|
+
function isImportAttributeName2() {
|
|
27326
27370
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
27327
27371
|
}
|
|
27328
27372
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -27441,8 +27485,8 @@ var Parser;
|
|
|
27441
27485
|
return isLiteralPropertyName();
|
|
27442
27486
|
case 9 /* ObjectBindingElements */:
|
|
27443
27487
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
27444
|
-
case 24 /*
|
|
27445
|
-
return
|
|
27488
|
+
case 24 /* ImportAttributes */:
|
|
27489
|
+
return isImportAttributeName2();
|
|
27446
27490
|
case 7 /* HeritageClauseElement */:
|
|
27447
27491
|
if (token() === 19 /* OpenBraceToken */) {
|
|
27448
27492
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -27545,7 +27589,7 @@ var Parser;
|
|
|
27545
27589
|
case 12 /* ObjectLiteralMembers */:
|
|
27546
27590
|
case 9 /* ObjectBindingElements */:
|
|
27547
27591
|
case 23 /* ImportOrExportSpecifiers */:
|
|
27548
|
-
case 24 /*
|
|
27592
|
+
case 24 /* ImportAttributes */:
|
|
27549
27593
|
return token() === 20 /* CloseBraceToken */;
|
|
27550
27594
|
case 3 /* SwitchClauseStatements */:
|
|
27551
27595
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -27851,7 +27895,7 @@ var Parser;
|
|
|
27851
27895
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27852
27896
|
case 14 /* JsxChildren */:
|
|
27853
27897
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27854
|
-
case 24 /*
|
|
27898
|
+
case 24 /* ImportAttributes */:
|
|
27855
27899
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
27856
27900
|
case 25 /* JSDocComment */:
|
|
27857
27901
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -28726,16 +28770,22 @@ var Parser;
|
|
|
28726
28770
|
nextToken();
|
|
28727
28771
|
return token() === 102 /* ImportKeyword */;
|
|
28728
28772
|
}
|
|
28729
|
-
function
|
|
28773
|
+
function parseImportTypeAttributes() {
|
|
28730
28774
|
const pos = getNodePos();
|
|
28731
28775
|
const openBracePosition = scanner.getTokenStart();
|
|
28732
28776
|
parseExpected(19 /* OpenBraceToken */);
|
|
28733
28777
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
28734
|
-
|
|
28778
|
+
const currentToken2 = token();
|
|
28779
|
+
if (currentToken2 !== 118 /* WithKeyword */ && currentToken2 !== 132 /* AssertKeyword */) {
|
|
28780
|
+
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
|
|
28781
|
+
} else {
|
|
28782
|
+
nextToken();
|
|
28783
|
+
}
|
|
28735
28784
|
parseExpected(59 /* ColonToken */);
|
|
28736
|
-
const
|
|
28737
|
-
|
|
28738
|
-
|
|
28785
|
+
const attributes = parseImportAttributes(
|
|
28786
|
+
currentToken2,
|
|
28787
|
+
/*shouldAdvance*/
|
|
28788
|
+
false
|
|
28739
28789
|
);
|
|
28740
28790
|
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
28741
28791
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
@@ -28746,7 +28796,7 @@ var Parser;
|
|
|
28746
28796
|
);
|
|
28747
28797
|
}
|
|
28748
28798
|
}
|
|
28749
|
-
return finishNode(factory2.
|
|
28799
|
+
return finishNode(factory2.createImportTypeAttributes(attributes, multiLine), pos);
|
|
28750
28800
|
}
|
|
28751
28801
|
function parseImportType() {
|
|
28752
28802
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
@@ -28755,14 +28805,14 @@ var Parser;
|
|
|
28755
28805
|
parseExpected(102 /* ImportKeyword */);
|
|
28756
28806
|
parseExpected(21 /* OpenParenToken */);
|
|
28757
28807
|
const type = parseType();
|
|
28758
|
-
let
|
|
28808
|
+
let attributes;
|
|
28759
28809
|
if (parseOptional(28 /* CommaToken */)) {
|
|
28760
|
-
|
|
28810
|
+
attributes = parseImportTypeAttributes();
|
|
28761
28811
|
}
|
|
28762
28812
|
parseExpected(22 /* CloseParenToken */);
|
|
28763
28813
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
28764
28814
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
28765
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
28815
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
28766
28816
|
}
|
|
28767
28817
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
28768
28818
|
nextToken();
|
|
@@ -31824,15 +31874,16 @@ var Parser;
|
|
|
31824
31874
|
parseExpected(161 /* FromKeyword */);
|
|
31825
31875
|
}
|
|
31826
31876
|
const moduleSpecifier = parseModuleSpecifier();
|
|
31827
|
-
|
|
31828
|
-
|
|
31829
|
-
|
|
31877
|
+
const currentToken2 = token();
|
|
31878
|
+
let attributes;
|
|
31879
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
|
|
31880
|
+
attributes = parseImportAttributes(currentToken2);
|
|
31830
31881
|
}
|
|
31831
31882
|
parseSemicolon();
|
|
31832
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
31883
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
31833
31884
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31834
31885
|
}
|
|
31835
|
-
function
|
|
31886
|
+
function parseImportAttribute() {
|
|
31836
31887
|
const pos = getNodePos();
|
|
31837
31888
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
31838
31889
|
parseExpected(59 /* ColonToken */);
|
|
@@ -31840,19 +31891,19 @@ var Parser;
|
|
|
31840
31891
|
/*allowReturnTypeInArrowFunction*/
|
|
31841
31892
|
true
|
|
31842
31893
|
);
|
|
31843
|
-
return finishNode(factory2.
|
|
31894
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
31844
31895
|
}
|
|
31845
|
-
function
|
|
31896
|
+
function parseImportAttributes(token2, shouldAdvance = true) {
|
|
31846
31897
|
const pos = getNodePos();
|
|
31847
|
-
if (
|
|
31848
|
-
|
|
31898
|
+
if (shouldAdvance) {
|
|
31899
|
+
nextToken();
|
|
31849
31900
|
}
|
|
31850
31901
|
const openBracePosition = scanner.getTokenStart();
|
|
31851
31902
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
31852
31903
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
31853
31904
|
const elements = parseDelimitedList(
|
|
31854
|
-
24 /*
|
|
31855
|
-
|
|
31905
|
+
24 /* ImportAttributes */,
|
|
31906
|
+
parseImportAttribute,
|
|
31856
31907
|
/*considerSemicolonAsDelimiter*/
|
|
31857
31908
|
true
|
|
31858
31909
|
);
|
|
@@ -31865,7 +31916,7 @@ var Parser;
|
|
|
31865
31916
|
);
|
|
31866
31917
|
}
|
|
31867
31918
|
}
|
|
31868
|
-
return finishNode(factory2.
|
|
31919
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
31869
31920
|
} else {
|
|
31870
31921
|
const elements = createNodeArray(
|
|
31871
31922
|
[],
|
|
@@ -31875,10 +31926,11 @@ var Parser;
|
|
|
31875
31926
|
/*hasTrailingComma*/
|
|
31876
31927
|
false
|
|
31877
31928
|
);
|
|
31878
|
-
return finishNode(factory2.
|
|
31929
|
+
return finishNode(factory2.createImportAttributes(
|
|
31879
31930
|
elements,
|
|
31880
31931
|
/*multiLine*/
|
|
31881
|
-
false
|
|
31932
|
+
false,
|
|
31933
|
+
token2
|
|
31882
31934
|
), pos);
|
|
31883
31935
|
}
|
|
31884
31936
|
}
|
|
@@ -32010,7 +32062,7 @@ var Parser;
|
|
|
32010
32062
|
);
|
|
32011
32063
|
let exportClause;
|
|
32012
32064
|
let moduleSpecifier;
|
|
32013
|
-
let
|
|
32065
|
+
let attributes;
|
|
32014
32066
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
32015
32067
|
const namespaceExportPos = getNodePos();
|
|
32016
32068
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -32026,12 +32078,13 @@ var Parser;
|
|
|
32026
32078
|
moduleSpecifier = parseModuleSpecifier();
|
|
32027
32079
|
}
|
|
32028
32080
|
}
|
|
32029
|
-
|
|
32030
|
-
|
|
32081
|
+
const currentToken2 = token();
|
|
32082
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
|
|
32083
|
+
attributes = parseImportAttributes(currentToken2);
|
|
32031
32084
|
}
|
|
32032
32085
|
parseSemicolon();
|
|
32033
32086
|
setAwaitContext(savedAwaitContext);
|
|
32034
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
32087
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
32035
32088
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
32036
32089
|
}
|
|
32037
32090
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -32081,7 +32134,7 @@ var Parser;
|
|
|
32081
32134
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
32082
32135
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
32083
32136
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
32084
|
-
ParsingContext2[ParsingContext2["
|
|
32137
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
32085
32138
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
32086
32139
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
32087
32140
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -32101,8 +32154,7 @@ var Parser;
|
|
|
32101
32154
|
/*syntaxCursor*/
|
|
32102
32155
|
void 0,
|
|
32103
32156
|
1 /* JS */,
|
|
32104
|
-
/*
|
|
32105
|
-
false
|
|
32157
|
+
0 /* ParseAll */
|
|
32106
32158
|
);
|
|
32107
32159
|
scanner.setText(content, start, length2);
|
|
32108
32160
|
currentToken = scanner.scan();
|
|
@@ -32167,8 +32219,7 @@ var Parser;
|
|
|
32167
32219
|
/*syntaxCursor*/
|
|
32168
32220
|
void 0,
|
|
32169
32221
|
1 /* JS */,
|
|
32170
|
-
/*
|
|
32171
|
-
false
|
|
32222
|
+
0 /* ParseAll */
|
|
32172
32223
|
);
|
|
32173
32224
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
|
|
32174
32225
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -33125,7 +33176,7 @@ var IncrementalParser;
|
|
|
33125
33176
|
true,
|
|
33126
33177
|
sourceFile.scriptKind,
|
|
33127
33178
|
sourceFile.setExternalModuleIndicator,
|
|
33128
|
-
sourceFile.
|
|
33179
|
+
sourceFile.jsDocParsingMode
|
|
33129
33180
|
);
|
|
33130
33181
|
}
|
|
33131
33182
|
const incrementalSourceFile = sourceFile;
|
|
@@ -33150,7 +33201,7 @@ var IncrementalParser;
|
|
|
33150
33201
|
true,
|
|
33151
33202
|
sourceFile.scriptKind,
|
|
33152
33203
|
sourceFile.setExternalModuleIndicator,
|
|
33153
|
-
sourceFile.
|
|
33204
|
+
sourceFile.jsDocParsingMode
|
|
33154
33205
|
);
|
|
33155
33206
|
result.commentDirectives = getNewCommentDirectives(
|
|
33156
33207
|
sourceFile.commentDirectives,
|
|
@@ -34091,6 +34142,7 @@ var moduleOptionDeclaration = {
|
|
|
34091
34142
|
node16: 100 /* Node16 */,
|
|
34092
34143
|
nodenext: 199 /* NodeNext */
|
|
34093
34144
|
})),
|
|
34145
|
+
affectsSourceFile: true,
|
|
34094
34146
|
affectsModuleResolution: true,
|
|
34095
34147
|
affectsEmit: true,
|
|
34096
34148
|
affectsBuildInfo: true,
|
|
@@ -34527,6 +34579,7 @@ var commandOptionsWithoutBuild = [
|
|
|
34527
34579
|
bundler: 100 /* Bundler */
|
|
34528
34580
|
})),
|
|
34529
34581
|
deprecatedKeys: /* @__PURE__ */ new Set(["node"]),
|
|
34582
|
+
affectsSourceFile: true,
|
|
34530
34583
|
affectsModuleResolution: true,
|
|
34531
34584
|
paramType: Diagnostics.STRATEGY,
|
|
34532
34585
|
category: Diagnostics.Modules,
|
|
@@ -35069,6 +35122,7 @@ var commandOptionsWithoutBuild = [
|
|
|
35069
35122
|
legacy: 1 /* Legacy */,
|
|
35070
35123
|
force: 3 /* Force */
|
|
35071
35124
|
})),
|
|
35125
|
+
affectsSourceFile: true,
|
|
35072
35126
|
affectsModuleResolution: true,
|
|
35073
35127
|
description: Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
35074
35128
|
category: Diagnostics.Language_and_Environment,
|
|
@@ -35088,7 +35142,7 @@ var semanticDiagnosticsOptionDeclarations = optionDeclarations.filter((option) =
|
|
|
35088
35142
|
var affectsEmitOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsEmit);
|
|
35089
35143
|
var affectsDeclarationPathOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsDeclarationPath);
|
|
35090
35144
|
var moduleResolutionOptionDeclarations = optionDeclarations.filter((option) => !!option.affectsModuleResolution);
|
|
35091
|
-
var sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.
|
|
35145
|
+
var sourceFileAffectingCompilerOptions = optionDeclarations.filter((option) => !!option.affectsSourceFile || !!option.affectsBindDiagnostics);
|
|
35092
35146
|
var optionsAffectingProgramStructure = optionDeclarations.filter((option) => !!option.affectsProgramStructure);
|
|
35093
35147
|
var transpileOptionValueCompilerOptions = optionDeclarations.filter((option) => hasProperty(option, "transpileOptionValue"));
|
|
35094
35148
|
var optionsForBuild = [
|
|
@@ -37463,15 +37517,6 @@ function createModeAwareCache() {
|
|
|
37463
37517
|
return result;
|
|
37464
37518
|
}
|
|
37465
37519
|
}
|
|
37466
|
-
function zipToModeAwareCache(file, keys, values, nameAndModeGetter) {
|
|
37467
|
-
Debug.assert(keys.length === values.length);
|
|
37468
|
-
const map2 = createModeAwareCache();
|
|
37469
|
-
for (let i = 0; i < keys.length; ++i) {
|
|
37470
|
-
const entry = keys[i];
|
|
37471
|
-
map2.set(nameAndModeGetter.getName(entry), nameAndModeGetter.getMode(entry, file), values[i]);
|
|
37472
|
-
}
|
|
37473
|
-
return map2;
|
|
37474
|
-
}
|
|
37475
37520
|
function getOriginalOrResolvedModuleFileName(result) {
|
|
37476
37521
|
return result.resolvedModule && (result.resolvedModule.originalPath || result.resolvedModule.resolvedFileName);
|
|
37477
37522
|
}
|
|
@@ -46331,7 +46376,7 @@ function createTypeChecker(host) {
|
|
|
46331
46376
|
const contextSpecifier = isStringLiteralLike(location) ? location : ((_a = findAncestor(location, isImportCall)) == null ? void 0 : _a.arguments[0]) || ((_b = findAncestor(location, isImportDeclaration)) == null ? void 0 : _b.moduleSpecifier) || ((_c = findAncestor(location, isExternalModuleImportEqualsDeclaration)) == null ? void 0 : _c.moduleReference.expression) || ((_d = findAncestor(location, isExportDeclaration)) == null ? void 0 : _d.moduleSpecifier) || ((_e = isModuleDeclaration(location) ? location : location.parent && isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : void 0) == null ? void 0 : _e.name) || ((_f = isLiteralImportTypeNode(location) ? location : void 0) == null ? void 0 : _f.argument.literal);
|
|
46332
46377
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
46333
46378
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
46334
|
-
const resolvedModule = getResolvedModule(currentSourceFile, moduleReference, mode);
|
|
46379
|
+
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
46335
46380
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
46336
46381
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
46337
46382
|
if (sourceFile) {
|
|
@@ -46339,7 +46384,7 @@ function createTypeChecker(host) {
|
|
|
46339
46384
|
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
46340
46385
|
}
|
|
46341
46386
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
46342
|
-
const importOrExport = ((
|
|
46387
|
+
const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
46343
46388
|
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
46344
46389
|
error(
|
|
46345
46390
|
errorNode,
|
|
@@ -46348,7 +46393,7 @@ function createTypeChecker(host) {
|
|
|
46348
46393
|
);
|
|
46349
46394
|
}
|
|
46350
46395
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
46351
|
-
const importOrExport = ((
|
|
46396
|
+
const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
46352
46397
|
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
46353
46398
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
46354
46399
|
error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
@@ -46368,9 +46413,8 @@ function createTypeChecker(host) {
|
|
|
46368
46413
|
}
|
|
46369
46414
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
46370
46415
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
46371
|
-
const
|
|
46372
|
-
|
|
46373
|
-
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
46416
|
+
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
46417
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
46374
46418
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
46375
46419
|
error(errorNode, Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead, moduleReference);
|
|
46376
46420
|
} else {
|
|
@@ -48241,7 +48285,7 @@ function createTypeChecker(host) {
|
|
|
48241
48285
|
return factory.updateImportTypeNode(
|
|
48242
48286
|
root,
|
|
48243
48287
|
root.argument,
|
|
48244
|
-
root.
|
|
48288
|
+
root.attributes,
|
|
48245
48289
|
qualifier,
|
|
48246
48290
|
typeArguments,
|
|
48247
48291
|
root.isTypeOf
|
|
@@ -48974,7 +49018,6 @@ function createTypeChecker(host) {
|
|
|
48974
49018
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
48975
49019
|
}
|
|
48976
49020
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
48977
|
-
var _a, _b, _c, _d;
|
|
48978
49021
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
48979
49022
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
48980
49023
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -48983,17 +49026,18 @@ function createTypeChecker(host) {
|
|
|
48983
49026
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
48984
49027
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
48985
49028
|
let specifier;
|
|
48986
|
-
let
|
|
49029
|
+
let attributes;
|
|
48987
49030
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
48988
49031
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
48989
49032
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
48990
|
-
|
|
48991
|
-
factory.
|
|
48992
|
-
factory.
|
|
48993
|
-
|
|
48994
|
-
|
|
48995
|
-
|
|
48996
|
-
|
|
49033
|
+
attributes = factory.createImportTypeAttributes(factory.createImportAttributes(
|
|
49034
|
+
factory.createNodeArray([
|
|
49035
|
+
factory.createImportAttribute(
|
|
49036
|
+
factory.createStringLiteral("resolution-mode"),
|
|
49037
|
+
factory.createStringLiteral("import")
|
|
49038
|
+
)
|
|
49039
|
+
])
|
|
49040
|
+
));
|
|
48997
49041
|
}
|
|
48998
49042
|
}
|
|
48999
49043
|
if (!specifier) {
|
|
@@ -49007,16 +49051,17 @@ function createTypeChecker(host) {
|
|
|
49007
49051
|
if (specifier.includes("/node_modules/")) {
|
|
49008
49052
|
specifier = oldSpecifier;
|
|
49009
49053
|
} else {
|
|
49010
|
-
|
|
49011
|
-
factory.
|
|
49012
|
-
factory.
|
|
49013
|
-
|
|
49014
|
-
|
|
49015
|
-
|
|
49016
|
-
|
|
49054
|
+
attributes = factory.createImportTypeAttributes(factory.createImportAttributes(
|
|
49055
|
+
factory.createNodeArray([
|
|
49056
|
+
factory.createImportAttribute(
|
|
49057
|
+
factory.createStringLiteral("resolution-mode"),
|
|
49058
|
+
factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
|
|
49059
|
+
)
|
|
49060
|
+
])
|
|
49061
|
+
));
|
|
49017
49062
|
}
|
|
49018
49063
|
}
|
|
49019
|
-
if (!
|
|
49064
|
+
if (!attributes) {
|
|
49020
49065
|
context.encounteredError = true;
|
|
49021
49066
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
49022
49067
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -49036,11 +49081,11 @@ function createTypeChecker(host) {
|
|
|
49036
49081
|
void 0
|
|
49037
49082
|
);
|
|
49038
49083
|
}
|
|
49039
|
-
return factory.createImportTypeNode(lit,
|
|
49084
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
49040
49085
|
} else {
|
|
49041
49086
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
49042
49087
|
const qualifier = splitNode.objectType.typeName;
|
|
49043
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
49088
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
49044
49089
|
}
|
|
49045
49090
|
}
|
|
49046
49091
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -49516,7 +49561,7 @@ function createTypeChecker(host) {
|
|
|
49516
49561
|
return factory.updateImportTypeNode(
|
|
49517
49562
|
node,
|
|
49518
49563
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
49519
|
-
node.
|
|
49564
|
+
node.attributes,
|
|
49520
49565
|
node.qualifier,
|
|
49521
49566
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
49522
49567
|
node.isTypeOf
|
|
@@ -49736,7 +49781,7 @@ function createTypeChecker(host) {
|
|
|
49736
49781
|
return statements;
|
|
49737
49782
|
}
|
|
49738
49783
|
function inlineExportModifiers(statements) {
|
|
49739
|
-
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.
|
|
49784
|
+
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause));
|
|
49740
49785
|
if (index >= 0) {
|
|
49741
49786
|
const exportDecl = statements[index];
|
|
49742
49787
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -49764,7 +49809,7 @@ function createTypeChecker(host) {
|
|
|
49764
49809
|
replacements
|
|
49765
49810
|
),
|
|
49766
49811
|
exportDecl.moduleSpecifier,
|
|
49767
|
-
exportDecl.
|
|
49812
|
+
exportDecl.attributes
|
|
49768
49813
|
);
|
|
49769
49814
|
}
|
|
49770
49815
|
}
|
|
@@ -50415,7 +50460,7 @@ function createTypeChecker(host) {
|
|
|
50415
50460
|
)])
|
|
50416
50461
|
),
|
|
50417
50462
|
factory.createStringLiteral(specifier2),
|
|
50418
|
-
/*
|
|
50463
|
+
/*attributes*/
|
|
50419
50464
|
void 0
|
|
50420
50465
|
),
|
|
50421
50466
|
0 /* None */
|
|
@@ -50503,7 +50548,7 @@ function createTypeChecker(host) {
|
|
|
50503
50548
|
void 0
|
|
50504
50549
|
),
|
|
50505
50550
|
specifier2,
|
|
50506
|
-
node.parent.
|
|
50551
|
+
node.parent.attributes
|
|
50507
50552
|
),
|
|
50508
50553
|
0 /* None */
|
|
50509
50554
|
);
|
|
@@ -50524,7 +50569,7 @@ function createTypeChecker(host) {
|
|
|
50524
50569
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
50525
50570
|
),
|
|
50526
50571
|
specifier2,
|
|
50527
|
-
node.parent.
|
|
50572
|
+
node.parent.attributes
|
|
50528
50573
|
),
|
|
50529
50574
|
0 /* None */
|
|
50530
50575
|
);
|
|
@@ -50565,7 +50610,7 @@ function createTypeChecker(host) {
|
|
|
50565
50610
|
])
|
|
50566
50611
|
),
|
|
50567
50612
|
specifier2,
|
|
50568
|
-
node.parent.parent.parent.
|
|
50613
|
+
node.parent.parent.parent.attributes
|
|
50569
50614
|
),
|
|
50570
50615
|
0 /* None */
|
|
50571
50616
|
);
|
|
@@ -53234,7 +53279,28 @@ function createTypeChecker(host) {
|
|
|
53234
53279
|
}
|
|
53235
53280
|
}
|
|
53236
53281
|
}
|
|
53237
|
-
|
|
53282
|
+
let resolved = combineSymbolTables(earlySymbols, lateSymbols);
|
|
53283
|
+
if (symbol.flags & 33554432 /* Transient */ && links.cjsExportMerged && symbol.declarations) {
|
|
53284
|
+
for (const decl of symbol.declarations) {
|
|
53285
|
+
const original = getSymbolLinks(decl.symbol)[resolutionKind];
|
|
53286
|
+
if (!resolved) {
|
|
53287
|
+
resolved = original;
|
|
53288
|
+
continue;
|
|
53289
|
+
}
|
|
53290
|
+
if (!original)
|
|
53291
|
+
continue;
|
|
53292
|
+
original.forEach((s, name) => {
|
|
53293
|
+
const existing = resolved.get(name);
|
|
53294
|
+
if (!existing)
|
|
53295
|
+
resolved.set(name, s);
|
|
53296
|
+
else if (existing === s)
|
|
53297
|
+
return;
|
|
53298
|
+
else
|
|
53299
|
+
resolved.set(name, mergeSymbol(existing, s));
|
|
53300
|
+
});
|
|
53301
|
+
}
|
|
53302
|
+
}
|
|
53303
|
+
links[resolutionKind] = resolved || emptySymbols;
|
|
53238
53304
|
}
|
|
53239
53305
|
return links[resolutionKind];
|
|
53240
53306
|
}
|
|
@@ -64060,13 +64126,10 @@ function createTypeChecker(host) {
|
|
|
64060
64126
|
if (sourceNameType && targetNameType)
|
|
64061
64127
|
inferFromTypes(sourceNameType, targetNameType);
|
|
64062
64128
|
}
|
|
64063
|
-
if (getObjectFlags(target) & 32 /* Mapped */) {
|
|
64064
|
-
const
|
|
64065
|
-
if (
|
|
64066
|
-
|
|
64067
|
-
if (inferToMappedType(source, mappedType, constraintType)) {
|
|
64068
|
-
return;
|
|
64069
|
-
}
|
|
64129
|
+
if (getObjectFlags(target) & 32 /* Mapped */ && !target.declaration.nameType) {
|
|
64130
|
+
const constraintType = getConstraintTypeFromMappedType(target);
|
|
64131
|
+
if (inferToMappedType(source, target, constraintType)) {
|
|
64132
|
+
return;
|
|
64070
64133
|
}
|
|
64071
64134
|
}
|
|
64072
64135
|
if (!typesDefinitelyUnrelated(source, target)) {
|
|
@@ -75785,16 +75848,16 @@ function createTypeChecker(host) {
|
|
|
75785
75848
|
getTypeFromTypeNode(node);
|
|
75786
75849
|
}
|
|
75787
75850
|
function checkImportType(node) {
|
|
75851
|
+
var _a, _b;
|
|
75788
75852
|
checkSourceElement(node.argument);
|
|
75789
|
-
if (node.
|
|
75790
|
-
const override =
|
|
75791
|
-
|
|
75792
|
-
|
|
75793
|
-
|
|
75794
|
-
|
|
75795
|
-
|
|
75796
|
-
|
|
75797
|
-
}
|
|
75853
|
+
if (node.attributes) {
|
|
75854
|
+
const override = getResolutionModeOverride((_a = node.attributes) == null ? void 0 : _a.attributes, grammarErrorOnNode);
|
|
75855
|
+
const errorNode = (_b = node.attributes) == null ? void 0 : _b.attributes;
|
|
75856
|
+
if (override && errorNode && getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
75857
|
+
grammarErrorOnNode(
|
|
75858
|
+
errorNode,
|
|
75859
|
+
node.attributes.attributes.token === 118 /* WithKeyword */ ? Diagnostics.resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext : Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext
|
|
75860
|
+
);
|
|
75798
75861
|
}
|
|
75799
75862
|
}
|
|
75800
75863
|
checkTypeReferenceOrImport(node);
|
|
@@ -79759,12 +79822,13 @@ function createTypeChecker(host) {
|
|
|
79759
79822
|
return false;
|
|
79760
79823
|
}
|
|
79761
79824
|
}
|
|
79762
|
-
if (!isImportEqualsDeclaration(node) && node.
|
|
79825
|
+
if (!isImportEqualsDeclaration(node) && node.attributes) {
|
|
79826
|
+
const diagnostic = node.attributes.token === 118 /* WithKeyword */ ? Diagnostics.Import_attribute_values_must_be_string_literal_expressions : Diagnostics.Import_assertion_values_must_be_string_literal_expressions;
|
|
79763
79827
|
let hasError = false;
|
|
79764
|
-
for (const
|
|
79765
|
-
if (!isStringLiteral(
|
|
79828
|
+
for (const attr of node.attributes.elements) {
|
|
79829
|
+
if (!isStringLiteral(attr.value)) {
|
|
79766
79830
|
hasError = true;
|
|
79767
|
-
error(
|
|
79831
|
+
error(attr.value, diagnostic);
|
|
79768
79832
|
}
|
|
79769
79833
|
}
|
|
79770
79834
|
return !hasError;
|
|
@@ -79896,32 +79960,35 @@ function createTypeChecker(host) {
|
|
|
79896
79960
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
79897
79961
|
}
|
|
79898
79962
|
}
|
|
79899
|
-
function
|
|
79963
|
+
function checkImportAttributes(declaration) {
|
|
79900
79964
|
var _a;
|
|
79901
|
-
if (declaration.
|
|
79902
|
-
|
|
79903
|
-
|
|
79904
|
-
|
|
79905
|
-
|
|
79906
|
-
|
|
79907
|
-
|
|
79965
|
+
if (declaration.attributes && declaration.attributes.token === 132 /* AssertKeyword */) {
|
|
79966
|
+
grammarErrorOnFirstToken(declaration.attributes, Diagnostics.The_assert_keyword_in_import_attributes_is_deprecated_and_has_been_replaced_by_the_with_keyword);
|
|
79967
|
+
}
|
|
79968
|
+
const node = declaration.attributes;
|
|
79969
|
+
if (node) {
|
|
79970
|
+
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
79971
|
+
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
79972
|
+
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
79973
|
+
if (validForTypeAttributes && override) {
|
|
79908
79974
|
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
79909
|
-
return grammarErrorOnNode(
|
|
79975
|
+
return grammarErrorOnNode(
|
|
79976
|
+
node,
|
|
79977
|
+
isImportAttributes2 ? Diagnostics.resolution_mode_attribute_are_only_supported_when_moduleResolution_is_node16_or_nodenext : Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext
|
|
79978
|
+
);
|
|
79910
79979
|
}
|
|
79911
79980
|
return;
|
|
79912
79981
|
}
|
|
79913
79982
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
79914
79983
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
79915
|
-
|
|
79916
|
-
|
|
79917
|
-
moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext
|
|
79918
|
-
);
|
|
79984
|
+
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_transpile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext;
|
|
79985
|
+
return grammarErrorOnNode(node, message);
|
|
79919
79986
|
}
|
|
79920
79987
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
79921
|
-
return grammarErrorOnNode(
|
|
79988
|
+
return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
79922
79989
|
}
|
|
79923
79990
|
if (override) {
|
|
79924
|
-
return grammarErrorOnNode(
|
|
79991
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
79925
79992
|
}
|
|
79926
79993
|
}
|
|
79927
79994
|
}
|
|
@@ -79953,7 +80020,7 @@ function createTypeChecker(host) {
|
|
|
79953
80020
|
}
|
|
79954
80021
|
}
|
|
79955
80022
|
}
|
|
79956
|
-
|
|
80023
|
+
checkImportAttributes(node);
|
|
79957
80024
|
}
|
|
79958
80025
|
function checkImportEqualsDeclaration(node) {
|
|
79959
80026
|
if (checkGrammarModuleElementContext(node, isInJSFile(node) ? Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
@@ -80026,7 +80093,7 @@ function createTypeChecker(host) {
|
|
|
80026
80093
|
}
|
|
80027
80094
|
}
|
|
80028
80095
|
}
|
|
80029
|
-
|
|
80096
|
+
checkImportAttributes(node);
|
|
80030
80097
|
}
|
|
80031
80098
|
function checkGrammarExportDeclaration(node) {
|
|
80032
80099
|
var _a;
|
|
@@ -83816,12 +83883,12 @@ function createTypeChecker(host) {
|
|
|
83816
83883
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
83817
83884
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
83818
83885
|
if (nodeArguments.length > 1) {
|
|
83819
|
-
const
|
|
83820
|
-
return grammarErrorOnNode(
|
|
83886
|
+
const importAttributesArgument = nodeArguments[1];
|
|
83887
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
83821
83888
|
}
|
|
83822
83889
|
}
|
|
83823
83890
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
83824
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
83891
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
|
|
83825
83892
|
}
|
|
83826
83893
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
83827
83894
|
if (spreadElement) {
|
|
@@ -84088,13 +84155,6 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
84088
84155
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
84089
84156
|
}
|
|
84090
84157
|
}
|
|
84091
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
84092
|
-
var _a;
|
|
84093
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
84094
|
-
this.onDiagnosticReported();
|
|
84095
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
84096
|
-
}
|
|
84097
|
-
}
|
|
84098
84158
|
onDiagnosticReported() {
|
|
84099
84159
|
this.context.reportedDiagnostic = true;
|
|
84100
84160
|
}
|
|
@@ -84603,16 +84663,16 @@ var visitEachChildTable = {
|
|
|
84603
84663
|
return context.factory.updateImportTypeNode(
|
|
84604
84664
|
node,
|
|
84605
84665
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
84606
|
-
nodeVisitor(node.
|
|
84666
|
+
nodeVisitor(node.attributes, visitor, isImportTypeAttributes),
|
|
84607
84667
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
84608
84668
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
84609
84669
|
node.isTypeOf
|
|
84610
84670
|
);
|
|
84611
84671
|
},
|
|
84612
|
-
[302 /*
|
|
84613
|
-
return context.factory.
|
|
84672
|
+
[302 /* ImportTypeAttributes */]: function visitEachChildOfImportTypeAttributes(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
84673
|
+
return context.factory.updateImportTypeAttributes(
|
|
84614
84674
|
node,
|
|
84615
|
-
Debug.checkDefined(nodeVisitor(node.
|
|
84675
|
+
Debug.checkDefined(nodeVisitor(node.attributes, visitor, isImportAttributes)),
|
|
84616
84676
|
node.multiLine
|
|
84617
84677
|
);
|
|
84618
84678
|
},
|
|
@@ -85154,20 +85214,20 @@ var visitEachChildTable = {
|
|
|
85154
85214
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
85155
85215
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
85156
85216
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
85157
|
-
nodeVisitor(node.
|
|
85217
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
85158
85218
|
);
|
|
85159
85219
|
},
|
|
85160
|
-
[300 /*
|
|
85161
|
-
return context.factory.
|
|
85220
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
85221
|
+
return context.factory.updateImportAttributes(
|
|
85162
85222
|
node,
|
|
85163
|
-
nodesVisitor(node.elements, visitor,
|
|
85223
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
85164
85224
|
node.multiLine
|
|
85165
85225
|
);
|
|
85166
85226
|
},
|
|
85167
|
-
[301 /*
|
|
85168
|
-
return context.factory.
|
|
85227
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
85228
|
+
return context.factory.updateImportAttribute(
|
|
85169
85229
|
node,
|
|
85170
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
85230
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
85171
85231
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
85172
85232
|
);
|
|
85173
85233
|
},
|
|
@@ -85219,7 +85279,7 @@ var visitEachChildTable = {
|
|
|
85219
85279
|
node.isTypeOnly,
|
|
85220
85280
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
85221
85281
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
85222
|
-
nodeVisitor(node.
|
|
85282
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
85223
85283
|
);
|
|
85224
85284
|
},
|
|
85225
85285
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -88538,7 +88598,7 @@ function transformTypeScript(context) {
|
|
|
88538
88598
|
void 0,
|
|
88539
88599
|
importClause,
|
|
88540
88600
|
node.moduleSpecifier,
|
|
88541
|
-
node.
|
|
88601
|
+
node.attributes
|
|
88542
88602
|
) : void 0;
|
|
88543
88603
|
}
|
|
88544
88604
|
function visitImportClause(node) {
|
|
@@ -88588,7 +88648,7 @@ function transformTypeScript(context) {
|
|
|
88588
88648
|
node.isTypeOnly,
|
|
88589
88649
|
exportClause,
|
|
88590
88650
|
node.moduleSpecifier,
|
|
88591
|
-
node.
|
|
88651
|
+
node.attributes
|
|
88592
88652
|
) : void 0;
|
|
88593
88653
|
}
|
|
88594
88654
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -88622,7 +88682,7 @@ function transformTypeScript(context) {
|
|
|
88622
88682
|
/*importClause*/
|
|
88623
88683
|
void 0,
|
|
88624
88684
|
node.moduleReference.expression,
|
|
88625
|
-
/*
|
|
88685
|
+
/*attributes*/
|
|
88626
88686
|
void 0
|
|
88627
88687
|
),
|
|
88628
88688
|
node
|
|
@@ -96792,7 +96852,7 @@ function transformJsx(context) {
|
|
|
96792
96852
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
96793
96853
|
),
|
|
96794
96854
|
factory2.createStringLiteral(importSource),
|
|
96795
|
-
/*
|
|
96855
|
+
/*attributes*/
|
|
96796
96856
|
void 0
|
|
96797
96857
|
);
|
|
96798
96858
|
setParentRecursive(
|
|
@@ -106199,7 +106259,9 @@ function transformECMAScriptModule(context) {
|
|
|
106199
106259
|
)
|
|
106200
106260
|
])
|
|
106201
106261
|
),
|
|
106202
|
-
factory2.createStringLiteral("module")
|
|
106262
|
+
factory2.createStringLiteral("module"),
|
|
106263
|
+
/*attributes*/
|
|
106264
|
+
void 0
|
|
106203
106265
|
);
|
|
106204
106266
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
106205
106267
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -106316,7 +106378,7 @@ function transformECMAScriptModule(context) {
|
|
|
106316
106378
|
)
|
|
106317
106379
|
),
|
|
106318
106380
|
node.moduleSpecifier,
|
|
106319
|
-
node.
|
|
106381
|
+
node.attributes
|
|
106320
106382
|
);
|
|
106321
106383
|
setOriginalNode(importDecl, node.exportClause);
|
|
106322
106384
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -106769,8 +106831,7 @@ function transformDeclarations(context) {
|
|
|
106769
106831
|
trackReferencedAmbientModule,
|
|
106770
106832
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
106771
106833
|
reportNonlocalAugmentation,
|
|
106772
|
-
reportNonSerializableProperty
|
|
106773
|
-
reportImportTypeNodeResolutionModeOverride
|
|
106834
|
+
reportNonSerializableProperty
|
|
106774
106835
|
};
|
|
106775
106836
|
let errorNameNode;
|
|
106776
106837
|
let errorFallbackNode;
|
|
@@ -106894,11 +106955,6 @@ function transformDeclarations(context) {
|
|
|
106894
106955
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
106895
106956
|
}
|
|
106896
106957
|
}
|
|
106897
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
106898
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
106899
|
-
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
|
|
106900
|
-
}
|
|
106901
|
-
}
|
|
106902
106958
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
106903
106959
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
106904
106960
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -107403,7 +107459,7 @@ function transformDeclarations(context) {
|
|
|
107403
107459
|
decl.modifiers,
|
|
107404
107460
|
decl.importClause,
|
|
107405
107461
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107406
|
-
|
|
107462
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107407
107463
|
);
|
|
107408
107464
|
}
|
|
107409
107465
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -107419,7 +107475,7 @@ function transformDeclarations(context) {
|
|
|
107419
107475
|
void 0
|
|
107420
107476
|
),
|
|
107421
107477
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107422
|
-
|
|
107478
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107423
107479
|
);
|
|
107424
107480
|
}
|
|
107425
107481
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -107437,7 +107493,7 @@ function transformDeclarations(context) {
|
|
|
107437
107493
|
namedBindings
|
|
107438
107494
|
),
|
|
107439
107495
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107440
|
-
|
|
107496
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107441
107497
|
) : void 0;
|
|
107442
107498
|
}
|
|
107443
107499
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -107452,7 +107508,7 @@ function transformDeclarations(context) {
|
|
|
107452
107508
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
107453
107509
|
),
|
|
107454
107510
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107455
|
-
|
|
107511
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107456
107512
|
);
|
|
107457
107513
|
}
|
|
107458
107514
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -107462,19 +107518,13 @@ function transformDeclarations(context) {
|
|
|
107462
107518
|
/*importClause*/
|
|
107463
107519
|
void 0,
|
|
107464
107520
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107465
|
-
|
|
107521
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107466
107522
|
);
|
|
107467
107523
|
}
|
|
107468
107524
|
}
|
|
107469
|
-
function
|
|
107470
|
-
const mode =
|
|
107471
|
-
|
|
107472
|
-
if (!isNightly()) {
|
|
107473
|
-
context.addDiagnostic(createDiagnosticForNode(assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next));
|
|
107474
|
-
}
|
|
107475
|
-
return assertClause;
|
|
107476
|
-
}
|
|
107477
|
-
return void 0;
|
|
107525
|
+
function tryGetResolutionModeOverride(node) {
|
|
107526
|
+
const mode = getResolutionModeOverride(node);
|
|
107527
|
+
return node && mode !== void 0 ? node : void 0;
|
|
107478
107528
|
}
|
|
107479
107529
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
107480
107530
|
while (length(lateMarkedStatements)) {
|
|
@@ -107760,7 +107810,7 @@ function transformDeclarations(context) {
|
|
|
107760
107810
|
return cleanup(factory2.updateImportTypeNode(
|
|
107761
107811
|
input,
|
|
107762
107812
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
107763
|
-
input.
|
|
107813
|
+
input.attributes,
|
|
107764
107814
|
input.qualifier,
|
|
107765
107815
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
107766
107816
|
input.isTypeOf
|
|
@@ -107814,7 +107864,7 @@ function transformDeclarations(context) {
|
|
|
107814
107864
|
input.isTypeOnly,
|
|
107815
107865
|
input.exportClause,
|
|
107816
107866
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
107817
|
-
|
|
107867
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
107818
107868
|
);
|
|
107819
107869
|
}
|
|
107820
107870
|
case 277 /* ExportAssignment */: {
|
|
@@ -110307,10 +110357,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
110307
110357
|
return emitNamedExports(node);
|
|
110308
110358
|
case 281 /* ExportSpecifier */:
|
|
110309
110359
|
return emitExportSpecifier(node);
|
|
110310
|
-
case 300 /*
|
|
110311
|
-
return
|
|
110312
|
-
case 301 /*
|
|
110313
|
-
return
|
|
110360
|
+
case 300 /* ImportAttributes */:
|
|
110361
|
+
return emitImportAttributes(node);
|
|
110362
|
+
case 301 /* ImportAttribute */:
|
|
110363
|
+
return emitImportAttribute(node);
|
|
110314
110364
|
case 282 /* MissingDeclaration */:
|
|
110315
110365
|
return;
|
|
110316
110366
|
case 283 /* ExternalModuleReference */:
|
|
@@ -111085,16 +111135,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111085
111135
|
writeKeyword("import");
|
|
111086
111136
|
writePunctuation("(");
|
|
111087
111137
|
emit(node.argument);
|
|
111088
|
-
if (node.
|
|
111138
|
+
if (node.attributes) {
|
|
111089
111139
|
writePunctuation(",");
|
|
111090
111140
|
writeSpace();
|
|
111091
111141
|
writePunctuation("{");
|
|
111092
111142
|
writeSpace();
|
|
111093
|
-
writeKeyword("assert");
|
|
111143
|
+
writeKeyword(node.attributes.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
111094
111144
|
writePunctuation(":");
|
|
111095
111145
|
writeSpace();
|
|
111096
|
-
const elements = node.
|
|
111097
|
-
emitList(node.
|
|
111146
|
+
const elements = node.attributes.attributes.elements;
|
|
111147
|
+
emitList(node.attributes.attributes, elements, 526226 /* ImportAttributes */);
|
|
111098
111148
|
writeSpace();
|
|
111099
111149
|
writePunctuation("}");
|
|
111100
111150
|
}
|
|
@@ -112079,8 +112129,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112079
112129
|
writeSpace();
|
|
112080
112130
|
}
|
|
112081
112131
|
emitExpression(node.moduleSpecifier);
|
|
112082
|
-
if (node.
|
|
112083
|
-
emitWithLeadingSpace(node.
|
|
112132
|
+
if (node.attributes) {
|
|
112133
|
+
emitWithLeadingSpace(node.attributes);
|
|
112084
112134
|
}
|
|
112085
112135
|
writeTrailingSemicolon();
|
|
112086
112136
|
}
|
|
@@ -112149,18 +112199,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112149
112199
|
writeSpace();
|
|
112150
112200
|
emitExpression(node.moduleSpecifier);
|
|
112151
112201
|
}
|
|
112152
|
-
if (node.
|
|
112153
|
-
emitWithLeadingSpace(node.
|
|
112202
|
+
if (node.attributes) {
|
|
112203
|
+
emitWithLeadingSpace(node.attributes);
|
|
112154
112204
|
}
|
|
112155
112205
|
writeTrailingSemicolon();
|
|
112156
112206
|
}
|
|
112157
|
-
function
|
|
112158
|
-
emitTokenWithComment(
|
|
112207
|
+
function emitImportAttributes(node) {
|
|
112208
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
112159
112209
|
writeSpace();
|
|
112160
112210
|
const elements = node.elements;
|
|
112161
|
-
emitList(node, elements, 526226 /*
|
|
112211
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
112162
112212
|
}
|
|
112163
|
-
function
|
|
112213
|
+
function emitImportAttribute(node) {
|
|
112164
112214
|
emit(node.name);
|
|
112165
112215
|
writePunctuation(":");
|
|
112166
112216
|
writeSpace();
|
|
@@ -114877,7 +114927,7 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
114877
114927
|
function createCompilerHost(options, setParentNodes) {
|
|
114878
114928
|
return createCompilerHostWorker(options, setParentNodes);
|
|
114879
114929
|
}
|
|
114880
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes
|
|
114930
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
|
|
114881
114931
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
114882
114932
|
let text;
|
|
114883
114933
|
try {
|
|
@@ -114891,15 +114941,7 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipN
|
|
|
114891
114941
|
}
|
|
114892
114942
|
text = "";
|
|
114893
114943
|
}
|
|
114894
|
-
return text !== void 0 ? createSourceFile(
|
|
114895
|
-
fileName,
|
|
114896
|
-
text,
|
|
114897
|
-
languageVersionOrOptions,
|
|
114898
|
-
setParentNodes,
|
|
114899
|
-
/*scriptKind*/
|
|
114900
|
-
void 0,
|
|
114901
|
-
skipNonSemanticJSDocParsing2
|
|
114902
|
-
) : void 0;
|
|
114944
|
+
return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
|
|
114903
114945
|
};
|
|
114904
114946
|
}
|
|
114905
114947
|
function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
|
|
@@ -114923,7 +114965,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
114923
114965
|
}
|
|
114924
114966
|
};
|
|
114925
114967
|
}
|
|
114926
|
-
function createCompilerHostWorker(options, setParentNodes,
|
|
114968
|
+
function createCompilerHostWorker(options, setParentNodes, system = sys) {
|
|
114927
114969
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
114928
114970
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
114929
114971
|
function directoryExists(directoryPath) {
|
|
@@ -114942,7 +114984,7 @@ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocP
|
|
|
114942
114984
|
const newLine = getNewLineCharacter(options);
|
|
114943
114985
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
114944
114986
|
const compilerHost = {
|
|
114945
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes
|
|
114987
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
|
|
114946
114988
|
getDefaultLibLocation,
|
|
114947
114989
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
114948
114990
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -115226,14 +115268,14 @@ function getModeForUsageLocation(file, usage) {
|
|
|
115226
115268
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
115227
115269
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
115228
115270
|
if (isTypeOnly) {
|
|
115229
|
-
const override =
|
|
115271
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
115230
115272
|
if (override) {
|
|
115231
115273
|
return override;
|
|
115232
115274
|
}
|
|
115233
115275
|
}
|
|
115234
115276
|
}
|
|
115235
115277
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
115236
|
-
const override =
|
|
115278
|
+
const override = getResolutionModeOverride((_a = usage.parent.parent.attributes) == null ? void 0 : _a.attributes);
|
|
115237
115279
|
if (override) {
|
|
115238
115280
|
return override;
|
|
115239
115281
|
}
|
|
@@ -115244,18 +115286,24 @@ function getModeForUsageLocation(file, usage) {
|
|
|
115244
115286
|
const exprParentParent = (_b = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _b.parent;
|
|
115245
115287
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
115246
115288
|
}
|
|
115247
|
-
function
|
|
115248
|
-
if (!
|
|
115289
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
115290
|
+
if (!node)
|
|
115249
115291
|
return void 0;
|
|
115250
|
-
if (length(
|
|
115251
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
115292
|
+
if (length(node.elements) !== 1) {
|
|
115293
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
115294
|
+
node,
|
|
115295
|
+
node.token === 118 /* WithKeyword */ ? Diagnostics.Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require : Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require
|
|
115296
|
+
);
|
|
115252
115297
|
return void 0;
|
|
115253
115298
|
}
|
|
115254
|
-
const elem =
|
|
115299
|
+
const elem = node.elements[0];
|
|
115255
115300
|
if (!isStringLiteralLike(elem.name))
|
|
115256
115301
|
return void 0;
|
|
115257
115302
|
if (elem.name.text !== "resolution-mode") {
|
|
115258
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
115303
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
115304
|
+
elem.name,
|
|
115305
|
+
node.token === 118 /* WithKeyword */ ? Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_attributes : Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions
|
|
115306
|
+
);
|
|
115259
115307
|
return void 0;
|
|
115260
115308
|
}
|
|
115261
115309
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -115398,15 +115446,15 @@ function isReferencedFile(reason) {
|
|
|
115398
115446
|
function isReferenceFileLocation(location) {
|
|
115399
115447
|
return location.pos !== void 0;
|
|
115400
115448
|
}
|
|
115401
|
-
function getReferencedFileLocation(
|
|
115402
|
-
var _a, _b, _c, _d
|
|
115403
|
-
const file = Debug.checkDefined(getSourceFileByPath(ref.file));
|
|
115449
|
+
function getReferencedFileLocation(program, ref) {
|
|
115450
|
+
var _a, _b, _c, _d;
|
|
115451
|
+
const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
|
|
115404
115452
|
const { kind, index } = ref;
|
|
115405
115453
|
let pos, end, packageId, resolutionMode;
|
|
115406
115454
|
switch (kind) {
|
|
115407
115455
|
case 3 /* Import */:
|
|
115408
115456
|
const importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
115409
|
-
packageId = (
|
|
115457
|
+
packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
|
|
115410
115458
|
if (importLiteral.pos === -1)
|
|
115411
115459
|
return { file, packageId, text: importLiteral.text };
|
|
115412
115460
|
pos = skipTrivia(file.text, importLiteral.pos);
|
|
@@ -115417,7 +115465,7 @@ function getReferencedFileLocation(getSourceFileByPath, ref) {
|
|
|
115417
115465
|
break;
|
|
115418
115466
|
case 5 /* TypeReferenceDirective */:
|
|
115419
115467
|
({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
|
|
115420
|
-
packageId = (
|
|
115468
|
+
packageId = (_d = (_c = program.getResolvedTypeReferenceDirective(file, toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) == null ? void 0 : _c.resolvedTypeReferenceDirective) == null ? void 0 : _d.packageId;
|
|
115421
115469
|
break;
|
|
115422
115470
|
case 7 /* LibReferenceDirective */:
|
|
115423
115471
|
({ pos, end } = file.libReferenceDirectives[index]);
|
|
@@ -115550,7 +115598,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
|
|
|
115550
115598
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
115551
115599
|
Diagnostics.Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern.code,
|
|
115552
115600
|
Diagnostics.Duplicate_label_0.code,
|
|
115553
|
-
Diagnostics.
|
|
115601
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
115554
115602
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
115555
115603
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
115556
115604
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -115631,6 +115679,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115631
115679
|
let automaticTypeDirectiveResolutions;
|
|
115632
115680
|
let resolvedLibReferences;
|
|
115633
115681
|
let resolvedLibProcessing;
|
|
115682
|
+
let resolvedModules;
|
|
115683
|
+
let resolvedModulesProcessing;
|
|
115684
|
+
let resolvedTypeReferenceDirectiveNames;
|
|
115685
|
+
let resolvedTypeReferenceDirectiveNamesProcessing;
|
|
115634
115686
|
let packageMap;
|
|
115635
115687
|
const maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
|
|
115636
115688
|
let currentNodeModulesDepth = 0;
|
|
@@ -115895,6 +115947,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115895
115947
|
}
|
|
115896
115948
|
oldProgram = void 0;
|
|
115897
115949
|
resolvedLibProcessing = void 0;
|
|
115950
|
+
resolvedModulesProcessing = void 0;
|
|
115951
|
+
resolvedTypeReferenceDirectiveNamesProcessing = void 0;
|
|
115898
115952
|
const program = {
|
|
115899
115953
|
getRootFileNames: () => rootNames,
|
|
115900
115954
|
getSourceFile,
|
|
@@ -115936,7 +115990,13 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115936
115990
|
sourceFileToPackageName,
|
|
115937
115991
|
redirectTargetsMap,
|
|
115938
115992
|
usesUriStyleNodeCoreModules,
|
|
115993
|
+
resolvedModules,
|
|
115994
|
+
resolvedTypeReferenceDirectiveNames,
|
|
115939
115995
|
resolvedLibReferences,
|
|
115996
|
+
getResolvedModule,
|
|
115997
|
+
getResolvedTypeReferenceDirective,
|
|
115998
|
+
forEachResolvedModule,
|
|
115999
|
+
forEachResolvedTypeReferenceDirective,
|
|
115940
116000
|
getCurrentPackagesMap: () => packageMap,
|
|
115941
116001
|
typesPackageExists,
|
|
115942
116002
|
packageBundlesTypes,
|
|
@@ -115967,7 +116027,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115967
116027
|
case 1 /* FilePreprocessingFileExplainingDiagnostic */:
|
|
115968
116028
|
return programDiagnostics.add(createDiagnosticExplainingFile(diagnostic.file && getSourceFileByPath(diagnostic.file), diagnostic.fileProcessingReason, diagnostic.diagnostic, diagnostic.args || emptyArray));
|
|
115969
116029
|
case 0 /* FilePreprocessingReferencedDiagnostic */:
|
|
115970
|
-
const { file, pos, end } = getReferencedFileLocation(
|
|
116030
|
+
const { file, pos, end } = getReferencedFileLocation(program, diagnostic.reason);
|
|
115971
116031
|
return programDiagnostics.add(createFileDiagnostic(file, Debug.checkDefined(pos), Debug.checkDefined(end) - pos, diagnostic.diagnostic, ...diagnostic.args || emptyArray));
|
|
115972
116032
|
case 2 /* ResolutionDiagnostics */:
|
|
115973
116033
|
return diagnostic.diagnostics.forEach((d) => programDiagnostics.add(d));
|
|
@@ -115980,17 +116040,34 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115980
116040
|
measure("Program", "beforeProgram", "afterProgram");
|
|
115981
116041
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
115982
116042
|
return program;
|
|
116043
|
+
function getResolvedModule(file, moduleName, mode) {
|
|
116044
|
+
var _a2;
|
|
116045
|
+
return (_a2 = resolvedModules == null ? void 0 : resolvedModules.get(file.path)) == null ? void 0 : _a2.get(moduleName, mode);
|
|
116046
|
+
}
|
|
116047
|
+
function getResolvedTypeReferenceDirective(file, typeDirectiveName, mode) {
|
|
116048
|
+
var _a2;
|
|
116049
|
+
return (_a2 = resolvedTypeReferenceDirectiveNames == null ? void 0 : resolvedTypeReferenceDirectiveNames.get(file.path)) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
116050
|
+
}
|
|
116051
|
+
function forEachResolvedModule(callback, file) {
|
|
116052
|
+
forEachResolution(resolvedModules, callback, file);
|
|
116053
|
+
}
|
|
116054
|
+
function forEachResolvedTypeReferenceDirective(callback, file) {
|
|
116055
|
+
forEachResolution(resolvedTypeReferenceDirectiveNames, callback, file);
|
|
116056
|
+
}
|
|
116057
|
+
function forEachResolution(resolutionCache, callback, file) {
|
|
116058
|
+
var _a2;
|
|
116059
|
+
if (file)
|
|
116060
|
+
(_a2 = resolutionCache == null ? void 0 : resolutionCache.get(file.path)) == null ? void 0 : _a2.forEach((resolution, name, mode) => callback(resolution, name, mode, file.path));
|
|
116061
|
+
else
|
|
116062
|
+
resolutionCache == null ? void 0 : resolutionCache.forEach((resolutions, filePath) => resolutions.forEach((resolution, name, mode) => callback(resolution, name, mode, filePath)));
|
|
116063
|
+
}
|
|
115983
116064
|
function getPackagesMap() {
|
|
115984
116065
|
if (packageMap)
|
|
115985
116066
|
return packageMap;
|
|
115986
116067
|
packageMap = /* @__PURE__ */ new Map();
|
|
115987
|
-
|
|
115988
|
-
if (
|
|
115989
|
-
|
|
115990
|
-
sf.resolvedModules.forEach(({ resolvedModule }) => {
|
|
115991
|
-
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
115992
|
-
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
115993
|
-
});
|
|
116068
|
+
forEachResolvedModule(({ resolvedModule }) => {
|
|
116069
|
+
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
116070
|
+
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
115994
116071
|
});
|
|
115995
116072
|
return packageMap;
|
|
115996
116073
|
}
|
|
@@ -116123,7 +116200,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116123
116200
|
return classifiableNames;
|
|
116124
116201
|
}
|
|
116125
116202
|
function resolveModuleNamesReusingOldState(moduleNames, file) {
|
|
116126
|
-
var _a2;
|
|
116127
116203
|
if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
|
|
116128
116204
|
return resolveModuleNamesWorker(
|
|
116129
116205
|
moduleNames,
|
|
@@ -116132,24 +116208,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116132
116208
|
void 0
|
|
116133
116209
|
);
|
|
116134
116210
|
}
|
|
116135
|
-
const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
116136
|
-
if (oldSourceFile !== file && file.resolvedModules) {
|
|
116137
|
-
const result2 = [];
|
|
116138
|
-
for (const moduleName of moduleNames) {
|
|
116139
|
-
const resolvedModule = file.resolvedModules.get(moduleName.text, getModeForUsageLocation(file, moduleName));
|
|
116140
|
-
result2.push(resolvedModule);
|
|
116141
|
-
}
|
|
116142
|
-
return result2;
|
|
116143
|
-
}
|
|
116144
116211
|
let unknownModuleNames;
|
|
116145
116212
|
let result;
|
|
116146
116213
|
let reusedNames;
|
|
116147
116214
|
const predictedToResolveToAmbientModuleMarker = emptyResolution;
|
|
116215
|
+
const oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
116148
116216
|
for (let i = 0; i < moduleNames.length; i++) {
|
|
116149
116217
|
const moduleName = moduleNames[i];
|
|
116150
|
-
if (file === oldSourceFile && !hasInvalidatedResolutions(
|
|
116218
|
+
if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
|
|
116151
116219
|
const mode = getModeForUsageLocation(file, moduleName);
|
|
116152
|
-
const oldResolution =
|
|
116220
|
+
const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
|
|
116153
116221
|
if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
|
|
116154
116222
|
if (isTraceEnabled(options, host)) {
|
|
116155
116223
|
trace(
|
|
@@ -116196,7 +116264,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116196
116264
|
Debug.assert(j === resolutions.length);
|
|
116197
116265
|
return result;
|
|
116198
116266
|
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
|
|
116199
|
-
|
|
116267
|
+
var _a2;
|
|
116268
|
+
const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
|
|
116200
116269
|
const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
|
|
116201
116270
|
if (resolutionToFile && resolvedFile) {
|
|
116202
116271
|
return false;
|
|
@@ -116221,28 +116290,18 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116221
116290
|
void 0
|
|
116222
116291
|
);
|
|
116223
116292
|
}
|
|
116224
|
-
const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0;
|
|
116225
|
-
if (!isString(containingFile)) {
|
|
116226
|
-
if (oldSourceFile !== containingFile && containingFile.resolvedTypeReferenceDirectiveNames) {
|
|
116227
|
-
const result2 = [];
|
|
116228
|
-
for (const typeDirectiveName of typeDirectiveNames) {
|
|
116229
|
-
const resolvedTypeReferenceDirective = containingFile.resolvedTypeReferenceDirectiveNames.get(getTypeReferenceResolutionName(typeDirectiveName), getModeForFileReference(typeDirectiveName, containingFile.impliedNodeFormat));
|
|
116230
|
-
result2.push(resolvedTypeReferenceDirective);
|
|
116231
|
-
}
|
|
116232
|
-
return result2;
|
|
116233
|
-
}
|
|
116234
|
-
}
|
|
116235
116293
|
let unknownTypeReferenceDirectiveNames;
|
|
116236
116294
|
let result;
|
|
116237
116295
|
let reusedNames;
|
|
116238
116296
|
const containingSourceFile = !isString(containingFile) ? containingFile : void 0;
|
|
116239
|
-
const
|
|
116297
|
+
const oldSourceFile = !isString(containingFile) ? oldProgram && oldProgram.getSourceFile(containingFile.fileName) : void 0;
|
|
116298
|
+
const canReuseResolutions = !isString(containingFile) ? containingFile === oldSourceFile && !hasInvalidatedResolutions(containingFile.path) : !hasInvalidatedResolutions(toPath3(containingFile));
|
|
116240
116299
|
for (let i = 0; i < typeDirectiveNames.length; i++) {
|
|
116241
116300
|
const entry = typeDirectiveNames[i];
|
|
116242
116301
|
if (canReuseResolutions) {
|
|
116243
116302
|
const typeDirectiveName = getTypeReferenceResolutionName(entry);
|
|
116244
116303
|
const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
|
|
116245
|
-
const oldResolution =
|
|
116304
|
+
const oldResolution = !isString(containingFile) ? oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(containingFile, typeDirectiveName, mode) : (_a2 = oldProgram == null ? void 0 : oldProgram.getAutomaticTypeDirectiveResolutions()) == null ? void 0 : _a2.get(typeDirectiveName, mode);
|
|
116246
116305
|
if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
|
|
116247
116306
|
if (isTraceEnabled(options, host)) {
|
|
116248
116307
|
trace(
|
|
@@ -116404,43 +116463,47 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116404
116463
|
structureIsReused = 1 /* SafeModules */;
|
|
116405
116464
|
}
|
|
116406
116465
|
}
|
|
116407
|
-
modifiedSourceFiles.push(
|
|
116466
|
+
modifiedSourceFiles.push(newSourceFile);
|
|
116408
116467
|
} else if (hasInvalidatedResolutions(oldSourceFile.path)) {
|
|
116409
116468
|
structureIsReused = 1 /* SafeModules */;
|
|
116410
|
-
modifiedSourceFiles.push(
|
|
116469
|
+
modifiedSourceFiles.push(newSourceFile);
|
|
116470
|
+
} else {
|
|
116471
|
+
for (const moduleName of oldSourceFile.ambientModuleNames) {
|
|
116472
|
+
ambientModuleNameToUnmodifiedFileName.set(moduleName, oldSourceFile.fileName);
|
|
116473
|
+
}
|
|
116411
116474
|
}
|
|
116412
116475
|
newSourceFiles.push(newSourceFile);
|
|
116413
116476
|
}
|
|
116414
116477
|
if (structureIsReused !== 2 /* Completely */) {
|
|
116415
116478
|
return structureIsReused;
|
|
116416
116479
|
}
|
|
116417
|
-
const
|
|
116418
|
-
for (const oldFile of oldSourceFiles) {
|
|
116419
|
-
if (!contains(modifiedFiles, oldFile)) {
|
|
116420
|
-
for (const moduleName of oldFile.ambientModuleNames) {
|
|
116421
|
-
ambientModuleNameToUnmodifiedFileName.set(moduleName, oldFile.fileName);
|
|
116422
|
-
}
|
|
116423
|
-
}
|
|
116424
|
-
}
|
|
116425
|
-
for (const { oldFile: oldSourceFile, newFile: newSourceFile } of modifiedSourceFiles) {
|
|
116480
|
+
for (const newSourceFile of modifiedSourceFiles) {
|
|
116426
116481
|
const moduleNames = getModuleNames(newSourceFile);
|
|
116427
116482
|
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
|
116428
|
-
|
|
116429
|
-
|
|
116483
|
+
(resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
|
|
116484
|
+
const resolutionsChanged = hasChangesInResolutions(
|
|
116485
|
+
moduleNames,
|
|
116486
|
+
newSourceFile,
|
|
116487
|
+
resolutions,
|
|
116488
|
+
(name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
|
|
116489
|
+
moduleResolutionIsEqualTo,
|
|
116490
|
+
moduleResolutionNameAndModeGetter
|
|
116491
|
+
);
|
|
116492
|
+
if (resolutionsChanged)
|
|
116430
116493
|
structureIsReused = 1 /* SafeModules */;
|
|
116431
|
-
newSourceFile.resolvedModules = zipToModeAwareCache(newSourceFile, moduleNames, resolutions, moduleResolutionNameAndModeGetter);
|
|
116432
|
-
} else {
|
|
116433
|
-
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
|
|
116434
|
-
}
|
|
116435
116494
|
const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
116436
116495
|
const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
|
|
116437
|
-
|
|
116438
|
-
|
|
116496
|
+
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
|
|
116497
|
+
const typeReferenceResolutionsChanged = hasChangesInResolutions(
|
|
116498
|
+
typesReferenceDirectives,
|
|
116499
|
+
newSourceFile,
|
|
116500
|
+
typeReferenceResolutions,
|
|
116501
|
+
(name, mode) => oldProgram == null ? void 0 : oldProgram.getResolvedTypeReferenceDirective(newSourceFile, name, mode),
|
|
116502
|
+
typeDirectiveIsEqualTo,
|
|
116503
|
+
typeReferenceResolutionNameAndModeGetter
|
|
116504
|
+
);
|
|
116505
|
+
if (typeReferenceResolutionsChanged)
|
|
116439
116506
|
structureIsReused = 1 /* SafeModules */;
|
|
116440
|
-
newSourceFile.resolvedTypeReferenceDirectiveNames = zipToModeAwareCache(newSourceFile, typesReferenceDirectives, typeReferenceResolutions, typeReferenceResolutionNameAndModeGetter);
|
|
116441
|
-
} else {
|
|
116442
|
-
newSourceFile.resolvedTypeReferenceDirectiveNames = oldSourceFile.resolvedTypeReferenceDirectiveNames;
|
|
116443
|
-
}
|
|
116444
116507
|
}
|
|
116445
116508
|
if (structureIsReused !== 2 /* Completely */) {
|
|
116446
116509
|
return structureIsReused;
|
|
@@ -116487,6 +116550,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116487
116550
|
sourceFileToPackageName = oldProgram.sourceFileToPackageName;
|
|
116488
116551
|
redirectTargetsMap = oldProgram.redirectTargetsMap;
|
|
116489
116552
|
usesUriStyleNodeCoreModules = oldProgram.usesUriStyleNodeCoreModules;
|
|
116553
|
+
resolvedModules = oldProgram.resolvedModules;
|
|
116554
|
+
resolvedTypeReferenceDirectiveNames = oldProgram.resolvedTypeReferenceDirectiveNames;
|
|
116490
116555
|
resolvedLibReferences = oldProgram.resolvedLibReferences;
|
|
116491
116556
|
packageMap = oldProgram.getCurrentPackagesMap();
|
|
116492
116557
|
return 2 /* Completely */;
|
|
@@ -117067,7 +117132,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117067
117132
|
/*importClause*/
|
|
117068
117133
|
void 0,
|
|
117069
117134
|
externalHelpersModuleReference,
|
|
117070
|
-
/*
|
|
117135
|
+
/*attributes*/
|
|
117071
117136
|
void 0
|
|
117072
117137
|
);
|
|
117073
117138
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -117308,7 +117373,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117308
117373
|
const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
|
|
117309
117374
|
const languageVersion = getEmitScriptTarget(options2);
|
|
117310
117375
|
const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
|
|
117311
|
-
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2 } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2 };
|
|
117376
|
+
return typeof result === "object" ? { ...result, languageVersion, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode } : { languageVersion, impliedNodeFormat: result, setExternalModuleIndicator: setExternalModuleIndicator2, jsDocParsingMode: host2.jsDocParsingMode };
|
|
117312
117377
|
}
|
|
117313
117378
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
117314
117379
|
var _a2;
|
|
@@ -117532,16 +117597,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117532
117597
|
}
|
|
117533
117598
|
function processTypeReferenceDirectives(file) {
|
|
117534
117599
|
const typeDirectives = file.typeReferenceDirectives;
|
|
117535
|
-
if (!typeDirectives.length)
|
|
117536
|
-
file.resolvedTypeReferenceDirectiveNames = void 0;
|
|
117600
|
+
if (!typeDirectives.length)
|
|
117537
117601
|
return;
|
|
117538
|
-
|
|
117539
|
-
const
|
|
117602
|
+
const resolutions = (resolvedTypeReferenceDirectiveNamesProcessing == null ? void 0 : resolvedTypeReferenceDirectiveNamesProcessing.get(file.path)) || resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectives, file);
|
|
117603
|
+
const resolutionsInFile = createModeAwareCache();
|
|
117604
|
+
(resolvedTypeReferenceDirectiveNames ?? (resolvedTypeReferenceDirectiveNames = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile);
|
|
117540
117605
|
for (let index = 0; index < typeDirectives.length; index++) {
|
|
117541
117606
|
const ref = file.typeReferenceDirectives[index];
|
|
117542
117607
|
const resolvedTypeReferenceDirective = resolutions[index];
|
|
117543
117608
|
const fileName = toFileNameLowerCase(ref.fileName);
|
|
117544
|
-
|
|
117609
|
+
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
117545
117610
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
117546
117611
|
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
117547
117612
|
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
|
|
@@ -117705,14 +117770,16 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117705
117770
|
collectExternalModuleReferences(file);
|
|
117706
117771
|
if (file.imports.length || file.moduleAugmentations.length) {
|
|
117707
117772
|
const moduleNames = getModuleNames(file);
|
|
117708
|
-
const resolutions = resolveModuleNamesReusingOldState(moduleNames, file);
|
|
117773
|
+
const resolutions = (resolvedModulesProcessing == null ? void 0 : resolvedModulesProcessing.get(file.path)) || resolveModuleNamesReusingOldState(moduleNames, file);
|
|
117709
117774
|
Debug.assert(resolutions.length === moduleNames.length);
|
|
117710
117775
|
const optionsForFile = (useSourceOfProjectReferenceRedirect ? (_a2 = getRedirectReferenceForResolution(file)) == null ? void 0 : _a2.commandLine.options : void 0) || options;
|
|
117776
|
+
const resolutionsInFile = createModeAwareCache();
|
|
117777
|
+
(resolvedModules ?? (resolvedModules = /* @__PURE__ */ new Map())).set(file.path, resolutionsInFile);
|
|
117711
117778
|
for (let index = 0; index < moduleNames.length; index++) {
|
|
117712
117779
|
const resolution = resolutions[index].resolvedModule;
|
|
117713
117780
|
const moduleName = moduleNames[index].text;
|
|
117714
117781
|
const mode = getModeForUsageLocation(file, moduleNames[index]);
|
|
117715
|
-
|
|
117782
|
+
resolutionsInFile.set(moduleName, mode, resolutions[index]);
|
|
117716
117783
|
addResolutionDiagnosticsFromResolutionOrCache(file, moduleName, resolutions[index], mode);
|
|
117717
117784
|
if (!resolution) {
|
|
117718
117785
|
continue;
|
|
@@ -117743,8 +117810,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117743
117810
|
currentNodeModulesDepth--;
|
|
117744
117811
|
}
|
|
117745
117812
|
}
|
|
117746
|
-
} else {
|
|
117747
|
-
file.resolvedModules = void 0;
|
|
117748
117813
|
}
|
|
117749
117814
|
}
|
|
117750
117815
|
function checkSourceFilesBelongToPath(sourceFiles, rootDirectory) {
|
|
@@ -118259,7 +118324,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118259
118324
|
processReason(fileProcessingReason);
|
|
118260
118325
|
if (locationReason && (fileIncludeReasons == null ? void 0 : fileIncludeReasons.length) === 1)
|
|
118261
118326
|
fileIncludeReasons = void 0;
|
|
118262
|
-
const location = locationReason && getReferencedFileLocation(
|
|
118327
|
+
const location = locationReason && getReferencedFileLocation(program, locationReason);
|
|
118263
118328
|
const fileIncludeReasonDetails = fileIncludeReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
|
118264
118329
|
const redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file);
|
|
118265
118330
|
const chain = chainDiagnosticMessages(redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, diagnostic, ...args || emptyArray);
|
|
@@ -118295,7 +118360,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118295
118360
|
}
|
|
118296
118361
|
function fileIncludeReasonToRelatedInformation(reason) {
|
|
118297
118362
|
if (isReferencedFile(reason)) {
|
|
118298
|
-
const referenceLocation = getReferencedFileLocation(
|
|
118363
|
+
const referenceLocation = getReferencedFileLocation(program, reason);
|
|
118299
118364
|
let message2;
|
|
118300
118365
|
switch (reason.kind) {
|
|
118301
118366
|
case 3 /* Import */:
|
|
@@ -118584,8 +118649,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118584
118649
|
if (!symlinks) {
|
|
118585
118650
|
symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
|
|
118586
118651
|
}
|
|
118587
|
-
if (files &&
|
|
118588
|
-
symlinks.setSymlinksFromResolutions(
|
|
118652
|
+
if (files && !symlinks.hasProcessedResolutions()) {
|
|
118653
|
+
symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions);
|
|
118589
118654
|
}
|
|
118590
118655
|
return symlinks;
|
|
118591
118656
|
}
|
|
@@ -118954,16 +119019,14 @@ var BuilderState;
|
|
|
118954
119019
|
addReferencedFile(referencedPath);
|
|
118955
119020
|
}
|
|
118956
119021
|
}
|
|
118957
|
-
|
|
118958
|
-
|
|
118959
|
-
|
|
118960
|
-
|
|
118961
|
-
|
|
118962
|
-
|
|
118963
|
-
|
|
118964
|
-
|
|
118965
|
-
});
|
|
118966
|
-
}
|
|
119022
|
+
program.forEachResolvedTypeReferenceDirective(({ resolvedTypeReferenceDirective }) => {
|
|
119023
|
+
if (!resolvedTypeReferenceDirective) {
|
|
119024
|
+
return;
|
|
119025
|
+
}
|
|
119026
|
+
const fileName = resolvedTypeReferenceDirective.resolvedFileName;
|
|
119027
|
+
const typeFilePath = getReferencedFileFromFileName(program, fileName, sourceFileDirectory, getCanonicalFileName);
|
|
119028
|
+
addReferencedFile(typeFilePath);
|
|
119029
|
+
}, sourceFile);
|
|
118967
119030
|
if (sourceFile.moduleAugmentations.length) {
|
|
118968
119031
|
const checker = program.getTypeChecker();
|
|
118969
119032
|
for (const moduleName of sourceFile.moduleAugmentations) {
|
|
@@ -120681,6 +120744,47 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
|
|
|
120681
120744
|
const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
|
|
120682
120745
|
return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
|
|
120683
120746
|
}
|
|
120747
|
+
function createModuleResolutionLoaderUsingGlobalCache(containingFile, redirectedReference, options, resolutionHost, moduleResolutionCache) {
|
|
120748
|
+
return {
|
|
120749
|
+
nameAndMode: moduleResolutionNameAndModeGetter,
|
|
120750
|
+
resolve: (moduleName, resoluionMode) => resolveModuleNameUsingGlobalCache(
|
|
120751
|
+
resolutionHost,
|
|
120752
|
+
moduleResolutionCache,
|
|
120753
|
+
moduleName,
|
|
120754
|
+
containingFile,
|
|
120755
|
+
options,
|
|
120756
|
+
redirectedReference,
|
|
120757
|
+
resoluionMode
|
|
120758
|
+
)
|
|
120759
|
+
};
|
|
120760
|
+
}
|
|
120761
|
+
function resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, compilerOptions, redirectedReference, mode) {
|
|
120762
|
+
var _a;
|
|
120763
|
+
const host = ((_a = resolutionHost.getCompilerHost) == null ? void 0 : _a.call(resolutionHost)) || resolutionHost;
|
|
120764
|
+
const primaryResult = resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
120765
|
+
if (!resolutionHost.getGlobalCache) {
|
|
120766
|
+
return primaryResult;
|
|
120767
|
+
}
|
|
120768
|
+
const globalCache = resolutionHost.getGlobalCache();
|
|
120769
|
+
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
120770
|
+
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
120771
|
+
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
120772
|
+
resolutionHost.projectName,
|
|
120773
|
+
compilerOptions,
|
|
120774
|
+
host,
|
|
120775
|
+
globalCache,
|
|
120776
|
+
moduleResolutionCache
|
|
120777
|
+
);
|
|
120778
|
+
if (resolvedModule) {
|
|
120779
|
+
primaryResult.resolvedModule = resolvedModule;
|
|
120780
|
+
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
120781
|
+
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
120782
|
+
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
120783
|
+
return primaryResult;
|
|
120784
|
+
}
|
|
120785
|
+
}
|
|
120786
|
+
return primaryResult;
|
|
120787
|
+
}
|
|
120684
120788
|
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
|
|
120685
120789
|
let filesWithChangedSetOfUnresolvedImports;
|
|
120686
120790
|
let filesWithInvalidatedResolutions;
|
|
@@ -120727,6 +120831,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120727
120831
|
const rootPathComponents = getPathComponents(rootPath);
|
|
120728
120832
|
const typeRootsWatches = /* @__PURE__ */ new Map();
|
|
120729
120833
|
return {
|
|
120834
|
+
rootDirForResolution,
|
|
120835
|
+
resolvedModuleNames,
|
|
120836
|
+
resolvedTypeReferenceDirectives,
|
|
120837
|
+
resolvedLibraries,
|
|
120838
|
+
resolvedFileToResolution,
|
|
120839
|
+
resolutionsWithFailedLookups,
|
|
120840
|
+
resolutionsWithOnlyAffectingLocations,
|
|
120841
|
+
directoryWatchesOfFailedLookups,
|
|
120842
|
+
fileWatchesOfAffectingLocations,
|
|
120843
|
+
watchFailedLookupLocationsOfExternalModuleResolutions,
|
|
120730
120844
|
getModuleResolutionCache: () => moduleResolutionCache,
|
|
120731
120845
|
startRecordingFilesWithChangedResolutions,
|
|
120732
120846
|
finishRecordingFilesWithChangedResolutions,
|
|
@@ -120751,7 +120865,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120751
120865
|
clear: clear2,
|
|
120752
120866
|
onChangesAffectModuleResolution
|
|
120753
120867
|
};
|
|
120754
|
-
function
|
|
120868
|
+
function getResolvedModule(resolution) {
|
|
120755
120869
|
return resolution.resolvedModule;
|
|
120756
120870
|
}
|
|
120757
120871
|
function getResolvedTypeReferenceDirective(resolution) {
|
|
@@ -120829,8 +120943,8 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120829
120943
|
if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) {
|
|
120830
120944
|
stopWatchFailedLookupLocationOfResolution(
|
|
120831
120945
|
resolution,
|
|
120832
|
-
resolutionHost.toPath(getInferredLibraryNameResolveFrom(
|
|
120833
|
-
|
|
120946
|
+
resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)),
|
|
120947
|
+
getResolvedModule
|
|
120834
120948
|
);
|
|
120835
120949
|
resolvedLibraries.delete(libFileName);
|
|
120836
120950
|
}
|
|
@@ -120871,58 +120985,22 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120871
120985
|
}
|
|
120872
120986
|
});
|
|
120873
120987
|
}
|
|
120874
|
-
directoryWatchesOfFailedLookups.forEach(
|
|
120875
|
-
|
|
120876
|
-
directoryWatchesOfFailedLookups.delete(path);
|
|
120877
|
-
watcher.watcher.close();
|
|
120878
|
-
}
|
|
120879
|
-
});
|
|
120880
|
-
fileWatchesOfAffectingLocations.forEach((watcher, path) => {
|
|
120881
|
-
if (watcher.files === 0 && watcher.resolutions === 0) {
|
|
120882
|
-
fileWatchesOfAffectingLocations.delete(path);
|
|
120883
|
-
watcher.watcher.close();
|
|
120884
|
-
}
|
|
120885
|
-
});
|
|
120988
|
+
directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
|
|
120989
|
+
fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
|
|
120886
120990
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
120887
120991
|
}
|
|
120888
|
-
function
|
|
120889
|
-
|
|
120890
|
-
|
|
120891
|
-
|
|
120892
|
-
if (!resolutionHost.getGlobalCache) {
|
|
120893
|
-
return primaryResult;
|
|
120894
|
-
}
|
|
120895
|
-
const globalCache = resolutionHost.getGlobalCache();
|
|
120896
|
-
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
120897
|
-
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
120898
|
-
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
120899
|
-
resolutionHost.projectName,
|
|
120900
|
-
compilerOptions,
|
|
120901
|
-
host,
|
|
120902
|
-
globalCache,
|
|
120903
|
-
moduleResolutionCache
|
|
120904
|
-
);
|
|
120905
|
-
if (resolvedModule) {
|
|
120906
|
-
primaryResult.resolvedModule = resolvedModule;
|
|
120907
|
-
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
120908
|
-
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
120909
|
-
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
120910
|
-
return primaryResult;
|
|
120911
|
-
}
|
|
120992
|
+
function closeDirectoryWatchesOfFailedLookup(watcher, path) {
|
|
120993
|
+
if (watcher.refCount === 0) {
|
|
120994
|
+
directoryWatchesOfFailedLookups.delete(path);
|
|
120995
|
+
watcher.watcher.close();
|
|
120912
120996
|
}
|
|
120913
|
-
return primaryResult;
|
|
120914
120997
|
}
|
|
120915
|
-
function
|
|
120916
|
-
|
|
120917
|
-
|
|
120918
|
-
|
|
120919
|
-
|
|
120920
|
-
|
|
120921
|
-
options,
|
|
120922
|
-
redirectedReference,
|
|
120923
|
-
resoluionMode
|
|
120924
|
-
)
|
|
120925
|
-
};
|
|
120998
|
+
function closeFileWatcherOfAffectingLocation(watcher, path) {
|
|
120999
|
+
var _a;
|
|
121000
|
+
if (watcher.files === 0 && watcher.resolutions === 0 && !((_a = watcher.symlinks) == null ? void 0 : _a.size)) {
|
|
121001
|
+
fileWatchesOfAffectingLocations.delete(path);
|
|
121002
|
+
watcher.watcher.close();
|
|
121003
|
+
}
|
|
120926
121004
|
}
|
|
120927
121005
|
function resolveNamesWithLocalCache({
|
|
120928
121006
|
entries,
|
|
@@ -120959,9 +121037,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120959
121037
|
resolutionHost.onDiscoveredSymlink();
|
|
120960
121038
|
}
|
|
120961
121039
|
resolutionsInFile.set(name, mode, resolution);
|
|
120962
|
-
|
|
120963
|
-
|
|
120964
|
-
|
|
121040
|
+
if (resolution !== existingResolution) {
|
|
121041
|
+
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
|
|
121042
|
+
if (existingResolution) {
|
|
121043
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
|
|
121044
|
+
}
|
|
120965
121045
|
}
|
|
120966
121046
|
if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {
|
|
120967
121047
|
filesWithChangedSetOfUnresolvedImports.push(path);
|
|
@@ -121050,12 +121130,14 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121050
121130
|
options,
|
|
121051
121131
|
reusedNames,
|
|
121052
121132
|
perFileCache: resolvedModuleNames,
|
|
121053
|
-
loader:
|
|
121133
|
+
loader: createModuleResolutionLoaderUsingGlobalCache(
|
|
121054
121134
|
containingFile,
|
|
121055
121135
|
redirectedReference,
|
|
121056
|
-
options
|
|
121136
|
+
options,
|
|
121137
|
+
resolutionHost,
|
|
121138
|
+
moduleResolutionCache
|
|
121057
121139
|
),
|
|
121058
|
-
getResolutionWithResolvedFileName:
|
|
121140
|
+
getResolutionWithResolvedFileName: getResolvedModule,
|
|
121059
121141
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
121060
121142
|
logChanges: logChangesWhenResolvingModule,
|
|
121061
121143
|
deferWatchingNonRelativeResolution: true
|
|
@@ -121074,17 +121156,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121074
121156
|
libraryName,
|
|
121075
121157
|
resolution,
|
|
121076
121158
|
path,
|
|
121077
|
-
|
|
121159
|
+
getResolvedModule,
|
|
121078
121160
|
/*deferWatchingNonRelativeResolution*/
|
|
121079
121161
|
false
|
|
121080
121162
|
);
|
|
121081
121163
|
resolvedLibraries.set(libFileName, resolution);
|
|
121082
121164
|
if (existingResolution) {
|
|
121083
|
-
stopWatchFailedLookupLocationOfResolution(existingResolution, path,
|
|
121165
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolvedModule);
|
|
121084
121166
|
}
|
|
121085
121167
|
} else {
|
|
121086
121168
|
if (isTraceEnabled(options, host)) {
|
|
121087
|
-
const resolved =
|
|
121169
|
+
const resolved = getResolvedModule(resolution);
|
|
121088
121170
|
trace(
|
|
121089
121171
|
host,
|
|
121090
121172
|
(resolved == null ? void 0 : resolved.resolvedFileName) ? resolved.packageId ? Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2_with_Package_ID_3 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_successfully_resolved_to_2 : Diagnostics.Reusing_resolution_of_module_0_from_1_of_old_program_it_was_not_resolved,
|
|
@@ -121107,7 +121189,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121107
121189
|
);
|
|
121108
121190
|
if (resolution && !resolution.isInvalidated)
|
|
121109
121191
|
return resolution;
|
|
121110
|
-
return
|
|
121192
|
+
return resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, resolutionHost.getCompilationSettings());
|
|
121111
121193
|
}
|
|
121112
121194
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
121113
121195
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -121207,52 +121289,63 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121207
121289
|
return;
|
|
121208
121290
|
}
|
|
121209
121291
|
let locationToWatch = affectingLocation;
|
|
121292
|
+
let isSymlink = false;
|
|
121293
|
+
let symlinkWatcher;
|
|
121210
121294
|
if (resolutionHost.realpath) {
|
|
121211
121295
|
locationToWatch = resolutionHost.realpath(affectingLocation);
|
|
121212
121296
|
if (affectingLocation !== locationToWatch) {
|
|
121213
|
-
|
|
121214
|
-
|
|
121215
|
-
|
|
121216
|
-
|
|
121217
|
-
|
|
121218
|
-
|
|
121219
|
-
|
|
121220
|
-
|
|
121221
|
-
|
|
121222
|
-
|
|
121223
|
-
|
|
121224
|
-
|
|
121225
|
-
|
|
121226
|
-
|
|
121227
|
-
|
|
121228
|
-
|
|
121229
|
-
|
|
121230
|
-
|
|
121231
|
-
|
|
121232
|
-
|
|
121233
|
-
|
|
121234
|
-
|
|
121235
|
-
|
|
121236
|
-
|
|
121237
|
-
|
|
121238
|
-
|
|
121239
|
-
|
|
121240
|
-
|
|
121241
|
-
|
|
121242
|
-
|
|
121243
|
-
|
|
121244
|
-
|
|
121245
|
-
|
|
121246
|
-
|
|
121247
|
-
|
|
121248
|
-
|
|
121249
|
-
|
|
121250
|
-
|
|
121251
|
-
if (affectingLocation !== locationToWatch) {
|
|
121297
|
+
isSymlink = true;
|
|
121298
|
+
symlinkWatcher = fileWatchesOfAffectingLocations.get(locationToWatch);
|
|
121299
|
+
}
|
|
121300
|
+
}
|
|
121301
|
+
const resolutions = forResolution ? 1 : 0;
|
|
121302
|
+
const files = forResolution ? 0 : 1;
|
|
121303
|
+
if (!isSymlink || !symlinkWatcher) {
|
|
121304
|
+
const watcher = {
|
|
121305
|
+
watcher: canWatchAffectingLocation(resolutionHost.toPath(locationToWatch)) ? resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
|
121306
|
+
cachedDirectoryStructureHost == null ? void 0 : cachedDirectoryStructureHost.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
|
121307
|
+
invalidateAffectingFileWatcher(locationToWatch, moduleResolutionCache.getPackageJsonInfoCache().getInternalMap());
|
|
121308
|
+
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
|
121309
|
+
}) : noopFileWatcher,
|
|
121310
|
+
resolutions: isSymlink ? 0 : resolutions,
|
|
121311
|
+
files: isSymlink ? 0 : files,
|
|
121312
|
+
symlinks: void 0
|
|
121313
|
+
};
|
|
121314
|
+
fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
|
|
121315
|
+
if (isSymlink)
|
|
121316
|
+
symlinkWatcher = watcher;
|
|
121317
|
+
}
|
|
121318
|
+
if (isSymlink) {
|
|
121319
|
+
Debug.assert(!!symlinkWatcher);
|
|
121320
|
+
const watcher = {
|
|
121321
|
+
watcher: {
|
|
121322
|
+
close: () => {
|
|
121323
|
+
var _a;
|
|
121324
|
+
const symlinkWatcher2 = fileWatchesOfAffectingLocations.get(locationToWatch);
|
|
121325
|
+
if (((_a = symlinkWatcher2 == null ? void 0 : symlinkWatcher2.symlinks) == null ? void 0 : _a.delete(affectingLocation)) && !symlinkWatcher2.symlinks.size && !symlinkWatcher2.resolutions && !symlinkWatcher2.files) {
|
|
121326
|
+
fileWatchesOfAffectingLocations.delete(locationToWatch);
|
|
121327
|
+
symlinkWatcher2.watcher.close();
|
|
121328
|
+
}
|
|
121329
|
+
}
|
|
121330
|
+
},
|
|
121331
|
+
resolutions,
|
|
121332
|
+
files,
|
|
121333
|
+
symlinks: void 0
|
|
121334
|
+
};
|
|
121252
121335
|
fileWatchesOfAffectingLocations.set(affectingLocation, watcher);
|
|
121253
|
-
|
|
121336
|
+
(symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation);
|
|
121254
121337
|
}
|
|
121255
121338
|
}
|
|
121339
|
+
function invalidateAffectingFileWatcher(path, packageJsonMap) {
|
|
121340
|
+
var _a;
|
|
121341
|
+
const watcher = fileWatchesOfAffectingLocations.get(path);
|
|
121342
|
+
if (watcher == null ? void 0 : watcher.resolutions)
|
|
121343
|
+
(affectingPathChecks ?? (affectingPathChecks = /* @__PURE__ */ new Set())).add(path);
|
|
121344
|
+
if (watcher == null ? void 0 : watcher.files)
|
|
121345
|
+
(affectingPathChecksForFile ?? (affectingPathChecksForFile = /* @__PURE__ */ new Set())).add(path);
|
|
121346
|
+
(_a = watcher == null ? void 0 : watcher.symlinks) == null ? void 0 : _a.forEach((path2) => invalidateAffectingFileWatcher(path2, packageJsonMap));
|
|
121347
|
+
packageJsonMap == null ? void 0 : packageJsonMap.delete(resolutionHost.toPath(path));
|
|
121348
|
+
}
|
|
121256
121349
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
121257
121350
|
const program = resolutionHost.getCurrentProgram();
|
|
121258
121351
|
if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
|
|
@@ -121274,7 +121367,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121274
121367
|
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive });
|
|
121275
121368
|
}
|
|
121276
121369
|
}
|
|
121277
|
-
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) {
|
|
121370
|
+
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) {
|
|
121278
121371
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
121279
121372
|
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121280
121373
|
failedLookupLocation,
|
|
@@ -121289,12 +121382,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121289
121382
|
if (dirPath === rootPath) {
|
|
121290
121383
|
removeAtRoot = true;
|
|
121291
121384
|
} else {
|
|
121292
|
-
removeDirectoryWatcher(dirPath);
|
|
121385
|
+
removeDirectoryWatcher(dirPath, syncDirWatcherRemove);
|
|
121293
121386
|
}
|
|
121294
121387
|
}
|
|
121295
121388
|
return removeAtRoot;
|
|
121296
121389
|
}
|
|
121297
|
-
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
|
|
121390
|
+
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
121298
121391
|
Debug.checkDefined(resolution.files).delete(filePath);
|
|
121299
121392
|
resolution.refCount--;
|
|
121300
121393
|
if (resolution.refCount) {
|
|
@@ -121312,13 +121405,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121312
121405
|
let removeAtRoot = false;
|
|
121313
121406
|
if (failedLookupLocations) {
|
|
121314
121407
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
121315
|
-
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot);
|
|
121408
|
+
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
|
|
121316
121409
|
}
|
|
121317
121410
|
}
|
|
121318
121411
|
if (node10Result)
|
|
121319
|
-
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot);
|
|
121412
|
+
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
|
|
121320
121413
|
if (removeAtRoot)
|
|
121321
|
-
removeDirectoryWatcher(rootPath);
|
|
121414
|
+
removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
|
|
121322
121415
|
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
121323
121416
|
resolutionsWithOnlyAffectingLocations.delete(resolution);
|
|
121324
121417
|
}
|
|
@@ -121326,12 +121419,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121326
121419
|
for (const affectingLocation of affectingLocations) {
|
|
121327
121420
|
const watcher = fileWatchesOfAffectingLocations.get(affectingLocation);
|
|
121328
121421
|
watcher.resolutions--;
|
|
121422
|
+
if (syncDirWatcherRemove)
|
|
121423
|
+
closeFileWatcherOfAffectingLocation(watcher, affectingLocation);
|
|
121329
121424
|
}
|
|
121330
121425
|
}
|
|
121331
121426
|
}
|
|
121332
|
-
function removeDirectoryWatcher(dirPath) {
|
|
121427
|
+
function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) {
|
|
121333
121428
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
121334
121429
|
dirWatcher.refCount--;
|
|
121430
|
+
if (syncDirWatcherRemove)
|
|
121431
|
+
closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath);
|
|
121335
121432
|
}
|
|
121336
121433
|
function createDirectoryWatcher(directory, dirPath, nonRecursive) {
|
|
121337
121434
|
return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => {
|
|
@@ -121342,10 +121439,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121342
121439
|
scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
|
|
121343
121440
|
}, nonRecursive ? 0 /* None */ : 1 /* Recursive */);
|
|
121344
121441
|
}
|
|
121345
|
-
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) {
|
|
121442
|
+
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
121346
121443
|
const resolutions = cache.get(filePath);
|
|
121347
121444
|
if (resolutions) {
|
|
121348
|
-
resolutions.forEach(
|
|
121445
|
+
resolutions.forEach(
|
|
121446
|
+
(resolution) => stopWatchFailedLookupLocationOfResolution(
|
|
121447
|
+
resolution,
|
|
121448
|
+
filePath,
|
|
121449
|
+
getResolutionWithResolvedFileName,
|
|
121450
|
+
syncDirWatcherRemove
|
|
121451
|
+
)
|
|
121452
|
+
);
|
|
121349
121453
|
cache.delete(filePath);
|
|
121350
121454
|
}
|
|
121351
121455
|
}
|
|
@@ -121360,9 +121464,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121360
121464
|
return;
|
|
121361
121465
|
resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
|
|
121362
121466
|
}
|
|
121363
|
-
function removeResolutionsOfFile(filePath) {
|
|
121364
|
-
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath,
|
|
121365
|
-
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
|
|
121467
|
+
function removeResolutionsOfFile(filePath, syncDirWatcherRemove) {
|
|
121468
|
+
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove);
|
|
121469
|
+
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove);
|
|
121366
121470
|
}
|
|
121367
121471
|
function invalidateResolutions(resolutions, canInvalidate) {
|
|
121368
121472
|
if (!resolutions)
|
|
@@ -121788,7 +121892,7 @@ function fileIncludeReasonToDiagnostics(program, reason, fileNameConvertor) {
|
|
|
121788
121892
|
var _a, _b;
|
|
121789
121893
|
const options = program.getCompilerOptions();
|
|
121790
121894
|
if (isReferencedFile(reason)) {
|
|
121791
|
-
const referenceLocation = getReferencedFileLocation(
|
|
121895
|
+
const referenceLocation = getReferencedFileLocation(program, reason);
|
|
121792
121896
|
const referenceText = isReferenceFileLocation(referenceLocation) ? referenceLocation.file.text.substring(referenceLocation.pos, referenceLocation.end) : `"${referenceLocation.text}"`;
|
|
121793
121897
|
let message;
|
|
121794
121898
|
Debug.assert(isReferenceFileLocation(referenceLocation) || reason.kind === 3 /* Import */, "Only synthetic references are imports");
|
|
@@ -122016,8 +122120,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
122016
122120
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
122017
122121
|
getCompilerOptions,
|
|
122018
122122
|
/*setParentNodes*/
|
|
122019
|
-
void 0
|
|
122020
|
-
host.skipNonSemanticJSDocParsing
|
|
122123
|
+
void 0
|
|
122021
122124
|
),
|
|
122022
122125
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
122023
122126
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -122039,7 +122142,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
122039
122142
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
122040
122143
|
createHash: maybeBind(host, host.createHash),
|
|
122041
122144
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
122042
|
-
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
122145
|
+
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
122146
|
+
jsDocParsingMode: host.jsDocParsingMode
|
|
122043
122147
|
};
|
|
122044
122148
|
return compilerHost;
|
|
122045
122149
|
}
|
|
@@ -122203,12 +122307,11 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
122203
122307
|
return void 0;
|
|
122204
122308
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
122205
122309
|
}
|
|
122206
|
-
function createIncrementalCompilerHost(options, system = sys
|
|
122310
|
+
function createIncrementalCompilerHost(options, system = sys) {
|
|
122207
122311
|
const host = createCompilerHostWorker(
|
|
122208
122312
|
options,
|
|
122209
122313
|
/*setParentNodes*/
|
|
122210
122314
|
void 0,
|
|
122211
|
-
skipNonSemanticJSDocParsing2,
|
|
122212
122315
|
system
|
|
122213
122316
|
);
|
|
122214
122317
|
host.createHash = maybeBind(system, system.createHash);
|
|
@@ -122325,7 +122428,7 @@ function createWatchProgram(host) {
|
|
|
122325
122428
|
watchConfigFileWildCardDirectories();
|
|
122326
122429
|
if (configFileName)
|
|
122327
122430
|
updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
|
|
122328
|
-
return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close };
|
|
122431
|
+
return configFileName ? { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, close, getResolutionCache } : { getCurrentProgram: getCurrentBuilderProgram, getProgram: updateProgram, updateRootFileNames, close, getResolutionCache };
|
|
122329
122432
|
function close() {
|
|
122330
122433
|
clearInvalidateResolutionsOfFailedLookupLocations();
|
|
122331
122434
|
resolutionCache.clear();
|
|
@@ -122365,6 +122468,9 @@ function createWatchProgram(host) {
|
|
|
122365
122468
|
parsedConfigs = void 0;
|
|
122366
122469
|
}
|
|
122367
122470
|
}
|
|
122471
|
+
function getResolutionCache() {
|
|
122472
|
+
return resolutionCache;
|
|
122473
|
+
}
|
|
122368
122474
|
function getCurrentBuilderProgram() {
|
|
122369
122475
|
return builderProgram;
|
|
122370
122476
|
}
|
|
@@ -125538,7 +125644,7 @@ function reportWatchModeWithoutSysSupport(sys2, reportDiagnostic) {
|
|
|
125538
125644
|
}
|
|
125539
125645
|
return false;
|
|
125540
125646
|
}
|
|
125541
|
-
var
|
|
125647
|
+
var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */;
|
|
125542
125648
|
function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
125543
125649
|
const reportDiagnostic = updateReportDiagnostic(
|
|
125544
125650
|
sys2,
|
|
@@ -125577,7 +125683,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
|
125577
125683
|
createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
|
|
125578
125684
|
createWatchStatusReporter2(sys2, buildOptions)
|
|
125579
125685
|
);
|
|
125580
|
-
buildHost2.
|
|
125686
|
+
buildHost2.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125581
125687
|
const solutionPerformance2 = enableSolutionPerformance(sys2, buildOptions);
|
|
125582
125688
|
updateSolutionBuilderHost(sys2, cb, buildHost2, solutionPerformance2);
|
|
125583
125689
|
const onWatchStatusChange = buildHost2.onWatchStatusChange;
|
|
@@ -125602,7 +125708,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
|
125602
125708
|
createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
|
|
125603
125709
|
createReportErrorSummary(sys2, buildOptions)
|
|
125604
125710
|
);
|
|
125605
|
-
buildHost.
|
|
125711
|
+
buildHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125606
125712
|
const solutionPerformance = enableSolutionPerformance(sys2, buildOptions);
|
|
125607
125713
|
updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance);
|
|
125608
125714
|
const builder = createSolutionBuilder(buildHost, projects, buildOptions);
|
|
@@ -125620,9 +125726,9 @@ function performCompilation(sys2, cb, reportDiagnostic, config) {
|
|
|
125620
125726
|
options,
|
|
125621
125727
|
/*setParentNodes*/
|
|
125622
125728
|
void 0,
|
|
125623
|
-
skipNonSemanticJSDocParsing,
|
|
125624
125729
|
sys2
|
|
125625
125730
|
);
|
|
125731
|
+
host.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125626
125732
|
const currentDirectory = host.getCurrentDirectory();
|
|
125627
125733
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
125628
125734
|
changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, currentDirectory, getCanonicalFileName));
|
|
@@ -125663,7 +125769,8 @@ function performIncrementalCompilation2(sys2, cb, reportDiagnostic, config) {
|
|
|
125663
125769
|
/*isBuildMode*/
|
|
125664
125770
|
false
|
|
125665
125771
|
);
|
|
125666
|
-
const host = createIncrementalCompilerHost(options, sys2
|
|
125772
|
+
const host = createIncrementalCompilerHost(options, sys2);
|
|
125773
|
+
host.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125667
125774
|
const exitStatus = performIncrementalCompilation({
|
|
125668
125775
|
host,
|
|
125669
125776
|
system: sys2,
|
|
@@ -125718,7 +125825,7 @@ function updateCreateProgram(sys2, host, isBuildMode) {
|
|
|
125718
125825
|
};
|
|
125719
125826
|
}
|
|
125720
125827
|
function updateWatchCompilationHost(sys2, cb, watchCompilerHost) {
|
|
125721
|
-
watchCompilerHost.
|
|
125828
|
+
watchCompilerHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125722
125829
|
updateCreateProgram(
|
|
125723
125830
|
sys2,
|
|
125724
125831
|
watchCompilerHost,
|