@typescript-deploys/pr-build 5.3.0-pr-55880-5 → 5.3.0-pr-55567-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/lib.es5.d.ts +9 -1
- package/lib/tsc.js +325 -269
- package/lib/tsserver.js +369 -299
- package/lib/typescript.d.ts +51 -29
- package/lib/typescript.js +364 -296
- package/lib/typingsInstaller.js +170 -115
- 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.20230927`;
|
|
22
22
|
|
|
23
23
|
// src/compiler/core.ts
|
|
24
24
|
var emptyArray = [];
|
|
@@ -3312,8 +3312,10 @@ 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["
|
|
3315
|
+
SyntaxKind4[SyntaxKind4["ImportAttributes"] = 300] = "ImportAttributes";
|
|
3316
|
+
SyntaxKind4[SyntaxKind4["ImportAttribute"] = 301] = "ImportAttribute";
|
|
3317
|
+
SyntaxKind4[SyntaxKind4["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
|
|
3318
|
+
SyntaxKind4[SyntaxKind4["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
|
|
3317
3319
|
SyntaxKind4[SyntaxKind4["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer";
|
|
3318
3320
|
SyntaxKind4[SyntaxKind4["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
3319
3321
|
SyntaxKind4[SyntaxKind4["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
@@ -4837,12 +4839,11 @@ var sys = (() => {
|
|
|
4837
4839
|
let activeSession;
|
|
4838
4840
|
let profilePath = "./profile.cpuprofile";
|
|
4839
4841
|
const Buffer = require("buffer").Buffer;
|
|
4840
|
-
const
|
|
4841
|
-
const platform = _os.platform();
|
|
4842
|
+
const isWindows = process.platform === "win32";
|
|
4842
4843
|
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
|
4843
|
-
const fsRealpath = !!_fs.realpathSync.native ?
|
|
4844
|
+
const fsRealpath = !!_fs.realpathSync.native ? isWindows ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
4844
4845
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
4845
|
-
const fsSupportsRecursiveFsWatch =
|
|
4846
|
+
const fsSupportsRecursiveFsWatch = isWindows || process.platform === "darwin";
|
|
4846
4847
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
4847
4848
|
const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
|
|
4848
4849
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -4861,7 +4862,7 @@ var sys = (() => {
|
|
|
4861
4862
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
4862
4863
|
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
4863
4864
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
4864
|
-
inodeWatching:
|
|
4865
|
+
inodeWatching: !isWindows,
|
|
4865
4866
|
sysLog
|
|
4866
4867
|
});
|
|
4867
4868
|
const nodeSystem = {
|
|
@@ -5046,7 +5047,7 @@ var sys = (() => {
|
|
|
5046
5047
|
return Buffer.from && Buffer.from !== Int8Array.from ? Buffer.from(input, encoding) : new Buffer(input, encoding);
|
|
5047
5048
|
}
|
|
5048
5049
|
function isFileSystemCaseSensitive() {
|
|
5049
|
-
if (
|
|
5050
|
+
if (isWindows) {
|
|
5050
5051
|
return false;
|
|
5051
5052
|
}
|
|
5052
5053
|
return !fileExists(swapCase(__filename));
|
|
@@ -6054,9 +6055,8 @@ var Diagnostics = {
|
|
|
6054
6055
|
_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveValueImports_and_isolatedModules_are_both_enabled: diag(1446, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_imported_using_a_type_only_import_when_preserveVa_1446", "'{0}' resolves to a type-only declaration and must be imported using a type-only import when 'preserveValueImports' and 'isolatedModules' are both enabled."),
|
|
6055
6056
|
_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_enabled: diag(1448, 1 /* Error */, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_1_is_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when '{1}' is enabled."),
|
|
6056
6057
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, 3 /* Message */, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
6057
|
-
|
|
6058
|
+
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments: diag(1450, 3 /* Message */, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional set of attributes as arguments"),
|
|
6058
6059
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, 1 /* Error */, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
6059
|
-
resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, 1 /* Error */, "resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "'resolution-mode' assertions are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
6060
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`."),
|
|
6061
6061
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, 1 /* Error */, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
6062
6062
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, 1 /* Error */, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
@@ -6066,6 +6066,8 @@ var Diagnostics = {
|
|
|
6066
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"`),
|
|
6067
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"`),
|
|
6068
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"),
|
|
6069
|
+
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."),
|
|
6070
|
+
Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require: diag(1464, 1 /* Error */, "Type_import_attributes_should_have_exactly_one_key_resolution_mode_with_value_import_or_require_1464", "Type import attributes should have exactly one key - 'resolution-mode' - with value 'import' or 'require'."),
|
|
6069
6071
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, 1 /* Error */, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
6070
6072
|
Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_with_require_Use_an_ECMAScript_import_instead: diag(1471, 1 /* Error */, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead."),
|
|
6071
6073
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -6092,6 +6094,7 @@ var Diagnostics = {
|
|
|
6092
6094
|
The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration: diag(1493, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_a_using_declaration_1493", "The left-hand side of a 'for...in' statement cannot be a 'using' declaration."),
|
|
6093
6095
|
The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration: diag(1494, 1 /* Error */, "The_left_hand_side_of_a_for_in_statement_cannot_be_an_await_using_declaration_1494", "The left-hand side of a 'for...in' statement cannot be an 'await using' declaration."),
|
|
6094
6096
|
_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."),
|
|
6097
|
+
Identifier_string_literal_or_number_literal_expected: diag(1496, 1 /* Error */, "Identifier_string_literal_or_number_literal_expected_1496", "Identifier, string literal, or number literal expected."),
|
|
6095
6098
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, 1 /* Error */, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
6096
6099
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, 1 /* Error */, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
6097
6100
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -6621,15 +6624,15 @@ var Diagnostics = {
|
|
|
6621
6624
|
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, 1 /* Error */, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
6622
6625
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2821", "Import assertions are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
6623
6626
|
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."),
|
|
6627
|
+
Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext_2823", "Import attributes are only supported when the '--module' option is set to 'esnext' or 'nodenext'."),
|
|
6624
6628
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, 1 /* Error */, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
6625
6629
|
Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path: diag(2834, 1 /* Error */, "Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_n_2834", "Relative import paths need explicit file extensions in ECMAScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path."),
|
|
6626
6630
|
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}'?"),
|
|
6627
|
-
|
|
6631
|
+
Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2836, 1 /* Error */, "Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2836", "Import assertions are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
6628
6632
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, 1 /* Error */, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
6629
6633
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, 1 /* Error */, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
6630
6634
|
This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value: diag(2839, 1 /* Error */, "This_condition_will_always_return_0_since_JavaScript_compares_objects_by_reference_not_value_2839", "This condition will always return '{0}' since JavaScript compares objects by reference, not value."),
|
|
6631
6635
|
An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_classes: diag(2840, 1 /* Error */, "An_interface_cannot_extend_a_primitive_type_like_0_an_interface_can_only_extend_named_types_and_clas_2840", "An interface cannot extend a primitive type like '{0}'; an interface can only extend named types and classes"),
|
|
6632
|
-
The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_feature_Use_nightly_TypeScript_to_silence_this_error_Try_updating_with_npm_install_D_typescript_next: diag(2841, 1 /* Error */, "The_type_of_this_expression_cannot_be_named_without_a_resolution_mode_assertion_which_is_an_unstable_2841", "The type of this expression cannot be named without a 'resolution-mode' assertion, which is an unstable feature. Use nightly TypeScript to silence this error. Try updating with 'npm install -D typescript@next'."),
|
|
6633
6636
|
_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation: diag(2842, 1 /* Error */, "_0_is_an_unused_renaming_of_1_Did_you_intend_to_use_it_as_a_type_annotation_2842", "'{0}' is an unused renaming of '{1}'. Did you intend to use it as a type annotation?"),
|
|
6634
6637
|
We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here: diag(2843, 1 /* Error */, "We_can_only_write_a_type_for_0_by_adding_a_type_for_the_entire_parameter_here_2843", "We can only write a type for '{0}' by adding a type for the entire parameter here."),
|
|
6635
6638
|
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."),
|
|
@@ -6643,6 +6646,10 @@ var Diagnostics = {
|
|
|
6643
6646
|
await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_has_no_imports_or_exports_Consider_adding_an_empty_export_to_make_this_file_a_module: diag(2853, 1 /* Error */, "await_using_statements_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_th_2853", "'await using' statements are only allowed at the top level of a file when that file is a module, but this file has no imports or exports. Consider adding an empty 'export {}' to make this file a module."),
|
|
6644
6647
|
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."),
|
|
6645
6648
|
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."),
|
|
6649
|
+
Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls: diag(2856, 1 /* Error */, "Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls_2856", "Import attributes are not allowed on statements that compile to CommonJS 'require' calls."),
|
|
6650
|
+
Import_attributes_cannot_be_used_with_type_only_imports_or_exports: diag(2857, 1 /* Error */, "Import_attributes_cannot_be_used_with_type_only_imports_or_exports_2857", "Import attributes cannot be used with type-only imports or exports."),
|
|
6651
|
+
Import_attribute_values_must_be_string_literal_expressions: diag(2858, 1 /* Error */, "Import_attribute_values_must_be_string_literal_expressions_2858", "Import attribute values must be string literal expressions."),
|
|
6652
|
+
Excessive_complexity_comparing_types_0_and_1: diag(2859, 1 /* Error */, "Excessive_complexity_comparing_types_0_and_1_2859", "Excessive complexity comparing types '{0}' and '{1}'."),
|
|
6646
6653
|
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}'."),
|
|
6647
6654
|
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}'."),
|
|
6648
6655
|
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}'."),
|
|
@@ -6751,7 +6758,6 @@ var Diagnostics = {
|
|
|
6751
6758
|
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}'."),
|
|
6752
6759
|
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}'?"),
|
|
6753
6760
|
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'."),
|
|
6755
6761
|
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."),
|
|
6756
6762
|
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."),
|
|
6757
6763
|
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}'."),
|
|
@@ -10686,7 +10692,7 @@ function isTypeOnlyExportDeclaration(node) {
|
|
|
10686
10692
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
10687
10693
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
10688
10694
|
}
|
|
10689
|
-
function
|
|
10695
|
+
function isImportAttributeName(node) {
|
|
10690
10696
|
return isStringLiteral(node) || isIdentifier(node);
|
|
10691
10697
|
}
|
|
10692
10698
|
function isGeneratedIdentifier(node) {
|
|
@@ -14742,9 +14748,6 @@ function getIndentString(level) {
|
|
|
14742
14748
|
function getIndentSize() {
|
|
14743
14749
|
return indentStrings[1].length;
|
|
14744
14750
|
}
|
|
14745
|
-
function isNightly() {
|
|
14746
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
14747
|
-
}
|
|
14748
14751
|
function createTextWriter(newLine) {
|
|
14749
14752
|
var output;
|
|
14750
14753
|
var indent2;
|
|
@@ -17464,6 +17467,12 @@ function getPropertyNameFromType(type) {
|
|
|
17464
17467
|
function isExpandoPropertyDeclaration(declaration) {
|
|
17465
17468
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
17466
17469
|
}
|
|
17470
|
+
function hasResolutionModeOverride(node) {
|
|
17471
|
+
if (node === void 0) {
|
|
17472
|
+
return false;
|
|
17473
|
+
}
|
|
17474
|
+
return !!getResolutionModeOverride(node.attributes);
|
|
17475
|
+
}
|
|
17467
17476
|
|
|
17468
17477
|
// src/compiler/factory/baseNodeFactory.ts
|
|
17469
17478
|
function createBaseNodeFactory() {
|
|
@@ -18335,6 +18344,10 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
18335
18344
|
updateAssertEntry,
|
|
18336
18345
|
createImportTypeAssertionContainer,
|
|
18337
18346
|
updateImportTypeAssertionContainer,
|
|
18347
|
+
createImportAttributes,
|
|
18348
|
+
updateImportAttributes,
|
|
18349
|
+
createImportAttribute,
|
|
18350
|
+
updateImportAttribute,
|
|
18338
18351
|
createNamespaceImport,
|
|
18339
18352
|
updateNamespaceImport,
|
|
18340
18353
|
createNamespaceExport,
|
|
@@ -19603,18 +19616,21 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
19603
19616
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
19604
19617
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
19605
19618
|
}
|
|
19606
|
-
function createImportTypeNode(argument,
|
|
19619
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
19607
19620
|
const node = createBaseNode(205 /* ImportType */);
|
|
19608
19621
|
node.argument = argument;
|
|
19609
|
-
node.
|
|
19622
|
+
node.attributes = attributes;
|
|
19623
|
+
if (node.assertions && node.assertions.assertClause && node.attributes) {
|
|
19624
|
+
node.assertions.assertClause = node.attributes;
|
|
19625
|
+
}
|
|
19610
19626
|
node.qualifier = qualifier;
|
|
19611
19627
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
19612
19628
|
node.isTypeOf = isTypeOf;
|
|
19613
19629
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
19614
19630
|
return node;
|
|
19615
19631
|
}
|
|
19616
|
-
function updateImportTypeNode(node, argument,
|
|
19617
|
-
return node.argument !== argument || node.
|
|
19632
|
+
function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
|
|
19633
|
+
return node.argument !== argument || node.attributes !== attributes || node.qualifier !== qualifier || node.typeArguments !== typeArguments || node.isTypeOf !== isTypeOf ? update(createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf), node) : node;
|
|
19618
19634
|
}
|
|
19619
19635
|
function createParenthesizedType(type) {
|
|
19620
19636
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -20744,19 +20760,19 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20744
20760
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
20745
20761
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
20746
20762
|
}
|
|
20747
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
20763
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
20748
20764
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
20749
20765
|
node.modifiers = asNodeArray(modifiers);
|
|
20750
20766
|
node.importClause = importClause;
|
|
20751
20767
|
node.moduleSpecifier = moduleSpecifier;
|
|
20752
|
-
node.assertClause =
|
|
20768
|
+
node.attributes = node.assertClause = attributes;
|
|
20753
20769
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
20754
20770
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
20755
20771
|
node.jsDoc = void 0;
|
|
20756
20772
|
return node;
|
|
20757
20773
|
}
|
|
20758
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
20759
|
-
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
20774
|
+
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
|
|
20775
|
+
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node;
|
|
20760
20776
|
}
|
|
20761
20777
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
20762
20778
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -20777,6 +20793,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20777
20793
|
const node = createBaseNode(300 /* AssertClause */);
|
|
20778
20794
|
node.elements = createNodeArray(elements);
|
|
20779
20795
|
node.multiLine = multiLine;
|
|
20796
|
+
node.token = 132 /* AssertKeyword */;
|
|
20780
20797
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
20781
20798
|
return node;
|
|
20782
20799
|
}
|
|
@@ -20802,6 +20819,27 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20802
20819
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
20803
20820
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
20804
20821
|
}
|
|
20822
|
+
function createImportAttributes(elements, multiLine, token) {
|
|
20823
|
+
const node = createBaseNode(300 /* ImportAttributes */);
|
|
20824
|
+
node.token = token ?? 118 /* WithKeyword */;
|
|
20825
|
+
node.elements = createNodeArray(elements);
|
|
20826
|
+
node.multiLine = multiLine;
|
|
20827
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
20828
|
+
return node;
|
|
20829
|
+
}
|
|
20830
|
+
function updateImportAttributes(node, elements, multiLine) {
|
|
20831
|
+
return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node;
|
|
20832
|
+
}
|
|
20833
|
+
function createImportAttribute(name, value) {
|
|
20834
|
+
const node = createBaseNode(301 /* ImportAttribute */);
|
|
20835
|
+
node.name = name;
|
|
20836
|
+
node.value = value;
|
|
20837
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
20838
|
+
return node;
|
|
20839
|
+
}
|
|
20840
|
+
function updateImportAttribute(node, name, value) {
|
|
20841
|
+
return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;
|
|
20842
|
+
}
|
|
20805
20843
|
function createNamespaceImport(name) {
|
|
20806
20844
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
20807
20845
|
node.name = name;
|
|
@@ -20862,20 +20900,20 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
20862
20900
|
function updateExportAssignment(node, modifiers, expression) {
|
|
20863
20901
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment(modifiers, node.isExportEquals, expression), node) : node;
|
|
20864
20902
|
}
|
|
20865
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
20903
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
20866
20904
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
20867
20905
|
node.modifiers = asNodeArray(modifiers);
|
|
20868
20906
|
node.isTypeOnly = isTypeOnly;
|
|
20869
20907
|
node.exportClause = exportClause;
|
|
20870
20908
|
node.moduleSpecifier = moduleSpecifier;
|
|
20871
|
-
node.assertClause =
|
|
20909
|
+
node.attributes = node.assertClause = attributes;
|
|
20872
20910
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
20873
20911
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
20874
20912
|
node.jsDoc = void 0;
|
|
20875
20913
|
return node;
|
|
20876
20914
|
}
|
|
20877
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
20878
|
-
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
20915
|
+
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
20916
|
+
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? finishUpdateExportDeclaration(createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes), node) : node;
|
|
20879
20917
|
}
|
|
20880
20918
|
function finishUpdateExportDeclaration(updated, original) {
|
|
20881
20919
|
if (updated !== original) {
|
|
@@ -22202,7 +22240,7 @@ function createNodeFactory(flags, baseFactory2) {
|
|
|
22202
22240
|
} else {
|
|
22203
22241
|
modifierArray = modifiers;
|
|
22204
22242
|
}
|
|
22205
|
-
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.
|
|
22243
|
+
return isTypeParameterDeclaration(node) ? updateTypeParameterDeclaration(node, modifierArray, node.name, node.constraint, node.default) : isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isConstructorTypeNode(node) ? updateConstructorTypeNode1(node, modifierArray, node.typeParameters, node.parameters, node.type) : isPropertySignature(node) ? updatePropertySignature(node, modifierArray, node.name, node.questionToken, node.type) : isPropertyDeclaration(node) ? updatePropertyDeclaration(node, modifierArray, node.name, node.questionToken ?? node.exclamationToken, node.type, node.initializer) : isMethodSignature(node) ? updateMethodSignature(node, modifierArray, node.name, node.questionToken, node.typeParameters, node.parameters, node.type) : isMethodDeclaration(node) ? updateMethodDeclaration(node, modifierArray, node.asteriskToken, node.name, node.questionToken, node.typeParameters, node.parameters, node.type, node.body) : isConstructorDeclaration(node) ? updateConstructorDeclaration(node, modifierArray, node.parameters, node.body) : isGetAccessorDeclaration(node) ? updateGetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.type, node.body) : isSetAccessorDeclaration(node) ? updateSetAccessorDeclaration(node, modifierArray, node.name, node.parameters, node.body) : isIndexSignatureDeclaration(node) ? updateIndexSignature(node, modifierArray, node.parameters, node.type) : isFunctionExpression(node) ? updateFunctionExpression(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isArrowFunction(node) ? updateArrowFunction(node, modifierArray, node.typeParameters, node.parameters, node.type, node.equalsGreaterThanToken, node.body) : isClassExpression(node) ? updateClassExpression(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isVariableStatement(node) ? updateVariableStatement(node, modifierArray, node.declarationList) : isFunctionDeclaration(node) ? updateFunctionDeclaration(node, modifierArray, node.asteriskToken, node.name, node.typeParameters, node.parameters, node.type, node.body) : isClassDeclaration(node) ? updateClassDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isInterfaceDeclaration(node) ? updateInterfaceDeclaration(node, modifierArray, node.name, node.typeParameters, node.heritageClauses, node.members) : isTypeAliasDeclaration(node) ? updateTypeAliasDeclaration(node, modifierArray, node.name, node.typeParameters, node.type) : isEnumDeclaration(node) ? updateEnumDeclaration(node, modifierArray, node.name, node.members) : isModuleDeclaration(node) ? updateModuleDeclaration(node, modifierArray, node.name, node.body) : isImportEqualsDeclaration(node) ? updateImportEqualsDeclaration(node, modifierArray, node.isTypeOnly, node.name, node.moduleReference) : isImportDeclaration(node) ? updateImportDeclaration(node, modifierArray, node.importClause, node.moduleSpecifier, node.attributes) : isExportAssignment(node) ? updateExportAssignment(node, modifierArray, node.expression) : isExportDeclaration(node) ? updateExportDeclaration(node, modifierArray, node.isTypeOnly, node.exportClause, node.moduleSpecifier, node.attributes) : Debug.assertNever(node);
|
|
22206
22244
|
}
|
|
22207
22245
|
function updateModifierLike(node, modifierArray) {
|
|
22208
22246
|
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);
|
|
@@ -24426,14 +24464,14 @@ function isImportDeclaration(node) {
|
|
|
24426
24464
|
function isImportClause(node) {
|
|
24427
24465
|
return node.kind === 273 /* ImportClause */;
|
|
24428
24466
|
}
|
|
24429
|
-
function isImportTypeAssertionContainer(node) {
|
|
24430
|
-
return node.kind === 302 /* ImportTypeAssertionContainer */;
|
|
24431
|
-
}
|
|
24432
24467
|
function isAssertClause(node) {
|
|
24433
24468
|
return node.kind === 300 /* AssertClause */;
|
|
24434
24469
|
}
|
|
24435
|
-
function
|
|
24436
|
-
return node.kind ===
|
|
24470
|
+
function isImportAttributes(node) {
|
|
24471
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
24472
|
+
}
|
|
24473
|
+
function isImportAttribute(node) {
|
|
24474
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
24437
24475
|
}
|
|
24438
24476
|
function isNamespaceImport(node) {
|
|
24439
24477
|
return node.kind === 274 /* NamespaceImport */;
|
|
@@ -25109,7 +25147,7 @@ function createExternalHelpersImportDeclarationIfNeeded(nodeFactory, helperFacto
|
|
|
25109
25147
|
namedBindings
|
|
25110
25148
|
),
|
|
25111
25149
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
25112
|
-
/*
|
|
25150
|
+
/*attributes*/
|
|
25113
25151
|
void 0
|
|
25114
25152
|
);
|
|
25115
25153
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -25863,7 +25901,7 @@ var forEachChildTable = {
|
|
|
25863
25901
|
return visitNode2(cbNode, node.typeParameter);
|
|
25864
25902
|
},
|
|
25865
25903
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
25866
|
-
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.
|
|
25904
|
+
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
25867
25905
|
},
|
|
25868
25906
|
[302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
|
|
25869
25907
|
return visitNode2(cbNode, node.assertClause);
|
|
@@ -26037,15 +26075,15 @@ var forEachChildTable = {
|
|
|
26037
26075
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
26038
26076
|
},
|
|
26039
26077
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
26040
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
26078
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
26041
26079
|
},
|
|
26042
26080
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
26043
26081
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
26044
26082
|
},
|
|
26045
|
-
[300 /*
|
|
26083
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
26046
26084
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
26047
26085
|
},
|
|
26048
|
-
[301 /*
|
|
26086
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
26049
26087
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
26050
26088
|
},
|
|
26051
26089
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -26060,7 +26098,7 @@ var forEachChildTable = {
|
|
|
26060
26098
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
26061
26099
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
26062
26100
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
26063
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
26101
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
26064
26102
|
},
|
|
26065
26103
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
26066
26104
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -27325,7 +27363,7 @@ var Parser;
|
|
|
27325
27363
|
function isLiteralPropertyName() {
|
|
27326
27364
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
27327
27365
|
}
|
|
27328
|
-
function
|
|
27366
|
+
function isImportAttributeName2() {
|
|
27329
27367
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
27330
27368
|
}
|
|
27331
27369
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -27444,8 +27482,8 @@ var Parser;
|
|
|
27444
27482
|
return isLiteralPropertyName();
|
|
27445
27483
|
case 9 /* ObjectBindingElements */:
|
|
27446
27484
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
27447
|
-
case 24 /*
|
|
27448
|
-
return
|
|
27485
|
+
case 24 /* ImportAttributes */:
|
|
27486
|
+
return isImportAttributeName2();
|
|
27449
27487
|
case 7 /* HeritageClauseElement */:
|
|
27450
27488
|
if (token() === 19 /* OpenBraceToken */) {
|
|
27451
27489
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -27548,7 +27586,7 @@ var Parser;
|
|
|
27548
27586
|
case 12 /* ObjectLiteralMembers */:
|
|
27549
27587
|
case 9 /* ObjectBindingElements */:
|
|
27550
27588
|
case 23 /* ImportOrExportSpecifiers */:
|
|
27551
|
-
case 24 /*
|
|
27589
|
+
case 24 /* ImportAttributes */:
|
|
27552
27590
|
return token() === 20 /* CloseBraceToken */;
|
|
27553
27591
|
case 3 /* SwitchClauseStatements */:
|
|
27554
27592
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -27854,7 +27892,7 @@ var Parser;
|
|
|
27854
27892
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27855
27893
|
case 14 /* JsxChildren */:
|
|
27856
27894
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
27857
|
-
case 24 /*
|
|
27895
|
+
case 24 /* ImportAttributes */:
|
|
27858
27896
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
27859
27897
|
case 25 /* JSDocComment */:
|
|
27860
27898
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -28729,28 +28767,6 @@ var Parser;
|
|
|
28729
28767
|
nextToken();
|
|
28730
28768
|
return token() === 102 /* ImportKeyword */;
|
|
28731
28769
|
}
|
|
28732
|
-
function parseImportTypeAssertions() {
|
|
28733
|
-
const pos = getNodePos();
|
|
28734
|
-
const openBracePosition = scanner.getTokenStart();
|
|
28735
|
-
parseExpected(19 /* OpenBraceToken */);
|
|
28736
|
-
const multiLine = scanner.hasPrecedingLineBreak();
|
|
28737
|
-
parseExpected(132 /* AssertKeyword */);
|
|
28738
|
-
parseExpected(59 /* ColonToken */);
|
|
28739
|
-
const clause = parseAssertClause(
|
|
28740
|
-
/*skipAssertKeyword*/
|
|
28741
|
-
true
|
|
28742
|
-
);
|
|
28743
|
-
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
28744
|
-
const lastError = lastOrUndefined(parseDiagnostics);
|
|
28745
|
-
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
28746
|
-
addRelatedInfo(
|
|
28747
|
-
lastError,
|
|
28748
|
-
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
28749
|
-
);
|
|
28750
|
-
}
|
|
28751
|
-
}
|
|
28752
|
-
return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
28753
|
-
}
|
|
28754
28770
|
function parseImportType() {
|
|
28755
28771
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
28756
28772
|
const pos = getNodePos();
|
|
@@ -28758,14 +28774,36 @@ var Parser;
|
|
|
28758
28774
|
parseExpected(102 /* ImportKeyword */);
|
|
28759
28775
|
parseExpected(21 /* OpenParenToken */);
|
|
28760
28776
|
const type = parseType();
|
|
28761
|
-
let
|
|
28777
|
+
let attributes;
|
|
28762
28778
|
if (parseOptional(28 /* CommaToken */)) {
|
|
28763
|
-
|
|
28779
|
+
const openBracePosition = scanner.getTokenStart();
|
|
28780
|
+
parseExpected(19 /* OpenBraceToken */);
|
|
28781
|
+
const currentToken2 = token();
|
|
28782
|
+
if (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) {
|
|
28783
|
+
nextToken();
|
|
28784
|
+
} else {
|
|
28785
|
+
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
|
|
28786
|
+
}
|
|
28787
|
+
parseExpected(59 /* ColonToken */);
|
|
28788
|
+
attributes = parseImportAttributes(
|
|
28789
|
+
currentToken2,
|
|
28790
|
+
/*skipKeyword*/
|
|
28791
|
+
true
|
|
28792
|
+
);
|
|
28793
|
+
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
28794
|
+
const lastError = lastOrUndefined(parseDiagnostics);
|
|
28795
|
+
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
28796
|
+
addRelatedInfo(
|
|
28797
|
+
lastError,
|
|
28798
|
+
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
28799
|
+
);
|
|
28800
|
+
}
|
|
28801
|
+
}
|
|
28764
28802
|
}
|
|
28765
28803
|
parseExpected(22 /* CloseParenToken */);
|
|
28766
28804
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
28767
28805
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
28768
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
28806
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
28769
28807
|
}
|
|
28770
28808
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
28771
28809
|
nextToken();
|
|
@@ -31827,15 +31865,16 @@ var Parser;
|
|
|
31827
31865
|
parseExpected(161 /* FromKeyword */);
|
|
31828
31866
|
}
|
|
31829
31867
|
const moduleSpecifier = parseModuleSpecifier();
|
|
31830
|
-
|
|
31831
|
-
|
|
31832
|
-
|
|
31868
|
+
const currentToken2 = token();
|
|
31869
|
+
let attributes;
|
|
31870
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
|
|
31871
|
+
attributes = parseImportAttributes(currentToken2);
|
|
31833
31872
|
}
|
|
31834
31873
|
parseSemicolon();
|
|
31835
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
31874
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
31836
31875
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
31837
31876
|
}
|
|
31838
|
-
function
|
|
31877
|
+
function parseImportAttribute() {
|
|
31839
31878
|
const pos = getNodePos();
|
|
31840
31879
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
31841
31880
|
parseExpected(59 /* ColonToken */);
|
|
@@ -31843,19 +31882,19 @@ var Parser;
|
|
|
31843
31882
|
/*allowReturnTypeInArrowFunction*/
|
|
31844
31883
|
true
|
|
31845
31884
|
);
|
|
31846
|
-
return finishNode(factory2.
|
|
31885
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
31847
31886
|
}
|
|
31848
|
-
function
|
|
31887
|
+
function parseImportAttributes(token2, skipKeyword) {
|
|
31849
31888
|
const pos = getNodePos();
|
|
31850
|
-
if (!
|
|
31851
|
-
parseExpected(
|
|
31889
|
+
if (!skipKeyword) {
|
|
31890
|
+
parseExpected(token2);
|
|
31852
31891
|
}
|
|
31853
31892
|
const openBracePosition = scanner.getTokenStart();
|
|
31854
31893
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
31855
31894
|
const multiLine = scanner.hasPrecedingLineBreak();
|
|
31856
31895
|
const elements = parseDelimitedList(
|
|
31857
|
-
24 /*
|
|
31858
|
-
|
|
31896
|
+
24 /* ImportAttributes */,
|
|
31897
|
+
parseImportAttribute,
|
|
31859
31898
|
/*considerSemicolonAsDelimiter*/
|
|
31860
31899
|
true
|
|
31861
31900
|
);
|
|
@@ -31868,7 +31907,7 @@ var Parser;
|
|
|
31868
31907
|
);
|
|
31869
31908
|
}
|
|
31870
31909
|
}
|
|
31871
|
-
return finishNode(factory2.
|
|
31910
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
31872
31911
|
} else {
|
|
31873
31912
|
const elements = createNodeArray(
|
|
31874
31913
|
[],
|
|
@@ -31878,10 +31917,11 @@ var Parser;
|
|
|
31878
31917
|
/*hasTrailingComma*/
|
|
31879
31918
|
false
|
|
31880
31919
|
);
|
|
31881
|
-
return finishNode(factory2.
|
|
31920
|
+
return finishNode(factory2.createImportAttributes(
|
|
31882
31921
|
elements,
|
|
31883
31922
|
/*multiLine*/
|
|
31884
|
-
false
|
|
31923
|
+
false,
|
|
31924
|
+
token2
|
|
31885
31925
|
), pos);
|
|
31886
31926
|
}
|
|
31887
31927
|
}
|
|
@@ -32013,7 +32053,7 @@ var Parser;
|
|
|
32013
32053
|
);
|
|
32014
32054
|
let exportClause;
|
|
32015
32055
|
let moduleSpecifier;
|
|
32016
|
-
let
|
|
32056
|
+
let attributes;
|
|
32017
32057
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
32018
32058
|
const namespaceExportPos = getNodePos();
|
|
32019
32059
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -32029,12 +32069,13 @@ var Parser;
|
|
|
32029
32069
|
moduleSpecifier = parseModuleSpecifier();
|
|
32030
32070
|
}
|
|
32031
32071
|
}
|
|
32032
|
-
|
|
32033
|
-
|
|
32072
|
+
const currentToken2 = token();
|
|
32073
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner.hasPrecedingLineBreak()) {
|
|
32074
|
+
attributes = parseImportAttributes(currentToken2);
|
|
32034
32075
|
}
|
|
32035
32076
|
parseSemicolon();
|
|
32036
32077
|
setAwaitContext(savedAwaitContext);
|
|
32037
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
32078
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
32038
32079
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
32039
32080
|
}
|
|
32040
32081
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -32084,7 +32125,7 @@ var Parser;
|
|
|
32084
32125
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
32085
32126
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
32086
32127
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
32087
|
-
ParsingContext2[ParsingContext2["
|
|
32128
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
32088
32129
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
32089
32130
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
32090
32131
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -37067,10 +37108,15 @@ function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFil
|
|
|
37067
37108
|
const failedLookupLocations = [];
|
|
37068
37109
|
const affectingLocations = [];
|
|
37069
37110
|
let features = getNodeResolutionFeatures(options);
|
|
37070
|
-
if (resolutionMode
|
|
37111
|
+
if (resolutionMode !== void 0) {
|
|
37112
|
+
features |= 30 /* AllFeatures */;
|
|
37113
|
+
}
|
|
37114
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
37115
|
+
if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
|
|
37071
37116
|
features |= 32 /* EsmMode */;
|
|
37072
37117
|
}
|
|
37073
|
-
const
|
|
37118
|
+
const useImportCondition = resolutionMode === 99 /* ESNext */ || (resolutionMode !== void 0 ? false : void 0);
|
|
37119
|
+
const conditions = features & 8 /* Exports */ ? getConditions(options, useImportCondition) : [];
|
|
37074
37120
|
const diagnostics = [];
|
|
37075
37121
|
const moduleResolutionState = {
|
|
37076
37122
|
compilerOptions: options,
|
|
@@ -37239,11 +37285,19 @@ function getNodeResolutionFeatures(options) {
|
|
|
37239
37285
|
return features;
|
|
37240
37286
|
}
|
|
37241
37287
|
function getConditions(options, esmMode) {
|
|
37242
|
-
const
|
|
37288
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
37289
|
+
if (esmMode === void 0) {
|
|
37290
|
+
if (moduleResolution === 100 /* Bundler */) {
|
|
37291
|
+
esmMode ?? (esmMode = moduleResolution === 100 /* Bundler */);
|
|
37292
|
+
} else if (moduleResolution === 2 /* Node10 */) {
|
|
37293
|
+
return [];
|
|
37294
|
+
}
|
|
37295
|
+
}
|
|
37296
|
+
const conditions = esmMode ? ["import"] : ["require"];
|
|
37243
37297
|
if (!options.noDtsResolution) {
|
|
37244
37298
|
conditions.push("types");
|
|
37245
37299
|
}
|
|
37246
|
-
if (
|
|
37300
|
+
if (moduleResolution !== 100 /* Bundler */) {
|
|
37247
37301
|
conditions.push("node");
|
|
37248
37302
|
}
|
|
37249
37303
|
return concatenate(conditions, options.customConditions);
|
|
@@ -37661,13 +37715,13 @@ function resolveModuleName(moduleName, containingFile, compilerOptions, host, ca
|
|
|
37661
37715
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
37662
37716
|
break;
|
|
37663
37717
|
case 2 /* Node10 */:
|
|
37664
|
-
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
37718
|
+
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
37665
37719
|
break;
|
|
37666
37720
|
case 1 /* Classic */:
|
|
37667
37721
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
37668
37722
|
break;
|
|
37669
37723
|
case 100 /* Bundler */:
|
|
37670
|
-
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
37724
|
+
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
37671
37725
|
break;
|
|
37672
37726
|
default:
|
|
37673
37727
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
@@ -37832,7 +37886,7 @@ function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
37832
37886
|
resolutionMode
|
|
37833
37887
|
);
|
|
37834
37888
|
}
|
|
37835
|
-
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
37889
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode, conditions) {
|
|
37836
37890
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
37837
37891
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
37838
37892
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
@@ -37849,7 +37903,8 @@ function nodeNextModuleNameResolverWorker(features, moduleName, containingFile,
|
|
|
37849
37903
|
extensions,
|
|
37850
37904
|
/*isConfigLookup*/
|
|
37851
37905
|
false,
|
|
37852
|
-
redirectedReference
|
|
37906
|
+
redirectedReference,
|
|
37907
|
+
conditions
|
|
37853
37908
|
);
|
|
37854
37909
|
}
|
|
37855
37910
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
@@ -37865,10 +37920,12 @@ function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
|
37865
37920
|
/*isConfigLookup*/
|
|
37866
37921
|
false,
|
|
37867
37922
|
/*redirectedReference*/
|
|
37923
|
+
void 0,
|
|
37924
|
+
/*conditions*/
|
|
37868
37925
|
void 0
|
|
37869
37926
|
);
|
|
37870
37927
|
}
|
|
37871
|
-
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
37928
|
+
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions) {
|
|
37872
37929
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
37873
37930
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
37874
37931
|
if (getResolveJsonModule(compilerOptions)) {
|
|
@@ -37884,10 +37941,11 @@ function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions,
|
|
|
37884
37941
|
extensions,
|
|
37885
37942
|
/*isConfigLookup*/
|
|
37886
37943
|
false,
|
|
37887
|
-
redirectedReference
|
|
37944
|
+
redirectedReference,
|
|
37945
|
+
conditions
|
|
37888
37946
|
);
|
|
37889
37947
|
}
|
|
37890
|
-
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
37948
|
+
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) {
|
|
37891
37949
|
let extensions;
|
|
37892
37950
|
if (isConfigLookup) {
|
|
37893
37951
|
extensions = 8 /* Json */;
|
|
@@ -37898,7 +37956,7 @@ function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, hos
|
|
|
37898
37956
|
} else {
|
|
37899
37957
|
extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
37900
37958
|
}
|
|
37901
|
-
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
|
|
37959
|
+
return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
|
|
37902
37960
|
}
|
|
37903
37961
|
function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
37904
37962
|
return nodeModuleNameResolverWorker(
|
|
@@ -37913,15 +37971,21 @@ function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
|
37913
37971
|
/*isConfigLookup*/
|
|
37914
37972
|
true,
|
|
37915
37973
|
/*redirectedReference*/
|
|
37974
|
+
void 0,
|
|
37975
|
+
/*conditions*/
|
|
37916
37976
|
void 0
|
|
37917
37977
|
);
|
|
37918
37978
|
}
|
|
37919
|
-
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
37979
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
|
|
37920
37980
|
var _a, _b, _c, _d;
|
|
37921
37981
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
37922
37982
|
const failedLookupLocations = [];
|
|
37923
37983
|
const affectingLocations = [];
|
|
37924
|
-
const
|
|
37984
|
+
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
37985
|
+
conditions ?? (conditions = getConditions(
|
|
37986
|
+
compilerOptions,
|
|
37987
|
+
moduleResolution === 100 /* Bundler */ || moduleResolution === 2 /* Node10 */ ? void 0 : !!(features & 32 /* EsmMode */)
|
|
37988
|
+
));
|
|
37925
37989
|
const diagnostics = [];
|
|
37926
37990
|
const state = {
|
|
37927
37991
|
compilerOptions,
|
|
@@ -37931,17 +37995,17 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
37931
37995
|
affectingLocations,
|
|
37932
37996
|
packageJsonInfoCache: cache,
|
|
37933
37997
|
features,
|
|
37934
|
-
conditions,
|
|
37998
|
+
conditions: conditions ?? emptyArray,
|
|
37935
37999
|
requestContainingDirectory: containingDirectory,
|
|
37936
38000
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
37937
38001
|
isConfigLookup,
|
|
37938
38002
|
candidateIsFromPackageJsonField: false
|
|
37939
38003
|
};
|
|
37940
|
-
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(
|
|
37941
|
-
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
38004
|
+
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
38005
|
+
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
|
|
37942
38006
|
}
|
|
37943
38007
|
let result;
|
|
37944
|
-
if (
|
|
38008
|
+
if (moduleResolution === 2 /* Node10 */) {
|
|
37945
38009
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
37946
38010
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
37947
38011
|
result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
|
|
@@ -37949,7 +38013,7 @@ function nodeModuleNameResolverWorker(features, moduleName, containingDirectory,
|
|
|
37949
38013
|
result = tryResolve(extensions, state);
|
|
37950
38014
|
}
|
|
37951
38015
|
let legacyResult;
|
|
37952
|
-
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && conditions.includes("import")) {
|
|
38016
|
+
if (((_a = result == null ? void 0 : result.value) == null ? void 0 : _a.isExternalLibraryImport) && !isConfigLookup && extensions & (1 /* TypeScript */ | 4 /* Declaration */) && features & 8 /* Exports */ && !isExternalModuleNameRelative(moduleName) && !extensionIsOk(1 /* TypeScript */ | 4 /* Declaration */, result.value.resolved.extension) && (conditions == null ? void 0 : conditions.includes("import"))) {
|
|
37953
38017
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
37954
38018
|
const diagnosticState = {
|
|
37955
38019
|
...state,
|
|
@@ -38625,7 +38689,8 @@ function getLoadModuleFromTargetImportOrExport(extensions, state, cache, redirec
|
|
|
38625
38689
|
extensions,
|
|
38626
38690
|
/*isConfigLookup*/
|
|
38627
38691
|
false,
|
|
38628
|
-
redirectedReference
|
|
38692
|
+
redirectedReference,
|
|
38693
|
+
state.conditions
|
|
38629
38694
|
);
|
|
38630
38695
|
return toSearchResult(
|
|
38631
38696
|
result.resolvedModule ? {
|
|
@@ -46318,7 +46383,7 @@ function createTypeChecker(host) {
|
|
|
46318
46383
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
46319
46384
|
}
|
|
46320
46385
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
46321
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
46386
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
46322
46387
|
if (startsWith(moduleReference, "@types/")) {
|
|
46323
46388
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
46324
46389
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -46373,9 +46438,8 @@ function createTypeChecker(host) {
|
|
|
46373
46438
|
}
|
|
46374
46439
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
46375
46440
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
46376
|
-
const
|
|
46377
|
-
|
|
46378
|
-
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
46441
|
+
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
46442
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
46379
46443
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
46380
46444
|
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);
|
|
46381
46445
|
} else {
|
|
@@ -46481,7 +46545,7 @@ function createTypeChecker(host) {
|
|
|
46481
46545
|
error(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
46482
46546
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
46483
46547
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
46484
|
-
const suggestedExt = (
|
|
46548
|
+
const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
|
|
46485
46549
|
if (suggestedExt) {
|
|
46486
46550
|
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);
|
|
46487
46551
|
} else {
|
|
@@ -48246,7 +48310,7 @@ function createTypeChecker(host) {
|
|
|
48246
48310
|
return factory.updateImportTypeNode(
|
|
48247
48311
|
root,
|
|
48248
48312
|
root.argument,
|
|
48249
|
-
root.
|
|
48313
|
+
root.attributes,
|
|
48250
48314
|
qualifier,
|
|
48251
48315
|
typeArguments,
|
|
48252
48316
|
root.isTypeOf
|
|
@@ -48979,7 +49043,6 @@ function createTypeChecker(host) {
|
|
|
48979
49043
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
48980
49044
|
}
|
|
48981
49045
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
48982
|
-
var _a, _b, _c, _d;
|
|
48983
49046
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
48984
49047
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
48985
49048
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -48988,17 +49051,18 @@ function createTypeChecker(host) {
|
|
|
48988
49051
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
48989
49052
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
48990
49053
|
let specifier;
|
|
48991
|
-
let
|
|
49054
|
+
let attributes;
|
|
48992
49055
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
48993
49056
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
48994
49057
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
48995
|
-
|
|
48996
|
-
factory.
|
|
48997
|
-
factory.
|
|
48998
|
-
|
|
48999
|
-
|
|
49000
|
-
|
|
49001
|
-
|
|
49058
|
+
attributes = factory.createImportAttributes(
|
|
49059
|
+
factory.createNodeArray([
|
|
49060
|
+
factory.createImportAttribute(
|
|
49061
|
+
factory.createStringLiteral("resolution-mode"),
|
|
49062
|
+
factory.createStringLiteral("import")
|
|
49063
|
+
)
|
|
49064
|
+
])
|
|
49065
|
+
);
|
|
49002
49066
|
}
|
|
49003
49067
|
}
|
|
49004
49068
|
if (!specifier) {
|
|
@@ -49012,16 +49076,17 @@ function createTypeChecker(host) {
|
|
|
49012
49076
|
if (specifier.includes("/node_modules/")) {
|
|
49013
49077
|
specifier = oldSpecifier;
|
|
49014
49078
|
} else {
|
|
49015
|
-
|
|
49016
|
-
factory.
|
|
49017
|
-
factory.
|
|
49018
|
-
|
|
49019
|
-
|
|
49020
|
-
|
|
49021
|
-
|
|
49079
|
+
attributes = factory.createImportAttributes(
|
|
49080
|
+
factory.createNodeArray([
|
|
49081
|
+
factory.createImportAttribute(
|
|
49082
|
+
factory.createStringLiteral("resolution-mode"),
|
|
49083
|
+
factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
|
|
49084
|
+
)
|
|
49085
|
+
])
|
|
49086
|
+
);
|
|
49022
49087
|
}
|
|
49023
49088
|
}
|
|
49024
|
-
if (!
|
|
49089
|
+
if (!attributes) {
|
|
49025
49090
|
context.encounteredError = true;
|
|
49026
49091
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
49027
49092
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -49041,11 +49106,11 @@ function createTypeChecker(host) {
|
|
|
49041
49106
|
void 0
|
|
49042
49107
|
);
|
|
49043
49108
|
}
|
|
49044
|
-
return factory.createImportTypeNode(lit,
|
|
49109
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
49045
49110
|
} else {
|
|
49046
49111
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
49047
49112
|
const qualifier = splitNode.objectType.typeName;
|
|
49048
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
49113
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
49049
49114
|
}
|
|
49050
49115
|
}
|
|
49051
49116
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -49521,7 +49586,7 @@ function createTypeChecker(host) {
|
|
|
49521
49586
|
return factory.updateImportTypeNode(
|
|
49522
49587
|
node,
|
|
49523
49588
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
49524
|
-
node.
|
|
49589
|
+
node.attributes,
|
|
49525
49590
|
node.qualifier,
|
|
49526
49591
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
49527
49592
|
node.isTypeOf
|
|
@@ -49741,7 +49806,7 @@ function createTypeChecker(host) {
|
|
|
49741
49806
|
return statements;
|
|
49742
49807
|
}
|
|
49743
49808
|
function inlineExportModifiers(statements) {
|
|
49744
|
-
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.
|
|
49809
|
+
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause));
|
|
49745
49810
|
if (index >= 0) {
|
|
49746
49811
|
const exportDecl = statements[index];
|
|
49747
49812
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -49769,7 +49834,7 @@ function createTypeChecker(host) {
|
|
|
49769
49834
|
replacements
|
|
49770
49835
|
),
|
|
49771
49836
|
exportDecl.moduleSpecifier,
|
|
49772
|
-
exportDecl.
|
|
49837
|
+
exportDecl.attributes
|
|
49773
49838
|
);
|
|
49774
49839
|
}
|
|
49775
49840
|
}
|
|
@@ -50420,7 +50485,7 @@ function createTypeChecker(host) {
|
|
|
50420
50485
|
)])
|
|
50421
50486
|
),
|
|
50422
50487
|
factory.createStringLiteral(specifier2),
|
|
50423
|
-
/*
|
|
50488
|
+
/*attributes*/
|
|
50424
50489
|
void 0
|
|
50425
50490
|
),
|
|
50426
50491
|
0 /* None */
|
|
@@ -50508,7 +50573,7 @@ function createTypeChecker(host) {
|
|
|
50508
50573
|
void 0
|
|
50509
50574
|
),
|
|
50510
50575
|
specifier2,
|
|
50511
|
-
node.parent.
|
|
50576
|
+
node.parent.attributes
|
|
50512
50577
|
),
|
|
50513
50578
|
0 /* None */
|
|
50514
50579
|
);
|
|
@@ -50529,7 +50594,7 @@ function createTypeChecker(host) {
|
|
|
50529
50594
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
50530
50595
|
),
|
|
50531
50596
|
specifier2,
|
|
50532
|
-
node.parent.
|
|
50597
|
+
node.parent.attributes
|
|
50533
50598
|
),
|
|
50534
50599
|
0 /* None */
|
|
50535
50600
|
);
|
|
@@ -50570,7 +50635,7 @@ function createTypeChecker(host) {
|
|
|
50570
50635
|
])
|
|
50571
50636
|
),
|
|
50572
50637
|
specifier2,
|
|
50573
|
-
node.parent.parent.parent.
|
|
50638
|
+
node.parent.parent.parent.attributes
|
|
50574
50639
|
),
|
|
50575
50640
|
0 /* None */
|
|
50576
50641
|
);
|
|
@@ -60029,6 +60094,7 @@ function createTypeChecker(host) {
|
|
|
60029
60094
|
let skipParentCounter = 0;
|
|
60030
60095
|
let lastSkippedInfo;
|
|
60031
60096
|
let incompatibleStack;
|
|
60097
|
+
let relationCount = 16e6 - relation.size >> 3;
|
|
60032
60098
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
60033
60099
|
const result = isRelatedTo(
|
|
60034
60100
|
source,
|
|
@@ -60042,8 +60108,19 @@ function createTypeChecker(host) {
|
|
|
60042
60108
|
reportIncompatibleStack();
|
|
60043
60109
|
}
|
|
60044
60110
|
if (overflow) {
|
|
60111
|
+
const id = getRelationKey(
|
|
60112
|
+
source,
|
|
60113
|
+
target,
|
|
60114
|
+
/*intersectionState*/
|
|
60115
|
+
0 /* None */,
|
|
60116
|
+
relation,
|
|
60117
|
+
/*ignoreConstraints*/
|
|
60118
|
+
false
|
|
60119
|
+
);
|
|
60120
|
+
relation.set(id, 4 /* Reported */ | 2 /* Failed */);
|
|
60045
60121
|
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
60046
|
-
const
|
|
60122
|
+
const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
|
|
60123
|
+
const diag2 = error(errorNode || currentNode, message, typeToString(source), typeToString(target));
|
|
60047
60124
|
if (errorOutputContainer) {
|
|
60048
60125
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
|
|
60049
60126
|
}
|
|
@@ -60574,6 +60651,16 @@ function createTypeChecker(host) {
|
|
|
60574
60651
|
}
|
|
60575
60652
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
60576
60653
|
if (source2.flags & 1048576 /* Union */) {
|
|
60654
|
+
if (target2.flags & 1048576 /* Union */) {
|
|
60655
|
+
const sourceOrigin = source2.origin;
|
|
60656
|
+
if (sourceOrigin && sourceOrigin.flags & 2097152 /* Intersection */ && target2.aliasSymbol && contains(sourceOrigin.types, target2)) {
|
|
60657
|
+
return -1 /* True */;
|
|
60658
|
+
}
|
|
60659
|
+
const targetOrigin = target2.origin;
|
|
60660
|
+
if (targetOrigin && targetOrigin.flags & 1048576 /* Union */ && source2.aliasSymbol && contains(targetOrigin.types, source2)) {
|
|
60661
|
+
return -1 /* True */;
|
|
60662
|
+
}
|
|
60663
|
+
}
|
|
60577
60664
|
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
|
|
60578
60665
|
}
|
|
60579
60666
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -60887,6 +60974,10 @@ function createTypeChecker(host) {
|
|
|
60887
60974
|
return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
|
|
60888
60975
|
}
|
|
60889
60976
|
}
|
|
60977
|
+
if (relationCount <= 0) {
|
|
60978
|
+
overflow = true;
|
|
60979
|
+
return 0 /* False */;
|
|
60980
|
+
}
|
|
60890
60981
|
if (!maybeKeys) {
|
|
60891
60982
|
maybeKeys = [];
|
|
60892
60983
|
maybeKeysSet = /* @__PURE__ */ new Set();
|
|
@@ -60980,6 +61071,7 @@ function createTypeChecker(host) {
|
|
|
60980
61071
|
}
|
|
60981
61072
|
} else {
|
|
60982
61073
|
relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
|
|
61074
|
+
relationCount--;
|
|
60983
61075
|
resetMaybeStack(
|
|
60984
61076
|
/*markAllAsSucceeded*/
|
|
60985
61077
|
false
|
|
@@ -60991,6 +61083,7 @@ function createTypeChecker(host) {
|
|
|
60991
61083
|
maybeKeysSet.delete(maybeKeys[i]);
|
|
60992
61084
|
if (markAllAsSucceeded) {
|
|
60993
61085
|
relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
|
|
61086
|
+
relationCount--;
|
|
60994
61087
|
}
|
|
60995
61088
|
}
|
|
60996
61089
|
maybeCount = maybeStart;
|
|
@@ -62386,10 +62479,7 @@ function createTypeChecker(host) {
|
|
|
62386
62479
|
return false;
|
|
62387
62480
|
}
|
|
62388
62481
|
function getVariances(type) {
|
|
62389
|
-
return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */
|
|
62390
|
-
}
|
|
62391
|
-
function isArraySubtype(type) {
|
|
62392
|
-
return length(type.typeParameters) === 1 && length(getBaseTypes(type)) === 1 && isTypeReferenceWithGenericArguments(getBaseTypes(type)[0]) && getVariances(getBaseTypes(type)[0].target) === arrayVariances && length(getTypeArguments(getBaseTypes(type)[0])) === 1 && getTypeArguments(getBaseTypes(type)[0])[0] === type.typeParameters[0];
|
|
62482
|
+
return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */ ? arrayVariances : getVariancesWorker(type.symbol, type.typeParameters);
|
|
62393
62483
|
}
|
|
62394
62484
|
function getAliasVariances(symbol) {
|
|
62395
62485
|
return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters);
|
|
@@ -75826,16 +75916,8 @@ function createTypeChecker(host) {
|
|
|
75826
75916
|
}
|
|
75827
75917
|
function checkImportType(node) {
|
|
75828
75918
|
checkSourceElement(node.argument);
|
|
75829
|
-
if (node.
|
|
75830
|
-
|
|
75831
|
-
if (override) {
|
|
75832
|
-
if (!isNightly()) {
|
|
75833
|
-
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);
|
|
75834
|
-
}
|
|
75835
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
75836
|
-
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
75837
|
-
}
|
|
75838
|
-
}
|
|
75919
|
+
if (node.attributes) {
|
|
75920
|
+
getResolutionModeOverride(node.attributes, grammarErrorOnNode);
|
|
75839
75921
|
}
|
|
75840
75922
|
checkTypeReferenceOrImport(node);
|
|
75841
75923
|
}
|
|
@@ -79799,12 +79881,13 @@ function createTypeChecker(host) {
|
|
|
79799
79881
|
return false;
|
|
79800
79882
|
}
|
|
79801
79883
|
}
|
|
79802
|
-
if (!isImportEqualsDeclaration(node) && node.
|
|
79884
|
+
if (!isImportEqualsDeclaration(node) && node.attributes) {
|
|
79885
|
+
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;
|
|
79803
79886
|
let hasError = false;
|
|
79804
|
-
for (const
|
|
79805
|
-
if (!isStringLiteral(
|
|
79887
|
+
for (const attr of node.attributes.elements) {
|
|
79888
|
+
if (!isStringLiteral(attr.value)) {
|
|
79806
79889
|
hasError = true;
|
|
79807
|
-
error(
|
|
79890
|
+
error(attr.value, diagnostic);
|
|
79808
79891
|
}
|
|
79809
79892
|
}
|
|
79810
79893
|
return !hasError;
|
|
@@ -79936,32 +80019,26 @@ function createTypeChecker(host) {
|
|
|
79936
80019
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
79937
80020
|
}
|
|
79938
80021
|
}
|
|
79939
|
-
function
|
|
80022
|
+
function checkImportAttributes(declaration) {
|
|
79940
80023
|
var _a;
|
|
79941
|
-
|
|
79942
|
-
|
|
79943
|
-
const
|
|
79944
|
-
|
|
79945
|
-
|
|
79946
|
-
|
|
79947
|
-
}
|
|
79948
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
79949
|
-
return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
79950
|
-
}
|
|
80024
|
+
const node = declaration.attributes;
|
|
80025
|
+
if (node) {
|
|
80026
|
+
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
80027
|
+
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
80028
|
+
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
80029
|
+
if (validForTypeAttributes && override) {
|
|
79951
80030
|
return;
|
|
79952
80031
|
}
|
|
79953
80032
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
79954
80033
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
79955
|
-
|
|
79956
|
-
|
|
79957
|
-
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
|
|
79958
|
-
);
|
|
80034
|
+
const message = isImportAttributes2 ? moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_attributes_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext : moduleKind === 199 /* NodeNext */ ? Diagnostics.Import_assertions_are_not_allowed_on_statements_that_compile_to_CommonJS_require_calls : Diagnostics.Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext;
|
|
80035
|
+
return grammarErrorOnNode(node, message);
|
|
79959
80036
|
}
|
|
79960
80037
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
79961
|
-
return grammarErrorOnNode(
|
|
80038
|
+
return grammarErrorOnNode(node, isImportAttributes2 ? Diagnostics.Import_attributes_cannot_be_used_with_type_only_imports_or_exports : Diagnostics.Import_assertions_cannot_be_used_with_type_only_imports_or_exports);
|
|
79962
80039
|
}
|
|
79963
80040
|
if (override) {
|
|
79964
|
-
return grammarErrorOnNode(
|
|
80041
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
79965
80042
|
}
|
|
79966
80043
|
}
|
|
79967
80044
|
}
|
|
@@ -79993,7 +80070,7 @@ function createTypeChecker(host) {
|
|
|
79993
80070
|
}
|
|
79994
80071
|
}
|
|
79995
80072
|
}
|
|
79996
|
-
|
|
80073
|
+
checkImportAttributes(node);
|
|
79997
80074
|
}
|
|
79998
80075
|
function checkImportEqualsDeclaration(node) {
|
|
79999
80076
|
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)) {
|
|
@@ -80066,7 +80143,7 @@ function createTypeChecker(host) {
|
|
|
80066
80143
|
}
|
|
80067
80144
|
}
|
|
80068
80145
|
}
|
|
80069
|
-
|
|
80146
|
+
checkImportAttributes(node);
|
|
80070
80147
|
}
|
|
80071
80148
|
function checkGrammarExportDeclaration(node) {
|
|
80072
80149
|
var _a;
|
|
@@ -83856,12 +83933,12 @@ function createTypeChecker(host) {
|
|
|
83856
83933
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
83857
83934
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
83858
83935
|
if (nodeArguments.length > 1) {
|
|
83859
|
-
const
|
|
83860
|
-
return grammarErrorOnNode(
|
|
83936
|
+
const importAttributesArgument = nodeArguments[1];
|
|
83937
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
83861
83938
|
}
|
|
83862
83939
|
}
|
|
83863
83940
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
83864
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
83941
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
|
|
83865
83942
|
}
|
|
83866
83943
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
83867
83944
|
if (spreadElement) {
|
|
@@ -84128,13 +84205,6 @@ var SymbolTrackerImpl = class _SymbolTrackerImpl {
|
|
|
84128
84205
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
84129
84206
|
}
|
|
84130
84207
|
}
|
|
84131
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
84132
|
-
var _a;
|
|
84133
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
84134
|
-
this.onDiagnosticReported();
|
|
84135
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
84136
|
-
}
|
|
84137
|
-
}
|
|
84138
84208
|
onDiagnosticReported() {
|
|
84139
84209
|
this.context.reportedDiagnostic = true;
|
|
84140
84210
|
}
|
|
@@ -84643,7 +84713,7 @@ var visitEachChildTable = {
|
|
|
84643
84713
|
return context.factory.updateImportTypeNode(
|
|
84644
84714
|
node,
|
|
84645
84715
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
84646
|
-
nodeVisitor(node.
|
|
84716
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes),
|
|
84647
84717
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
84648
84718
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
84649
84719
|
node.isTypeOf
|
|
@@ -85194,20 +85264,20 @@ var visitEachChildTable = {
|
|
|
85194
85264
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
85195
85265
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
85196
85266
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
85197
|
-
nodeVisitor(node.
|
|
85267
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
85198
85268
|
);
|
|
85199
85269
|
},
|
|
85200
|
-
[300 /*
|
|
85201
|
-
return context.factory.
|
|
85270
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
85271
|
+
return context.factory.updateImportAttributes(
|
|
85202
85272
|
node,
|
|
85203
|
-
nodesVisitor(node.elements, visitor,
|
|
85273
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
85204
85274
|
node.multiLine
|
|
85205
85275
|
);
|
|
85206
85276
|
},
|
|
85207
|
-
[301 /*
|
|
85208
|
-
return context.factory.
|
|
85277
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
85278
|
+
return context.factory.updateImportAttribute(
|
|
85209
85279
|
node,
|
|
85210
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
85280
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
85211
85281
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
85212
85282
|
);
|
|
85213
85283
|
},
|
|
@@ -85259,7 +85329,7 @@ var visitEachChildTable = {
|
|
|
85259
85329
|
node.isTypeOnly,
|
|
85260
85330
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
85261
85331
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
85262
|
-
nodeVisitor(node.
|
|
85332
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
85263
85333
|
);
|
|
85264
85334
|
},
|
|
85265
85335
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -88578,7 +88648,7 @@ function transformTypeScript(context) {
|
|
|
88578
88648
|
void 0,
|
|
88579
88649
|
importClause,
|
|
88580
88650
|
node.moduleSpecifier,
|
|
88581
|
-
node.
|
|
88651
|
+
node.attributes
|
|
88582
88652
|
) : void 0;
|
|
88583
88653
|
}
|
|
88584
88654
|
function visitImportClause(node) {
|
|
@@ -88628,7 +88698,7 @@ function transformTypeScript(context) {
|
|
|
88628
88698
|
node.isTypeOnly,
|
|
88629
88699
|
exportClause,
|
|
88630
88700
|
node.moduleSpecifier,
|
|
88631
|
-
node.
|
|
88701
|
+
node.attributes
|
|
88632
88702
|
) : void 0;
|
|
88633
88703
|
}
|
|
88634
88704
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -88662,7 +88732,7 @@ function transformTypeScript(context) {
|
|
|
88662
88732
|
/*importClause*/
|
|
88663
88733
|
void 0,
|
|
88664
88734
|
node.moduleReference.expression,
|
|
88665
|
-
/*
|
|
88735
|
+
/*attributes*/
|
|
88666
88736
|
void 0
|
|
88667
88737
|
),
|
|
88668
88738
|
node
|
|
@@ -96832,7 +96902,7 @@ function transformJsx(context) {
|
|
|
96832
96902
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
96833
96903
|
),
|
|
96834
96904
|
factory2.createStringLiteral(importSource),
|
|
96835
|
-
/*
|
|
96905
|
+
/*attributes*/
|
|
96836
96906
|
void 0
|
|
96837
96907
|
);
|
|
96838
96908
|
setParentRecursive(
|
|
@@ -106239,7 +106309,9 @@ function transformECMAScriptModule(context) {
|
|
|
106239
106309
|
)
|
|
106240
106310
|
])
|
|
106241
106311
|
),
|
|
106242
|
-
factory2.createStringLiteral("module")
|
|
106312
|
+
factory2.createStringLiteral("module"),
|
|
106313
|
+
/*attributes*/
|
|
106314
|
+
void 0
|
|
106243
106315
|
);
|
|
106244
106316
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
106245
106317
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -106356,7 +106428,7 @@ function transformECMAScriptModule(context) {
|
|
|
106356
106428
|
)
|
|
106357
106429
|
),
|
|
106358
106430
|
node.moduleSpecifier,
|
|
106359
|
-
node.
|
|
106431
|
+
node.attributes
|
|
106360
106432
|
);
|
|
106361
106433
|
setOriginalNode(importDecl, node.exportClause);
|
|
106362
106434
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -106809,8 +106881,7 @@ function transformDeclarations(context) {
|
|
|
106809
106881
|
trackReferencedAmbientModule,
|
|
106810
106882
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
106811
106883
|
reportNonlocalAugmentation,
|
|
106812
|
-
reportNonSerializableProperty
|
|
106813
|
-
reportImportTypeNodeResolutionModeOverride
|
|
106884
|
+
reportNonSerializableProperty
|
|
106814
106885
|
};
|
|
106815
106886
|
let errorNameNode;
|
|
106816
106887
|
let errorFallbackNode;
|
|
@@ -106934,11 +107005,6 @@ function transformDeclarations(context) {
|
|
|
106934
107005
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
106935
107006
|
}
|
|
106936
107007
|
}
|
|
106937
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
106938
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
106939
|
-
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));
|
|
106940
|
-
}
|
|
106941
|
-
}
|
|
106942
107008
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
106943
107009
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
106944
107010
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -107443,7 +107509,7 @@ function transformDeclarations(context) {
|
|
|
107443
107509
|
decl.modifiers,
|
|
107444
107510
|
decl.importClause,
|
|
107445
107511
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107446
|
-
|
|
107512
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107447
107513
|
);
|
|
107448
107514
|
}
|
|
107449
107515
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -107459,7 +107525,7 @@ function transformDeclarations(context) {
|
|
|
107459
107525
|
void 0
|
|
107460
107526
|
),
|
|
107461
107527
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107462
|
-
|
|
107528
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107463
107529
|
);
|
|
107464
107530
|
}
|
|
107465
107531
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -107477,7 +107543,7 @@ function transformDeclarations(context) {
|
|
|
107477
107543
|
namedBindings
|
|
107478
107544
|
),
|
|
107479
107545
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107480
|
-
|
|
107546
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107481
107547
|
) : void 0;
|
|
107482
107548
|
}
|
|
107483
107549
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -107492,7 +107558,7 @@ function transformDeclarations(context) {
|
|
|
107492
107558
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
107493
107559
|
),
|
|
107494
107560
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107495
|
-
|
|
107561
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107496
107562
|
);
|
|
107497
107563
|
}
|
|
107498
107564
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -107502,19 +107568,13 @@ function transformDeclarations(context) {
|
|
|
107502
107568
|
/*importClause*/
|
|
107503
107569
|
void 0,
|
|
107504
107570
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
107505
|
-
|
|
107571
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
107506
107572
|
);
|
|
107507
107573
|
}
|
|
107508
107574
|
}
|
|
107509
|
-
function
|
|
107510
|
-
const mode =
|
|
107511
|
-
|
|
107512
|
-
if (!isNightly()) {
|
|
107513
|
-
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));
|
|
107514
|
-
}
|
|
107515
|
-
return assertClause;
|
|
107516
|
-
}
|
|
107517
|
-
return void 0;
|
|
107575
|
+
function tryGetResolutionModeOverride(node) {
|
|
107576
|
+
const mode = getResolutionModeOverride(node);
|
|
107577
|
+
return node && mode !== void 0 ? node : void 0;
|
|
107518
107578
|
}
|
|
107519
107579
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
107520
107580
|
while (length(lateMarkedStatements)) {
|
|
@@ -107800,7 +107860,7 @@ function transformDeclarations(context) {
|
|
|
107800
107860
|
return cleanup(factory2.updateImportTypeNode(
|
|
107801
107861
|
input,
|
|
107802
107862
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
107803
|
-
input.
|
|
107863
|
+
input.attributes,
|
|
107804
107864
|
input.qualifier,
|
|
107805
107865
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
107806
107866
|
input.isTypeOf
|
|
@@ -107854,7 +107914,7 @@ function transformDeclarations(context) {
|
|
|
107854
107914
|
input.isTypeOnly,
|
|
107855
107915
|
input.exportClause,
|
|
107856
107916
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
107857
|
-
|
|
107917
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
107858
107918
|
);
|
|
107859
107919
|
}
|
|
107860
107920
|
case 277 /* ExportAssignment */: {
|
|
@@ -110349,10 +110409,10 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
110349
110409
|
return emitNamedExports(node);
|
|
110350
110410
|
case 281 /* ExportSpecifier */:
|
|
110351
110411
|
return emitExportSpecifier(node);
|
|
110352
|
-
case 300 /*
|
|
110353
|
-
return
|
|
110354
|
-
case 301 /*
|
|
110355
|
-
return
|
|
110412
|
+
case 300 /* ImportAttributes */:
|
|
110413
|
+
return emitImportAttributes(node);
|
|
110414
|
+
case 301 /* ImportAttribute */:
|
|
110415
|
+
return emitImportAttribute(node);
|
|
110356
110416
|
case 282 /* MissingDeclaration */:
|
|
110357
110417
|
return;
|
|
110358
110418
|
case 283 /* ExternalModuleReference */:
|
|
@@ -111127,16 +111187,16 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
111127
111187
|
writeKeyword("import");
|
|
111128
111188
|
writePunctuation("(");
|
|
111129
111189
|
emit(node.argument);
|
|
111130
|
-
if (node.
|
|
111190
|
+
if (node.attributes) {
|
|
111131
111191
|
writePunctuation(",");
|
|
111132
111192
|
writeSpace();
|
|
111133
111193
|
writePunctuation("{");
|
|
111134
111194
|
writeSpace();
|
|
111135
|
-
writeKeyword("assert");
|
|
111195
|
+
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
111136
111196
|
writePunctuation(":");
|
|
111137
111197
|
writeSpace();
|
|
111138
|
-
const elements = node.
|
|
111139
|
-
emitList(node.
|
|
111198
|
+
const elements = node.attributes.elements;
|
|
111199
|
+
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
111140
111200
|
writeSpace();
|
|
111141
111201
|
writePunctuation("}");
|
|
111142
111202
|
}
|
|
@@ -112125,8 +112185,8 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112125
112185
|
writeSpace();
|
|
112126
112186
|
}
|
|
112127
112187
|
emitExpression(node.moduleSpecifier);
|
|
112128
|
-
if (node.
|
|
112129
|
-
emitWithLeadingSpace(node.
|
|
112188
|
+
if (node.attributes) {
|
|
112189
|
+
emitWithLeadingSpace(node.attributes);
|
|
112130
112190
|
}
|
|
112131
112191
|
writeTrailingSemicolon();
|
|
112132
112192
|
}
|
|
@@ -112195,18 +112255,18 @@ function createPrinter(printerOptions = {}, handlers = {}) {
|
|
|
112195
112255
|
writeSpace();
|
|
112196
112256
|
emitExpression(node.moduleSpecifier);
|
|
112197
112257
|
}
|
|
112198
|
-
if (node.
|
|
112199
|
-
emitWithLeadingSpace(node.
|
|
112258
|
+
if (node.attributes) {
|
|
112259
|
+
emitWithLeadingSpace(node.attributes);
|
|
112200
112260
|
}
|
|
112201
112261
|
writeTrailingSemicolon();
|
|
112202
112262
|
}
|
|
112203
|
-
function
|
|
112204
|
-
emitTokenWithComment(
|
|
112263
|
+
function emitImportAttributes(node) {
|
|
112264
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
112205
112265
|
writeSpace();
|
|
112206
112266
|
const elements = node.elements;
|
|
112207
|
-
emitList(node, elements, 526226 /*
|
|
112267
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
112208
112268
|
}
|
|
112209
|
-
function
|
|
112269
|
+
function emitImportAttribute(node) {
|
|
112210
112270
|
emit(node.name);
|
|
112211
112271
|
writePunctuation(":");
|
|
112212
112272
|
writeSpace();
|
|
@@ -115243,8 +115303,6 @@ function getModeForFileReference(ref, containingFileMode) {
|
|
|
115243
115303
|
return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
115244
115304
|
}
|
|
115245
115305
|
function getModeForResolutionAtIndex(file, index) {
|
|
115246
|
-
if (file.impliedNodeFormat === void 0)
|
|
115247
|
-
return void 0;
|
|
115248
115306
|
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
|
|
115249
115307
|
}
|
|
115250
115308
|
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
@@ -115258,42 +115316,48 @@ function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
|
115258
115316
|
return false;
|
|
115259
115317
|
}
|
|
115260
115318
|
function getModeForUsageLocation(file, usage) {
|
|
115261
|
-
var _a
|
|
115262
|
-
if (file.impliedNodeFormat === void 0)
|
|
115263
|
-
return void 0;
|
|
115319
|
+
var _a;
|
|
115264
115320
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
115265
115321
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
115266
115322
|
if (isTypeOnly) {
|
|
115267
|
-
const override =
|
|
115323
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
115268
115324
|
if (override) {
|
|
115269
115325
|
return override;
|
|
115270
115326
|
}
|
|
115271
115327
|
}
|
|
115272
115328
|
}
|
|
115273
115329
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
115274
|
-
const override =
|
|
115330
|
+
const override = getResolutionModeOverride(usage.parent.parent.attributes);
|
|
115275
115331
|
if (override) {
|
|
115276
115332
|
return override;
|
|
115277
115333
|
}
|
|
115278
115334
|
}
|
|
115335
|
+
if (file.impliedNodeFormat === void 0)
|
|
115336
|
+
return void 0;
|
|
115279
115337
|
if (file.impliedNodeFormat !== 99 /* ESNext */) {
|
|
115280
115338
|
return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
115281
115339
|
}
|
|
115282
|
-
const exprParentParent = (
|
|
115340
|
+
const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent;
|
|
115283
115341
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
115284
115342
|
}
|
|
115285
|
-
function
|
|
115286
|
-
if (!
|
|
115343
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
115344
|
+
if (!node)
|
|
115287
115345
|
return void 0;
|
|
115288
|
-
if (length(
|
|
115289
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
115346
|
+
if (length(node.elements) !== 1) {
|
|
115347
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
115348
|
+
node,
|
|
115349
|
+
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
|
|
115350
|
+
);
|
|
115290
115351
|
return void 0;
|
|
115291
115352
|
}
|
|
115292
|
-
const elem =
|
|
115353
|
+
const elem = node.elements[0];
|
|
115293
115354
|
if (!isStringLiteralLike(elem.name))
|
|
115294
115355
|
return void 0;
|
|
115295
115356
|
if (elem.name.text !== "resolution-mode") {
|
|
115296
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
115357
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
115358
|
+
elem.name,
|
|
115359
|
+
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
|
|
115360
|
+
);
|
|
115297
115361
|
return void 0;
|
|
115298
115362
|
}
|
|
115299
115363
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -115588,7 +115652,7 @@ var plainJSErrors = /* @__PURE__ */ new Set([
|
|
|
115588
115652
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
115589
115653
|
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,
|
|
115590
115654
|
Diagnostics.Duplicate_label_0.code,
|
|
115591
|
-
Diagnostics.
|
|
115655
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
115592
115656
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
115593
115657
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
115594
115658
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -117122,7 +117186,7 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117122
117186
|
/*importClause*/
|
|
117123
117187
|
void 0,
|
|
117124
117188
|
externalHelpersModuleReference,
|
|
117125
|
-
/*
|
|
117189
|
+
/*attributes*/
|
|
117126
117190
|
void 0
|
|
117127
117191
|
);
|
|
117128
117192
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -117598,14 +117662,6 @@ function createProgram(rootNamesOrOptions, _options, _host, _oldProgram, _config
|
|
|
117598
117662
|
const fileName = toFileNameLowerCase(ref.fileName);
|
|
117599
117663
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
117600
117664
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
117601
|
-
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
117602
|
-
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
|
|
117603
|
-
kind: 2 /* ResolutionDiagnostics */,
|
|
117604
|
-
diagnostics: [
|
|
117605
|
-
createDiagnosticForRange(file, ref, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)
|
|
117606
|
-
]
|
|
117607
|
-
});
|
|
117608
|
-
}
|
|
117609
117665
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
|
117610
117666
|
}
|
|
117611
117667
|
}
|