@typescript-deploys/pr-build 5.3.0-pr-54242-4 → 5.3.0-pr-55856-6
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 +1 -9
- package/lib/tsc.js +236 -266
- package/lib/tsserver.js +394 -340
- package/lib/typescript.d.ts +88 -62
- package/lib/typescript.js +391 -335
- package/lib/typingsInstaller.js +81 -136
- 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.20230925`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3312,12 +3312,9 @@ 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["
|
|
3318
|
-
SyntaxKind4[SyntaxKind4["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
|
|
3319
|
-
SyntaxKind4[SyntaxKind4["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
|
|
3320
|
-
SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 302 /* ImportTypeAttributes */] = "ImportTypeAssertionContainer";
|
|
3315
|
+
SyntaxKind4[SyntaxKind4["AssertClause"] = 300] = "AssertClause";
|
|
3316
|
+
SyntaxKind4[SyntaxKind4["AssertEntry"] = 301] = "AssertEntry";
|
|
3317
|
+
SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer";
|
|
3321
3318
|
SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
3322
3319
|
SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
3323
3320
|
SyntaxKind4[SyntaxKind4["SpreadAssignment"] = 305] = "SpreadAssignment";
|
|
@@ -5694,7 +5691,6 @@ var Diagnostics = {
|
|
|
5694
5691
|
_0_expected: diag(1005, 1 /* Error */, "_0_expected_1005", "'{0}' expected."),
|
|
5695
5692
|
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."),
|
|
5696
5693
|
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."),
|
|
5698
5694
|
Trailing_comma_not_allowed: diag(1009, 1 /* Error */, "Trailing_comma_not_allowed_1009", "Trailing comma not allowed."),
|
|
5699
5695
|
Asterisk_Slash_expected: diag(1010, 1 /* Error */, "Asterisk_Slash_expected_1010", "'*/' expected."),
|
|
5700
5696
|
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."),
|
|
@@ -6058,7 +6054,7 @@ var Diagnostics = {
|
|
|
6058
6054
|
_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."),
|
|
6059
6055
|
_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."),
|
|
6060
6056
|
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."),
|
|
6061
|
-
|
|
6057
|
+
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
|
|
6062
6058
|
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"),
|
|
6063
6059
|
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`."),
|
|
6064
6060
|
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`."),
|
|
@@ -6070,9 +6066,6 @@ var Diagnostics = {
|
|
|
6070
6066
|
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"`),
|
|
6071
6067
|
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"`),
|
|
6072
6068
|
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`."),
|
|
6076
6069
|
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."),
|
|
6077
6070
|
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."),
|
|
6078
6071
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -6099,7 +6092,6 @@ var Diagnostics = {
|
|
|
6099
6092
|
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."),
|
|
6100
6093
|
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."),
|
|
6101
6094
|
_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."),
|
|
6103
6095
|
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."),
|
|
6104
6096
|
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."),
|
|
6105
6097
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -6629,7 +6621,6 @@ var Diagnostics = {
|
|
|
6629
6621
|
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}'?"),
|
|
6630
6622
|
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'."),
|
|
6631
6623
|
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'."),
|
|
6633
6624
|
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}'?"),
|
|
6634
6625
|
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."),
|
|
6635
6626
|
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}'?"),
|
|
@@ -6638,6 +6629,7 @@ var Diagnostics = {
|
|
|
6638
6629
|
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."),
|
|
6639
6630
|
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."),
|
|
6640
6631
|
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'."),
|
|
6641
6633
|
_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?"),
|
|
6642
6634
|
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."),
|
|
6643
6635
|
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."),
|
|
@@ -6650,9 +6642,7 @@ var Diagnostics = {
|
|
|
6650
6642
|
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."),
|
|
6651
6643
|
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."),
|
|
6652
6644
|
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
|
-
|
|
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
|
+
Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super: diag(2855, 1 /* Error */, "Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super_2855", "Class field '{0}' defined by the parent class is not accessible in the child class via super."),
|
|
6656
6646
|
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}'."),
|
|
6657
6647
|
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}'."),
|
|
6658
6648
|
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}'."),
|
|
@@ -6761,6 +6751,7 @@ var Diagnostics = {
|
|
|
6761
6751
|
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}'."),
|
|
6762
6752
|
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}'?"),
|
|
6763
6753
|
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'."),
|
|
6754
|
+
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'."),
|
|
6764
6755
|
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."),
|
|
6765
6756
|
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."),
|
|
6766
6757
|
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}'."),
|
|
@@ -10695,7 +10686,7 @@ function isTypeOnlyExportDeclaration(node) {
|
|
|
10695
10686
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
10696
10687
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
10697
10688
|
}
|
|
10698
|
-
function
|
|
10689
|
+
function isAssertionKey(node) {
|
|
10699
10690
|
return isStringLiteral(node) || isIdentifier(node);
|
|
10700
10691
|
}
|
|
10701
10692
|
function isGeneratedIdentifier(node) {
|
|
@@ -10815,6 +10806,9 @@ function isAccessor(node) {
|
|
|
10815
10806
|
function isAutoAccessorPropertyDeclaration(node) {
|
|
10816
10807
|
return isPropertyDeclaration(node) && hasAccessorModifier(node);
|
|
10817
10808
|
}
|
|
10809
|
+
function isClassFieldAndNotAutoAccessor(node) {
|
|
10810
|
+
return node.parent && isClassLike(node.parent) && isPropertyDeclaration(node) && !hasAccessorModifier(node);
|
|
10811
|
+
}
|
|
10818
10812
|
function isMethodOrAccessor(node) {
|
|
10819
10813
|
switch (node.kind) {
|
|
10820
10814
|
case 174 /* MethodDeclaration */:
|
|
@@ -14745,6 +14739,9 @@ function getIndentString(level) {
|
|
|
14745
14739
|
function getIndentSize() {
|
|
14746
14740
|
return indentStrings[1].length;
|
|
14747
14741
|
}
|
|
14742
|
+
function isNightly() {
|
|
14743
|
+
return version.includes("-dev") || version.includes("-insiders");
|
|
14744
|
+
}
|
|
14748
14745
|
function createTextWriter(newLine) {
|
|
14749
14746
|
var output;
|
|
14750
14747
|
var indent2;
|
|
@@ -17461,13 +17458,6 @@ function getPropertyNameFromType(type) {
|
|
|
17461
17458
|
function isExpandoPropertyDeclaration(declaration) {
|
|
17462
17459
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
17463
17460
|
}
|
|
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
|
-
}
|
|
17471
17461
|
|
|
17472
17462
|
// src/compiler/factory/baseNodeFactory.ts
|
|
17473
17463
|
function createBaseNodeFactory() {
|
|
@@ -18339,12 +18329,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18339
18329
|
updateAssertEntry,
|
|
18340
18330
|
createImportTypeAssertionContainer,
|
|
18341
18331
|
updateImportTypeAssertionContainer,
|
|
18342
|
-
createImportTypeAttributes,
|
|
18343
|
-
updateImportTypeAttributes,
|
|
18344
|
-
createImportAttributes,
|
|
18345
|
-
updateImportAttributes,
|
|
18346
|
-
createImportAttribute,
|
|
18347
|
-
updateImportAttribute,
|
|
18348
18332
|
createNamespaceImport,
|
|
18349
18333
|
updateNamespaceImport,
|
|
18350
18334
|
createNamespaceExport,
|
|
@@ -19613,18 +19597,18 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19613
19597
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
19614
19598
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
19615
19599
|
}
|
|
19616
|
-
function createImportTypeNode(argument,
|
|
19600
|
+
function createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf = false) {
|
|
19617
19601
|
const node = createBaseNode(205 /* ImportType */);
|
|
19618
19602
|
node.argument = argument;
|
|
19619
|
-
node.
|
|
19603
|
+
node.assertions = assertions;
|
|
19620
19604
|
node.qualifier = qualifier;
|
|
19621
19605
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
19622
19606
|
node.isTypeOf = isTypeOf;
|
|
19623
19607
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
19624
19608
|
return node;
|
|
19625
19609
|
}
|
|
19626
|
-
function updateImportTypeNode(node, argument,
|
|
19627
|
-
return node.argument !== argument || node.
|
|
19610
|
+
function updateImportTypeNode(node, argument, assertions, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
|
|
19611
|
+
return node.argument !== argument || node.assertions !== assertions || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, assertions, qualifier, typeArguments, isTypeOf), node) : node;
|
|
19628
19612
|
}
|
|
19629
19613
|
function createParenthesizedType(type) {
|
|
19630
19614
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -20754,19 +20738,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20754
20738
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
20755
20739
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
20756
20740
|
}
|
|
20757
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
20741
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause) {
|
|
20758
20742
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
20759
20743
|
node.modifiers = asNodeArray(modifiers);
|
|
20760
20744
|
node.importClause = importClause;
|
|
20761
20745
|
node.moduleSpecifier = moduleSpecifier;
|
|
20762
|
-
node.
|
|
20746
|
+
node.assertClause = assertClause;
|
|
20763
20747
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
20764
20748
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
20765
20749
|
node.jsDoc = void 0;
|
|
20766
20750
|
return node;
|
|
20767
20751
|
}
|
|
20768
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
20769
|
-
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
20752
|
+
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, assertClause) {
|
|
20753
|
+
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause), node) : node;
|
|
20770
20754
|
}
|
|
20771
20755
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
20772
20756
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -20787,7 +20771,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20787
20771
|
const node = createBaseNode(300 /* AssertClause */);
|
|
20788
20772
|
node.elements = createNodeArray(elements);
|
|
20789
20773
|
node.multiLine = multiLine;
|
|
20790
|
-
node.token = 132 /* AssertKeyword */;
|
|
20791
20774
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
20792
20775
|
return node;
|
|
20793
20776
|
}
|
|
@@ -20813,36 +20796,6 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20813
20796
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
20814
20797
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
20815
20798
|
}
|
|
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
|
-
}
|
|
20846
20799
|
function createNamespaceImport(name) {
|
|
20847
20800
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
20848
20801
|
node.name = name;
|
|
@@ -20903,20 +20856,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20903
20856
|
function updateExportAssignment(node, modifiers, expression) {
|
|
20904
20857
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node;
|
|
20905
20858
|
}
|
|
20906
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
20859
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
|
|
20907
20860
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
20908
20861
|
node.modifiers = asNodeArray(modifiers);
|
|
20909
20862
|
node.isTypeOnly = isTypeOnly;
|
|
20910
20863
|
node.exportClause = exportClause;
|
|
20911
20864
|
node.moduleSpecifier = moduleSpecifier;
|
|
20912
|
-
node.
|
|
20865
|
+
node.assertClause = assertClause;
|
|
20913
20866
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
20914
20867
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
20915
20868
|
node.jsDoc = void 0;
|
|
20916
20869
|
return node;
|
|
20917
20870
|
}
|
|
20918
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
20919
|
-
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
20871
|
+
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause) {
|
|
20872
|
+
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.assertClause !== assertClause ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause), node) : node;
|
|
20920
20873
|
}
|
|
20921
20874
|
function finishUpdateExportDeclaration(updated, original) {
|
|
20922
20875
|
if (updated !== original) {
|
|
@@ -22243,7 +22196,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22243
22196
|
} else {
|
|
22244
22197
|
modifierArray = modifiers;
|
|
22245
22198
|
}
|
|
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.
|
|
22199
|
+
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.assertClause) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.assertClause) : Debug.assertNever(node);
|
|
22247
22200
|
}
|
|
22248
22201
|
function updateModifierLike(node, modifierArray) {
|
|
22249
22202
|
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);
|
|
@@ -24467,14 +24420,14 @@ function isImportDeclaration(node) {
|
|
|
24467
24420
|
function isImportClause(node) {
|
|
24468
24421
|
return node.kind === 273 /* ImportClause */;
|
|
24469
24422
|
}
|
|
24470
|
-
function
|
|
24471
|
-
return node.kind === 302 /*
|
|
24423
|
+
function isImportTypeAssertionContainer(node) {
|
|
24424
|
+
return node.kind === 302 /* ImportTypeAssertionContainer */;
|
|
24472
24425
|
}
|
|
24473
|
-
function
|
|
24474
|
-
return node.kind === 300 /*
|
|
24426
|
+
function isAssertClause(node) {
|
|
24427
|
+
return node.kind === 300 /* AssertClause */;
|
|
24475
24428
|
}
|
|
24476
|
-
function
|
|
24477
|
-
return node.kind === 301 /*
|
|
24429
|
+
function isAssertEntry(node) {
|
|
24430
|
+
return node.kind === 301 /* AssertEntry */;
|
|
24478
24431
|
}
|
|
24479
24432
|
function isNamespaceImport(node) {
|
|
24480
24433
|
return node.kind === 274 /* NamespaceImport */;
|
|
@@ -25150,7 +25103,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
25150
25103
|
namedBindings
|
|
25151
25104
|
),
|
|
25152
25105
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
25153
|
-
/*
|
|
25106
|
+
/*assertClause*/
|
|
25154
25107
|
void 0
|
|
25155
25108
|
);
|
|
25156
25109
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -25904,10 +25857,10 @@ var forEachChildTable = {
|
|
|
25904
25857
|
return visitNode2(cbNode, node.typeParameter);
|
|
25905
25858
|
},
|
|
25906
25859
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
25907
|
-
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.
|
|
25860
|
+
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.assertions) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
25908
25861
|
},
|
|
25909
|
-
[302 /*
|
|
25910
|
-
return visitNode2(cbNode, node.
|
|
25862
|
+
[302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
|
|
25863
|
+
return visitNode2(cbNode, node.assertClause);
|
|
25911
25864
|
},
|
|
25912
25865
|
[196 /* ParenthesizedType */]: forEachChildInParenthesizedTypeOrTypeOperator,
|
|
25913
25866
|
[198 /* TypeOperator */]: forEachChildInParenthesizedTypeOrTypeOperator,
|
|
@@ -26078,15 +26031,15 @@ var forEachChildTable = {
|
|
|
26078
26031
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
26079
26032
|
},
|
|
26080
26033
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
26081
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
26034
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
|
|
26082
26035
|
},
|
|
26083
26036
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
26084
26037
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
26085
26038
|
},
|
|
26086
|
-
[300 /*
|
|
26039
|
+
[300 /* AssertClause */]: function forEachChildInAssertClause(node, cbNode, cbNodes) {
|
|
26087
26040
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
26088
26041
|
},
|
|
26089
|
-
[301 /*
|
|
26042
|
+
[301 /* AssertEntry */]: function forEachChildInAssertEntry(node, cbNode, _cbNodes) {
|
|
26090
26043
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
26091
26044
|
},
|
|
26092
26045
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -26101,7 +26054,7 @@ var forEachChildTable = {
|
|
|
26101
26054
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
26102
26055
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
26103
26056
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
26104
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
26057
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.assertClause);
|
|
26105
26058
|
},
|
|
26106
26059
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
26107
26060
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -27366,7 +27319,7 @@ var Parser;
|
|
|
27366
27319
|
function isLiteralPropertyName() {
|
|
27367
27320
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
27368
27321
|
}
|
|
27369
|
-
function
|
|
27322
|
+
function isAssertionKey2() {
|
|
27370
27323
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
27371
27324
|
}
|
|
27372
27325
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -27485,8 +27438,8 @@ var Parser;
|
|
|
27485
27438
|
return isLiteralPropertyName();
|
|
27486
27439
|
case 9 /* ObjectBindingElements */:
|
|
27487
27440
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
27488
|
-
case 24 /*
|
|
27489
|
-
return
|
|
27441
|
+
case 24 /* AssertEntries */:
|
|
27442
|
+
return isAssertionKey2();
|
|
27490
27443
|
case 7 /* HeritageClauseElement */:
|
|
27491
27444
|
if (token() === 19 /* OpenBraceToken */) {
|
|
27492
27445
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -27589,7 +27542,7 @@ var Parser;
|
|
|
27589
27542
|
case 12 /* ObjectLiteralMembers */:
|
|
27590
27543
|
case 9 /* ObjectBindingElements */:
|
|
27591
27544
|
case 23 /* ImportOrExportSpecifiers */:
|
|
27592
|
-
case 24 /*
|
|
27545
|
+
case 24 /* AssertEntries */:
|
|
27593
27546
|
return token() === 20 /* CloseBraceToken */;
|
|
27594
27547
|
case 3 /* SwitchClauseStatements */:
|
|
27595
27548
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -27895,7 +27848,7 @@ var Parser;
|
|
|
27895
27848
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27896
27849
|
case 14 /* JsxChildren */:
|
|
27897
27850
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27898
|
-
case 24 /*
|
|
27851
|
+
case 24 /* AssertEntries */:
|
|
27899
27852
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
27900
27853
|
case 25 /* JSDocComment */:
|
|
27901
27854
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -28770,22 +28723,16 @@ var Parser;
|
|
|
28770
28723
|
nextToken();
|
|
28771
28724
|
return token() === 102 /* ImportKeyword */;
|
|
28772
28725
|
}
|
|
28773
|
-
function
|
|
28726
|
+
function parseImportTypeAssertions() {
|
|
28774
28727
|
const pos = getNodePos();
|
|
28775
28728
|
const openBracePosition = scanner.getTokenStart();
|
|
28776
28729
|
parseExpected(19 /* OpenBraceToken */);
|
|
28777
28730
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
28778
|
-
|
|
28779
|
-
if (currentToken2 !== 118 /* WithKeyword */ && currentToken2 !== 132 /* AssertKeyword */) {
|
|
28780
|
-
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
|
|
28781
|
-
} else {
|
|
28782
|
-
nextToken();
|
|
28783
|
-
}
|
|
28731
|
+
parseExpected(132 /* AssertKeyword */);
|
|
28784
28732
|
parseExpected(59 /* ColonToken */);
|
|
28785
|
-
const
|
|
28786
|
-
|
|
28787
|
-
|
|
28788
|
-
false
|
|
28733
|
+
const clause = parseAssertClause(
|
|
28734
|
+
/*skipAssertKeyword*/
|
|
28735
|
+
true
|
|
28789
28736
|
);
|
|
28790
28737
|
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
28791
28738
|
const lastError = lastOrUndefined(parseDiagnostics);
|
|
@@ -28796,7 +28743,7 @@ var Parser;
|
|
|
28796
28743
|
);
|
|
28797
28744
|
}
|
|
28798
28745
|
}
|
|
28799
|
-
return finishNode(factory2.
|
|
28746
|
+
return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
28800
28747
|
}
|
|
28801
28748
|
function parseImportType() {
|
|
28802
28749
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
@@ -28805,14 +28752,14 @@ var Parser;
|
|
|
28805
28752
|
parseExpected(102 /* ImportKeyword */);
|
|
28806
28753
|
parseExpected(21 /* OpenParenToken */);
|
|
28807
28754
|
const type = parseType();
|
|
28808
|
-
let
|
|
28755
|
+
let assertions;
|
|
28809
28756
|
if (parseOptional(28 /* CommaToken */)) {
|
|
28810
|
-
|
|
28757
|
+
assertions = parseImportTypeAssertions();
|
|
28811
28758
|
}
|
|
28812
28759
|
parseExpected(22 /* CloseParenToken */);
|
|
28813
28760
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
28814
28761
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
28815
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
28762
|
+
return finishNode(factory2.createImportTypeNode(type, assertions, qualifier, typeArguments, isTypeOf), pos);
|
|
28816
28763
|
}
|
|
28817
28764
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
28818
28765
|
nextToken();
|
|
@@ -31874,16 +31821,15 @@ var Parser;
|
|
|
31874
31821
|
parseExpected(161 /* FromKeyword */);
|
|
31875
31822
|
}
|
|
31876
31823
|
const moduleSpecifier = parseModuleSpecifier();
|
|
31877
|
-
|
|
31878
|
-
|
|
31879
|
-
|
|
31880
|
-
attributes = parseImportAttributes(currentToken2);
|
|
31824
|
+
let assertClause;
|
|
31825
|
+
if (token() === 132 /* AssertKeyword */ && !scanner.hasPrecedingLineBreak()) {
|
|
31826
|
+
assertClause = parseAssertClause();
|
|
31881
31827
|
}
|
|
31882
31828
|
parseSemicolon();
|
|
31883
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
31829
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, assertClause);
|
|
31884
31830
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31885
31831
|
}
|
|
31886
|
-
function
|
|
31832
|
+
function parseAssertEntry() {
|
|
31887
31833
|
const pos = getNodePos();
|
|
31888
31834
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
31889
31835
|
parseExpected(59 /* ColonToken */);
|
|
@@ -31891,19 +31837,19 @@ var Parser;
|
|
|
31891
31837
|
/*allowReturnTypeInArrowFunction*/
|
|
31892
31838
|
true
|
|
31893
31839
|
);
|
|
31894
|
-
return finishNode(factory2.
|
|
31840
|
+
return finishNode(factory2.createAssertEntry(name, value), pos);
|
|
31895
31841
|
}
|
|
31896
|
-
function
|
|
31842
|
+
function parseAssertClause(skipAssertKeyword) {
|
|
31897
31843
|
const pos = getNodePos();
|
|
31898
|
-
if (
|
|
31899
|
-
|
|
31844
|
+
if (!skipAssertKeyword) {
|
|
31845
|
+
parseExpected(132 /* AssertKeyword */);
|
|
31900
31846
|
}
|
|
31901
31847
|
const openBracePosition = scanner.getTokenStart();
|
|
31902
31848
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
31903
31849
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
31904
31850
|
const elements = parseDelimitedList(
|
|
31905
|
-
24 /*
|
|
31906
|
-
|
|
31851
|
+
24 /* AssertEntries */,
|
|
31852
|
+
parseAssertEntry,
|
|
31907
31853
|
/*considerSemicolonAsDelimiter*/
|
|
31908
31854
|
true
|
|
31909
31855
|
);
|
|
@@ -31916,7 +31862,7 @@ var Parser;
|
|
|
31916
31862
|
);
|
|
31917
31863
|
}
|
|
31918
31864
|
}
|
|
31919
|
-
return finishNode(factory2.
|
|
31865
|
+
return finishNode(factory2.createAssertClause(elements, multiLine), pos);
|
|
31920
31866
|
} else {
|
|
31921
31867
|
const elements = createNodeArray(
|
|
31922
31868
|
[],
|
|
@@ -31926,11 +31872,10 @@ var Parser;
|
|
|
31926
31872
|
/*hasTrailingComma*/
|
|
31927
31873
|
false
|
|
31928
31874
|
);
|
|
31929
|
-
return finishNode(factory2.
|
|
31875
|
+
return finishNode(factory2.createAssertClause(
|
|
31930
31876
|
elements,
|
|
31931
31877
|
/*multiLine*/
|
|
31932
|
-
false
|
|
31933
|
-
token2
|
|
31878
|
+
false
|
|
31934
31879
|
), pos);
|
|
31935
31880
|
}
|
|
31936
31881
|
}
|
|
@@ -32062,7 +32007,7 @@ var Parser;
|
|
|
32062
32007
|
);
|
|
32063
32008
|
let exportClause;
|
|
32064
32009
|
let moduleSpecifier;
|
|
32065
|
-
let
|
|
32010
|
+
let assertClause;
|
|
32066
32011
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
32067
32012
|
const namespaceExportPos = getNodePos();
|
|
32068
32013
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -32078,13 +32023,12 @@ var Parser;
|
|
|
32078
32023
|
moduleSpecifier = parseModuleSpecifier();
|
|
32079
32024
|
}
|
|
32080
32025
|
}
|
|
32081
|
-
|
|
32082
|
-
|
|
32083
|
-
attributes = parseImportAttributes(currentToken2);
|
|
32026
|
+
if (moduleSpecifier && token() === 132 /* AssertKeyword */ && !scanner.hasPrecedingLineBreak()) {
|
|
32027
|
+
assertClause = parseAssertClause();
|
|
32084
32028
|
}
|
|
32085
32029
|
parseSemicolon();
|
|
32086
32030
|
setAwaitContext(savedAwaitContext);
|
|
32087
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
32031
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, assertClause);
|
|
32088
32032
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
32089
32033
|
}
|
|
32090
32034
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -32134,7 +32078,7 @@ var Parser;
|
|
|
32134
32078
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
32135
32079
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
32136
32080
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
32137
|
-
ParsingContext2[ParsingContext2["
|
|
32081
|
+
ParsingContext2[ParsingContext2["AssertEntries"] = 24] = "AssertEntries";
|
|
32138
32082
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
32139
32083
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
32140
32084
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -46358,7 +46302,7 @@ function createTypeChecker(host) {
|
|
|
46358
46302
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
46359
46303
|
}
|
|
46360
46304
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
46361
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
46305
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
|
46362
46306
|
if (startsWith(moduleReference, "@types/")) {
|
|
46363
46307
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
46364
46308
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -46413,8 +46357,9 @@ function createTypeChecker(host) {
|
|
|
46413
46357
|
}
|
|
46414
46358
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
46415
46359
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
46416
|
-
const
|
|
46417
|
-
|
|
46360
|
+
const overrideClauseHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
46361
|
+
const overrideClause = overrideClauseHost && isImportTypeNode(overrideClauseHost) ? (_j = overrideClauseHost.assertions) == null ? void 0 : _j.assertClause : overrideClauseHost == null ? void 0 : overrideClauseHost.assertClause;
|
|
46362
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
46418
46363
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
46419
46364
|
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);
|
|
46420
46365
|
} else {
|
|
@@ -46520,7 +46465,7 @@ function createTypeChecker(host) {
|
|
|
46520
46465
|
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
46521
46466
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
46522
46467
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
46523
|
-
const suggestedExt = (
|
|
46468
|
+
const suggestedExt = (_k = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _k[1];
|
|
46524
46469
|
if (suggestedExt) {
|
|
46525
46470
|
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);
|
|
46526
46471
|
} else {
|
|
@@ -48285,7 +48230,7 @@ function createTypeChecker(host) {
|
|
|
48285
48230
|
return factory.updateImportTypeNode(
|
|
48286
48231
|
root,
|
|
48287
48232
|
root.argument,
|
|
48288
|
-
root.
|
|
48233
|
+
root.assertions,
|
|
48289
48234
|
qualifier,
|
|
48290
48235
|
typeArguments,
|
|
48291
48236
|
root.isTypeOf
|
|
@@ -49018,6 +48963,7 @@ function createTypeChecker(host) {
|
|
|
49018
48963
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
49019
48964
|
}
|
|
49020
48965
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
48966
|
+
var _a, _b, _c, _d;
|
|
49021
48967
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
49022
48968
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
49023
48969
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -49026,18 +48972,17 @@ function createTypeChecker(host) {
|
|
|
49026
48972
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
49027
48973
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
49028
48974
|
let specifier;
|
|
49029
|
-
let
|
|
48975
|
+
let assertion;
|
|
49030
48976
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
49031
48977
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
49032
48978
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
49033
|
-
|
|
49034
|
-
factory.
|
|
49035
|
-
factory.
|
|
49036
|
-
|
|
49037
|
-
|
|
49038
|
-
|
|
49039
|
-
|
|
49040
|
-
));
|
|
48979
|
+
assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
|
|
48980
|
+
factory.createAssertEntry(
|
|
48981
|
+
factory.createStringLiteral("resolution-mode"),
|
|
48982
|
+
factory.createStringLiteral("import")
|
|
48983
|
+
)
|
|
48984
|
+
])));
|
|
48985
|
+
(_b = (_a = context.tracker).reportImportTypeNodeResolutionModeOverride) == null ? void 0 : _b.call(_a);
|
|
49041
48986
|
}
|
|
49042
48987
|
}
|
|
49043
48988
|
if (!specifier) {
|
|
@@ -49051,17 +48996,16 @@ function createTypeChecker(host) {
|
|
|
49051
48996
|
if (specifier.includes("/node_modules/")) {
|
|
49052
48997
|
specifier = oldSpecifier;
|
|
49053
48998
|
} else {
|
|
49054
|
-
|
|
49055
|
-
factory.
|
|
49056
|
-
factory.
|
|
49057
|
-
|
|
49058
|
-
|
|
49059
|
-
|
|
49060
|
-
|
|
49061
|
-
));
|
|
48999
|
+
assertion = factory.createImportTypeAssertionContainer(factory.createAssertClause(factory.createNodeArray([
|
|
49000
|
+
factory.createAssertEntry(
|
|
49001
|
+
factory.createStringLiteral("resolution-mode"),
|
|
49002
|
+
factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
|
|
49003
|
+
)
|
|
49004
|
+
])));
|
|
49005
|
+
(_d = (_c = context.tracker).reportImportTypeNodeResolutionModeOverride) == null ? void 0 : _d.call(_c);
|
|
49062
49006
|
}
|
|
49063
49007
|
}
|
|
49064
|
-
if (!
|
|
49008
|
+
if (!assertion) {
|
|
49065
49009
|
context.encounteredError = true;
|
|
49066
49010
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
49067
49011
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -49081,11 +49025,11 @@ function createTypeChecker(host) {
|
|
|
49081
49025
|
void 0
|
|
49082
49026
|
);
|
|
49083
49027
|
}
|
|
49084
|
-
return factory.createImportTypeNode(lit,
|
|
49028
|
+
return factory.createImportTypeNode(lit, assertion, nonRootParts, typeParameterNodes, isTypeOf);
|
|
49085
49029
|
} else {
|
|
49086
49030
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
49087
49031
|
const qualifier = splitNode.objectType.typeName;
|
|
49088
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
49032
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, assertion, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
49089
49033
|
}
|
|
49090
49034
|
}
|
|
49091
49035
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -49561,7 +49505,7 @@ function createTypeChecker(host) {
|
|
|
49561
49505
|
return factory.updateImportTypeNode(
|
|
49562
49506
|
node,
|
|
49563
49507
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
49564
|
-
node.
|
|
49508
|
+
node.assertions,
|
|
49565
49509
|
node.qualifier,
|
|
49566
49510
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
49567
49511
|
node.isTypeOf
|
|
@@ -49781,7 +49725,7 @@ function createTypeChecker(host) {
|
|
|
49781
49725
|
return statements;
|
|
49782
49726
|
}
|
|
49783
49727
|
function inlineExportModifiers(statements) {
|
|
49784
|
-
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.
|
|
49728
|
+
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.assertClause && !!d.exportClause && isNamedExports(d.exportClause));
|
|
49785
49729
|
if (index >= 0) {
|
|
49786
49730
|
const exportDecl = statements[index];
|
|
49787
49731
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -49809,7 +49753,7 @@ function createTypeChecker(host) {
|
|
|
49809
49753
|
replacements
|
|
49810
49754
|
),
|
|
49811
49755
|
exportDecl.moduleSpecifier,
|
|
49812
|
-
exportDecl.
|
|
49756
|
+
exportDecl.assertClause
|
|
49813
49757
|
);
|
|
49814
49758
|
}
|
|
49815
49759
|
}
|
|
@@ -50460,7 +50404,7 @@ function createTypeChecker(host) {
|
|
|
50460
50404
|
)])
|
|
50461
50405
|
),
|
|
50462
50406
|
factory.createStringLiteral(specifier2),
|
|
50463
|
-
/*
|
|
50407
|
+
/*assertClause*/
|
|
50464
50408
|
void 0
|
|
50465
50409
|
),
|
|
50466
50410
|
0 /* None */
|
|
@@ -50548,7 +50492,7 @@ function createTypeChecker(host) {
|
|
|
50548
50492
|
void 0
|
|
50549
50493
|
),
|
|
50550
50494
|
specifier2,
|
|
50551
|
-
node.parent.
|
|
50495
|
+
node.parent.assertClause
|
|
50552
50496
|
),
|
|
50553
50497
|
0 /* None */
|
|
50554
50498
|
);
|
|
@@ -50569,7 +50513,7 @@ function createTypeChecker(host) {
|
|
|
50569
50513
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
50570
50514
|
),
|
|
50571
50515
|
specifier2,
|
|
50572
|
-
node.parent.
|
|
50516
|
+
node.parent.parent.assertClause
|
|
50573
50517
|
),
|
|
50574
50518
|
0 /* None */
|
|
50575
50519
|
);
|
|
@@ -50610,7 +50554,7 @@ function createTypeChecker(host) {
|
|
|
50610
50554
|
])
|
|
50611
50555
|
),
|
|
50612
50556
|
specifier2,
|
|
50613
|
-
node.parent.parent.parent.
|
|
50557
|
+
node.parent.parent.parent.assertClause
|
|
50614
50558
|
),
|
|
50615
50559
|
0 /* None */
|
|
50616
50560
|
);
|
|
@@ -57682,7 +57626,7 @@ function createTypeChecker(host) {
|
|
|
57682
57626
|
return !!(type.flags & (1 /* Any */ | 4 /* String */ | 8 /* Number */ | 64 /* BigInt */)) || isPatternLiteralType(type);
|
|
57683
57627
|
}
|
|
57684
57628
|
function isPatternLiteralType(type) {
|
|
57685
|
-
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) &&
|
|
57629
|
+
return !!(type.flags & 134217728 /* TemplateLiteral */) && every(type.types, isPatternLiteralPlaceholderType) || !!(type.flags & 268435456 /* StringMapping */) && everyContainedType(type.type, isPatternLiteralPlaceholderType);
|
|
57686
57630
|
}
|
|
57687
57631
|
function isGenericType(type) {
|
|
57688
57632
|
return !!getGenericObjectFlags(type);
|
|
@@ -69195,6 +69139,7 @@ function createTypeChecker(host) {
|
|
|
69195
69139
|
return checkPropertyAccessibilityAtLocation(node, isSuper, writing, type, prop, errorNode);
|
|
69196
69140
|
}
|
|
69197
69141
|
function checkPropertyAccessibilityAtLocation(location, isSuper, writing, containingType, prop, errorNode) {
|
|
69142
|
+
var _a;
|
|
69198
69143
|
const flags = getDeclarationModifierFlagsFromSymbol(prop, writing);
|
|
69199
69144
|
if (isSuper) {
|
|
69200
69145
|
if (languageVersion < 2 /* ES2015 */) {
|
|
@@ -69211,6 +69156,12 @@ function createTypeChecker(host) {
|
|
|
69211
69156
|
}
|
|
69212
69157
|
return false;
|
|
69213
69158
|
}
|
|
69159
|
+
if (!(flags & 32 /* Static */) && ((_a = prop.declarations) == null ? void 0 : _a.some(isClassFieldAndNotAutoAccessor))) {
|
|
69160
|
+
if (errorNode) {
|
|
69161
|
+
error(errorNode, Diagnostics.Class_field_0_defined_by_the_parent_class_is_not_accessible_in_the_child_class_via_super, symbolToString(prop));
|
|
69162
|
+
}
|
|
69163
|
+
return false;
|
|
69164
|
+
}
|
|
69214
69165
|
}
|
|
69215
69166
|
if (flags & 256 /* Abstract */ && symbolHasNonMethodDeclaration(prop) && (isThisProperty(location) || isThisInitializedObjectBindingExpression(location) || isObjectBindingPattern(location.parent) && isThisInitializedDeclaration(location.parent.parent))) {
|
|
69216
69167
|
const declaringClassDeclaration = getClassLikeDeclarationOfSymbol(getParentOfSymbol(prop));
|
|
@@ -69616,11 +69567,17 @@ function createTypeChecker(host) {
|
|
|
69616
69567
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
69617
69568
|
}
|
|
69618
69569
|
function isUncheckedJSSuggestion(node, suggestion, excludeClasses) {
|
|
69570
|
+
var _a;
|
|
69619
69571
|
const file = getSourceFileOfNode(node);
|
|
69620
69572
|
if (file) {
|
|
69621
69573
|
if (compilerOptions.checkJs === void 0 && file.checkJsDirective === void 0 && (file.scriptKind === 1 /* JS */ || file.scriptKind === 2 /* JSX */)) {
|
|
69622
69574
|
const declarationFile = forEach(suggestion == null ? void 0 : suggestion.declarations, getSourceFileOfNode);
|
|
69623
|
-
|
|
69575
|
+
const suggestionHasNoExtendsOrDecorators = !(suggestion == null ? void 0 : suggestion.valueDeclaration) || !isClassLike(suggestion.valueDeclaration) || ((_a = suggestion.valueDeclaration.heritageClauses) == null ? void 0 : _a.length) || classOrConstructorParameterIsDecorated(
|
|
69576
|
+
/*useLegacyDecorators*/
|
|
69577
|
+
false,
|
|
69578
|
+
suggestion.valueDeclaration
|
|
69579
|
+
);
|
|
69580
|
+
return !(file !== declarationFile && !!declarationFile && isGlobalSourceFile(declarationFile)) && !(excludeClasses && suggestion && suggestion.flags & 32 /* Class */ && suggestionHasNoExtendsOrDecorators) && !(!!node && excludeClasses && isPropertyAccessExpression(node) && node.expression.kind === 110 /* ThisKeyword */ && suggestionHasNoExtendsOrDecorators);
|
|
69624
69581
|
}
|
|
69625
69582
|
}
|
|
69626
69583
|
return false;
|
|
@@ -75848,16 +75805,16 @@ function createTypeChecker(host) {
|
|
|
75848
75805
|
getTypeFromTypeNode(node);
|
|
75849
75806
|
}
|
|
75850
75807
|
function checkImportType(node) {
|
|
75851
|
-
var _a, _b;
|
|
75852
75808
|
checkSourceElement(node.argument);
|
|
75853
|
-
if (node.
|
|
75854
|
-
const override =
|
|
75855
|
-
|
|
75856
|
-
|
|
75857
|
-
|
|
75858
|
-
|
|
75859
|
-
|
|
75860
|
-
|
|
75809
|
+
if (node.assertions) {
|
|
75810
|
+
const override = getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
|
|
75811
|
+
if (override) {
|
|
75812
|
+
if (!isNightly()) {
|
|
75813
|
+
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
|
|
75814
|
+
}
|
|
75815
|
+
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
75816
|
+
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
75817
|
+
}
|
|
75861
75818
|
}
|
|
75862
75819
|
}
|
|
75863
75820
|
checkTypeReferenceOrImport(node);
|
|
@@ -79822,13 +79779,12 @@ function createTypeChecker(host) {
|
|
|
79822
79779
|
return false;
|
|
79823
79780
|
}
|
|
79824
79781
|
}
|
|
79825
|
-
if (!isImportEqualsDeclaration(node) && node.
|
|
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;
|
|
79782
|
+
if (!isImportEqualsDeclaration(node) && node.assertClause) {
|
|
79827
79783
|
let hasError = false;
|
|
79828
|
-
for (const
|
|
79829
|
-
if (!isStringLiteral(
|
|
79784
|
+
for (const clause of node.assertClause.elements) {
|
|
79785
|
+
if (!isStringLiteral(clause.value)) {
|
|
79830
79786
|
hasError = true;
|
|
79831
|
-
error(
|
|
79787
|
+
error(clause.value, Diagnostics.Import_assertion_values_must_be_string_literal_expressions);
|
|
79832
79788
|
}
|
|
79833
79789
|
}
|
|
79834
79790
|
return !hasError;
|
|
@@ -79960,35 +79916,32 @@ function createTypeChecker(host) {
|
|
|
79960
79916
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
79961
79917
|
}
|
|
79962
79918
|
}
|
|
79963
|
-
function
|
|
79919
|
+
function checkAssertClause(declaration) {
|
|
79964
79920
|
var _a;
|
|
79965
|
-
if (declaration.
|
|
79966
|
-
|
|
79967
|
-
|
|
79968
|
-
|
|
79969
|
-
|
|
79970
|
-
|
|
79971
|
-
|
|
79972
|
-
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
79973
|
-
if (validForTypeAttributes && override) {
|
|
79921
|
+
if (declaration.assertClause) {
|
|
79922
|
+
const validForTypeAssertions = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
79923
|
+
const override = getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : void 0);
|
|
79924
|
+
if (validForTypeAssertions && override) {
|
|
79925
|
+
if (!isNightly()) {
|
|
79926
|
+
grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_unstable_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next);
|
|
79927
|
+
}
|
|
79974
79928
|
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
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
|
-
);
|
|
79929
|
+
return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
79979
79930
|
}
|
|
79980
79931
|
return;
|
|
79981
79932
|
}
|
|
79982
79933
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
79983
79934
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
79984
|
-
|
|
79985
|
-
|
|
79935
|
+
return grammarErrorOnNode(
|
|
79936
|
+
declaration.assertClause,
|
|
79937
|
+
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
|
|
79938
|
+
);
|
|
79986
79939
|
}
|
|
79987
79940
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
79988
|
-
return grammarErrorOnNode(
|
|
79941
|
+
return grammarErrorOnNode(declaration.assertClause, Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
79989
79942
|
}
|
|
79990
79943
|
if (override) {
|
|
79991
|
-
return grammarErrorOnNode(
|
|
79944
|
+
return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
79992
79945
|
}
|
|
79993
79946
|
}
|
|
79994
79947
|
}
|
|
@@ -80020,7 +79973,7 @@ function createTypeChecker(host) {
|
|
|
80020
79973
|
}
|
|
80021
79974
|
}
|
|
80022
79975
|
}
|
|
80023
|
-
|
|
79976
|
+
checkAssertClause(node);
|
|
80024
79977
|
}
|
|
80025
79978
|
function checkImportEqualsDeclaration(node) {
|
|
80026
79979
|
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)) {
|
|
@@ -80093,7 +80046,7 @@ function createTypeChecker(host) {
|
|
|
80093
80046
|
}
|
|
80094
80047
|
}
|
|
80095
80048
|
}
|
|
80096
|
-
|
|
80049
|
+
checkAssertClause(node);
|
|
80097
80050
|
}
|
|
80098
80051
|
function checkGrammarExportDeclaration(node) {
|
|
80099
80052
|
var _a;
|
|
@@ -83883,12 +83836,12 @@ function createTypeChecker(host) {
|
|
|
83883
83836
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
83884
83837
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
83885
83838
|
if (nodeArguments.length > 1) {
|
|
83886
|
-
const
|
|
83887
|
-
return grammarErrorOnNode(
|
|
83839
|
+
const assertionArgument = nodeArguments[1];
|
|
83840
|
+
return grammarErrorOnNode(assertionArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
83888
83841
|
}
|
|
83889
83842
|
}
|
|
83890
83843
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
83891
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
83844
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments);
|
|
83892
83845
|
}
|
|
83893
83846
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
83894
83847
|
if (spreadElement) {
|
|
@@ -84155,6 +84108,13 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
84155
84108
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
84156
84109
|
}
|
|
84157
84110
|
}
|
|
84111
|
+
reportImportTypeNodeResolutionModeOverride() {
|
|
84112
|
+
var _a;
|
|
84113
|
+
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
84114
|
+
this.onDiagnosticReported();
|
|
84115
|
+
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
84116
|
+
}
|
|
84117
|
+
}
|
|
84158
84118
|
onDiagnosticReported() {
|
|
84159
84119
|
this.context.reportedDiagnostic = true;
|
|
84160
84120
|
}
|
|
@@ -84663,16 +84623,16 @@ var visitEachChildTable = {
|
|
|
84663
84623
|
return context.factory.updateImportTypeNode(
|
|
84664
84624
|
node,
|
|
84665
84625
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
84666
|
-
nodeVisitor(node.
|
|
84626
|
+
nodeVisitor(node.assertions, visitor, isImportTypeAssertionContainer),
|
|
84667
84627
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
84668
84628
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
84669
84629
|
node.isTypeOf
|
|
84670
84630
|
);
|
|
84671
84631
|
},
|
|
84672
|
-
[302 /*
|
|
84673
|
-
return context.factory.
|
|
84632
|
+
[302 /* ImportTypeAssertionContainer */]: function visitEachChildOfImportTypeAssertionContainer(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
84633
|
+
return context.factory.updateImportTypeAssertionContainer(
|
|
84674
84634
|
node,
|
|
84675
|
-
Debug.checkDefined(nodeVisitor(node.
|
|
84635
|
+
Debug.checkDefined(nodeVisitor(node.assertClause, visitor, isAssertClause)),
|
|
84676
84636
|
node.multiLine
|
|
84677
84637
|
);
|
|
84678
84638
|
},
|
|
@@ -85214,20 +85174,20 @@ var visitEachChildTable = {
|
|
|
85214
85174
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
85215
85175
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
85216
85176
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
85217
|
-
nodeVisitor(node.
|
|
85177
|
+
nodeVisitor(node.assertClause, visitor, isAssertClause)
|
|
85218
85178
|
);
|
|
85219
85179
|
},
|
|
85220
|
-
[300 /*
|
|
85221
|
-
return context.factory.
|
|
85180
|
+
[300 /* AssertClause */]: function visitEachChildOfAssertClause(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
85181
|
+
return context.factory.updateAssertClause(
|
|
85222
85182
|
node,
|
|
85223
|
-
nodesVisitor(node.elements, visitor,
|
|
85183
|
+
nodesVisitor(node.elements, visitor, isAssertEntry),
|
|
85224
85184
|
node.multiLine
|
|
85225
85185
|
);
|
|
85226
85186
|
},
|
|
85227
|
-
[301 /*
|
|
85228
|
-
return context.factory.
|
|
85187
|
+
[301 /* AssertEntry */]: function visitEachChildOfAssertEntry(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
85188
|
+
return context.factory.updateAssertEntry(
|
|
85229
85189
|
node,
|
|
85230
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
85190
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isAssertionKey)),
|
|
85231
85191
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
85232
85192
|
);
|
|
85233
85193
|
},
|
|
@@ -85279,7 +85239,7 @@ var visitEachChildTable = {
|
|
|
85279
85239
|
node.isTypeOnly,
|
|
85280
85240
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
85281
85241
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
85282
|
-
nodeVisitor(node.
|
|
85242
|
+
nodeVisitor(node.assertClause, visitor, isAssertClause)
|
|
85283
85243
|
);
|
|
85284
85244
|
},
|
|
85285
85245
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -88598,7 +88558,7 @@ function transformTypeScript(context) {
|
|
|
88598
88558
|
void 0,
|
|
88599
88559
|
importClause,
|
|
88600
88560
|
node.moduleSpecifier,
|
|
88601
|
-
node.
|
|
88561
|
+
node.assertClause
|
|
88602
88562
|
) : void 0;
|
|
88603
88563
|
}
|
|
88604
88564
|
function visitImportClause(node) {
|
|
@@ -88648,7 +88608,7 @@ function transformTypeScript(context) {
|
|
|
88648
88608
|
node.isTypeOnly,
|
|
88649
88609
|
exportClause,
|
|
88650
88610
|
node.moduleSpecifier,
|
|
88651
|
-
node.
|
|
88611
|
+
node.assertClause
|
|
88652
88612
|
) : void 0;
|
|
88653
88613
|
}
|
|
88654
88614
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -88682,7 +88642,7 @@ function transformTypeScript(context) {
|
|
|
88682
88642
|
/*importClause*/
|
|
88683
88643
|
void 0,
|
|
88684
88644
|
node.moduleReference.expression,
|
|
88685
|
-
/*
|
|
88645
|
+
/*assertClause*/
|
|
88686
88646
|
void 0
|
|
88687
88647
|
),
|
|
88688
88648
|
node
|
|
@@ -96852,7 +96812,7 @@ function transformJsx(context) {
|
|
|
96852
96812
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
96853
96813
|
),
|
|
96854
96814
|
factory2.createStringLiteral(importSource),
|
|
96855
|
-
/*
|
|
96815
|
+
/*assertClause*/
|
|
96856
96816
|
void 0
|
|
96857
96817
|
);
|
|
96858
96818
|
setParentRecursive(
|
|
@@ -106259,9 +106219,7 @@ function transformECMAScriptModule(context) {
|
|
|
106259
106219
|
)
|
|
106260
106220
|
])
|
|
106261
106221
|
),
|
|
106262
|
-
factory2.createStringLiteral("module")
|
|
106263
|
-
/*attributes*/
|
|
106264
|
-
void 0
|
|
106222
|
+
factory2.createStringLiteral("module")
|
|
106265
106223
|
);
|
|
106266
106224
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
106267
106225
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -106378,7 +106336,7 @@ function transformECMAScriptModule(context) {
|
|
|
106378
106336
|
)
|
|
106379
106337
|
),
|
|
106380
106338
|
node.moduleSpecifier,
|
|
106381
|
-
node.
|
|
106339
|
+
node.assertClause
|
|
106382
106340
|
);
|
|
106383
106341
|
setOriginalNode(importDecl, node.exportClause);
|
|
106384
106342
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -106831,7 +106789,8 @@ function transformDeclarations(context) {
|
|
|
106831
106789
|
trackReferencedAmbientModule,
|
|
106832
106790
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
106833
106791
|
reportNonlocalAugmentation,
|
|
106834
|
-
reportNonSerializableProperty
|
|
106792
|
+
reportNonSerializableProperty,
|
|
106793
|
+
reportImportTypeNodeResolutionModeOverride
|
|
106835
106794
|
};
|
|
106836
106795
|
let errorNameNode;
|
|
106837
106796
|
let errorFallbackNode;
|
|
@@ -106955,6 +106914,11 @@ function transformDeclarations(context) {
|
|
|
106955
106914
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
106956
106915
|
}
|
|
106957
106916
|
}
|
|
106917
|
+
function reportImportTypeNodeResolutionModeOverride() {
|
|
106918
|
+
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
106919
|
+
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));
|
|
106920
|
+
}
|
|
106921
|
+
}
|
|
106958
106922
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
106959
106923
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
106960
106924
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -107459,7 +107423,7 @@ function transformDeclarations(context) {
|
|
|
107459
107423
|
decl.modifiers,
|
|
107460
107424
|
decl.importClause,
|
|
107461
107425
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107462
|
-
|
|
107426
|
+
getResolutionModeOverrideForClauseInNightly(decl.assertClause)
|
|
107463
107427
|
);
|
|
107464
107428
|
}
|
|
107465
107429
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -107475,7 +107439,7 @@ function transformDeclarations(context) {
|
|
|
107475
107439
|
void 0
|
|
107476
107440
|
),
|
|
107477
107441
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107478
|
-
|
|
107442
|
+
getResolutionModeOverrideForClauseInNightly(decl.assertClause)
|
|
107479
107443
|
);
|
|
107480
107444
|
}
|
|
107481
107445
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -107493,7 +107457,7 @@ function transformDeclarations(context) {
|
|
|
107493
107457
|
namedBindings
|
|
107494
107458
|
),
|
|
107495
107459
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107496
|
-
|
|
107460
|
+
getResolutionModeOverrideForClauseInNightly(decl.assertClause)
|
|
107497
107461
|
) : void 0;
|
|
107498
107462
|
}
|
|
107499
107463
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -107508,7 +107472,7 @@ function transformDeclarations(context) {
|
|
|
107508
107472
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
107509
107473
|
),
|
|
107510
107474
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107511
|
-
|
|
107475
|
+
getResolutionModeOverrideForClauseInNightly(decl.assertClause)
|
|
107512
107476
|
);
|
|
107513
107477
|
}
|
|
107514
107478
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -107518,13 +107482,19 @@ function transformDeclarations(context) {
|
|
|
107518
107482
|
/*importClause*/
|
|
107519
107483
|
void 0,
|
|
107520
107484
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107521
|
-
|
|
107485
|
+
getResolutionModeOverrideForClauseInNightly(decl.assertClause)
|
|
107522
107486
|
);
|
|
107523
107487
|
}
|
|
107524
107488
|
}
|
|
107525
|
-
function
|
|
107526
|
-
const mode =
|
|
107527
|
-
|
|
107489
|
+
function getResolutionModeOverrideForClauseInNightly(assertClause) {
|
|
107490
|
+
const mode = getResolutionModeOverrideForClause(assertClause);
|
|
107491
|
+
if (mode !== void 0) {
|
|
107492
|
+
if (!isNightly()) {
|
|
107493
|
+
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));
|
|
107494
|
+
}
|
|
107495
|
+
return assertClause;
|
|
107496
|
+
}
|
|
107497
|
+
return void 0;
|
|
107528
107498
|
}
|
|
107529
107499
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
107530
107500
|
while (length(lateMarkedStatements)) {
|
|
@@ -107810,7 +107780,7 @@ function transformDeclarations(context) {
|
|
|
107810
107780
|
return cleanup(factory2.updateImportTypeNode(
|
|
107811
107781
|
input,
|
|
107812
107782
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
107813
|
-
input.
|
|
107783
|
+
input.assertions,
|
|
107814
107784
|
input.qualifier,
|
|
107815
107785
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
107816
107786
|
input.isTypeOf
|
|
@@ -107864,7 +107834,7 @@ function transformDeclarations(context) {
|
|
|
107864
107834
|
input.isTypeOnly,
|
|
107865
107835
|
input.exportClause,
|
|
107866
107836
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
107867
|
-
|
|
107837
|
+
getResolutionModeOverrideForClause(input.assertClause) ? input.assertClause : void 0
|
|
107868
107838
|
);
|
|
107869
107839
|
}
|
|
107870
107840
|
case 277 /* ExportAssignment */: {
|
|
@@ -109313,6 +109283,7 @@ function emitFiles(resolver, host, targetSourceFile, { scriptTransformers, decla
|
|
|
109313
109283
|
inlineSourceMap: compilerOptions.inlineSourceMap,
|
|
109314
109284
|
extendedDiagnostics: compilerOptions.extendedDiagnostics,
|
|
109315
109285
|
onlyPrintJsDocStyle: true,
|
|
109286
|
+
omitBraceSourceMapPositions: true,
|
|
109316
109287
|
writeBundleFileInfo: !!bundleBuildInfo,
|
|
109317
109288
|
recordInternalSection: !!bundleBuildInfo,
|
|
109318
109289
|
relativeToBuildInfo
|
|
@@ -109723,6 +109694,7 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
109723
109694
|
onAfterEmitToken
|
|
109724
109695
|
} = handlers;
|
|
109725
109696
|
var extendedDiagnostics = !!printerOptions.extendedDiagnostics;
|
|
109697
|
+
var omitBraceSourcePositions = !!printerOptions.omitBraceSourceMapPositions;
|
|
109726
109698
|
var newLine = getNewLineCharacter(printerOptions);
|
|
109727
109699
|
var moduleKind = getEmitModuleKind(printerOptions);
|
|
109728
109700
|
var bundledHelpers = /* @__PURE__ */ new Map();
|
|
@@ -110357,10 +110329,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
110357
110329
|
return emitNamedExports(node);
|
|
110358
110330
|
case 281 /* ExportSpecifier */:
|
|
110359
110331
|
return emitExportSpecifier(node);
|
|
110360
|
-
case 300 /*
|
|
110361
|
-
return
|
|
110362
|
-
case 301 /*
|
|
110363
|
-
return
|
|
110332
|
+
case 300 /* AssertClause */:
|
|
110333
|
+
return emitAssertClause(node);
|
|
110334
|
+
case 301 /* AssertEntry */:
|
|
110335
|
+
return emitAssertEntry(node);
|
|
110364
110336
|
case 282 /* MissingDeclaration */:
|
|
110365
110337
|
return;
|
|
110366
110338
|
case 283 /* ExternalModuleReference */:
|
|
@@ -111135,16 +111107,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111135
111107
|
writeKeyword("import");
|
|
111136
111108
|
writePunctuation("(");
|
|
111137
111109
|
emit(node.argument);
|
|
111138
|
-
if (node.
|
|
111110
|
+
if (node.assertions) {
|
|
111139
111111
|
writePunctuation(",");
|
|
111140
111112
|
writeSpace();
|
|
111141
111113
|
writePunctuation("{");
|
|
111142
111114
|
writeSpace();
|
|
111143
|
-
writeKeyword(
|
|
111115
|
+
writeKeyword("assert");
|
|
111144
111116
|
writePunctuation(":");
|
|
111145
111117
|
writeSpace();
|
|
111146
|
-
const elements = node.
|
|
111147
|
-
emitList(node.
|
|
111118
|
+
const elements = node.assertions.assertClause.elements;
|
|
111119
|
+
emitList(node.assertions.assertClause, elements, 526226 /* ImportClauseEntries */);
|
|
111148
111120
|
writeSpace();
|
|
111149
111121
|
writePunctuation("}");
|
|
111150
111122
|
}
|
|
@@ -111718,7 +111690,11 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111718
111690
|
decreaseIndent();
|
|
111719
111691
|
}
|
|
111720
111692
|
}
|
|
111721
|
-
|
|
111693
|
+
if (!omitBraceSourcePositions && (token === 19 /* OpenBraceToken */ || token === 20 /* CloseBraceToken */)) {
|
|
111694
|
+
pos = writeToken(token, pos, writer2, contextNode);
|
|
111695
|
+
} else {
|
|
111696
|
+
pos = writeTokenText(token, writer2, pos);
|
|
111697
|
+
}
|
|
111722
111698
|
if (isSimilarNode && contextNode.end !== pos) {
|
|
111723
111699
|
const isJsxExprContext = contextNode.kind === 294 /* JsxExpression */;
|
|
111724
111700
|
emitTrailingCommentsOfPosition(
|
|
@@ -112129,8 +112105,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112129
112105
|
writeSpace();
|
|
112130
112106
|
}
|
|
112131
112107
|
emitExpression(node.moduleSpecifier);
|
|
112132
|
-
if (node.
|
|
112133
|
-
emitWithLeadingSpace(node.
|
|
112108
|
+
if (node.assertClause) {
|
|
112109
|
+
emitWithLeadingSpace(node.assertClause);
|
|
112134
112110
|
}
|
|
112135
112111
|
writeTrailingSemicolon();
|
|
112136
112112
|
}
|
|
@@ -112199,18 +112175,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112199
112175
|
writeSpace();
|
|
112200
112176
|
emitExpression(node.moduleSpecifier);
|
|
112201
112177
|
}
|
|
112202
|
-
if (node.
|
|
112203
|
-
emitWithLeadingSpace(node.
|
|
112178
|
+
if (node.assertClause) {
|
|
112179
|
+
emitWithLeadingSpace(node.assertClause);
|
|
112204
112180
|
}
|
|
112205
112181
|
writeTrailingSemicolon();
|
|
112206
112182
|
}
|
|
112207
|
-
function
|
|
112208
|
-
emitTokenWithComment(
|
|
112183
|
+
function emitAssertClause(node) {
|
|
112184
|
+
emitTokenWithComment(132 /* AssertKeyword */, node.pos, writeKeyword, node);
|
|
112209
112185
|
writeSpace();
|
|
112210
112186
|
const elements = node.elements;
|
|
112211
|
-
emitList(node, elements, 526226 /*
|
|
112187
|
+
emitList(node, elements, 526226 /* ImportClauseEntries */);
|
|
112212
112188
|
}
|
|
112213
|
-
function
|
|
112189
|
+
function emitAssertEntry(node) {
|
|
112214
112190
|
emit(node.name);
|
|
112215
112191
|
writePunctuation(":");
|
|
112216
112192
|
writeSpace();
|
|
@@ -115268,14 +115244,14 @@ function getModeForUsageLocation(file, usage) {
|
|
|
115268
115244
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
115269
115245
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
115270
115246
|
if (isTypeOnly) {
|
|
115271
|
-
const override =
|
|
115247
|
+
const override = getResolutionModeOverrideForClause(usage.parent.assertClause);
|
|
115272
115248
|
if (override) {
|
|
115273
115249
|
return override;
|
|
115274
115250
|
}
|
|
115275
115251
|
}
|
|
115276
115252
|
}
|
|
115277
115253
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
115278
|
-
const override =
|
|
115254
|
+
const override = getResolutionModeOverrideForClause((_a = usage.parent.parent.assertions) == null ? void 0 : _a.assertClause);
|
|
115279
115255
|
if (override) {
|
|
115280
115256
|
return override;
|
|
115281
115257
|
}
|
|
@@ -115286,24 +115262,18 @@ function getModeForUsageLocation(file, usage) {
|
|
|
115286
115262
|
const exprParentParent = (_b = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _b.parent;
|
|
115287
115263
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
115288
115264
|
}
|
|
115289
|
-
function
|
|
115290
|
-
if (!
|
|
115265
|
+
function getResolutionModeOverrideForClause(clause, grammarErrorOnNode) {
|
|
115266
|
+
if (!clause)
|
|
115291
115267
|
return void 0;
|
|
115292
|
-
if (length(
|
|
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
|
-
);
|
|
115268
|
+
if (length(clause.elements) !== 1) {
|
|
115269
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(clause, Diagnostics.Type_import_assertions_should_have_exactly_one_key_resolution_mode_with_value_import_or_require);
|
|
115297
115270
|
return void 0;
|
|
115298
115271
|
}
|
|
115299
|
-
const elem =
|
|
115272
|
+
const elem = clause.elements[0];
|
|
115300
115273
|
if (!isStringLiteralLike(elem.name))
|
|
115301
115274
|
return void 0;
|
|
115302
115275
|
if (elem.name.text !== "resolution-mode") {
|
|
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
|
-
);
|
|
115276
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(elem.name, Diagnostics.resolution_mode_is_the_only_valid_key_for_type_import_assertions);
|
|
115307
115277
|
return void 0;
|
|
115308
115278
|
}
|
|
115309
115279
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -115598,7 +115568,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
|
|
|
115598
115568
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
115599
115569
|
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,
|
|
115600
115570
|
Diagnostics.Duplicate_label_0.code,
|
|
115601
|
-
Diagnostics.
|
|
115571
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments.code,
|
|
115602
115572
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
115603
115573
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
115604
115574
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -117132,7 +117102,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117132
117102
|
/*importClause*/
|
|
117133
117103
|
void 0,
|
|
117134
117104
|
externalHelpersModuleReference,
|
|
117135
|
-
/*
|
|
117105
|
+
/*assertClause*/
|
|
117136
117106
|
void 0
|
|
117137
117107
|
);
|
|
117138
117108
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|