@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/typescript.js
CHANGED
|
@@ -35,7 +35,7 @@ var ts = (() => {
|
|
|
35
35
|
"src/compiler/corePublic.ts"() {
|
|
36
36
|
"use strict";
|
|
37
37
|
versionMajorMinor = "5.3";
|
|
38
|
-
version = `${versionMajorMinor}.0-insiders.
|
|
38
|
+
version = `${versionMajorMinor}.0-insiders.20230927`;
|
|
39
39
|
Comparison = /* @__PURE__ */ ((Comparison3) => {
|
|
40
40
|
Comparison3[Comparison3["LessThan"] = -1] = "LessThan";
|
|
41
41
|
Comparison3[Comparison3["EqualTo"] = 0] = "EqualTo";
|
|
@@ -3802,8 +3802,10 @@ ${lanes.join("\n")}
|
|
|
3802
3802
|
SyntaxKind5[SyntaxKind5["DefaultClause"] = 297] = "DefaultClause";
|
|
3803
3803
|
SyntaxKind5[SyntaxKind5["HeritageClause"] = 298] = "HeritageClause";
|
|
3804
3804
|
SyntaxKind5[SyntaxKind5["CatchClause"] = 299] = "CatchClause";
|
|
3805
|
-
SyntaxKind5[SyntaxKind5["
|
|
3806
|
-
SyntaxKind5[SyntaxKind5["
|
|
3805
|
+
SyntaxKind5[SyntaxKind5["ImportAttributes"] = 300] = "ImportAttributes";
|
|
3806
|
+
SyntaxKind5[SyntaxKind5["ImportAttribute"] = 301] = "ImportAttribute";
|
|
3807
|
+
SyntaxKind5[SyntaxKind5["AssertClause"] = 300 /* ImportAttributes */] = "AssertClause";
|
|
3808
|
+
SyntaxKind5[SyntaxKind5["AssertEntry"] = 301 /* ImportAttribute */] = "AssertEntry";
|
|
3807
3809
|
SyntaxKind5[SyntaxKind5["ImportTypeAssertionContainer"] = 302] = "ImportTypeAssertionContainer";
|
|
3808
3810
|
SyntaxKind5[SyntaxKind5["PropertyAssignment"] = 303] = "PropertyAssignment";
|
|
3809
3811
|
SyntaxKind5[SyntaxKind5["ShorthandPropertyAssignment"] = 304] = "ShorthandPropertyAssignment";
|
|
@@ -5102,7 +5104,8 @@ ${lanes.join("\n")}
|
|
|
5102
5104
|
ListFormat2[ListFormat2["ObjectBindingPatternElements"] = 525136] = "ObjectBindingPatternElements";
|
|
5103
5105
|
ListFormat2[ListFormat2["ArrayBindingPatternElements"] = 524880] = "ArrayBindingPatternElements";
|
|
5104
5106
|
ListFormat2[ListFormat2["ObjectLiteralExpressionProperties"] = 526226] = "ObjectLiteralExpressionProperties";
|
|
5105
|
-
ListFormat2[ListFormat2["
|
|
5107
|
+
ListFormat2[ListFormat2["ImportAttributes"] = 526226] = "ImportAttributes";
|
|
5108
|
+
ListFormat2[ListFormat2["ImportClauseEntries"] = 526226 /* ImportAttributes */] = "ImportClauseEntries";
|
|
5106
5109
|
ListFormat2[ListFormat2["ArrayLiteralExpressionElements"] = 8914] = "ArrayLiteralExpressionElements";
|
|
5107
5110
|
ListFormat2[ListFormat2["CommaListElements"] = 528] = "CommaListElements";
|
|
5108
5111
|
ListFormat2[ListFormat2["CallExpressionArguments"] = 2576] = "CallExpressionArguments";
|
|
@@ -6123,12 +6126,11 @@ ${lanes.join("\n")}
|
|
|
6123
6126
|
let activeSession;
|
|
6124
6127
|
let profilePath = "./profile.cpuprofile";
|
|
6125
6128
|
const Buffer2 = require("buffer").Buffer;
|
|
6126
|
-
const
|
|
6127
|
-
const platform = _os.platform();
|
|
6129
|
+
const isWindows = process.platform === "win32";
|
|
6128
6130
|
const useCaseSensitiveFileNames2 = isFileSystemCaseSensitive();
|
|
6129
|
-
const fsRealpath = !!_fs.realpathSync.native ?
|
|
6131
|
+
const fsRealpath = !!_fs.realpathSync.native ? isWindows ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
|
6130
6132
|
const executingFilePath = __filename.endsWith("sys.js") ? _path.join(_path.dirname(__dirname), "__fake__.js") : __filename;
|
|
6131
|
-
const fsSupportsRecursiveFsWatch =
|
|
6133
|
+
const fsSupportsRecursiveFsWatch = isWindows || process.platform === "darwin";
|
|
6132
6134
|
const getCurrentDirectory = memoize(() => process.cwd());
|
|
6133
6135
|
const { watchFile: watchFile2, watchDirectory } = createSystemWatchFunctions({
|
|
6134
6136
|
pollingWatchFileWorker: fsWatchFileWorker,
|
|
@@ -6147,7 +6149,7 @@ ${lanes.join("\n")}
|
|
|
6147
6149
|
tscWatchFile: process.env.TSC_WATCHFILE,
|
|
6148
6150
|
useNonPollingWatchers: !!process.env.TSC_NONPOLLING_WATCHER,
|
|
6149
6151
|
tscWatchDirectory: process.env.TSC_WATCHDIRECTORY,
|
|
6150
|
-
inodeWatching:
|
|
6152
|
+
inodeWatching: !isWindows,
|
|
6151
6153
|
sysLog
|
|
6152
6154
|
});
|
|
6153
6155
|
const nodeSystem = {
|
|
@@ -6332,7 +6334,7 @@ ${lanes.join("\n")}
|
|
|
6332
6334
|
return Buffer2.from && Buffer2.from !== Int8Array.from ? Buffer2.from(input, encoding) : new Buffer2(input, encoding);
|
|
6333
6335
|
}
|
|
6334
6336
|
function isFileSystemCaseSensitive() {
|
|
6335
|
-
if (
|
|
6337
|
+
if (isWindows) {
|
|
6336
6338
|
return false;
|
|
6337
6339
|
}
|
|
6338
6340
|
return !fileExists(swapCase(__filename));
|
|
@@ -7363,9 +7365,8 @@ ${lanes.join("\n")}
|
|
|
7363
7365
|
_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."),
|
|
7364
7366
|
_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."),
|
|
7365
7367
|
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."),
|
|
7366
|
-
|
|
7368
|
+
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"),
|
|
7367
7369
|
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"),
|
|
7368
|
-
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`."),
|
|
7369
7370
|
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`."),
|
|
7370
7371
|
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."),
|
|
7371
7372
|
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."),
|
|
@@ -7375,6 +7376,8 @@ ${lanes.join("\n")}
|
|
|
7375
7376
|
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"`),
|
|
7376
7377
|
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"`),
|
|
7377
7378
|
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"),
|
|
7379
|
+
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."),
|
|
7380
|
+
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'."),
|
|
7378
7381
|
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."),
|
|
7379
7382
|
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."),
|
|
7380
7383
|
catch_or_finally_expected: diag(1472, 1 /* Error */, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -7401,6 +7404,7 @@ ${lanes.join("\n")}
|
|
|
7401
7404
|
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."),
|
|
7402
7405
|
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."),
|
|
7403
7406
|
_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."),
|
|
7407
|
+
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."),
|
|
7404
7408
|
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."),
|
|
7405
7409
|
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."),
|
|
7406
7410
|
Call_signature_return_types_0_and_1_are_incompatible: diag(
|
|
@@ -7930,15 +7934,15 @@ ${lanes.join("\n")}
|
|
|
7930
7934
|
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}'?"),
|
|
7931
7935
|
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'."),
|
|
7932
7936
|
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."),
|
|
7937
|
+
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'."),
|
|
7933
7938
|
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}'?"),
|
|
7934
7939
|
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."),
|
|
7935
7940
|
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}'?"),
|
|
7936
|
-
|
|
7941
|
+
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."),
|
|
7937
7942
|
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."),
|
|
7938
7943
|
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."),
|
|
7939
7944
|
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."),
|
|
7940
7945
|
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"),
|
|
7941
|
-
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'."),
|
|
7942
7946
|
_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?"),
|
|
7943
7947
|
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."),
|
|
7944
7948
|
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."),
|
|
@@ -7952,6 +7956,10 @@ ${lanes.join("\n")}
|
|
|
7952
7956
|
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."),
|
|
7953
7957
|
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."),
|
|
7954
7958
|
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."),
|
|
7959
|
+
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."),
|
|
7960
|
+
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."),
|
|
7961
|
+
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."),
|
|
7962
|
+
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}'."),
|
|
7955
7963
|
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}'."),
|
|
7956
7964
|
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}'."),
|
|
7957
7965
|
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}'."),
|
|
@@ -8060,7 +8068,6 @@ ${lanes.join("\n")}
|
|
|
8060
8068
|
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}'."),
|
|
8061
8069
|
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}'?"),
|
|
8062
8070
|
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'."),
|
|
8063
|
-
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'."),
|
|
8064
8071
|
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."),
|
|
8065
8072
|
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."),
|
|
8066
8073
|
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}'."),
|
|
@@ -12142,12 +12149,12 @@ ${lanes.join("\n")}
|
|
|
12142
12149
|
function isTypeOnlyImportOrExportDeclaration(node) {
|
|
12143
12150
|
return isTypeOnlyImportDeclaration(node) || isTypeOnlyExportDeclaration(node);
|
|
12144
12151
|
}
|
|
12145
|
-
function isAssertionKey(node) {
|
|
12146
|
-
return isStringLiteral(node) || isIdentifier(node);
|
|
12147
|
-
}
|
|
12148
12152
|
function isStringTextContainingNode(node) {
|
|
12149
12153
|
return node.kind === 11 /* StringLiteral */ || isTemplateLiteralKind(node.kind);
|
|
12150
12154
|
}
|
|
12155
|
+
function isImportAttributeName(node) {
|
|
12156
|
+
return isStringLiteral(node) || isIdentifier(node);
|
|
12157
|
+
}
|
|
12151
12158
|
function isGeneratedIdentifier(node) {
|
|
12152
12159
|
var _a;
|
|
12153
12160
|
return isIdentifier(node) && ((_a = node.emitNode) == null ? void 0 : _a.autoGenerate) !== void 0;
|
|
@@ -16017,9 +16024,6 @@ ${lanes.join("\n")}
|
|
|
16017
16024
|
function getIndentSize() {
|
|
16018
16025
|
return indentStrings[1].length;
|
|
16019
16026
|
}
|
|
16020
|
-
function isNightly() {
|
|
16021
|
-
return version.includes("-dev") || version.includes("-insiders");
|
|
16022
|
-
}
|
|
16023
16027
|
function createTextWriter(newLine) {
|
|
16024
16028
|
var output;
|
|
16025
16029
|
var indent3;
|
|
@@ -18887,6 +18891,12 @@ ${lanes.join("\n")}
|
|
|
18887
18891
|
function isExpandoPropertyDeclaration(declaration) {
|
|
18888
18892
|
return !!declaration && (isPropertyAccessExpression(declaration) || isElementAccessExpression(declaration) || isBinaryExpression(declaration));
|
|
18889
18893
|
}
|
|
18894
|
+
function hasResolutionModeOverride(node) {
|
|
18895
|
+
if (node === void 0) {
|
|
18896
|
+
return false;
|
|
18897
|
+
}
|
|
18898
|
+
return !!getResolutionModeOverride(node.attributes);
|
|
18899
|
+
}
|
|
18890
18900
|
var resolvingEmptyArray, externalHelpersModuleNameText, defaultMaximumTruncationLength, noTruncationMaximumTruncationLength, stringWriter, getScriptTargetFeatures, GetLiteralTextFlags, fullTripleSlashReferencePathRegEx, fullTripleSlashReferenceTypeReferenceDirectiveRegEx, fullTripleSlashLibReferenceRegEx, fullTripleSlashAMDReferencePathRegEx, fullTripleSlashAMDModuleRegEx, defaultLibReferenceRegEx, AssignmentKind, FunctionFlags, Associativity, OperatorPrecedence, templateSubstitutionRegExp, doubleQuoteEscapedCharsRegExp, singleQuoteEscapedCharsRegExp, backtickQuoteEscapedCharsRegExp, escapedCharsMap, nonAsciiCharacters, jsxDoubleQuoteEscapedCharsRegExp, jsxSingleQuoteEscapedCharsRegExp, jsxEscapedCharsMap, indentStrings, base64Digits, carriageReturnLineFeed, lineFeed, objectAllocator, objectAllocatorPatchers, localizedDiagnosticMessages, reservedCharacterPattern, wildcardCharCodes, commonPackageFolders, implicitExcludePathRegexPattern, filesMatcher, directoriesMatcher, excludeMatcher, wildcardMatchers, supportedTSExtensions, supportedTSExtensionsFlat, supportedTSExtensionsWithJson, supportedTSExtensionsForExtractExtension, supportedJSExtensions, supportedJSExtensionsFlat, allSupportedExtensions, allSupportedExtensionsWithJson, supportedDeclarationExtensions, supportedTSImplementationExtensions, extensionsNotSupportingExtensionlessResolution, ModuleSpecifierEnding, extensionsToRemove, emptyFileSystemEntries;
|
|
18891
18901
|
var init_utilities = __esm({
|
|
18892
18902
|
"src/compiler/utilities.ts"() {
|
|
@@ -20356,6 +20366,10 @@ ${lanes.join("\n")}
|
|
|
20356
20366
|
updateAssertEntry,
|
|
20357
20367
|
createImportTypeAssertionContainer,
|
|
20358
20368
|
updateImportTypeAssertionContainer,
|
|
20369
|
+
createImportAttributes,
|
|
20370
|
+
updateImportAttributes,
|
|
20371
|
+
createImportAttribute,
|
|
20372
|
+
updateImportAttribute,
|
|
20359
20373
|
createNamespaceImport,
|
|
20360
20374
|
updateNamespaceImport,
|
|
20361
20375
|
createNamespaceExport,
|
|
@@ -21624,18 +21638,21 @@ ${lanes.join("\n")}
|
|
|
21624
21638
|
function updateTemplateLiteralType(node, head, templateSpans) {
|
|
21625
21639
|
return node.head !== head || node.templateSpans !== templateSpans ? update(createTemplateLiteralType(head, templateSpans), node) : node;
|
|
21626
21640
|
}
|
|
21627
|
-
function createImportTypeNode(argument,
|
|
21641
|
+
function createImportTypeNode(argument, attributes, qualifier, typeArguments, isTypeOf = false) {
|
|
21628
21642
|
const node = createBaseNode(205 /* ImportType */);
|
|
21629
21643
|
node.argument = argument;
|
|
21630
|
-
node.
|
|
21644
|
+
node.attributes = attributes;
|
|
21645
|
+
if (node.assertions && node.assertions.assertClause && node.attributes) {
|
|
21646
|
+
node.assertions.assertClause = node.attributes;
|
|
21647
|
+
}
|
|
21631
21648
|
node.qualifier = qualifier;
|
|
21632
21649
|
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
21633
21650
|
node.isTypeOf = isTypeOf;
|
|
21634
21651
|
node.transformFlags = 1 /* ContainsTypeScript */;
|
|
21635
21652
|
return node;
|
|
21636
21653
|
}
|
|
21637
|
-
function updateImportTypeNode(node, argument,
|
|
21638
|
-
return node.argument !== argument || node.
|
|
21654
|
+
function updateImportTypeNode(node, argument, attributes, qualifier, typeArguments, isTypeOf = node.isTypeOf) {
|
|
21655
|
+
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;
|
|
21639
21656
|
}
|
|
21640
21657
|
function createParenthesizedType(type) {
|
|
21641
21658
|
const node = createBaseNode(196 /* ParenthesizedType */);
|
|
@@ -22765,19 +22782,19 @@ ${lanes.join("\n")}
|
|
|
22765
22782
|
function updateImportEqualsDeclaration(node, modifiers, isTypeOnly, name, moduleReference) {
|
|
22766
22783
|
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.name !== name || node.moduleReference !== moduleReference ? update(createImportEqualsDeclaration(modifiers, isTypeOnly, name, moduleReference), node) : node;
|
|
22767
22784
|
}
|
|
22768
|
-
function createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
22785
|
+
function createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes) {
|
|
22769
22786
|
const node = createBaseNode(272 /* ImportDeclaration */);
|
|
22770
22787
|
node.modifiers = asNodeArray(modifiers);
|
|
22771
22788
|
node.importClause = importClause;
|
|
22772
22789
|
node.moduleSpecifier = moduleSpecifier;
|
|
22773
|
-
node.assertClause =
|
|
22790
|
+
node.attributes = node.assertClause = attributes;
|
|
22774
22791
|
node.transformFlags |= propagateChildFlags(node.importClause) | propagateChildFlags(node.moduleSpecifier);
|
|
22775
22792
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
22776
22793
|
node.jsDoc = void 0;
|
|
22777
22794
|
return node;
|
|
22778
22795
|
}
|
|
22779
|
-
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier,
|
|
22780
|
-
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
22796
|
+
function updateImportDeclaration(node, modifiers, importClause, moduleSpecifier, attributes) {
|
|
22797
|
+
return node.modifiers !== modifiers || node.importClause !== importClause || node.moduleSpecifier !== moduleSpecifier || node.attributes !== attributes ? update(createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes), node) : node;
|
|
22781
22798
|
}
|
|
22782
22799
|
function createImportClause(isTypeOnly, name, namedBindings) {
|
|
22783
22800
|
const node = createBaseDeclaration(273 /* ImportClause */);
|
|
@@ -22798,6 +22815,7 @@ ${lanes.join("\n")}
|
|
|
22798
22815
|
const node = createBaseNode(300 /* AssertClause */);
|
|
22799
22816
|
node.elements = createNodeArray(elements);
|
|
22800
22817
|
node.multiLine = multiLine;
|
|
22818
|
+
node.token = 132 /* AssertKeyword */;
|
|
22801
22819
|
node.transformFlags |= 4 /* ContainsESNext */;
|
|
22802
22820
|
return node;
|
|
22803
22821
|
}
|
|
@@ -22823,6 +22841,27 @@ ${lanes.join("\n")}
|
|
|
22823
22841
|
function updateImportTypeAssertionContainer(node, clause, multiLine) {
|
|
22824
22842
|
return node.assertClause !== clause || node.multiLine !== multiLine ? update(createImportTypeAssertionContainer(clause, multiLine), node) : node;
|
|
22825
22843
|
}
|
|
22844
|
+
function createImportAttributes(elements, multiLine, token) {
|
|
22845
|
+
const node = createBaseNode(300 /* ImportAttributes */);
|
|
22846
|
+
node.token = token ?? 118 /* WithKeyword */;
|
|
22847
|
+
node.elements = createNodeArray(elements);
|
|
22848
|
+
node.multiLine = multiLine;
|
|
22849
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
22850
|
+
return node;
|
|
22851
|
+
}
|
|
22852
|
+
function updateImportAttributes(node, elements, multiLine) {
|
|
22853
|
+
return node.elements !== elements || node.multiLine !== multiLine ? update(createImportAttributes(elements, multiLine, node.token), node) : node;
|
|
22854
|
+
}
|
|
22855
|
+
function createImportAttribute(name, value) {
|
|
22856
|
+
const node = createBaseNode(301 /* ImportAttribute */);
|
|
22857
|
+
node.name = name;
|
|
22858
|
+
node.value = value;
|
|
22859
|
+
node.transformFlags |= 4 /* ContainsESNext */;
|
|
22860
|
+
return node;
|
|
22861
|
+
}
|
|
22862
|
+
function updateImportAttribute(node, name, value) {
|
|
22863
|
+
return node.name !== name || node.value !== value ? update(createImportAttribute(name, value), node) : node;
|
|
22864
|
+
}
|
|
22826
22865
|
function createNamespaceImport(name) {
|
|
22827
22866
|
const node = createBaseDeclaration(274 /* NamespaceImport */);
|
|
22828
22867
|
node.name = name;
|
|
@@ -22883,20 +22922,20 @@ ${lanes.join("\n")}
|
|
|
22883
22922
|
function updateExportAssignment(node, modifiers, expression) {
|
|
22884
22923
|
return node.modifiers !== modifiers || node.expression !== expression ? update(createExportAssignment2(modifiers, node.isExportEquals, expression), node) : node;
|
|
22885
22924
|
}
|
|
22886
|
-
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
22925
|
+
function createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
22887
22926
|
const node = createBaseDeclaration(278 /* ExportDeclaration */);
|
|
22888
22927
|
node.modifiers = asNodeArray(modifiers);
|
|
22889
22928
|
node.isTypeOnly = isTypeOnly;
|
|
22890
22929
|
node.exportClause = exportClause;
|
|
22891
22930
|
node.moduleSpecifier = moduleSpecifier;
|
|
22892
|
-
node.assertClause =
|
|
22931
|
+
node.attributes = node.assertClause = attributes;
|
|
22893
22932
|
node.transformFlags |= propagateChildrenFlags(node.modifiers) | propagateChildFlags(node.exportClause) | propagateChildFlags(node.moduleSpecifier);
|
|
22894
22933
|
node.transformFlags &= ~67108864 /* ContainsPossibleTopLevelAwait */;
|
|
22895
22934
|
node.jsDoc = void 0;
|
|
22896
22935
|
return node;
|
|
22897
22936
|
}
|
|
22898
|
-
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
22899
|
-
return node.modifiers !== modifiers || node.isTypeOnly !== isTypeOnly || node.exportClause !== exportClause || node.moduleSpecifier !== moduleSpecifier || node.
|
|
22937
|
+
function updateExportDeclaration(node, modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes) {
|
|
22938
|
+
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;
|
|
22900
22939
|
}
|
|
22901
22940
|
function finishUpdateExportDeclaration(updated, original) {
|
|
22902
22941
|
if (updated !== original) {
|
|
@@ -24223,7 +24262,7 @@ ${lanes.join("\n")}
|
|
|
24223
24262
|
} else {
|
|
24224
24263
|
modifierArray = modifiers;
|
|
24225
24264
|
}
|
|
24226
|
-
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) ? updatePropertyDeclaration2(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.
|
|
24265
|
+
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) ? updatePropertyDeclaration2(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);
|
|
24227
24266
|
}
|
|
24228
24267
|
function updateModifierLike(node, modifierArray) {
|
|
24229
24268
|
return isParameter(node) ? updateParameterDeclaration(node, modifierArray, node.dotDotDotToken, node.name, node.questionToken, node.type, node.initializer) : isPropertyDeclaration(node) ? updatePropertyDeclaration2(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);
|
|
@@ -26599,6 +26638,12 @@ ${lanes.join("\n")}
|
|
|
26599
26638
|
function isAssertEntry(node) {
|
|
26600
26639
|
return node.kind === 301 /* AssertEntry */;
|
|
26601
26640
|
}
|
|
26641
|
+
function isImportAttributes(node) {
|
|
26642
|
+
return node.kind === 300 /* ImportAttributes */;
|
|
26643
|
+
}
|
|
26644
|
+
function isImportAttribute(node) {
|
|
26645
|
+
return node.kind === 301 /* ImportAttribute */;
|
|
26646
|
+
}
|
|
26602
26647
|
function isNamespaceImport(node) {
|
|
26603
26648
|
return node.kind === 274 /* NamespaceImport */;
|
|
26604
26649
|
}
|
|
@@ -27326,7 +27371,7 @@ ${lanes.join("\n")}
|
|
|
27326
27371
|
namedBindings
|
|
27327
27372
|
),
|
|
27328
27373
|
nodeFactory.createStringLiteral(externalHelpersModuleNameText),
|
|
27329
|
-
/*
|
|
27374
|
+
/*attributes*/
|
|
27330
27375
|
void 0
|
|
27331
27376
|
);
|
|
27332
27377
|
addInternalEmitFlags(externalHelpersImportDeclaration, 2 /* NeverApplyImportHelper */);
|
|
@@ -28503,7 +28548,7 @@ ${lanes.join("\n")}
|
|
|
28503
28548
|
return visitNode2(cbNode, node.typeParameter);
|
|
28504
28549
|
},
|
|
28505
28550
|
[205 /* ImportType */]: function forEachChildInImportType(node, cbNode, cbNodes) {
|
|
28506
|
-
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.
|
|
28551
|
+
return visitNode2(cbNode, node.argument) || visitNode2(cbNode, node.attributes) || visitNode2(cbNode, node.qualifier) || visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
28507
28552
|
},
|
|
28508
28553
|
[302 /* ImportTypeAssertionContainer */]: function forEachChildInImportTypeAssertionContainer(node, cbNode, _cbNodes) {
|
|
28509
28554
|
return visitNode2(cbNode, node.assertClause);
|
|
@@ -28677,15 +28722,15 @@ ${lanes.join("\n")}
|
|
|
28677
28722
|
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.name) || visitNode2(cbNode, node.moduleReference);
|
|
28678
28723
|
},
|
|
28679
28724
|
[272 /* ImportDeclaration */]: function forEachChildInImportDeclaration(node, cbNode, cbNodes) {
|
|
28680
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
28725
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.importClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
28681
28726
|
},
|
|
28682
28727
|
[273 /* ImportClause */]: function forEachChildInImportClause(node, cbNode, _cbNodes) {
|
|
28683
28728
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.namedBindings);
|
|
28684
28729
|
},
|
|
28685
|
-
[300 /*
|
|
28730
|
+
[300 /* ImportAttributes */]: function forEachChildInImportAttributes(node, cbNode, cbNodes) {
|
|
28686
28731
|
return visitNodes(cbNode, cbNodes, node.elements);
|
|
28687
28732
|
},
|
|
28688
|
-
[301 /*
|
|
28733
|
+
[301 /* ImportAttribute */]: function forEachChildInImportAttribute(node, cbNode, _cbNodes) {
|
|
28689
28734
|
return visitNode2(cbNode, node.name) || visitNode2(cbNode, node.value);
|
|
28690
28735
|
},
|
|
28691
28736
|
[270 /* NamespaceExportDeclaration */]: function forEachChildInNamespaceExportDeclaration(node, cbNode, cbNodes) {
|
|
@@ -28700,7 +28745,7 @@ ${lanes.join("\n")}
|
|
|
28700
28745
|
[275 /* NamedImports */]: forEachChildInNamedImportsOrExports,
|
|
28701
28746
|
[279 /* NamedExports */]: forEachChildInNamedImportsOrExports,
|
|
28702
28747
|
[278 /* ExportDeclaration */]: function forEachChildInExportDeclaration(node, cbNode, cbNodes) {
|
|
28703
|
-
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.
|
|
28748
|
+
return visitNodes(cbNode, cbNodes, node.modifiers) || visitNode2(cbNode, node.exportClause) || visitNode2(cbNode, node.moduleSpecifier) || visitNode2(cbNode, node.attributes);
|
|
28704
28749
|
},
|
|
28705
28750
|
[276 /* ImportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
28706
28751
|
[281 /* ExportSpecifier */]: forEachChildInImportOrExportSpecifier,
|
|
@@ -29794,7 +29839,7 @@ ${lanes.join("\n")}
|
|
|
29794
29839
|
function isLiteralPropertyName() {
|
|
29795
29840
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */ || token() === 9 /* NumericLiteral */;
|
|
29796
29841
|
}
|
|
29797
|
-
function
|
|
29842
|
+
function isImportAttributeName2() {
|
|
29798
29843
|
return tokenIsIdentifierOrKeyword(token()) || token() === 11 /* StringLiteral */;
|
|
29799
29844
|
}
|
|
29800
29845
|
function parsePropertyNameWorker(allowComputedPropertyNames) {
|
|
@@ -29913,8 +29958,8 @@ ${lanes.join("\n")}
|
|
|
29913
29958
|
return isLiteralPropertyName();
|
|
29914
29959
|
case 9 /* ObjectBindingElements */:
|
|
29915
29960
|
return token() === 23 /* OpenBracketToken */ || token() === 26 /* DotDotDotToken */ || isLiteralPropertyName();
|
|
29916
|
-
case 24 /*
|
|
29917
|
-
return
|
|
29961
|
+
case 24 /* ImportAttributes */:
|
|
29962
|
+
return isImportAttributeName2();
|
|
29918
29963
|
case 7 /* HeritageClauseElement */:
|
|
29919
29964
|
if (token() === 19 /* OpenBraceToken */) {
|
|
29920
29965
|
return lookAhead(isValidHeritageClauseObjectLiteral);
|
|
@@ -30017,7 +30062,7 @@ ${lanes.join("\n")}
|
|
|
30017
30062
|
case 12 /* ObjectLiteralMembers */:
|
|
30018
30063
|
case 9 /* ObjectBindingElements */:
|
|
30019
30064
|
case 23 /* ImportOrExportSpecifiers */:
|
|
30020
|
-
case 24 /*
|
|
30065
|
+
case 24 /* ImportAttributes */:
|
|
30021
30066
|
return token() === 20 /* CloseBraceToken */;
|
|
30022
30067
|
case 3 /* SwitchClauseStatements */:
|
|
30023
30068
|
return token() === 20 /* CloseBraceToken */ || token() === 84 /* CaseKeyword */ || token() === 90 /* DefaultKeyword */;
|
|
@@ -30323,7 +30368,7 @@ ${lanes.join("\n")}
|
|
|
30323
30368
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30324
30369
|
case 14 /* JsxChildren */:
|
|
30325
30370
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
30326
|
-
case 24 /*
|
|
30371
|
+
case 24 /* ImportAttributes */:
|
|
30327
30372
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected);
|
|
30328
30373
|
case 25 /* JSDocComment */:
|
|
30329
30374
|
return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
|
@@ -31198,28 +31243,6 @@ ${lanes.join("\n")}
|
|
|
31198
31243
|
nextToken();
|
|
31199
31244
|
return token() === 102 /* ImportKeyword */;
|
|
31200
31245
|
}
|
|
31201
|
-
function parseImportTypeAssertions() {
|
|
31202
|
-
const pos = getNodePos();
|
|
31203
|
-
const openBracePosition = scanner2.getTokenStart();
|
|
31204
|
-
parseExpected(19 /* OpenBraceToken */);
|
|
31205
|
-
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
31206
|
-
parseExpected(132 /* AssertKeyword */);
|
|
31207
|
-
parseExpected(59 /* ColonToken */);
|
|
31208
|
-
const clause = parseAssertClause(
|
|
31209
|
-
/*skipAssertKeyword*/
|
|
31210
|
-
true
|
|
31211
|
-
);
|
|
31212
|
-
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
31213
|
-
const lastError = lastOrUndefined(parseDiagnostics);
|
|
31214
|
-
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
31215
|
-
addRelatedInfo(
|
|
31216
|
-
lastError,
|
|
31217
|
-
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
31218
|
-
);
|
|
31219
|
-
}
|
|
31220
|
-
}
|
|
31221
|
-
return finishNode(factory2.createImportTypeAssertionContainer(clause, multiLine), pos);
|
|
31222
|
-
}
|
|
31223
31246
|
function parseImportType() {
|
|
31224
31247
|
sourceFlags |= 4194304 /* PossiblyContainsDynamicImport */;
|
|
31225
31248
|
const pos = getNodePos();
|
|
@@ -31227,14 +31250,36 @@ ${lanes.join("\n")}
|
|
|
31227
31250
|
parseExpected(102 /* ImportKeyword */);
|
|
31228
31251
|
parseExpected(21 /* OpenParenToken */);
|
|
31229
31252
|
const type = parseType();
|
|
31230
|
-
let
|
|
31253
|
+
let attributes;
|
|
31231
31254
|
if (parseOptional(28 /* CommaToken */)) {
|
|
31232
|
-
|
|
31255
|
+
const openBracePosition = scanner2.getTokenStart();
|
|
31256
|
+
parseExpected(19 /* OpenBraceToken */);
|
|
31257
|
+
const currentToken2 = token();
|
|
31258
|
+
if (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) {
|
|
31259
|
+
nextToken();
|
|
31260
|
+
} else {
|
|
31261
|
+
parseErrorAtCurrentToken(Diagnostics._0_expected, tokenToString(118 /* WithKeyword */));
|
|
31262
|
+
}
|
|
31263
|
+
parseExpected(59 /* ColonToken */);
|
|
31264
|
+
attributes = parseImportAttributes(
|
|
31265
|
+
currentToken2,
|
|
31266
|
+
/*skipKeyword*/
|
|
31267
|
+
true
|
|
31268
|
+
);
|
|
31269
|
+
if (!parseExpected(20 /* CloseBraceToken */)) {
|
|
31270
|
+
const lastError = lastOrUndefined(parseDiagnostics);
|
|
31271
|
+
if (lastError && lastError.code === Diagnostics._0_expected.code) {
|
|
31272
|
+
addRelatedInfo(
|
|
31273
|
+
lastError,
|
|
31274
|
+
createDetachedDiagnostic(fileName, sourceText, openBracePosition, 1, Diagnostics.The_parser_expected_to_find_a_1_to_match_the_0_token_here, "{", "}")
|
|
31275
|
+
);
|
|
31276
|
+
}
|
|
31277
|
+
}
|
|
31233
31278
|
}
|
|
31234
31279
|
parseExpected(22 /* CloseParenToken */);
|
|
31235
31280
|
const qualifier = parseOptional(25 /* DotToken */) ? parseEntityNameOfTypeReference() : void 0;
|
|
31236
31281
|
const typeArguments = parseTypeArgumentsOfTypeReference();
|
|
31237
|
-
return finishNode(factory2.createImportTypeNode(type,
|
|
31282
|
+
return finishNode(factory2.createImportTypeNode(type, attributes, qualifier, typeArguments, isTypeOf), pos);
|
|
31238
31283
|
}
|
|
31239
31284
|
function nextTokenIsNumericOrBigIntLiteral() {
|
|
31240
31285
|
nextToken();
|
|
@@ -34296,15 +34341,16 @@ ${lanes.join("\n")}
|
|
|
34296
34341
|
parseExpected(161 /* FromKeyword */);
|
|
34297
34342
|
}
|
|
34298
34343
|
const moduleSpecifier = parseModuleSpecifier();
|
|
34299
|
-
|
|
34300
|
-
|
|
34301
|
-
|
|
34344
|
+
const currentToken2 = token();
|
|
34345
|
+
let attributes;
|
|
34346
|
+
if ((currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
34347
|
+
attributes = parseImportAttributes(currentToken2);
|
|
34302
34348
|
}
|
|
34303
34349
|
parseSemicolon();
|
|
34304
|
-
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier,
|
|
34350
|
+
const node = factory2.createImportDeclaration(modifiers, importClause, moduleSpecifier, attributes);
|
|
34305
34351
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
34306
34352
|
}
|
|
34307
|
-
function
|
|
34353
|
+
function parseImportAttribute() {
|
|
34308
34354
|
const pos = getNodePos();
|
|
34309
34355
|
const name = tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(11 /* StringLiteral */);
|
|
34310
34356
|
parseExpected(59 /* ColonToken */);
|
|
@@ -34312,19 +34358,19 @@ ${lanes.join("\n")}
|
|
|
34312
34358
|
/*allowReturnTypeInArrowFunction*/
|
|
34313
34359
|
true
|
|
34314
34360
|
);
|
|
34315
|
-
return finishNode(factory2.
|
|
34361
|
+
return finishNode(factory2.createImportAttribute(name, value), pos);
|
|
34316
34362
|
}
|
|
34317
|
-
function
|
|
34363
|
+
function parseImportAttributes(token2, skipKeyword) {
|
|
34318
34364
|
const pos = getNodePos();
|
|
34319
|
-
if (!
|
|
34320
|
-
parseExpected(
|
|
34365
|
+
if (!skipKeyword) {
|
|
34366
|
+
parseExpected(token2);
|
|
34321
34367
|
}
|
|
34322
34368
|
const openBracePosition = scanner2.getTokenStart();
|
|
34323
34369
|
if (parseExpected(19 /* OpenBraceToken */)) {
|
|
34324
34370
|
const multiLine = scanner2.hasPrecedingLineBreak();
|
|
34325
34371
|
const elements = parseDelimitedList(
|
|
34326
|
-
24 /*
|
|
34327
|
-
|
|
34372
|
+
24 /* ImportAttributes */,
|
|
34373
|
+
parseImportAttribute,
|
|
34328
34374
|
/*considerSemicolonAsDelimiter*/
|
|
34329
34375
|
true
|
|
34330
34376
|
);
|
|
@@ -34337,7 +34383,7 @@ ${lanes.join("\n")}
|
|
|
34337
34383
|
);
|
|
34338
34384
|
}
|
|
34339
34385
|
}
|
|
34340
|
-
return finishNode(factory2.
|
|
34386
|
+
return finishNode(factory2.createImportAttributes(elements, multiLine, token2), pos);
|
|
34341
34387
|
} else {
|
|
34342
34388
|
const elements = createNodeArray(
|
|
34343
34389
|
[],
|
|
@@ -34347,10 +34393,11 @@ ${lanes.join("\n")}
|
|
|
34347
34393
|
/*hasTrailingComma*/
|
|
34348
34394
|
false
|
|
34349
34395
|
);
|
|
34350
|
-
return finishNode(factory2.
|
|
34396
|
+
return finishNode(factory2.createImportAttributes(
|
|
34351
34397
|
elements,
|
|
34352
34398
|
/*multiLine*/
|
|
34353
|
-
false
|
|
34399
|
+
false,
|
|
34400
|
+
token2
|
|
34354
34401
|
), pos);
|
|
34355
34402
|
}
|
|
34356
34403
|
}
|
|
@@ -34482,7 +34529,7 @@ ${lanes.join("\n")}
|
|
|
34482
34529
|
);
|
|
34483
34530
|
let exportClause;
|
|
34484
34531
|
let moduleSpecifier;
|
|
34485
|
-
let
|
|
34532
|
+
let attributes;
|
|
34486
34533
|
const isTypeOnly = parseOptional(156 /* TypeKeyword */);
|
|
34487
34534
|
const namespaceExportPos = getNodePos();
|
|
34488
34535
|
if (parseOptional(42 /* AsteriskToken */)) {
|
|
@@ -34498,12 +34545,13 @@ ${lanes.join("\n")}
|
|
|
34498
34545
|
moduleSpecifier = parseModuleSpecifier();
|
|
34499
34546
|
}
|
|
34500
34547
|
}
|
|
34501
|
-
|
|
34502
|
-
|
|
34548
|
+
const currentToken2 = token();
|
|
34549
|
+
if (moduleSpecifier && (currentToken2 === 118 /* WithKeyword */ || currentToken2 === 132 /* AssertKeyword */) && !scanner2.hasPrecedingLineBreak()) {
|
|
34550
|
+
attributes = parseImportAttributes(currentToken2);
|
|
34503
34551
|
}
|
|
34504
34552
|
parseSemicolon();
|
|
34505
34553
|
setAwaitContext(savedAwaitContext);
|
|
34506
|
-
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier,
|
|
34554
|
+
const node = factory2.createExportDeclaration(modifiers, isTypeOnly, exportClause, moduleSpecifier, attributes);
|
|
34507
34555
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
34508
34556
|
}
|
|
34509
34557
|
function parseExportAssignment(pos, hasJSDoc, modifiers) {
|
|
@@ -34553,7 +34601,7 @@ ${lanes.join("\n")}
|
|
|
34553
34601
|
ParsingContext2[ParsingContext2["TupleElementTypes"] = 21] = "TupleElementTypes";
|
|
34554
34602
|
ParsingContext2[ParsingContext2["HeritageClauses"] = 22] = "HeritageClauses";
|
|
34555
34603
|
ParsingContext2[ParsingContext2["ImportOrExportSpecifiers"] = 23] = "ImportOrExportSpecifiers";
|
|
34556
|
-
ParsingContext2[ParsingContext2["
|
|
34604
|
+
ParsingContext2[ParsingContext2["ImportAttributes"] = 24] = "ImportAttributes";
|
|
34557
34605
|
ParsingContext2[ParsingContext2["JSDocComment"] = 25] = "JSDocComment";
|
|
34558
34606
|
ParsingContext2[ParsingContext2["Count"] = 26] = "Count";
|
|
34559
34607
|
})(ParsingContext || (ParsingContext = {}));
|
|
@@ -39407,10 +39455,15 @@ ${lanes.join("\n")}
|
|
|
39407
39455
|
const failedLookupLocations = [];
|
|
39408
39456
|
const affectingLocations = [];
|
|
39409
39457
|
let features = getNodeResolutionFeatures(options);
|
|
39410
|
-
if (resolutionMode
|
|
39458
|
+
if (resolutionMode !== void 0) {
|
|
39459
|
+
features |= 30 /* AllFeatures */;
|
|
39460
|
+
}
|
|
39461
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
39462
|
+
if (resolutionMode === 99 /* ESNext */ && (3 /* Node16 */ <= moduleResolution && moduleResolution <= 99 /* NodeNext */)) {
|
|
39411
39463
|
features |= 32 /* EsmMode */;
|
|
39412
39464
|
}
|
|
39413
|
-
const
|
|
39465
|
+
const useImportCondition = resolutionMode === 99 /* ESNext */ || (resolutionMode !== void 0 ? false : void 0);
|
|
39466
|
+
const conditions = features & 8 /* Exports */ ? getConditions(options, useImportCondition) : [];
|
|
39414
39467
|
const diagnostics = [];
|
|
39415
39468
|
const moduleResolutionState = {
|
|
39416
39469
|
compilerOptions: options,
|
|
@@ -39579,11 +39632,19 @@ ${lanes.join("\n")}
|
|
|
39579
39632
|
return features;
|
|
39580
39633
|
}
|
|
39581
39634
|
function getConditions(options, esmMode) {
|
|
39582
|
-
const
|
|
39635
|
+
const moduleResolution = getEmitModuleResolutionKind(options);
|
|
39636
|
+
if (esmMode === void 0) {
|
|
39637
|
+
if (moduleResolution === 100 /* Bundler */) {
|
|
39638
|
+
esmMode ?? (esmMode = moduleResolution === 100 /* Bundler */);
|
|
39639
|
+
} else if (moduleResolution === 2 /* Node10 */) {
|
|
39640
|
+
return [];
|
|
39641
|
+
}
|
|
39642
|
+
}
|
|
39643
|
+
const conditions = esmMode ? ["import"] : ["require"];
|
|
39583
39644
|
if (!options.noDtsResolution) {
|
|
39584
39645
|
conditions.push("types");
|
|
39585
39646
|
}
|
|
39586
|
-
if (
|
|
39647
|
+
if (moduleResolution !== 100 /* Bundler */) {
|
|
39587
39648
|
conditions.push("node");
|
|
39588
39649
|
}
|
|
39589
39650
|
return concatenate(conditions, options.customConditions);
|
|
@@ -40026,13 +40087,13 @@ ${lanes.join("\n")}
|
|
|
40026
40087
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
40027
40088
|
break;
|
|
40028
40089
|
case 2 /* Node10 */:
|
|
40029
|
-
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
40090
|
+
result = nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
40030
40091
|
break;
|
|
40031
40092
|
case 1 /* Classic */:
|
|
40032
40093
|
result = classicNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
40033
40094
|
break;
|
|
40034
40095
|
case 100 /* Bundler */:
|
|
40035
|
-
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference);
|
|
40096
|
+
result = bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode ? getConditions(compilerOptions, resolutionMode === 99 /* ESNext */) : void 0);
|
|
40036
40097
|
break;
|
|
40037
40098
|
default:
|
|
40038
40099
|
return Debug.fail(`Unexpected moduleResolution: ${moduleResolution}`);
|
|
@@ -40197,7 +40258,7 @@ ${lanes.join("\n")}
|
|
|
40197
40258
|
resolutionMode
|
|
40198
40259
|
);
|
|
40199
40260
|
}
|
|
40200
|
-
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
40261
|
+
function nodeNextModuleNameResolverWorker(features, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode, conditions) {
|
|
40201
40262
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
40202
40263
|
const esmMode = resolutionMode === 99 /* ESNext */ ? 32 /* EsmMode */ : 0;
|
|
40203
40264
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
@@ -40214,7 +40275,8 @@ ${lanes.join("\n")}
|
|
|
40214
40275
|
extensions,
|
|
40215
40276
|
/*isConfigLookup*/
|
|
40216
40277
|
false,
|
|
40217
|
-
redirectedReference
|
|
40278
|
+
redirectedReference,
|
|
40279
|
+
conditions
|
|
40218
40280
|
);
|
|
40219
40281
|
}
|
|
40220
40282
|
function tryResolveJSModuleWorker(moduleName, initialDir, host) {
|
|
@@ -40230,10 +40292,12 @@ ${lanes.join("\n")}
|
|
|
40230
40292
|
/*isConfigLookup*/
|
|
40231
40293
|
false,
|
|
40232
40294
|
/*redirectedReference*/
|
|
40295
|
+
void 0,
|
|
40296
|
+
/*conditions*/
|
|
40233
40297
|
void 0
|
|
40234
40298
|
);
|
|
40235
40299
|
}
|
|
40236
|
-
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference) {
|
|
40300
|
+
function bundlerModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions) {
|
|
40237
40301
|
const containingDirectory = getDirectoryPath(containingFile);
|
|
40238
40302
|
let extensions = compilerOptions.noDtsResolution ? 3 /* ImplementationFiles */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
40239
40303
|
if (getResolveJsonModule(compilerOptions)) {
|
|
@@ -40249,10 +40313,11 @@ ${lanes.join("\n")}
|
|
|
40249
40313
|
extensions,
|
|
40250
40314
|
/*isConfigLookup*/
|
|
40251
40315
|
false,
|
|
40252
|
-
redirectedReference
|
|
40316
|
+
redirectedReference,
|
|
40317
|
+
conditions
|
|
40253
40318
|
);
|
|
40254
40319
|
}
|
|
40255
|
-
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, isConfigLookup) {
|
|
40320
|
+
function nodeModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, conditions, isConfigLookup) {
|
|
40256
40321
|
let extensions;
|
|
40257
40322
|
if (isConfigLookup) {
|
|
40258
40323
|
extensions = 8 /* Json */;
|
|
@@ -40263,7 +40328,7 @@ ${lanes.join("\n")}
|
|
|
40263
40328
|
} else {
|
|
40264
40329
|
extensions = getResolveJsonModule(compilerOptions) ? 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */ | 8 /* Json */ : 1 /* TypeScript */ | 2 /* JavaScript */ | 4 /* Declaration */;
|
|
40265
40330
|
}
|
|
40266
|
-
return nodeModuleNameResolverWorker(0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference);
|
|
40331
|
+
return nodeModuleNameResolverWorker(conditions ? 30 /* AllFeatures */ : 0 /* None */, moduleName, getDirectoryPath(containingFile), compilerOptions, host, cache, extensions, !!isConfigLookup, redirectedReference, conditions);
|
|
40267
40332
|
}
|
|
40268
40333
|
function nodeNextJsonConfigResolver(moduleName, containingFile, host) {
|
|
40269
40334
|
return nodeModuleNameResolverWorker(
|
|
@@ -40278,15 +40343,21 @@ ${lanes.join("\n")}
|
|
|
40278
40343
|
/*isConfigLookup*/
|
|
40279
40344
|
true,
|
|
40280
40345
|
/*redirectedReference*/
|
|
40346
|
+
void 0,
|
|
40347
|
+
/*conditions*/
|
|
40281
40348
|
void 0
|
|
40282
40349
|
);
|
|
40283
40350
|
}
|
|
40284
|
-
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference) {
|
|
40351
|
+
function nodeModuleNameResolverWorker(features, moduleName, containingDirectory, compilerOptions, host, cache, extensions, isConfigLookup, redirectedReference, conditions) {
|
|
40285
40352
|
var _a, _b, _c, _d;
|
|
40286
40353
|
const traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
40287
40354
|
const failedLookupLocations = [];
|
|
40288
40355
|
const affectingLocations = [];
|
|
40289
|
-
const
|
|
40356
|
+
const moduleResolution = getEmitModuleResolutionKind(compilerOptions);
|
|
40357
|
+
conditions ?? (conditions = getConditions(
|
|
40358
|
+
compilerOptions,
|
|
40359
|
+
moduleResolution === 100 /* Bundler */ || moduleResolution === 2 /* Node10 */ ? void 0 : !!(features & 32 /* EsmMode */)
|
|
40360
|
+
));
|
|
40290
40361
|
const diagnostics = [];
|
|
40291
40362
|
const state = {
|
|
40292
40363
|
compilerOptions,
|
|
@@ -40296,17 +40367,17 @@ ${lanes.join("\n")}
|
|
|
40296
40367
|
affectingLocations,
|
|
40297
40368
|
packageJsonInfoCache: cache,
|
|
40298
40369
|
features,
|
|
40299
|
-
conditions,
|
|
40370
|
+
conditions: conditions ?? emptyArray,
|
|
40300
40371
|
requestContainingDirectory: containingDirectory,
|
|
40301
40372
|
reportDiagnostic: (diag2) => void diagnostics.push(diag2),
|
|
40302
40373
|
isConfigLookup,
|
|
40303
40374
|
candidateIsFromPackageJsonField: false
|
|
40304
40375
|
};
|
|
40305
|
-
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(
|
|
40306
|
-
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", conditions.map((c) => `'${c}'`).join(", "));
|
|
40376
|
+
if (traceEnabled && moduleResolutionSupportsPackageJsonExportsAndImports(moduleResolution)) {
|
|
40377
|
+
trace(host, Diagnostics.Resolving_in_0_mode_with_conditions_1, features & 32 /* EsmMode */ ? "ESM" : "CJS", state.conditions.map((c) => `'${c}'`).join(", "));
|
|
40307
40378
|
}
|
|
40308
40379
|
let result;
|
|
40309
|
-
if (
|
|
40380
|
+
if (moduleResolution === 2 /* Node10 */) {
|
|
40310
40381
|
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
|
|
40311
40382
|
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
|
|
40312
40383
|
result = priorityExtensions && tryResolve(priorityExtensions, state) || secondaryExtensions && tryResolve(secondaryExtensions, state) || void 0;
|
|
@@ -40314,7 +40385,7 @@ ${lanes.join("\n")}
|
|
|
40314
40385
|
result = tryResolve(extensions, state);
|
|
40315
40386
|
}
|
|
40316
40387
|
let legacyResult;
|
|
40317
|
-
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")) {
|
|
40388
|
+
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"))) {
|
|
40318
40389
|
traceIfEnabled(state, Diagnostics.Resolution_of_non_relative_name_failed_trying_with_modern_Node_resolution_features_disabled_to_see_if_npm_library_needs_configuration_update);
|
|
40319
40390
|
const diagnosticState = {
|
|
40320
40391
|
...state,
|
|
@@ -41111,7 +41182,8 @@ ${lanes.join("\n")}
|
|
|
41111
41182
|
extensions,
|
|
41112
41183
|
/*isConfigLookup*/
|
|
41113
41184
|
false,
|
|
41114
|
-
redirectedReference
|
|
41185
|
+
redirectedReference,
|
|
41186
|
+
state.conditions
|
|
41115
41187
|
);
|
|
41116
41188
|
return toSearchResult(
|
|
41117
41189
|
result.resolvedModule ? {
|
|
@@ -48789,7 +48861,7 @@ ${lanes.join("\n")}
|
|
|
48789
48861
|
return isStringLiteralLike(moduleReferenceExpression) ? resolveExternalModule(location, moduleReferenceExpression.text, moduleNotFoundError, moduleReferenceExpression, isForAugmentation) : void 0;
|
|
48790
48862
|
}
|
|
48791
48863
|
function resolveExternalModule(location, moduleReference, moduleNotFoundError, errorNode, isForAugmentation = false) {
|
|
48792
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j
|
|
48864
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
48793
48865
|
if (startsWith(moduleReference, "@types/")) {
|
|
48794
48866
|
const diag2 = Diagnostics.Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1;
|
|
48795
48867
|
const withoutAtTypePrefix = removePrefix(moduleReference, "@types/");
|
|
@@ -48844,9 +48916,8 @@ ${lanes.join("\n")}
|
|
|
48844
48916
|
}
|
|
48845
48917
|
if (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */) {
|
|
48846
48918
|
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
|
|
48847
|
-
const
|
|
48848
|
-
|
|
48849
|
-
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !getResolutionModeOverrideForClause(overrideClause)) {
|
|
48919
|
+
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l));
|
|
48920
|
+
if (isSyncImport && sourceFile.impliedNodeFormat === 99 /* ESNext */ && !hasResolutionModeOverride(overrideHost)) {
|
|
48850
48921
|
if (findAncestor(location, isImportEqualsDeclaration)) {
|
|
48851
48922
|
error2(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);
|
|
48852
48923
|
} else {
|
|
@@ -48952,7 +49023,7 @@ ${lanes.join("\n")}
|
|
|
48952
49023
|
error2(errorNode, Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
48953
49024
|
} else if (mode === 99 /* ESNext */ && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
48954
49025
|
const absoluteRef = getNormalizedAbsolutePath(moduleReference, getDirectoryPath(currentSourceFile.path));
|
|
48955
|
-
const suggestedExt = (
|
|
49026
|
+
const suggestedExt = (_j = suggestedExtensions.find(([actualExt, _importExt]) => host.fileExists(absoluteRef + actualExt))) == null ? void 0 : _j[1];
|
|
48956
49027
|
if (suggestedExt) {
|
|
48957
49028
|
error2(errorNode, Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_ECMAScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
48958
49029
|
} else {
|
|
@@ -50717,7 +50788,7 @@ ${lanes.join("\n")}
|
|
|
50717
50788
|
return factory.updateImportTypeNode(
|
|
50718
50789
|
root,
|
|
50719
50790
|
root.argument,
|
|
50720
|
-
root.
|
|
50791
|
+
root.attributes,
|
|
50721
50792
|
qualifier,
|
|
50722
50793
|
typeArguments,
|
|
50723
50794
|
root.isTypeOf
|
|
@@ -51450,7 +51521,6 @@ ${lanes.join("\n")}
|
|
|
51450
51521
|
return symbol.parent ? factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
51451
51522
|
}
|
|
51452
51523
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
51453
|
-
var _a, _b, _c, _d;
|
|
51454
51524
|
const chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384 /* UseAliasDefinedOutsideCurrentScope */));
|
|
51455
51525
|
const isTypeOf = meaning === 111551 /* Value */;
|
|
51456
51526
|
if (some(chain[0].declarations, hasNonGlobalAugmentationExternalModuleSymbol)) {
|
|
@@ -51459,17 +51529,18 @@ ${lanes.join("\n")}
|
|
|
51459
51529
|
const contextFile = getSourceFileOfNode(getOriginalNode(context.enclosingDeclaration));
|
|
51460
51530
|
const targetFile = getSourceFileOfModule(chain[0]);
|
|
51461
51531
|
let specifier;
|
|
51462
|
-
let
|
|
51532
|
+
let attributes;
|
|
51463
51533
|
if (getEmitModuleResolutionKind(compilerOptions) === 3 /* Node16 */ || getEmitModuleResolutionKind(compilerOptions) === 99 /* NodeNext */) {
|
|
51464
51534
|
if ((targetFile == null ? void 0 : targetFile.impliedNodeFormat) === 99 /* ESNext */ && targetFile.impliedNodeFormat !== (contextFile == null ? void 0 : contextFile.impliedNodeFormat)) {
|
|
51465
51535
|
specifier = getSpecifierForModuleSymbol(chain[0], context, 99 /* ESNext */);
|
|
51466
|
-
|
|
51467
|
-
factory.
|
|
51468
|
-
factory.
|
|
51469
|
-
|
|
51470
|
-
|
|
51471
|
-
|
|
51472
|
-
|
|
51536
|
+
attributes = factory.createImportAttributes(
|
|
51537
|
+
factory.createNodeArray([
|
|
51538
|
+
factory.createImportAttribute(
|
|
51539
|
+
factory.createStringLiteral("resolution-mode"),
|
|
51540
|
+
factory.createStringLiteral("import")
|
|
51541
|
+
)
|
|
51542
|
+
])
|
|
51543
|
+
);
|
|
51473
51544
|
}
|
|
51474
51545
|
}
|
|
51475
51546
|
if (!specifier) {
|
|
@@ -51483,16 +51554,17 @@ ${lanes.join("\n")}
|
|
|
51483
51554
|
if (specifier.includes("/node_modules/")) {
|
|
51484
51555
|
specifier = oldSpecifier;
|
|
51485
51556
|
} else {
|
|
51486
|
-
|
|
51487
|
-
factory.
|
|
51488
|
-
factory.
|
|
51489
|
-
|
|
51490
|
-
|
|
51491
|
-
|
|
51492
|
-
|
|
51557
|
+
attributes = factory.createImportAttributes(
|
|
51558
|
+
factory.createNodeArray([
|
|
51559
|
+
factory.createImportAttribute(
|
|
51560
|
+
factory.createStringLiteral("resolution-mode"),
|
|
51561
|
+
factory.createStringLiteral(swappedMode === 99 /* ESNext */ ? "import" : "require")
|
|
51562
|
+
)
|
|
51563
|
+
])
|
|
51564
|
+
);
|
|
51493
51565
|
}
|
|
51494
51566
|
}
|
|
51495
|
-
if (!
|
|
51567
|
+
if (!attributes) {
|
|
51496
51568
|
context.encounteredError = true;
|
|
51497
51569
|
if (context.tracker.reportLikelyUnsafeImportRequiredError) {
|
|
51498
51570
|
context.tracker.reportLikelyUnsafeImportRequiredError(oldSpecifier);
|
|
@@ -51512,11 +51584,11 @@ ${lanes.join("\n")}
|
|
|
51512
51584
|
void 0
|
|
51513
51585
|
);
|
|
51514
51586
|
}
|
|
51515
|
-
return factory.createImportTypeNode(lit,
|
|
51587
|
+
return factory.createImportTypeNode(lit, attributes, nonRootParts, typeParameterNodes, isTypeOf);
|
|
51516
51588
|
} else {
|
|
51517
51589
|
const splitNode = getTopmostIndexedAccessType(nonRootParts);
|
|
51518
51590
|
const qualifier = splitNode.objectType.typeName;
|
|
51519
|
-
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit,
|
|
51591
|
+
return factory.createIndexedAccessTypeNode(factory.createImportTypeNode(lit, attributes, qualifier, typeParameterNodes, isTypeOf), splitNode.indexType);
|
|
51520
51592
|
}
|
|
51521
51593
|
}
|
|
51522
51594
|
const entityName = createAccessFromSymbolChain(chain, chain.length - 1, 0);
|
|
@@ -51992,7 +52064,7 @@ ${lanes.join("\n")}
|
|
|
51992
52064
|
return factory.updateImportTypeNode(
|
|
51993
52065
|
node,
|
|
51994
52066
|
factory.updateLiteralTypeNode(node.argument, rewriteModuleSpecifier(node, node.argument.literal)),
|
|
51995
|
-
node.
|
|
52067
|
+
node.attributes,
|
|
51996
52068
|
node.qualifier,
|
|
51997
52069
|
visitNodes2(node.typeArguments, visitExistingNodeTreeSymbols, isTypeNode),
|
|
51998
52070
|
node.isTypeOf
|
|
@@ -52212,7 +52284,7 @@ ${lanes.join("\n")}
|
|
|
52212
52284
|
return statements;
|
|
52213
52285
|
}
|
|
52214
52286
|
function inlineExportModifiers(statements) {
|
|
52215
|
-
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.
|
|
52287
|
+
const index = findIndex(statements, (d) => isExportDeclaration(d) && !d.moduleSpecifier && !d.attributes && !!d.exportClause && isNamedExports(d.exportClause));
|
|
52216
52288
|
if (index >= 0) {
|
|
52217
52289
|
const exportDecl = statements[index];
|
|
52218
52290
|
const replacements = mapDefined(exportDecl.exportClause.elements, (e) => {
|
|
@@ -52240,7 +52312,7 @@ ${lanes.join("\n")}
|
|
|
52240
52312
|
replacements
|
|
52241
52313
|
),
|
|
52242
52314
|
exportDecl.moduleSpecifier,
|
|
52243
|
-
exportDecl.
|
|
52315
|
+
exportDecl.attributes
|
|
52244
52316
|
);
|
|
52245
52317
|
}
|
|
52246
52318
|
}
|
|
@@ -52891,7 +52963,7 @@ ${lanes.join("\n")}
|
|
|
52891
52963
|
)])
|
|
52892
52964
|
),
|
|
52893
52965
|
factory.createStringLiteral(specifier2),
|
|
52894
|
-
/*
|
|
52966
|
+
/*attributes*/
|
|
52895
52967
|
void 0
|
|
52896
52968
|
),
|
|
52897
52969
|
0 /* None */
|
|
@@ -52979,7 +53051,7 @@ ${lanes.join("\n")}
|
|
|
52979
53051
|
void 0
|
|
52980
53052
|
),
|
|
52981
53053
|
specifier2,
|
|
52982
|
-
node.parent.
|
|
53054
|
+
node.parent.attributes
|
|
52983
53055
|
),
|
|
52984
53056
|
0 /* None */
|
|
52985
53057
|
);
|
|
@@ -53000,7 +53072,7 @@ ${lanes.join("\n")}
|
|
|
53000
53072
|
factory.createNamespaceImport(factory.createIdentifier(localName))
|
|
53001
53073
|
),
|
|
53002
53074
|
specifier2,
|
|
53003
|
-
node.parent.
|
|
53075
|
+
node.parent.attributes
|
|
53004
53076
|
),
|
|
53005
53077
|
0 /* None */
|
|
53006
53078
|
);
|
|
@@ -53041,7 +53113,7 @@ ${lanes.join("\n")}
|
|
|
53041
53113
|
])
|
|
53042
53114
|
),
|
|
53043
53115
|
specifier2,
|
|
53044
|
-
node.parent.parent.parent.
|
|
53116
|
+
node.parent.parent.parent.attributes
|
|
53045
53117
|
),
|
|
53046
53118
|
0 /* None */
|
|
53047
53119
|
);
|
|
@@ -62500,6 +62572,7 @@ ${lanes.join("\n")}
|
|
|
62500
62572
|
let skipParentCounter = 0;
|
|
62501
62573
|
let lastSkippedInfo;
|
|
62502
62574
|
let incompatibleStack;
|
|
62575
|
+
let relationCount = 16e6 - relation.size >> 3;
|
|
62503
62576
|
Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
62504
62577
|
const result = isRelatedTo(
|
|
62505
62578
|
source,
|
|
@@ -62513,8 +62586,19 @@ ${lanes.join("\n")}
|
|
|
62513
62586
|
reportIncompatibleStack();
|
|
62514
62587
|
}
|
|
62515
62588
|
if (overflow) {
|
|
62589
|
+
const id = getRelationKey(
|
|
62590
|
+
source,
|
|
62591
|
+
target,
|
|
62592
|
+
/*intersectionState*/
|
|
62593
|
+
0 /* None */,
|
|
62594
|
+
relation,
|
|
62595
|
+
/*ignoreConstraints*/
|
|
62596
|
+
false
|
|
62597
|
+
);
|
|
62598
|
+
relation.set(id, 4 /* Reported */ | 2 /* Failed */);
|
|
62516
62599
|
(_a = tracing) == null ? void 0 : _a.instant(tracing.Phase.CheckTypes, "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth });
|
|
62517
|
-
const
|
|
62600
|
+
const message = relationCount <= 0 ? Diagnostics.Excessive_complexity_comparing_types_0_and_1 : Diagnostics.Excessive_stack_depth_comparing_types_0_and_1;
|
|
62601
|
+
const diag2 = error2(errorNode || currentNode, message, typeToString(source), typeToString(target));
|
|
62518
62602
|
if (errorOutputContainer) {
|
|
62519
62603
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag2);
|
|
62520
62604
|
}
|
|
@@ -63045,6 +63129,16 @@ ${lanes.join("\n")}
|
|
|
63045
63129
|
}
|
|
63046
63130
|
function unionOrIntersectionRelatedTo(source2, target2, reportErrors2, intersectionState) {
|
|
63047
63131
|
if (source2.flags & 1048576 /* Union */) {
|
|
63132
|
+
if (target2.flags & 1048576 /* Union */) {
|
|
63133
|
+
const sourceOrigin = source2.origin;
|
|
63134
|
+
if (sourceOrigin && sourceOrigin.flags & 2097152 /* Intersection */ && target2.aliasSymbol && contains(sourceOrigin.types, target2)) {
|
|
63135
|
+
return -1 /* True */;
|
|
63136
|
+
}
|
|
63137
|
+
const targetOrigin = target2.origin;
|
|
63138
|
+
if (targetOrigin && targetOrigin.flags & 1048576 /* Union */ && source2.aliasSymbol && contains(targetOrigin.types, source2)) {
|
|
63139
|
+
return -1 /* True */;
|
|
63140
|
+
}
|
|
63141
|
+
}
|
|
63048
63142
|
return relation === comparableRelation ? someTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState) : eachTypeRelatedToType(source2, target2, reportErrors2 && !(source2.flags & 402784252 /* Primitive */), intersectionState);
|
|
63049
63143
|
}
|
|
63050
63144
|
if (target2.flags & 1048576 /* Union */) {
|
|
@@ -63358,6 +63452,10 @@ ${lanes.join("\n")}
|
|
|
63358
63452
|
return entry & 1 /* Succeeded */ ? -1 /* True */ : 0 /* False */;
|
|
63359
63453
|
}
|
|
63360
63454
|
}
|
|
63455
|
+
if (relationCount <= 0) {
|
|
63456
|
+
overflow = true;
|
|
63457
|
+
return 0 /* False */;
|
|
63458
|
+
}
|
|
63361
63459
|
if (!maybeKeys) {
|
|
63362
63460
|
maybeKeys = [];
|
|
63363
63461
|
maybeKeysSet = /* @__PURE__ */ new Set();
|
|
@@ -63451,6 +63549,7 @@ ${lanes.join("\n")}
|
|
|
63451
63549
|
}
|
|
63452
63550
|
} else {
|
|
63453
63551
|
relation.set(id, (reportErrors2 ? 4 /* Reported */ : 0) | 2 /* Failed */ | propagatingVarianceFlags);
|
|
63552
|
+
relationCount--;
|
|
63454
63553
|
resetMaybeStack(
|
|
63455
63554
|
/*markAllAsSucceeded*/
|
|
63456
63555
|
false
|
|
@@ -63462,6 +63561,7 @@ ${lanes.join("\n")}
|
|
|
63462
63561
|
maybeKeysSet.delete(maybeKeys[i]);
|
|
63463
63562
|
if (markAllAsSucceeded) {
|
|
63464
63563
|
relation.set(maybeKeys[i], 1 /* Succeeded */ | propagatingVarianceFlags);
|
|
63564
|
+
relationCount--;
|
|
63465
63565
|
}
|
|
63466
63566
|
}
|
|
63467
63567
|
maybeCount = maybeStart;
|
|
@@ -64857,10 +64957,7 @@ ${lanes.join("\n")}
|
|
|
64857
64957
|
return false;
|
|
64858
64958
|
}
|
|
64859
64959
|
function getVariances(type) {
|
|
64860
|
-
return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */
|
|
64861
|
-
}
|
|
64862
|
-
function isArraySubtype(type) {
|
|
64863
|
-
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];
|
|
64960
|
+
return type === globalArrayType || type === globalReadonlyArrayType || type.objectFlags & 8 /* Tuple */ ? arrayVariances : getVariancesWorker(type.symbol, type.typeParameters);
|
|
64864
64961
|
}
|
|
64865
64962
|
function getAliasVariances(symbol) {
|
|
64866
64963
|
return getVariancesWorker(symbol, getSymbolLinks(symbol).typeParameters);
|
|
@@ -78297,16 +78394,8 @@ ${lanes.join("\n")}
|
|
|
78297
78394
|
}
|
|
78298
78395
|
function checkImportType(node) {
|
|
78299
78396
|
checkSourceElement(node.argument);
|
|
78300
|
-
if (node.
|
|
78301
|
-
|
|
78302
|
-
if (override) {
|
|
78303
|
-
if (!isNightly()) {
|
|
78304
|
-
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);
|
|
78305
|
-
}
|
|
78306
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
78307
|
-
grammarErrorOnNode(node.assertions.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
78308
|
-
}
|
|
78309
|
-
}
|
|
78397
|
+
if (node.attributes) {
|
|
78398
|
+
getResolutionModeOverride(node.attributes, grammarErrorOnNode);
|
|
78310
78399
|
}
|
|
78311
78400
|
checkTypeReferenceOrImport(node);
|
|
78312
78401
|
}
|
|
@@ -82270,12 +82359,13 @@ ${lanes.join("\n")}
|
|
|
82270
82359
|
return false;
|
|
82271
82360
|
}
|
|
82272
82361
|
}
|
|
82273
|
-
if (!isImportEqualsDeclaration(node) && node.
|
|
82362
|
+
if (!isImportEqualsDeclaration(node) && node.attributes) {
|
|
82363
|
+
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;
|
|
82274
82364
|
let hasError = false;
|
|
82275
|
-
for (const
|
|
82276
|
-
if (!isStringLiteral(
|
|
82365
|
+
for (const attr of node.attributes.elements) {
|
|
82366
|
+
if (!isStringLiteral(attr.value)) {
|
|
82277
82367
|
hasError = true;
|
|
82278
|
-
error2(
|
|
82368
|
+
error2(attr.value, diagnostic);
|
|
82279
82369
|
}
|
|
82280
82370
|
}
|
|
82281
82371
|
return !hasError;
|
|
@@ -82407,32 +82497,26 @@ ${lanes.join("\n")}
|
|
|
82407
82497
|
checkExternalEmitHelpers(node, 131072 /* ImportDefault */);
|
|
82408
82498
|
}
|
|
82409
82499
|
}
|
|
82410
|
-
function
|
|
82500
|
+
function checkImportAttributes(declaration) {
|
|
82411
82501
|
var _a;
|
|
82412
|
-
|
|
82413
|
-
|
|
82414
|
-
const
|
|
82415
|
-
|
|
82416
|
-
|
|
82417
|
-
|
|
82418
|
-
}
|
|
82419
|
-
if (getEmitModuleResolutionKind(compilerOptions) !== 3 /* Node16 */ && getEmitModuleResolutionKind(compilerOptions) !== 99 /* NodeNext */) {
|
|
82420
|
-
return grammarErrorOnNode(declaration.assertClause, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
82421
|
-
}
|
|
82502
|
+
const node = declaration.attributes;
|
|
82503
|
+
if (node) {
|
|
82504
|
+
const validForTypeAttributes = isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
82505
|
+
const override = getResolutionModeOverride(node, validForTypeAttributes ? grammarErrorOnNode : void 0);
|
|
82506
|
+
const isImportAttributes2 = declaration.attributes.token === 118 /* WithKeyword */;
|
|
82507
|
+
if (validForTypeAttributes && override) {
|
|
82422
82508
|
return;
|
|
82423
82509
|
}
|
|
82424
82510
|
const mode = moduleKind === 199 /* NodeNext */ && declaration.moduleSpecifier && getUsageModeForExpression(declaration.moduleSpecifier);
|
|
82425
82511
|
if (mode !== 99 /* ESNext */ && moduleKind !== 99 /* ESNext */) {
|
|
82426
|
-
|
|
82427
|
-
|
|
82428
|
-
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
|
|
82429
|
-
);
|
|
82512
|
+
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;
|
|
82513
|
+
return grammarErrorOnNode(node, message);
|
|
82430
82514
|
}
|
|
82431
82515
|
if (isImportDeclaration(declaration) ? (_a = declaration.importClause) == null ? void 0 : _a.isTypeOnly : declaration.isTypeOnly) {
|
|
82432
|
-
return grammarErrorOnNode(
|
|
82516
|
+
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);
|
|
82433
82517
|
}
|
|
82434
82518
|
if (override) {
|
|
82435
|
-
return grammarErrorOnNode(
|
|
82519
|
+
return grammarErrorOnNode(node, Diagnostics.resolution_mode_can_only_be_set_for_type_only_imports);
|
|
82436
82520
|
}
|
|
82437
82521
|
}
|
|
82438
82522
|
}
|
|
@@ -82464,7 +82548,7 @@ ${lanes.join("\n")}
|
|
|
82464
82548
|
}
|
|
82465
82549
|
}
|
|
82466
82550
|
}
|
|
82467
|
-
|
|
82551
|
+
checkImportAttributes(node);
|
|
82468
82552
|
}
|
|
82469
82553
|
function checkImportEqualsDeclaration(node) {
|
|
82470
82554
|
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)) {
|
|
@@ -82537,7 +82621,7 @@ ${lanes.join("\n")}
|
|
|
82537
82621
|
}
|
|
82538
82622
|
}
|
|
82539
82623
|
}
|
|
82540
|
-
|
|
82624
|
+
checkImportAttributes(node);
|
|
82541
82625
|
}
|
|
82542
82626
|
function checkGrammarExportDeclaration(node) {
|
|
82543
82627
|
var _a;
|
|
@@ -86327,12 +86411,12 @@ ${lanes.join("\n")}
|
|
|
86327
86411
|
if (moduleKind !== 99 /* ESNext */ && moduleKind !== 199 /* NodeNext */ && moduleKind !== 100 /* Node16 */) {
|
|
86328
86412
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
86329
86413
|
if (nodeArguments.length > 1) {
|
|
86330
|
-
const
|
|
86331
|
-
return grammarErrorOnNode(
|
|
86414
|
+
const importAttributesArgument = nodeArguments[1];
|
|
86415
|
+
return grammarErrorOnNode(importAttributesArgument, Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
86332
86416
|
}
|
|
86333
86417
|
}
|
|
86334
86418
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
86335
|
-
return grammarErrorOnNode(node, Diagnostics.
|
|
86419
|
+
return grammarErrorOnNode(node, Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments);
|
|
86336
86420
|
}
|
|
86337
86421
|
const spreadElement = find(nodeArguments, isSpreadElement);
|
|
86338
86422
|
if (spreadElement) {
|
|
@@ -86731,13 +86815,6 @@ ${lanes.join("\n")}
|
|
|
86731
86815
|
this.inner.reportNonSerializableProperty(propertyName);
|
|
86732
86816
|
}
|
|
86733
86817
|
}
|
|
86734
|
-
reportImportTypeNodeResolutionModeOverride() {
|
|
86735
|
-
var _a;
|
|
86736
|
-
if ((_a = this.inner) == null ? void 0 : _a.reportImportTypeNodeResolutionModeOverride) {
|
|
86737
|
-
this.onDiagnosticReported();
|
|
86738
|
-
this.inner.reportImportTypeNodeResolutionModeOverride();
|
|
86739
|
-
}
|
|
86740
|
-
}
|
|
86741
86818
|
onDiagnosticReported() {
|
|
86742
86819
|
this.context.reportedDiagnostic = true;
|
|
86743
86820
|
}
|
|
@@ -87257,7 +87334,7 @@ ${lanes.join("\n")}
|
|
|
87257
87334
|
return context.factory.updateImportTypeNode(
|
|
87258
87335
|
node,
|
|
87259
87336
|
Debug.checkDefined(nodeVisitor(node.argument, visitor, isTypeNode)),
|
|
87260
|
-
nodeVisitor(node.
|
|
87337
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes),
|
|
87261
87338
|
nodeVisitor(node.qualifier, visitor, isEntityName),
|
|
87262
87339
|
nodesVisitor(node.typeArguments, visitor, isTypeNode),
|
|
87263
87340
|
node.isTypeOf
|
|
@@ -87808,20 +87885,20 @@ ${lanes.join("\n")}
|
|
|
87808
87885
|
nodesVisitor(node.modifiers, visitor, isModifierLike),
|
|
87809
87886
|
nodeVisitor(node.importClause, visitor, isImportClause),
|
|
87810
87887
|
Debug.checkDefined(nodeVisitor(node.moduleSpecifier, visitor, isExpression)),
|
|
87811
|
-
nodeVisitor(node.
|
|
87888
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
87812
87889
|
);
|
|
87813
87890
|
},
|
|
87814
|
-
[300 /*
|
|
87815
|
-
return context.factory.
|
|
87891
|
+
[300 /* ImportAttributes */]: function visitEachChildOfImportAttributes(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
87892
|
+
return context.factory.updateImportAttributes(
|
|
87816
87893
|
node,
|
|
87817
|
-
nodesVisitor(node.elements, visitor,
|
|
87894
|
+
nodesVisitor(node.elements, visitor, isImportAttribute),
|
|
87818
87895
|
node.multiLine
|
|
87819
87896
|
);
|
|
87820
87897
|
},
|
|
87821
|
-
[301 /*
|
|
87822
|
-
return context.factory.
|
|
87898
|
+
[301 /* ImportAttribute */]: function visitEachChildOfImportAttribute(node, visitor, context, _nodesVisitor, nodeVisitor, _tokenVisitor) {
|
|
87899
|
+
return context.factory.updateImportAttribute(
|
|
87823
87900
|
node,
|
|
87824
|
-
Debug.checkDefined(nodeVisitor(node.name, visitor,
|
|
87901
|
+
Debug.checkDefined(nodeVisitor(node.name, visitor, isImportAttributeName)),
|
|
87825
87902
|
Debug.checkDefined(nodeVisitor(node.value, visitor, isExpression))
|
|
87826
87903
|
);
|
|
87827
87904
|
},
|
|
@@ -87873,7 +87950,7 @@ ${lanes.join("\n")}
|
|
|
87873
87950
|
node.isTypeOnly,
|
|
87874
87951
|
nodeVisitor(node.exportClause, visitor, isNamedExportBindings),
|
|
87875
87952
|
nodeVisitor(node.moduleSpecifier, visitor, isExpression),
|
|
87876
|
-
nodeVisitor(node.
|
|
87953
|
+
nodeVisitor(node.attributes, visitor, isImportAttributes)
|
|
87877
87954
|
);
|
|
87878
87955
|
},
|
|
87879
87956
|
[279 /* NamedExports */]: function visitEachChildOfNamedExports(node, visitor, context, nodesVisitor, _nodeVisitor, _tokenVisitor) {
|
|
@@ -91401,7 +91478,7 @@ ${lanes.join("\n")}
|
|
|
91401
91478
|
void 0,
|
|
91402
91479
|
importClause,
|
|
91403
91480
|
node.moduleSpecifier,
|
|
91404
|
-
node.
|
|
91481
|
+
node.attributes
|
|
91405
91482
|
) : void 0;
|
|
91406
91483
|
}
|
|
91407
91484
|
function visitImportClause(node) {
|
|
@@ -91451,7 +91528,7 @@ ${lanes.join("\n")}
|
|
|
91451
91528
|
node.isTypeOnly,
|
|
91452
91529
|
exportClause,
|
|
91453
91530
|
node.moduleSpecifier,
|
|
91454
|
-
node.
|
|
91531
|
+
node.attributes
|
|
91455
91532
|
) : void 0;
|
|
91456
91533
|
}
|
|
91457
91534
|
function visitNamedExports(node, allowEmpty) {
|
|
@@ -91485,7 +91562,7 @@ ${lanes.join("\n")}
|
|
|
91485
91562
|
/*importClause*/
|
|
91486
91563
|
void 0,
|
|
91487
91564
|
node.moduleReference.expression,
|
|
91488
|
-
/*
|
|
91565
|
+
/*attributes*/
|
|
91489
91566
|
void 0
|
|
91490
91567
|
),
|
|
91491
91568
|
node
|
|
@@ -99723,7 +99800,7 @@ ${lanes.join("\n")}
|
|
|
99723
99800
|
factory2.createNamedImports(arrayFrom(importSpecifiersMap.values()))
|
|
99724
99801
|
),
|
|
99725
99802
|
factory2.createStringLiteral(importSource),
|
|
99726
|
-
/*
|
|
99803
|
+
/*attributes*/
|
|
99727
99804
|
void 0
|
|
99728
99805
|
);
|
|
99729
99806
|
setParentRecursive(
|
|
@@ -109174,7 +109251,9 @@ ${lanes.join("\n")}
|
|
|
109174
109251
|
)
|
|
109175
109252
|
])
|
|
109176
109253
|
),
|
|
109177
|
-
factory2.createStringLiteral("module")
|
|
109254
|
+
factory2.createStringLiteral("module"),
|
|
109255
|
+
/*attributes*/
|
|
109256
|
+
void 0
|
|
109178
109257
|
);
|
|
109179
109258
|
const requireHelperName = factory2.createUniqueName("__require", 16 /* Optimistic */ | 32 /* FileLevel */);
|
|
109180
109259
|
const requireStatement = factory2.createVariableStatement(
|
|
@@ -109291,7 +109370,7 @@ ${lanes.join("\n")}
|
|
|
109291
109370
|
)
|
|
109292
109371
|
),
|
|
109293
109372
|
node.moduleSpecifier,
|
|
109294
|
-
node.
|
|
109373
|
+
node.attributes
|
|
109295
109374
|
);
|
|
109296
109375
|
setOriginalNode(importDecl, node.exportClause);
|
|
109297
109376
|
const exportDecl = isExportNamespaceAsDefaultDeclaration(node) ? factory2.createExportDefault(synthName) : factory2.createExportDeclaration(
|
|
@@ -109761,8 +109840,7 @@ ${lanes.join("\n")}
|
|
|
109761
109840
|
trackReferencedAmbientModule,
|
|
109762
109841
|
trackExternalModuleSymbolOfImportTypeNode,
|
|
109763
109842
|
reportNonlocalAugmentation,
|
|
109764
|
-
reportNonSerializableProperty
|
|
109765
|
-
reportImportTypeNodeResolutionModeOverride
|
|
109843
|
+
reportNonSerializableProperty
|
|
109766
109844
|
};
|
|
109767
109845
|
let errorNameNode;
|
|
109768
109846
|
let errorFallbackNode;
|
|
@@ -109886,11 +109964,6 @@ ${lanes.join("\n")}
|
|
|
109886
109964
|
context.addDiagnostic(createDiagnosticForNode(errorNameNode || errorFallbackNode, Diagnostics.The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized, propertyName));
|
|
109887
109965
|
}
|
|
109888
109966
|
}
|
|
109889
|
-
function reportImportTypeNodeResolutionModeOverride() {
|
|
109890
|
-
if (!isNightly() && (errorNameNode || errorFallbackNode)) {
|
|
109891
|
-
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));
|
|
109892
|
-
}
|
|
109893
|
-
}
|
|
109894
109967
|
function transformDeclarationsForJS(sourceFile, bundled) {
|
|
109895
109968
|
const oldDiag = getSymbolAccessibilityDiagnostic;
|
|
109896
109969
|
getSymbolAccessibilityDiagnostic = (s) => s.errorNode && canProduceDiagnostics(s.errorNode) ? createGetSymbolAccessibilityDiagnosticForNode(s.errorNode)(s) : {
|
|
@@ -110395,7 +110468,7 @@ ${lanes.join("\n")}
|
|
|
110395
110468
|
decl.modifiers,
|
|
110396
110469
|
decl.importClause,
|
|
110397
110470
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110398
|
-
|
|
110471
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110399
110472
|
);
|
|
110400
110473
|
}
|
|
110401
110474
|
const visibleDefaultBinding = decl.importClause && decl.importClause.name && resolver.isDeclarationVisible(decl.importClause) ? decl.importClause.name : void 0;
|
|
@@ -110411,7 +110484,7 @@ ${lanes.join("\n")}
|
|
|
110411
110484
|
void 0
|
|
110412
110485
|
),
|
|
110413
110486
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110414
|
-
|
|
110487
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110415
110488
|
);
|
|
110416
110489
|
}
|
|
110417
110490
|
if (decl.importClause.namedBindings.kind === 274 /* NamespaceImport */) {
|
|
@@ -110429,7 +110502,7 @@ ${lanes.join("\n")}
|
|
|
110429
110502
|
namedBindings
|
|
110430
110503
|
),
|
|
110431
110504
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110432
|
-
|
|
110505
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110433
110506
|
) : void 0;
|
|
110434
110507
|
}
|
|
110435
110508
|
const bindingList = mapDefined(decl.importClause.namedBindings.elements, (b) => resolver.isDeclarationVisible(b) ? b : void 0);
|
|
@@ -110444,7 +110517,7 @@ ${lanes.join("\n")}
|
|
|
110444
110517
|
bindingList && bindingList.length ? factory2.updateNamedImports(decl.importClause.namedBindings, bindingList) : void 0
|
|
110445
110518
|
),
|
|
110446
110519
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110447
|
-
|
|
110520
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110448
110521
|
);
|
|
110449
110522
|
}
|
|
110450
110523
|
if (resolver.isImportRequiredByAugmentation(decl)) {
|
|
@@ -110454,19 +110527,13 @@ ${lanes.join("\n")}
|
|
|
110454
110527
|
/*importClause*/
|
|
110455
110528
|
void 0,
|
|
110456
110529
|
rewriteModuleSpecifier(decl, decl.moduleSpecifier),
|
|
110457
|
-
|
|
110530
|
+
tryGetResolutionModeOverride(decl.attributes)
|
|
110458
110531
|
);
|
|
110459
110532
|
}
|
|
110460
110533
|
}
|
|
110461
|
-
function
|
|
110462
|
-
const mode =
|
|
110463
|
-
|
|
110464
|
-
if (!isNightly()) {
|
|
110465
|
-
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));
|
|
110466
|
-
}
|
|
110467
|
-
return assertClause;
|
|
110468
|
-
}
|
|
110469
|
-
return void 0;
|
|
110534
|
+
function tryGetResolutionModeOverride(node) {
|
|
110535
|
+
const mode = getResolutionModeOverride(node);
|
|
110536
|
+
return node && mode !== void 0 ? node : void 0;
|
|
110470
110537
|
}
|
|
110471
110538
|
function transformAndReplaceLatePaintedStatements(statements) {
|
|
110472
110539
|
while (length(lateMarkedStatements)) {
|
|
@@ -110752,7 +110819,7 @@ ${lanes.join("\n")}
|
|
|
110752
110819
|
return cleanup(factory2.updateImportTypeNode(
|
|
110753
110820
|
input,
|
|
110754
110821
|
factory2.updateLiteralTypeNode(input.argument, rewriteModuleSpecifier(input, input.argument.literal)),
|
|
110755
|
-
input.
|
|
110822
|
+
input.attributes,
|
|
110756
110823
|
input.qualifier,
|
|
110757
110824
|
visitNodes2(input.typeArguments, visitDeclarationSubtree, isTypeNode),
|
|
110758
110825
|
input.isTypeOf
|
|
@@ -110806,7 +110873,7 @@ ${lanes.join("\n")}
|
|
|
110806
110873
|
input.isTypeOnly,
|
|
110807
110874
|
input.exportClause,
|
|
110808
110875
|
rewriteModuleSpecifier(input, input.moduleSpecifier),
|
|
110809
|
-
|
|
110876
|
+
tryGetResolutionModeOverride(input.attributes)
|
|
110810
110877
|
);
|
|
110811
110878
|
}
|
|
110812
110879
|
case 277 /* ExportAssignment */: {
|
|
@@ -113280,10 +113347,10 @@ ${lanes.join("\n")}
|
|
|
113280
113347
|
return emitNamedExports(node);
|
|
113281
113348
|
case 281 /* ExportSpecifier */:
|
|
113282
113349
|
return emitExportSpecifier(node);
|
|
113283
|
-
case 300 /*
|
|
113284
|
-
return
|
|
113285
|
-
case 301 /*
|
|
113286
|
-
return
|
|
113350
|
+
case 300 /* ImportAttributes */:
|
|
113351
|
+
return emitImportAttributes(node);
|
|
113352
|
+
case 301 /* ImportAttribute */:
|
|
113353
|
+
return emitImportAttribute(node);
|
|
113287
113354
|
case 282 /* MissingDeclaration */:
|
|
113288
113355
|
return;
|
|
113289
113356
|
case 283 /* ExternalModuleReference */:
|
|
@@ -114058,16 +114125,16 @@ ${lanes.join("\n")}
|
|
|
114058
114125
|
writeKeyword("import");
|
|
114059
114126
|
writePunctuation("(");
|
|
114060
114127
|
emit(node.argument);
|
|
114061
|
-
if (node.
|
|
114128
|
+
if (node.attributes) {
|
|
114062
114129
|
writePunctuation(",");
|
|
114063
114130
|
writeSpace();
|
|
114064
114131
|
writePunctuation("{");
|
|
114065
114132
|
writeSpace();
|
|
114066
|
-
writeKeyword("assert");
|
|
114133
|
+
writeKeyword(node.attributes.token === 132 /* AssertKeyword */ ? "assert" : "with");
|
|
114067
114134
|
writePunctuation(":");
|
|
114068
114135
|
writeSpace();
|
|
114069
|
-
const elements = node.
|
|
114070
|
-
emitList(node.
|
|
114136
|
+
const elements = node.attributes.elements;
|
|
114137
|
+
emitList(node.attributes, elements, 526226 /* ImportAttributes */);
|
|
114071
114138
|
writeSpace();
|
|
114072
114139
|
writePunctuation("}");
|
|
114073
114140
|
}
|
|
@@ -115056,8 +115123,8 @@ ${lanes.join("\n")}
|
|
|
115056
115123
|
writeSpace();
|
|
115057
115124
|
}
|
|
115058
115125
|
emitExpression(node.moduleSpecifier);
|
|
115059
|
-
if (node.
|
|
115060
|
-
emitWithLeadingSpace(node.
|
|
115126
|
+
if (node.attributes) {
|
|
115127
|
+
emitWithLeadingSpace(node.attributes);
|
|
115061
115128
|
}
|
|
115062
115129
|
writeTrailingSemicolon();
|
|
115063
115130
|
}
|
|
@@ -115126,18 +115193,18 @@ ${lanes.join("\n")}
|
|
|
115126
115193
|
writeSpace();
|
|
115127
115194
|
emitExpression(node.moduleSpecifier);
|
|
115128
115195
|
}
|
|
115129
|
-
if (node.
|
|
115130
|
-
emitWithLeadingSpace(node.
|
|
115196
|
+
if (node.attributes) {
|
|
115197
|
+
emitWithLeadingSpace(node.attributes);
|
|
115131
115198
|
}
|
|
115132
115199
|
writeTrailingSemicolon();
|
|
115133
115200
|
}
|
|
115134
|
-
function
|
|
115135
|
-
emitTokenWithComment(
|
|
115201
|
+
function emitImportAttributes(node) {
|
|
115202
|
+
emitTokenWithComment(node.token, node.pos, writeKeyword, node);
|
|
115136
115203
|
writeSpace();
|
|
115137
115204
|
const elements = node.elements;
|
|
115138
|
-
emitList(node, elements, 526226 /*
|
|
115205
|
+
emitList(node, elements, 526226 /* ImportAttributes */);
|
|
115139
115206
|
}
|
|
115140
|
-
function
|
|
115207
|
+
function emitImportAttribute(node) {
|
|
115141
115208
|
emit(node.name);
|
|
115142
115209
|
writePunctuation(":");
|
|
115143
115210
|
writeSpace();
|
|
@@ -118275,8 +118342,6 @@ ${lanes.join("\n")}
|
|
|
118275
118342
|
return (isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
118276
118343
|
}
|
|
118277
118344
|
function getModeForResolutionAtIndex(file, index) {
|
|
118278
|
-
if (file.impliedNodeFormat === void 0)
|
|
118279
|
-
return void 0;
|
|
118280
118345
|
return getModeForUsageLocation(file, getModuleNameStringLiteralAt(file, index));
|
|
118281
118346
|
}
|
|
118282
118347
|
function isExclusivelyTypeOnlyImportOrExport(decl) {
|
|
@@ -118290,42 +118355,48 @@ ${lanes.join("\n")}
|
|
|
118290
118355
|
return false;
|
|
118291
118356
|
}
|
|
118292
118357
|
function getModeForUsageLocation(file, usage) {
|
|
118293
|
-
var _a
|
|
118294
|
-
if (file.impliedNodeFormat === void 0)
|
|
118295
|
-
return void 0;
|
|
118358
|
+
var _a;
|
|
118296
118359
|
if (isImportDeclaration(usage.parent) || isExportDeclaration(usage.parent)) {
|
|
118297
118360
|
const isTypeOnly = isExclusivelyTypeOnlyImportOrExport(usage.parent);
|
|
118298
118361
|
if (isTypeOnly) {
|
|
118299
|
-
const override =
|
|
118362
|
+
const override = getResolutionModeOverride(usage.parent.attributes);
|
|
118300
118363
|
if (override) {
|
|
118301
118364
|
return override;
|
|
118302
118365
|
}
|
|
118303
118366
|
}
|
|
118304
118367
|
}
|
|
118305
118368
|
if (usage.parent.parent && isImportTypeNode(usage.parent.parent)) {
|
|
118306
|
-
const override =
|
|
118369
|
+
const override = getResolutionModeOverride(usage.parent.parent.attributes);
|
|
118307
118370
|
if (override) {
|
|
118308
118371
|
return override;
|
|
118309
118372
|
}
|
|
118310
118373
|
}
|
|
118374
|
+
if (file.impliedNodeFormat === void 0)
|
|
118375
|
+
return void 0;
|
|
118311
118376
|
if (file.impliedNodeFormat !== 99 /* ESNext */) {
|
|
118312
118377
|
return isImportCall(walkUpParenthesizedExpressions(usage.parent)) ? 99 /* ESNext */ : 1 /* CommonJS */;
|
|
118313
118378
|
}
|
|
118314
|
-
const exprParentParent = (
|
|
118379
|
+
const exprParentParent = (_a = walkUpParenthesizedExpressions(usage.parent)) == null ? void 0 : _a.parent;
|
|
118315
118380
|
return exprParentParent && isImportEqualsDeclaration(exprParentParent) ? 1 /* CommonJS */ : 99 /* ESNext */;
|
|
118316
118381
|
}
|
|
118317
|
-
function
|
|
118318
|
-
if (!
|
|
118382
|
+
function getResolutionModeOverride(node, grammarErrorOnNode) {
|
|
118383
|
+
if (!node)
|
|
118319
118384
|
return void 0;
|
|
118320
|
-
if (length(
|
|
118321
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
118385
|
+
if (length(node.elements) !== 1) {
|
|
118386
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
118387
|
+
node,
|
|
118388
|
+
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
|
|
118389
|
+
);
|
|
118322
118390
|
return void 0;
|
|
118323
118391
|
}
|
|
118324
|
-
const elem =
|
|
118392
|
+
const elem = node.elements[0];
|
|
118325
118393
|
if (!isStringLiteralLike(elem.name))
|
|
118326
118394
|
return void 0;
|
|
118327
118395
|
if (elem.name.text !== "resolution-mode") {
|
|
118328
|
-
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
118396
|
+
grammarErrorOnNode == null ? void 0 : grammarErrorOnNode(
|
|
118397
|
+
elem.name,
|
|
118398
|
+
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
|
|
118399
|
+
);
|
|
118329
118400
|
return void 0;
|
|
118330
118401
|
}
|
|
118331
118402
|
if (!isStringLiteralLike(elem.value))
|
|
@@ -120048,7 +120119,7 @@ ${lanes.join("\n")}
|
|
|
120048
120119
|
/*importClause*/
|
|
120049
120120
|
void 0,
|
|
120050
120121
|
externalHelpersModuleReference,
|
|
120051
|
-
/*
|
|
120122
|
+
/*attributes*/
|
|
120052
120123
|
void 0
|
|
120053
120124
|
);
|
|
120054
120125
|
addInternalEmitFlags(importDecl, 2 /* NeverApplyImportHelper */);
|
|
@@ -120524,14 +120595,6 @@ ${lanes.join("\n")}
|
|
|
120524
120595
|
const fileName = toFileNameLowerCase(ref.fileName);
|
|
120525
120596
|
resolutionsInFile.set(fileName, getModeForFileReference(ref, file.impliedNodeFormat), resolvedTypeReferenceDirective);
|
|
120526
120597
|
const mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
120527
|
-
if (mode && getEmitModuleResolutionKind(options) !== 3 /* Node16 */ && getEmitModuleResolutionKind(options) !== 99 /* NodeNext */) {
|
|
120528
|
-
(fileProcessingDiagnostics ?? (fileProcessingDiagnostics = [])).push({
|
|
120529
|
-
kind: 2 /* ResolutionDiagnostics */,
|
|
120530
|
-
diagnostics: [
|
|
120531
|
-
createDiagnosticForRange(file, ref, Diagnostics.resolution_mode_assertions_are_only_supported_when_moduleResolution_is_node16_or_nodenext)
|
|
120532
|
-
]
|
|
120533
|
-
});
|
|
120534
|
-
}
|
|
120535
120598
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: 5 /* TypeReferenceDirective */, file: file.path, index });
|
|
120536
120599
|
}
|
|
120537
120600
|
}
|
|
@@ -121927,7 +121990,7 @@ ${lanes.join("\n")}
|
|
|
121927
121990
|
Diagnostics.Classes_may_not_have_a_field_named_constructor.code,
|
|
121928
121991
|
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,
|
|
121929
121992
|
Diagnostics.Duplicate_label_0.code,
|
|
121930
|
-
Diagnostics.
|
|
121993
|
+
Diagnostics.Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_set_of_attributes_as_arguments.code,
|
|
121931
121994
|
Diagnostics.for_await_loops_cannot_be_used_inside_a_class_static_block.code,
|
|
121932
121995
|
Diagnostics.JSX_attributes_must_only_be_assigned_a_non_empty_expression.code,
|
|
121933
121996
|
Diagnostics.JSX_elements_cannot_have_multiple_attributes_with_the_same_name.code,
|
|
@@ -130458,7 +130521,7 @@ ${lanes.join("\n")}
|
|
|
130458
130521
|
void 0,
|
|
130459
130522
|
defaultImport || namedImports ? factory.createImportClause(!!isTypeOnly, defaultImport, namedImports && namedImports.length ? factory.createNamedImports(namedImports) : void 0) : void 0,
|
|
130460
130523
|
typeof moduleSpecifier === "string" ? makeStringLiteral(moduleSpecifier, quotePreference) : moduleSpecifier,
|
|
130461
|
-
/*
|
|
130524
|
+
/*attributes*/
|
|
130462
130525
|
void 0
|
|
130463
130526
|
);
|
|
130464
130527
|
}
|
|
@@ -136225,7 +136288,7 @@ ${lanes.join("\n")}
|
|
|
136225
136288
|
}
|
|
136226
136289
|
case 205 /* ImportType */:
|
|
136227
136290
|
const importTypeNode = parent2;
|
|
136228
|
-
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.
|
|
136291
|
+
changes.replaceNode(importingSourceFile, parent2, factory.createImportTypeNode(importTypeNode.argument, importTypeNode.attributes, factory.createIdentifier(exportName), importTypeNode.typeArguments, importTypeNode.isTypeOf));
|
|
136229
136292
|
break;
|
|
136230
136293
|
default:
|
|
136231
136294
|
Debug.failBadSyntaxKind(parent2);
|
|
@@ -136509,7 +136572,7 @@ ${lanes.join("\n")}
|
|
|
136509
136572
|
elements && elements.length ? factory.createNamedImports(elements) : void 0
|
|
136510
136573
|
),
|
|
136511
136574
|
old.moduleSpecifier,
|
|
136512
|
-
/*
|
|
136575
|
+
/*attributes*/
|
|
136513
136576
|
void 0
|
|
136514
136577
|
);
|
|
136515
136578
|
}
|
|
@@ -137395,7 +137458,7 @@ ${lanes.join("\n")}
|
|
|
137395
137458
|
factory.createNamespaceImport(newNamespaceId)
|
|
137396
137459
|
),
|
|
137397
137460
|
newModuleString,
|
|
137398
|
-
/*
|
|
137461
|
+
/*attributes*/
|
|
137399
137462
|
void 0
|
|
137400
137463
|
);
|
|
137401
137464
|
case 271 /* ImportEqualsDeclaration */:
|
|
@@ -137684,7 +137747,7 @@ ${lanes.join("\n")}
|
|
|
137684
137747
|
void 0,
|
|
137685
137748
|
factory.createImportClause(clause.isTypeOnly, defaultImport, namedBindings),
|
|
137686
137749
|
getSynthesizedDeepClone(moduleSpecifier),
|
|
137687
|
-
/*
|
|
137750
|
+
/*attributes*/
|
|
137688
137751
|
void 0
|
|
137689
137752
|
) : void 0;
|
|
137690
137753
|
}
|
|
@@ -138008,7 +138071,7 @@ ${lanes.join("\n")}
|
|
|
138008
138071
|
continue;
|
|
138009
138072
|
}
|
|
138010
138073
|
if (length(updatedElements) < length(elements)) {
|
|
138011
|
-
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.
|
|
138074
|
+
changes.replaceNode(targetFile, exportDeclaration, factory.updateExportDeclaration(exportDeclaration, exportDeclaration.modifiers, exportDeclaration.isTypeOnly, factory.updateNamedExports(exportDeclaration.exportClause, factory.createNodeArray(updatedElements, elements.hasTrailingComma)), exportDeclaration.moduleSpecifier, exportDeclaration.attributes));
|
|
138012
138075
|
}
|
|
138013
138076
|
}
|
|
138014
138077
|
}
|
|
@@ -148490,7 +148553,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148490
148553
|
false,
|
|
148491
148554
|
factory.updateNamedExports(exportClause, filter(exportClause.elements, (e) => !contains(typeExportSpecifiers, e))),
|
|
148492
148555
|
exportDeclaration.moduleSpecifier,
|
|
148493
|
-
/*
|
|
148556
|
+
/*attributes*/
|
|
148494
148557
|
void 0
|
|
148495
148558
|
);
|
|
148496
148559
|
const typeExportDeclaration = factory.createExportDeclaration(
|
|
@@ -148500,7 +148563,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148500
148563
|
true,
|
|
148501
148564
|
factory.createNamedExports(typeExportSpecifiers),
|
|
148502
148565
|
exportDeclaration.moduleSpecifier,
|
|
148503
|
-
/*
|
|
148566
|
+
/*attributes*/
|
|
148504
148567
|
void 0
|
|
148505
148568
|
);
|
|
148506
148569
|
changes.replaceNode(context.sourceFile, exportDeclaration, valueExportDeclaration, {
|
|
@@ -148615,7 +148678,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148615
148678
|
true
|
|
148616
148679
|
),
|
|
148617
148680
|
getSynthesizedDeepClone(
|
|
148618
|
-
declaration.
|
|
148681
|
+
declaration.attributes,
|
|
148619
148682
|
/*includeTrivia*/
|
|
148620
148683
|
true
|
|
148621
148684
|
)
|
|
@@ -148643,7 +148706,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148643
148706
|
true
|
|
148644
148707
|
),
|
|
148645
148708
|
getSynthesizedDeepClone(
|
|
148646
|
-
declaration.
|
|
148709
|
+
declaration.attributes,
|
|
148647
148710
|
/*includeTrivia*/
|
|
148648
148711
|
true
|
|
148649
148712
|
)
|
|
@@ -148666,7 +148729,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
148666
148729
|
true,
|
|
148667
148730
|
importClause.name,
|
|
148668
148731
|
newNamedBindings
|
|
148669
|
-
), declaration.moduleSpecifier, declaration.
|
|
148732
|
+
), declaration.moduleSpecifier, declaration.attributes);
|
|
148670
148733
|
changes.replaceNode(sourceFile, declaration, importDeclaration);
|
|
148671
148734
|
}
|
|
148672
148735
|
}
|
|
@@ -150189,7 +150252,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
150189
150252
|
factory.createNamespaceImport(factory.createIdentifier(namespaceLikeImport.name))
|
|
150190
150253
|
),
|
|
150191
150254
|
quotedModuleSpecifier,
|
|
150192
|
-
/*
|
|
150255
|
+
/*attributes*/
|
|
150193
150256
|
void 0
|
|
150194
150257
|
);
|
|
150195
150258
|
statements = combine(statements, declaration);
|
|
@@ -150807,7 +150870,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
150807
150870
|
)
|
|
150808
150871
|
),
|
|
150809
150872
|
node.moduleSpecifier,
|
|
150810
|
-
node.
|
|
150873
|
+
node.attributes
|
|
150811
150874
|
)
|
|
150812
150875
|
);
|
|
150813
150876
|
}
|
|
@@ -150824,7 +150887,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
150824
150887
|
)),
|
|
150825
150888
|
/*moduleSpecifier*/
|
|
150826
150889
|
void 0,
|
|
150827
|
-
/*
|
|
150890
|
+
/*attributes*/
|
|
150828
150891
|
void 0
|
|
150829
150892
|
));
|
|
150830
150893
|
}
|
|
@@ -155795,7 +155858,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155795
155858
|
namedImports
|
|
155796
155859
|
),
|
|
155797
155860
|
required,
|
|
155798
|
-
/*
|
|
155861
|
+
/*attributes*/
|
|
155799
155862
|
void 0
|
|
155800
155863
|
)
|
|
155801
155864
|
);
|
|
@@ -155964,7 +156027,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
155964
156027
|
const newTypeNode = factory.updateImportTypeNode(
|
|
155965
156028
|
importType,
|
|
155966
156029
|
importType.argument,
|
|
155967
|
-
importType.
|
|
156030
|
+
importType.attributes,
|
|
155968
156031
|
importType.qualifier,
|
|
155969
156032
|
importType.typeArguments,
|
|
155970
156033
|
/*isTypeOf*/
|
|
@@ -156232,7 +156295,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156232
156295
|
void 0
|
|
156233
156296
|
),
|
|
156234
156297
|
importDeclaration.moduleSpecifier,
|
|
156235
|
-
importDeclaration.
|
|
156298
|
+
importDeclaration.attributes
|
|
156236
156299
|
)
|
|
156237
156300
|
);
|
|
156238
156301
|
changes.insertNodeAfter(
|
|
@@ -156249,7 +156312,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
156249
156312
|
importClause.namedBindings
|
|
156250
156313
|
),
|
|
156251
156314
|
importDeclaration.moduleSpecifier,
|
|
156252
|
-
importDeclaration.
|
|
156315
|
+
importDeclaration.attributes
|
|
156253
156316
|
)
|
|
156254
156317
|
);
|
|
156255
156318
|
}
|
|
@@ -165577,7 +165640,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165577
165640
|
/*importClause*/
|
|
165578
165641
|
void 0,
|
|
165579
165642
|
moduleSpecifier,
|
|
165580
|
-
/*
|
|
165643
|
+
/*attributes*/
|
|
165581
165644
|
void 0
|
|
165582
165645
|
));
|
|
165583
165646
|
} else {
|
|
@@ -165743,7 +165806,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165743
165806
|
exportDecl.isTypeOnly,
|
|
165744
165807
|
exportDecl.exportClause && (isNamedExports(exportDecl.exportClause) ? factory.updateNamedExports(exportDecl.exportClause, sortedExportSpecifiers) : factory.updateNamespaceExport(exportDecl.exportClause, exportDecl.exportClause.name)),
|
|
165745
165808
|
exportDecl.moduleSpecifier,
|
|
165746
|
-
exportDecl.
|
|
165809
|
+
exportDecl.attributes
|
|
165747
165810
|
)
|
|
165748
165811
|
);
|
|
165749
165812
|
}
|
|
@@ -165775,7 +165838,7 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
165775
165838
|
factory.updateImportClause(importDeclaration.importClause, importDeclaration.importClause.isTypeOnly, name, namedBindings),
|
|
165776
165839
|
// TODO: GH#18217
|
|
165777
165840
|
importDeclaration.moduleSpecifier,
|
|
165778
|
-
importDeclaration.
|
|
165841
|
+
importDeclaration.attributes
|
|
165779
165842
|
);
|
|
165780
165843
|
}
|
|
165781
165844
|
function sortSpecifiers(specifiers, comparer) {
|
|
@@ -166293,10 +166356,11 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
|
|
|
166293
166356
|
return spanForParenthesizedExpression(n);
|
|
166294
166357
|
case 275 /* NamedImports */:
|
|
166295
166358
|
case 279 /* NamedExports */:
|
|
166359
|
+
case 300 /* ImportAttributes */:
|
|
166296
166360
|
case 300 /* AssertClause */:
|
|
166297
|
-
return
|
|
166361
|
+
return spanForImportExportElements(n);
|
|
166298
166362
|
}
|
|
166299
|
-
function
|
|
166363
|
+
function spanForImportExportElements(node) {
|
|
166300
166364
|
if (!node.elements.length) {
|
|
166301
166365
|
return void 0;
|
|
166302
166366
|
}
|
|
@@ -184915,7 +184979,7 @@ ${e.message}`;
|
|
|
184915
184979
|
getRenameLocation: () => getRenameLocation,
|
|
184916
184980
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
184917
184981
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
184918
|
-
|
|
184982
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
184919
184983
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
184920
184984
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
184921
184985
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -185047,6 +185111,7 @@ ${e.message}`;
|
|
|
185047
185111
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
185048
185112
|
hasQuestionToken: () => hasQuestionToken,
|
|
185049
185113
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
185114
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
185050
185115
|
hasRestParameter: () => hasRestParameter,
|
|
185051
185116
|
hasScopeMarker: () => hasScopeMarker,
|
|
185052
185117
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -185120,7 +185185,6 @@ ${e.message}`;
|
|
|
185120
185185
|
isAssertClause: () => isAssertClause,
|
|
185121
185186
|
isAssertEntry: () => isAssertEntry,
|
|
185122
185187
|
isAssertionExpression: () => isAssertionExpression,
|
|
185123
|
-
isAssertionKey: () => isAssertionKey,
|
|
185124
185188
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
185125
185189
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
185126
185190
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -185330,6 +185394,9 @@ ${e.message}`;
|
|
|
185330
185394
|
isIfStatement: () => isIfStatement,
|
|
185331
185395
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
185332
185396
|
isImplicitGlob: () => isImplicitGlob,
|
|
185397
|
+
isImportAttribute: () => isImportAttribute,
|
|
185398
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
185399
|
+
isImportAttributes: () => isImportAttributes,
|
|
185333
185400
|
isImportCall: () => isImportCall,
|
|
185334
185401
|
isImportClause: () => isImportClause,
|
|
185335
185402
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -185521,7 +185588,6 @@ ${e.message}`;
|
|
|
185521
185588
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
185522
185589
|
isNewExpression: () => isNewExpression,
|
|
185523
185590
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
185524
|
-
isNightly: () => isNightly,
|
|
185525
185591
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
185526
185592
|
isNode: () => isNode,
|
|
185527
185593
|
isNodeArray: () => isNodeArray,
|
|
@@ -187322,7 +187388,7 @@ ${e.message}`;
|
|
|
187322
187388
|
getRenameLocation: () => getRenameLocation,
|
|
187323
187389
|
getReplacementSpanForContextToken: () => getReplacementSpanForContextToken,
|
|
187324
187390
|
getResolutionDiagnostic: () => getResolutionDiagnostic,
|
|
187325
|
-
|
|
187391
|
+
getResolutionModeOverride: () => getResolutionModeOverride,
|
|
187326
187392
|
getResolveJsonModule: () => getResolveJsonModule,
|
|
187327
187393
|
getResolvePackageJsonExports: () => getResolvePackageJsonExports,
|
|
187328
187394
|
getResolvePackageJsonImports: () => getResolvePackageJsonImports,
|
|
@@ -187454,6 +187520,7 @@ ${e.message}`;
|
|
|
187454
187520
|
hasPropertyAccessExpressionWithName: () => hasPropertyAccessExpressionWithName,
|
|
187455
187521
|
hasQuestionToken: () => hasQuestionToken,
|
|
187456
187522
|
hasRecordedExternalHelpers: () => hasRecordedExternalHelpers,
|
|
187523
|
+
hasResolutionModeOverride: () => hasResolutionModeOverride,
|
|
187457
187524
|
hasRestParameter: () => hasRestParameter,
|
|
187458
187525
|
hasScopeMarker: () => hasScopeMarker,
|
|
187459
187526
|
hasStaticModifier: () => hasStaticModifier,
|
|
@@ -187527,7 +187594,6 @@ ${e.message}`;
|
|
|
187527
187594
|
isAssertClause: () => isAssertClause,
|
|
187528
187595
|
isAssertEntry: () => isAssertEntry,
|
|
187529
187596
|
isAssertionExpression: () => isAssertionExpression,
|
|
187530
|
-
isAssertionKey: () => isAssertionKey,
|
|
187531
187597
|
isAssertsKeyword: () => isAssertsKeyword,
|
|
187532
187598
|
isAssignmentDeclaration: () => isAssignmentDeclaration,
|
|
187533
187599
|
isAssignmentExpression: () => isAssignmentExpression,
|
|
@@ -187737,6 +187803,9 @@ ${e.message}`;
|
|
|
187737
187803
|
isIfStatement: () => isIfStatement,
|
|
187738
187804
|
isIgnoredFileFromWildCardWatching: () => isIgnoredFileFromWildCardWatching,
|
|
187739
187805
|
isImplicitGlob: () => isImplicitGlob,
|
|
187806
|
+
isImportAttribute: () => isImportAttribute,
|
|
187807
|
+
isImportAttributeName: () => isImportAttributeName,
|
|
187808
|
+
isImportAttributes: () => isImportAttributes,
|
|
187740
187809
|
isImportCall: () => isImportCall,
|
|
187741
187810
|
isImportClause: () => isImportClause,
|
|
187742
187811
|
isImportDeclaration: () => isImportDeclaration,
|
|
@@ -187928,7 +187997,6 @@ ${e.message}`;
|
|
|
187928
187997
|
isNamespaceReexportDeclaration: () => isNamespaceReexportDeclaration,
|
|
187929
187998
|
isNewExpression: () => isNewExpression,
|
|
187930
187999
|
isNewExpressionTarget: () => isNewExpressionTarget,
|
|
187931
|
-
isNightly: () => isNightly,
|
|
187932
188000
|
isNoSubstitutionTemplateLiteral: () => isNoSubstitutionTemplateLiteral,
|
|
187933
188001
|
isNode: () => isNode,
|
|
187934
188002
|
isNodeArray: () => isNodeArray,
|