typescript 4.7.0-dev.20220502 → 4.7.0-dev.20220505
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/AUTHORS.md +1 -0
- package/lib/de/diagnosticMessages.generated.json +2 -2
- package/lib/es/diagnosticMessages.generated.json +2 -2
- package/lib/ja/diagnosticMessages.generated.json +2 -2
- package/lib/lib.es2020.bigint.d.ts +4 -4
- package/lib/lib.es5.d.ts +14 -14
- package/lib/pl/diagnosticMessages.generated.json +2 -2
- package/lib/tr/diagnosticMessages.generated.json +2 -2
- package/lib/tsc.js +135 -119
- package/lib/tsserver.js +193 -174
- package/lib/tsserverlibrary.d.ts +7 -7
- package/lib/tsserverlibrary.js +193 -174
- package/lib/typescript.d.ts +7 -7
- package/lib/typescript.js +182 -165
- package/lib/typescriptServices.d.ts +7 -7
- package/lib/typescriptServices.js +182 -165
- package/lib/typingsInstaller.js +151 -144
- package/package.json +1 -1
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220505";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -5265,10 +5265,11 @@ var ts;
|
|
|
5265
5265
|
ModuleResolutionKind[ModuleResolutionKind["Classic"] = 1] = "Classic";
|
|
5266
5266
|
ModuleResolutionKind[ModuleResolutionKind["NodeJs"] = 2] = "NodeJs";
|
|
5267
5267
|
// Starting with node12, node's module resolver has significant departures from traditional cjs resolution
|
|
5268
|
-
// to better support ecmascript modules and their use within node - more features are still being added
|
|
5269
|
-
//
|
|
5270
|
-
// version-
|
|
5271
|
-
|
|
5268
|
+
// to better support ecmascript modules and their use within node - however more features are still being added.
|
|
5269
|
+
// TypeScript's Node ESM support was introduced after Node 12 went end-of-life, and Node 14 is the earliest stable
|
|
5270
|
+
// version that supports both pattern trailers - *but*, Node 16 is the first version that also supports ECMASCript 2022.
|
|
5271
|
+
// In turn, we offer both a `NodeNext` moving resolution target, and a `Node16` version-anchored resolution target
|
|
5272
|
+
ModuleResolutionKind[ModuleResolutionKind["Node16"] = 3] = "Node16";
|
|
5272
5273
|
ModuleResolutionKind[ModuleResolutionKind["NodeNext"] = 99] = "NodeNext";
|
|
5273
5274
|
})(ModuleResolutionKind = ts.ModuleResolutionKind || (ts.ModuleResolutionKind = {}));
|
|
5274
5275
|
var ModuleDetectionKind;
|
|
@@ -5278,7 +5279,7 @@ var ts;
|
|
|
5278
5279
|
*/
|
|
5279
5280
|
ModuleDetectionKind[ModuleDetectionKind["Legacy"] = 1] = "Legacy";
|
|
5280
5281
|
/**
|
|
5281
|
-
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution:
|
|
5282
|
+
* Legacy, but also files with jsx under react-jsx or react-jsxdev and esm mode files under moduleResolution: node16+
|
|
5282
5283
|
*/
|
|
5283
5284
|
ModuleDetectionKind[ModuleDetectionKind["Auto"] = 2] = "Auto";
|
|
5284
5285
|
/**
|
|
@@ -5323,8 +5324,8 @@ var ts;
|
|
|
5323
5324
|
ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
|
|
5324
5325
|
ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
|
|
5325
5326
|
ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
|
|
5326
|
-
//
|
|
5327
|
-
ModuleKind[ModuleKind["
|
|
5327
|
+
// Node16+ is an amalgam of commonjs (albeit updated) and es2022+, and represents a distinct module system from es2020/esnext
|
|
5328
|
+
ModuleKind[ModuleKind["Node16"] = 100] = "Node16";
|
|
5328
5329
|
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
|
|
5329
5330
|
})(ModuleKind = ts.ModuleKind || (ts.ModuleKind = {}));
|
|
5330
5331
|
var JsxEmit;
|
|
@@ -8246,6 +8247,7 @@ var ts;
|
|
|
8246
8247
|
_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias: diag(1274, ts.DiagnosticCategory.Error, "_0_modifier_can_only_appear_on_a_type_parameter_of_a_class_interface_or_type_alias_1274", "'{0}' modifier can only appear on a type parameter of a class, interface or type alias"),
|
|
8247
8248
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
8248
8249
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.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."),
|
|
8250
|
+
The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level: diag(1309, ts.DiagnosticCategory.Error, "The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level_1309", "The current file is a CommonJS module and cannot use 'await' at the top level."),
|
|
8249
8251
|
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: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
|
|
8250
8252
|
The_body_of_an_if_statement_cannot_be_the_empty_statement: diag(1313, ts.DiagnosticCategory.Error, "The_body_of_an_if_statement_cannot_be_the_empty_statement_1313", "The body of an 'if' statement cannot be the empty statement."),
|
|
8251
8253
|
Global_module_exports_may_only_appear_in_module_files: diag(1314, ts.DiagnosticCategory.Error, "Global_module_exports_may_only_appear_in_module_files_1314", "Global module exports may only appear in module files."),
|
|
@@ -8257,8 +8259,8 @@ var ts;
|
|
|
8257
8259
|
Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1320, ts.DiagnosticCategory.Error, "Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member_1320", "Type of 'await' operand must either be a valid promise or must not contain a callable 'then' member."),
|
|
8258
8260
|
Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: diag(1321, ts.DiagnosticCategory.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."),
|
|
8259
8261
|
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, ts.DiagnosticCategory.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."),
|
|
8260
|
-
|
|
8261
|
-
|
|
8262
|
+
Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext: diag(1323, ts.DiagnosticCategory.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'."),
|
|
8263
|
+
Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nod_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext', 'node16', or 'nodenext'."),
|
|
8262
8264
|
Argument_of_dynamic_import_cannot_be_spread_element: diag(1325, ts.DiagnosticCategory.Error, "Argument_of_dynamic_import_cannot_be_spread_element_1325", "Argument of dynamic import cannot be spread element."),
|
|
8263
8265
|
This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.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."),
|
|
8264
8266
|
String_literal_with_double_quotes_expected: diag(1327, ts.DiagnosticCategory.Error, "String_literal_with_double_quotes_expected_1327", "String literal with double quotes expected."),
|
|
@@ -8275,7 +8277,7 @@ var ts;
|
|
|
8275
8277
|
Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: diag(1339, ts.DiagnosticCategory.Error, "Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here_1339", "Module '{0}' does not refer to a value, but is used as a value here."),
|
|
8276
8278
|
Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: diag(1340, ts.DiagnosticCategory.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}')'?"),
|
|
8277
8279
|
Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
|
|
8278
|
-
|
|
8280
|
+
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext: diag(1343, ts.DiagnosticCategory.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'."),
|
|
8279
8281
|
A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
8280
8282
|
An_expression_of_type_void_cannot_be_tested_for_truthiness: diag(1345, ts.DiagnosticCategory.Error, "An_expression_of_type_void_cannot_be_tested_for_truthiness_1345", "An expression of type 'void' cannot be tested for truthiness."),
|
|
8281
8283
|
This_parameter_is_not_allowed_with_use_strict_directive: diag(1346, ts.DiagnosticCategory.Error, "This_parameter_is_not_allowed_with_use_strict_directive_1346", "This parameter is not allowed with 'use strict' directive."),
|
|
@@ -8306,7 +8308,7 @@ var ts;
|
|
|
8306
8308
|
await_expressions_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(1375, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_at_the_top_level_of_a_file_when_that_file_is_a_module_but_this_fi_1375", "'await' expressions 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."),
|
|
8307
8309
|
_0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
8308
8310
|
_0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
8309
|
-
|
|
8311
|
+
Top_level_await_expressions_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(1378, ts.DiagnosticCategory.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', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
8310
8312
|
An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type: diag(1379, ts.DiagnosticCategory.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'."),
|
|
8311
8313
|
An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type: diag(1380, ts.DiagnosticCategory.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'."),
|
|
8312
8314
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
@@ -8358,7 +8360,7 @@ var ts;
|
|
|
8358
8360
|
File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
8359
8361
|
The_file_is_in_the_program_because_Colon: diag(1430, ts.DiagnosticCategory.Message, "The_file_is_in_the_program_because_Colon_1430", "The file is in the program because:"),
|
|
8360
8362
|
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, ts.DiagnosticCategory.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."),
|
|
8361
|
-
|
|
8363
|
+
Top_level_for_await_loops_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(1432, ts.DiagnosticCategory.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', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
8362
8364
|
Decorators_may_not_be_applied_to_this_parameters: diag(1433, ts.DiagnosticCategory.Error, "Decorators_may_not_be_applied_to_this_parameters_1433", "Decorators may not be applied to 'this' parameters."),
|
|
8363
8365
|
Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
8364
8366
|
Unknown_keyword_or_identifier_Did_you_mean_0: diag(1435, ts.DiagnosticCategory.Error, "Unknown_keyword_or_identifier_Did_you_mean_0_1435", "Unknown keyword or identifier. Did you mean '{0}'?"),
|
|
@@ -8376,7 +8378,7 @@ var ts;
|
|
|
8376
8378
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.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."),
|
|
8377
8379
|
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
|
|
8378
8380
|
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, ts.DiagnosticCategory.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"),
|
|
8379
|
-
|
|
8381
|
+
Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node16` or `nodenext`."),
|
|
8380
8382
|
resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
8381
8383
|
resolution_mode_can_only_be_set_for_type_only_imports: diag(1454, ts.DiagnosticCategory.Error, "resolution_mode_can_only_be_set_for_type_only_imports_1454", "`resolution-mode` can only be set for type-only imports."),
|
|
8382
8384
|
resolution_mode_is_the_only_valid_key_for_type_import_assertions: diag(1455, ts.DiagnosticCategory.Error, "resolution_mode_is_the_only_valid_key_for_type_import_assertions_1455", "`resolution-mode` is the only valid key for type import assertions."),
|
|
@@ -8387,7 +8389,7 @@ var ts;
|
|
|
8387
8389
|
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
8388
8390
|
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
8389
8391
|
Control_what_method_is_used_to_detect_module_format_JS_files: diag(1475, ts.DiagnosticCategory.Message, "Control_what_method_is_used_to_detect_module_format_JS_files_1475", "Control what method is used to detect module-format JS files."),
|
|
8390
|
-
|
|
8392
|
+
auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules: diag(1476, ts.DiagnosticCategory.Message, "auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_w_1476", "\"auto\": Treat files with imports, exports, import.meta, jsx (with jsx: react-jsx), or esm format (with module: node16+) as modules."),
|
|
8391
8393
|
The_types_of_0_are_incompatible_between_these_types: diag(2200, ts.DiagnosticCategory.Error, "The_types_of_0_are_incompatible_between_these_types_2200", "The types of '{0}' are incompatible between these types."),
|
|
8392
8394
|
The_types_returned_by_0_are_incompatible_between_these_types: diag(2201, ts.DiagnosticCategory.Error, "The_types_returned_by_0_are_incompatible_between_these_types_2201", "The types returned by '{0}' are incompatible between these types."),
|
|
8393
8395
|
Call_signature_return_types_0_and_1_are_incompatible: diag(2202, ts.DiagnosticCategory.Error, "Call_signature_return_types_0_and_1_are_incompatible_2202", "Call signature return types '{0}' and '{1}' are incompatible.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
@@ -8396,7 +8398,6 @@ var ts;
|
|
|
8396
8398
|
Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2205, ts.DiagnosticCategory.Error, "Construct_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2205", "Construct signatures with no arguments have incompatible return types '{0}' and '{1}'.", /*reportsUnnecessary*/ undefined, /*elidedInCompatabilityPyramid*/ true),
|
|
8397
8399
|
The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement: diag(2206, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement_2206", "The 'type' modifier cannot be used on a named import when 'import type' is used on its import statement."),
|
|
8398
8400
|
The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement: diag(2207, ts.DiagnosticCategory.Error, "The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement_2207", "The 'type' modifier cannot be used on a named export when 'export type' is used on its export statement."),
|
|
8399
|
-
This_type_parameter_probably_needs_an_extends_object_constraint: diag(2208, ts.DiagnosticCategory.Error, "This_type_parameter_probably_needs_an_extends_object_constraint_2208", "This type parameter probably needs an `extends object` constraint."),
|
|
8400
8401
|
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
|
|
8401
8402
|
Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: diag(2301, ts.DiagnosticCategory.Error, "Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2301", "Initializer of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor."),
|
|
8402
8403
|
Static_members_cannot_reference_class_type_parameters: diag(2302, ts.DiagnosticCategory.Error, "Static_members_cannot_reference_class_type_parameters_2302", "Static members cannot reference class type parameters."),
|
|
@@ -8874,8 +8875,8 @@ var ts;
|
|
|
8874
8875
|
Import_assertions_are_only_supported_when_the_module_option_is_set_to_esnext_or_nodenext: diag(2821, ts.DiagnosticCategory.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'."),
|
|
8875
8876
|
Import_assertions_cannot_be_used_with_type_only_imports_or_exports: diag(2822, ts.DiagnosticCategory.Error, "Import_assertions_cannot_be_used_with_type_only_imports_or_exports_2822", "Import assertions cannot be used with type-only imports or exports."),
|
|
8876
8877
|
Cannot_find_namespace_0_Did_you_mean_1: diag(2833, ts.DiagnosticCategory.Error, "Cannot_find_namespace_0_Did_you_mean_1_2833", "Cannot find namespace '{0}'. Did you mean '{1}'?"),
|
|
8877
|
-
|
|
8878
|
-
|
|
8878
|
+
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, ts.DiagnosticCategory.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."),
|
|
8879
|
+
Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0: diag(2835, ts.DiagnosticCategory.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}'?"),
|
|
8879
8880
|
Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls: diag(2836, ts.DiagnosticCategory.Error, "Import_assertions_are_not_allowed_on_statements_that_transpile_to_commonjs_require_calls_2836", "Import assertions are not allowed on statements that transpile to commonjs 'require' calls."),
|
|
8880
8881
|
Import_assertion_values_must_be_string_literal_expressions: diag(2837, ts.DiagnosticCategory.Error, "Import_assertion_values_must_be_string_literal_expressions_2837", "Import assertion values must be string literal expressions."),
|
|
8881
8882
|
All_declarations_of_0_must_have_identical_constraints: diag(2838, ts.DiagnosticCategory.Error, "All_declarations_of_0_must_have_identical_constraints_2838", "All declarations of '{0}' must have identical constraints."),
|
|
@@ -9541,7 +9542,6 @@ var ts;
|
|
|
9541
9542
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead: diag(7059, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Use_an_as_expression_instead_7059", "This syntax is reserved in files with the .mts or .cts extension. Use an `as` expression instead."),
|
|
9542
9543
|
This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_constraint: diag(7060, ts.DiagnosticCategory.Error, "This_syntax_is_reserved_in_files_with_the_mts_or_cts_extension_Add_a_trailing_comma_or_explicit_cons_7060", "This syntax is reserved in files with the .mts or .cts extension. Add a trailing comma or explicit constraint."),
|
|
9543
9544
|
A_mapped_type_may_not_declare_properties_or_methods: diag(7061, ts.DiagnosticCategory.Error, "A_mapped_type_may_not_declare_properties_or_methods_7061", "A mapped type may not declare properties or methods."),
|
|
9544
|
-
JSON_imports_are_experimental_in_ES_module_mode_imports: diag(7062, ts.DiagnosticCategory.Error, "JSON_imports_are_experimental_in_ES_module_mode_imports_7062", "JSON imports are experimental in ES module mode imports."),
|
|
9545
9545
|
You_cannot_rename_this_element: diag(8000, ts.DiagnosticCategory.Error, "You_cannot_rename_this_element_8000", "You cannot rename this element."),
|
|
9546
9546
|
You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: diag(8001, ts.DiagnosticCategory.Error, "You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library_8001", "You cannot rename elements that are defined in the standard TypeScript library."),
|
|
9547
9547
|
import_can_only_be_used_in_TypeScript_files: diag(8002, ts.DiagnosticCategory.Error, "import_can_only_be_used_in_TypeScript_files_8002", "'import ... =' can only be used in TypeScript files."),
|
|
@@ -14834,7 +14834,7 @@ var ts;
|
|
|
14834
14834
|
}
|
|
14835
14835
|
ts.getNonAugmentationDeclaration = getNonAugmentationDeclaration;
|
|
14836
14836
|
function isCommonJSContainingModuleKind(kind) {
|
|
14837
|
-
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.
|
|
14837
|
+
return kind === ts.ModuleKind.CommonJS || kind === ts.ModuleKind.Node16 || kind === ts.ModuleKind.NodeNext;
|
|
14838
14838
|
}
|
|
14839
14839
|
function isEffectiveExternalModule(node, compilerOptions) {
|
|
14840
14840
|
return ts.isExternalModule(node) || compilerOptions.isolatedModules || (isCommonJSContainingModuleKind(getEmitModuleKind(compilerOptions)) && !!node.commonJsModuleIndicator);
|
|
@@ -20002,7 +20002,7 @@ var ts;
|
|
|
20002
20002
|
file.externalModuleIndicator = ts.isFileProbablyExternalModule(file);
|
|
20003
20003
|
};
|
|
20004
20004
|
case ts.ModuleDetectionKind.Auto:
|
|
20005
|
-
// If module is nodenext or
|
|
20005
|
+
// If module is nodenext or node16, all esm format files are modules
|
|
20006
20006
|
// If jsx is react-jsx or react-jsxdev then jsx tags force module-ness
|
|
20007
20007
|
// otherwise, the presence of import or export statments (or import.meta) implies module-ness
|
|
20008
20008
|
var checks = [ts.isFileProbablyExternalModule];
|
|
@@ -20010,7 +20010,7 @@ var ts;
|
|
|
20010
20010
|
checks.push(isFileModuleFromUsingJSXTag);
|
|
20011
20011
|
}
|
|
20012
20012
|
var moduleKind = getEmitModuleKind(options);
|
|
20013
|
-
if (moduleKind === ts.ModuleKind.
|
|
20013
|
+
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
20014
20014
|
checks.push(isFileForcedToBeModuleByFormat);
|
|
20015
20015
|
}
|
|
20016
20016
|
var combined_1 = ts.or.apply(void 0, checks);
|
|
@@ -20021,7 +20021,7 @@ var ts;
|
|
|
20021
20021
|
ts.getSetExternalModuleIndicator = getSetExternalModuleIndicator;
|
|
20022
20022
|
function getEmitScriptTarget(compilerOptions) {
|
|
20023
20023
|
return compilerOptions.target ||
|
|
20024
|
-
(compilerOptions.module === ts.ModuleKind.
|
|
20024
|
+
(compilerOptions.module === ts.ModuleKind.Node16 && 9 /* ES2022 */) ||
|
|
20025
20025
|
(compilerOptions.module === ts.ModuleKind.NodeNext && 99 /* ESNext */) ||
|
|
20026
20026
|
0 /* ES3 */;
|
|
20027
20027
|
}
|
|
@@ -20039,8 +20039,8 @@ var ts;
|
|
|
20039
20039
|
case ts.ModuleKind.CommonJS:
|
|
20040
20040
|
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
20041
20041
|
break;
|
|
20042
|
-
case ts.ModuleKind.
|
|
20043
|
-
moduleResolution = ts.ModuleResolutionKind.
|
|
20042
|
+
case ts.ModuleKind.Node16:
|
|
20043
|
+
moduleResolution = ts.ModuleResolutionKind.Node16;
|
|
20044
20044
|
break;
|
|
20045
20045
|
case ts.ModuleKind.NodeNext:
|
|
20046
20046
|
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
@@ -20065,7 +20065,7 @@ var ts;
|
|
|
20065
20065
|
case ts.ModuleKind.ES2020:
|
|
20066
20066
|
case ts.ModuleKind.ES2022:
|
|
20067
20067
|
case ts.ModuleKind.ESNext:
|
|
20068
|
-
case ts.ModuleKind.
|
|
20068
|
+
case ts.ModuleKind.Node16:
|
|
20069
20069
|
case ts.ModuleKind.NodeNext:
|
|
20070
20070
|
return true;
|
|
20071
20071
|
default:
|
|
@@ -20090,7 +20090,7 @@ var ts;
|
|
|
20090
20090
|
return compilerOptions.esModuleInterop;
|
|
20091
20091
|
}
|
|
20092
20092
|
switch (getEmitModuleKind(compilerOptions)) {
|
|
20093
|
-
case ts.ModuleKind.
|
|
20093
|
+
case ts.ModuleKind.Node16:
|
|
20094
20094
|
case ts.ModuleKind.NodeNext:
|
|
20095
20095
|
return true;
|
|
20096
20096
|
}
|
|
@@ -26172,7 +26172,7 @@ var ts;
|
|
|
26172
26172
|
return node;
|
|
26173
26173
|
}
|
|
26174
26174
|
function cloneSourceFileWithChanges(source, statements, isDeclarationFile, referencedFiles, typeReferences, hasNoDefaultLib, libReferences) {
|
|
26175
|
-
var node = baseFactory.createBaseSourceFileNode(305 /* SourceFile */);
|
|
26175
|
+
var node = (source.redirectInfo ? Object.create(source.redirectInfo.redirectTarget) : baseFactory.createBaseSourceFileNode(305 /* SourceFile */));
|
|
26176
26176
|
for (var p in source) {
|
|
26177
26177
|
if (p === "emitNode" || ts.hasProperty(node, p) || !ts.hasProperty(source, p))
|
|
26178
26178
|
continue;
|
|
@@ -31297,7 +31297,7 @@ var ts;
|
|
|
31297
31297
|
initializeState("", content, languageVersion, /*syntaxCursor*/ undefined, 1 /* JS */);
|
|
31298
31298
|
// Prime the scanner.
|
|
31299
31299
|
nextToken();
|
|
31300
|
-
var entityName = parseEntityName(/*allowReservedWords*/ true
|
|
31300
|
+
var entityName = parseEntityName(/*allowReservedWords*/ true);
|
|
31301
31301
|
var isInvalid = token() === 1 /* EndOfFileToken */ && !parseDiagnostics.length;
|
|
31302
31302
|
clearState();
|
|
31303
31303
|
return isInvalid ? entityName : undefined;
|
|
@@ -32897,7 +32897,7 @@ var ts;
|
|
|
32897
32897
|
}
|
|
32898
32898
|
return createMissingList();
|
|
32899
32899
|
}
|
|
32900
|
-
function parseEntityName(allowReservedWords,
|
|
32900
|
+
function parseEntityName(allowReservedWords, diagnosticMessage) {
|
|
32901
32901
|
var pos = getNodePos();
|
|
32902
32902
|
var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
|
|
32903
32903
|
var dotPos = getNodePos();
|
|
@@ -32908,7 +32908,7 @@ var ts;
|
|
|
32908
32908
|
break;
|
|
32909
32909
|
}
|
|
32910
32910
|
dotPos = getNodePos();
|
|
32911
|
-
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, allowPrivateIdentifiers)), pos);
|
|
32911
|
+
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, /* allowPrivateIdentifiers */ false)), pos);
|
|
32912
32912
|
}
|
|
32913
32913
|
return entity;
|
|
32914
32914
|
}
|
|
@@ -33041,7 +33041,7 @@ var ts;
|
|
|
33041
33041
|
}
|
|
33042
33042
|
// TYPES
|
|
33043
33043
|
function parseEntityNameOfTypeReference() {
|
|
33044
|
-
return parseEntityName(/*allowReservedWords*/ true,
|
|
33044
|
+
return parseEntityName(/*allowReservedWords*/ true, ts.Diagnostics.Type_expected);
|
|
33045
33045
|
}
|
|
33046
33046
|
function parseTypeArgumentsOfTypeReference() {
|
|
33047
33047
|
if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29 /* LessThanToken */) {
|
|
@@ -33174,7 +33174,7 @@ var ts;
|
|
|
33174
33174
|
function parseTypeQuery() {
|
|
33175
33175
|
var pos = getNodePos();
|
|
33176
33176
|
parseExpected(112 /* TypeOfKeyword */);
|
|
33177
|
-
var entityName = parseEntityName(/*allowReservedWords*/ true
|
|
33177
|
+
var entityName = parseEntityName(/*allowReservedWords*/ true);
|
|
33178
33178
|
// Make sure we perform ASI to prevent parsing the next line's type arguments as part of an instantiation expression.
|
|
33179
33179
|
var typeArguments = !scanner.hasPrecedingLineBreak() ? tryParseTypeArguments() : undefined;
|
|
33180
33180
|
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
@@ -34142,10 +34142,10 @@ var ts;
|
|
|
34142
34142
|
setDecoratorContext(/*val*/ false);
|
|
34143
34143
|
}
|
|
34144
34144
|
var pos = getNodePos();
|
|
34145
|
-
var expr = parseAssignmentExpressionOrHigher(
|
|
34145
|
+
var expr = parseAssignmentExpressionOrHigher();
|
|
34146
34146
|
var operatorToken;
|
|
34147
34147
|
while ((operatorToken = parseOptionalToken(27 /* CommaToken */))) {
|
|
34148
|
-
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(
|
|
34148
|
+
expr = makeBinaryExpression(expr, operatorToken, parseAssignmentExpressionOrHigher(), pos);
|
|
34149
34149
|
}
|
|
34150
34150
|
if (saveDecoratorContext) {
|
|
34151
34151
|
setDecoratorContext(/*val*/ true);
|
|
@@ -34153,9 +34153,9 @@ var ts;
|
|
|
34153
34153
|
return expr;
|
|
34154
34154
|
}
|
|
34155
34155
|
function parseInitializer() {
|
|
34156
|
-
return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher(
|
|
34156
|
+
return parseOptional(63 /* EqualsToken */) ? parseAssignmentExpressionOrHigher() : undefined;
|
|
34157
34157
|
}
|
|
34158
|
-
function parseAssignmentExpressionOrHigher(
|
|
34158
|
+
function parseAssignmentExpressionOrHigher() {
|
|
34159
34159
|
// AssignmentExpression[in,yield]:
|
|
34160
34160
|
// 1) ConditionalExpression[?in,?yield]
|
|
34161
34161
|
// 2) LeftHandSideExpression = AssignmentExpression[?in,?yield]
|
|
@@ -34181,7 +34181,7 @@ var ts;
|
|
|
34181
34181
|
// If we do successfully parse arrow-function, we must *not* recurse for productions 1, 2 or 3. An ArrowFunction is
|
|
34182
34182
|
// not a LeftHandSideExpression, nor does it start a ConditionalExpression. So we are done
|
|
34183
34183
|
// with AssignmentExpression if we see one.
|
|
34184
|
-
var arrowExpression = tryParseParenthesizedArrowFunctionExpression(
|
|
34184
|
+
var arrowExpression = tryParseParenthesizedArrowFunctionExpression() || tryParseAsyncSimpleArrowFunctionExpression();
|
|
34185
34185
|
if (arrowExpression) {
|
|
34186
34186
|
return arrowExpression;
|
|
34187
34187
|
}
|
|
@@ -34200,7 +34200,7 @@ var ts;
|
|
|
34200
34200
|
// parameter ('x => ...') above. We handle it here by checking if the parsed expression was a single
|
|
34201
34201
|
// identifier and the current token is an arrow.
|
|
34202
34202
|
if (expr.kind === 79 /* Identifier */ && token() === 38 /* EqualsGreaterThanToken */) {
|
|
34203
|
-
return parseSimpleArrowFunctionExpression(pos, expr,
|
|
34203
|
+
return parseSimpleArrowFunctionExpression(pos, expr, /*asyncModifier*/ undefined);
|
|
34204
34204
|
}
|
|
34205
34205
|
// Now see if we might be in cases '2' or '3'.
|
|
34206
34206
|
// If the expression was a LHS expression, and we have an assignment operator, then
|
|
@@ -34209,7 +34209,7 @@ var ts;
|
|
|
34209
34209
|
// Note: we call reScanGreaterToken so that we get an appropriately merged token
|
|
34210
34210
|
// for cases like `> > =` becoming `>>=`
|
|
34211
34211
|
if (ts.isLeftHandSideExpression(expr) && ts.isAssignmentOperator(reScanGreaterToken())) {
|
|
34212
|
-
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(
|
|
34212
|
+
return makeBinaryExpression(expr, parseTokenNode(), parseAssignmentExpressionOrHigher(), pos);
|
|
34213
34213
|
}
|
|
34214
34214
|
// It wasn't an assignment or a lambda. This is a conditional expression:
|
|
34215
34215
|
return parseConditionalExpressionRest(expr, pos);
|
|
@@ -34252,7 +34252,7 @@ var ts;
|
|
|
34252
34252
|
nextToken();
|
|
34253
34253
|
if (!scanner.hasPrecedingLineBreak() &&
|
|
34254
34254
|
(token() === 41 /* AsteriskToken */ || isStartOfExpression())) {
|
|
34255
|
-
return finishNode(factory.createYieldExpression(parseOptionalToken(41 /* AsteriskToken */), parseAssignmentExpressionOrHigher(
|
|
34255
|
+
return finishNode(factory.createYieldExpression(parseOptionalToken(41 /* AsteriskToken */), parseAssignmentExpressionOrHigher()), pos);
|
|
34256
34256
|
}
|
|
34257
34257
|
else {
|
|
34258
34258
|
// if the next token is not on the same line as yield. or we don't have an '*' or
|
|
@@ -34260,7 +34260,7 @@ var ts;
|
|
|
34260
34260
|
return finishNode(factory.createYieldExpression(/*asteriskToken*/ undefined, /*expression*/ undefined), pos);
|
|
34261
34261
|
}
|
|
34262
34262
|
}
|
|
34263
|
-
function parseSimpleArrowFunctionExpression(pos, identifier,
|
|
34263
|
+
function parseSimpleArrowFunctionExpression(pos, identifier, asyncModifier) {
|
|
34264
34264
|
ts.Debug.assert(token() === 38 /* EqualsGreaterThanToken */, "parseSimpleArrowFunctionExpression should only have been called if we had a =>");
|
|
34265
34265
|
var parameter = factory.createParameterDeclaration(
|
|
34266
34266
|
/*decorators*/ undefined,
|
|
@@ -34272,11 +34272,11 @@ var ts;
|
|
|
34272
34272
|
finishNode(parameter, identifier.pos);
|
|
34273
34273
|
var parameters = createNodeArray([parameter], parameter.pos, parameter.end);
|
|
34274
34274
|
var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);
|
|
34275
|
-
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier
|
|
34275
|
+
var body = parseArrowFunctionExpressionBody(/*isAsync*/ !!asyncModifier);
|
|
34276
34276
|
var node = factory.createArrowFunction(asyncModifier, /*typeParameters*/ undefined, parameters, /*type*/ undefined, equalsGreaterThanToken, body);
|
|
34277
34277
|
return addJSDocComment(finishNode(node, pos));
|
|
34278
34278
|
}
|
|
34279
|
-
function tryParseParenthesizedArrowFunctionExpression(
|
|
34279
|
+
function tryParseParenthesizedArrowFunctionExpression() {
|
|
34280
34280
|
var triState = isParenthesizedArrowFunctionExpression();
|
|
34281
34281
|
if (triState === 0 /* False */) {
|
|
34282
34282
|
// It's definitely not a parenthesized arrow function expression.
|
|
@@ -34287,8 +34287,8 @@ var ts;
|
|
|
34287
34287
|
// it out, but don't allow any ambiguity, and return 'undefined' if this could be an
|
|
34288
34288
|
// expression instead.
|
|
34289
34289
|
return triState === 1 /* True */ ?
|
|
34290
|
-
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true
|
|
34291
|
-
tryParse(
|
|
34290
|
+
parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ true) :
|
|
34291
|
+
tryParse(parsePossibleParenthesizedArrowFunctionExpression);
|
|
34292
34292
|
}
|
|
34293
34293
|
// True -> We definitely expect a parenthesized arrow function here.
|
|
34294
34294
|
// False -> There *cannot* be a parenthesized arrow function here.
|
|
@@ -34418,25 +34418,25 @@ var ts;
|
|
|
34418
34418
|
return 2 /* Unknown */;
|
|
34419
34419
|
}
|
|
34420
34420
|
}
|
|
34421
|
-
function parsePossibleParenthesizedArrowFunctionExpression(
|
|
34421
|
+
function parsePossibleParenthesizedArrowFunctionExpression() {
|
|
34422
34422
|
var tokenPos = scanner.getTokenPos();
|
|
34423
34423
|
if (notParenthesizedArrow === null || notParenthesizedArrow === void 0 ? void 0 : notParenthesizedArrow.has(tokenPos)) {
|
|
34424
34424
|
return undefined;
|
|
34425
34425
|
}
|
|
34426
|
-
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false
|
|
34426
|
+
var result = parseParenthesizedArrowFunctionExpression(/*allowAmbiguity*/ false);
|
|
34427
34427
|
if (!result) {
|
|
34428
34428
|
(notParenthesizedArrow || (notParenthesizedArrow = new ts.Set())).add(tokenPos);
|
|
34429
34429
|
}
|
|
34430
34430
|
return result;
|
|
34431
34431
|
}
|
|
34432
|
-
function tryParseAsyncSimpleArrowFunctionExpression(
|
|
34432
|
+
function tryParseAsyncSimpleArrowFunctionExpression() {
|
|
34433
34433
|
// We do a check here so that we won't be doing unnecessarily call to "lookAhead"
|
|
34434
34434
|
if (token() === 131 /* AsyncKeyword */) {
|
|
34435
34435
|
if (lookAhead(isUnParenthesizedAsyncArrowFunctionWorker) === 1 /* True */) {
|
|
34436
34436
|
var pos = getNodePos();
|
|
34437
34437
|
var asyncModifier = parseModifiersForArrowFunction();
|
|
34438
34438
|
var expr = parseBinaryExpressionOrHigher(0 /* Lowest */);
|
|
34439
|
-
return parseSimpleArrowFunctionExpression(pos, expr,
|
|
34439
|
+
return parseSimpleArrowFunctionExpression(pos, expr, asyncModifier);
|
|
34440
34440
|
}
|
|
34441
34441
|
}
|
|
34442
34442
|
return undefined;
|
|
@@ -34460,7 +34460,7 @@ var ts;
|
|
|
34460
34460
|
}
|
|
34461
34461
|
return 0 /* False */;
|
|
34462
34462
|
}
|
|
34463
|
-
function parseParenthesizedArrowFunctionExpression(allowAmbiguity
|
|
34463
|
+
function parseParenthesizedArrowFunctionExpression(allowAmbiguity) {
|
|
34464
34464
|
var pos = getNodePos();
|
|
34465
34465
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
34466
34466
|
var modifiers = parseModifiersForArrowFunction();
|
|
@@ -34495,23 +34495,6 @@ var ts;
|
|
|
34495
34495
|
return undefined;
|
|
34496
34496
|
}
|
|
34497
34497
|
}
|
|
34498
|
-
// Given:
|
|
34499
|
-
// x ? y => ({ y }) : z => ({ z })
|
|
34500
|
-
// We try to parse the body of the first arrow function by looking at:
|
|
34501
|
-
// ({ y }) : z => ({ z })
|
|
34502
|
-
// This is a valid arrow function with "z" as the return type.
|
|
34503
|
-
//
|
|
34504
|
-
// But, if we're in the true side of a conditional expression, this colon
|
|
34505
|
-
// terminates the expression, so we cannot allow a return type if we aren't
|
|
34506
|
-
// certain whether or not the preceding text was parsed as a parameter list.
|
|
34507
|
-
//
|
|
34508
|
-
// For example,
|
|
34509
|
-
// a() ? (b: number, c?: string): void => d() : e
|
|
34510
|
-
// is determined by isParenthesizedArrowFunctionExpression to unambiguously
|
|
34511
|
-
// be an arrow expression, so we allow a return type.
|
|
34512
|
-
if (disallowReturnTypeInArrowFunction && token() === 58 /* ColonToken */) {
|
|
34513
|
-
return undefined;
|
|
34514
|
-
}
|
|
34515
34498
|
var type = parseReturnType(58 /* ColonToken */, /*isType*/ false);
|
|
34516
34499
|
if (type && !allowAmbiguity && typeHasArrowFunctionBlockingParseError(type)) {
|
|
34517
34500
|
return undefined;
|
|
@@ -34540,12 +34523,12 @@ var ts;
|
|
|
34540
34523
|
var lastToken = token();
|
|
34541
34524
|
var equalsGreaterThanToken = parseExpectedToken(38 /* EqualsGreaterThanToken */);
|
|
34542
34525
|
var body = (lastToken === 38 /* EqualsGreaterThanToken */ || lastToken === 18 /* OpenBraceToken */)
|
|
34543
|
-
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier)
|
|
34526
|
+
? parseArrowFunctionExpressionBody(ts.some(modifiers, ts.isAsyncModifier))
|
|
34544
34527
|
: parseIdentifier();
|
|
34545
34528
|
var node = factory.createArrowFunction(modifiers, typeParameters, parameters, type, equalsGreaterThanToken, body);
|
|
34546
34529
|
return withJSDoc(finishNode(node, pos), hasJSDoc);
|
|
34547
34530
|
}
|
|
34548
|
-
function parseArrowFunctionExpressionBody(isAsync
|
|
34531
|
+
function parseArrowFunctionExpressionBody(isAsync) {
|
|
34549
34532
|
if (token() === 18 /* OpenBraceToken */) {
|
|
34550
34533
|
return parseFunctionBlock(isAsync ? 2 /* Await */ : 0 /* None */);
|
|
34551
34534
|
}
|
|
@@ -34573,8 +34556,8 @@ var ts;
|
|
|
34573
34556
|
var savedTopLevel = topLevel;
|
|
34574
34557
|
topLevel = false;
|
|
34575
34558
|
var node = isAsync
|
|
34576
|
-
? doInAwaitContext(
|
|
34577
|
-
: doOutsideOfAwaitContext(
|
|
34559
|
+
? doInAwaitContext(parseAssignmentExpressionOrHigher)
|
|
34560
|
+
: doOutsideOfAwaitContext(parseAssignmentExpressionOrHigher);
|
|
34578
34561
|
topLevel = savedTopLevel;
|
|
34579
34562
|
return node;
|
|
34580
34563
|
}
|
|
@@ -34587,8 +34570,8 @@ var ts;
|
|
|
34587
34570
|
// Note: we explicitly 'allowIn' in the whenTrue part of the condition expression, and
|
|
34588
34571
|
// we do not that for the 'whenFalse' part.
|
|
34589
34572
|
var colonToken;
|
|
34590
|
-
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext,
|
|
34591
|
-
? parseAssignmentExpressionOrHigher(
|
|
34573
|
+
return finishNode(factory.createConditionalExpression(leftOperand, questionToken, doOutsideOfContext(disallowInAndDecoratorContext, parseAssignmentExpressionOrHigher), colonToken = parseExpectedToken(58 /* ColonToken */), ts.nodeIsPresent(colonToken)
|
|
34574
|
+
? parseAssignmentExpressionOrHigher()
|
|
34592
34575
|
: createMissingNode(79 /* Identifier */, /*reportAtCurrentPosition*/ false, ts.Diagnostics._0_expected, ts.tokenToString(58 /* ColonToken */))), pos);
|
|
34593
34576
|
}
|
|
34594
34577
|
function parseBinaryExpressionOrHigher(precedence) {
|
|
@@ -35480,13 +35463,13 @@ var ts;
|
|
|
35480
35463
|
function parseSpreadElement() {
|
|
35481
35464
|
var pos = getNodePos();
|
|
35482
35465
|
parseExpected(25 /* DotDotDotToken */);
|
|
35483
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
35466
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
35484
35467
|
return finishNode(factory.createSpreadElement(expression), pos);
|
|
35485
35468
|
}
|
|
35486
35469
|
function parseArgumentOrArrayLiteralElement() {
|
|
35487
35470
|
return token() === 25 /* DotDotDotToken */ ? parseSpreadElement() :
|
|
35488
35471
|
token() === 27 /* CommaToken */ ? finishNode(factory.createOmittedExpression(), getNodePos()) :
|
|
35489
|
-
parseAssignmentExpressionOrHigher(
|
|
35472
|
+
parseAssignmentExpressionOrHigher();
|
|
35490
35473
|
}
|
|
35491
35474
|
function parseArgumentExpression() {
|
|
35492
35475
|
return doOutsideOfContext(disallowInAndDecoratorContext, parseArgumentOrArrayLiteralElement);
|
|
@@ -35504,7 +35487,7 @@ var ts;
|
|
|
35504
35487
|
var pos = getNodePos();
|
|
35505
35488
|
var hasJSDoc = hasPrecedingJSDocComment();
|
|
35506
35489
|
if (parseOptionalToken(25 /* DotDotDotToken */)) {
|
|
35507
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
35490
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
35508
35491
|
return withJSDoc(finishNode(factory.createSpreadAssignment(expression), pos), hasJSDoc);
|
|
35509
35492
|
}
|
|
35510
35493
|
var decorators = parseDecorators();
|
|
@@ -35533,7 +35516,7 @@ var ts;
|
|
|
35533
35516
|
var isShorthandPropertyAssignment = tokenIsIdentifier && (token() !== 58 /* ColonToken */);
|
|
35534
35517
|
if (isShorthandPropertyAssignment) {
|
|
35535
35518
|
var equalsToken = parseOptionalToken(63 /* EqualsToken */);
|
|
35536
|
-
var objectAssignmentInitializer = equalsToken ? allowInAnd(
|
|
35519
|
+
var objectAssignmentInitializer = equalsToken ? allowInAnd(parseAssignmentExpressionOrHigher) : undefined;
|
|
35537
35520
|
node = factory.createShorthandPropertyAssignment(name, objectAssignmentInitializer);
|
|
35538
35521
|
// Save equals token for error reporting.
|
|
35539
35522
|
// TODO(rbuckton): Consider manufacturing this when we need to report an error as it is otherwise not useful.
|
|
@@ -35541,7 +35524,7 @@ var ts;
|
|
|
35541
35524
|
}
|
|
35542
35525
|
else {
|
|
35543
35526
|
parseExpected(58 /* ColonToken */);
|
|
35544
|
-
var initializer = allowInAnd(
|
|
35527
|
+
var initializer = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
35545
35528
|
node = factory.createPropertyAssignment(name, initializer);
|
|
35546
35529
|
}
|
|
35547
35530
|
// Decorators, Modifiers, questionToken, and exclamationToken are not supported by property assignments and are reported in the grammar checker
|
|
@@ -35715,7 +35698,7 @@ var ts;
|
|
|
35715
35698
|
}
|
|
35716
35699
|
var node;
|
|
35717
35700
|
if (awaitToken ? parseExpected(160 /* OfKeyword */) : parseOptional(160 /* OfKeyword */)) {
|
|
35718
|
-
var expression = allowInAnd(
|
|
35701
|
+
var expression = allowInAnd(parseAssignmentExpressionOrHigher);
|
|
35719
35702
|
parseExpected(21 /* CloseParenToken */);
|
|
35720
35703
|
node = factory.createForOfStatement(awaitToken, initializer, expression, parseStatement());
|
|
35721
35704
|
}
|
|
@@ -36883,7 +36866,7 @@ var ts;
|
|
|
36883
36866
|
var pos = getNodePos();
|
|
36884
36867
|
var name = ts.tokenIsIdentifierOrKeyword(token()) ? parseIdentifierName() : parseLiteralLikeNode(10 /* StringLiteral */);
|
|
36885
36868
|
parseExpected(58 /* ColonToken */);
|
|
36886
|
-
var value = parseAssignmentExpressionOrHigher(
|
|
36869
|
+
var value = parseAssignmentExpressionOrHigher();
|
|
36887
36870
|
return finishNode(factory.createAssertEntry(name, value), pos);
|
|
36888
36871
|
}
|
|
36889
36872
|
function parseAssertClause(skipAssertKeyword) {
|
|
@@ -36943,7 +36926,7 @@ var ts;
|
|
|
36943
36926
|
function parseModuleReference() {
|
|
36944
36927
|
return isExternalModuleReference()
|
|
36945
36928
|
? parseExternalModuleReference()
|
|
36946
|
-
: parseEntityName(/*allowReservedWords*/ false
|
|
36929
|
+
: parseEntityName(/*allowReservedWords*/ false);
|
|
36947
36930
|
}
|
|
36948
36931
|
function parseExternalModuleReference() {
|
|
36949
36932
|
var pos = getNodePos();
|
|
@@ -37122,7 +37105,7 @@ var ts;
|
|
|
37122
37105
|
else {
|
|
37123
37106
|
parseExpected(88 /* DefaultKeyword */);
|
|
37124
37107
|
}
|
|
37125
|
-
var expression = parseAssignmentExpressionOrHigher(
|
|
37108
|
+
var expression = parseAssignmentExpressionOrHigher();
|
|
37126
37109
|
parseSemicolon();
|
|
37127
37110
|
setAwaitContext(savedAwaitContext);
|
|
37128
37111
|
var node = factory.createExportAssignment(decorators, modifiers, isExportEquals, expression);
|
|
@@ -37196,7 +37179,7 @@ var ts;
|
|
|
37196
37179
|
var pos = getNodePos();
|
|
37197
37180
|
var hasBrace = parseOptional(18 /* OpenBraceToken */);
|
|
37198
37181
|
var p2 = getNodePos();
|
|
37199
|
-
var entityName = parseEntityName(/* allowReservedWords*/ false
|
|
37182
|
+
var entityName = parseEntityName(/* allowReservedWords*/ false);
|
|
37200
37183
|
while (token() === 80 /* PrivateIdentifier */) {
|
|
37201
37184
|
reScanHashToken(); // rescan #id as # id
|
|
37202
37185
|
nextTokenJSDoc(); // then skip the #
|
|
@@ -37639,7 +37622,7 @@ var ts;
|
|
|
37639
37622
|
// parseEntityName logs an error for non-identifier, so create a MissingNode ourselves to avoid the error
|
|
37640
37623
|
var p2 = getNodePos();
|
|
37641
37624
|
var name = ts.tokenIsIdentifierOrKeyword(token())
|
|
37642
|
-
? parseEntityName(/*allowReservedWords*/ true
|
|
37625
|
+
? parseEntityName(/*allowReservedWords*/ true)
|
|
37643
37626
|
: undefined;
|
|
37644
37627
|
if (name) {
|
|
37645
37628
|
while (token() === 80 /* PrivateIdentifier */) {
|
|
@@ -39296,7 +39279,7 @@ var ts;
|
|
|
39296
39279
|
es2020: ts.ModuleKind.ES2020,
|
|
39297
39280
|
es2022: ts.ModuleKind.ES2022,
|
|
39298
39281
|
esnext: ts.ModuleKind.ESNext,
|
|
39299
|
-
|
|
39282
|
+
node16: ts.ModuleKind.Node16,
|
|
39300
39283
|
nodenext: ts.ModuleKind.NodeNext,
|
|
39301
39284
|
})),
|
|
39302
39285
|
affectsModuleResolution: true,
|
|
@@ -39650,7 +39633,7 @@ var ts;
|
|
|
39650
39633
|
type: new ts.Map(ts.getEntries({
|
|
39651
39634
|
node: ts.ModuleResolutionKind.NodeJs,
|
|
39652
39635
|
classic: ts.ModuleResolutionKind.Classic,
|
|
39653
|
-
|
|
39636
|
+
node16: ts.ModuleResolutionKind.Node16,
|
|
39654
39637
|
nodenext: ts.ModuleResolutionKind.NodeNext,
|
|
39655
39638
|
})),
|
|
39656
39639
|
affectsModuleResolution: true,
|
|
@@ -40126,7 +40109,7 @@ var ts;
|
|
|
40126
40109
|
affectsModuleResolution: true,
|
|
40127
40110
|
description: ts.Diagnostics.Control_what_method_is_used_to_detect_module_format_JS_files,
|
|
40128
40111
|
category: ts.Diagnostics.Language_and_Environment,
|
|
40129
|
-
defaultValueDescription: ts.Diagnostics.
|
|
40112
|
+
defaultValueDescription: ts.Diagnostics.auto_Colon_Treat_files_with_imports_exports_import_meta_jsx_with_jsx_Colon_react_jsx_or_esm_format_with_module_Colon_node16_as_modules,
|
|
40130
40113
|
}
|
|
40131
40114
|
];
|
|
40132
40115
|
/* @internal */
|
|
@@ -42362,9 +42345,9 @@ var ts;
|
|
|
42362
42345
|
// set in a non-modal module resolution setting here. Do note that our behavior is not particularly well defined when these mode-overriding imports
|
|
42363
42346
|
// are present in a non-modal project; while in theory we'd like to either ignore the mode or provide faithful modern resolution, depending on what we feel is best,
|
|
42364
42347
|
// in practice, not every cache has the options available to intelligently make the choice to ignore the mode request, and it's unclear how modern "faithful modern
|
|
42365
|
-
// resolution" should be (`
|
|
42348
|
+
// resolution" should be (`node16`? `nodenext`?). As such, witnessing a mode-overriding triple-slash reference in a non-modal module resolution
|
|
42366
42349
|
// context should _probably_ be an error - and that should likely be handled by the `Program` (which is what we do).
|
|
42367
|
-
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
42350
|
+
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext)) {
|
|
42368
42351
|
features |= NodeResolutionFeatures.EsmMode;
|
|
42369
42352
|
}
|
|
42370
42353
|
var conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : [];
|
|
@@ -42453,7 +42436,7 @@ var ts;
|
|
|
42453
42436
|
}
|
|
42454
42437
|
ts.resolveTypeReferenceDirective = resolveTypeReferenceDirective;
|
|
42455
42438
|
function getDefaultNodeResolutionFeatures(options) {
|
|
42456
|
-
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
42439
|
+
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 ? NodeResolutionFeatures.Node16Default :
|
|
42457
42440
|
ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext ? NodeResolutionFeatures.NodeNextDefault :
|
|
42458
42441
|
NodeResolutionFeatures.None;
|
|
42459
42442
|
}
|
|
@@ -42811,8 +42794,8 @@ var ts;
|
|
|
42811
42794
|
case ts.ModuleKind.CommonJS:
|
|
42812
42795
|
moduleResolution = ts.ModuleResolutionKind.NodeJs;
|
|
42813
42796
|
break;
|
|
42814
|
-
case ts.ModuleKind.
|
|
42815
|
-
moduleResolution = ts.ModuleResolutionKind.
|
|
42797
|
+
case ts.ModuleKind.Node16:
|
|
42798
|
+
moduleResolution = ts.ModuleResolutionKind.Node16;
|
|
42816
42799
|
break;
|
|
42817
42800
|
case ts.ModuleKind.NodeNext:
|
|
42818
42801
|
moduleResolution = ts.ModuleResolutionKind.NodeNext;
|
|
@@ -42832,8 +42815,8 @@ var ts;
|
|
|
42832
42815
|
}
|
|
42833
42816
|
ts.perfLogger.logStartResolveModule(moduleName /* , containingFile, ModuleResolutionKind[moduleResolution]*/);
|
|
42834
42817
|
switch (moduleResolution) {
|
|
42835
|
-
case ts.ModuleResolutionKind.
|
|
42836
|
-
result =
|
|
42818
|
+
case ts.ModuleResolutionKind.Node16:
|
|
42819
|
+
result = node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
42837
42820
|
break;
|
|
42838
42821
|
case ts.ModuleResolutionKind.NodeNext:
|
|
42839
42822
|
result = nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -43067,15 +43050,15 @@ var ts;
|
|
|
43067
43050
|
// respecting the `.exports` member of packages' package.json files and its (conditional) mappings of export names
|
|
43068
43051
|
NodeResolutionFeatures[NodeResolutionFeatures["Exports"] = 8] = "Exports";
|
|
43069
43052
|
// allowing `*` in the LHS of an export to be followed by more content, eg `"./whatever/*.js"`
|
|
43070
|
-
// not
|
|
43053
|
+
// not supported in node 12 - https://github.com/nodejs/Release/issues/690
|
|
43071
43054
|
NodeResolutionFeatures[NodeResolutionFeatures["ExportsPatternTrailers"] = 16] = "ExportsPatternTrailers";
|
|
43072
43055
|
NodeResolutionFeatures[NodeResolutionFeatures["AllFeatures"] = 30] = "AllFeatures";
|
|
43073
|
-
NodeResolutionFeatures[NodeResolutionFeatures["
|
|
43056
|
+
NodeResolutionFeatures[NodeResolutionFeatures["Node16Default"] = 30] = "Node16Default";
|
|
43074
43057
|
NodeResolutionFeatures[NodeResolutionFeatures["NodeNextDefault"] = 30] = "NodeNextDefault";
|
|
43075
43058
|
NodeResolutionFeatures[NodeResolutionFeatures["EsmMode"] = 32] = "EsmMode";
|
|
43076
43059
|
})(NodeResolutionFeatures || (NodeResolutionFeatures = {}));
|
|
43077
|
-
function
|
|
43078
|
-
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.
|
|
43060
|
+
function node16ModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43061
|
+
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.Node16Default, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
43079
43062
|
}
|
|
43080
43063
|
function nodeNextModuleNameResolver(moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode) {
|
|
43081
43064
|
return nodeNextModuleNameResolverWorker(NodeResolutionFeatures.NodeNextDefault, moduleName, containingFile, compilerOptions, host, cache, redirectedReference, resolutionMode);
|
|
@@ -43115,7 +43098,7 @@ var ts;
|
|
|
43115
43098
|
var _a, _b;
|
|
43116
43099
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
43117
43100
|
var failedLookupLocations = [];
|
|
43118
|
-
// conditions are only used by the
|
|
43101
|
+
// conditions are only used by the node16/nodenext resolver - there's no priority order in the list,
|
|
43119
43102
|
//it's essentially a set (priority is determined by object insertion order in the object we look at).
|
|
43120
43103
|
var conditions = features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"];
|
|
43121
43104
|
if (compilerOptions.noDtsResolution) {
|
|
@@ -48502,7 +48485,7 @@ var ts;
|
|
|
48502
48485
|
var enumRelation = new ts.Map();
|
|
48503
48486
|
var builtinGlobals = ts.createSymbolTable();
|
|
48504
48487
|
builtinGlobals.set(undefinedSymbol.escapedName, undefinedSymbol);
|
|
48505
|
-
// Extensions suggested for path imports when module resolution is
|
|
48488
|
+
// Extensions suggested for path imports when module resolution is node16 or higher.
|
|
48506
48489
|
// The first element of each tuple is the extension a file has.
|
|
48507
48490
|
// The second element of each tuple is the extension that should be used in a path import.
|
|
48508
48491
|
// e.g. if we want to import file `foo.mts`, we should write `import {} from "./foo.mjs".
|
|
@@ -50791,7 +50774,7 @@ var ts;
|
|
|
50791
50774
|
if (resolvedModule.isExternalLibraryImport && !ts.resolutionExtensionIsTSOrJson(resolvedModule.extension)) {
|
|
50792
50775
|
errorOnImplicitAnyModule(/*isError*/ false, errorNode, resolvedModule, moduleReference);
|
|
50793
50776
|
}
|
|
50794
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
50777
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
50795
50778
|
var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
|
|
50796
50779
|
var overrideClauseHost = ts.findAncestor(location, function (l) { return ts.isImportTypeNode(l) || ts.isExportDeclaration(l) || ts.isImportDeclaration(l); });
|
|
50797
50780
|
var overrideClause = overrideClauseHost && ts.isImportTypeNode(overrideClauseHost) ? (_g = overrideClauseHost.assertions) === null || _g === void 0 ? void 0 : _g.assertClause : overrideClauseHost === null || overrideClauseHost === void 0 ? void 0 : overrideClauseHost.assertClause;
|
|
@@ -50800,9 +50783,6 @@ var ts;
|
|
|
50800
50783
|
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext && !ts.getResolutionModeOverrideForClause(overrideClause)) {
|
|
50801
50784
|
error(errorNode, ts.Diagnostics.Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_cannot_be_imported_synchronously_Use_dynamic_import_instead, moduleReference);
|
|
50802
50785
|
}
|
|
50803
|
-
if (mode === ts.ModuleKind.ESNext && compilerOptions.resolveJsonModule && resolvedModule.extension === ".json" /* Json */) {
|
|
50804
|
-
error(errorNode, ts.Diagnostics.JSON_imports_are_experimental_in_ES_module_mode_imports);
|
|
50805
|
-
}
|
|
50806
50786
|
}
|
|
50807
50787
|
// merged symbol is module declaration symbol combined with all augmentations
|
|
50808
50788
|
return getMergedSymbol(sourceFile.symbol);
|
|
@@ -50855,7 +50835,7 @@ var ts;
|
|
|
50855
50835
|
var tsExtension = ts.tryExtractTSExtension(moduleReference);
|
|
50856
50836
|
var isExtensionlessRelativePathImport = ts.pathIsRelative(moduleReference) && !ts.hasExtension(moduleReference);
|
|
50857
50837
|
var moduleResolutionKind = ts.getEmitModuleResolutionKind(compilerOptions);
|
|
50858
|
-
var
|
|
50838
|
+
var resolutionIsNode16OrNext = moduleResolutionKind === ts.ModuleResolutionKind.Node16 ||
|
|
50859
50839
|
moduleResolutionKind === ts.ModuleResolutionKind.NodeNext;
|
|
50860
50840
|
if (tsExtension) {
|
|
50861
50841
|
var diag = ts.Diagnostics.An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead;
|
|
@@ -50876,17 +50856,17 @@ var ts;
|
|
|
50876
50856
|
ts.hasJsonModuleEmitEnabled(compilerOptions)) {
|
|
50877
50857
|
error(errorNode, ts.Diagnostics.Cannot_find_module_0_Consider_using_resolveJsonModule_to_import_module_with_json_extension, moduleReference);
|
|
50878
50858
|
}
|
|
50879
|
-
else if (mode === ts.ModuleKind.ESNext &&
|
|
50859
|
+
else if (mode === ts.ModuleKind.ESNext && resolutionIsNode16OrNext && isExtensionlessRelativePathImport) {
|
|
50880
50860
|
var absoluteRef_1 = ts.getNormalizedAbsolutePath(moduleReference, ts.getDirectoryPath(currentSourceFile.path));
|
|
50881
50861
|
var suggestedExt = (_h = suggestedExtensions.find(function (_a) {
|
|
50882
50862
|
var actualExt = _a[0], _importExt = _a[1];
|
|
50883
50863
|
return host.fileExists(absoluteRef_1 + actualExt);
|
|
50884
50864
|
})) === null || _h === void 0 ? void 0 : _h[1];
|
|
50885
50865
|
if (suggestedExt) {
|
|
50886
|
-
error(errorNode, ts.Diagnostics.
|
|
50866
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Did_you_mean_0, moduleReference + suggestedExt);
|
|
50887
50867
|
}
|
|
50888
50868
|
else {
|
|
50889
|
-
error(errorNode, ts.Diagnostics.
|
|
50869
|
+
error(errorNode, ts.Diagnostics.Relative_import_paths_need_explicit_file_extensions_in_EcmaScript_imports_when_moduleResolution_is_node16_or_nodenext_Consider_adding_an_extension_to_the_import_path);
|
|
50890
50870
|
}
|
|
50891
50871
|
}
|
|
50892
50872
|
else {
|
|
@@ -53208,7 +53188,7 @@ var ts;
|
|
|
53208
53188
|
var targetFile = ts.getSourceFileOfModule(chain[0]);
|
|
53209
53189
|
var specifier = void 0;
|
|
53210
53190
|
var assertion = void 0;
|
|
53211
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
53191
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
53212
53192
|
// An `import` type directed at an esm format file is only going to resolve in esm mode - set the esm mode assertion
|
|
53213
53193
|
if ((targetFile === null || targetFile === void 0 ? void 0 : targetFile.impliedNodeFormat) === ts.ModuleKind.ESNext && targetFile.impliedNodeFormat !== (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat)) {
|
|
53214
53194
|
specifier = getSpecifierForModuleSymbol(chain[0], context, ts.ModuleKind.ESNext);
|
|
@@ -53222,7 +53202,7 @@ var ts;
|
|
|
53222
53202
|
}
|
|
53223
53203
|
if (!(context.flags & 67108864 /* AllowNodeModulesRelativePaths */) && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Classic && specifier.indexOf("/node_modules/") >= 0) {
|
|
53224
53204
|
var oldSpecifier = specifier;
|
|
53225
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.
|
|
53205
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
53226
53206
|
// We might be able to write a portable import type using a mode override; try specifier generation again, but with a different mode set
|
|
53227
53207
|
var swappedMode = (contextFile === null || contextFile === void 0 ? void 0 : contextFile.impliedNodeFormat) === ts.ModuleKind.ESNext ? ts.ModuleKind.CommonJS : ts.ModuleKind.ESNext;
|
|
53228
53208
|
specifier = getSpecifierForModuleSymbol(chain[0], context, swappedMode);
|
|
@@ -64699,7 +64679,6 @@ var ts;
|
|
|
64699
64679
|
return 0 /* False */;
|
|
64700
64680
|
}
|
|
64701
64681
|
function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
|
|
64702
|
-
var _a, _b;
|
|
64703
64682
|
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
64704
64683
|
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
64705
64684
|
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
@@ -64740,9 +64719,6 @@ var ts;
|
|
|
64740
64719
|
return;
|
|
64741
64720
|
}
|
|
64742
64721
|
reportRelationError(headMessage, source, target);
|
|
64743
|
-
if (strictNullChecks && source.flags & 8650752 /* TypeVariable */ && ((_b = (_a = source.symbol) === null || _a === void 0 ? void 0 : _a.declarations) === null || _b === void 0 ? void 0 : _b[0]) && !getConstraintOfType(source) && isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */))) {
|
|
64744
|
-
associateRelatedInfo(ts.createDiagnosticForNode(source.symbol.declarations[0], ts.Diagnostics.This_type_parameter_probably_needs_an_extends_object_constraint));
|
|
64745
|
-
}
|
|
64746
64722
|
}
|
|
64747
64723
|
function traceUnionsOrIntersectionsTooLarge(source, target) {
|
|
64748
64724
|
if (!ts.tracing) {
|
|
@@ -65515,7 +65491,7 @@ var ts;
|
|
|
65515
65491
|
// IndexedAccess comparisons are handled above in the `targetFlags & TypeFlage.IndexedAccess` branch
|
|
65516
65492
|
if (!(sourceFlags & 8388608 /* IndexedAccess */ && targetFlags & 8388608 /* IndexedAccess */)) {
|
|
65517
65493
|
var constraint = getConstraintOfType(source);
|
|
65518
|
-
if (!
|
|
65494
|
+
if (!constraint || (sourceFlags & 262144 /* TypeParameter */ && constraint.flags & 1 /* Any */)) {
|
|
65519
65495
|
// A type variable with no constraint is not related to the non-primitive object type.
|
|
65520
65496
|
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864 /* NonPrimitive */), 3 /* Both */)) {
|
|
65521
65497
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -65523,12 +65499,12 @@ var ts;
|
|
|
65523
65499
|
}
|
|
65524
65500
|
}
|
|
65525
65501
|
// hi-speed no-this-instantiation check (less accurate, but avoids costly `this`-instantiation when the constraint will suffice), see #28231 for report on why this is needed
|
|
65526
|
-
else if (
|
|
65502
|
+
else if (result = isRelatedTo(constraint, target, 1 /* Source */, /*reportErrors*/ false, /*headMessage*/ undefined, intersectionState)) {
|
|
65527
65503
|
resetErrorInfo(saveErrorInfo);
|
|
65528
65504
|
return result;
|
|
65529
65505
|
}
|
|
65530
65506
|
// slower, fuller, this-instantiated check (necessary when comparing raw `this` types from base classes), see `subclassWithPolymorphicThisIsAssignable.ts` test for example
|
|
65531
|
-
else if (
|
|
65507
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1 /* Source */, reportErrors && !(targetFlags & sourceFlags & 262144 /* TypeParameter */), /*headMessage*/ undefined, intersectionState)) {
|
|
65532
65508
|
resetErrorInfo(saveErrorInfo);
|
|
65533
65509
|
return result;
|
|
65534
65510
|
}
|
|
@@ -71191,7 +71167,7 @@ var ts;
|
|
|
71191
71167
|
if (ts.isBindingElement(declaration) && !declaration.initializer && !declaration.dotDotDotToken && declaration.parent.elements.length >= 2) {
|
|
71192
71168
|
var parent = declaration.parent.parent;
|
|
71193
71169
|
if (parent.kind === 254 /* VariableDeclaration */ && ts.getCombinedNodeFlags(declaration) & 2 /* Const */ || parent.kind === 164 /* Parameter */) {
|
|
71194
|
-
var links = getNodeLinks(
|
|
71170
|
+
var links = getNodeLinks(parent);
|
|
71195
71171
|
if (!(links.flags & 268435456 /* InCheckIdentifier */)) {
|
|
71196
71172
|
links.flags |= 268435456 /* InCheckIdentifier */;
|
|
71197
71173
|
var parentType = getTypeForBindingElementParent(parent, 0 /* Normal */);
|
|
@@ -77054,13 +77030,13 @@ var ts;
|
|
|
77054
77030
|
}
|
|
77055
77031
|
}
|
|
77056
77032
|
function checkImportMetaProperty(node) {
|
|
77057
|
-
if (moduleKind === ts.ModuleKind.
|
|
77033
|
+
if (moduleKind === ts.ModuleKind.Node16 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
77058
77034
|
if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
77059
77035
|
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
77060
77036
|
}
|
|
77061
77037
|
}
|
|
77062
77038
|
else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
|
|
77063
|
-
error(node, ts.Diagnostics.
|
|
77039
|
+
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node16_or_nodenext);
|
|
77064
77040
|
}
|
|
77065
77041
|
var file = ts.getSourceFileOfNode(node);
|
|
77066
77042
|
ts.Debug.assert(!!(file.flags & 4194304 /* PossiblyContainsImportMeta */), "Containing file is missing import meta node flag.");
|
|
@@ -78011,15 +77987,30 @@ var ts;
|
|
|
78011
77987
|
if (!hasParseDiagnostics(sourceFile)) {
|
|
78012
77988
|
var span = void 0;
|
|
78013
77989
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
78014
|
-
|
|
78015
|
-
span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
77990
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
78016
77991
|
var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.await_expressions_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);
|
|
78017
77992
|
diagnostics.add(diagnostic);
|
|
78018
77993
|
}
|
|
78019
|
-
|
|
78020
|
-
|
|
78021
|
-
|
|
78022
|
-
|
|
77994
|
+
switch (moduleKind) {
|
|
77995
|
+
case ts.ModuleKind.Node16:
|
|
77996
|
+
case ts.ModuleKind.NodeNext:
|
|
77997
|
+
if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
|
|
77998
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
77999
|
+
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
|
|
78000
|
+
break;
|
|
78001
|
+
}
|
|
78002
|
+
// fallthrough
|
|
78003
|
+
case ts.ModuleKind.ES2022:
|
|
78004
|
+
case ts.ModuleKind.ESNext:
|
|
78005
|
+
case ts.ModuleKind.System:
|
|
78006
|
+
if (languageVersion >= 4 /* ES2017 */) {
|
|
78007
|
+
break;
|
|
78008
|
+
}
|
|
78009
|
+
// fallthrough
|
|
78010
|
+
default:
|
|
78011
|
+
span !== null && span !== void 0 ? span : (span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos));
|
|
78012
|
+
diagnostics.add(ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.Top_level_await_expressions_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));
|
|
78013
|
+
break;
|
|
78023
78014
|
}
|
|
78024
78015
|
}
|
|
78025
78016
|
}
|
|
@@ -80461,8 +80452,8 @@ var ts;
|
|
|
80461
80452
|
if (node.assertions) {
|
|
80462
80453
|
var override = ts.getResolutionModeOverrideForClause(node.assertions.assertClause, grammarErrorOnNode);
|
|
80463
80454
|
if (override) {
|
|
80464
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
80465
|
-
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.
|
|
80455
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
80456
|
+
grammarErrorOnNode(node.assertions.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
80466
80457
|
}
|
|
80467
80458
|
}
|
|
80468
80459
|
}
|
|
@@ -81912,7 +81903,7 @@ var ts;
|
|
|
81912
81903
|
}
|
|
81913
81904
|
function checkCollisionWithRequireExportsInGeneratedCode(node, name) {
|
|
81914
81905
|
// No need to check for require or exports for ES6 modules and later
|
|
81915
|
-
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.
|
|
81906
|
+
if (moduleKind >= ts.ModuleKind.ES2015 && !(moduleKind >= ts.ModuleKind.Node16 && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.CommonJS)) {
|
|
81916
81907
|
return;
|
|
81917
81908
|
}
|
|
81918
81909
|
if (!name || !needCollisionCheckForIdentifier(node, name, "require") && !needCollisionCheckForIdentifier(node, name, "exports")) {
|
|
@@ -84832,8 +84823,8 @@ var ts;
|
|
|
84832
84823
|
var validForTypeAssertions = ts.isExclusivelyTypeOnlyImportOrExport(declaration);
|
|
84833
84824
|
var override = ts.getResolutionModeOverrideForClause(declaration.assertClause, validForTypeAssertions ? grammarErrorOnNode : undefined);
|
|
84834
84825
|
if (validForTypeAssertions && override) {
|
|
84835
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
84836
|
-
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.
|
|
84826
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
84827
|
+
return grammarErrorOnNode(declaration.assertClause, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext);
|
|
84837
84828
|
}
|
|
84838
84829
|
return; // Other grammar checks do not apply to type-only imports with resolution mode assertions
|
|
84839
84830
|
}
|
|
@@ -88020,8 +88011,24 @@ var ts;
|
|
|
88020
88011
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
88021
88012
|
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.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));
|
|
88022
88013
|
}
|
|
88023
|
-
|
|
88024
|
-
|
|
88014
|
+
switch (moduleKind) {
|
|
88015
|
+
case ts.ModuleKind.Node16:
|
|
88016
|
+
case ts.ModuleKind.NodeNext:
|
|
88017
|
+
if (sourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS) {
|
|
88018
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.The_current_file_is_a_CommonJS_module_and_cannot_use_await_at_the_top_level));
|
|
88019
|
+
break;
|
|
88020
|
+
}
|
|
88021
|
+
// fallthrough
|
|
88022
|
+
case ts.ModuleKind.ES2022:
|
|
88023
|
+
case ts.ModuleKind.ESNext:
|
|
88024
|
+
case ts.ModuleKind.System:
|
|
88025
|
+
if (languageVersion >= 4 /* ES2017 */) {
|
|
88026
|
+
break;
|
|
88027
|
+
}
|
|
88028
|
+
// fallthrough
|
|
88029
|
+
default:
|
|
88030
|
+
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.Top_level_for_await_loops_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));
|
|
88031
|
+
break;
|
|
88025
88032
|
}
|
|
88026
88033
|
}
|
|
88027
88034
|
}
|
|
@@ -88716,7 +88723,7 @@ var ts;
|
|
|
88716
88723
|
}
|
|
88717
88724
|
function checkGrammarImportCallExpression(node) {
|
|
88718
88725
|
if (moduleKind === ts.ModuleKind.ES2015) {
|
|
88719
|
-
return grammarErrorOnNode(node, ts.Diagnostics.
|
|
88726
|
+
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node16_or_nodenext);
|
|
88720
88727
|
}
|
|
88721
88728
|
if (node.typeArguments) {
|
|
88722
88729
|
return grammarErrorOnNode(node, ts.Diagnostics.This_use_of_import_is_invalid_import_calls_can_be_written_but_they_must_have_parentheses_and_cannot_have_type_arguments);
|
|
@@ -88727,7 +88734,7 @@ var ts;
|
|
|
88727
88734
|
checkGrammarForDisallowedTrailingComma(nodeArguments);
|
|
88728
88735
|
if (nodeArguments.length > 1) {
|
|
88729
88736
|
var assertionArgument = nodeArguments[1];
|
|
88730
|
-
return grammarErrorOnNode(assertionArgument, ts.Diagnostics.
|
|
88737
|
+
return grammarErrorOnNode(assertionArgument, ts.Diagnostics.Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_node16_or_nodenext);
|
|
88731
88738
|
}
|
|
88732
88739
|
}
|
|
88733
88740
|
if (nodeArguments.length === 0 || nodeArguments.length > 2) {
|
|
@@ -108993,7 +109000,7 @@ var ts;
|
|
|
108993
109000
|
return ts.transformECMAScriptModule;
|
|
108994
109001
|
case ts.ModuleKind.System:
|
|
108995
109002
|
return ts.transformSystemModule;
|
|
108996
|
-
case ts.ModuleKind.
|
|
109003
|
+
case ts.ModuleKind.Node16:
|
|
108997
109004
|
case ts.ModuleKind.NodeNext:
|
|
108998
109005
|
return ts.transformNodeModule;
|
|
108999
109006
|
default:
|
|
@@ -116016,7 +116023,7 @@ var ts;
|
|
|
116016
116023
|
*/
|
|
116017
116024
|
function getImpliedNodeFormatForFile(fileName, packageJsonInfoCache, host, options) {
|
|
116018
116025
|
switch (ts.getEmitModuleResolutionKind(options)) {
|
|
116019
|
-
case ts.ModuleResolutionKind.
|
|
116026
|
+
case ts.ModuleResolutionKind.Node16:
|
|
116020
116027
|
case ts.ModuleResolutionKind.NodeNext:
|
|
116021
116028
|
return ts.fileExtensionIsOneOf(fileName, [".d.mts" /* Dmts */, ".mts" /* Mts */, ".mjs" /* Mjs */]) ? ts.ModuleKind.ESNext :
|
|
116022
116029
|
ts.fileExtensionIsOneOf(fileName, [".d.cts" /* Dcts */, ".cts" /* Cts */, ".cjs" /* Cjs */]) ? ts.ModuleKind.CommonJS :
|
|
@@ -116315,7 +116322,7 @@ var ts;
|
|
|
116315
116322
|
var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
|
|
116316
116323
|
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
|
|
116317
116324
|
for (var i = 0; i < typeReferences.length; i++) {
|
|
116318
|
-
// under
|
|
116325
|
+
// under node16/nodenext module resolution, load `types`/ata include names as cjs resolution results by passing an `undefined` mode
|
|
116319
116326
|
processTypeReferenceDirective(typeReferences[i], /*mode*/ undefined, resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
116320
116327
|
}
|
|
116321
116328
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -117968,8 +117975,8 @@ var ts;
|
|
|
117968
117975
|
var fileName = ts.toFileNameLowerCase(ref.fileName);
|
|
117969
117976
|
ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
|
|
117970
117977
|
var mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
117971
|
-
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.
|
|
117972
|
-
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.
|
|
117978
|
+
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
117979
|
+
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node16_or_nodenext));
|
|
117973
117980
|
}
|
|
117974
117981
|
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
|
|
117975
117982
|
}
|
|
@@ -118331,7 +118338,7 @@ var ts;
|
|
|
118331
118338
|
}
|
|
118332
118339
|
if (options.resolveJsonModule) {
|
|
118333
118340
|
if (ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeJs &&
|
|
118334
|
-
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.
|
|
118341
|
+
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node16 &&
|
|
118335
118342
|
ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
118336
118343
|
createDiagnosticForOptionName(ts.Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule");
|
|
118337
118344
|
}
|
|
@@ -121471,7 +121478,7 @@ var ts;
|
|
|
121471
121478
|
}
|
|
121472
121479
|
function isFormatRequiringExtensions(compilerOptions, importingSourceFileName, host) {
|
|
121473
121480
|
var _a;
|
|
121474
|
-
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.
|
|
121481
|
+
if (ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.Node16
|
|
121475
121482
|
&& ts.getEmitModuleResolutionKind(compilerOptions) !== ts.ModuleResolutionKind.NodeNext) {
|
|
121476
121483
|
return false;
|
|
121477
121484
|
}
|
|
@@ -122056,7 +122063,7 @@ var ts;
|
|
|
122056
122063
|
var cachedPackageJson = (_b = (_a = host.getPackageJsonInfoCache) === null || _a === void 0 ? void 0 : _a.call(host)) === null || _b === void 0 ? void 0 : _b.getPackageJsonInfo(packageJsonPath);
|
|
122057
122064
|
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
|
122058
122065
|
var packageJsonContent = (cachedPackageJson === null || cachedPackageJson === void 0 ? void 0 : cachedPackageJson.packageJsonContent) || JSON.parse(host.readFile(packageJsonPath));
|
|
122059
|
-
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.
|
|
122066
|
+
if (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node16 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext) {
|
|
122060
122067
|
// `conditions` *could* be made to go against `importingSourceFile.impliedNodeFormat` if something wanted to generate
|
|
122061
122068
|
// an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is
|
|
122062
122069
|
// usually called to conjure an import out of thin air, we don't have an existing usage to call `getModeForUsageAtIndex`
|