generated from actions/javascript-action
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(deps-dev): bump typescript from 5.7.3 to 5.8.2 in the typescript group #999
Merged
github-actions
merged 1 commit into
main
from
dependabot/npm_and_yarn/typescript-72b643b273
Mar 3, 2025
Merged
chore(deps-dev): bump typescript from 5.7.3 to 5.8.2 in the typescript group #999
github-actions
merged 1 commit into
main
from
dependabot/npm_and_yarn/typescript-72b643b273
Mar 3, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Diff between typescript 5.7.3 and 5.8.2diff --git a/lib/_tsc.js b/lib/_tsc.js
index v5.7.3..v5.8.2 100644
--- a/lib/_tsc.js
+++ b/lib/_tsc.js
@@ -18,6 +18,6 @@
// src/compiler/corePublic.ts
-var versionMajorMinor = "5.7";
-var version = "5.7.3";
+var versionMajorMinor = "5.8";
+var version = "5.8.2";
// src/compiler/core.ts
@@ -3734,4 +3734,5 @@
ModuleKind2[ModuleKind2["ESNext"] = 99] = "ESNext";
ModuleKind2[ModuleKind2["Node16"] = 100] = "Node16";
+ ModuleKind2[ModuleKind2["Node18"] = 101] = "Node18";
ModuleKind2[ModuleKind2["NodeNext"] = 199] = "NodeNext";
ModuleKind2[ModuleKind2["Preserve"] = 200] = "Preserve";
@@ -5500,13 +5501,96 @@
return reducePathComponents(getPathComponents(path, currentDirectory));
}
-function getNormalizedAbsolutePath(fileName, currentDirectory) {
- return getPathFromPathComponents(getNormalizedPathComponents(fileName, currentDirectory));
+function getNormalizedAbsolutePath(path, currentDirectory) {
+ let rootLength = getRootLength(path);
+ if (rootLength === 0 && currentDirectory) {
+ path = combinePaths(currentDirectory, path);
+ rootLength = getRootLength(path);
+ } else {
+ path = normalizeSlashes(path);
+ }
+ const simpleNormalized = simpleNormalizePath(path);
+ if (simpleNormalized !== void 0) {
+ return simpleNormalized.length > rootLength ? removeTrailingDirectorySeparator(simpleNormalized) : simpleNormalized;
+ }
+ const length2 = path.length;
+ const root = path.substring(0, rootLength);
+ let normalized;
+ let index = rootLength;
+ let segmentStart = index;
+ let normalizedUpTo = index;
+ let seenNonDotDotSegment = rootLength !== 0;
+ while (index < length2) {
+ segmentStart = index;
+ let ch = path.charCodeAt(index);
+ while (ch === 47 /* slash */ && index + 1 < length2) {
+ index++;
+ ch = path.charCodeAt(index);
+ }
+ if (index > segmentStart) {
+ normalized ?? (normalized = path.substring(0, segmentStart - 1));
+ segmentStart = index;
+ }
+ let segmentEnd = path.indexOf(directorySeparator, index + 1);
+ if (segmentEnd === -1) {
+ segmentEnd = length2;
+ }
+ const segmentLength = segmentEnd - segmentStart;
+ if (segmentLength === 1 && path.charCodeAt(index) === 46 /* dot */) {
+ normalized ?? (normalized = path.substring(0, normalizedUpTo));
+ } else if (segmentLength === 2 && path.charCodeAt(index) === 46 /* dot */ && path.charCodeAt(index + 1) === 46 /* dot */) {
+ if (!seenNonDotDotSegment) {
+ if (normalized !== void 0) {
+ normalized += normalized.length === rootLength ? ".." : "/..";
+ } else {
+ normalizedUpTo = index + 2;
+ }
+ } else if (normalized === void 0) {
+ if (normalizedUpTo - 2 >= 0) {
+ normalized = path.substring(0, Math.max(rootLength, path.lastIndexOf(directorySeparator, normalizedUpTo - 2)));
+ } else {
+ normalized = path.substring(0, normalizedUpTo);
+ }
+ } else {
+ const lastSlash = normalized.lastIndexOf(directorySeparator);
+ if (lastSlash !== -1) {
+ normalized = normalized.substring(0, Math.max(rootLength, lastSlash));
+ } else {
+ normalized = root;
+ }
+ if (normalized.length === rootLength) {
+ seenNonDotDotSegment = rootLength !== 0;
+ }
+ }
+ } else if (normalized !== void 0) {
+ if (normalized.length !== rootLength) {
+ normalized += directorySeparator;
+ }
+ seenNonDotDotSegment = true;
+ normalized += path.substring(segmentStart, segmentEnd);
+ } else {
+ seenNonDotDotSegment = true;
+ normalizedUpTo = segmentEnd;
+ }
+ index = segmentEnd + 1;
+ }
+ return normalized ?? (length2 > rootLength ? removeTrailingDirectorySeparator(path) : path);
}
function normalizePath(path) {
path = normalizeSlashes(path);
+ let normalized = simpleNormalizePath(path);
+ if (normalized !== void 0) {
+ return normalized;
+ }
+ normalized = getNormalizedAbsolutePath(path, "");
+ return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
+}
+function simpleNormalizePath(path) {
if (!relativePathSegmentRegExp.test(path)) {
return path;
}
- const simplified = path.replace(/\/\.\//g, "/").replace(/^\.\//, "");
+ let simplified = path.replace(/\/\.\//g, "/");
+ if (simplified.startsWith("./")) {
+ simplified = simplified.slice(2);
+ }
if (simplified !== path) {
path = simplified;
@@ -5515,6 +5599,5 @@
}
}
- const normalized = getPathFromPathComponents(reducePathComponents(getPathComponents(path)));
- return normalized && hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(normalized) : normalized;
+ return void 0;
}
function getPathWithoutRoot(pathComponents2) {
@@ -5938,4 +6021,5 @@
_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enabled_Consider_using_export_type_0_as_default: diag(1292, 1 /* Error */, "_0_resolves_to_a_type_and_must_be_marked_type_only_in_this_file_before_re_exporting_when_1_is_enable_1292", "'{0}' resolves to a type and must be marked type-only in this file before re-exporting when '{1}' is enabled. Consider using 'export type { {0} as default }'."),
ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve: diag(1293, 1 /* Error */, "ESM_syntax_is_not_allowed_in_a_CommonJS_module_when_module_is_set_to_preserve_1293", "ESM syntax is not allowed in a CommonJS module when 'module' is set to 'preserve'."),
+ This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled: diag(1294, 1 /* Error */, "This_syntax_is_not_allowed_when_erasableSyntaxOnly_is_enabled_1294", "This syntax is not allowed when 'erasableSyntaxOnly' is enabled."),
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, 1 /* Error */, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, 1 /* Error */, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
@@ -5952,6 +6036,6 @@
Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, 1 /* Error */, "Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_cal_1321", "Type of 'yield' operand in an async generator must either be a valid promise or must not contain a callable 'then' member."),
Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1322, 1 /* Error */, "Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322", "Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member."),
- Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, 1 /* Error */, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', or 'nodenext'."),
- Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodenext_or_preserve: diag(1324, 1 /* Error */, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_nodene_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'nodenext', or 'preserve'."),
+ Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_node18_or_nodenext: diag(1323, 1 /* Error */, "Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd__1323", "Dynamic imports are only supported when the '--module' flag is set to 'es2020', 'es2022', 'esnext', 'commonjs', 'amd', 'system', 'umd', 'node16', 'node18', or 'nodenext'."),
+ Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_nodenext_or_preserve: diag(1324, 1 /* Error */, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_node18_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', 'node18', 'nodenext', or 'preserve'."),
Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, 1 /* Error */, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, 1 /* Error */, "This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot__1326", "This use of 'import' is invalid. 'import()' calls can be written, but they must have parentheses and cannot have type arguments."),
@@ -5970,5 +6054,5 @@
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, 1 /* Error */, "Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0_1340", "Module '{0}' does not refer to a type, but is used as a type here. Did you mean 'typeof import('{0}')'?"),
Class_constructor_may_not_be_an_accessor: diag(1341, 1 /* Error */, "Class_constructor_may_not_be_an_accessor_1341", "Class constructor may not be an accessor."),
- The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', or 'nodenext'."),
+ The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext: diag(1343, 1 /* Error */, "The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system__1343", "The 'import.meta' meta-property is only allowed when the '--module' option is 'es2020', 'es2022', 'esnext', 'system', 'node16', 'node18', or 'nodenext'."),
A_label_is_not_allowed_here: diag(1344, 1 /* Error */, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, 1 /* Error */, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
@@ -6000,5 +6084,5 @@
_0_was_imported_here: diag(1376, 3 /* Message */, "_0_was_imported_here_1376", "'{0}' was imported here."),
_0_was_exported_here: diag(1377, 3 /* Message */, "_0_was_exported_here_1377", "'{0}' was exported here."),
- Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
+ Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1378, 1 /* Error */, "Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type_1379", "An import alias cannot reference a declaration that was exported using 'export type'."),
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, 1 /* Error */, "An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type_1380", "An import alias cannot reference a declaration that was imported using 'import type'."),
@@ -6051,5 +6135,5 @@
The_file_is_in_the_program_because_Colon: diag(1430, 3 /* Message */, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
for_await_loops_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(1431, 1 /* Error */, "for_await_loops_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_file_1431", "'for await' loops 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."),
- Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
+ Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_and_the_target_option_is_set_to_es2017_or_higher: diag(1432, 1 /* Error */, "Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_nod_1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters: diag(1433, 1 /* Error */, "Neither_decorators_nor_modifiers_may_be_applied_to_this_parameters_1433", "Neither decorators nor modifiers may be applied to 'this' parameters."),
Unexpected_keyword_or_identifier: diag(1434, 1 /* Error */, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
@@ -6693,7 +6777,7 @@
Namespace_name_cannot_be_0: diag(2819, 1 /* Error */, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
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}'?"),
- Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
+ Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2821, 1 /* Error */, "Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2821", "Import assertions are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),
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."),
- Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_nodenext_or_preserve_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'nodenext', or 'preserve'."),
+ Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_preserve: diag(2823, 1 /* Error */, "Import_attributes_are_only_supported_when_the_module_option_is_set_to_esnext_node18_nodenext_or_pres_2823", "Import attributes are only supported when the '--module' option is set to 'esnext', 'node18', 'nodenext', or 'preserve'."),
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}'?"),
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."),
@@ -6715,5 +6799,5 @@
await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(2852, 1 /* Error */, "await_using_statements_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_2852", "'await using' statements are only allowed within async functions and at the top levels of modules."),
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."),
- Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_nodenext_or_preserve_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', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
+ Top_level_await_using_statements_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_node16_node18_nodenext_or_preserve_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', 'node18', 'nodenext', or 'preserve', and the 'target' option is set to 'es2017' or higher."),
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."),
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."),
@@ -6741,4 +6825,5 @@
This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_between_the_projects_output_files_is_not_the_same_as_the_relative_path_between_its_input_files: diag(2878, 1 /* Error */, "This_import_path_is_unsafe_to_rewrite_because_it_resolves_to_another_project_and_the_relative_path_b_2878", "This import path is unsafe to rewrite because it resolves to another project, and the relative path between the projects' output files is not the same as the relative path between its input files."),
Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found: diag(2879, 1 /* Error */, "Using_JSX_fragments_requires_fragment_factory_0_to_be_in_scope_but_it_could_not_be_found_2879", "Using JSX fragments requires fragment factory '{0}' to be in scope, but it could not be found."),
+ Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert: diag(2880, 1 /* Error */, "Import_assertions_have_been_replaced_by_import_attributes_Use_with_instead_of_assert_2880", "Import assertions have been replaced by import attributes. Use 'with' instead of 'assert'."),
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}'."),
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}'."),
@@ -6850,4 +6935,6 @@
Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given: diag(4125, 1 /* Error */, "Each_declaration_of_0_1_differs_in_its_value_where_2_was_expected_but_3_was_given_4125", "Each declaration of '{0}.{1}' differs in its value, where '{2}' was expected but '{3}' was given."),
One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value: diag(4126, 1 /* Error */, "One_value_of_0_1_is_the_string_2_and_the_other_is_assumed_to_be_an_unknown_numeric_value_4126", "One value of '{0}.{1}' is the string '{2}', and the other is assumed to be an unknown numeric value."),
+ This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic: diag(4127, 1 /* Error */, "This_member_cannot_have_an_override_modifier_because_its_name_is_dynamic_4127", "This member cannot have an 'override' modifier because its name is dynamic."),
+ This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic: diag(4128, 1 /* Error */, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_name_is_dynamic_4128", "This member cannot have a JSDoc comment with an '@override' tag because its name is dynamic."),
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."),
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."),
@@ -7422,4 +7509,5 @@
Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files: diag(6719, 3 /* Message */, "Require_sufficient_annotation_on_exports_so_other_tools_can_trivially_generate_declaration_files_6719", "Require sufficient annotation on exports so other tools can trivially generate declaration files."),
Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any: diag(6720, 3 /* Message */, "Built_in_iterators_are_instantiated_with_a_TReturn_type_of_undefined_instead_of_any_6720", "Built-in iterators are instantiated with a 'TReturn' type of 'undefined' instead of 'any'."),
+ Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript: diag(6721, 3 /* Message */, "Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript_6721", "Do not allow runtime constructs that are not part of ECMAScript."),
Default_catch_clause_variables_as_unknown_instead_of_any: diag(6803, 3 /* Message */, "Default_catch_clause_variables_as_unknown_instead_of_any_6803", "Default catch clause variables as 'unknown' instead of 'any'."),
Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_in_the_output_file_s_format_based_on_the_module_setting: diag(6804, 3 /* Message */, "Do_not_transform_or_elide_any_imports_or_exports_not_marked_as_type_only_ensuring_they_are_written_i_6804", "Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting."),
@@ -7427,4 +7515,5 @@
Check_side_effect_imports: diag(6806, 3 /* Message */, "Check_side_effect_imports_6806", "Check side effect imports."),
This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2: diag(6807, 1 /* Error */, "This_operation_can_be_simplified_This_shift_is_identical_to_0_1_2_6807", "This operation can be simplified. This shift is identical to `{0} {1} {2}`."),
+ Enable_lib_replacement: diag(6808, 3 /* Message */, "Enable_lib_replacement_6808", "Enable lib replacement."),
one_of_Colon: diag(6900, 3 /* Message */, "one_of_Colon_6900", "one of:"),
one_or_more_Colon: diag(6901, 3 /* Message */, "one_or_more_Colon_6901", "one or more:"),
@@ -13151,4 +13240,7 @@
"fround",
"cbrt"
+ ],
+ esnext: [
+ "f16round"
]
})),
@@ -13320,4 +13412,8 @@
"getBigInt64",
"getBigUint64"
+ ],
+ esnext: [
+ "setFloat16",
+ "getFloat16"
]
})),
@@ -13423,4 +13519,7 @@
]
})),
+ Float16Array: new Map(Object.entries({
+ esnext: emptyArray
+ })),
Float32Array: new Map(Object.entries({
es2022: [
@@ -13591,5 +13690,5 @@
}
function isCommonJSContainingModuleKind(kind) {
- return kind === 1 /* CommonJS */ || kind === 100 /* Node16 */ || kind === 199 /* NodeNext */;
+ return kind === 1 /* CommonJS */ || 100 /* Node16 */ <= kind && kind <= 199 /* NodeNext */;
}
function isEffectiveExternalModule(node, compilerOptions) {
@@ -14259,7 +14358,4 @@
});
}
-function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
- return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
-}
function getTsConfigObjectLiteralExpression(tsConfigSourceFile) {
if (tsConfigSourceFile && tsConfigSourceFile.statements.length) {
@@ -17819,5 +17915,5 @@
computeValue: (compilerOptions) => {
const target = compilerOptions.target === 0 /* ES3 */ ? void 0 : compilerOptions.target;
- return target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
+ return target ?? (compilerOptions.module === 100 /* Node16 */ && 9 /* ES2022 */ || compilerOptions.module === 101 /* Node18 */ && 9 /* ES2022 */ || compilerOptions.module === 199 /* NodeNext */ && 99 /* ESNext */ || 1 /* ES5 */);
}
},
@@ -17838,4 +17934,5 @@
break;
case 100 /* Node16 */:
+ case 101 /* Node18 */:
moduleResolution = 3 /* Node16 */;
break;
@@ -17857,5 +17954,9 @@
dependencies: ["module", "target"],
computeValue: (compilerOptions) => {
- return compilerOptions.moduleDetection || (_computedOptions.module.computeValue(compilerOptions) === 100 /* Node16 */ || _computedOptions.module.computeValue(compilerOptions) === 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */);
+ if (compilerOptions.moduleDetection !== void 0) {
+ return compilerOptions.moduleDetection;
+ }
+ const moduleKind = _computedOptions.module.computeValue(compilerOptions);
+ return 100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ ? 3 /* Force */ : 2 /* Auto */;
}
},
@@ -17874,4 +17975,5 @@
switch (_computedOptions.module.computeValue(compilerOptions)) {
case 100 /* Node16 */:
+ case 101 /* Node18 */:
case 199 /* NodeNext */:
case 200 /* Preserve */:
@@ -18067,4 +18169,7 @@
return moduleResolution >= 3 /* Node16 */ && moduleResolution <= 99 /* NodeNext */ || moduleResolution === 100 /* Bundler */;
}
+function moduleSupportsImportAttributes(moduleKind) {
+ return 101 /* Node18 */ <= moduleKind && moduleKind <= 199 /* NodeNext */ || moduleKind === 200 /* Preserve */ || moduleKind === 99 /* ESNext */;
+}
function getStrictOptionValue(compilerOptions, flag) {
return compilerOptions[flag] === void 0 ? !!compilerOptions.strict : !!compilerOptions[flag];
@@ -18784,5 +18889,5 @@
}
function isValidTypeOnlyAliasUseSite(useSite) {
- return !!(useSite.flags & 33554432 /* Ambient */) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
+ return !!(useSite.flags & 33554432 /* Ambient */) || isInJSDoc(useSite) || isPartOfTypeQuery(useSite) || isIdentifierInNonEmittingHeritageClause(useSite) || isPartOfPossiblyValidTypeOrAbstractComputedPropertyName(useSite) || !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
}
function isShorthandPropertyNameUseSite(useSite) {
@@ -19850,4 +19955,62 @@
return isFunctionLike(node) || isJSDocSignature(node) || isMappedTypeNode(node);
}
+function getLibNameFromLibReference(libReference) {
+ return toFileNameLowerCase(libReference.fileName);
+}
+function getLibFileNameFromLibReference(libReference) {
+ const libName = getLibNameFromLibReference(libReference);
+ return libMap.get(libName);
+}
+function forEachResolvedProjectReference(resolvedProjectReferences, cb) {
+ return forEachProjectReference(
+ /*projectReferences*/
+ void 0,
+ resolvedProjectReferences,
+ (resolvedRef, parent) => resolvedRef && cb(resolvedRef, parent)
+ );
+}
+function forEachProjectReference(projectReferences, resolvedProjectReferences, cbResolvedRef, cbRef) {
+ let seenResolvedRefs;
+ return worker(
+ projectReferences,
+ resolvedProjectReferences,
+ /*parent*/
+ void 0
+ );
+ function worker(projectReferences2, resolvedProjectReferences2, parent) {
+ if (cbRef) {
+ const result = cbRef(projectReferences2, parent);
+ if (result) return result;
+ }
+ let skipChildren;
+ return forEach(
+ resolvedProjectReferences2,
+ (resolvedRef, index) => {
+ if (resolvedRef && (seenResolvedRefs == null ? void 0 : seenResolvedRefs.has(resolvedRef.sourceFile.path))) {
+ (skipChildren ?? (skipChildren = /* @__PURE__ */ new Set())).add(resolvedRef);
+ return void 0;
+ }
+ const result = cbResolvedRef(resolvedRef, parent, index);
+ if (result || !resolvedRef) return result;
+ (seenResolvedRefs || (seenResolvedRefs = /* @__PURE__ */ new Set())).add(resolvedRef.sourceFile.path);
+ }
+ ) || forEach(
+ resolvedProjectReferences2,
+ (resolvedRef) => resolvedRef && !(skipChildren == null ? void 0 : skipChildren.has(resolvedRef)) ? worker(resolvedRef.commandLine.projectReferences, resolvedRef.references, resolvedRef) : void 0
+ );
+ }
+}
+function getOptionsSyntaxByArrayElementValue(optionsObject, name, value) {
+ return optionsObject && getPropertyArrayElementValue(optionsObject, name, value);
+}
+function getPropertyArrayElementValue(objectLiteral, propKey, elementValue) {
+ return forEachPropertyAssignment(objectLiteral, propKey, (property) => isArrayLiteralExpression(property.initializer) ? find(property.initializer.elements, (element) => isStringLiteral(element) && element.text === elementValue) : void 0);
+}
+function getOptionsSyntaxByValue(optionsObject, name, value) {
+ return forEachOptionsSyntaxByName(optionsObject, name, (property) => isStringLiteral(property.initializer) && property.initializer.text === value ? property.initializer : void 0);
+}
+function forEachOptionsSyntaxByName(optionsObject, name, callback) {
+ return forEachPropertyAssignment(optionsObject, name, callback);
+}
// src/compiler/factory/baseNodeFactory.ts
@@ -22456,4 +22619,6 @@
node.whenFalse = parenthesizerRules().parenthesizeBranchOfConditionalExpression(whenFalse);
node.transformFlags |= propagateChildFlags(node.condition) | propagateChildFlags(node.questionToken) | propagateChildFlags(node.whenTrue) | propagateChildFlags(node.colonToken) | propagateChildFlags(node.whenFalse);
+ node.flowNodeWhenFalse = void 0;
+ node.flowNodeWhenTrue = void 0;
return node;
}
@@ -24259,5 +24424,5 @@
return isParenthesizedExpression(node) && nodeIsSynthesized(node) && nodeIsSynthesized(getSourceMapRange(node)) && nodeIsSynthesized(getCommentRange(node)) && !some(getSyntheticLeadingComments(node)) && !some(getSyntheticTrailingComments(node));
}
- function restoreOuterExpressions(outerExpression, innerExpression, kinds = 31 /* All */) {
+ function restoreOuterExpressions(outerExpression, innerExpression, kinds = 63 /* All */) {
if (outerExpression && isOuterExpression(outerExpression, kinds) && !isIgnorableParen(outerExpression)) {
return updateOuterExpression(
@@ -24305,5 +24470,5 @@
}
function createCallBinding(expression, recordTempVariable, languageVersion, cacheIdentifiers = false) {
- const callee = skipOuterExpressions(expression, 31 /* All */);
+ const callee = skipOuterExpressions(expression, 63 /* All */);
let thisArg;
let target;
@@ -27174,5 +27339,5 @@
return type;
}
-function isOuterExpression(node, kinds = 31 /* All */) {
+function isOuterExpression(node, kinds = 63 /* All */) {
switch (node.kind) {
case 217 /* ParenthesizedExpression */:
@@ -27183,6 +27348,7 @@
case 216 /* TypeAssertionExpression */:
case 234 /* AsExpression */:
- case 238 /* SatisfiesExpression */:
return (kinds & 2 /* TypeAssertions */) !== 0;
+ case 238 /* SatisfiesExpression */:
+ return (kinds & (2 /* TypeAssertions */ | 32 /* Satisfies */)) !== 0;
case 233 /* ExpressionWithTypeArguments */:
return (kinds & 16 /* ExpressionsWithTypeArguments */) !== 0;
@@ -27194,5 +27360,5 @@
return false;
}
-function skipOuterExpressions(node, kinds = 31 /* All */) {
+function skipOuterExpressions(node, kinds = 63 /* All */) {
while (isOuterExpression(node, kinds)) {
node = node.expression;
@@ -27200,5 +27366,5 @@
return node;
}
-function walkUpOuterExpressions(node, kinds = 31 /* All */) {
+function walkUpOuterExpressions(node, kinds = 63 /* All */) {
let parent = node.parent;
while (isOuterExpression(parent, kinds)) {
@@ -35057,4 +35223,5 @@
const res = finishNode(node, pos);
if (usedBrace) {
+ skipWhitespace();
parseExpected(20 /* CloseBraceToken */);
}
@@ -36102,4 +36269,6 @@
["esnext.string", "lib.es2024.string.d.ts"],
["esnext.iterator", "lib.esnext.iterator.d.ts"],
+ ["esnext.promise", "lib.esnext.promise.d.ts"],
+ ["esnext.float16", "lib.esnext.float16.d.ts"],
["decorators", "lib.decorators.d.ts"],
["decorators.legacy", "lib.decorators.legacy.d.ts"]
@@ -36428,4 +36597,5 @@
esnext: 99 /* ESNext */,
node16: 100 /* Node16 */,
+ node18: 101 /* Node18 */,
nodenext: 199 /* NodeNext */,
preserve: 200 /* Preserve */
@@ -36680,4 +36850,21 @@
affectsSemanticDiagnostics: true
},
+ {
+ name: "erasableSyntaxOnly",
+ type: "boolean",
+ category: Diagnostics.Interop_Constraints,
+ description: Diagnostics.Do_not_allow_runtime_constructs_that_are_not_part_of_ECMAScript,
+ defaultValueDescription: false,
+ affectsBuildInfo: true,
+ affectsSemanticDiagnostics: true
+ },
+ {
+ name: "libReplacement",
+ type: "boolean",
+ affectsProgramStructure: true,
+ category: Diagnostics.Language_and_Environment,
+ description: Diagnostics.Enable_lib_replacement,
+ defaultValueDescription: true
+ },
// Strict Type Checks
{
@@ -40732,7 +40919,5 @@
function loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson = true) {
const packageInfo = considerPackageJson ? getPackageJsonInfo(candidate, onlyRecordFailures, state) : void 0;
- const packageJsonContent = packageInfo && packageInfo.contents.packageJsonContent;
- const versionPaths = packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state);
- return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJsonContent, versionPaths), state);
+ return withPackageId(packageInfo, loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo), state);
}
function getTemporaryModuleResolutionState(packageJsonInfoCache, host, options) {
@@ -40841,11 +41026,12 @@
}
}
-function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, jsonContent, versionPaths) {
+function loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageJson) {
+ const versionPaths = packageJson && getVersionPathsOfPackageJsonInfo(packageJson, state);
let packageFile;
- if (jsonContent) {
+ if (packageJson && arePathsEqual(packageJson == null ? void 0 : packageJson.packageDirectory, candidate, state.host)) {
if (state.isConfigLookup) {
- packageFile = readPackageJsonTSConfigField(jsonContent, candidate, state);
+ packageFile = readPackageJsonTSConfigField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state);
} else {
- packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(jsonContent, candidate, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(jsonContent, candidate, state) || void 0;
+ packageFile = extensions & 4 /* Declaration */ && readPackageJsonTypesFields(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || extensions & (3 /* ImplementationFiles */ | 4 /* Declaration */) && readPackageJsonMainField(packageJson.contents.packageJsonContent, packageJson.packageDirectory, state) || void 0;
}
}
@@ -40866,5 +41052,5 @@
const candidateIsFromPackageJsonField = state2.candidateIsFromPackageJsonField;
state2.candidateIsFromPackageJsonField = true;
- if ((jsonContent == null ? void 0 : jsonContent.type) !== "module") {
+ if ((packageJson == null ? void 0 : packageJson.contents.packageJsonContent.type) !== "module") {
state2.features &= ~32 /* EsmMode */;
}
@@ -41137,4 +41323,5 @@
return loadModuleFromTargetExportOrImport;
function loadModuleFromTargetExportOrImport(target, subpath, pattern, key) {
+ var _a, _b;
if (typeof target === "string") {
if (!pattern && subpath.length > 0 && !endsWith(target, "/")) {
@@ -41165,4 +41352,6 @@
state.conditions
);
+ (_a = state.failedLookupLocations) == null ? void 0 : _a.push(...result.failedLookupLocations ?? emptyArray);
+ (_b = state.affectingLocations) == null ? void 0 : _b.push(...result.affectingLocations ?? emptyArray);
return toSearchResult(
result.resolvedModule ? {
@@ -41274,7 +41463,7 @@
);
function toAbsolutePath(path) {
- var _a, _b;
+ var _a2, _b2;
if (path === void 0) return path;
- return getNormalizedAbsolutePath(path, (_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a));
+ return getNormalizedAbsolutePath(path, (_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2));
}
function combineDirectoryPath(root, dir) {
@@ -41282,10 +41471,10 @@
}
function tryLoadInputFileForPath(finalPath, entry, packagePath, isImports2) {
- var _a, _b, _c, _d;
+ var _a2, _b2, _c, _d;
if (!state.isConfigLookup && (state.compilerOptions.declarationDir || state.compilerOptions.outDir) && !finalPath.includes("/node_modules/") && (state.compilerOptions.configFile ? containsPath(scope.packageDirectory, toAbsolutePath(state.compilerOptions.configFile.fileName), !useCaseSensitiveFileNames(state)) : true)) {
const getCanonicalFileName = hostGetCanonicalFileName({ useCaseSensitiveFileNames: () => useCaseSensitiveFileNames(state) });
const commonSourceDirGuesses = [];
if (state.compilerOptions.rootDir || state.compilerOptions.composite && state.compilerOptions.configFilePath) {
- const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b = (_a = state.host).getCurrentDirectory) == null ? void 0 : _b.call(_a)) || "", getCanonicalFileName));
+ const commonDir = toAbsolutePath(getCommonSourceDirectory(state.compilerOptions, () => [], ((_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)) || "", getCanonicalFileName));
commonSourceDirGuesses.push(commonDir);
} else if (state.requestContainingDirectory) {
@@ -41343,6 +41532,6 @@
return void 0;
function getOutputDirectoriesForBaseDirectory(commonSourceDirGuess) {
- var _a2, _b2;
- const currentDir = state.compilerOptions.configFile ? ((_b2 = (_a2 = state.host).getCurrentDirectory) == null ? void 0 : _b2.call(_a2)) || "" : commonSourceDirGuess;
+ var _a3, _b3;
+ const currentDir = state.compilerOptions.configFile ? ((_b3 = (_a3 = state.host).getCurrentDirectory) == null ? void 0 : _b3.call(_a3)) || "" : commonSourceDirGuess;
const candidateDirectories = [];
if (state.compilerOptions.declarationDir) {
@@ -41391,5 +41580,5 @@
}
function loadModuleFromNearestNodeModulesDirectoryWorker(extensions, moduleName, directory, state, typesScopeOnly, cache, redirectedReference) {
- const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ ? 99 /* ESNext */ : 1 /* CommonJS */;
+ const mode = state.features === 0 ? void 0 : state.features & 32 /* EsmMode */ || state.conditions.includes("import") ? 99 /* ESNext */ : 1 /* CommonJS */;
const priorityExtensions = extensions & (1 /* TypeScript */ | 4 /* Declaration */);
const secondaryExtensions = extensions & ~(1 /* TypeScript */ | 4 /* Declaration */);
@@ -41469,6 +41658,5 @@
!nodeModulesDirectoryExists,
state,
- packageInfo.contents.packageJsonContent,
- getVersionPathsOfPackageJsonInfo(packageInfo, state)
+ packageInfo
);
return withPackageId(packageInfo, fromDirectory, state);
@@ -41480,8 +41668,7 @@
onlyRecordFailures,
state2,
- packageInfo && packageInfo.contents.packageJsonContent,
- packageInfo && getVersionPathsOfPackageJsonInfo(packageInfo, state2)
+ packageInfo
);
- if (!pathAndExtension && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
+ if (!pathAndExtension && !rest && packageInfo && (packageInfo.contents.packageJsonContent.exports === void 0 || packageInfo.contents.packageJsonContent.exports === null) && state2.features & 32 /* EsmMode */) {
pathAndExtension = loadModuleFromFile(extensions2, combinePaths(candidate2, "index.js"), onlyRecordFailures, state2);
}
@@ -41911,4 +42098,5 @@
var activeLabelList;
var hasExplicitReturn;
+ var inReturnPosition;
var hasFlowEffects;
var emitFlags;
@@ -41983,4 +42171,5 @@
activeLabelList = void 0;
hasExplicitReturn = false;
+ inReturnPosition = false;
hasFlowEffects = false;
inAssignmentPattern = false;
@@ -42219,4 +42408,6 @@
const saveThisParentContainer = thisParentContainer;
const savedBlockScopeContainer = blockScopeContainer;
+ const savedInReturnPosition = inReturnPosition;
+ if (node.kind === 219 /* ArrowFunction */ && node.body.kind !== 241 /* Block */) inReturnPosition = true;
if (containerFlags & 1 /* IsContainer */) {
if (node.kind !== 219 /* ArrowFunction */) {
@@ -42296,4 +42487,5 @@
bindChildren(node);
}
+ inReturnPosition = savedInReturnPosition;
container = saveContainer;
thisParentContainer = saveThisParentContainer;
@@ -42317,4 +42509,7 @@
inAssignmentPattern = false;
if (checkUnreachable(node)) {
+ if (canHaveFlowNode(node) && node.flowNode) {
+ node.flowNode = void 0;
+ }
bindEachChild(node);
bindJSDoc(node);
@@ -42512,5 +42707,7 @@
case 37 /* EqualsEqualsEqualsToken */:
case 38 /* ExclamationEqualsEqualsToken */:
- return isNarrowableOperand(expr.left) || isNarrowableOperand(expr.right) || isNarrowingTypeofOperands(expr.right, expr.left) || isNarrowingTypeofOperands(expr.left, expr.right) || (isBooleanLiteral(expr.right) && isNarrowingExpression(expr.left) || isBooleanLiteral(expr.left) && isNarrowingExpression(expr.right));
+ const left = skipParentheses(expr.left);
+ const right = skipParentheses(expr.right);
+ return isNarrowableOperand(left) || isNarrowableOperand(right) || isNarrowingTypeofOperands(right, left) || isNarrowingTypeofOperands(left, right) || (isBooleanLiteral(right) && isNarrowingExpression(left) || isBooleanLiteral(left) && isNarrowingExpression(right));
case 104 /* InstanceOfKeyword */:
return isNarrowableOperand(expr.left);
@@ -42704,4 +42901,5 @@
const preLoopLabel = setContinueTarget(node, createLoopLabel());
const preBodyLabel = createBranchLabel();
+ const preIncrementorLabel = createBranchLabel();
const postLoopLabel = createBranchLabel();
bind(node.initializer);
@@ -42710,5 +42908,7 @@
bindCondition(node.condition, preBodyLabel, postLoopLabel);
currentFlow = finishFlowLabel(preBodyLabel);
- bindIterativeStatement(node.statement, postLoopLabel, preLoopLabel);
+ bindIterativeStatement(node.statement, postLoopLabel, preIncrementorLabel);
+ addAntecedent(preIncrementorLabel, currentFlow);
+ currentFlow = finishFlowLabel(preIncrementorLabel);
bind(node.incrementor);
addAntecedent(preLoopLabel, currentFlow);
@@ -42747,5 +42947,8 @@
}
function bindReturnOrThrow(node) {
+ const savedInReturnPosition = inReturnPosition;
+ inReturnPosition = true;
bind(node.expression);
+ inReturnPosition = savedInReturnPosition;
if (node.kind === 253 /* ReturnStatement */) {
hasExplicitReturn = true;
@@ -43108,8 +43311,14 @@
bindCondition(node.condition, trueLabel, falseLabel);
currentFlow = finishFlowLabel(trueLabel);
+ if (inReturnPosition) {
+ node.flowNodeWhenTrue = currentFlow;
+ }
bind(node.questionToken);
bind(node.whenTrue);
addAntecedent(postExpressionLabel, currentFlow);
currentFlow = finishFlowLabel(falseLabel);
+ if (inReturnPosition) {
+ node.flowNodeWhenFalse = currentFlow;
+ }
bind(node.colonToken);
bind(node.whenFalse);
@@ -46285,4 +46494,5 @@
getBigIntType: () => bigintType,
getBigIntLiteralType,
+ getUnknownType: () => unknownType,
createPromiseType,
createArrayType,
@@ -46401,6 +46611,11 @@
isTypeParameterPossiblyReferenced,
typeHasCallOrConstructSignatures,
- getSymbolFlags
+ getSymbolFlags,
+ getTypeArgumentsForResolvedSignature
};
+ function getTypeArgumentsForResolvedSignature(signature) {
+ if (signature.mapper === void 0) return void 0;
+ return instantiateTypes((signature.target || signature).typeParameters, signature.mapper);
+ }
function getCandidateSignaturesForStringLiteralCompletions(call, editingArgument) {
const candidatesSet = /* @__PURE__ */ new Set();
@@ -47824,7 +48039,7 @@
if (containerKind === 264 /* InterfaceDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) {
error(errorLocation, Diagnostics.An_interface_cannot_extend_a_primitive_type_like_0_It_can_only_extend_other_named_object_types, unescapeLeadingUnderscores(name));
- } else if (containerKind === 263 /* ClassDeclaration */ && heritageKind === 96 /* ExtendsKeyword */) {
+ } else if (isClassLike(grandparent.parent) && heritageKind === 96 /* ExtendsKeyword */) {
error(errorLocation, Diagnostics.A_class_cannot_extend_a_primitive_type_like_0_Classes_can_only_extend_constructable_values, unescapeLeadingUnderscores(name));
- } else if (containerKind === 263 /* ClassDeclaration */ && heritageKind === 119 /* ImplementsKeyword */) {
+ } else if (isClassLike(grandparent.parent) && heritageKind === 119 /* ImplementsKeyword */) {
error(errorLocation, Diagnostics.A_class_cannot_implement_a_primitive_type_like_0_It_can_only_implement_other_named_object_types, unescapeLeadingUnderscores(name));
}
@@ -49002,5 +49217,5 @@
);
}
- if (errorNode && (moduleResolutionKind === 3 /* Node16 */ || moduleResolutionKind === 99 /* NodeNext */)) {
+ if (errorNode && (moduleKind === 100 /* Node16 */ || moduleKind === 101 /* Node18 */)) {
const isSyncImport = currentSourceFile.impliedNodeFormat === 1 /* CommonJS */ && !findAncestor(location, isImportCall) || !!findAncestor(location, isImportEqualsDeclaration);
const overrideHost = findAncestor(location, (l) => isImportTypeNode(l) || isExportDeclaration(l) || isImportDeclaration(l) || isJSDocImportTag(l));
@@ -50243,10 +50458,5 @@
if (isFunctionLike(node) || isJSDocSignature(node)) {
const signature = getSignatureFromDeclaration(node);
- const expandedParams = getExpandedParameters(
- signature,
- /*skipUnionExpanding*/
- true
- )[0];
- return enterNewScope(context, node, expandedParams, signature.typeParameters);
+ return enterNewScope(context, node, signature.parameters, signature.typeParameters);
} else {
const typeParameters = isConditionalTypeNode(node) ? getInferTypeParameters(node) : [getDeclaredTypeOfTypeParameter(getSymbolOfDeclaration(node.typeParameter))];
@@ -50901,5 +51111,5 @@
var _a3;
const isStaticMethodSymbol = !!(symbol.flags & 8192 /* Method */) && // typeof static method
- some(symbol.declarations, (declaration) => isStatic(declaration));
+ some(symbol.declarations, (declaration) => isStatic(declaration) && !isLateBindableIndexSignature(getNameOfDeclaration(declaration)));
const isNonLocalFunctionSymbol = !!(symbol.flags & 16 /* Function */) && (symbol.parent || // is exported function symbol
forEach(symbol.declarations, (declaration) => declaration.parent.kind === 307 /* SourceFile */ || declaration.parent.kind === 268 /* ModuleBlock */));
@@ -51204,4 +51414,36 @@
return ids;
}
+ function indexInfoToObjectComputedNamesOrSignatureDeclaration(indexInfo, context2, typeNode) {
+ if (indexInfo.components) {
+ const allComponentComputedNamesSerializable = every(indexInfo.components, (e) => {
+ var _a2;
+ return !!(e.name && isComputedPropertyName(e.name) && isEntityNameExpression(e.name.expression) && context2.enclosingDeclaration && ((_a2 = isEntityNameVisible(
+ e.name.expression,
+ context2.enclosingDeclaration,
+ /*shouldComputeAliasToMakeVisible*/
+ false
+ )) == null ? void 0 : _a2.accessibility) === 0 /* Accessible */);
+ });
+ if (allComponentComputedNamesSerializable) {
+ const newComponents = filter(indexInfo.components, (e) => {
+ return !hasLateBindableName(e);
+ });
+ return map(newComponents, (e) => {
+ trackComputedName(e.name.expression, context2.enclosingDeclaration, context2);
+ return setTextRange2(
+ context2,
+ factory.createPropertySignature(
+ indexInfo.isReadonly ? [factory.createModifier(148 /* ReadonlyKeyword */)] : void 0,
+ e.name,
+ (isPropertySignature(e) || isPropertyDeclaration(e) || isMethodSignature(e) || isMethodDeclaration(e) || isGetAccessor(e) || isSetAccessor(e)) && e.questionToken ? factory.createToken(58 /* QuestionToken */) : void 0,
+ typeNode || typeToTypeNodeHelper(getTypeOfSymbol(e.symbol), context2)
+ ),
+ e
+ );
+ });
+ }
+ }
+ return [indexInfoToIndexSignatureDeclarationHelper(indexInfo, context2, typeNode)];
+ }
function createTypeNodesFromResolvedType(resolvedType) {
if (checkTruncationLength(context)) {
@@ -51228,5 +51470,5 @@
}
for (const info of resolvedType.indexInfos) {
- typeElements.push(indexInfoToIndexSignatureDeclarationHelper(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
+ typeElements.push(...indexInfoToObjectComputedNamesOrSignatureDeclaration(info, context, resolvedType.objectFlags & 1024 /* ReverseMapped */ ? createElidedInformationPlaceholder(context) : void 0));
}
const properties = resolvedType.properties;
@@ -51917,5 +52159,5 @@
const firstIdentifier = getFirstIdentifier(accessExpression);
const name = resolveName(
- firstIdentifier,
+ enclosingDeclaration,
firstIdentifier.escapedText,
111551 /* Value */ | 1048576 /* ExportValue */,
@@ -51927,4 +52169,17 @@
if (name) {
context.tracker.trackSymbol(name, enclosingDeclaration, 111551 /* Value */);
+ } else {
+ const fallback = resolveName(
+ firstIdentifier,
+ firstIdentifier.escapedText,
+ 111551 /* Value */ | 1048576 /* ExportValue */,
+ /*nameNotFoundMessage*/
+ void 0,
+ /*isUse*/
+ true
+ );
+ if (fallback) {
+ context.tracker.trackSymbol(fallback, enclosingDeclaration, 111551 /* Value */);
+ }
}
}
@@ -58741,6 +58996,6 @@
return symbolTable.get("__index" /* Index */);
}
- function createIndexInfo(keyType, type, isReadonly, declaration) {
- return { keyType, type, isReadonly, declaration };
+ function createIndexInfo(keyType, type, isReadonly, declaration, components) {
+ return { keyType, type, isReadonly, declaration, components };
}
function getIndexInfosOfSymbol(symbol) {
@@ -59255,4 +59510,7 @@
checkNoTypeArguments(node);
return numberType;
+ case "BigInt":
+ checkNoTypeArguments(node);
+ return bigintType;
case "Boolean":
checkNoTypeArguments(node);
@@ -61808,5 +62066,5 @@
}
function getIndexInfoWithReadonly(info, readonly) {
- return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration) : info;
+ return info.isReadonly !== readonly ? createIndexInfo(info.keyType, info.type, readonly, info.declaration, info.components) : info;
}
function createLiteralType(flags, value, symbol, regularType) {
@@ -62567,5 +62825,5 @@
}
function instantiateIndexInfo(info, mapper) {
- return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration);
+ return createIndexInfo(info.keyType, instantiateType(info.type, mapper), info.isReadonly, info.declaration, info.components);
}
function isContextSensitive(node) {
@@ -66698,5 +66956,5 @@
}
}
- const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly)));
+ const result = createAnonymousType(type.symbol, members, emptyArray, emptyArray, sameMap(getIndexInfosOfType(type), (info) => createIndexInfo(info.keyType, getWidenedType(info.type), info.isReadonly, info.declaration, info.components)));
result.objectFlags |= getObjectFlags(type) & (4096 /* JSLiteral */ | 262144 /* NonInferrableType */);
return result;
@@ -68140,4 +68398,5 @@
case 235 /* NonNullExpression */:
case 217 /* ParenthesizedExpression */:
+ case 238 /* SatisfiesExpression */:
return isMatchingReference(source.expression, target);
case 211 /* PropertyAccessExpression */:
@@ -69990,4 +70249,5 @@
return filterType(type, (t) => !isTypeDerivedFrom(t, candidate));
}
+ type = type.flags & 2 /* Unknown */ ? unknownUnionType : type;
const trueType2 = getNarrowedType(
type,
@@ -69998,5 +70258,5 @@
false
);
- return filterType(type, (t) => !isTypeSubsetOf(t, trueType2));
+ return recombineUnknownType(filterType(type, (t) => !isTypeSubsetOf(t, trueType2)));
}
if (type.flags & 3 /* AnyOrUnknown */) {
@@ -70096,4 +70356,5 @@
case 217 /* ParenthesizedExpression */:
case 235 /* NonNullExpression */:
+ case 238 /* SatisfiesExpression */:
return narrowType(type, expr.expression, assumeTrue);
case 226 /* BinaryExpression */:
@@ -70479,6 +70740,7 @@
if (isJsxOpeningFragment(node)) {
const file = getSourceFileOfNode(node);
- const localJsxNamespace = getLocalJsxNamespace(file);
- if (localJsxNamespace) {
+ const entity = getJsxFactoryEntity(file);
+ if (entity) {
+ const localJsxNamespace = getFirstIdentifier(entity).escapedText;
resolveName(
jsxFactoryLocation,
@@ -72718,14 +72980,31 @@
return isKnownSymbol(symbol) || firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name) && isTypeAssignableToKind(checkComputedPropertyName(firstDecl.name), 4096 /* ESSymbol */);
}
+ function isSymbolWithComputedName(symbol) {
+ var _a;
+ const firstDecl = (_a = symbol.declarations) == null ? void 0 : _a[0];
+ return firstDecl && isNamedDeclaration(firstDecl) && isComputedPropertyName(firstDecl.name);
+ }
function getObjectLiteralIndexInfo(isReadonly, offset, properties, keyType) {
+ var _a;
const propTypes = [];
+ let components;
for (let i = offset; i < properties.length; i++) {
const prop = properties[i];
if (keyType === stringType && !isSymbolWithSymbolName(prop) || keyType === numberType && isSymbolWithNumericName(prop) || keyType === esSymbolType && isSymbolWithSymbolName(prop)) {
propTypes.push(getTypeOfSymbol(properties[i]));
+ if (isSymbolWithComputedName(properties[i])) {
+ components = append(components, (_a = properties[i].declarations) == null ? void 0 : _a[0]);
+ }
}
}
const unionType = propTypes.length ? getUnionType(propTypes, 2 /* Subtype */) : undefinedType;
- return createIndexInfo(keyType, unionType, isReadonly);
+ return createIndexInfo(
+ keyType,
+ unionType,
+ isReadonly,
+ /*declaration*/
+ void 0,
+ components
+ );
}
function getImmediateAliasedSymbol(symbol) {
@@ -73262,4 +73541,7 @@
}
function getJsxElementChildrenPropertyName(jsxNamespace) {
+ if (compilerOptions.jsx === 4 /* ReactJSX */ || compilerOptions.jsx === 5 /* ReactJSXDev */) {
+ return "children";
+ }
return getNameFromJsxElementAttributesContainer(JsxNames.ElementChildrenAttributeNameContainer, jsxNamespace);
}
@@ -74820,6 +75102,6 @@
}
function getEffectiveCheckNode(argument) {
- argument = skipParentheses(argument);
- return isSatisfiesExpression(argument) ? skipParentheses(argument.expression) : argument;
+ const flags = isInJSFile(argument) ? 1 /* Parentheses */ | 32 /* Satisfies */ | -2147483648 /* ExcludeJSDocTypeAssertion */ : 1 /* Parentheses */ | 32 /* Satisfies */;
+ return skipOuterExpressions(argument, flags);
}
function getSignatureApplicabilityError(node, args, signature, relation, checkMode, reportErrors2, containingMessageChain, inferenceContext) {
@@ -75246,9 +75528,14 @@
result = chooseOverload(candidates, assignableRelation, isSingleNonGenericCandidate, signatureHelpTrailingComma);
}
+ const links = getNodeLinks(node);
+ if (links.resolvedSignature !== resolvingSignature && !candidatesOutArray) {
+ Debug.assert(links.resolvedSignature);
+ return links.resolvedSignature;
+ }
if (result) {
return result;
}
result = getCandidateForOverloadFailure(node, candidates, args, !!candidatesOutArray, checkMode);
- getNodeLinks(node).resolvedSignature = result;
+ links.resolvedSignature = result;
if (reportErrors2) {
if (!headMessage && isInstanceof) {
@@ -76136,10 +76423,7 @@
}
links.resolvedSignature = resolvingSignature;
- let result = resolveSignature(node, candidatesOutArray, checkMode || 0 /* Normal */);
+ const result = resolveSignature(node, candidatesOutArray, checkMode || 0 /* Normal */);
resolutionStart = saveResolutionStart;
if (result !== resolvingSignature) {
- if (links.resolvedSignature !== resolvingSignature) {
- result = links.resolvedSignature;
- }
links.resolvedSignature = flowLoopStart === flowLoopCount ? result : cached;
}
@@ -76720,10 +77004,10 @@
}
function checkImportMetaProperty(node) {
- if (moduleKind === 100 /* Node16 */ || moduleKind === 199 /* NodeNext */) {
+ if (100 /* Node16 */ <= moduleKind && moduleKind <= 199 /* NodeNext */) {
if (getSourceFileOfNode(node).impliedNodeFormat !== 99 /* ESNext */) {
error(node, Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
}
} else if (moduleKind < 6 /* ES2020 */ && moduleKind !== 4 /* System */) {
- error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
+ error(node, Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_node18_or_nodenext);
}
const file = getSourceFileOfNode(node);
@@ -77554,5 +77838,5 @@
return !someType(operandConstraint, (t) => getTypeFacts(t, notEqualFacts) === notEqualFacts);
}
- const type = checkExpressionCached(node.expression);
+ const type = getBaseConstraintOrType(checkExpressionCached(node.expression));
if (!isLiteralType(type)) {
return false;
@@ -77817,17 +78101,5 @@
const returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags);
if (returnOrPromisedType) {
- const effectiveCheckNode = getEffectiveCheckNode(node.body);
- if ((functionFlags & 3 /* AsyncGenerator */) === 2 /* Async */) {
- const awaitedType = checkAwaitedType(
- exprType,
- /*withAlias*/
- false,
- effectiveCheckNode,
- Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member
- );
- checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
- } else {
- checkTypeAssignableToAndOptionallyElaborate(exprType, returnOrPromisedType, effectiveCheckNode, effectiveCheckNode);
- }
+ checkReturnExpression(node, returnOrPromisedType, node.body, node.body, exprType);
}
}
@@ -77883,5 +78155,5 @@
if (isReadonlySymbol(symbol)) {
if (symbol.flags & 4 /* Property */ && isAcces (too long so truncated)
Command detailsnpm diff --diff=typescript@5.7.3 --diff=typescript@5.8.2 --diff-unified=2 See also the Reported by ybiquitous/npm-diff-action@v1.6.0 (Node.js 22.14.0 and npm 11.1.0) |
Bumps the typescript group with 1 update: [typescript](https://github.com/microsoft/TypeScript). Updates `typescript` from 5.7.3 to 5.8.2 - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Changelog](https://github.com/microsoft/TypeScript/blob/main/azure-pipelines.release.yml) - [Commits](microsoft/TypeScript@v5.7.3...v5.8.2) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-minor dependency-group: typescript ... Signed-off-by: dependabot[bot] <support@github.com>
526854f
to
40d219c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Pull requests that update a dependency file
javascript
Pull requests that update Javascript code
0 participants
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rebasing might not happen immediately, so don't worry if this takes some time.
Note: if you make any changes to this PR yourself, they will take precedence over the rebase.
Bumps the typescript group with 1 update: typescript.
Updates
typescript
from 5.7.3 to 5.8.2Release notes
Sourced from typescript's releases.
Commits
beb69e4
Bump version to 5.8.2 and LKG8fdbd54
🤖 Pick PR #61210 (Fix mistakenly disallowed default e...) into release-5.8 (#...f4a3a8a
🤖 Pick PR #61175 (Ban import=require and export= unde...) into release-5.8 (#...420ff06
Bump version to 5.8.1-rc and LKG48eb13f
Update LKGfb59c19
Merge remote-tracking branch 'origin/main' into release-5.8df342b7
FixedrewriteRelativeImportExtensions
forimport()
within call expression...775412a
Bump github/codeql-action from 3.28.8 to 3.28.9 in the github-actions group (...e1629e5
Pass ignoreErrors=true to more resolveEntityName callers (#61144)6fd1799
Update LKGDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
@dependabot rebase
will rebase this PR@dependabot recreate
will recreate this PR, overwriting any edits that have been made to it@dependabot merge
will merge this PR after your CI passes on it@dependabot squash and merge
will squash and merge this PR after your CI passes on it@dependabot cancel merge
will cancel a previously requested merge and block automerging@dependabot reopen
will reopen this PR if it is closed@dependabot close
will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually@dependabot show <dependency name> ignore conditions
will show all of the ignore conditions of the specified dependency@dependabot ignore <dependency name> major version
will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)@dependabot ignore <dependency name> minor version
will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)@dependabot ignore <dependency name>
will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)@dependabot unignore <dependency name>
will remove all of the ignore conditions of the specified dependency@dependabot unignore <dependency name> <ignore condition>
will remove the ignore condition of the specified dependency and ignore conditions