@typescript-deploys/pr-build 5.3.0-pr-55820-7 → 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.es5.d.ts +9 -1
- package/lib/tsc.js +582 -487
- package/lib/tsserver.js +715 -561
- package/lib/typescript.d.ts +96 -32
- package/lib/typescript.js +709 -561
- package/lib/typingsInstaller.js +187 -125
- 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}'."),
|
|
@@ -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) {
|
|
@@ -11438,8 +11468,8 @@ function moduleResolutionIsEqualTo(oldResolution, newResolution) {
|
|
|
11438
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;
|
|
11439
11469
|
}
|
|
11440
11470
|
function createModuleNotFoundChain(sourceFile, host, moduleReference, mode, packageName) {
|
|
11441
|
-
var _a
|
|
11442
|
-
const node10Result = (
|
|
11471
|
+
var _a;
|
|
11472
|
+
const node10Result = (_a = host.getResolvedModule(sourceFile, moduleReference, mode)) == null ? void 0 : _a.node10Result;
|
|
11443
11473
|
const result = node10Result ? chainDiagnosticMessages(
|
|
11444
11474
|
/*details*/
|
|
11445
11475
|
void 0,
|
|
@@ -11481,14 +11511,14 @@ function packageIdToString(packageId) {
|
|
|
11481
11511
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
11482
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;
|
|
11483
11513
|
}
|
|
11484
|
-
function hasChangesInResolutions(names, newSourceFile, newResolutions,
|
|
11514
|
+
function hasChangesInResolutions(names, newSourceFile, newResolutions, getOldResolution, comparer, nameAndModeGetter) {
|
|
11485
11515
|
Debug.assert(names.length === newResolutions.length);
|
|
11486
11516
|
for (let i = 0; i < names.length; i++) {
|
|
11487
11517
|
const newResolution = newResolutions[i];
|
|
11488
11518
|
const entry = names[i];
|
|
11489
11519
|
const name = nameAndModeGetter.getName(entry);
|
|
11490
11520
|
const mode = nameAndModeGetter.getMode(entry, newSourceFile);
|
|
11491
|
-
const oldResolution =
|
|
11521
|
+
const oldResolution = getOldResolution(name, mode);
|
|
11492
11522
|
const changed = oldResolution ? !newResolution || !comparer(oldResolution, newResolution) : newResolution;
|
|
11493
11523
|
if (changed) {
|
|
11494
11524
|
return true;
|
|
@@ -14715,9 +14745,6 @@ function getIndentString(level) {
|
|
|
14715
14745
|
function getIndentSize() {
|
|
14716
14746
|
return indentStrings[1].length;
|
|
14717
14747
|
}
|
|
14718
|
-
function isNightly() {
|
|
14719
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
14720
|
-
}
|
|
14721
14748
|
function createTextWriter(newLine) {
|
|
14722
14749
|
var output;
|
|
14723
14750
|
var indent2;
|
|
@@ -16454,11 +16481,11 @@ function createSymlinkCache(cwd, getCanonicalFileName) {
|
|
|
16454
16481
|
(symlinkedDirectories || (symlinkedDirectories = /* @__PURE__ */ new Map())).set(symlinkPath, real);
|
|
16455
16482
|
}
|
|
16456
16483
|
},
|
|
16457
|
-
setSymlinksFromResolutions(
|
|
16484
|
+
setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, typeReferenceDirectives) {
|
|
16458
16485
|
Debug.assert(!hasProcessedResolutions);
|
|
16459
16486
|
hasProcessedResolutions = true;
|
|
16460
|
-
|
|
16461
|
-
|
|
16487
|
+
forEachResolvedModule((resolution) => processResolution(this, resolution.resolvedModule));
|
|
16488
|
+
forEachResolvedTypeReferenceDirective((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16462
16489
|
typeReferenceDirectives.forEach((resolution) => processResolution(this, resolution.resolvedTypeReferenceDirective));
|
|
16463
16490
|
},
|
|
16464
16491
|
hasProcessedResolutions: () => hasProcessedResolutions
|
|
@@ -17434,6 +17461,13 @@ function getPropertyNameFromType(type) {
|
|
|
17434
17461
|
function isExpandoPropertyDeclaration(declaration) {
|
|
17435
17462
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
17436
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
|
+
}
|
|
17437
17471
|
|
|
17438
17472
|
// src/compiler/factory/baseNodeFactory.ts
|
|
17439
17473
|
function createBaseNodeFactory() {
|
|
@@ -18305,6 +18339,12 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18305
18339
|
updateAssertEntry,
|
|
18306
18340
|
createImportTypeAssertionContainer,
|
|
18307
18341
|
updateImportTypeAssertionContainer,
|
|
18342
|
+
createImportTypeAttributes,
|
|
18343
|
+
updateImportTypeAttributes,
|
|
18344
|
+
createImportAttributes,
|
|
18345
|
+
updateImportAttributes,
|
|
18346
|
+
createImportAttribute,
|
|
18347
|
+
updateImportAttribute,
|
|
18308
18348
|
createNamespaceImport,
|
|
18309
18349
|
updateNamespaceImport,
|
|
18310
18350
|
createNamespaceExport,
|
|
@@ -19573,18 +19613,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19573
19613
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
19574
19614
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
19575
19615
|
}
|
|
19576
|
-
function createImportTypeNode(argument,
|
|
19616
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
19577
19617
|
const node = createBaseNode(205 /* ImportType */);
|
|
19578
19618
|
node.argument = argument;
|
|
19579
|
-
node.assertions =
|
|
19619
|
+
node.attributes = node.assertions = attributes;
|
|
19580
19620
|
node.qualifier = qualifier;
|
|
19581
19621
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
19582
19622
|
node.isTypeOf = isTypeOf;
|
|
19583
19623
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
19584
19624
|
return node;
|
|
19585
19625
|
}
|
|
19586
|
-
function updateImportTypeNode(node, argument,
|
|
19587
|
-
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;
|
|
19588
19628
|
}
|
|
19589
19629
|
function createParenthesizedType(type) {
|
|
19590
19630
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -20714,19 +20754,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20714
20754
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
20715
20755
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
20716
20756
|
}
|
|
20717
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
20757
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
20718
20758
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
20719
20759
|
node.modifiers = asNodeArray(modifiers);
|
|
20720
20760
|
node.importClause = importClause;
|
|
20721
20761
|
node.moduleSpecifier = moduleSpecifier;
|
|
20722
|
-
node.assertClause =
|
|
20762
|
+
node.attributes = node.assertClause = attributes;
|
|
20723
20763
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
20724
20764
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
20725
20765
|
node.jsDoc = void 0;
|
|
20726
20766
|
return node;
|
|
20727
20767
|
}
|
|
20728
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
20729
|
-
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;
|
|
20730
20770
|
}
|
|
20731
20771
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
20732
20772
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -20747,6 +20787,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20747
20787
|
const node = createBaseNode(300 /* AssertClause */);
|
|
20748
20788
|
node.elements = createNodeArray(elements);
|
|
20749
20789
|
node.multiLine = multiLine;
|
|
20790
|
+
node.token = 132 /* AssertKeyword */;
|
|
20750
20791
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
20751
20792
|
return node;
|
|
20752
20793
|
}
|
|
@@ -20772,6 +20813,36 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20772
20813
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
20773
20814
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
20774
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
|
+
}
|
|
20775
20846
|
function createNamespaceImport(name) {
|
|
20776
20847
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
20777
20848
|
node.name = name;
|
|
@@ -20832,20 +20903,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20832
20903
|
function updateExportAssignment(node, modifiers, expression) {
|
|
20833
20904
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node;
|
|
20834
20905
|
}
|
|
20835
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
20906
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
20836
20907
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
20837
20908
|
node.modifiers = asNodeArray(modifiers);
|
|
20838
20909
|
node.isTypeOnly = isTypeOnly;
|
|
20839
20910
|
node.exportClause = exportClause;
|
|
20840
20911
|
node.moduleSpecifier = moduleSpecifier;
|
|
20841
|
-
node.assertClause =
|
|
20912
|
+
node.attributes = node.assertClause = attributes;
|
|
20842
20913
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
20843
20914
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
20844
20915
|
node.jsDoc = void 0;
|
|
20845
20916
|
return node;
|
|
20846
20917
|
}
|
|
20847
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
20848
|
-
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;
|
|
20849
20920
|
}
|
|
20850
20921
|
function finishUpdateExportDeclaration(updated, original) {
|
|
20851
20922
|
if (updated !== original) {
|
|
@@ -22172,7 +22243,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22172
22243
|
} else {
|
|
22173
22244
|
modifierArray = modifiers;
|
|
22174
22245
|
}
|
|
22175
|
-
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);
|
|
22176
22247
|
}
|
|
22177
22248
|
function updateModifierLike(node, modifierArray) {
|
|
22178
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);
|
|
@@ -24396,14 +24467,14 @@ function isImportDeclaration(node) {
|
|
|
24396
24467
|
function isImportClause(node) {
|
|
24397
24468
|
return node.kind === 273 /* ImportClause */;
|
|
24398
24469
|
}
|
|
24399
|
-
function
|
|
24400
|
-
return node.kind === 302 /*
|
|
24470
|
+
function isImportTypeAttributes(node) {
|
|
24471
|
+
return node.kind === 302 /* ImportTypeAttributes */;
|
|
24401
24472
|
}
|
|
24402
|
-
function
|
|
24403
|
-
return node.kind === 300 /*
|
|
24473
|
+
function isImportAttributes(node) {
|
|
24474
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
24404
24475
|
}
|
|
24405
|
-
function
|
|
24406
|
-
return node.kind === 301 /*
|
|
24476
|
+
function isImportAttribute(node) {
|
|
24477
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
24407
24478
|
}
|
|
24408
24479
|
function isNamespaceImport(node) {
|
|
24409
24480
|
return node.kind === 274 /* NamespaceImport */;
|
|
@@ -25079,7 +25150,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
25079
25150
|
namedBindings
|
|
25080
25151
|
),
|
|
25081
25152
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
25082
|
-
/*
|
|
25153
|
+
/*attributes*/
|
|
25083
25154
|
void 0
|
|
25084
25155
|
);
|
|
25085
25156
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -25833,10 +25904,10 @@ var forEachChildTable = {
|
|
|
25833
25904
|
return visitNode2(cbNode, node.typeParameter);
|
|
25834
25905
|
},
|
|
25835
25906
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
25836
|
-
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);
|
|
25837
25908
|
},
|
|
25838
|
-
[302 /*
|
|
25839
|
-
return visitNode2(cbNode, node.
|
|
25909
|
+
[302 /* ImportTypeAttributes */]: function forEachChildInImportTypeAttributes(node, cbNode, _cbNodes) {
|
|
25910
|
+
return visitNode2(cbNode, node.attributes);
|
|
25840
25911
|
},
|
|
25841
25912
|
[196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
|
|
25842
25913
|
[198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
|
|
@@ -26007,15 +26078,15 @@ var forEachChildTable = {
|
|
|
26007
26078
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
26008
26079
|
},
|
|
26009
26080
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
26010
|
-
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);
|
|
26011
26082
|
},
|
|
26012
26083
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
26013
26084
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
26014
26085
|
},
|
|
26015
|
-
[300 /*
|
|
26086
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
26016
26087
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
26017
26088
|
},
|
|
26018
|
-
[301 /*
|
|
26089
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
26019
26090
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
26020
26091
|
},
|
|
26021
26092
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -26030,7 +26101,7 @@ var forEachChildTable = {
|
|
|
26030
26101
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
26031
26102
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
26032
26103
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
26033
|
-
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);
|
|
26034
26105
|
},
|
|
26035
26106
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
26036
26107
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -26269,7 +26340,7 @@ function gatherPossibleChildren(node) {
|
|
|
26269
26340
|
function setExternalModuleIndicator(sourceFile) {
|
|
26270
26341
|
sourceFile.externalModuleIndicator = isFileProbablyExternalModule(sourceFile);
|
|
26271
26342
|
}
|
|
26272
|
-
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind
|
|
26343
|
+
function createSourceFile(fileName, sourceText, languageVersionOrOptions, setParentNodes = false, scriptKind) {
|
|
26273
26344
|
var _a, _b, _c, _d;
|
|
26274
26345
|
(_a = tracing) == null ? void 0 : _a.push(
|
|
26275
26346
|
tracing.Phase.Parse,
|
|
@@ -26284,7 +26355,8 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26284
26355
|
const {
|
|
26285
26356
|
languageVersion,
|
|
26286
26357
|
setExternalModuleIndicator: overrideSetExternalModuleIndicator,
|
|
26287
|
-
impliedNodeFormat: format
|
|
26358
|
+
impliedNodeFormat: format,
|
|
26359
|
+
jsDocParsingMode
|
|
26288
26360
|
} = typeof languageVersionOrOptions === "object" ? languageVersionOrOptions : { languageVersion: languageVersionOrOptions };
|
|
26289
26361
|
if (languageVersion === 100 /* JSON */) {
|
|
26290
26362
|
result = Parser.parseSourceFile(
|
|
@@ -26296,7 +26368,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26296
26368
|
setParentNodes,
|
|
26297
26369
|
6 /* JSON */,
|
|
26298
26370
|
noop,
|
|
26299
|
-
|
|
26371
|
+
jsDocParsingMode
|
|
26300
26372
|
);
|
|
26301
26373
|
} else {
|
|
26302
26374
|
const setIndicator = format === void 0 ? overrideSetExternalModuleIndicator : (file) => {
|
|
@@ -26312,7 +26384,7 @@ function createSourceFile(fileName, sourceText, languageVersionOrOptions, setPar
|
|
|
26312
26384
|
setParentNodes,
|
|
26313
26385
|
scriptKind,
|
|
26314
26386
|
setIndicator,
|
|
26315
|
-
|
|
26387
|
+
jsDocParsingMode
|
|
26316
26388
|
);
|
|
26317
26389
|
}
|
|
26318
26390
|
(_c = perfLogger) == null ? void 0 : _c.logStopParseSourceFile();
|
|
@@ -26431,7 +26503,7 @@ var Parser;
|
|
|
26431
26503
|
var contextFlags;
|
|
26432
26504
|
var topLevel = true;
|
|
26433
26505
|
var parseErrorBeforeNextFinishedNode = false;
|
|
26434
|
-
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride,
|
|
26506
|
+
function parseSourceFile(fileName2, sourceText2, languageVersion2, syntaxCursor2, setParentNodes = false, scriptKind2, setExternalModuleIndicatorOverride, jsDocParsingMode = 0 /* ParseAll */) {
|
|
26435
26507
|
var _a;
|
|
26436
26508
|
scriptKind2 = ensureScriptKind(fileName2, scriptKind2);
|
|
26437
26509
|
if (scriptKind2 === 6 /* JSON */) {
|
|
@@ -26453,9 +26525,8 @@ var Parser;
|
|
|
26453
26525
|
result2.pragmas = emptyMap;
|
|
26454
26526
|
return result2;
|
|
26455
26527
|
}
|
|
26456
|
-
|
|
26457
|
-
|
|
26458
|
-
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);
|
|
26459
26530
|
clearState();
|
|
26460
26531
|
return result;
|
|
26461
26532
|
}
|
|
@@ -26468,8 +26539,7 @@ var Parser;
|
|
|
26468
26539
|
/*syntaxCursor*/
|
|
26469
26540
|
void 0,
|
|
26470
26541
|
1 /* JS */,
|
|
26471
|
-
/*
|
|
26472
|
-
false
|
|
26542
|
+
0 /* ParseAll */
|
|
26473
26543
|
);
|
|
26474
26544
|
nextToken();
|
|
26475
26545
|
const entityName = parseEntityName(
|
|
@@ -26482,15 +26552,7 @@ var Parser;
|
|
|
26482
26552
|
}
|
|
26483
26553
|
Parser2.parseIsolatedEntityName = parseIsolatedEntityName2;
|
|
26484
26554
|
function parseJsonText2(fileName2, sourceText2, languageVersion2 = 2 /* ES2015 */, syntaxCursor2, setParentNodes = false) {
|
|
26485
|
-
initializeState(
|
|
26486
|
-
fileName2,
|
|
26487
|
-
sourceText2,
|
|
26488
|
-
languageVersion2,
|
|
26489
|
-
syntaxCursor2,
|
|
26490
|
-
6 /* JSON */,
|
|
26491
|
-
/*skipNonSemanticJSDoc*/
|
|
26492
|
-
false
|
|
26493
|
-
);
|
|
26555
|
+
initializeState(fileName2, sourceText2, languageVersion2, syntaxCursor2, 6 /* JSON */, 0 /* ParseAll */);
|
|
26494
26556
|
sourceFlags = contextFlags;
|
|
26495
26557
|
nextToken();
|
|
26496
26558
|
const pos = getNodePos();
|
|
@@ -26571,7 +26633,7 @@ var Parser;
|
|
|
26571
26633
|
return result;
|
|
26572
26634
|
}
|
|
26573
26635
|
Parser2.parseJsonText = parseJsonText2;
|
|
26574
|
-
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind,
|
|
26636
|
+
function initializeState(_fileName, _sourceText, _languageVersion, _syntaxCursor, _scriptKind, _jsDocParsingMode) {
|
|
26575
26637
|
NodeConstructor2 = objectAllocator.getNodeConstructor();
|
|
26576
26638
|
TokenConstructor2 = objectAllocator.getTokenConstructor();
|
|
26577
26639
|
IdentifierConstructor2 = objectAllocator.getIdentifierConstructor();
|
|
@@ -26607,13 +26669,15 @@ var Parser;
|
|
|
26607
26669
|
scanner.setOnError(scanError);
|
|
26608
26670
|
scanner.setScriptTarget(languageVersion);
|
|
26609
26671
|
scanner.setLanguageVariant(languageVariant);
|
|
26610
|
-
scanner.
|
|
26672
|
+
scanner.setScriptKind(scriptKind);
|
|
26673
|
+
scanner.setJSDocParsingMode(_jsDocParsingMode);
|
|
26611
26674
|
}
|
|
26612
26675
|
function clearState() {
|
|
26613
26676
|
scanner.clearCommentDirectives();
|
|
26614
26677
|
scanner.setText("");
|
|
26615
26678
|
scanner.setOnError(void 0);
|
|
26616
|
-
scanner.
|
|
26679
|
+
scanner.setScriptKind(0 /* Unknown */);
|
|
26680
|
+
scanner.setJSDocParsingMode(0 /* ParseAll */);
|
|
26617
26681
|
sourceText = void 0;
|
|
26618
26682
|
languageVersion = void 0;
|
|
26619
26683
|
syntaxCursor = void 0;
|
|
@@ -26627,7 +26691,7 @@ var Parser;
|
|
|
26627
26691
|
notParenthesizedArrow = void 0;
|
|
26628
26692
|
topLevel = true;
|
|
26629
26693
|
}
|
|
26630
|
-
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2,
|
|
26694
|
+
function parseSourceFileWorker(languageVersion2, setParentNodes, scriptKind2, setExternalModuleIndicator2, jsDocParsingMode) {
|
|
26631
26695
|
const isDeclarationFile = isDeclarationFileName(fileName);
|
|
26632
26696
|
if (isDeclarationFile) {
|
|
26633
26697
|
contextFlags |= 33554432 /* Ambient */;
|
|
@@ -26646,7 +26710,7 @@ var Parser;
|
|
|
26646
26710
|
sourceFile.identifierCount = identifierCount;
|
|
26647
26711
|
sourceFile.identifiers = identifiers;
|
|
26648
26712
|
sourceFile.parseDiagnostics = attachFileToDiagnostics(parseDiagnostics, sourceFile);
|
|
26649
|
-
sourceFile.
|
|
26713
|
+
sourceFile.jsDocParsingMode = jsDocParsingMode;
|
|
26650
26714
|
if (jsDocDiagnostics) {
|
|
26651
26715
|
sourceFile.jsDocDiagnostics = attachFileToDiagnostics(jsDocDiagnostics, sourceFile);
|
|
26652
26716
|
}
|
|
@@ -27302,7 +27366,7 @@ var Parser;
|
|
|
27302
27366
|
function isLiteralPropertyName() {
|
|
27303
27367
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
27304
27368
|
}
|
|
27305
|
-
function
|
|
27369
|
+
function isImportAttributeName2() {
|
|
27306
27370
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
27307
27371
|
}
|
|
27308
27372
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -27421,8 +27485,8 @@ var Parser;
|
|
|
27421
27485
|
return isLiteralPropertyName();
|
|
27422
27486
|
case 9 /* ObjectBindingElements */:
|
|
27423
27487
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
27424
|
-
case 24 /*
|
|
27425
|
-
return
|
|
27488
|
+
case 24 /* ImportAttributes */:
|
|
27489
|
+
return isImportAttributeName2();
|
|
27426
27490
|
case 7 /* HeritageClauseElement */:
|
|
27427
27491
|
if (token() === 19 /* OpenBraceToken */) {
|
|
27428
27492
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -27525,7 +27589,7 @@ var Parser;
|
|
|
27525
27589
|
case 12 /* ObjectLiteralMembers */:
|
|
27526
27590
|
case 9 /* ObjectBindingElements */:
|
|
27527
27591
|
case 23 /* ImportOrExportSpecifiers */:
|
|
27528
|
-
case 24 /*
|
|
27592
|
+
case 24 /* ImportAttributes */:
|
|
27529
27593
|
return token() === 20 /* CloseBraceToken */;
|
|
27530
27594
|
case 3 /* SwitchClauseStatements */:
|
|
27531
27595
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -27831,7 +27895,7 @@ var Parser;
|
|
|
27831
27895
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27832
27896
|
case 14 /* JsxChildren */:
|
|
27833
27897
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27834
|
-
case 24 /*
|
|
27898
|
+
case 24 /* ImportAttributes */:
|
|
27835
27899
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
27836
27900
|
case 25 /* JSDocComment */:
|
|
27837
27901
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -28706,16 +28770,22 @@ var Parser;
|
|
|
28706
28770
|
nextToken();
|
|
28707
28771
|
return token() === 102 /* ImportKeyword */;
|
|
28708
28772
|
}
|
|
28709
|
-
function
|
|
28773
|
+
function parseImportTypeAttributes() {
|
|
28710
28774
|
const pos = getNodePos();
|
|
28711
28775
|
const openBracePosition = scanner.getTokenStart();
|
|
28712
28776
|
parseExpected(19 /* OpenBraceToken */);
|
|
28713
28777
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
28714
|
-
|
|
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
|
+
}
|
|
28715
28784
|
parseExpected(59 /* ColonToken */);
|
|
28716
|
-
const
|
|
28717
|
-
|
|
28718
|
-
|
|
28785
|
+
const attributes = parseImportAttributes(
|
|
28786
|
+
currentToken2,
|
|
28787
|
+
/*shouldAdvance*/
|
|
28788
|
+
false
|
|
28719
28789
|
);
|
|
28720
28790
|
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
28721
28791
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
@@ -28726,7 +28796,7 @@ var Parser;
|
|
|
28726
28796
|
);
|
|
28727
28797
|
}
|
|
28728
28798
|
}
|
|
28729
|
-
return finishNode(factory2.
|
|
28799
|
+
return finishNode(factory2.createImportTypeAttributes(attributes, multiLine), pos);
|
|
28730
28800
|
}
|
|
28731
28801
|
function parseImportType() {
|
|
28732
28802
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
@@ -28735,14 +28805,14 @@ var Parser;
|
|
|
28735
28805
|
parseExpected(102 /* ImportKeyword */);
|
|
28736
28806
|
parseExpected(21 /* OpenParenToken */);
|
|
28737
28807
|
const type = parseType();
|
|
28738
|
-
let
|
|
28808
|
+
let attributes;
|
|
28739
28809
|
if (parseOptional(28 /* CommaToken */)) {
|
|
28740
|
-
|
|
28810
|
+
attributes = parseImportTypeAttributes();
|
|
28741
28811
|
}
|
|
28742
28812
|
parseExpected(22 /* CloseParenToken */);
|
|
28743
28813
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
28744
28814
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
28745
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
28815
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
28746
28816
|
}
|
|
28747
28817
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
28748
28818
|
nextToken();
|
|
@@ -31804,15 +31874,16 @@ var Parser;
|
|
|
31804
31874
|
parseExpected(161 /* FromKeyword */);
|
|
31805
31875
|
}
|
|
31806
31876
|
const moduleSpecifier = parseModuleSpecifier();
|
|
31807
|
-
|
|
31808
|
-
|
|
31809
|
-
|
|
31877
|
+
const currentToken2 = token();
|
|
31878
|
+
let attributes;
|
|
31879
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
|
|
31880
|
+
attributes = parseImportAttributes(currentToken2);
|
|
31810
31881
|
}
|
|
31811
31882
|
parseSemicolon();
|
|
31812
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
31883
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
31813
31884
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31814
31885
|
}
|
|
31815
|
-
function
|
|
31886
|
+
function parseImportAttribute() {
|
|
31816
31887
|
const pos = getNodePos();
|
|
31817
31888
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
31818
31889
|
parseExpected(59 /* ColonToken */);
|
|
@@ -31820,19 +31891,19 @@ var Parser;
|
|
|
31820
31891
|
/*allowReturnTypeInArrowFunction*/
|
|
31821
31892
|
true
|
|
31822
31893
|
);
|
|
31823
|
-
return finishNode(factory2.
|
|
31894
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
31824
31895
|
}
|
|
31825
|
-
function
|
|
31896
|
+
function parseImportAttributes(token2, shouldAdvance = true) {
|
|
31826
31897
|
const pos = getNodePos();
|
|
31827
|
-
if (
|
|
31828
|
-
|
|
31898
|
+
if (shouldAdvance) {
|
|
31899
|
+
nextToken();
|
|
31829
31900
|
}
|
|
31830
31901
|
const openBracePosition = scanner.getTokenStart();
|
|
31831
31902
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
31832
31903
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
31833
31904
|
const elements = parseDelimitedList(
|
|
31834
|
-
24 /*
|
|
31835
|
-
|
|
31905
|
+
24 /* ImportAttributes */,
|
|
31906
|
+
parseImportAttribute,
|
|
31836
31907
|
/*considerSemicolonAsDelimiter*/
|
|
31837
31908
|
true
|
|
31838
31909
|
);
|
|
@@ -31845,7 +31916,7 @@ var Parser;
|
|
|
31845
31916
|
);
|
|
31846
31917
|
}
|
|
31847
31918
|
}
|
|
31848
|
-
return finishNode(factory2.
|
|
31919
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
31849
31920
|
} else {
|
|
31850
31921
|
const elements = createNodeArray(
|
|
31851
31922
|
[],
|
|
@@ -31855,10 +31926,11 @@ var Parser;
|
|
|
31855
31926
|
/*hasTrailingComma*/
|
|
31856
31927
|
false
|
|
31857
31928
|
);
|
|
31858
|
-
return finishNode(factory2.
|
|
31929
|
+
return finishNode(factory2.createImportAttributes(
|
|
31859
31930
|
elements,
|
|
31860
31931
|
/*multiLine*/
|
|
31861
|
-
false
|
|
31932
|
+
false,
|
|
31933
|
+
token2
|
|
31862
31934
|
), pos);
|
|
31863
31935
|
}
|
|
31864
31936
|
}
|
|
@@ -31990,7 +32062,7 @@ var Parser;
|
|
|
31990
32062
|
);
|
|
31991
32063
|
let exportClause;
|
|
31992
32064
|
let moduleSpecifier;
|
|
31993
|
-
let
|
|
32065
|
+
let attributes;
|
|
31994
32066
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
31995
32067
|
const namespaceExportPos = getNodePos();
|
|
31996
32068
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -32006,12 +32078,13 @@ var Parser;
|
|
|
32006
32078
|
moduleSpecifier = parseModuleSpecifier();
|
|
32007
32079
|
}
|
|
32008
32080
|
}
|
|
32009
|
-
|
|
32010
|
-
|
|
32081
|
+
const currentToken2 = token();
|
|
32082
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
|
|
32083
|
+
attributes = parseImportAttributes(currentToken2);
|
|
32011
32084
|
}
|
|
32012
32085
|
parseSemicolon();
|
|
32013
32086
|
setAwaitContext(savedAwaitContext);
|
|
32014
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
32087
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
32015
32088
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
32016
32089
|
}
|
|
32017
32090
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -32061,7 +32134,7 @@ var Parser;
|
|
|
32061
32134
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
32062
32135
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
32063
32136
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
32064
|
-
ParsingContext2[ParsingContext2["
|
|
32137
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
32065
32138
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
32066
32139
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
32067
32140
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -32081,8 +32154,7 @@ var Parser;
|
|
|
32081
32154
|
/*syntaxCursor*/
|
|
32082
32155
|
void 0,
|
|
32083
32156
|
1 /* JS */,
|
|
32084
|
-
/*
|
|
32085
|
-
false
|
|
32157
|
+
0 /* ParseAll */
|
|
32086
32158
|
);
|
|
32087
32159
|
scanner.setText(content, start, length2);
|
|
32088
32160
|
currentToken = scanner.scan();
|
|
@@ -32147,8 +32219,7 @@ var Parser;
|
|
|
32147
32219
|
/*syntaxCursor*/
|
|
32148
32220
|
void 0,
|
|
32149
32221
|
1 /* JS */,
|
|
32150
|
-
/*
|
|
32151
|
-
false
|
|
32222
|
+
0 /* ParseAll */
|
|
32152
32223
|
);
|
|
32153
32224
|
const jsDoc = doInsideOfContext(16777216 /* JSDoc */, () => parseJSDocCommentWorker(start, length2));
|
|
32154
32225
|
const sourceFile = { languageVariant: 0 /* Standard */, text: content };
|
|
@@ -33105,7 +33176,7 @@ var IncrementalParser;
|
|
|
33105
33176
|
true,
|
|
33106
33177
|
sourceFile.scriptKind,
|
|
33107
33178
|
sourceFile.setExternalModuleIndicator,
|
|
33108
|
-
sourceFile.
|
|
33179
|
+
sourceFile.jsDocParsingMode
|
|
33109
33180
|
);
|
|
33110
33181
|
}
|
|
33111
33182
|
const incrementalSourceFile = sourceFile;
|
|
@@ -33130,7 +33201,7 @@ var IncrementalParser;
|
|
|
33130
33201
|
true,
|
|
33131
33202
|
sourceFile.scriptKind,
|
|
33132
33203
|
sourceFile.setExternalModuleIndicator,
|
|
33133
|
-
sourceFile.
|
|
33204
|
+
sourceFile.jsDocParsingMode
|
|
33134
33205
|
);
|
|
33135
33206
|
result.commentDirectives = getNewCommentDirectives(
|
|
33136
33207
|
sourceFile.commentDirectives,
|
|
@@ -46287,7 +46358,7 @@ function createTypeChecker(host) {
|
|
|
46287
46358
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
46288
46359
|
}
|
|
46289
46360
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
46290
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
46361
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
46291
46362
|
if (startsWith(moduleReference, "@types/")) {
|
|
46292
46363
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
46293
46364
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -46305,7 +46376,7 @@ function createTypeChecker(host) {
|
|
|
46305
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);
|
|
46306
46377
|
const mode = contextSpecifier && isStringLiteralLike(contextSpecifier) ? getModeForUsageLocation(currentSourceFile, contextSpecifier) : currentSourceFile.impliedNodeFormat;
|
|
46307
46378
|
const moduleResolutionKind = getEmitModuleResolutionKind(compilerOptions);
|
|
46308
|
-
const resolvedModule = (
|
|
46379
|
+
const resolvedModule = (_g = host.getResolvedModule(currentSourceFile, moduleReference, mode)) == null ? void 0 : _g.resolvedModule;
|
|
46309
46380
|
const resolutionDiagnostic = resolvedModule && getResolutionDiagnostic(compilerOptions, resolvedModule, currentSourceFile);
|
|
46310
46381
|
const sourceFile = resolvedModule && (!resolutionDiagnostic || resolutionDiagnostic === Diagnostics.Module_0_was_resolved_to_1_but_jsx_is_not_set) && host.getSourceFile(resolvedModule.resolvedFileName);
|
|
46311
46382
|
if (sourceFile) {
|
|
@@ -46313,7 +46384,7 @@ function createTypeChecker(host) {
|
|
|
46313
46384
|
error(errorNode, resolutionDiagnostic, moduleReference, resolvedModule.resolvedFileName);
|
|
46314
46385
|
}
|
|
46315
46386
|
if (resolvedModule.resolvedUsingTsExtension && isDeclarationFileName(moduleReference)) {
|
|
46316
|
-
const importOrExport = ((
|
|
46387
|
+
const importOrExport = ((_h = findAncestor(location, isImportDeclaration)) == null ? void 0 : _h.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
46317
46388
|
if (importOrExport && !importOrExport.isTypeOnly || findAncestor(location, isImportCall)) {
|
|
46318
46389
|
error(
|
|
46319
46390
|
errorNode,
|
|
@@ -46322,7 +46393,7 @@ function createTypeChecker(host) {
|
|
|
46322
46393
|
);
|
|
46323
46394
|
}
|
|
46324
46395
|
} else if (resolvedModule.resolvedUsingTsExtension && !shouldAllowImportingTsExtension(compilerOptions, currentSourceFile.fileName)) {
|
|
46325
|
-
const importOrExport = ((
|
|
46396
|
+
const importOrExport = ((_i = findAncestor(location, isImportDeclaration)) == null ? void 0 : _i.importClause) || findAncestor(location, or(isImportEqualsDeclaration, isExportDeclaration));
|
|
46326
46397
|
if (!((importOrExport == null ? void 0 : importOrExport.isTypeOnly) || findAncestor(location, isImportTypeNode))) {
|
|
46327
46398
|
const tsExtension = Debug.checkDefined(tryExtractTSExtension(moduleReference));
|
|
46328
46399
|
error(errorNode, Diagnostics.An_import_path_can_only_end_with_a_0_extension_when_allowImportingTsExtensions_is_enabled, tsExtension);
|
|
@@ -46342,9 +46413,8 @@ function createTypeChecker(host) {
|
|
|
46342
46413
|
}
|
|
46343
46414
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
46344
46415
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
46345
|
-
const
|
|
46346
|
-
|
|
46347
|
-
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)) {
|
|
46348
46418
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
46349
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);
|
|
46350
46420
|
} else {
|
|
@@ -46450,7 +46520,7 @@ function createTypeChecker(host) {
|
|
|
46450
46520
|
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
46451
46521
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
46452
46522
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
46453
|
-
const suggestedExt = (
|
|
46523
|
+
const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
|
|
46454
46524
|
if (suggestedExt) {
|
|
46455
46525
|
error(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
46456
46526
|
} else {
|
|
@@ -47749,7 +47819,7 @@ function createTypeChecker(host) {
|
|
|
47749
47819
|
}
|
|
47750
47820
|
return factory.createInferTypeNode(typeParameterToDeclarationWithConstraint(type, context, constraintNode));
|
|
47751
47821
|
}
|
|
47752
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */) {
|
|
47822
|
+
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */ && type.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) {
|
|
47753
47823
|
const name2 = typeParameterToName(type, context);
|
|
47754
47824
|
context.approximateLength += idText(name2).length;
|
|
47755
47825
|
return factory.createTypeReferenceNode(
|
|
@@ -48215,7 +48285,7 @@ function createTypeChecker(host) {
|
|
|
48215
48285
|
return factory.updateImportTypeNode(
|
|
48216
48286
|
root,
|
|
48217
48287
|
root.argument,
|
|
48218
|
-
root.
|
|
48288
|
+
root.attributes,
|
|
48219
48289
|
qualifier,
|
|
48220
48290
|
typeArguments,
|
|
48221
48291
|
root.isTypeOf
|
|
@@ -48515,65 +48585,36 @@ function createTypeChecker(host) {
|
|
|
48515
48585
|
true
|
|
48516
48586
|
)[0];
|
|
48517
48587
|
let cleanup;
|
|
48518
|
-
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) &&
|
|
48519
|
-
|
|
48520
|
-
|
|
48521
|
-
|
|
48522
|
-
|
|
48523
|
-
|
|
48524
|
-
|
|
48525
|
-
|
|
48526
|
-
|
|
48527
|
-
|
|
48528
|
-
|
|
48529
|
-
|
|
48530
|
-
|
|
48531
|
-
if (!locals.has(name)) {
|
|
48532
|
-
newLocals = append(newLocals, name);
|
|
48533
|
-
locals.set(name, symbol);
|
|
48534
|
-
}
|
|
48535
|
-
});
|
|
48536
|
-
if (!newLocals)
|
|
48537
|
-
return;
|
|
48538
|
-
const oldCleanup = cleanup;
|
|
48539
|
-
function undo() {
|
|
48588
|
+
if (context.enclosingDeclaration && signature.declaration && signature.declaration !== context.enclosingDeclaration && !isInJSFile(signature.declaration) && some(expandedParams)) {
|
|
48589
|
+
const existingFakeScope = getNodeLinks(context.enclosingDeclaration).fakeScopeForSignatureDeclaration ? context.enclosingDeclaration : void 0;
|
|
48590
|
+
Debug.assertOptionalNode(existingFakeScope, isBlock);
|
|
48591
|
+
const locals = (existingFakeScope == null ? void 0 : existingFakeScope.locals) ?? createSymbolTable();
|
|
48592
|
+
let newLocals;
|
|
48593
|
+
for (const param of expandedParams) {
|
|
48594
|
+
if (!locals.has(param.escapedName)) {
|
|
48595
|
+
newLocals = append(newLocals, param.escapedName);
|
|
48596
|
+
locals.set(param.escapedName, param);
|
|
48597
|
+
}
|
|
48598
|
+
}
|
|
48599
|
+
if (newLocals) {
|
|
48600
|
+
let removeNewLocals2 = function() {
|
|
48540
48601
|
forEach(newLocals, (s) => locals.delete(s));
|
|
48541
|
-
|
|
48542
|
-
|
|
48602
|
+
};
|
|
48603
|
+
var removeNewLocals = removeNewLocals2;
|
|
48543
48604
|
if (existingFakeScope) {
|
|
48544
|
-
cleanup =
|
|
48605
|
+
cleanup = removeNewLocals2;
|
|
48545
48606
|
} else {
|
|
48546
48607
|
const fakeScope = parseNodeFactory.createBlock(emptyArray);
|
|
48547
|
-
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration =
|
|
48608
|
+
getNodeLinks(fakeScope).fakeScopeForSignatureDeclaration = true;
|
|
48548
48609
|
fakeScope.locals = locals;
|
|
48549
48610
|
const saveEnclosingDeclaration = context.enclosingDeclaration;
|
|
48550
48611
|
setParent(fakeScope, saveEnclosingDeclaration);
|
|
48551
48612
|
context.enclosingDeclaration = fakeScope;
|
|
48552
48613
|
cleanup = () => {
|
|
48553
48614
|
context.enclosingDeclaration = saveEnclosingDeclaration;
|
|
48554
|
-
|
|
48615
|
+
removeNewLocals2();
|
|
48555
48616
|
};
|
|
48556
48617
|
}
|
|
48557
|
-
};
|
|
48558
|
-
var pushFakeScope = pushFakeScope2;
|
|
48559
|
-
pushFakeScope2(
|
|
48560
|
-
"params",
|
|
48561
|
-
(add) => {
|
|
48562
|
-
for (const param of expandedParams) {
|
|
48563
|
-
add(param.escapedName, param);
|
|
48564
|
-
}
|
|
48565
|
-
}
|
|
48566
|
-
);
|
|
48567
|
-
if (context.flags & 4 /* GenerateNamesForShadowedTypeParams */) {
|
|
48568
|
-
pushFakeScope2(
|
|
48569
|
-
"typeParams",
|
|
48570
|
-
(add) => {
|
|
48571
|
-
for (const typeParam of signature.typeParameters ?? emptyArray) {
|
|
48572
|
-
const typeParamName = typeParameterToName(typeParam, context).escapedText;
|
|
48573
|
-
add(typeParamName, typeParam.symbol);
|
|
48574
|
-
}
|
|
48575
|
-
}
|
|
48576
|
-
);
|
|
48577
48618
|
}
|
|
48578
48619
|
}
|
|
48579
48620
|
const parameters = (some(expandedParams, (p) => p !== expandedParams[expandedParams.length - 1] && !!(getCheckFlags(p) & 32768 /* RestParameter */)) ? signature.parameters : expandedParams).map((parameter) => symbolToParameterDeclaration(parameter, context, kind === 176 /* Constructor */, options == null ? void 0 : options.privateSymbolVisitor, options == null ? void 0 : options.bundledImports));
|
|
@@ -48977,7 +49018,6 @@ function createTypeChecker(host) {
|
|
|
48977
49018
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
48978
49019
|
}
|
|
48979
49020
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
48980
|
-
var _a, _b, _c, _d;
|
|
48981
49021
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
48982
49022
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
48983
49023
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -48986,17 +49026,18 @@ function createTypeChecker(host) {
|
|
|
48986
49026
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
48987
49027
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
48988
49028
|
let specifier;
|
|
48989
|
-
let
|
|
49029
|
+
let attributes;
|
|
48990
49030
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
48991
49031
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
48992
49032
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
48993
|
-
|
|
48994
|
-
factory.
|
|
48995
|
-
factory.
|
|
48996
|
-
|
|
48997
|
-
|
|
48998
|
-
|
|
48999
|
-
|
|
49033
|
+
attributes = factory.createImportTypeAttributes(factory.createImportAttributes(
|
|
49034
|
+
factory.createNodeArray([
|
|
49035
|
+
factory.createImportAttribute(
|
|
49036
|
+
factory.createStringLiteral("resolution-mode"),
|
|
49037
|
+
factory.createStringLiteral("import")
|
|
49038
|
+
)
|
|
49039
|
+
])
|
|
49040
|
+
));
|
|
49000
49041
|
}
|
|
49001
49042
|
}
|
|
49002
49043
|
if (!specifier) {
|
|
@@ -49010,16 +49051,17 @@ function createTypeChecker(host) {
|
|
|
49010
49051
|
if (specifier.includes("/node_modules/")) {
|
|
49011
49052
|
specifier = oldSpecifier;
|
|
49012
49053
|
} else {
|
|
49013
|
-
|
|
49014
|
-
factory.
|
|
49015
|
-
factory.
|
|
49016
|
-
|
|
49017
|
-
|
|
49018
|
-
|
|
49019
|
-
|
|
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
|
+
));
|
|
49020
49062
|
}
|
|
49021
49063
|
}
|
|
49022
|
-
if (!
|
|
49064
|
+
if (!attributes) {
|
|
49023
49065
|
context.encounteredError = true;
|
|
49024
49066
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
49025
49067
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -49039,11 +49081,11 @@ function createTypeChecker(host) {
|
|
|
49039
49081
|
void 0
|
|
49040
49082
|
);
|
|
49041
49083
|
}
|
|
49042
|
-
return factory.createImportTypeNode(lit,
|
|
49084
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
49043
49085
|
} else {
|
|
49044
49086
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
49045
49087
|
const qualifier = splitNode.objectType.typeName;
|
|
49046
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
49088
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
49047
49089
|
}
|
|
49048
49090
|
}
|
|
49049
49091
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -49117,7 +49159,7 @@ function createTypeChecker(host) {
|
|
|
49117
49159
|
return identifier;
|
|
49118
49160
|
}
|
|
49119
49161
|
}
|
|
49120
|
-
function
|
|
49162
|
+
function typeParameterShadowsNameInScope(escapedName, context, type) {
|
|
49121
49163
|
const result = resolveName(
|
|
49122
49164
|
context.enclosingDeclaration,
|
|
49123
49165
|
escapedName,
|
|
@@ -49128,8 +49170,11 @@ function createTypeChecker(host) {
|
|
|
49128
49170
|
/*isUse*/
|
|
49129
49171
|
false
|
|
49130
49172
|
);
|
|
49131
|
-
if (result
|
|
49132
|
-
|
|
49173
|
+
if (result) {
|
|
49174
|
+
if (result.flags & 262144 /* TypeParameter */ && result === type.symbol) {
|
|
49175
|
+
return false;
|
|
49176
|
+
}
|
|
49177
|
+
return true;
|
|
49133
49178
|
}
|
|
49134
49179
|
return false;
|
|
49135
49180
|
}
|
|
@@ -49155,7 +49200,7 @@ function createTypeChecker(host) {
|
|
|
49155
49200
|
const rawtext = result.escapedText;
|
|
49156
49201
|
let i = ((_a = context.typeParameterNamesByTextNextNameCount) == null ? void 0 : _a.get(rawtext)) || 0;
|
|
49157
49202
|
let text = rawtext;
|
|
49158
|
-
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) ||
|
|
49203
|
+
while (((_b = context.typeParameterNamesByText) == null ? void 0 : _b.has(text)) || typeParameterShadowsNameInScope(text, context, type)) {
|
|
49159
49204
|
i++;
|
|
49160
49205
|
text = `${rawtext}_${i}`;
|
|
49161
49206
|
}
|
|
@@ -49166,7 +49211,7 @@ function createTypeChecker(host) {
|
|
|
49166
49211
|
}
|
|
49167
49212
|
(context.typeParameterNamesByTextNextNameCount || (context.typeParameterNamesByTextNextNameCount = /* @__PURE__ */ new Map())).set(rawtext, i);
|
|
49168
49213
|
(context.typeParameterNames || (context.typeParameterNames = /* @__PURE__ */ new Map())).set(getTypeId(type), result);
|
|
49169
|
-
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(
|
|
49214
|
+
(context.typeParameterNamesByText || (context.typeParameterNamesByText = /* @__PURE__ */ new Set())).add(rawtext);
|
|
49170
49215
|
}
|
|
49171
49216
|
return result;
|
|
49172
49217
|
}
|
|
@@ -49311,10 +49356,7 @@ function createTypeChecker(host) {
|
|
|
49311
49356
|
return !(getObjectFlags(type) & 4 /* Reference */) || !isTypeReferenceNode(existing) || length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
49312
49357
|
}
|
|
49313
49358
|
function getEnclosingDeclarationIgnoringFakeScope(enclosingDeclaration) {
|
|
49314
|
-
|
|
49315
|
-
enclosingDeclaration = enclosingDeclaration.parent;
|
|
49316
|
-
}
|
|
49317
|
-
return enclosingDeclaration;
|
|
49359
|
+
return getNodeLinks(enclosingDeclaration).fakeScopeForSignatureDeclaration ? enclosingDeclaration.parent : enclosingDeclaration;
|
|
49318
49360
|
}
|
|
49319
49361
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
49320
49362
|
if (!isErrorType(type) && enclosingDeclaration) {
|
|
@@ -49394,7 +49436,7 @@ function createTypeChecker(host) {
|
|
|
49394
49436
|
}
|
|
49395
49437
|
if (isIdentifier(node)) {
|
|
49396
49438
|
const type = getDeclaredTypeOfSymbol(sym);
|
|
49397
|
-
const name = sym.flags & 262144 /* TypeParameter */ ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
49439
|
+
const name = sym.flags & 262144 /* TypeParameter */ && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : factory.cloneNode(node);
|
|
49398
49440
|
name.symbol = sym;
|
|
49399
49441
|
return { introducesError, node: setEmitFlags(setOriginalNode(name, node), 16777216 /* NoAsciiEscaping */) };
|
|
49400
49442
|
}
|
|
@@ -49519,7 +49561,7 @@ function createTypeChecker(host) {
|
|
|
49519
49561
|
return factory.updateImportTypeNode(
|
|
49520
49562
|
node,
|
|
49521
49563
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
49522
|
-
node.
|
|
49564
|
+
node.attributes,
|
|
49523
49565
|
node.qualifier,
|
|
49524
49566
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
49525
49567
|
node.isTypeOf
|
|
@@ -49739,7 +49781,7 @@ function createTypeChecker(host) {
|
|
|
49739
49781
|
return statements;
|
|
49740
49782
|
}
|
|
49741
49783
|
function inlineExportModifiers(statements) {
|
|
49742
|
-
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));
|
|
49743
49785
|
if (index >= 0) {
|
|
49744
49786
|
const exportDecl = statements[index];
|
|
49745
49787
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -49767,7 +49809,7 @@ function createTypeChecker(host) {
|
|
|
49767
49809
|
replacements
|
|
49768
49810
|
),
|
|
49769
49811
|
exportDecl.moduleSpecifier,
|
|
49770
|
-
exportDecl.
|
|
49812
|
+
exportDecl.attributes
|
|
49771
49813
|
);
|
|
49772
49814
|
}
|
|
49773
49815
|
}
|
|
@@ -50418,7 +50460,7 @@ function createTypeChecker(host) {
|
|
|
50418
50460
|
)])
|
|
50419
50461
|
),
|
|
50420
50462
|
factory.createStringLiteral(specifier2),
|
|
50421
|
-
/*
|
|
50463
|
+
/*attributes*/
|
|
50422
50464
|
void 0
|
|
50423
50465
|
),
|
|
50424
50466
|
0 /* None */
|
|
@@ -50506,7 +50548,7 @@ function createTypeChecker(host) {
|
|
|
50506
50548
|
void 0
|
|
50507
50549
|
),
|
|
50508
50550
|
specifier2,
|
|
50509
|
-
node.parent.
|
|
50551
|
+
node.parent.attributes
|
|
50510
50552
|
),
|
|
50511
50553
|
0 /* None */
|
|
50512
50554
|
);
|
|
@@ -50527,7 +50569,7 @@ function createTypeChecker(host) {
|
|
|
50527
50569
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
50528
50570
|
),
|
|
50529
50571
|
specifier2,
|
|
50530
|
-
node.parent.
|
|
50572
|
+
node.parent.attributes
|
|
50531
50573
|
),
|
|
50532
50574
|
0 /* None */
|
|
50533
50575
|
);
|
|
@@ -50568,7 +50610,7 @@ function createTypeChecker(host) {
|
|
|
50568
50610
|
])
|
|
50569
50611
|
),
|
|
50570
50612
|
specifier2,
|
|
50571
|
-
node.parent.parent.parent.
|
|
50613
|
+
node.parent.parent.parent.attributes
|
|
50572
50614
|
),
|
|
50573
50615
|
0 /* None */
|
|
50574
50616
|
);
|
|
@@ -75806,16 +75848,16 @@ function createTypeChecker(host) {
|
|
|
75806
75848
|
getTypeFromTypeNode(node);
|
|
75807
75849
|
}
|
|
75808
75850
|
function checkImportType(node) {
|
|
75851
|
+
var _a, _b;
|
|
75809
75852
|
checkSourceElement(node.argument);
|
|
75810
|
-
if (node.
|
|
75811
|
-
const override =
|
|
75812
|
-
|
|
75813
|
-
|
|
75814
|
-
|
|
75815
|
-
|
|
75816
|
-
|
|
75817
|
-
|
|
75818
|
-
}
|
|
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
|
+
);
|
|
75819
75861
|
}
|
|
75820
75862
|
}
|
|
75821
75863
|
checkTypeReferenceOrImport(node);
|
|
@@ -79780,12 +79822,13 @@ function createTypeChecker(host) {
|
|
|
79780
79822
|
return false;
|
|
79781
79823
|
}
|
|
79782
79824
|
}
|
|
79783
|
-
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;
|
|
79784
79827
|
let hasError = false;
|
|
79785
|
-
for (const
|
|
79786
|
-
if (!isStringLiteral(
|
|
79828
|
+
for (const attr of node.attributes.elements) {
|
|
79829
|
+
if (!isStringLiteral(attr.value)) {
|
|
79787
79830
|
hasError = true;
|
|
79788
|
-
error(
|
|
79831
|
+
error(attr.value, diagnostic);
|
|
79789
79832
|
}
|
|
79790
79833
|
}
|
|
79791
79834
|
return !hasError;
|
|
@@ -79917,32 +79960,35 @@ function createTypeChecker(host) {
|
|
|
79917
79960
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
79918
79961
|
}
|
|
79919
79962
|
}
|
|
79920
|
-
function
|
|
79963
|
+
function checkImportAttributes(declaration) {
|
|
79921
79964
|
var _a;
|
|
79922
|
-
if (declaration.
|
|
79923
|
-
|
|
79924
|
-
|
|
79925
|
-
|
|
79926
|
-
|
|
79927
|
-
|
|
79928
|
-
|
|
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) {
|
|
79929
79974
|
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
79930
|
-
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
|
+
);
|
|
79931
79979
|
}
|
|
79932
79980
|
return;
|
|
79933
79981
|
}
|
|
79934
79982
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
79935
79983
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
79936
|
-
|
|
79937
|
-
|
|
79938
|
-
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
|
|
79939
|
-
);
|
|
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);
|
|
79940
79986
|
}
|
|
79941
79987
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
79942
|
-
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);
|
|
79943
79989
|
}
|
|
79944
79990
|
if (override) {
|
|
79945
|
-
return grammarErrorOnNode(
|
|
79991
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
79946
79992
|
}
|
|
79947
79993
|
}
|
|
79948
79994
|
}
|
|
@@ -79974,7 +80020,7 @@ function createTypeChecker(host) {
|
|
|
79974
80020
|
}
|
|
79975
80021
|
}
|
|
79976
80022
|
}
|
|
79977
|
-
|
|
80023
|
+
checkImportAttributes(node);
|
|
79978
80024
|
}
|
|
79979
80025
|
function checkImportEqualsDeclaration(node) {
|
|
79980
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)) {
|
|
@@ -80047,7 +80093,7 @@ function createTypeChecker(host) {
|
|
|
80047
80093
|
}
|
|
80048
80094
|
}
|
|
80049
80095
|
}
|
|
80050
|
-
|
|
80096
|
+
checkImportAttributes(node);
|
|
80051
80097
|
}
|
|
80052
80098
|
function checkGrammarExportDeclaration(node) {
|
|
80053
80099
|
var _a;
|
|
@@ -83837,12 +83883,12 @@ function createTypeChecker(host) {
|
|
|
83837
83883
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
83838
83884
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
83839
83885
|
if (nodeArguments.length > 1) {
|
|
83840
|
-
const
|
|
83841
|
-
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);
|
|
83842
83888
|
}
|
|
83843
83889
|
}
|
|
83844
83890
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
83845
|
-
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);
|
|
83846
83892
|
}
|
|
83847
83893
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
83848
83894
|
if (spreadElement) {
|
|
@@ -84109,13 +84155,6 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
84109
84155
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
84110
84156
|
}
|
|
84111
84157
|
}
|
|
84112
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
84113
|
-
var _a;
|
|
84114
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
84115
|
-
this.onDiagnosticReported();
|
|
84116
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
84117
|
-
}
|
|
84118
|
-
}
|
|
84119
84158
|
onDiagnosticReported() {
|
|
84120
84159
|
this.context.reportedDiagnostic = true;
|
|
84121
84160
|
}
|
|
@@ -84624,16 +84663,16 @@ var visitEachChildTable = {
|
|
|
84624
84663
|
return context.factory.updateImportTypeNode(
|
|
84625
84664
|
node,
|
|
84626
84665
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
84627
|
-
nodeVisitor(node.
|
|
84666
|
+
nodeVisitor(node.attributes, visitor, isImportTypeAttributes),
|
|
84628
84667
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
84629
84668
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
84630
84669
|
node.isTypeOf
|
|
84631
84670
|
);
|
|
84632
84671
|
},
|
|
84633
|
-
[302 /*
|
|
84634
|
-
return context.factory.
|
|
84672
|
+
[302 /* ImportTypeAttributes */]: function visitEachChildOfImportTypeAttributes(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
84673
|
+
return context.factory.updateImportTypeAttributes(
|
|
84635
84674
|
node,
|
|
84636
|
-
Debug.checkDefined(nodeVisitor(node.
|
|
84675
|
+
Debug.checkDefined(nodeVisitor(node.attributes, visitor, isImportAttributes)),
|
|
84637
84676
|
node.multiLine
|
|
84638
84677
|
);
|
|
84639
84678
|
},
|
|
@@ -85175,20 +85214,20 @@ var visitEachChildTable = {
|
|
|
85175
85214
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
85176
85215
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
85177
85216
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
85178
|
-
nodeVisitor(node.
|
|
85217
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
85179
85218
|
);
|
|
85180
85219
|
},
|
|
85181
|
-
[300 /*
|
|
85182
|
-
return context.factory.
|
|
85220
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
85221
|
+
return context.factory.updateImportAttributes(
|
|
85183
85222
|
node,
|
|
85184
|
-
nodesVisitor(node.elements, visitor,
|
|
85223
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
85185
85224
|
node.multiLine
|
|
85186
85225
|
);
|
|
85187
85226
|
},
|
|
85188
|
-
[301 /*
|
|
85189
|
-
return context.factory.
|
|
85227
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
85228
|
+
return context.factory.updateImportAttribute(
|
|
85190
85229
|
node,
|
|
85191
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
85230
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
85192
85231
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
85193
85232
|
);
|
|
85194
85233
|
},
|
|
@@ -85240,7 +85279,7 @@ var visitEachChildTable = {
|
|
|
85240
85279
|
node.isTypeOnly,
|
|
85241
85280
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
85242
85281
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
85243
|
-
nodeVisitor(node.
|
|
85282
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
85244
85283
|
);
|
|
85245
85284
|
},
|
|
85246
85285
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -88559,7 +88598,7 @@ function transformTypeScript(context) {
|
|
|
88559
88598
|
void 0,
|
|
88560
88599
|
importClause,
|
|
88561
88600
|
node.moduleSpecifier,
|
|
88562
|
-
node.
|
|
88601
|
+
node.attributes
|
|
88563
88602
|
) : void 0;
|
|
88564
88603
|
}
|
|
88565
88604
|
function visitImportClause(node) {
|
|
@@ -88609,7 +88648,7 @@ function transformTypeScript(context) {
|
|
|
88609
88648
|
node.isTypeOnly,
|
|
88610
88649
|
exportClause,
|
|
88611
88650
|
node.moduleSpecifier,
|
|
88612
|
-
node.
|
|
88651
|
+
node.attributes
|
|
88613
88652
|
) : void 0;
|
|
88614
88653
|
}
|
|
88615
88654
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -88643,7 +88682,7 @@ function transformTypeScript(context) {
|
|
|
88643
88682
|
/*importClause*/
|
|
88644
88683
|
void 0,
|
|
88645
88684
|
node.moduleReference.expression,
|
|
88646
|
-
/*
|
|
88685
|
+
/*attributes*/
|
|
88647
88686
|
void 0
|
|
88648
88687
|
),
|
|
88649
88688
|
node
|
|
@@ -96813,7 +96852,7 @@ function transformJsx(context) {
|
|
|
96813
96852
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
96814
96853
|
),
|
|
96815
96854
|
factory2.createStringLiteral(importSource),
|
|
96816
|
-
/*
|
|
96855
|
+
/*attributes*/
|
|
96817
96856
|
void 0
|
|
96818
96857
|
);
|
|
96819
96858
|
setParentRecursive(
|
|
@@ -106220,7 +106259,9 @@ function transformECMAScriptModule(context) {
|
|
|
106220
106259
|
)
|
|
106221
106260
|
])
|
|
106222
106261
|
),
|
|
106223
|
-
factory2.createStringLiteral("module")
|
|
106262
|
+
factory2.createStringLiteral("module"),
|
|
106263
|
+
/*attributes*/
|
|
106264
|
+
void 0
|
|
106224
106265
|
);
|
|
106225
106266
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
106226
106267
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -106337,7 +106378,7 @@ function transformECMAScriptModule(context) {
|
|
|
106337
106378
|
)
|
|
106338
106379
|
),
|
|
106339
106380
|
node.moduleSpecifier,
|
|
106340
|
-
node.
|
|
106381
|
+
node.attributes
|
|
106341
106382
|
);
|
|
106342
106383
|
setOriginalNode(importDecl, node.exportClause);
|
|
106343
106384
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -106790,8 +106831,7 @@ function transformDeclarations(context) {
|
|
|
106790
106831
|
trackReferencedAmbientModule,
|
|
106791
106832
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
106792
106833
|
reportNonlocalAugmentation,
|
|
106793
|
-
reportNonSerializableProperty
|
|
106794
|
-
reportImportTypeNodeResolutionModeOverride
|
|
106834
|
+
reportNonSerializableProperty
|
|
106795
106835
|
};
|
|
106796
106836
|
let errorNameNode;
|
|
106797
106837
|
let errorFallbackNode;
|
|
@@ -106915,11 +106955,6 @@ function transformDeclarations(context) {
|
|
|
106915
106955
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
106916
106956
|
}
|
|
106917
106957
|
}
|
|
106918
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
106919
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
106920
|
-
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));
|
|
106921
|
-
}
|
|
106922
|
-
}
|
|
106923
106958
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
106924
106959
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
106925
106960
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -107424,7 +107459,7 @@ function transformDeclarations(context) {
|
|
|
107424
107459
|
decl.modifiers,
|
|
107425
107460
|
decl.importClause,
|
|
107426
107461
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107427
|
-
|
|
107462
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107428
107463
|
);
|
|
107429
107464
|
}
|
|
107430
107465
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -107440,7 +107475,7 @@ function transformDeclarations(context) {
|
|
|
107440
107475
|
void 0
|
|
107441
107476
|
),
|
|
107442
107477
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107443
|
-
|
|
107478
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107444
107479
|
);
|
|
107445
107480
|
}
|
|
107446
107481
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -107458,7 +107493,7 @@ function transformDeclarations(context) {
|
|
|
107458
107493
|
namedBindings
|
|
107459
107494
|
),
|
|
107460
107495
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107461
|
-
|
|
107496
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107462
107497
|
) : void 0;
|
|
107463
107498
|
}
|
|
107464
107499
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -107473,7 +107508,7 @@ function transformDeclarations(context) {
|
|
|
107473
107508
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
107474
107509
|
),
|
|
107475
107510
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107476
|
-
|
|
107511
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107477
107512
|
);
|
|
107478
107513
|
}
|
|
107479
107514
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -107483,19 +107518,13 @@ function transformDeclarations(context) {
|
|
|
107483
107518
|
/*importClause*/
|
|
107484
107519
|
void 0,
|
|
107485
107520
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107486
|
-
|
|
107521
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107487
107522
|
);
|
|
107488
107523
|
}
|
|
107489
107524
|
}
|
|
107490
|
-
function
|
|
107491
|
-
const mode =
|
|
107492
|
-
|
|
107493
|
-
if (!isNightly()) {
|
|
107494
|
-
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));
|
|
107495
|
-
}
|
|
107496
|
-
return assertClause;
|
|
107497
|
-
}
|
|
107498
|
-
return void 0;
|
|
107525
|
+
function tryGetResolutionModeOverride(node) {
|
|
107526
|
+
const mode = getResolutionModeOverride(node);
|
|
107527
|
+
return node && mode !== void 0 ? node : void 0;
|
|
107499
107528
|
}
|
|
107500
107529
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
107501
107530
|
while (length(lateMarkedStatements)) {
|
|
@@ -107781,7 +107810,7 @@ function transformDeclarations(context) {
|
|
|
107781
107810
|
return cleanup(factory2.updateImportTypeNode(
|
|
107782
107811
|
input,
|
|
107783
107812
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
107784
|
-
input.
|
|
107813
|
+
input.attributes,
|
|
107785
107814
|
input.qualifier,
|
|
107786
107815
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
107787
107816
|
input.isTypeOf
|
|
@@ -107835,7 +107864,7 @@ function transformDeclarations(context) {
|
|
|
107835
107864
|
input.isTypeOnly,
|
|
107836
107865
|
input.exportClause,
|
|
107837
107866
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
107838
|
-
|
|
107867
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
107839
107868
|
);
|
|
107840
107869
|
}
|
|
107841
107870
|
case 277 /* ExportAssignment */: {
|
|
@@ -110328,10 +110357,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
110328
110357
|
return emitNamedExports(node);
|
|
110329
110358
|
case 281 /* ExportSpecifier */:
|
|
110330
110359
|
return emitExportSpecifier(node);
|
|
110331
|
-
case 300 /*
|
|
110332
|
-
return
|
|
110333
|
-
case 301 /*
|
|
110334
|
-
return
|
|
110360
|
+
case 300 /* ImportAttributes */:
|
|
110361
|
+
return emitImportAttributes(node);
|
|
110362
|
+
case 301 /* ImportAttribute */:
|
|
110363
|
+
return emitImportAttribute(node);
|
|
110335
110364
|
case 282 /* MissingDeclaration */:
|
|
110336
110365
|
return;
|
|
110337
110366
|
case 283 /* ExternalModuleReference */:
|
|
@@ -111106,16 +111135,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111106
111135
|
writeKeyword("import");
|
|
111107
111136
|
writePunctuation("(");
|
|
111108
111137
|
emit(node.argument);
|
|
111109
|
-
if (node.
|
|
111138
|
+
if (node.attributes) {
|
|
111110
111139
|
writePunctuation(",");
|
|
111111
111140
|
writeSpace();
|
|
111112
111141
|
writePunctuation("{");
|
|
111113
111142
|
writeSpace();
|
|
111114
|
-
writeKeyword("assert");
|
|
111143
|
+
writeKeyword(node.attributes.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
111115
111144
|
writePunctuation(":");
|
|
111116
111145
|
writeSpace();
|
|
111117
|
-
const elements = node.
|
|
111118
|
-
emitList(node.
|
|
111146
|
+
const elements = node.attributes.attributes.elements;
|
|
111147
|
+
emitList(node.attributes.attributes, elements, 526226 /* ImportAttributes */);
|
|
111119
111148
|
writeSpace();
|
|
111120
111149
|
writePunctuation("}");
|
|
111121
111150
|
}
|
|
@@ -112100,8 +112129,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112100
112129
|
writeSpace();
|
|
112101
112130
|
}
|
|
112102
112131
|
emitExpression(node.moduleSpecifier);
|
|
112103
|
-
if (node.
|
|
112104
|
-
emitWithLeadingSpace(node.
|
|
112132
|
+
if (node.attributes) {
|
|
112133
|
+
emitWithLeadingSpace(node.attributes);
|
|
112105
112134
|
}
|
|
112106
112135
|
writeTrailingSemicolon();
|
|
112107
112136
|
}
|
|
@@ -112170,18 +112199,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112170
112199
|
writeSpace();
|
|
112171
112200
|
emitExpression(node.moduleSpecifier);
|
|
112172
112201
|
}
|
|
112173
|
-
if (node.
|
|
112174
|
-
emitWithLeadingSpace(node.
|
|
112202
|
+
if (node.attributes) {
|
|
112203
|
+
emitWithLeadingSpace(node.attributes);
|
|
112175
112204
|
}
|
|
112176
112205
|
writeTrailingSemicolon();
|
|
112177
112206
|
}
|
|
112178
|
-
function
|
|
112179
|
-
emitTokenWithComment(
|
|
112207
|
+
function emitImportAttributes(node) {
|
|
112208
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
112180
112209
|
writeSpace();
|
|
112181
112210
|
const elements = node.elements;
|
|
112182
|
-
emitList(node, elements, 526226 /*
|
|
112211
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
112183
112212
|
}
|
|
112184
|
-
function
|
|
112213
|
+
function emitImportAttribute(node) {
|
|
112185
112214
|
emit(node.name);
|
|
112186
112215
|
writePunctuation(":");
|
|
112187
112216
|
writeSpace();
|
|
@@ -114898,7 +114927,7 @@ function computeCommonSourceDirectoryOfFilenames(fileNames, currentDirectory, ge
|
|
|
114898
114927
|
function createCompilerHost(options, setParentNodes) {
|
|
114899
114928
|
return createCompilerHostWorker(options, setParentNodes);
|
|
114900
114929
|
}
|
|
114901
|
-
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes
|
|
114930
|
+
function createGetSourceFile(readFile, getCompilerOptions, setParentNodes) {
|
|
114902
114931
|
return (fileName, languageVersionOrOptions, onError) => {
|
|
114903
114932
|
let text;
|
|
114904
114933
|
try {
|
|
@@ -114912,15 +114941,7 @@ function createGetSourceFile(readFile, getCompilerOptions, setParentNodes, skipN
|
|
|
114912
114941
|
}
|
|
114913
114942
|
text = "";
|
|
114914
114943
|
}
|
|
114915
|
-
return text !== void 0 ? createSourceFile(
|
|
114916
|
-
fileName,
|
|
114917
|
-
text,
|
|
114918
|
-
languageVersionOrOptions,
|
|
114919
|
-
setParentNodes,
|
|
114920
|
-
/*scriptKind*/
|
|
114921
|
-
void 0,
|
|
114922
|
-
skipNonSemanticJSDocParsing2
|
|
114923
|
-
) : void 0;
|
|
114944
|
+
return text !== void 0 ? createSourceFile(fileName, text, languageVersionOrOptions, setParentNodes) : void 0;
|
|
114924
114945
|
};
|
|
114925
114946
|
}
|
|
114926
114947
|
function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryExists) {
|
|
@@ -114944,7 +114965,7 @@ function createWriteFileMeasuringIO(actualWriteFile, createDirectory, directoryE
|
|
|
114944
114965
|
}
|
|
114945
114966
|
};
|
|
114946
114967
|
}
|
|
114947
|
-
function createCompilerHostWorker(options, setParentNodes,
|
|
114968
|
+
function createCompilerHostWorker(options, setParentNodes, system = sys) {
|
|
114948
114969
|
const existingDirectories = /* @__PURE__ */ new Map();
|
|
114949
114970
|
const getCanonicalFileName = createGetCanonicalFileName(system.useCaseSensitiveFileNames);
|
|
114950
114971
|
function directoryExists(directoryPath) {
|
|
@@ -114963,7 +114984,7 @@ function createCompilerHostWorker(options, setParentNodes, skipNonSemanticJSDocP
|
|
|
114963
114984
|
const newLine = getNewLineCharacter(options);
|
|
114964
114985
|
const realpath = system.realpath && ((path) => system.realpath(path));
|
|
114965
114986
|
const compilerHost = {
|
|
114966
|
-
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes
|
|
114987
|
+
getSourceFile: createGetSourceFile((fileName) => compilerHost.readFile(fileName), () => options, setParentNodes),
|
|
114967
114988
|
getDefaultLibLocation,
|
|
114968
114989
|
getDefaultLibFileName: (options2) => combinePaths(getDefaultLibLocation(), getDefaultLibFileName(options2)),
|
|
114969
114990
|
writeFile: createWriteFileMeasuringIO(
|
|
@@ -115247,14 +115268,14 @@ function getModeForUsageLocation(file, usage) {
|
|
|
115247
115268
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
115248
115269
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
115249
115270
|
if (isTypeOnly) {
|
|
115250
|
-
const override =
|
|
115271
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
115251
115272
|
if (override) {
|
|
115252
115273
|
return override;
|
|
115253
115274
|
}
|
|
115254
115275
|
}
|
|
115255
115276
|
}
|
|
115256
115277
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
115257
|
-
const override =
|
|
115278
|
+
const override = getResolutionModeOverride((_a = usage.parent.parent.attributes) == null ? void 0 : _a.attributes);
|
|
115258
115279
|
if (override) {
|
|
115259
115280
|
return override;
|
|
115260
115281
|
}
|
|
@@ -115265,18 +115286,24 @@ function getModeForUsageLocation(file, usage) {
|
|
|
115265
115286
|
const exprParentParent = (_b = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _b.parent;
|
|
115266
115287
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
115267
115288
|
}
|
|
115268
|
-
function
|
|
115269
|
-
if (!
|
|
115289
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
115290
|
+
if (!node)
|
|
115270
115291
|
return void 0;
|
|
115271
|
-
if (length(
|
|
115272
|
-
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
|
+
);
|
|
115273
115297
|
return void 0;
|
|
115274
115298
|
}
|
|
115275
|
-
const elem =
|
|
115299
|
+
const elem = node.elements[0];
|
|
115276
115300
|
if (!isStringLiteralLike(elem.name))
|
|
115277
115301
|
return void 0;
|
|
115278
115302
|
if (elem.name.text !== "resolution-mode") {
|
|
115279
|
-
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
|
+
);
|
|
115280
115307
|
return void 0;
|
|
115281
115308
|
}
|
|
115282
115309
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -115420,14 +115447,14 @@ function isReferenceFileLocation(location) {
|
|
|
115420
115447
|
return location.pos !== void 0;
|
|
115421
115448
|
}
|
|
115422
115449
|
function getReferencedFileLocation(program, ref) {
|
|
115423
|
-
var _a, _b, _c, _d
|
|
115450
|
+
var _a, _b, _c, _d;
|
|
115424
115451
|
const file = Debug.checkDefined(program.getSourceFileByPath(ref.file));
|
|
115425
115452
|
const { kind, index } = ref;
|
|
115426
115453
|
let pos, end, packageId, resolutionMode;
|
|
115427
115454
|
switch (kind) {
|
|
115428
115455
|
case 3 /* Import */:
|
|
115429
115456
|
const importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
115430
|
-
packageId = (
|
|
115457
|
+
packageId = (_b = (_a = program.getResolvedModule(file, importLiteral.text, getModeForResolutionAtIndex(file, index))) == null ? void 0 : _a.resolvedModule) == null ? void 0 : _b.packageId;
|
|
115431
115458
|
if (importLiteral.pos === -1)
|
|
115432
115459
|
return { file, packageId, text: importLiteral.text };
|
|
115433
115460
|
pos = skipTrivia(file.text, importLiteral.pos);
|
|
@@ -115438,7 +115465,7 @@ function getReferencedFileLocation(program, ref) {
|
|
|
115438
115465
|
break;
|
|
115439
115466
|
case 5 /* TypeReferenceDirective */:
|
|
115440
115467
|
({ pos, end, resolutionMode } = file.typeReferenceDirectives[index]);
|
|
115441
|
-
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;
|
|
115442
115469
|
break;
|
|
115443
115470
|
case 7 /* LibReferenceDirective */:
|
|
115444
115471
|
({ pos, end } = file.libReferenceDirectives[index]);
|
|
@@ -115571,7 +115598,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
|
|
|
115571
115598
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
115572
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,
|
|
115573
115600
|
Diagnostics.Duplicate_label_0.code,
|
|
115574
|
-
Diagnostics.
|
|
115601
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
115575
115602
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
115576
115603
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
115577
115604
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -115966,6 +115993,10 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
115966
115993
|
resolvedModules,
|
|
115967
115994
|
resolvedTypeReferenceDirectiveNames,
|
|
115968
115995
|
resolvedLibReferences,
|
|
115996
|
+
getResolvedModule,
|
|
115997
|
+
getResolvedTypeReferenceDirective,
|
|
115998
|
+
forEachResolvedModule,
|
|
115999
|
+
forEachResolvedTypeReferenceDirective,
|
|
115969
116000
|
getCurrentPackagesMap: () => packageMap,
|
|
115970
116001
|
typesPackageExists,
|
|
115971
116002
|
packageBundlesTypes,
|
|
@@ -116009,19 +116040,35 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116009
116040
|
measure("Program", "beforeProgram", "afterProgram");
|
|
116010
116041
|
(_p = tracing) == null ? void 0 : _p.pop();
|
|
116011
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
|
+
}
|
|
116012
116064
|
function getPackagesMap() {
|
|
116013
116065
|
if (packageMap)
|
|
116014
116066
|
return packageMap;
|
|
116015
116067
|
packageMap = /* @__PURE__ */ new Map();
|
|
116016
|
-
|
|
116017
|
-
(
|
|
116018
|
-
|
|
116019
|
-
|
|
116020
|
-
if (resolvedModule == null ? void 0 : resolvedModule.packageId)
|
|
116021
|
-
packageMap.set(resolvedModule.packageId.name, resolvedModule.extension === ".d.ts" /* Dts */ || !!packageMap.get(resolvedModule.packageId.name));
|
|
116022
|
-
});
|
|
116023
|
-
}
|
|
116024
|
-
);
|
|
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));
|
|
116071
|
+
});
|
|
116025
116072
|
return packageMap;
|
|
116026
116073
|
}
|
|
116027
116074
|
function typesPackageExists(packageName) {
|
|
@@ -116153,7 +116200,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116153
116200
|
return classifiableNames;
|
|
116154
116201
|
}
|
|
116155
116202
|
function resolveModuleNamesReusingOldState(moduleNames, file) {
|
|
116156
|
-
var _a2, _b2;
|
|
116157
116203
|
if (structureIsReused === 0 /* Not */ && !file.ambientModuleNames.length) {
|
|
116158
116204
|
return resolveModuleNamesWorker(
|
|
116159
116205
|
moduleNames,
|
|
@@ -116171,7 +116217,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116171
116217
|
const moduleName = moduleNames[i];
|
|
116172
116218
|
if (file === oldSourceFile && !hasInvalidatedResolutions(file.path)) {
|
|
116173
116219
|
const mode = getModeForUsageLocation(file, moduleName);
|
|
116174
|
-
const oldResolution =
|
|
116220
|
+
const oldResolution = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, mode);
|
|
116175
116221
|
if (oldResolution == null ? void 0 : oldResolution.resolvedModule) {
|
|
116176
116222
|
if (isTraceEnabled(options, host)) {
|
|
116177
116223
|
trace(
|
|
@@ -116218,8 +116264,8 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116218
116264
|
Debug.assert(j === resolutions.length);
|
|
116219
116265
|
return result;
|
|
116220
116266
|
function moduleNameResolvesToAmbientModuleInNonModifiedFile(moduleName) {
|
|
116221
|
-
var
|
|
116222
|
-
const resolutionToFile = (
|
|
116267
|
+
var _a2;
|
|
116268
|
+
const resolutionToFile = (_a2 = oldProgram == null ? void 0 : oldProgram.getResolvedModule(file, moduleName.text, getModeForUsageLocation(file, moduleName))) == null ? void 0 : _a2.resolvedModule;
|
|
116223
116269
|
const resolvedFile = resolutionToFile && oldProgram.getSourceFile(resolutionToFile.resolvedFileName);
|
|
116224
116270
|
if (resolutionToFile && resolvedFile) {
|
|
116225
116271
|
return false;
|
|
@@ -116235,7 +116281,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116235
116281
|
}
|
|
116236
116282
|
}
|
|
116237
116283
|
function resolveTypeReferenceDirectiveNamesReusingOldState(typeDirectiveNames, containingFile) {
|
|
116238
|
-
var _a2
|
|
116284
|
+
var _a2;
|
|
116239
116285
|
if (structureIsReused === 0 /* Not */) {
|
|
116240
116286
|
return resolveTypeReferenceDirectiveNamesWorker(
|
|
116241
116287
|
typeDirectiveNames,
|
|
@@ -116255,7 +116301,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116255
116301
|
if (canReuseResolutions) {
|
|
116256
116302
|
const typeDirectiveName = getTypeReferenceResolutionName(entry);
|
|
116257
116303
|
const mode = getModeForFileReference(entry, containingSourceFile == null ? void 0 : containingSourceFile.impliedNodeFormat);
|
|
116258
|
-
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);
|
|
116259
116305
|
if (oldResolution == null ? void 0 : oldResolution.resolvedTypeReferenceDirective) {
|
|
116260
116306
|
if (isTraceEnabled(options, host)) {
|
|
116261
116307
|
trace(
|
|
@@ -116315,7 +116361,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116315
116361
|
);
|
|
116316
116362
|
}
|
|
116317
116363
|
function tryReuseStructureFromOldProgram() {
|
|
116318
|
-
var _a2
|
|
116364
|
+
var _a2;
|
|
116319
116365
|
if (!oldProgram) {
|
|
116320
116366
|
return 0 /* Not */;
|
|
116321
116367
|
}
|
|
@@ -116435,20 +116481,29 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
116435
116481
|
const moduleNames = getModuleNames(newSourceFile);
|
|
116436
116482
|
const resolutions = resolveModuleNamesReusingOldState(moduleNames, newSourceFile);
|
|
116437
116483
|
(resolvedModulesProcessing ?? (resolvedModulesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, resolutions);
|
|
116438
|
-
const
|
|
116439
|
-
|
|
116484
|
+
const resolutionsChanged = hasChangesInResolutions(
|
|
116485
|
+
moduleNames,
|
|
116486
|
+
newSourceFile,
|
|
116487
|
+
resolutions,
|
|
116488
|
+
(name, mode) => oldProgram.getResolvedModule(newSourceFile, name, mode),
|
|
116489
|
+
moduleResolutionIsEqualTo,
|
|
116490
|
+
moduleResolutionNameAndModeGetter
|
|
116491
|
+
);
|
|
116440
116492
|
if (resolutionsChanged)
|
|
116441
116493
|
structureIsReused = 1 /* SafeModules */;
|
|
116442
116494
|
const typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
116443
116495
|
const typeReferenceResolutions = resolveTypeReferenceDirectiveNamesReusingOldState(typesReferenceDirectives, newSourceFile);
|
|
116444
116496
|
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, typeReferenceResolutions);
|
|
116445
|
-
const
|
|
116446
|
-
|
|
116447
|
-
|
|
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)
|
|
116448
116506
|
structureIsReused = 1 /* SafeModules */;
|
|
116449
|
-
} else if (oldTypeResolutions) {
|
|
116450
|
-
(resolvedTypeReferenceDirectiveNamesProcessing ?? (resolvedTypeReferenceDirectiveNamesProcessing = /* @__PURE__ */ new Map())).set(newSourceFile.path, oldTypeResolutions);
|
|
116451
|
-
}
|
|
116452
116507
|
}
|
|
116453
116508
|
if (structureIsReused !== 2 /* Completely */) {
|
|
116454
116509
|
return structureIsReused;
|
|
@@ -117077,7 +117132,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117077
117132
|
/*importClause*/
|
|
117078
117133
|
void 0,
|
|
117079
117134
|
externalHelpersModuleReference,
|
|
117080
|
-
/*
|
|
117135
|
+
/*attributes*/
|
|
117081
117136
|
void 0
|
|
117082
117137
|
);
|
|
117083
117138
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -117318,7 +117373,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117318
117373
|
const result = getImpliedNodeFormatForFileWorker(getNormalizedAbsolutePath(fileName, currentDirectory), moduleResolutionCache2 == null ? void 0 : moduleResolutionCache2.getPackageJsonInfoCache(), host2, options2);
|
|
117319
117374
|
const languageVersion = getEmitScriptTarget(options2);
|
|
117320
117375
|
const setExternalModuleIndicator2 = getSetExternalModuleIndicator(options2);
|
|
117321
|
-
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 };
|
|
117322
117377
|
}
|
|
117323
117378
|
function findSourceFileWorker(fileName, isDefaultLib, ignoreNoDefaultLib, reason, packageId) {
|
|
117324
117379
|
var _a2;
|
|
@@ -118595,7 +118650,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
118595
118650
|
symlinks = createSymlinkCache(currentDirectory, getCanonicalFileName);
|
|
118596
118651
|
}
|
|
118597
118652
|
if (files && !symlinks.hasProcessedResolutions()) {
|
|
118598
|
-
symlinks.setSymlinksFromResolutions(
|
|
118653
|
+
symlinks.setSymlinksFromResolutions(forEachResolvedModule, forEachResolvedTypeReferenceDirective, automaticTypeDirectiveResolutions);
|
|
118599
118654
|
}
|
|
118600
118655
|
return symlinks;
|
|
118601
118656
|
}
|
|
@@ -118949,7 +119004,6 @@ var BuilderState;
|
|
|
118949
119004
|
return toPath(program.getProjectReferenceRedirect(fileName) || fileName, sourceFileDirectory, getCanonicalFileName);
|
|
118950
119005
|
}
|
|
118951
119006
|
function getReferencedFiles(program, sourceFile, getCanonicalFileName) {
|
|
118952
|
-
var _a;
|
|
118953
119007
|
let referencedFiles;
|
|
118954
119008
|
if (sourceFile.imports && sourceFile.imports.length > 0) {
|
|
118955
119009
|
const checker = program.getTypeChecker();
|
|
@@ -118965,17 +119019,14 @@ var BuilderState;
|
|
|
118965
119019
|
addReferencedFile(referencedPath);
|
|
118966
119020
|
}
|
|
118967
119021
|
}
|
|
118968
|
-
|
|
118969
|
-
|
|
118970
|
-
|
|
118971
|
-
|
|
118972
|
-
|
|
118973
|
-
|
|
118974
|
-
|
|
118975
|
-
|
|
118976
|
-
addReferencedFile(typeFilePath);
|
|
118977
|
-
});
|
|
118978
|
-
}
|
|
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);
|
|
118979
119030
|
if (sourceFile.moduleAugmentations.length) {
|
|
118980
119031
|
const checker = program.getTypeChecker();
|
|
118981
119032
|
for (const moduleName of sourceFile.moduleAugmentations) {
|
|
@@ -120693,6 +120744,47 @@ function getRootDirectoryOfResolutionCache(rootDirForResolution, getCurrentDirec
|
|
|
120693
120744
|
const normalized = getNormalizedAbsolutePath(rootDirForResolution, getCurrentDirectory());
|
|
120694
120745
|
return !isDiskPathRoot(normalized) ? removeTrailingDirectorySeparator(normalized) : normalized;
|
|
120695
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
|
+
}
|
|
120696
120788
|
function createResolutionCache(resolutionHost, rootDirForResolution, logChangesWhenResolvingModule) {
|
|
120697
120789
|
let filesWithChangedSetOfUnresolvedImports;
|
|
120698
120790
|
let filesWithInvalidatedResolutions;
|
|
@@ -120739,6 +120831,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120739
120831
|
const rootPathComponents = getPathComponents(rootPath);
|
|
120740
120832
|
const typeRootsWatches = /* @__PURE__ */ new Map();
|
|
120741
120833
|
return {
|
|
120834
|
+
rootDirForResolution,
|
|
120835
|
+
resolvedModuleNames,
|
|
120836
|
+
resolvedTypeReferenceDirectives,
|
|
120837
|
+
resolvedLibraries,
|
|
120838
|
+
resolvedFileToResolution,
|
|
120839
|
+
resolutionsWithFailedLookups,
|
|
120840
|
+
resolutionsWithOnlyAffectingLocations,
|
|
120841
|
+
directoryWatchesOfFailedLookups,
|
|
120842
|
+
fileWatchesOfAffectingLocations,
|
|
120843
|
+
watchFailedLookupLocationsOfExternalModuleResolutions,
|
|
120742
120844
|
getModuleResolutionCache: () => moduleResolutionCache,
|
|
120743
120845
|
startRecordingFilesWithChangedResolutions,
|
|
120744
120846
|
finishRecordingFilesWithChangedResolutions,
|
|
@@ -120841,7 +120943,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120841
120943
|
if (!((_a = newProgram == null ? void 0 : newProgram.resolvedLibReferences) == null ? void 0 : _a.has(libFileName))) {
|
|
120842
120944
|
stopWatchFailedLookupLocationOfResolution(
|
|
120843
120945
|
resolution,
|
|
120844
|
-
resolutionHost.toPath(getInferredLibraryNameResolveFrom(
|
|
120946
|
+
resolutionHost.toPath(getInferredLibraryNameResolveFrom(resolutionHost.getCompilationSettings(), getCurrentDirectory(), libFileName)),
|
|
120845
120947
|
getResolvedModule
|
|
120846
120948
|
);
|
|
120847
120949
|
resolvedLibraries.delete(libFileName);
|
|
@@ -120883,58 +120985,22 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120883
120985
|
}
|
|
120884
120986
|
});
|
|
120885
120987
|
}
|
|
120886
|
-
directoryWatchesOfFailedLookups.forEach(
|
|
120887
|
-
|
|
120888
|
-
directoryWatchesOfFailedLookups.delete(path);
|
|
120889
|
-
watcher.watcher.close();
|
|
120890
|
-
}
|
|
120891
|
-
});
|
|
120892
|
-
fileWatchesOfAffectingLocations.forEach((watcher, path) => {
|
|
120893
|
-
if (watcher.files === 0 && watcher.resolutions === 0) {
|
|
120894
|
-
fileWatchesOfAffectingLocations.delete(path);
|
|
120895
|
-
watcher.watcher.close();
|
|
120896
|
-
}
|
|
120897
|
-
});
|
|
120988
|
+
directoryWatchesOfFailedLookups.forEach(closeDirectoryWatchesOfFailedLookup);
|
|
120989
|
+
fileWatchesOfAffectingLocations.forEach(closeFileWatcherOfAffectingLocation);
|
|
120898
120990
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
120899
120991
|
}
|
|
120900
|
-
function
|
|
120901
|
-
|
|
120902
|
-
|
|
120903
|
-
|
|
120904
|
-
if (!resolutionHost.getGlobalCache) {
|
|
120905
|
-
return primaryResult;
|
|
120992
|
+
function closeDirectoryWatchesOfFailedLookup(watcher, path) {
|
|
120993
|
+
if (watcher.refCount === 0) {
|
|
120994
|
+
directoryWatchesOfFailedLookups.delete(path);
|
|
120995
|
+
watcher.watcher.close();
|
|
120906
120996
|
}
|
|
120907
|
-
const globalCache = resolutionHost.getGlobalCache();
|
|
120908
|
-
if (globalCache !== void 0 && !isExternalModuleNameRelative(moduleName) && !(primaryResult.resolvedModule && extensionIsTS(primaryResult.resolvedModule.extension))) {
|
|
120909
|
-
const { resolvedModule, failedLookupLocations, affectingLocations, resolutionDiagnostics } = loadModuleFromGlobalCache(
|
|
120910
|
-
Debug.checkDefined(resolutionHost.globalCacheResolutionModuleName)(moduleName),
|
|
120911
|
-
resolutionHost.projectName,
|
|
120912
|
-
compilerOptions,
|
|
120913
|
-
host,
|
|
120914
|
-
globalCache,
|
|
120915
|
-
moduleResolutionCache
|
|
120916
|
-
);
|
|
120917
|
-
if (resolvedModule) {
|
|
120918
|
-
primaryResult.resolvedModule = resolvedModule;
|
|
120919
|
-
primaryResult.failedLookupLocations = updateResolutionField(primaryResult.failedLookupLocations, failedLookupLocations);
|
|
120920
|
-
primaryResult.affectingLocations = updateResolutionField(primaryResult.affectingLocations, affectingLocations);
|
|
120921
|
-
primaryResult.resolutionDiagnostics = updateResolutionField(primaryResult.resolutionDiagnostics, resolutionDiagnostics);
|
|
120922
|
-
return primaryResult;
|
|
120923
|
-
}
|
|
120924
|
-
}
|
|
120925
|
-
return primaryResult;
|
|
120926
120997
|
}
|
|
120927
|
-
function
|
|
120928
|
-
|
|
120929
|
-
|
|
120930
|
-
|
|
120931
|
-
|
|
120932
|
-
|
|
120933
|
-
options,
|
|
120934
|
-
redirectedReference,
|
|
120935
|
-
resoluionMode
|
|
120936
|
-
)
|
|
120937
|
-
};
|
|
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
|
+
}
|
|
120938
121004
|
}
|
|
120939
121005
|
function resolveNamesWithLocalCache({
|
|
120940
121006
|
entries,
|
|
@@ -120971,9 +121037,11 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
120971
121037
|
resolutionHost.onDiscoveredSymlink();
|
|
120972
121038
|
}
|
|
120973
121039
|
resolutionsInFile.set(name, mode, resolution);
|
|
120974
|
-
|
|
120975
|
-
|
|
120976
|
-
|
|
121040
|
+
if (resolution !== existingResolution) {
|
|
121041
|
+
watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution, path, getResolutionWithResolvedFileName, deferWatchingNonRelativeResolution);
|
|
121042
|
+
if (existingResolution) {
|
|
121043
|
+
stopWatchFailedLookupLocationOfResolution(existingResolution, path, getResolutionWithResolvedFileName);
|
|
121044
|
+
}
|
|
120977
121045
|
}
|
|
120978
121046
|
if (logChanges && filesWithChangedSetOfUnresolvedImports && !resolutionIsEqualTo(existingResolution, resolution)) {
|
|
120979
121047
|
filesWithChangedSetOfUnresolvedImports.push(path);
|
|
@@ -121062,10 +121130,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121062
121130
|
options,
|
|
121063
121131
|
reusedNames,
|
|
121064
121132
|
perFileCache: resolvedModuleNames,
|
|
121065
|
-
loader:
|
|
121133
|
+
loader: createModuleResolutionLoaderUsingGlobalCache(
|
|
121066
121134
|
containingFile,
|
|
121067
121135
|
redirectedReference,
|
|
121068
|
-
options
|
|
121136
|
+
options,
|
|
121137
|
+
resolutionHost,
|
|
121138
|
+
moduleResolutionCache
|
|
121069
121139
|
),
|
|
121070
121140
|
getResolutionWithResolvedFileName: getResolvedModule,
|
|
121071
121141
|
shouldRetryResolution: (resolution) => !resolution.resolvedModule || !resolutionExtensionIsTSOrJson(resolution.resolvedModule.extension),
|
|
@@ -121119,7 +121189,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121119
121189
|
);
|
|
121120
121190
|
if (resolution && !resolution.isInvalidated)
|
|
121121
121191
|
return resolution;
|
|
121122
|
-
return
|
|
121192
|
+
return resolveModuleNameUsingGlobalCache(resolutionHost, moduleResolutionCache, moduleName, containingFile, resolutionHost.getCompilationSettings());
|
|
121123
121193
|
}
|
|
121124
121194
|
function isNodeModulesAtTypesDirectory(dirPath) {
|
|
121125
121195
|
return endsWith(dirPath, "/node_modules/@types");
|
|
@@ -121219,52 +121289,63 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121219
121289
|
return;
|
|
121220
121290
|
}
|
|
121221
121291
|
let locationToWatch = affectingLocation;
|
|
121292
|
+
let isSymlink = false;
|
|
121293
|
+
let symlinkWatcher;
|
|
121222
121294
|
if (resolutionHost.realpath) {
|
|
121223
121295
|
locationToWatch = resolutionHost.realpath(affectingLocation);
|
|
121224
121296
|
if (affectingLocation !== locationToWatch) {
|
|
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
|
-
|
|
121252
|
-
|
|
121253
|
-
|
|
121254
|
-
|
|
121255
|
-
|
|
121256
|
-
|
|
121257
|
-
|
|
121258
|
-
|
|
121259
|
-
|
|
121260
|
-
|
|
121261
|
-
|
|
121262
|
-
|
|
121263
|
-
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
|
+
};
|
|
121264
121335
|
fileWatchesOfAffectingLocations.set(affectingLocation, watcher);
|
|
121265
|
-
|
|
121336
|
+
(symlinkWatcher.symlinks ?? (symlinkWatcher.symlinks = /* @__PURE__ */ new Set())).add(affectingLocation);
|
|
121266
121337
|
}
|
|
121267
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
|
+
}
|
|
121268
121349
|
function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions, name) {
|
|
121269
121350
|
const program = resolutionHost.getCurrentProgram();
|
|
121270
121351
|
if (!program || !program.getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name)) {
|
|
@@ -121286,7 +121367,7 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121286
121367
|
directoryWatchesOfFailedLookups.set(dirPath, { watcher: createDirectoryWatcher(dir, dirPath, nonRecursive), refCount: 1, nonRecursive });
|
|
121287
121368
|
}
|
|
121288
121369
|
}
|
|
121289
|
-
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot) {
|
|
121370
|
+
function stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove) {
|
|
121290
121371
|
const failedLookupLocationPath = resolutionHost.toPath(failedLookupLocation);
|
|
121291
121372
|
const toWatch = getDirectoryToWatchFailedLookupLocation(
|
|
121292
121373
|
failedLookupLocation,
|
|
@@ -121301,12 +121382,12 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121301
121382
|
if (dirPath === rootPath) {
|
|
121302
121383
|
removeAtRoot = true;
|
|
121303
121384
|
} else {
|
|
121304
|
-
removeDirectoryWatcher(dirPath);
|
|
121385
|
+
removeDirectoryWatcher(dirPath, syncDirWatcherRemove);
|
|
121305
121386
|
}
|
|
121306
121387
|
}
|
|
121307
121388
|
return removeAtRoot;
|
|
121308
121389
|
}
|
|
121309
|
-
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName) {
|
|
121390
|
+
function stopWatchFailedLookupLocationOfResolution(resolution, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
121310
121391
|
Debug.checkDefined(resolution.files).delete(filePath);
|
|
121311
121392
|
resolution.refCount--;
|
|
121312
121393
|
if (resolution.refCount) {
|
|
@@ -121324,13 +121405,13 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121324
121405
|
let removeAtRoot = false;
|
|
121325
121406
|
if (failedLookupLocations) {
|
|
121326
121407
|
for (const failedLookupLocation of failedLookupLocations) {
|
|
121327
|
-
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot);
|
|
121408
|
+
removeAtRoot = stopWatchFailedLookupLocation(failedLookupLocation, removeAtRoot, syncDirWatcherRemove);
|
|
121328
121409
|
}
|
|
121329
121410
|
}
|
|
121330
121411
|
if (node10Result)
|
|
121331
|
-
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot);
|
|
121412
|
+
removeAtRoot = stopWatchFailedLookupLocation(node10Result, removeAtRoot, syncDirWatcherRemove);
|
|
121332
121413
|
if (removeAtRoot)
|
|
121333
|
-
removeDirectoryWatcher(rootPath);
|
|
121414
|
+
removeDirectoryWatcher(rootPath, syncDirWatcherRemove);
|
|
121334
121415
|
} else if (affectingLocations == null ? void 0 : affectingLocations.length) {
|
|
121335
121416
|
resolutionsWithOnlyAffectingLocations.delete(resolution);
|
|
121336
121417
|
}
|
|
@@ -121338,12 +121419,16 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121338
121419
|
for (const affectingLocation of affectingLocations) {
|
|
121339
121420
|
const watcher = fileWatchesOfAffectingLocations.get(affectingLocation);
|
|
121340
121421
|
watcher.resolutions--;
|
|
121422
|
+
if (syncDirWatcherRemove)
|
|
121423
|
+
closeFileWatcherOfAffectingLocation(watcher, affectingLocation);
|
|
121341
121424
|
}
|
|
121342
121425
|
}
|
|
121343
121426
|
}
|
|
121344
|
-
function removeDirectoryWatcher(dirPath) {
|
|
121427
|
+
function removeDirectoryWatcher(dirPath, syncDirWatcherRemove) {
|
|
121345
121428
|
const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath);
|
|
121346
121429
|
dirWatcher.refCount--;
|
|
121430
|
+
if (syncDirWatcherRemove)
|
|
121431
|
+
closeDirectoryWatchesOfFailedLookup(dirWatcher, dirPath);
|
|
121347
121432
|
}
|
|
121348
121433
|
function createDirectoryWatcher(directory, dirPath, nonRecursive) {
|
|
121349
121434
|
return resolutionHost.watchDirectoryOfFailedLookupLocation(directory, (fileOrDirectory) => {
|
|
@@ -121354,10 +121439,17 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121354
121439
|
scheduleInvalidateResolutionOfFailedLookupLocation(fileOrDirectoryPath, dirPath === fileOrDirectoryPath);
|
|
121355
121440
|
}, nonRecursive ? 0 /* None */ : 1 /* Recursive */);
|
|
121356
121441
|
}
|
|
121357
|
-
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName) {
|
|
121442
|
+
function removeResolutionsOfFileFromCache(cache, filePath, getResolutionWithResolvedFileName, syncDirWatcherRemove) {
|
|
121358
121443
|
const resolutions = cache.get(filePath);
|
|
121359
121444
|
if (resolutions) {
|
|
121360
|
-
resolutions.forEach(
|
|
121445
|
+
resolutions.forEach(
|
|
121446
|
+
(resolution) => stopWatchFailedLookupLocationOfResolution(
|
|
121447
|
+
resolution,
|
|
121448
|
+
filePath,
|
|
121449
|
+
getResolutionWithResolvedFileName,
|
|
121450
|
+
syncDirWatcherRemove
|
|
121451
|
+
)
|
|
121452
|
+
);
|
|
121361
121453
|
cache.delete(filePath);
|
|
121362
121454
|
}
|
|
121363
121455
|
}
|
|
@@ -121372,9 +121464,9 @@ function createResolutionCache(resolutionHost, rootDirForResolution, logChangesW
|
|
|
121372
121464
|
return;
|
|
121373
121465
|
resolvedProjectReference.commandLine.fileNames.forEach((f) => removeResolutionsOfFile(resolutionHost.toPath(f)));
|
|
121374
121466
|
}
|
|
121375
|
-
function removeResolutionsOfFile(filePath) {
|
|
121376
|
-
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule);
|
|
121377
|
-
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective);
|
|
121467
|
+
function removeResolutionsOfFile(filePath, syncDirWatcherRemove) {
|
|
121468
|
+
removeResolutionsOfFileFromCache(resolvedModuleNames, filePath, getResolvedModule, syncDirWatcherRemove);
|
|
121469
|
+
removeResolutionsOfFileFromCache(resolvedTypeReferenceDirectives, filePath, getResolvedTypeReferenceDirective, syncDirWatcherRemove);
|
|
121378
121470
|
}
|
|
121379
121471
|
function invalidateResolutions(resolutions, canInvalidate) {
|
|
121380
121472
|
if (!resolutions)
|
|
@@ -122028,8 +122120,7 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
122028
122120
|
(fileName, encoding) => !encoding ? compilerHost.readFile(fileName) : host.readFile(fileName, encoding),
|
|
122029
122121
|
getCompilerOptions,
|
|
122030
122122
|
/*setParentNodes*/
|
|
122031
|
-
void 0
|
|
122032
|
-
host.skipNonSemanticJSDocParsing
|
|
122123
|
+
void 0
|
|
122033
122124
|
),
|
|
122034
122125
|
getDefaultLibLocation: maybeBind(host, host.getDefaultLibLocation),
|
|
122035
122126
|
getDefaultLibFileName: (options) => host.getDefaultLibFileName(options),
|
|
@@ -122051,7 +122142,8 @@ function createCompilerHostFromProgramHost(host, getCompilerOptions, directorySt
|
|
|
122051
122142
|
getEnvironmentVariable: maybeBind(host, host.getEnvironmentVariable) || (() => ""),
|
|
122052
122143
|
createHash: maybeBind(host, host.createHash),
|
|
122053
122144
|
readDirectory: maybeBind(host, host.readDirectory),
|
|
122054
|
-
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit
|
|
122145
|
+
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
|
122146
|
+
jsDocParsingMode: host.jsDocParsingMode
|
|
122055
122147
|
};
|
|
122056
122148
|
return compilerHost;
|
|
122057
122149
|
}
|
|
@@ -122215,12 +122307,11 @@ function readBuilderProgram(compilerOptions, host) {
|
|
|
122215
122307
|
return void 0;
|
|
122216
122308
|
return createBuilderProgramUsingProgramBuildInfo(buildInfo, buildInfoPath, host);
|
|
122217
122309
|
}
|
|
122218
|
-
function createIncrementalCompilerHost(options, system = sys
|
|
122310
|
+
function createIncrementalCompilerHost(options, system = sys) {
|
|
122219
122311
|
const host = createCompilerHostWorker(
|
|
122220
122312
|
options,
|
|
122221
122313
|
/*setParentNodes*/
|
|
122222
122314
|
void 0,
|
|
122223
|
-
skipNonSemanticJSDocParsing2,
|
|
122224
122315
|
system
|
|
122225
122316
|
);
|
|
122226
122317
|
host.createHash = maybeBind(system, system.createHash);
|
|
@@ -122337,7 +122428,7 @@ function createWatchProgram(host) {
|
|
|
122337
122428
|
watchConfigFileWildCardDirectories();
|
|
122338
122429
|
if (configFileName)
|
|
122339
122430
|
updateExtendedConfigFilesWatches(toPath3(configFileName), compilerOptions, watchOptions, WatchType.ExtendedConfigFile);
|
|
122340
|
-
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 };
|
|
122341
122432
|
function close() {
|
|
122342
122433
|
clearInvalidateResolutionsOfFailedLookupLocations();
|
|
122343
122434
|
resolutionCache.clear();
|
|
@@ -122377,6 +122468,9 @@ function createWatchProgram(host) {
|
|
|
122377
122468
|
parsedConfigs = void 0;
|
|
122378
122469
|
}
|
|
122379
122470
|
}
|
|
122471
|
+
function getResolutionCache() {
|
|
122472
|
+
return resolutionCache;
|
|
122473
|
+
}
|
|
122380
122474
|
function getCurrentBuilderProgram() {
|
|
122381
122475
|
return builderProgram;
|
|
122382
122476
|
}
|
|
@@ -125550,7 +125644,7 @@ function reportWatchModeWithoutSysSupport(sys2, reportDiagnostic) {
|
|
|
125550
125644
|
}
|
|
125551
125645
|
return false;
|
|
125552
125646
|
}
|
|
125553
|
-
var
|
|
125647
|
+
var defaultJSDocParsingMode = 2 /* ParseForTypeErrors */;
|
|
125554
125648
|
function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
125555
125649
|
const reportDiagnostic = updateReportDiagnostic(
|
|
125556
125650
|
sys2,
|
|
@@ -125589,7 +125683,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
|
125589
125683
|
createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
|
|
125590
125684
|
createWatchStatusReporter2(sys2, buildOptions)
|
|
125591
125685
|
);
|
|
125592
|
-
buildHost2.
|
|
125686
|
+
buildHost2.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125593
125687
|
const solutionPerformance2 = enableSolutionPerformance(sys2, buildOptions);
|
|
125594
125688
|
updateSolutionBuilderHost(sys2, cb, buildHost2, solutionPerformance2);
|
|
125595
125689
|
const onWatchStatusChange = buildHost2.onWatchStatusChange;
|
|
@@ -125614,7 +125708,7 @@ function performBuild(sys2, cb, buildOptions, watchOptions, projects, errors) {
|
|
|
125614
125708
|
createBuilderStatusReporter(sys2, shouldBePretty(sys2, buildOptions)),
|
|
125615
125709
|
createReportErrorSummary(sys2, buildOptions)
|
|
125616
125710
|
);
|
|
125617
|
-
buildHost.
|
|
125711
|
+
buildHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125618
125712
|
const solutionPerformance = enableSolutionPerformance(sys2, buildOptions);
|
|
125619
125713
|
updateSolutionBuilderHost(sys2, cb, buildHost, solutionPerformance);
|
|
125620
125714
|
const builder = createSolutionBuilder(buildHost, projects, buildOptions);
|
|
@@ -125632,9 +125726,9 @@ function performCompilation(sys2, cb, reportDiagnostic, config) {
|
|
|
125632
125726
|
options,
|
|
125633
125727
|
/*setParentNodes*/
|
|
125634
125728
|
void 0,
|
|
125635
|
-
skipNonSemanticJSDocParsing,
|
|
125636
125729
|
sys2
|
|
125637
125730
|
);
|
|
125731
|
+
host.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125638
125732
|
const currentDirectory = host.getCurrentDirectory();
|
|
125639
125733
|
const getCanonicalFileName = createGetCanonicalFileName(host.useCaseSensitiveFileNames());
|
|
125640
125734
|
changeCompilerHostLikeToUseCache(host, (fileName) => toPath(fileName, currentDirectory, getCanonicalFileName));
|
|
@@ -125675,7 +125769,8 @@ function performIncrementalCompilation2(sys2, cb, reportDiagnostic, config) {
|
|
|
125675
125769
|
/*isBuildMode*/
|
|
125676
125770
|
false
|
|
125677
125771
|
);
|
|
125678
|
-
const host = createIncrementalCompilerHost(options, sys2
|
|
125772
|
+
const host = createIncrementalCompilerHost(options, sys2);
|
|
125773
|
+
host.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125679
125774
|
const exitStatus = performIncrementalCompilation({
|
|
125680
125775
|
host,
|
|
125681
125776
|
system: sys2,
|
|
@@ -125730,7 +125825,7 @@ function updateCreateProgram(sys2, host, isBuildMode) {
|
|
|
125730
125825
|
};
|
|
125731
125826
|
}
|
|
125732
125827
|
function updateWatchCompilationHost(sys2, cb, watchCompilerHost) {
|
|
125733
|
-
watchCompilerHost.
|
|
125828
|
+
watchCompilerHost.jsDocParsingMode = defaultJSDocParsingMode;
|
|
125734
125829
|
updateCreateProgram(
|
|
125735
125830
|
sys2,
|
|
125736
125831
|
watchCompilerHost,
|