@typescript-deploys/pr-build 4.5.0-pr-45884-7 → 4.5.0-pr-46071-13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cs/diagnosticMessages.generated.json +24 -7
- package/lib/de/diagnosticMessages.generated.json +24 -7
- package/lib/es/diagnosticMessages.generated.json +24 -7
- package/lib/fr/diagnosticMessages.generated.json +24 -7
- package/lib/it/diagnosticMessages.generated.json +24 -7
- package/lib/ja/diagnosticMessages.generated.json +24 -7
- package/lib/ko/diagnosticMessages.generated.json +24 -7
- package/lib/lib.dom.d.ts +669 -1896
- package/lib/lib.dom.iterable.d.ts +16 -48
- package/lib/lib.es2021.d.ts +1 -0
- package/lib/lib.es2021.intl.d.ts +9 -0
- package/lib/lib.es5.d.ts +10 -10
- package/lib/lib.webworker.d.ts +183 -520
- package/lib/lib.webworker.iterable.d.ts +10 -30
- package/lib/pl/diagnosticMessages.generated.json +24 -7
- package/lib/protocol.d.ts +1 -0
- package/lib/pt-br/diagnosticMessages.generated.json +24 -7
- package/lib/ru/diagnosticMessages.generated.json +24 -7
- package/lib/tr/diagnosticMessages.generated.json +24 -7
- package/lib/tsc.js +841 -439
- package/lib/tsserver.js +1457 -661
- package/lib/tsserverlibrary.d.ts +14 -9
- package/lib/tsserverlibrary.js +1457 -661
- package/lib/typescript.d.ts +13 -9
- package/lib/typescript.js +1457 -661
- package/lib/typescriptServices.d.ts +13 -9
- package/lib/typescriptServices.js +1457 -661
- package/lib/typingsInstaller.js +965 -462
- package/lib/zh-cn/diagnosticMessages.generated.json +24 -7
- package/lib/zh-tw/diagnosticMessages.generated.json +24 -7
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,7 +69,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.5";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20211001";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
function tryGetNativeMap() {
|
|
@@ -3294,6 +3294,7 @@ var ts;
|
|
|
3294
3294
|
ModuleKind[ModuleKind["System"] = 4] = "System";
|
|
3295
3295
|
ModuleKind[ModuleKind["ES2015"] = 5] = "ES2015";
|
|
3296
3296
|
ModuleKind[ModuleKind["ES2020"] = 6] = "ES2020";
|
|
3297
|
+
ModuleKind[ModuleKind["ES2022"] = 7] = "ES2022";
|
|
3297
3298
|
ModuleKind[ModuleKind["ESNext"] = 99] = "ESNext";
|
|
3298
3299
|
ModuleKind[ModuleKind["Node12"] = 100] = "Node12";
|
|
3299
3300
|
ModuleKind[ModuleKind["NodeNext"] = 199] = "NodeNext";
|
|
@@ -5297,7 +5298,7 @@ var ts;
|
|
|
5297
5298
|
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."),
|
|
5298
5299
|
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."),
|
|
5299
5300
|
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."),
|
|
5300
|
-
|
|
5301
|
+
Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_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', 'node12', or 'nodenext'."),
|
|
5301
5302
|
Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext: diag(1324, ts.DiagnosticCategory.Error, "Dynamic_imports_only_support_a_second_argument_when_the_module_option_is_set_to_esnext_1324", "Dynamic imports only support a second argument when the '--module' option is set to 'esnext'."),
|
|
5302
5303
|
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."),
|
|
5303
5304
|
Dynamic_import_cannot_have_type_arguments: diag(1326, ts.DiagnosticCategory.Error, "Dynamic_import_cannot_have_type_arguments_1326", "Dynamic import cannot have type arguments."),
|
|
@@ -5315,7 +5316,7 @@ var ts;
|
|
|
5315
5316
|
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."),
|
|
5316
5317
|
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}')'?"),
|
|
5317
5318
|
Type_arguments_cannot_be_used_here: diag(1342, ts.DiagnosticCategory.Error, "Type_arguments_cannot_be_used_here_1342", "Type arguments cannot be used here."),
|
|
5318
|
-
|
|
5319
|
+
The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_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', 'node12', or 'nodenext'."),
|
|
5319
5320
|
A_label_is_not_allowed_here: diag(1344, ts.DiagnosticCategory.Error, "A_label_is_not_allowed_here_1344", "'A label is not allowed here."),
|
|
5320
5321
|
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."),
|
|
5321
5322
|
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."),
|
|
@@ -5346,7 +5347,7 @@ var ts;
|
|
|
5346
5347
|
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."),
|
|
5347
5348
|
_0_was_imported_here: diag(1376, ts.DiagnosticCategory.Message, "_0_was_imported_here_1376", "'{0}' was imported here."),
|
|
5348
5349
|
_0_was_exported_here: diag(1377, ts.DiagnosticCategory.Message, "_0_was_exported_here_1377", "'{0}' was exported here."),
|
|
5349
|
-
|
|
5350
|
+
Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_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_o_1378", "Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
5350
5351
|
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'."),
|
|
5351
5352
|
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'."),
|
|
5352
5353
|
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 `}`?"),
|
|
@@ -5398,7 +5399,7 @@ var ts;
|
|
|
5398
5399
|
File_redirects_to_file_0: diag(1429, ts.DiagnosticCategory.Message, "File_redirects_to_file_0_1429", "File redirects to file '{0}'"),
|
|
5399
5400
|
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:"),
|
|
5400
5401
|
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."),
|
|
5401
|
-
|
|
5402
|
+
Top_level_for_await_loops_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_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_or__1432", "Top-level 'for await' loops are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', or 'nodenext', and the 'target' option is set to 'es2017' or higher."),
|
|
5402
5403
|
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."),
|
|
5403
5404
|
Unexpected_keyword_or_identifier: diag(1434, ts.DiagnosticCategory.Error, "Unexpected_keyword_or_identifier_1434", "Unexpected keyword or identifier."),
|
|
5404
5405
|
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}'?"),
|
|
@@ -5415,14 +5416,17 @@ var ts;
|
|
|
5415
5416
|
_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isolatedModules_is_enabled: diag(1448, ts.DiagnosticCategory.Error, "_0_resolves_to_a_type_only_declaration_and_must_be_re_exported_using_a_type_only_re_export_when_isol_1448", "'{0}' resolves to a type-only declaration and must be re-exported using a type-only re-export when 'isolatedModules' is enabled."),
|
|
5416
5417
|
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."),
|
|
5417
5418
|
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"),
|
|
5419
|
+
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"),
|
|
5418
5420
|
The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output: diag(1470, ts.DiagnosticCategory.Error, "The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output_1470", "The 'import.meta' meta-property is not allowed in files which will build into CommonJS output."),
|
|
5419
|
-
|
|
5421
|
+
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: diag(1471, ts.DiagnosticCategory.Error, "Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471", "Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead."),
|
|
5420
5422
|
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."),
|
|
5421
5423
|
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."),
|
|
5422
5424
|
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.", undefined, true),
|
|
5423
5425
|
Construct_signature_return_types_0_and_1_are_incompatible: diag(2203, ts.DiagnosticCategory.Error, "Construct_signature_return_types_0_and_1_are_incompatible_2203", "Construct signature return types '{0}' and '{1}' are incompatible.", undefined, true),
|
|
5424
5426
|
Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1: diag(2204, ts.DiagnosticCategory.Error, "Call_signatures_with_no_arguments_have_incompatible_return_types_0_and_1_2204", "Call signatures with no arguments have incompatible return types '{0}' and '{1}'.", undefined, true),
|
|
5425
5427
|
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}'.", undefined, true),
|
|
5428
|
+
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."),
|
|
5429
|
+
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."),
|
|
5426
5430
|
Duplicate_identifier_0: diag(2300, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_2300", "Duplicate identifier '{0}'."),
|
|
5427
5431
|
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."),
|
|
5428
5432
|
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."),
|
|
@@ -5481,7 +5485,7 @@ var ts;
|
|
|
5481
5485
|
The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: diag(2357, ts.DiagnosticCategory.Error, "The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access_2357", "The operand of an increment or decrement operator must be a variable or a property access."),
|
|
5482
5486
|
The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: diag(2358, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_paramete_2358", "The left-hand side of an 'instanceof' expression must be of type 'any', an object type or a type parameter."),
|
|
5483
5487
|
The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: diag(2359, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_F_2359", "The right-hand side of an 'instanceof' expression must be of type 'any' or of a type assignable to the 'Function' interface type."),
|
|
5484
|
-
|
|
5488
|
+
The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol: diag(2360, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or__2360", "The left-hand side of an 'in' expression must be a private identifier or of type 'any', 'string', 'number', or 'symbol'."),
|
|
5485
5489
|
The_right_hand_side_of_an_in_expression_must_not_be_a_primitive: diag(2361, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_in_expression_must_not_be_a_primitive_2361", "The right-hand side of an 'in' expression must not be a primitive."),
|
|
5486
5490
|
The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2362, ts.DiagnosticCategory.Error, "The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2362", "The left-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
|
|
5487
5491
|
The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type: diag(2363, ts.DiagnosticCategory.Error, "The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_bigint_or_an_enum_type_2363", "The right-hand side of an arithmetic operation must be of type 'any', 'number', 'bigint' or an enum type."),
|
|
@@ -9722,7 +9726,7 @@ var ts;
|
|
|
9722
9726
|
switch (node.kind) {
|
|
9723
9727
|
case 269:
|
|
9724
9728
|
case 274:
|
|
9725
|
-
return node.parent.parent.isTypeOnly;
|
|
9729
|
+
return node.isTypeOnly || node.parent.parent.isTypeOnly;
|
|
9726
9730
|
case 267:
|
|
9727
9731
|
return node.parent.isTypeOnly;
|
|
9728
9732
|
case 266:
|
|
@@ -10045,6 +10049,7 @@ var ts;
|
|
|
10045
10049
|
case 225:
|
|
10046
10050
|
case 212:
|
|
10047
10051
|
case 79:
|
|
10052
|
+
case 80:
|
|
10048
10053
|
case 13:
|
|
10049
10054
|
case 8:
|
|
10050
10055
|
case 9:
|
|
@@ -12136,6 +12141,8 @@ var ts;
|
|
|
12136
12141
|
node = node.parent;
|
|
12137
12142
|
}
|
|
12138
12143
|
return node.parent.kind === 180 || ts.isJSDocLinkLike(node.parent) || ts.isJSDocNameReference(node.parent) || ts.isJSDocMemberName(node.parent) || isJSXTagName(node);
|
|
12144
|
+
case 80:
|
|
12145
|
+
return ts.isBinaryExpression(node.parent) && node.parent.left === node && node.parent.operatorToken.kind === 101;
|
|
12139
12146
|
case 79:
|
|
12140
12147
|
if (node.parent.kind === 180 || ts.isJSDocLinkLike(node.parent) || ts.isJSDocNameReference(node.parent) || ts.isJSDocMemberName(node.parent) || isJSXTagName(node)) {
|
|
12141
12148
|
return true;
|
|
@@ -13493,6 +13500,7 @@ var ts;
|
|
|
13493
13500
|
case 108:
|
|
13494
13501
|
case 106:
|
|
13495
13502
|
case 79:
|
|
13503
|
+
case 80:
|
|
13496
13504
|
case 104:
|
|
13497
13505
|
case 110:
|
|
13498
13506
|
case 95:
|
|
@@ -15515,6 +15523,7 @@ var ts;
|
|
|
15515
15523
|
case ts.ModuleKind.AMD:
|
|
15516
15524
|
case ts.ModuleKind.ES2015:
|
|
15517
15525
|
case ts.ModuleKind.ES2020:
|
|
15526
|
+
case ts.ModuleKind.ES2022:
|
|
15518
15527
|
case ts.ModuleKind.ESNext:
|
|
15519
15528
|
return true;
|
|
15520
15529
|
default:
|
|
@@ -15684,7 +15693,8 @@ var ts;
|
|
|
15684
15693
|
var aParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(a, cwd));
|
|
15685
15694
|
var bParts = ts.getPathComponents(ts.getNormalizedAbsolutePath(b, cwd));
|
|
15686
15695
|
var isDirectory = false;
|
|
15687
|
-
while (
|
|
15696
|
+
while (aParts.length >= 2 && bParts.length >= 2 &&
|
|
15697
|
+
!isNodeModulesOrScopedPackageDirectory(aParts[aParts.length - 2], getCanonicalFileName) &&
|
|
15688
15698
|
!isNodeModulesOrScopedPackageDirectory(bParts[bParts.length - 2], getCanonicalFileName) &&
|
|
15689
15699
|
getCanonicalFileName(aParts[aParts.length - 1]) === getCanonicalFileName(bParts[bParts.length - 1])) {
|
|
15690
15700
|
aParts.pop();
|
|
@@ -15694,7 +15704,7 @@ var ts;
|
|
|
15694
15704
|
return isDirectory ? [ts.getPathFromPathComponents(aParts), ts.getPathFromPathComponents(bParts)] : undefined;
|
|
15695
15705
|
}
|
|
15696
15706
|
function isNodeModulesOrScopedPackageDirectory(s, getCanonicalFileName) {
|
|
15697
|
-
return getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@");
|
|
15707
|
+
return s !== undefined && (getCanonicalFileName(s) === "node_modules" || ts.startsWith(s, "@"));
|
|
15698
15708
|
}
|
|
15699
15709
|
function stripLeadingDirectorySeparator(s) {
|
|
15700
15710
|
return ts.isAnyDirectorySeparator(s.charCodeAt(0)) ? s.slice(1) : undefined;
|
|
@@ -16234,10 +16244,6 @@ var ts;
|
|
|
16234
16244
|
|| !(isExpressionNode(useSite) || isShorthandPropertyNameUseSite(useSite));
|
|
16235
16245
|
}
|
|
16236
16246
|
ts.isValidTypeOnlyAliasUseSite = isValidTypeOnlyAliasUseSite;
|
|
16237
|
-
function typeOnlyDeclarationIsExport(typeOnlyDeclaration) {
|
|
16238
|
-
return typeOnlyDeclaration.kind === 274;
|
|
16239
|
-
}
|
|
16240
|
-
ts.typeOnlyDeclarationIsExport = typeOnlyDeclarationIsExport;
|
|
16241
16247
|
function isShorthandPropertyNameUseSite(useSite) {
|
|
16242
16248
|
return ts.isIdentifier(useSite) && ts.isShorthandPropertyAssignment(useSite.parent) && useSite.parent.name === useSite;
|
|
16243
16249
|
}
|
|
@@ -16488,6 +16494,10 @@ var ts;
|
|
|
16488
16494
|
return !!declaration && (ts.isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
|
|
16489
16495
|
}
|
|
16490
16496
|
ts.isParameterOrCatchClauseVariable = isParameterOrCatchClauseVariable;
|
|
16497
|
+
function isFunctionExpressionOrArrowFunction(node) {
|
|
16498
|
+
return node.kind === 212 || node.kind === 213;
|
|
16499
|
+
}
|
|
16500
|
+
ts.isFunctionExpressionOrArrowFunction = isFunctionExpressionOrArrowFunction;
|
|
16491
16501
|
})(ts || (ts = {}));
|
|
16492
16502
|
var ts;
|
|
16493
16503
|
(function (ts) {
|
|
@@ -19694,8 +19704,9 @@ var ts;
|
|
|
19694
19704
|
? update(createNamedImports(elements), node)
|
|
19695
19705
|
: node;
|
|
19696
19706
|
}
|
|
19697
|
-
function createImportSpecifier(propertyName, name) {
|
|
19707
|
+
function createImportSpecifier(isTypeOnly, propertyName, name) {
|
|
19698
19708
|
var node = createBaseNode(269);
|
|
19709
|
+
node.isTypeOnly = isTypeOnly;
|
|
19699
19710
|
node.propertyName = propertyName;
|
|
19700
19711
|
node.name = name;
|
|
19701
19712
|
node.transformFlags |=
|
|
@@ -19704,10 +19715,11 @@ var ts;
|
|
|
19704
19715
|
node.transformFlags &= ~16777216;
|
|
19705
19716
|
return node;
|
|
19706
19717
|
}
|
|
19707
|
-
function updateImportSpecifier(node, propertyName, name) {
|
|
19708
|
-
return node.
|
|
19718
|
+
function updateImportSpecifier(node, isTypeOnly, propertyName, name) {
|
|
19719
|
+
return node.isTypeOnly !== isTypeOnly
|
|
19720
|
+
|| node.propertyName !== propertyName
|
|
19709
19721
|
|| node.name !== name
|
|
19710
|
-
? update(createImportSpecifier(propertyName, name), node)
|
|
19722
|
+
? update(createImportSpecifier(isTypeOnly, propertyName, name), node)
|
|
19711
19723
|
: node;
|
|
19712
19724
|
}
|
|
19713
19725
|
function createExportAssignment(decorators, modifiers, isExportEquals, expression) {
|
|
@@ -19761,8 +19773,9 @@ var ts;
|
|
|
19761
19773
|
? update(createNamedExports(elements), node)
|
|
19762
19774
|
: node;
|
|
19763
19775
|
}
|
|
19764
|
-
function createExportSpecifier(propertyName, name) {
|
|
19776
|
+
function createExportSpecifier(isTypeOnly, propertyName, name) {
|
|
19765
19777
|
var node = createBaseNode(274);
|
|
19778
|
+
node.isTypeOnly = isTypeOnly;
|
|
19766
19779
|
node.propertyName = asName(propertyName);
|
|
19767
19780
|
node.name = asName(name);
|
|
19768
19781
|
node.transformFlags |=
|
|
@@ -19771,10 +19784,11 @@ var ts;
|
|
|
19771
19784
|
node.transformFlags &= ~16777216;
|
|
19772
19785
|
return node;
|
|
19773
19786
|
}
|
|
19774
|
-
function updateExportSpecifier(node, propertyName, name) {
|
|
19775
|
-
return node.
|
|
19787
|
+
function updateExportSpecifier(node, isTypeOnly, propertyName, name) {
|
|
19788
|
+
return node.isTypeOnly !== isTypeOnly
|
|
19789
|
+
|| node.propertyName !== propertyName
|
|
19776
19790
|
|| node.name !== name
|
|
19777
|
-
? update(createExportSpecifier(propertyName, name), node)
|
|
19791
|
+
? update(createExportSpecifier(isTypeOnly, propertyName, name), node)
|
|
19778
19792
|
: node;
|
|
19779
19793
|
}
|
|
19780
19794
|
function createMissingDeclaration() {
|
|
@@ -20651,7 +20665,7 @@ var ts;
|
|
|
20651
20665
|
}
|
|
20652
20666
|
function createExternalModuleExport(exportName) {
|
|
20653
20667
|
return createExportDeclaration(undefined, undefined, false, createNamedExports([
|
|
20654
|
-
createExportSpecifier(undefined, exportName)
|
|
20668
|
+
createExportSpecifier(false, undefined, exportName)
|
|
20655
20669
|
]));
|
|
20656
20670
|
}
|
|
20657
20671
|
function createTypeCheck(value, tag) {
|
|
@@ -21710,6 +21724,7 @@ var ts;
|
|
|
21710
21724
|
createExportStarHelper: createExportStarHelper,
|
|
21711
21725
|
createClassPrivateFieldGetHelper: createClassPrivateFieldGetHelper,
|
|
21712
21726
|
createClassPrivateFieldSetHelper: createClassPrivateFieldSetHelper,
|
|
21727
|
+
createClassPrivateFieldInHelper: createClassPrivateFieldInHelper
|
|
21713
21728
|
};
|
|
21714
21729
|
function getUnscopedHelperName(name) {
|
|
21715
21730
|
return ts.setEmitFlags(factory.createIdentifier(name), 4096 | 2);
|
|
@@ -21875,6 +21890,10 @@ var ts;
|
|
|
21875
21890
|
}
|
|
21876
21891
|
return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldSet"), undefined, args);
|
|
21877
21892
|
}
|
|
21893
|
+
function createClassPrivateFieldInHelper(state, receiver) {
|
|
21894
|
+
context.requestEmitHelper(ts.classPrivateFieldInHelper);
|
|
21895
|
+
return factory.createCallExpression(getUnscopedHelperName("__classPrivateFieldIn"), undefined, [state, receiver]);
|
|
21896
|
+
}
|
|
21878
21897
|
}
|
|
21879
21898
|
ts.createEmitHelperFactory = createEmitHelperFactory;
|
|
21880
21899
|
function compareEmitHelpers(x, y) {
|
|
@@ -22059,6 +22078,12 @@ var ts;
|
|
|
22059
22078
|
scoped: false,
|
|
22060
22079
|
text: "\n var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n };"
|
|
22061
22080
|
};
|
|
22081
|
+
ts.classPrivateFieldInHelper = {
|
|
22082
|
+
name: "typescript:classPrivateFieldIn",
|
|
22083
|
+
importName: "__classPrivateFieldIn",
|
|
22084
|
+
scoped: false,
|
|
22085
|
+
text: "\n var __classPrivateFieldIn = (this && this.__classPrivateFieldIn) || function(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n };"
|
|
22086
|
+
};
|
|
22062
22087
|
var allUnscopedEmitHelpers;
|
|
22063
22088
|
function getAllUnscopedEmitHelpers() {
|
|
22064
22089
|
return allUnscopedEmitHelpers || (allUnscopedEmitHelpers = ts.arrayToMap([
|
|
@@ -22083,6 +22108,7 @@ var ts;
|
|
|
22083
22108
|
ts.exportStarHelper,
|
|
22084
22109
|
ts.classPrivateFieldGetHelper,
|
|
22085
22110
|
ts.classPrivateFieldSetHelper,
|
|
22111
|
+
ts.classPrivateFieldInHelper,
|
|
22086
22112
|
ts.createBindingHelper,
|
|
22087
22113
|
ts.setModuleDefaultHelper
|
|
22088
22114
|
], function (helper) { return helper.name; }));
|
|
@@ -23290,8 +23316,8 @@ var ts;
|
|
|
23290
23316
|
if (ts.some(helperNames)) {
|
|
23291
23317
|
helperNames.sort(ts.compareStringsCaseSensitive);
|
|
23292
23318
|
namedBindings = nodeFactory.createNamedImports(ts.map(helperNames, function (name) { return ts.isFileLevelUniqueName(sourceFile, name)
|
|
23293
|
-
? nodeFactory.createImportSpecifier(undefined, nodeFactory.createIdentifier(name))
|
|
23294
|
-
: nodeFactory.createImportSpecifier(nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));
|
|
23319
|
+
? nodeFactory.createImportSpecifier(false, undefined, nodeFactory.createIdentifier(name))
|
|
23320
|
+
: nodeFactory.createImportSpecifier(false, nodeFactory.createIdentifier(name), helperFactory.getUnscopedHelperName(name)); }));
|
|
23295
23321
|
var parseNode = ts.getOriginalNode(sourceFile, ts.isSourceFile);
|
|
23296
23322
|
var emitNode = ts.getOrCreateEmitNode(parseNode);
|
|
23297
23323
|
emitNode.externalHelpers = true;
|
|
@@ -25019,7 +25045,7 @@ var ts;
|
|
|
25019
25045
|
parseErrorAtCurrentToken(blankDiagnostic);
|
|
25020
25046
|
}
|
|
25021
25047
|
else {
|
|
25022
|
-
parseErrorAtCurrentToken(nameDiagnostic,
|
|
25048
|
+
parseErrorAtCurrentToken(nameDiagnostic, scanner.getTokenValue());
|
|
25023
25049
|
}
|
|
25024
25050
|
}
|
|
25025
25051
|
function getSpaceSuggestion(expressionText) {
|
|
@@ -25271,7 +25297,6 @@ var ts;
|
|
|
25271
25297
|
case 88:
|
|
25272
25298
|
return nextTokenCanFollowDefaultKeyword();
|
|
25273
25299
|
case 124:
|
|
25274
|
-
return nextTokenIsOnSameLineAndCanFollowModifier();
|
|
25275
25300
|
case 136:
|
|
25276
25301
|
case 148:
|
|
25277
25302
|
nextToken();
|
|
@@ -27700,6 +27725,8 @@ var ts;
|
|
|
27700
27725
|
break;
|
|
27701
27726
|
case 15:
|
|
27702
27727
|
return parseTemplateExpression(false);
|
|
27728
|
+
case 80:
|
|
27729
|
+
return parsePrivateIdentifier();
|
|
27703
27730
|
}
|
|
27704
27731
|
return parseIdentifier(ts.Diagnostics.Expression_expected);
|
|
27705
27732
|
}
|
|
@@ -28662,7 +28689,7 @@ var ts;
|
|
|
28662
28689
|
}
|
|
28663
28690
|
return list && createNodeArray(list, pos);
|
|
28664
28691
|
}
|
|
28665
|
-
function tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
|
|
28692
|
+
function tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStaticModifier) {
|
|
28666
28693
|
var pos = getNodePos();
|
|
28667
28694
|
var kind = token();
|
|
28668
28695
|
if (token() === 85 && permitInvalidConstAsModifier) {
|
|
@@ -28673,6 +28700,9 @@ var ts;
|
|
|
28673
28700
|
else if (stopOnStartOfClassStaticBlock && token() === 124 && lookAhead(nextTokenIsOpenBrace)) {
|
|
28674
28701
|
return undefined;
|
|
28675
28702
|
}
|
|
28703
|
+
else if (hasSeenStaticModifier && token() === 124) {
|
|
28704
|
+
return undefined;
|
|
28705
|
+
}
|
|
28676
28706
|
else {
|
|
28677
28707
|
if (!parseAnyContextualModifier()) {
|
|
28678
28708
|
return undefined;
|
|
@@ -28682,8 +28712,10 @@ var ts;
|
|
|
28682
28712
|
}
|
|
28683
28713
|
function parseModifiers(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock) {
|
|
28684
28714
|
var pos = getNodePos();
|
|
28685
|
-
var list, modifier;
|
|
28686
|
-
while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock)) {
|
|
28715
|
+
var list, modifier, hasSeenStatic = false;
|
|
28716
|
+
while (modifier = tryParseModifier(permitInvalidConstAsModifier, stopOnStartOfClassStaticBlock, hasSeenStatic)) {
|
|
28717
|
+
if (modifier.kind === 124)
|
|
28718
|
+
hasSeenStatic = true;
|
|
28687
28719
|
list = ts.append(list, modifier);
|
|
28688
28720
|
}
|
|
28689
28721
|
return list && createNodeArray(list, pos);
|
|
@@ -29060,27 +29092,60 @@ var ts;
|
|
|
29060
29092
|
var checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
|
|
29061
29093
|
var checkIdentifierStart = scanner.getTokenPos();
|
|
29062
29094
|
var checkIdentifierEnd = scanner.getTextPos();
|
|
29063
|
-
var
|
|
29095
|
+
var isTypeOnly = false;
|
|
29064
29096
|
var propertyName;
|
|
29065
|
-
var
|
|
29066
|
-
|
|
29067
|
-
|
|
29068
|
-
|
|
29069
|
-
|
|
29070
|
-
|
|
29071
|
-
|
|
29072
|
-
|
|
29097
|
+
var canParseAsKeyword = true;
|
|
29098
|
+
var name = parseIdentifierName();
|
|
29099
|
+
if (name.escapedText === "type") {
|
|
29100
|
+
if (token() === 127) {
|
|
29101
|
+
var firstAs = parseIdentifierName();
|
|
29102
|
+
if (token() === 127) {
|
|
29103
|
+
var secondAs = parseIdentifierName();
|
|
29104
|
+
if (ts.tokenIsIdentifierOrKeyword(token())) {
|
|
29105
|
+
isTypeOnly = true;
|
|
29106
|
+
propertyName = firstAs;
|
|
29107
|
+
name = parseNameWithKeywordCheck();
|
|
29108
|
+
canParseAsKeyword = false;
|
|
29109
|
+
}
|
|
29110
|
+
else {
|
|
29111
|
+
propertyName = name;
|
|
29112
|
+
name = secondAs;
|
|
29113
|
+
canParseAsKeyword = false;
|
|
29114
|
+
}
|
|
29115
|
+
}
|
|
29116
|
+
else if (ts.tokenIsIdentifierOrKeyword(token())) {
|
|
29117
|
+
propertyName = name;
|
|
29118
|
+
canParseAsKeyword = false;
|
|
29119
|
+
name = parseNameWithKeywordCheck();
|
|
29120
|
+
}
|
|
29121
|
+
else {
|
|
29122
|
+
isTypeOnly = true;
|
|
29123
|
+
name = firstAs;
|
|
29124
|
+
}
|
|
29125
|
+
}
|
|
29126
|
+
else if (ts.tokenIsIdentifierOrKeyword(token())) {
|
|
29127
|
+
isTypeOnly = true;
|
|
29128
|
+
name = parseNameWithKeywordCheck();
|
|
29129
|
+
}
|
|
29073
29130
|
}
|
|
29074
|
-
|
|
29075
|
-
|
|
29131
|
+
if (canParseAsKeyword && token() === 127) {
|
|
29132
|
+
propertyName = name;
|
|
29133
|
+
parseExpected(127);
|
|
29134
|
+
name = parseNameWithKeywordCheck();
|
|
29076
29135
|
}
|
|
29077
29136
|
if (kind === 269 && checkIdentifierIsKeyword) {
|
|
29078
29137
|
parseErrorAt(checkIdentifierStart, checkIdentifierEnd, ts.Diagnostics.Identifier_expected);
|
|
29079
29138
|
}
|
|
29080
29139
|
var node = kind === 269
|
|
29081
|
-
? factory.createImportSpecifier(propertyName, name)
|
|
29082
|
-
: factory.createExportSpecifier(propertyName, name);
|
|
29140
|
+
? factory.createImportSpecifier(isTypeOnly, propertyName, name)
|
|
29141
|
+
: factory.createExportSpecifier(isTypeOnly, propertyName, name);
|
|
29083
29142
|
return finishNode(node, pos);
|
|
29143
|
+
function parseNameWithKeywordCheck() {
|
|
29144
|
+
checkIdentifierIsKeyword = ts.isKeyword(token()) && !isIdentifier();
|
|
29145
|
+
checkIdentifierStart = scanner.getTokenPos();
|
|
29146
|
+
checkIdentifierEnd = scanner.getTextPos();
|
|
29147
|
+
return parseIdentifierName();
|
|
29148
|
+
}
|
|
29084
29149
|
}
|
|
29085
29150
|
function parseNamespaceExport(pos) {
|
|
29086
29151
|
return finishNode(factory.createNamespaceExport(parseIdentifierName()), pos);
|
|
@@ -30951,6 +31016,7 @@ var ts;
|
|
|
30951
31016
|
es6: ts.ModuleKind.ES2015,
|
|
30952
31017
|
es2015: ts.ModuleKind.ES2015,
|
|
30953
31018
|
es2020: ts.ModuleKind.ES2020,
|
|
31019
|
+
es2022: ts.ModuleKind.ES2022,
|
|
30954
31020
|
esnext: ts.ModuleKind.ESNext,
|
|
30955
31021
|
node12: ts.ModuleKind.Node12,
|
|
30956
31022
|
nodenext: ts.ModuleKind.NodeNext,
|
|
@@ -31823,7 +31889,7 @@ var ts;
|
|
|
31823
31889
|
};
|
|
31824
31890
|
ts.defaultInitCompilerOptions = {
|
|
31825
31891
|
module: ts.ModuleKind.CommonJS,
|
|
31826
|
-
target:
|
|
31892
|
+
target: 3,
|
|
31827
31893
|
strict: true,
|
|
31828
31894
|
esModuleInterop: true,
|
|
31829
31895
|
forceConsistentCasingInFileNames: true,
|
|
@@ -32547,29 +32613,39 @@ var ts;
|
|
|
32547
32613
|
}
|
|
32548
32614
|
return result;
|
|
32549
32615
|
}
|
|
32550
|
-
function
|
|
32616
|
+
function getCompilerOptionsDiffValue(options, newLine) {
|
|
32617
|
+
var compilerOptionsMap = getSerializedCompilerOption(options);
|
|
32618
|
+
return getOverwrittenDefaultOptions();
|
|
32619
|
+
function makePadding(paddingLength) {
|
|
32620
|
+
return Array(paddingLength + 1).join(" ");
|
|
32621
|
+
}
|
|
32622
|
+
function getOverwrittenDefaultOptions() {
|
|
32623
|
+
var result = [];
|
|
32624
|
+
var tab = makePadding(2);
|
|
32625
|
+
commandOptionsWithoutBuild.forEach(function (cmd) {
|
|
32626
|
+
if (!compilerOptionsMap.has(cmd.name)) {
|
|
32627
|
+
return;
|
|
32628
|
+
}
|
|
32629
|
+
var newValue = compilerOptionsMap.get(cmd.name);
|
|
32630
|
+
var defaultValue = getDefaultValueForOption(cmd);
|
|
32631
|
+
if (newValue !== defaultValue) {
|
|
32632
|
+
result.push("" + tab + cmd.name + ": " + newValue);
|
|
32633
|
+
}
|
|
32634
|
+
else if (ts.hasProperty(ts.defaultInitCompilerOptions, cmd.name)) {
|
|
32635
|
+
result.push("" + tab + cmd.name + ": " + defaultValue);
|
|
32636
|
+
}
|
|
32637
|
+
});
|
|
32638
|
+
return result.join(newLine) + newLine;
|
|
32639
|
+
}
|
|
32640
|
+
}
|
|
32641
|
+
ts.getCompilerOptionsDiffValue = getCompilerOptionsDiffValue;
|
|
32642
|
+
function getSerializedCompilerOption(options) {
|
|
32551
32643
|
var compilerOptions = ts.extend(options, ts.defaultInitCompilerOptions);
|
|
32552
|
-
|
|
32644
|
+
return serializeCompilerOptions(compilerOptions);
|
|
32645
|
+
}
|
|
32646
|
+
function generateTSConfig(options, fileNames, newLine) {
|
|
32647
|
+
var compilerOptionsMap = getSerializedCompilerOption(options);
|
|
32553
32648
|
return writeConfigurations();
|
|
32554
|
-
function getDefaultValueForOption(option) {
|
|
32555
|
-
switch (option.type) {
|
|
32556
|
-
case "number":
|
|
32557
|
-
return 1;
|
|
32558
|
-
case "boolean":
|
|
32559
|
-
return true;
|
|
32560
|
-
case "string":
|
|
32561
|
-
return option.isFilePath ? "./" : "";
|
|
32562
|
-
case "list":
|
|
32563
|
-
return [];
|
|
32564
|
-
case "object":
|
|
32565
|
-
return {};
|
|
32566
|
-
default:
|
|
32567
|
-
var iterResult = option.type.keys().next();
|
|
32568
|
-
if (!iterResult.done)
|
|
32569
|
-
return iterResult.value;
|
|
32570
|
-
return ts.Debug.fail("Expected 'option.type' to have entries.");
|
|
32571
|
-
}
|
|
32572
|
-
}
|
|
32573
32649
|
function makePadding(paddingLength) {
|
|
32574
32650
|
return Array(paddingLength + 1).join(" ");
|
|
32575
32651
|
}
|
|
@@ -33397,6 +33473,25 @@ var ts;
|
|
|
33397
33473
|
});
|
|
33398
33474
|
}
|
|
33399
33475
|
}
|
|
33476
|
+
function getDefaultValueForOption(option) {
|
|
33477
|
+
switch (option.type) {
|
|
33478
|
+
case "number":
|
|
33479
|
+
return 1;
|
|
33480
|
+
case "boolean":
|
|
33481
|
+
return true;
|
|
33482
|
+
case "string":
|
|
33483
|
+
return option.isFilePath ? "./" : "";
|
|
33484
|
+
case "list":
|
|
33485
|
+
return [];
|
|
33486
|
+
case "object":
|
|
33487
|
+
return {};
|
|
33488
|
+
default:
|
|
33489
|
+
var iterResult = option.type.keys().next();
|
|
33490
|
+
if (!iterResult.done)
|
|
33491
|
+
return iterResult.value;
|
|
33492
|
+
return ts.Debug.fail("Expected 'option.type' to have entries.");
|
|
33493
|
+
}
|
|
33494
|
+
}
|
|
33400
33495
|
})(ts || (ts = {}));
|
|
33401
33496
|
var ts;
|
|
33402
33497
|
(function (ts) {
|
|
@@ -34210,7 +34305,15 @@ var ts;
|
|
|
34210
34305
|
var _a, _b;
|
|
34211
34306
|
var traceEnabled = isTraceEnabled(compilerOptions, host);
|
|
34212
34307
|
var failedLookupLocations = [];
|
|
34213
|
-
var state = {
|
|
34308
|
+
var state = {
|
|
34309
|
+
compilerOptions: compilerOptions,
|
|
34310
|
+
host: host,
|
|
34311
|
+
traceEnabled: traceEnabled,
|
|
34312
|
+
failedLookupLocations: failedLookupLocations,
|
|
34313
|
+
packageJsonInfoCache: cache,
|
|
34314
|
+
features: features,
|
|
34315
|
+
conditions: features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"]
|
|
34316
|
+
};
|
|
34214
34317
|
var result = ts.forEach(extensions, function (ext) { return tryResolve(ext); });
|
|
34215
34318
|
return createResolvedModuleWithFailedLookupLocations((_a = result === null || result === void 0 ? void 0 : result.value) === null || _a === void 0 ? void 0 : _a.resolved, (_b = result === null || result === void 0 ? void 0 : result.value) === null || _b === void 0 ? void 0 : _b.isExternalLibraryImport, failedLookupLocations, state.resultFromCache);
|
|
34216
34319
|
function tryResolve(extensions) {
|
|
@@ -38374,6 +38477,7 @@ var ts;
|
|
|
38374
38477
|
getLocalTypeParametersOfClassOrInterfaceOrTypeAlias: getLocalTypeParametersOfClassOrInterfaceOrTypeAlias,
|
|
38375
38478
|
isDeclarationVisible: isDeclarationVisible,
|
|
38376
38479
|
isPropertyAccessible: isPropertyAccessible,
|
|
38480
|
+
getTypeOnlyAliasDeclaration: getTypeOnlyAliasDeclaration,
|
|
38377
38481
|
};
|
|
38378
38482
|
function getResolvedSignatureWorker(nodeIn, candidatesOutArray, argumentCount, checkMode) {
|
|
38379
38483
|
var node = ts.getParseTreeNode(nodeIn, ts.isCallLikeExpression);
|
|
@@ -38398,10 +38502,13 @@ var ts;
|
|
|
38398
38502
|
var undefinedProperties = new ts.Map();
|
|
38399
38503
|
var unknownSymbol = createSymbol(4, "unknown");
|
|
38400
38504
|
var resolvingSymbol = createSymbol(0, "__resolving__");
|
|
38505
|
+
var unresolvedSymbols = new ts.Map();
|
|
38506
|
+
var errorTypes = new ts.Map();
|
|
38401
38507
|
var anyType = createIntrinsicType(1, "any");
|
|
38402
38508
|
var autoType = createIntrinsicType(1, "any");
|
|
38403
38509
|
var wildcardType = createIntrinsicType(1, "any");
|
|
38404
38510
|
var errorType = createIntrinsicType(1, "error");
|
|
38511
|
+
var unresolvedType = createIntrinsicType(1, "unresolved");
|
|
38405
38512
|
var nonInferrableAnyType = createIntrinsicType(1, "any", 131072);
|
|
38406
38513
|
var intrinsicMarkerType = createIntrinsicType(1, "intrinsic");
|
|
38407
38514
|
var unknownType = createIntrinsicType(2, "unknown");
|
|
@@ -38629,17 +38736,9 @@ var ts;
|
|
|
38629
38736
|
}
|
|
38630
38737
|
}
|
|
38631
38738
|
else {
|
|
38632
|
-
|
|
38633
|
-
|
|
38634
|
-
|
|
38635
|
-
var jsxPragma = file.pragmas.get("jsx");
|
|
38636
|
-
if (jsxPragma) {
|
|
38637
|
-
var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
|
|
38638
|
-
file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
|
|
38639
|
-
ts.visitNode(file.localJsxFactory, markAsSynthetic);
|
|
38640
|
-
if (file.localJsxFactory) {
|
|
38641
|
-
return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
|
|
38642
|
-
}
|
|
38739
|
+
var localJsxNamespace = getLocalJsxNamespace(file);
|
|
38740
|
+
if (localJsxNamespace) {
|
|
38741
|
+
return file.localJsxNamespace = localJsxNamespace;
|
|
38643
38742
|
}
|
|
38644
38743
|
}
|
|
38645
38744
|
}
|
|
@@ -38661,11 +38760,25 @@ var ts;
|
|
|
38661
38760
|
_jsxFactoryEntity = ts.factory.createQualifiedName(ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(_jsxNamespace)), "createElement");
|
|
38662
38761
|
}
|
|
38663
38762
|
return _jsxNamespace;
|
|
38664
|
-
|
|
38665
|
-
|
|
38666
|
-
|
|
38763
|
+
}
|
|
38764
|
+
function getLocalJsxNamespace(file) {
|
|
38765
|
+
if (file.localJsxNamespace) {
|
|
38766
|
+
return file.localJsxNamespace;
|
|
38767
|
+
}
|
|
38768
|
+
var jsxPragma = file.pragmas.get("jsx");
|
|
38769
|
+
if (jsxPragma) {
|
|
38770
|
+
var chosenPragma = ts.isArray(jsxPragma) ? jsxPragma[0] : jsxPragma;
|
|
38771
|
+
file.localJsxFactory = ts.parseIsolatedEntityName(chosenPragma.arguments.factory, languageVersion);
|
|
38772
|
+
ts.visitNode(file.localJsxFactory, markAsSynthetic);
|
|
38773
|
+
if (file.localJsxFactory) {
|
|
38774
|
+
return file.localJsxNamespace = ts.getFirstIdentifier(file.localJsxFactory).escapedText;
|
|
38775
|
+
}
|
|
38667
38776
|
}
|
|
38668
38777
|
}
|
|
38778
|
+
function markAsSynthetic(node) {
|
|
38779
|
+
ts.setTextRangePosEnd(node, -1, -1);
|
|
38780
|
+
return ts.visitEachChild(node, markAsSynthetic, ts.nullTransformationContext);
|
|
38781
|
+
}
|
|
38669
38782
|
function getEmitResolver(sourceFile, cancellationToken) {
|
|
38670
38783
|
getDiagnostics(sourceFile, cancellationToken);
|
|
38671
38784
|
return emitResolver;
|
|
@@ -39550,8 +39663,7 @@ var ts;
|
|
|
39550
39663
|
if (!ts.isValidTypeOnlyAliasUseSite(useSite)) {
|
|
39551
39664
|
var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(symbol);
|
|
39552
39665
|
if (typeOnlyDeclaration) {
|
|
39553
|
-
var
|
|
39554
|
-
var message = isExport
|
|
39666
|
+
var message = typeOnlyDeclaration.kind === 274
|
|
39555
39667
|
? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
|
|
39556
39668
|
: ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
|
|
39557
39669
|
var unescapedName = ts.unescapeLeadingUnderscores(name);
|
|
@@ -39562,7 +39674,7 @@ var ts;
|
|
|
39562
39674
|
function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) {
|
|
39563
39675
|
if (!typeOnlyDeclaration)
|
|
39564
39676
|
return diagnostic;
|
|
39565
|
-
return ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(typeOnlyDeclaration,
|
|
39677
|
+
return ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(typeOnlyDeclaration, typeOnlyDeclaration.kind === 274 ? ts.Diagnostics._0_was_exported_here : ts.Diagnostics._0_was_imported_here, unescapedName));
|
|
39566
39678
|
}
|
|
39567
39679
|
function getIsDeferredContext(location, lastLocation) {
|
|
39568
39680
|
if (location.kind !== 213 && location.kind !== 212) {
|
|
@@ -39855,7 +39967,7 @@ var ts;
|
|
|
39855
39967
|
function checkAndReportErrorForResolvingImportAliasToTypeOnlySymbol(node, resolved) {
|
|
39856
39968
|
if (markSymbolOfAliasDeclarationIfTypeOnly(node, undefined, resolved, false) && !node.isTypeOnly) {
|
|
39857
39969
|
var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(getSymbolOfNode(node));
|
|
39858
|
-
var isExport =
|
|
39970
|
+
var isExport = typeOnlyDeclaration.kind === 274;
|
|
39859
39971
|
var message = isExport
|
|
39860
39972
|
? ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_exported_using_export_type
|
|
39861
39973
|
: ts.Diagnostics.An_import_alias_cannot_reference_a_declaration_that_was_imported_using_import_type;
|
|
@@ -39876,7 +39988,20 @@ var ts;
|
|
|
39876
39988
|
function isSyntacticDefault(node) {
|
|
39877
39989
|
return ((ts.isExportAssignment(node) && !node.isExportEquals) || ts.hasSyntacticModifier(node, 512) || ts.isExportSpecifier(node));
|
|
39878
39990
|
}
|
|
39879
|
-
function
|
|
39991
|
+
function getUsageModeForExpression(usage) {
|
|
39992
|
+
return ts.isStringLiteralLike(usage) ? ts.getModeForUsageLocation(ts.getSourceFileOfNode(usage), usage) : undefined;
|
|
39993
|
+
}
|
|
39994
|
+
function isESMFormatImportImportingCommonjsFormatFile(usageMode, targetMode) {
|
|
39995
|
+
return usageMode === ts.ModuleKind.ESNext && targetMode === ts.ModuleKind.CommonJS;
|
|
39996
|
+
}
|
|
39997
|
+
function canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, usage) {
|
|
39998
|
+
var usageMode = file && getUsageModeForExpression(usage);
|
|
39999
|
+
if (file && usageMode !== undefined) {
|
|
40000
|
+
var result = isESMFormatImportImportingCommonjsFormatFile(usageMode, file.impliedNodeFormat);
|
|
40001
|
+
if (usageMode === ts.ModuleKind.ESNext || result) {
|
|
40002
|
+
return result;
|
|
40003
|
+
}
|
|
40004
|
+
}
|
|
39880
40005
|
if (!allowSyntheticDefaultImports) {
|
|
39881
40006
|
return false;
|
|
39882
40007
|
}
|
|
@@ -39907,7 +40032,7 @@ var ts;
|
|
|
39907
40032
|
exportDefaultSymbol = resolveExportByName(moduleSymbol, "default", node, dontResolveAlias);
|
|
39908
40033
|
}
|
|
39909
40034
|
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
39910
|
-
var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias);
|
|
40035
|
+
var hasSyntheticDefault = canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, node.parent.moduleSpecifier);
|
|
39911
40036
|
if (!exportDefaultSymbol && !hasSyntheticDefault) {
|
|
39912
40037
|
if (hasExportAssignmentSymbol(moduleSymbol)) {
|
|
39913
40038
|
var compilerOptionName = moduleKind >= ts.ModuleKind.ES2015 ? "allowSyntheticDefaultImports" : "esModuleInterop";
|
|
@@ -40026,7 +40151,7 @@ var ts;
|
|
|
40026
40151
|
var symbolFromModule = getExportOfModule(targetSymbol, name, specifier, dontResolveAlias);
|
|
40027
40152
|
if (symbolFromModule === undefined && name.escapedText === "default") {
|
|
40028
40153
|
var file = (_a = moduleSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
40029
|
-
if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias)) {
|
|
40154
|
+
if (canHaveSyntheticDefault(file, moduleSymbol, dontResolveAlias, moduleSpecifier)) {
|
|
40030
40155
|
symbolFromModule = resolveExternalModuleSymbol(moduleSymbol, dontResolveAlias) || resolveSymbol(moduleSymbol, dontResolveAlias);
|
|
40031
40156
|
}
|
|
40032
40157
|
}
|
|
@@ -40487,10 +40612,10 @@ var ts;
|
|
|
40487
40612
|
var currentSourceFile = ts.getSourceFileOfNode(location);
|
|
40488
40613
|
var contextSpecifier = ts.isStringLiteralLike(location)
|
|
40489
40614
|
? location
|
|
40490
|
-
: ((_a =
|
|
40491
|
-
((_b =
|
|
40492
|
-
((_c =
|
|
40493
|
-
((_d =
|
|
40615
|
+
: ((_a = ts.findAncestor(location, ts.isImportCall)) === null || _a === void 0 ? void 0 : _a.arguments[0]) ||
|
|
40616
|
+
((_b = ts.findAncestor(location, ts.isImportDeclaration)) === null || _b === void 0 ? void 0 : _b.moduleSpecifier) ||
|
|
40617
|
+
((_c = ts.findAncestor(location, ts.isExternalModuleImportEqualsDeclaration)) === null || _c === void 0 ? void 0 : _c.moduleReference.expression) ||
|
|
40618
|
+
((_d = ts.findAncestor(location, ts.isExportDeclaration)) === null || _d === void 0 ? void 0 : _d.moduleSpecifier) ||
|
|
40494
40619
|
((_e = (ts.isModuleDeclaration(location) ? location : location.parent && ts.isModuleDeclaration(location.parent) && location.parent.name === location ? location.parent : undefined)) === null || _e === void 0 ? void 0 : _e.name) ||
|
|
40495
40620
|
((_f = (ts.isLiteralImportTypeNode(location) ? location : undefined)) === null || _f === void 0 ? void 0 : _f.argument.literal);
|
|
40496
40621
|
var resolvedModule = ts.getResolvedModule(currentSourceFile, moduleReference, contextSpecifier && ts.isStringLiteralLike(contextSpecifier) ? ts.getModeForUsageLocation(currentSourceFile, contextSpecifier) : undefined);
|
|
@@ -40504,7 +40629,7 @@ var ts;
|
|
|
40504
40629
|
if (ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(compilerOptions) === ts.ModuleResolutionKind.NodeNext) {
|
|
40505
40630
|
var isSyncImport = (currentSourceFile.impliedNodeFormat === ts.ModuleKind.CommonJS && !ts.findAncestor(location, ts.isImportCall)) || !!ts.findAncestor(location, ts.isImportEqualsDeclaration);
|
|
40506
40631
|
if (isSyncImport && sourceFile.impliedNodeFormat === ts.ModuleKind.ESNext) {
|
|
40507
|
-
error(errorNode, ts.Diagnostics.
|
|
40632
|
+
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);
|
|
40508
40633
|
}
|
|
40509
40634
|
}
|
|
40510
40635
|
return getMergedSymbol(sourceFile.symbol);
|
|
@@ -40635,7 +40760,7 @@ var ts;
|
|
|
40635
40760
|
sigs = getSignaturesOfStructuredType(type, 1);
|
|
40636
40761
|
}
|
|
40637
40762
|
if (sigs && sigs.length) {
|
|
40638
|
-
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol);
|
|
40763
|
+
var moduleType = getTypeWithSyntheticDefaultImportType(type, symbol, moduleSymbol, ts.isImportCall(referenceParent) ? referenceParent.arguments[0] : referenceParent.moduleSpecifier);
|
|
40639
40764
|
var result = createSymbol(symbol.flags, symbol.escapedName);
|
|
40640
40765
|
result.declarations = symbol.declarations ? symbol.declarations.slice() : [];
|
|
40641
40766
|
result.parent = symbol.parent;
|
|
@@ -41395,7 +41520,7 @@ var ts;
|
|
|
41395
41520
|
var typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | 70221824 | (noTruncation ? 1 : 0), writer);
|
|
41396
41521
|
if (typeNode === undefined)
|
|
41397
41522
|
return ts.Debug.fail("should always get typenode");
|
|
41398
|
-
var options = { removeComments:
|
|
41523
|
+
var options = { removeComments: type !== unresolvedType };
|
|
41399
41524
|
var printer = ts.createPrinter(options);
|
|
41400
41525
|
var sourceFile = enclosingDeclaration && ts.getSourceFileOfNode(enclosingDeclaration);
|
|
41401
41526
|
printer.writeNode(4, typeNode, sourceFile, writer);
|
|
@@ -41540,6 +41665,12 @@ var ts;
|
|
|
41540
41665
|
type = getReducedType(type);
|
|
41541
41666
|
}
|
|
41542
41667
|
if (type.flags & 1) {
|
|
41668
|
+
if (type.aliasSymbol) {
|
|
41669
|
+
return ts.factory.createTypeReferenceNode(symbolToEntityNameNode(type.aliasSymbol), mapToTypeNodes(type.aliasTypeArguments, context));
|
|
41670
|
+
}
|
|
41671
|
+
if (type === unresolvedType) {
|
|
41672
|
+
return ts.addSyntheticLeadingComment(ts.factory.createKeywordTypeNode(130), 3, "unresolved");
|
|
41673
|
+
}
|
|
41543
41674
|
context.approximateLength += 3;
|
|
41544
41675
|
return ts.factory.createKeywordTypeNode(type === intrinsicMarkerType ? 138 : 130);
|
|
41545
41676
|
}
|
|
@@ -42555,6 +42686,10 @@ var ts;
|
|
|
42555
42686
|
}
|
|
42556
42687
|
return specifier;
|
|
42557
42688
|
}
|
|
42689
|
+
function symbolToEntityNameNode(symbol) {
|
|
42690
|
+
var identifier = ts.factory.createIdentifier(ts.unescapeLeadingUnderscores(symbol.escapedName));
|
|
42691
|
+
return symbol.parent ? ts.factory.createQualifiedName(symbolToEntityNameNode(symbol.parent), identifier) : identifier;
|
|
42692
|
+
}
|
|
42558
42693
|
function symbolToTypeNode(symbol, context, meaning, overrideTypeArguments) {
|
|
42559
42694
|
var chain = lookupSymbolChain(symbol, context, meaning, !(context.flags & 16384));
|
|
42560
42695
|
var isTypeOf = meaning === 111551;
|
|
@@ -42818,7 +42953,7 @@ var ts;
|
|
|
42818
42953
|
return !(ts.getObjectFlags(type) & 4) || !ts.isTypeReferenceNode(existing) || ts.length(existing.typeArguments) >= getMinTypeArgumentCount(type.target.typeParameters);
|
|
42819
42954
|
}
|
|
42820
42955
|
function serializeTypeForDeclaration(context, type, symbol, enclosingDeclaration, includePrivateSymbol, bundled) {
|
|
42821
|
-
if (type
|
|
42956
|
+
if (!isErrorType(type) && enclosingDeclaration) {
|
|
42822
42957
|
var declWithExistingAnnotation = getDeclarationWithTypeAnnotation(symbol, enclosingDeclaration);
|
|
42823
42958
|
if (declWithExistingAnnotation && !ts.isFunctionLikeDeclaration(declWithExistingAnnotation) && !ts.isGetAccessorDeclaration(declWithExistingAnnotation)) {
|
|
42824
42959
|
var existing = ts.getEffectiveTypeAnnotationNode(declWithExistingAnnotation);
|
|
@@ -42840,7 +42975,7 @@ var ts;
|
|
|
42840
42975
|
return result;
|
|
42841
42976
|
}
|
|
42842
42977
|
function serializeReturnTypeForSignature(context, type, signature, includePrivateSymbol, bundled) {
|
|
42843
|
-
if (type
|
|
42978
|
+
if (!isErrorType(type) && context.enclosingDeclaration) {
|
|
42844
42979
|
var annotation = signature.declaration && ts.getEffectiveReturnTypeNode(signature.declaration);
|
|
42845
42980
|
if (!!ts.findAncestor(annotation, function (n) { return n === context.enclosingDeclaration; }) && annotation) {
|
|
42846
42981
|
var annotated = getTypeFromTypeNode(annotation);
|
|
@@ -42933,7 +43068,7 @@ var ts;
|
|
|
42933
43068
|
return ts.factory.createFunctionTypeNode(ts.visitNodes(node.typeParameters, visitExistingNodeTreeSymbols), ts.map(node.parameters, function (p, i) { return ts.factory.createParameterDeclaration(undefined, undefined, getEffectiveDotDotDotForParameter(p), getNameForJSDocFunctionParameter(p, i), p.questionToken, ts.visitNode(p.type, visitExistingNodeTreeSymbols), undefined); }), ts.visitNode(node.type, visitExistingNodeTreeSymbols) || ts.factory.createKeywordTypeNode(130));
|
|
42934
43069
|
}
|
|
42935
43070
|
}
|
|
42936
|
-
if (ts.isTypeReferenceNode(node) && ts.isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(
|
|
43071
|
+
if (ts.isTypeReferenceNode(node) && ts.isInJSDoc(node) && (!existingTypeNodeIsNotReferenceOrIsReferenceWithCompatibleTypeArgumentCount(node, getTypeFromTypeNode(node)) || getIntendedTypeFromJSDocTypeReference(node) || unknownSymbol === resolveTypeReferenceName(node, 788968, true))) {
|
|
42937
43072
|
return ts.setOriginalNode(typeToTypeNodeHelper(getTypeFromTypeNode(node), context), node);
|
|
42938
43073
|
}
|
|
42939
43074
|
if (ts.isLiteralImportTypeNode(node)) {
|
|
@@ -43047,7 +43182,7 @@ var ts;
|
|
|
43047
43182
|
var name_2 = ns.name;
|
|
43048
43183
|
var body = ns.body;
|
|
43049
43184
|
if (ts.length(excessExports)) {
|
|
43050
|
-
ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements, true), [ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(undefined, id); })), undefined)], false))));
|
|
43185
|
+
ns = ts.factory.updateModuleDeclaration(ns, ns.decorators, ns.modifiers, ns.name, body = ts.factory.updateModuleBlock(body, ts.factory.createNodeArray(__spreadArray(__spreadArray([], ns.body.statements, true), [ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports(ts.map(ts.flatMap(excessExports, function (e) { return getNamesOfDeclaration(e); }), function (id) { return ts.factory.createExportSpecifier(false, undefined, id); })), undefined)], false))));
|
|
43051
43186
|
statements = __spreadArray(__spreadArray(__spreadArray([], statements.slice(0, nsIndex), true), [ns], false), statements.slice(nsIndex + 1), true);
|
|
43052
43187
|
}
|
|
43053
43188
|
if (!ts.find(statements, function (s) { return s !== ns && ts.nodeHasName(s, name_2); })) {
|
|
@@ -43229,7 +43364,7 @@ var ts;
|
|
|
43229
43364
|
if (propertyAccessRequire && ts.isBinaryExpression(propertyAccessRequire.parent) && ts.isIdentifier(propertyAccessRequire.parent.right)
|
|
43230
43365
|
&& ((_b = type.symbol) === null || _b === void 0 ? void 0 : _b.valueDeclaration) && ts.isSourceFile(type.symbol.valueDeclaration)) {
|
|
43231
43366
|
var alias = localName === propertyAccessRequire.parent.right.escapedText ? undefined : propertyAccessRequire.parent.right;
|
|
43232
|
-
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(alias, localName)])), 0);
|
|
43367
|
+
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, alias, localName)])), 0);
|
|
43233
43368
|
context.tracker.trackSymbol(type.symbol, context.enclosingDeclaration, 111551);
|
|
43234
43369
|
}
|
|
43235
43370
|
else {
|
|
@@ -43238,7 +43373,7 @@ var ts;
|
|
|
43238
43373
|
], flags)), textRange);
|
|
43239
43374
|
addResult(statement, name !== localName ? modifierFlags & ~1 : modifierFlags);
|
|
43240
43375
|
if (name !== localName && !isPrivate) {
|
|
43241
|
-
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(name, localName)])), 0);
|
|
43376
|
+
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, name, localName)])), 0);
|
|
43242
43377
|
needsExportDeclaration = false;
|
|
43243
43378
|
needsPostExportDefault = false;
|
|
43244
43379
|
}
|
|
@@ -43287,7 +43422,7 @@ var ts;
|
|
|
43287
43422
|
addResult(ts.factory.createExportAssignment(undefined, undefined, false, ts.factory.createIdentifier(getInternalSymbolName(symbol, symbolName))), 0);
|
|
43288
43423
|
}
|
|
43289
43424
|
else if (needsExportDeclaration) {
|
|
43290
|
-
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(getInternalSymbolName(symbol, symbolName), symbolName)])), 0);
|
|
43425
|
+
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, getInternalSymbolName(symbol, symbolName), symbolName)])), 0);
|
|
43291
43426
|
}
|
|
43292
43427
|
}
|
|
43293
43428
|
function includePrivateSymbol(symbol) {
|
|
@@ -43392,7 +43527,7 @@ var ts;
|
|
|
43392
43527
|
var target = aliasDecl && getTargetOfAliasDeclaration(aliasDecl, true);
|
|
43393
43528
|
includePrivateSymbol(target || s);
|
|
43394
43529
|
var targetName = target ? getInternalSymbolName(target, ts.unescapeLeadingUnderscores(target.escapedName)) : localName;
|
|
43395
|
-
return ts.factory.createExportSpecifier(name === targetName ? undefined : targetName, name);
|
|
43530
|
+
return ts.factory.createExportSpecifier(false, name === targetName ? undefined : targetName, name);
|
|
43396
43531
|
})))]);
|
|
43397
43532
|
addResult(ts.factory.createModuleDeclaration(undefined, undefined, ts.factory.createIdentifier(localName), nsBody, 16), 0);
|
|
43398
43533
|
}
|
|
@@ -43452,7 +43587,7 @@ var ts;
|
|
|
43452
43587
|
addingDeclare = oldAddingDeclare;
|
|
43453
43588
|
var declarations = results;
|
|
43454
43589
|
results = oldResults;
|
|
43455
|
-
var defaultReplaced = ts.map(declarations, function (d) { return ts.isExportAssignment(d) && !d.isExportEquals && ts.isIdentifier(d.expression) ? ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(d.expression, ts.factory.createIdentifier("default"))])) : d; });
|
|
43590
|
+
var defaultReplaced = ts.map(declarations, function (d) { return ts.isExportAssignment(d) && !d.isExportEquals && ts.isIdentifier(d.expression) ? ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, d.expression, ts.factory.createIdentifier("default"))])) : d; });
|
|
43456
43591
|
var exportModifierStripped = ts.every(defaultReplaced, function (d) { return ts.hasSyntacticModifier(d, 1); }) ? ts.map(defaultReplaced, removeExportModifier) : defaultReplaced;
|
|
43457
43592
|
fakespace = ts.factory.updateModuleDeclaration(fakespace, fakespace.decorators, fakespace.modifiers, fakespace.name, ts.factory.createModuleBlock(exportModifierStripped));
|
|
43458
43593
|
addResult(fakespace, modifierFlags);
|
|
@@ -43575,7 +43710,7 @@ var ts;
|
|
|
43575
43710
|
if (((_b = (_a = node.parent) === null || _a === void 0 ? void 0 : _a.parent) === null || _b === void 0 ? void 0 : _b.kind) === 253) {
|
|
43576
43711
|
var specifier_1 = getSpecifierForModuleSymbol(target.parent || target, context);
|
|
43577
43712
|
var propertyName = node.propertyName;
|
|
43578
|
-
addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1), undefined), 0);
|
|
43713
|
+
addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([ts.factory.createImportSpecifier(false, propertyName && ts.isIdentifier(propertyName) ? ts.factory.createIdentifier(ts.idText(propertyName)) : undefined, ts.factory.createIdentifier(localName))])), ts.factory.createStringLiteral(specifier_1), undefined), 0);
|
|
43579
43714
|
break;
|
|
43580
43715
|
}
|
|
43581
43716
|
ts.Debug.failBadSyntaxKind(((_c = node.parent) === null || _c === void 0 ? void 0 : _c.parent) || node, "Unhandled binding element grandparent kind in declaration serialization");
|
|
@@ -43618,7 +43753,7 @@ var ts;
|
|
|
43618
43753
|
break;
|
|
43619
43754
|
case 269:
|
|
43620
43755
|
addResult(ts.factory.createImportDeclaration(undefined, undefined, ts.factory.createImportClause(false, undefined, ts.factory.createNamedImports([
|
|
43621
|
-
ts.factory.createImportSpecifier(localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))
|
|
43756
|
+
ts.factory.createImportSpecifier(false, localName !== verbatimTargetName ? ts.factory.createIdentifier(verbatimTargetName) : undefined, ts.factory.createIdentifier(localName))
|
|
43622
43757
|
])), ts.factory.createStringLiteral(getSpecifierForModuleSymbol(target.parent || target, context)), undefined), 0);
|
|
43623
43758
|
break;
|
|
43624
43759
|
case 274:
|
|
@@ -43643,7 +43778,7 @@ var ts;
|
|
|
43643
43778
|
}
|
|
43644
43779
|
}
|
|
43645
43780
|
function serializeExportSpecifier(localName, targetName, specifier) {
|
|
43646
|
-
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(localName !== targetName ? targetName : undefined, localName)]), specifier), 0);
|
|
43781
|
+
addResult(ts.factory.createExportDeclaration(undefined, undefined, false, ts.factory.createNamedExports([ts.factory.createExportSpecifier(false, localName !== targetName ? targetName : undefined, localName)]), specifier), 0);
|
|
43647
43782
|
}
|
|
43648
43783
|
function serializeMaybeAliasAssignment(symbol) {
|
|
43649
43784
|
if (symbol.flags & 4194304) {
|
|
@@ -44248,6 +44383,9 @@ var ts;
|
|
|
44248
44383
|
function isTypeAny(type) {
|
|
44249
44384
|
return type && (type.flags & 1) !== 0;
|
|
44250
44385
|
}
|
|
44386
|
+
function isErrorType(type) {
|
|
44387
|
+
return type === errorType || !!(type.flags & 1 && type.aliasSymbol);
|
|
44388
|
+
}
|
|
44251
44389
|
function getTypeForBindingElementParent(node) {
|
|
44252
44390
|
var symbol = getSymbolOfNode(node);
|
|
44253
44391
|
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
|
|
@@ -44704,7 +44842,7 @@ var ts;
|
|
|
44704
44842
|
if (!declaredType) {
|
|
44705
44843
|
return type;
|
|
44706
44844
|
}
|
|
44707
|
-
else if (declaredType
|
|
44845
|
+
else if (!isErrorType(declaredType) && !isErrorType(type) && !isTypeIdenticalTo(declaredType, type)) {
|
|
44708
44846
|
errorNextVariableOrPropertyDeclarationMustHaveSameType(undefined, declaredType, declaration, type);
|
|
44709
44847
|
}
|
|
44710
44848
|
}
|
|
@@ -45497,7 +45635,7 @@ var ts;
|
|
|
45497
45635
|
for (var _b = 0, implementsTypeNodes_1 = implementsTypeNodes; _b < implementsTypeNodes_1.length; _b++) {
|
|
45498
45636
|
var node = implementsTypeNodes_1[_b];
|
|
45499
45637
|
var implementsType = getTypeFromTypeNode(node);
|
|
45500
|
-
if (implementsType
|
|
45638
|
+
if (!isErrorType(implementsType)) {
|
|
45501
45639
|
if (resolvedImplementsTypes === ts.emptyArray) {
|
|
45502
45640
|
resolvedImplementsTypes = [implementsType];
|
|
45503
45641
|
}
|
|
@@ -45571,7 +45709,7 @@ var ts;
|
|
|
45571
45709
|
}
|
|
45572
45710
|
baseType = getReturnTypeOfSignature(constructors[0]);
|
|
45573
45711
|
}
|
|
45574
|
-
if (baseType
|
|
45712
|
+
if (isErrorType(baseType)) {
|
|
45575
45713
|
return type.resolvedBaseTypes = ts.emptyArray;
|
|
45576
45714
|
}
|
|
45577
45715
|
var reducedBaseType = getReducedType(baseType);
|
|
@@ -45618,7 +45756,7 @@ var ts;
|
|
|
45618
45756
|
for (var _b = 0, _c = ts.getInterfaceBaseTypeNodes(declaration); _b < _c.length; _b++) {
|
|
45619
45757
|
var node = _c[_b];
|
|
45620
45758
|
var baseType = getReducedType(getTypeFromTypeNode(node));
|
|
45621
|
-
if (baseType
|
|
45759
|
+
if (!isErrorType(baseType)) {
|
|
45622
45760
|
if (isValidBaseType(baseType)) {
|
|
45623
45761
|
if (type !== baseType && !hasBaseType(baseType, type)) {
|
|
45624
45762
|
if (type.resolvedBaseTypes === ts.emptyArray) {
|
|
@@ -46666,6 +46804,23 @@ var ts;
|
|
|
46666
46804
|
function getIsLateCheckFlag(s) {
|
|
46667
46805
|
return ts.getCheckFlags(s) & 4096;
|
|
46668
46806
|
}
|
|
46807
|
+
function forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(type, include, stringsOnly, cb) {
|
|
46808
|
+
for (var _i = 0, _a = getPropertiesOfType(type); _i < _a.length; _i++) {
|
|
46809
|
+
var prop = _a[_i];
|
|
46810
|
+
cb(getLiteralTypeFromProperty(prop, include));
|
|
46811
|
+
}
|
|
46812
|
+
if (type.flags & 1) {
|
|
46813
|
+
cb(stringType);
|
|
46814
|
+
}
|
|
46815
|
+
else {
|
|
46816
|
+
for (var _b = 0, _c = getIndexInfosOfType(type); _b < _c.length; _b++) {
|
|
46817
|
+
var info = _c[_b];
|
|
46818
|
+
if (!stringsOnly || info.keyType.flags & (4 | 134217728)) {
|
|
46819
|
+
cb(info.keyType);
|
|
46820
|
+
}
|
|
46821
|
+
}
|
|
46822
|
+
}
|
|
46823
|
+
}
|
|
46669
46824
|
function resolveMappedTypeMembers(type) {
|
|
46670
46825
|
var members = ts.createSymbolTable();
|
|
46671
46826
|
var indexInfos;
|
|
@@ -46678,21 +46833,7 @@ var ts;
|
|
|
46678
46833
|
var templateModifiers = getMappedTypeModifiers(type);
|
|
46679
46834
|
var include = keyofStringsOnly ? 128 : 8576;
|
|
46680
46835
|
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
46681
|
-
|
|
46682
|
-
var prop = _a[_i];
|
|
46683
|
-
addMemberForKeyType(getLiteralTypeFromProperty(prop, include));
|
|
46684
|
-
}
|
|
46685
|
-
if (modifiersType.flags & 1) {
|
|
46686
|
-
addMemberForKeyType(stringType);
|
|
46687
|
-
}
|
|
46688
|
-
else {
|
|
46689
|
-
for (var _b = 0, _c = getIndexInfosOfType(modifiersType); _b < _c.length; _b++) {
|
|
46690
|
-
var info = _c[_b];
|
|
46691
|
-
if (!keyofStringsOnly || info.keyType.flags & (4 | 134217728)) {
|
|
46692
|
-
addMemberForKeyType(info.keyType);
|
|
46693
|
-
}
|
|
46694
|
-
}
|
|
46695
|
-
}
|
|
46836
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, include, keyofStringsOnly, addMemberForKeyType);
|
|
46696
46837
|
}
|
|
46697
46838
|
else {
|
|
46698
46839
|
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
@@ -47196,7 +47337,7 @@ var ts;
|
|
|
47196
47337
|
for (var _i = 0, _c = containingType.types; _i < _c.length; _i++) {
|
|
47197
47338
|
var current = _c[_i];
|
|
47198
47339
|
var type = getApparentType(current);
|
|
47199
|
-
if (!(type
|
|
47340
|
+
if (!(isErrorType(type) || type.flags & 131072)) {
|
|
47200
47341
|
var prop = getPropertyOfType(type, name, skipObjectFunctionPropertyAugment);
|
|
47201
47342
|
var modifiers = prop ? ts.getDeclarationModifierFlagsFromSymbol(prop) : 0;
|
|
47202
47343
|
if (prop) {
|
|
@@ -47294,7 +47435,7 @@ var ts;
|
|
|
47294
47435
|
else if (type !== firstType) {
|
|
47295
47436
|
checkFlags |= 64;
|
|
47296
47437
|
}
|
|
47297
|
-
if (isLiteralType(type)) {
|
|
47438
|
+
if (isLiteralType(type) || isPatternLiteralType(type)) {
|
|
47298
47439
|
checkFlags |= 128;
|
|
47299
47440
|
}
|
|
47300
47441
|
if (type.flags & 131072) {
|
|
@@ -48031,7 +48172,7 @@ var ts;
|
|
|
48031
48172
|
}
|
|
48032
48173
|
else {
|
|
48033
48174
|
var type = getTypeFromTypeNode(constraintDeclaration);
|
|
48034
|
-
if (type.flags & 1 && type
|
|
48175
|
+
if (type.flags & 1 && !isErrorType(type)) {
|
|
48035
48176
|
type = constraintDeclaration.parent.parent.kind === 194 ? keyofConstraintType : unknownType;
|
|
48036
48177
|
}
|
|
48037
48178
|
typeParameter.constraint = type;
|
|
@@ -48185,6 +48326,18 @@ var ts;
|
|
|
48185
48326
|
return instantiation;
|
|
48186
48327
|
}
|
|
48187
48328
|
function getTypeFromTypeAliasReference(node, symbol) {
|
|
48329
|
+
if (ts.getCheckFlags(symbol) & 1048576) {
|
|
48330
|
+
var typeArguments = typeArgumentsFromTypeReferenceNode(node);
|
|
48331
|
+
var id = getAliasId(symbol, typeArguments);
|
|
48332
|
+
var errorType_1 = errorTypes.get(id);
|
|
48333
|
+
if (!errorType_1) {
|
|
48334
|
+
errorType_1 = createIntrinsicType(1, "error");
|
|
48335
|
+
errorType_1.aliasSymbol = symbol;
|
|
48336
|
+
errorType_1.aliasTypeArguments = typeArguments;
|
|
48337
|
+
errorTypes.set(id, errorType_1);
|
|
48338
|
+
}
|
|
48339
|
+
return errorType_1;
|
|
48340
|
+
}
|
|
48188
48341
|
var type = getDeclaredTypeOfSymbol(symbol);
|
|
48189
48342
|
var typeParameters = getSymbolLinks(symbol).typeParameters;
|
|
48190
48343
|
if (typeParameters) {
|
|
@@ -48219,11 +48372,37 @@ var ts;
|
|
|
48219
48372
|
}
|
|
48220
48373
|
return undefined;
|
|
48221
48374
|
}
|
|
48222
|
-
function
|
|
48223
|
-
|
|
48375
|
+
function getSymbolPath(symbol) {
|
|
48376
|
+
return symbol.parent ? getSymbolPath(symbol.parent) + "." + symbol.escapedName : symbol.escapedName;
|
|
48377
|
+
}
|
|
48378
|
+
function getUnresolvedSymbolForEntityName(name) {
|
|
48379
|
+
var identifier = name.kind === 160 ? name.right :
|
|
48380
|
+
name.kind === 205 ? name.name :
|
|
48381
|
+
name;
|
|
48382
|
+
var text = identifier.escapedText;
|
|
48383
|
+
if (text) {
|
|
48384
|
+
var parentSymbol = name.kind === 160 ? getUnresolvedSymbolForEntityName(name.left) :
|
|
48385
|
+
name.kind === 205 ? getUnresolvedSymbolForEntityName(name.expression) :
|
|
48386
|
+
undefined;
|
|
48387
|
+
var path = parentSymbol ? getSymbolPath(parentSymbol) + "." + text : text;
|
|
48388
|
+
var result = unresolvedSymbols.get(path);
|
|
48389
|
+
if (!result) {
|
|
48390
|
+
unresolvedSymbols.set(path, result = createSymbol(524288, text, 1048576));
|
|
48391
|
+
result.parent = parentSymbol;
|
|
48392
|
+
result.declaredType = unresolvedType;
|
|
48393
|
+
}
|
|
48394
|
+
return result;
|
|
48395
|
+
}
|
|
48396
|
+
return unknownSymbol;
|
|
48397
|
+
}
|
|
48398
|
+
function resolveTypeReferenceName(typeReference, meaning, ignoreErrors) {
|
|
48399
|
+
var name = getTypeReferenceName(typeReference);
|
|
48400
|
+
if (!name) {
|
|
48224
48401
|
return unknownSymbol;
|
|
48225
48402
|
}
|
|
48226
|
-
|
|
48403
|
+
var symbol = resolveEntityName(name, meaning, ignoreErrors);
|
|
48404
|
+
return symbol && symbol !== unknownSymbol ? symbol :
|
|
48405
|
+
ignoreErrors ? unknownSymbol : getUnresolvedSymbolForEntityName(name);
|
|
48227
48406
|
}
|
|
48228
48407
|
function getTypeReferenceType(node, symbol) {
|
|
48229
48408
|
if (symbol === unknownSymbol) {
|
|
@@ -48246,7 +48425,7 @@ var ts;
|
|
|
48246
48425
|
return jsdocType;
|
|
48247
48426
|
}
|
|
48248
48427
|
else {
|
|
48249
|
-
resolveTypeReferenceName(
|
|
48428
|
+
resolveTypeReferenceName(node, 788968);
|
|
48250
48429
|
return getTypeOfSymbol(symbol);
|
|
48251
48430
|
}
|
|
48252
48431
|
}
|
|
@@ -48380,18 +48559,18 @@ var ts;
|
|
|
48380
48559
|
if (isJSDocTypeReference(node)) {
|
|
48381
48560
|
type = getIntendedTypeFromJSDocTypeReference(node);
|
|
48382
48561
|
if (!type) {
|
|
48383
|
-
symbol = resolveTypeReferenceName(
|
|
48562
|
+
symbol = resolveTypeReferenceName(node, meaning, true);
|
|
48384
48563
|
if (symbol === unknownSymbol) {
|
|
48385
|
-
symbol = resolveTypeReferenceName(
|
|
48564
|
+
symbol = resolveTypeReferenceName(node, meaning | 111551);
|
|
48386
48565
|
}
|
|
48387
48566
|
else {
|
|
48388
|
-
resolveTypeReferenceName(
|
|
48567
|
+
resolveTypeReferenceName(node, meaning);
|
|
48389
48568
|
}
|
|
48390
48569
|
type = getTypeReferenceType(node, symbol);
|
|
48391
48570
|
}
|
|
48392
48571
|
}
|
|
48393
48572
|
if (!type) {
|
|
48394
|
-
symbol = resolveTypeReferenceName(
|
|
48573
|
+
symbol = resolveTypeReferenceName(node, meaning);
|
|
48395
48574
|
type = getTypeReferenceType(node, symbol);
|
|
48396
48575
|
}
|
|
48397
48576
|
links.resolvedSymbol = symbol;
|
|
@@ -48626,7 +48805,7 @@ var ts;
|
|
|
48626
48805
|
function mayResolveTypeAlias(node) {
|
|
48627
48806
|
switch (node.kind) {
|
|
48628
48807
|
case 177:
|
|
48629
|
-
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node
|
|
48808
|
+
return isJSDocTypeReference(node) || !!(resolveTypeReferenceName(node, 788968).flags & 524288);
|
|
48630
48809
|
case 180:
|
|
48631
48810
|
return true;
|
|
48632
48811
|
case 192:
|
|
@@ -48876,8 +49055,6 @@ var ts;
|
|
|
48876
49055
|
}
|
|
48877
49056
|
if (!(flags & 131072)) {
|
|
48878
49057
|
includes |= flags & 205258751;
|
|
48879
|
-
if (flags & 469499904)
|
|
48880
|
-
includes |= 262144;
|
|
48881
49058
|
if (type === wildcardType)
|
|
48882
49059
|
includes |= 8388608;
|
|
48883
49060
|
if (!strictNullChecks && flags & 98304) {
|
|
@@ -49159,11 +49336,17 @@ var ts;
|
|
|
49159
49336
|
if (type === wildcardType)
|
|
49160
49337
|
includes |= 8388608;
|
|
49161
49338
|
}
|
|
49162
|
-
else if (
|
|
49163
|
-
if (
|
|
49164
|
-
includes |=
|
|
49339
|
+
else if (strictNullChecks || !(flags & 98304)) {
|
|
49340
|
+
if (exactOptionalPropertyTypes && type === missingType) {
|
|
49341
|
+
includes |= 262144;
|
|
49342
|
+
type = undefinedType;
|
|
49343
|
+
}
|
|
49344
|
+
if (!typeSet.has(type.id.toString())) {
|
|
49345
|
+
if (type.flags & 109440 && includes & 109440) {
|
|
49346
|
+
includes |= 67108864;
|
|
49347
|
+
}
|
|
49348
|
+
typeSet.set(type.id.toString(), type);
|
|
49165
49349
|
}
|
|
49166
|
-
typeSet.set(type.id.toString(), type);
|
|
49167
49350
|
}
|
|
49168
49351
|
includes |= flags & 205258751;
|
|
49169
49352
|
}
|
|
@@ -49227,14 +49410,13 @@ var ts;
|
|
|
49227
49410
|
}
|
|
49228
49411
|
return false;
|
|
49229
49412
|
}
|
|
49230
|
-
function
|
|
49231
|
-
|
|
49232
|
-
|
|
49233
|
-
|
|
49234
|
-
|
|
49235
|
-
return
|
|
49413
|
+
function eachIsUnionContaining(types, flag) {
|
|
49414
|
+
return ts.every(types, function (t) { return !!(t.flags & 1048576) && ts.some(t.types, function (tt) { return !!(tt.flags & flag); }); });
|
|
49415
|
+
}
|
|
49416
|
+
function removeFromEach(types, flag) {
|
|
49417
|
+
for (var i = 0; i < types.length; i++) {
|
|
49418
|
+
types[i] = filterType(types[i], function (t) { return !(t.flags & flag); });
|
|
49236
49419
|
}
|
|
49237
|
-
return false;
|
|
49238
49420
|
}
|
|
49239
49421
|
function intersectUnionsOfPrimitiveTypes(types) {
|
|
49240
49422
|
var unionTypes;
|
|
@@ -49314,6 +49496,9 @@ var ts;
|
|
|
49314
49496
|
if (includes & 16777216 && includes & 524288) {
|
|
49315
49497
|
ts.orderedRemoveItemAt(typeSet, ts.findIndex(typeSet, isEmptyAnonymousObjectType));
|
|
49316
49498
|
}
|
|
49499
|
+
if (includes & 262144) {
|
|
49500
|
+
typeSet[typeSet.indexOf(undefinedType)] = missingType;
|
|
49501
|
+
}
|
|
49317
49502
|
if (typeSet.length === 0) {
|
|
49318
49503
|
return unknownType;
|
|
49319
49504
|
}
|
|
@@ -49327,10 +49512,13 @@ var ts;
|
|
|
49327
49512
|
if (intersectUnionsOfPrimitiveTypes(typeSet)) {
|
|
49328
49513
|
result = getIntersectionType(typeSet, aliasSymbol, aliasTypeArguments);
|
|
49329
49514
|
}
|
|
49330
|
-
else if (
|
|
49331
|
-
|
|
49515
|
+
else if (eachIsUnionContaining(typeSet, 32768)) {
|
|
49516
|
+
var undefinedOrMissingType = exactOptionalPropertyTypes && ts.some(typeSet, function (t) { return containsType(t.types, missingType); }) ? missingType : undefinedType;
|
|
49517
|
+
removeFromEach(typeSet, 32768);
|
|
49518
|
+
result = getUnionType([getIntersectionType(typeSet), undefinedOrMissingType], 1, aliasSymbol, aliasTypeArguments);
|
|
49332
49519
|
}
|
|
49333
|
-
else if (
|
|
49520
|
+
else if (eachIsUnionContaining(typeSet, 65536)) {
|
|
49521
|
+
removeFromEach(typeSet, 65536);
|
|
49334
49522
|
result = getUnionType([getIntersectionType(typeSet), nullType], 1, aliasSymbol, aliasTypeArguments);
|
|
49335
49523
|
}
|
|
49336
49524
|
else {
|
|
@@ -49405,16 +49593,38 @@ var ts;
|
|
|
49405
49593
|
type.resolvedStringIndexType || (type.resolvedStringIndexType = createIndexType(type, true)) :
|
|
49406
49594
|
type.resolvedIndexType || (type.resolvedIndexType = createIndexType(type, false));
|
|
49407
49595
|
}
|
|
49408
|
-
function
|
|
49409
|
-
|
|
49410
|
-
|
|
49411
|
-
|
|
49412
|
-
|
|
49413
|
-
|
|
49414
|
-
|
|
49415
|
-
|
|
49416
|
-
|
|
49417
|
-
|
|
49596
|
+
function getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) {
|
|
49597
|
+
var typeParameter = getTypeParameterFromMappedType(type);
|
|
49598
|
+
var constraintType = getConstraintTypeFromMappedType(type);
|
|
49599
|
+
var nameType = getNameTypeFromMappedType(type.target || type);
|
|
49600
|
+
if (!nameType && !noIndexSignatures) {
|
|
49601
|
+
return constraintType;
|
|
49602
|
+
}
|
|
49603
|
+
var keyTypes = [];
|
|
49604
|
+
if (isMappedTypeWithKeyofConstraintDeclaration(type)) {
|
|
49605
|
+
if (!isGenericIndexType(constraintType)) {
|
|
49606
|
+
var modifiersType = getApparentType(getModifiersTypeFromMappedType(type));
|
|
49607
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576, stringsOnly, addMemberForKeyType);
|
|
49608
|
+
}
|
|
49609
|
+
else {
|
|
49610
|
+
return getIndexTypeForGenericType(type, stringsOnly);
|
|
49611
|
+
}
|
|
49612
|
+
}
|
|
49613
|
+
else {
|
|
49614
|
+
forEachType(getLowerBoundOfKeyType(constraintType), addMemberForKeyType);
|
|
49615
|
+
}
|
|
49616
|
+
if (isGenericIndexType(constraintType)) {
|
|
49617
|
+
forEachType(constraintType, addMemberForKeyType);
|
|
49618
|
+
}
|
|
49619
|
+
var result = noIndexSignatures ? filterType(getUnionType(keyTypes), function (t) { return !(t.flags & (1 | 4)); }) : getUnionType(keyTypes);
|
|
49620
|
+
if (result.flags & 1048576 && constraintType.flags & 1048576 && getTypeListId(result.types) === getTypeListId(constraintType.types)) {
|
|
49621
|
+
return constraintType;
|
|
49622
|
+
}
|
|
49623
|
+
return result;
|
|
49624
|
+
function addMemberForKeyType(keyType) {
|
|
49625
|
+
var propNameType = nameType ? instantiateType(nameType, appendTypeMapping(type.mapper, typeParameter, keyType)) : keyType;
|
|
49626
|
+
keyTypes.push(propNameType === stringType ? stringOrNumberType : propNameType);
|
|
49627
|
+
}
|
|
49418
49628
|
}
|
|
49419
49629
|
function hasDistributiveNameType(mappedType) {
|
|
49420
49630
|
var typeVariable = getTypeParameterFromMappedType(mappedType);
|
|
@@ -49466,7 +49676,7 @@ var ts;
|
|
|
49466
49676
|
return type.flags & 1048576 ? getIntersectionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
|
49467
49677
|
type.flags & 2097152 ? getUnionType(ts.map(type.types, function (t) { return getIndexType(t, stringsOnly, noIndexSignatures); })) :
|
|
49468
49678
|
type.flags & 58982400 || isGenericTupleType(type) || isGenericMappedType(type) && !hasDistributiveNameType(type) ? getIndexTypeForGenericType(type, stringsOnly) :
|
|
49469
|
-
ts.getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, noIndexSignatures) :
|
|
49679
|
+
ts.getObjectFlags(type) & 32 ? getIndexTypeForMappedType(type, stringsOnly, noIndexSignatures) :
|
|
49470
49680
|
type === wildcardType ? wildcardType :
|
|
49471
49681
|
type.flags & 2 ? neverType :
|
|
49472
49682
|
type.flags & (1 | 131072) ? keyofConstraintType :
|
|
@@ -50893,7 +51103,7 @@ var ts;
|
|
|
50893
51103
|
var mappedTypeVariable = instantiateType(typeVariable, mapper);
|
|
50894
51104
|
if (typeVariable !== mappedTypeVariable) {
|
|
50895
51105
|
return mapTypeWithAlias(getReducedType(mappedTypeVariable), function (t) {
|
|
50896
|
-
if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && t
|
|
51106
|
+
if (t.flags & (3 | 58982400 | 524288 | 2097152) && t !== wildcardType && !isErrorType(t)) {
|
|
50897
51107
|
if (!type.declaration.nameType) {
|
|
50898
51108
|
if (isArrayType(t)) {
|
|
50899
51109
|
return instantiateMappedArrayType(t, type, prependTypeMapping(typeVariable, t, mapper));
|
|
@@ -50929,7 +51139,7 @@ var ts;
|
|
|
50929
51139
|
}
|
|
50930
51140
|
function instantiateMappedArrayType(arrayType, mappedType, mapper) {
|
|
50931
51141
|
var elementType = instantiateMappedTypeTemplate(mappedType, numberType, true, mapper);
|
|
50932
|
-
return elementType
|
|
51142
|
+
return isErrorType(elementType) ? errorType :
|
|
50933
51143
|
createArrayType(elementType, getModifiedReadonlyState(isReadonlyArrayType(arrayType), getMappedTypeModifiers(mappedType)));
|
|
50934
51144
|
}
|
|
50935
51145
|
function instantiateMappedTupleType(tupleType, mappedType, mapper) {
|
|
@@ -51148,7 +51358,7 @@ var ts;
|
|
|
51148
51358
|
return !node.typeParameters && !ts.getEffectiveReturnTypeNode(node) && !!node.body && node.body.kind !== 234 && isContextSensitive(node.body);
|
|
51149
51359
|
}
|
|
51150
51360
|
function isContextSensitiveFunctionOrObjectLiteralMethod(func) {
|
|
51151
|
-
return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
|
|
51361
|
+
return (ts.isInJSFile(func) && ts.isFunctionDeclaration(func) || ts.isFunctionExpressionOrArrowFunction(func) || ts.isObjectLiteralMethod(func)) &&
|
|
51152
51362
|
isContextSensitiveFunctionLikeDeclaration(func);
|
|
51153
51363
|
}
|
|
51154
51364
|
function getTypeWithoutSignatures(type) {
|
|
@@ -51932,7 +52142,8 @@ var ts;
|
|
|
51932
52142
|
var sourceStack;
|
|
51933
52143
|
var targetStack;
|
|
51934
52144
|
var maybeCount = 0;
|
|
51935
|
-
var
|
|
52145
|
+
var sourceDepth = 0;
|
|
52146
|
+
var targetDepth = 0;
|
|
51936
52147
|
var expandingFlags = 0;
|
|
51937
52148
|
var overflow = false;
|
|
51938
52149
|
var overrideNextErrorInfo = 0;
|
|
@@ -51940,12 +52151,12 @@ var ts;
|
|
|
51940
52151
|
var incompatibleStack = [];
|
|
51941
52152
|
var inPropertyCheck = false;
|
|
51942
52153
|
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
51943
|
-
var result = isRelatedTo(source, target, !!errorNode, headMessage);
|
|
52154
|
+
var result = isRelatedTo(source, target, 3, !!errorNode, headMessage);
|
|
51944
52155
|
if (incompatibleStack.length) {
|
|
51945
52156
|
reportIncompatibleStack();
|
|
51946
52157
|
}
|
|
51947
52158
|
if (overflow) {
|
|
51948
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth:
|
|
52159
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "checkTypeRelatedTo_DepthLimit", { sourceId: source.id, targetId: target.id, depth: sourceDepth, targetDepth: targetDepth });
|
|
51949
52160
|
var diag = error(errorNode || currentNode, ts.Diagnostics.Excessive_stack_depth_comparing_types_0_and_1, typeToString(source), typeToString(target));
|
|
51950
52161
|
if (errorOutputContainer) {
|
|
51951
52162
|
(errorOutputContainer.errors || (errorOutputContainer.errors = [])).push(diag);
|
|
@@ -52158,6 +52369,10 @@ var ts;
|
|
|
52158
52369
|
}
|
|
52159
52370
|
}
|
|
52160
52371
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1;
|
|
52372
|
+
var typeLengthLimit = 30;
|
|
52373
|
+
if (!errorInfo && compilerOptions.pretty && (sourceType.length > typeLengthLimit || targetType.length > typeLengthLimit)) {
|
|
52374
|
+
message = formatMessageForTypes(message, typeLengthLimit, sourceType, targetType);
|
|
52375
|
+
}
|
|
52161
52376
|
}
|
|
52162
52377
|
}
|
|
52163
52378
|
else if (message === ts.Diagnostics.Argument_of_type_0_is_not_assignable_to_parameter_of_type_1
|
|
@@ -52167,6 +52382,14 @@ var ts;
|
|
|
52167
52382
|
}
|
|
52168
52383
|
reportError(message, generalizedSourceType, targetType);
|
|
52169
52384
|
}
|
|
52385
|
+
function formatMessageForTypes(diagnostic, typeLengthLimit, source, target) {
|
|
52386
|
+
var message = diagnostic.message;
|
|
52387
|
+
if (source.length > typeLengthLimit)
|
|
52388
|
+
message = message.replace(" '{0}' ", ":\n{0}\n\n");
|
|
52389
|
+
if (target.length > typeLengthLimit)
|
|
52390
|
+
message = message.replace(" '{1}'", ":\n{1}").replace(".", "");
|
|
52391
|
+
return __assign(__assign({}, diagnostic), { message: message });
|
|
52392
|
+
}
|
|
52170
52393
|
function tryElaborateErrorsForPrimitivesAndObjects(source, target) {
|
|
52171
52394
|
var sourceType = symbolValueDeclarationIsContextSensitive(source.symbol) ? typeToString(source, source.symbol.valueDeclaration) : typeToString(source);
|
|
52172
52395
|
var targetType = symbolValueDeclarationIsContextSensitive(target.symbol) ? typeToString(target, target.symbol.valueDeclaration) : typeToString(target);
|
|
@@ -52198,7 +52421,11 @@ var ts;
|
|
|
52198
52421
|
}
|
|
52199
52422
|
return true;
|
|
52200
52423
|
}
|
|
52201
|
-
function
|
|
52424
|
+
function isRelatedToWorker(source, target, reportErrors) {
|
|
52425
|
+
return isRelatedTo(source, target, 3, reportErrors);
|
|
52426
|
+
}
|
|
52427
|
+
function isRelatedTo(originalSource, originalTarget, recursionFlags, reportErrors, headMessage, intersectionState) {
|
|
52428
|
+
if (recursionFlags === void 0) { recursionFlags = 3; }
|
|
52202
52429
|
if (reportErrors === void 0) { reportErrors = false; }
|
|
52203
52430
|
if (intersectionState === void 0) { intersectionState = 0; }
|
|
52204
52431
|
if (originalSource.flags & 524288 && originalTarget.flags & 131068) {
|
|
@@ -52213,7 +52440,7 @@ var ts;
|
|
|
52213
52440
|
if (source === target)
|
|
52214
52441
|
return -1;
|
|
52215
52442
|
if (relation === identityRelation) {
|
|
52216
|
-
return isIdenticalTo(source, target);
|
|
52443
|
+
return isIdenticalTo(source, target, recursionFlags);
|
|
52217
52444
|
}
|
|
52218
52445
|
if (source.flags & 262144 && getConstraintOfType(source) === target) {
|
|
52219
52446
|
return -1;
|
|
@@ -52250,8 +52477,8 @@ var ts;
|
|
|
52250
52477
|
var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
|
|
52251
52478
|
var calls = getSignaturesOfType(source, 0);
|
|
52252
52479
|
var constructs = getSignaturesOfType(source, 1);
|
|
52253
|
-
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, false) ||
|
|
52254
|
-
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, false)) {
|
|
52480
|
+
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
|
|
52481
|
+
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
|
|
52255
52482
|
reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
|
|
52256
52483
|
}
|
|
52257
52484
|
else {
|
|
@@ -52265,11 +52492,11 @@ var ts;
|
|
|
52265
52492
|
var saveErrorInfo = captureErrorCalculationState();
|
|
52266
52493
|
if (source.flags & 3145728 || target.flags & 3145728) {
|
|
52267
52494
|
result = getConstituentCount(source) * getConstituentCount(target) >= 4 ?
|
|
52268
|
-
recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8) :
|
|
52495
|
+
recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags) :
|
|
52269
52496
|
structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
|
|
52270
52497
|
}
|
|
52271
52498
|
if (!result && !(source.flags & 1048576) && (source.flags & (469499904) || target.flags & 469499904)) {
|
|
52272
|
-
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState)) {
|
|
52499
|
+
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
52273
52500
|
resetErrorInfo(saveErrorInfo);
|
|
52274
52501
|
}
|
|
52275
52502
|
}
|
|
@@ -52277,7 +52504,7 @@ var ts;
|
|
|
52277
52504
|
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
|
|
52278
52505
|
if (constraint && (source.flags & 2097152 || target.flags & 1048576)) {
|
|
52279
52506
|
if (everyType(constraint, function (c) { return c !== source; })) {
|
|
52280
|
-
if (result = isRelatedTo(constraint, target, false, undefined, intersectionState)) {
|
|
52507
|
+
if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
|
|
52281
52508
|
resetErrorInfo(saveErrorInfo);
|
|
52282
52509
|
}
|
|
52283
52510
|
}
|
|
@@ -52286,7 +52513,7 @@ var ts;
|
|
|
52286
52513
|
if (result && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
|
|
52287
52514
|
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288); }))) {
|
|
52288
52515
|
inPropertyCheck = true;
|
|
52289
|
-
result &= recursiveTypeRelatedTo(source, target, reportErrors, 4);
|
|
52516
|
+
result &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
|
|
52290
52517
|
inPropertyCheck = false;
|
|
52291
52518
|
}
|
|
52292
52519
|
reportErrorResults(source, target, result, isComparingJsxAttributes);
|
|
@@ -52318,7 +52545,7 @@ var ts;
|
|
|
52318
52545
|
var targetTypes = target.types;
|
|
52319
52546
|
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
52320
52547
|
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
52321
|
-
if (intrinsicAttributes
|
|
52548
|
+
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
52322
52549
|
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
52323
52550
|
return result;
|
|
52324
52551
|
}
|
|
@@ -52358,7 +52585,7 @@ var ts;
|
|
|
52358
52585
|
}
|
|
52359
52586
|
}
|
|
52360
52587
|
}
|
|
52361
|
-
function isIdenticalTo(source, target) {
|
|
52588
|
+
function isIdenticalTo(source, target, recursionFlags) {
|
|
52362
52589
|
if (source.flags !== target.flags)
|
|
52363
52590
|
return 0;
|
|
52364
52591
|
if (source.flags & 67358815)
|
|
@@ -52371,7 +52598,7 @@ var ts;
|
|
|
52371
52598
|
}
|
|
52372
52599
|
return result_7;
|
|
52373
52600
|
}
|
|
52374
|
-
return recursiveTypeRelatedTo(source, target, false, 0);
|
|
52601
|
+
return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
|
|
52375
52602
|
}
|
|
52376
52603
|
function getTypeOfPropertyInTypes(types, name) {
|
|
52377
52604
|
var appendPropType = function (propTypes, type) {
|
|
@@ -52442,7 +52669,7 @@ var ts;
|
|
|
52442
52669
|
}
|
|
52443
52670
|
return { value: true };
|
|
52444
52671
|
}
|
|
52445
|
-
if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), reportErrors)) {
|
|
52672
|
+
if (checkTypes && !isRelatedTo(getTypeOfSymbol(prop), getTypeOfPropertyInTypes(checkTypes, prop.escapedName), 3, reportErrors)) {
|
|
52446
52673
|
if (reportErrors) {
|
|
52447
52674
|
reportIncompatibleError(ts.Diagnostics.Types_of_property_0_are_incompatible, symbolToString(prop));
|
|
52448
52675
|
}
|
|
@@ -52482,7 +52709,7 @@ var ts;
|
|
|
52482
52709
|
}
|
|
52483
52710
|
var match = getMatchingUnionConstituentForType(target, source);
|
|
52484
52711
|
if (match) {
|
|
52485
|
-
var related = isRelatedTo(source, match, false);
|
|
52712
|
+
var related = isRelatedTo(source, match, 2, false);
|
|
52486
52713
|
if (related) {
|
|
52487
52714
|
return related;
|
|
52488
52715
|
}
|
|
@@ -52490,14 +52717,14 @@ var ts;
|
|
|
52490
52717
|
}
|
|
52491
52718
|
for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) {
|
|
52492
52719
|
var type = targetTypes_1[_i];
|
|
52493
|
-
var related = isRelatedTo(source, type, false);
|
|
52720
|
+
var related = isRelatedTo(source, type, 2, false);
|
|
52494
52721
|
if (related) {
|
|
52495
52722
|
return related;
|
|
52496
52723
|
}
|
|
52497
52724
|
}
|
|
52498
52725
|
if (reportErrors) {
|
|
52499
52726
|
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
|
|
52500
|
-
isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], true);
|
|
52727
|
+
isRelatedTo(source, bestMatchingType || targetTypes[targetTypes.length - 1], 2, true);
|
|
52501
52728
|
}
|
|
52502
52729
|
return 0;
|
|
52503
52730
|
}
|
|
@@ -52506,7 +52733,7 @@ var ts;
|
|
|
52506
52733
|
var targetTypes = target.types;
|
|
52507
52734
|
for (var _i = 0, targetTypes_2 = targetTypes; _i < targetTypes_2.length; _i++) {
|
|
52508
52735
|
var targetType = targetTypes_2[_i];
|
|
52509
|
-
var related = isRelatedTo(source, targetType, reportErrors, undefined, intersectionState);
|
|
52736
|
+
var related = isRelatedTo(source, targetType, 2, reportErrors, undefined, intersectionState);
|
|
52510
52737
|
if (!related) {
|
|
52511
52738
|
return 0;
|
|
52512
52739
|
}
|
|
@@ -52521,7 +52748,7 @@ var ts;
|
|
|
52521
52748
|
}
|
|
52522
52749
|
var len = sourceTypes.length;
|
|
52523
52750
|
for (var i = 0; i < len; i++) {
|
|
52524
|
-
var related = isRelatedTo(sourceTypes[i], target, reportErrors && i === len - 1, undefined, intersectionState);
|
|
52751
|
+
var related = isRelatedTo(sourceTypes[i], target, 1, reportErrors && i === len - 1, undefined, intersectionState);
|
|
52525
52752
|
if (related) {
|
|
52526
52753
|
return related;
|
|
52527
52754
|
}
|
|
@@ -52542,13 +52769,13 @@ var ts;
|
|
|
52542
52769
|
for (var i = 0; i < sourceTypes.length; i++) {
|
|
52543
52770
|
var sourceType = sourceTypes[i];
|
|
52544
52771
|
if (undefinedStrippedTarget.flags & 1048576 && sourceTypes.length >= undefinedStrippedTarget.types.length && sourceTypes.length % undefinedStrippedTarget.types.length === 0) {
|
|
52545
|
-
var related_1 = isRelatedTo(sourceType, undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length], false, undefined, intersectionState);
|
|
52772
|
+
var related_1 = isRelatedTo(sourceType, undefinedStrippedTarget.types[i % undefinedStrippedTarget.types.length], 3, false, undefined, intersectionState);
|
|
52546
52773
|
if (related_1) {
|
|
52547
52774
|
result &= related_1;
|
|
52548
52775
|
continue;
|
|
52549
52776
|
}
|
|
52550
52777
|
}
|
|
52551
|
-
var related = isRelatedTo(sourceType, target, reportErrors, undefined, intersectionState);
|
|
52778
|
+
var related = isRelatedTo(sourceType, target, 1, reportErrors, undefined, intersectionState);
|
|
52552
52779
|
if (!related) {
|
|
52553
52780
|
return 0;
|
|
52554
52781
|
}
|
|
@@ -52573,24 +52800,24 @@ var ts;
|
|
|
52573
52800
|
var t = targets[i];
|
|
52574
52801
|
var related = -1;
|
|
52575
52802
|
if (varianceFlags & 8) {
|
|
52576
|
-
related = relation === identityRelation ? isRelatedTo(s, t, false) : compareTypesIdentical(s, t);
|
|
52803
|
+
related = relation === identityRelation ? isRelatedTo(s, t, 3, false) : compareTypesIdentical(s, t);
|
|
52577
52804
|
}
|
|
52578
52805
|
else if (variance === 1) {
|
|
52579
|
-
related = isRelatedTo(s, t, reportErrors, undefined, intersectionState);
|
|
52806
|
+
related = isRelatedTo(s, t, 3, reportErrors, undefined, intersectionState);
|
|
52580
52807
|
}
|
|
52581
52808
|
else if (variance === 2) {
|
|
52582
|
-
related = isRelatedTo(t, s, reportErrors, undefined, intersectionState);
|
|
52809
|
+
related = isRelatedTo(t, s, 3, reportErrors, undefined, intersectionState);
|
|
52583
52810
|
}
|
|
52584
52811
|
else if (variance === 3) {
|
|
52585
|
-
related = isRelatedTo(t, s, false);
|
|
52812
|
+
related = isRelatedTo(t, s, 3, false);
|
|
52586
52813
|
if (!related) {
|
|
52587
|
-
related = isRelatedTo(s, t, reportErrors, undefined, intersectionState);
|
|
52814
|
+
related = isRelatedTo(s, t, 3, reportErrors, undefined, intersectionState);
|
|
52588
52815
|
}
|
|
52589
52816
|
}
|
|
52590
52817
|
else {
|
|
52591
|
-
related = isRelatedTo(s, t, reportErrors, undefined, intersectionState);
|
|
52818
|
+
related = isRelatedTo(s, t, 3, reportErrors, undefined, intersectionState);
|
|
52592
52819
|
if (related) {
|
|
52593
|
-
related &= isRelatedTo(t, s, reportErrors, undefined, intersectionState);
|
|
52820
|
+
related &= isRelatedTo(t, s, 3, reportErrors, undefined, intersectionState);
|
|
52594
52821
|
}
|
|
52595
52822
|
}
|
|
52596
52823
|
if (!related) {
|
|
@@ -52601,7 +52828,7 @@ var ts;
|
|
|
52601
52828
|
}
|
|
52602
52829
|
return result;
|
|
52603
52830
|
}
|
|
52604
|
-
function recursiveTypeRelatedTo(source, target, reportErrors, intersectionState) {
|
|
52831
|
+
function recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags) {
|
|
52605
52832
|
if (overflow) {
|
|
52606
52833
|
return 0;
|
|
52607
52834
|
}
|
|
@@ -52638,7 +52865,7 @@ var ts;
|
|
|
52638
52865
|
return 3;
|
|
52639
52866
|
}
|
|
52640
52867
|
}
|
|
52641
|
-
if (
|
|
52868
|
+
if (sourceDepth === 100 || targetDepth === 100) {
|
|
52642
52869
|
overflow = true;
|
|
52643
52870
|
return 0;
|
|
52644
52871
|
}
|
|
@@ -52646,13 +52873,18 @@ var ts;
|
|
|
52646
52873
|
var maybeStart = maybeCount;
|
|
52647
52874
|
maybeKeys[maybeCount] = id;
|
|
52648
52875
|
maybeCount++;
|
|
52649
|
-
|
|
52650
|
-
|
|
52651
|
-
|
|
52876
|
+
if (recursionFlags & 1) {
|
|
52877
|
+
sourceStack[sourceDepth] = source;
|
|
52878
|
+
sourceDepth++;
|
|
52879
|
+
}
|
|
52880
|
+
if (recursionFlags & 2) {
|
|
52881
|
+
targetStack[targetDepth] = target;
|
|
52882
|
+
targetDepth++;
|
|
52883
|
+
}
|
|
52652
52884
|
var saveExpandingFlags = expandingFlags;
|
|
52653
|
-
if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack,
|
|
52885
|
+
if (!(expandingFlags & 1) && isDeeplyNestedType(source, sourceStack, sourceDepth))
|
|
52654
52886
|
expandingFlags |= 1;
|
|
52655
|
-
if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack,
|
|
52887
|
+
if (!(expandingFlags & 2) && isDeeplyNestedType(target, targetStack, targetDepth))
|
|
52656
52888
|
expandingFlags |= 2;
|
|
52657
52889
|
var originalHandler;
|
|
52658
52890
|
var propagatingVarianceFlags = 0;
|
|
@@ -52669,7 +52901,8 @@ var ts;
|
|
|
52669
52901
|
sourceIdStack: sourceStack.map(function (t) { return t.id; }),
|
|
52670
52902
|
targetId: target.id,
|
|
52671
52903
|
targetIdStack: targetStack.map(function (t) { return t.id; }),
|
|
52672
|
-
depth:
|
|
52904
|
+
depth: sourceDepth,
|
|
52905
|
+
targetDepth: targetDepth
|
|
52673
52906
|
});
|
|
52674
52907
|
}
|
|
52675
52908
|
var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3;
|
|
@@ -52677,9 +52910,14 @@ var ts;
|
|
|
52677
52910
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
52678
52911
|
}
|
|
52679
52912
|
expandingFlags = saveExpandingFlags;
|
|
52680
|
-
|
|
52913
|
+
if (recursionFlags & 1) {
|
|
52914
|
+
sourceDepth--;
|
|
52915
|
+
}
|
|
52916
|
+
if (recursionFlags & 2) {
|
|
52917
|
+
targetDepth--;
|
|
52918
|
+
}
|
|
52681
52919
|
if (result) {
|
|
52682
|
-
if (result === -1 ||
|
|
52920
|
+
if (result === -1 || (sourceDepth === 0 && targetDepth === 0)) {
|
|
52683
52921
|
if (result === -1 || result === 3) {
|
|
52684
52922
|
for (var i = maybeStart; i < maybeCount; i++) {
|
|
52685
52923
|
relation.set(maybeKeys[i], 1 | propagatingVarianceFlags);
|
|
@@ -52721,7 +52959,7 @@ var ts;
|
|
|
52721
52959
|
if (constraints !== source.types) {
|
|
52722
52960
|
source = getIntersectionType(constraints);
|
|
52723
52961
|
if (!(source.flags & 2097152)) {
|
|
52724
|
-
return isRelatedTo(source, target, false);
|
|
52962
|
+
return isRelatedTo(source, target, 1, false);
|
|
52725
52963
|
}
|
|
52726
52964
|
}
|
|
52727
52965
|
}
|
|
@@ -52730,22 +52968,22 @@ var ts;
|
|
|
52730
52968
|
var flags = source.flags & target.flags;
|
|
52731
52969
|
if (relation === identityRelation && !(flags & 524288)) {
|
|
52732
52970
|
if (flags & 4194304) {
|
|
52733
|
-
return isRelatedTo(source.type, target.type, false);
|
|
52971
|
+
return isRelatedTo(source.type, target.type, 3, false);
|
|
52734
52972
|
}
|
|
52735
52973
|
var result_8 = 0;
|
|
52736
52974
|
if (flags & 8388608) {
|
|
52737
|
-
if (result_8 = isRelatedTo(source.objectType, target.objectType, false)) {
|
|
52738
|
-
if (result_8 &= isRelatedTo(source.indexType, target.indexType, false)) {
|
|
52975
|
+
if (result_8 = isRelatedTo(source.objectType, target.objectType, 3, false)) {
|
|
52976
|
+
if (result_8 &= isRelatedTo(source.indexType, target.indexType, 3, false)) {
|
|
52739
52977
|
return result_8;
|
|
52740
52978
|
}
|
|
52741
52979
|
}
|
|
52742
52980
|
}
|
|
52743
52981
|
if (flags & 16777216) {
|
|
52744
52982
|
if (source.root.isDistributive === target.root.isDistributive) {
|
|
52745
|
-
if (result_8 = isRelatedTo(source.checkType, target.checkType, false)) {
|
|
52746
|
-
if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, false)) {
|
|
52747
|
-
if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), false)) {
|
|
52748
|
-
if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), false)) {
|
|
52983
|
+
if (result_8 = isRelatedTo(source.checkType, target.checkType, 3, false)) {
|
|
52984
|
+
if (result_8 &= isRelatedTo(source.extendsType, target.extendsType, 3, false)) {
|
|
52985
|
+
if (result_8 &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3, false)) {
|
|
52986
|
+
if (result_8 &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, false)) {
|
|
52749
52987
|
return result_8;
|
|
52750
52988
|
}
|
|
52751
52989
|
}
|
|
@@ -52754,7 +52992,7 @@ var ts;
|
|
|
52754
52992
|
}
|
|
52755
52993
|
}
|
|
52756
52994
|
if (flags & 33554432) {
|
|
52757
|
-
return isRelatedTo(source.substitute, target.substitute, false);
|
|
52995
|
+
return isRelatedTo(source.substitute, target.substitute, 3, false);
|
|
52758
52996
|
}
|
|
52759
52997
|
return 0;
|
|
52760
52998
|
}
|
|
@@ -52774,37 +53012,54 @@ var ts;
|
|
|
52774
53012
|
return varianceResult;
|
|
52775
53013
|
}
|
|
52776
53014
|
}
|
|
52777
|
-
if (isSingleElementGenericTupleType(source) && !source.target.readonly && (result = isRelatedTo(getTypeArguments(source)[0], target)) ||
|
|
52778
|
-
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0]))) {
|
|
53015
|
+
if (isSingleElementGenericTupleType(source) && !source.target.readonly && (result = isRelatedTo(getTypeArguments(source)[0], target, 1)) ||
|
|
53016
|
+
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2))) {
|
|
52779
53017
|
return result;
|
|
52780
53018
|
}
|
|
52781
53019
|
if (target.flags & 262144) {
|
|
52782
|
-
if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source))) {
|
|
53020
|
+
if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3)) {
|
|
52783
53021
|
if (!(getMappedTypeModifiers(source) & 4)) {
|
|
52784
53022
|
var templateType = getTemplateTypeFromMappedType(source);
|
|
52785
53023
|
var indexedAccessType = getIndexedAccessType(target, getTypeParameterFromMappedType(source));
|
|
52786
|
-
if (result = isRelatedTo(templateType, indexedAccessType, reportErrors)) {
|
|
53024
|
+
if (result = isRelatedTo(templateType, indexedAccessType, 3, reportErrors)) {
|
|
52787
53025
|
return result;
|
|
52788
53026
|
}
|
|
52789
53027
|
}
|
|
52790
53028
|
}
|
|
52791
53029
|
}
|
|
52792
53030
|
else if (target.flags & 4194304) {
|
|
52793
|
-
var
|
|
53031
|
+
var targetType_1 = target.type;
|
|
52794
53032
|
if (source.flags & 4194304) {
|
|
52795
|
-
if (result = isRelatedTo(
|
|
53033
|
+
if (result = isRelatedTo(targetType_1, source.type, 3, false)) {
|
|
52796
53034
|
return result;
|
|
52797
53035
|
}
|
|
52798
53036
|
}
|
|
52799
|
-
if (isTupleType(
|
|
52800
|
-
if (result = isRelatedTo(source, getKnownKeysOfTupleType(
|
|
53037
|
+
if (isTupleType(targetType_1)) {
|
|
53038
|
+
if (result = isRelatedTo(source, getKnownKeysOfTupleType(targetType_1), 2, reportErrors)) {
|
|
52801
53039
|
return result;
|
|
52802
53040
|
}
|
|
52803
53041
|
}
|
|
52804
53042
|
else {
|
|
52805
|
-
var constraint = getSimplifiedTypeOrConstraint(
|
|
53043
|
+
var constraint = getSimplifiedTypeOrConstraint(targetType_1);
|
|
52806
53044
|
if (constraint) {
|
|
52807
|
-
if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), reportErrors) === -1) {
|
|
53045
|
+
if (isRelatedTo(source, getIndexType(constraint, target.stringsOnly), 2, reportErrors) === -1) {
|
|
53046
|
+
return -1;
|
|
53047
|
+
}
|
|
53048
|
+
}
|
|
53049
|
+
else if (isGenericMappedType(targetType_1)) {
|
|
53050
|
+
var nameType_1 = getNameTypeFromMappedType(targetType_1);
|
|
53051
|
+
var constraintType = getConstraintTypeFromMappedType(targetType_1);
|
|
53052
|
+
var targetKeys = void 0;
|
|
53053
|
+
if (nameType_1 && isMappedTypeWithKeyofConstraintDeclaration(targetType_1)) {
|
|
53054
|
+
var modifiersType = getApparentType(getModifiersTypeFromMappedType(targetType_1));
|
|
53055
|
+
var mappedKeys_1 = [];
|
|
53056
|
+
forEachMappedTypePropertyKeyTypeAndIndexSignatureKeyType(modifiersType, 8576, false, function (t) { return void mappedKeys_1.push(instantiateType(nameType_1, appendTypeMapping(targetType_1.mapper, getTypeParameterFromMappedType(targetType_1), t))); });
|
|
53057
|
+
targetKeys = getUnionType(__spreadArray(__spreadArray([], mappedKeys_1, true), [nameType_1], false));
|
|
53058
|
+
}
|
|
53059
|
+
else {
|
|
53060
|
+
targetKeys = nameType_1 || constraintType;
|
|
53061
|
+
}
|
|
53062
|
+
if (isRelatedTo(source, targetKeys, 2, reportErrors) === -1) {
|
|
52808
53063
|
return -1;
|
|
52809
53064
|
}
|
|
52810
53065
|
}
|
|
@@ -52812,8 +53067,8 @@ var ts;
|
|
|
52812
53067
|
}
|
|
52813
53068
|
else if (target.flags & 8388608) {
|
|
52814
53069
|
if (source.flags & 8388608) {
|
|
52815
|
-
if (result = isRelatedTo(source.objectType, target.objectType, reportErrors)) {
|
|
52816
|
-
result &= isRelatedTo(source.indexType, target.indexType, reportErrors);
|
|
53070
|
+
if (result = isRelatedTo(source.objectType, target.objectType, 3, reportErrors)) {
|
|
53071
|
+
result &= isRelatedTo(source.indexType, target.indexType, 3, reportErrors);
|
|
52817
53072
|
}
|
|
52818
53073
|
if (result) {
|
|
52819
53074
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -52835,7 +53090,7 @@ var ts;
|
|
|
52835
53090
|
if (reportErrors && originalErrorInfo) {
|
|
52836
53091
|
resetErrorInfo(saveErrorInfo);
|
|
52837
53092
|
}
|
|
52838
|
-
if (result = isRelatedTo(source, constraint, reportErrors)) {
|
|
53093
|
+
if (result = isRelatedTo(source, constraint, 2, reportErrors)) {
|
|
52839
53094
|
return result;
|
|
52840
53095
|
}
|
|
52841
53096
|
if (reportErrors && originalErrorInfo && errorInfo) {
|
|
@@ -52864,11 +53119,12 @@ var ts;
|
|
|
52864
53119
|
var filteredByApplicability = includeOptional ? intersectTypes(targetKeys, sourceKeys) : undefined;
|
|
52865
53120
|
if (includeOptional
|
|
52866
53121
|
? !(filteredByApplicability.flags & 131072)
|
|
52867
|
-
: isRelatedTo(targetKeys, sourceKeys)) {
|
|
53122
|
+
: isRelatedTo(targetKeys, sourceKeys, 3)) {
|
|
53123
|
+
var templateType_1 = getTemplateTypeFromMappedType(target);
|
|
52868
53124
|
var typeParameter = getTypeParameterFromMappedType(target);
|
|
52869
|
-
var nonNullComponent = extractTypesOfKind(
|
|
53125
|
+
var nonNullComponent = extractTypesOfKind(templateType_1, ~98304);
|
|
52870
53126
|
if (!keysRemapped && nonNullComponent.flags & 8388608 && nonNullComponent.indexType === typeParameter) {
|
|
52871
|
-
if (result = isRelatedTo(source, nonNullComponent.objectType, reportErrors)) {
|
|
53127
|
+
if (result = isRelatedTo(source, nonNullComponent.objectType, 2, reportErrors)) {
|
|
52872
53128
|
return result;
|
|
52873
53129
|
}
|
|
52874
53130
|
}
|
|
@@ -52879,7 +53135,7 @@ var ts;
|
|
|
52879
53135
|
? getIntersectionType([filteredByApplicability, typeParameter])
|
|
52880
53136
|
: typeParameter;
|
|
52881
53137
|
var indexedAccessType = getIndexedAccessType(source, indexingType);
|
|
52882
|
-
if (result = isRelatedTo(indexedAccessType,
|
|
53138
|
+
if (result = isRelatedTo(indexedAccessType, templateType_1, 3, reportErrors)) {
|
|
52883
53139
|
return result;
|
|
52884
53140
|
}
|
|
52885
53141
|
}
|
|
@@ -52900,10 +53156,11 @@ var ts;
|
|
|
52900
53156
|
distributionMapper = prependTypeMapping(checkVar, newParam, c.mapper);
|
|
52901
53157
|
newParam.mapper = distributionMapper;
|
|
52902
53158
|
}
|
|
52903
|
-
var
|
|
52904
|
-
|
|
52905
|
-
|
|
52906
|
-
|
|
53159
|
+
var expanding = isDeeplyNestedType(target, targetStack, targetDepth);
|
|
53160
|
+
var localResult = expanding ? 3 : undefined;
|
|
53161
|
+
if (skipTrue || expanding || (localResult = isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.trueType), distributionMapper) : getTrueTypeFromConditionalType(c), 2, false))) {
|
|
53162
|
+
if (!skipFalse && !expanding) {
|
|
53163
|
+
localResult = (localResult || 3) & isRelatedTo(source, distributionMapper ? instantiateType(getTypeFromTypeNode(c.root.node.falseType), distributionMapper) : getFalseTypeFromConditionalType(c), 2, false);
|
|
52907
53164
|
}
|
|
52908
53165
|
}
|
|
52909
53166
|
if (localResult) {
|
|
@@ -52913,6 +53170,9 @@ var ts;
|
|
|
52913
53170
|
}
|
|
52914
53171
|
else if (target.flags & 134217728) {
|
|
52915
53172
|
if (source.flags & 134217728) {
|
|
53173
|
+
if (relation === comparableRelation) {
|
|
53174
|
+
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 : -1;
|
|
53175
|
+
}
|
|
52916
53176
|
instantiateType(source, makeFunctionTypeMapper(reportUnreliableMarkers));
|
|
52917
53177
|
}
|
|
52918
53178
|
var result_9 = inferTypesFromTemplateLiteralType(source, target);
|
|
@@ -52924,32 +53184,31 @@ var ts;
|
|
|
52924
53184
|
if (!(source.flags & 8388608 && target.flags & 8388608)) {
|
|
52925
53185
|
var constraint = getConstraintOfType(source);
|
|
52926
53186
|
if (!constraint || (source.flags & 262144 && constraint.flags & 1)) {
|
|
52927
|
-
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864))) {
|
|
53187
|
+
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
|
|
52928
53188
|
resetErrorInfo(saveErrorInfo);
|
|
52929
53189
|
return result;
|
|
52930
53190
|
}
|
|
52931
53191
|
}
|
|
52932
|
-
else if (result = isRelatedTo(constraint, target, false, undefined, intersectionState)) {
|
|
53192
|
+
else if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
|
|
52933
53193
|
resetErrorInfo(saveErrorInfo);
|
|
52934
53194
|
return result;
|
|
52935
53195
|
}
|
|
52936
|
-
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, reportErrors && !(target.flags & source.flags & 262144), undefined, intersectionState)) {
|
|
53196
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(target.flags & source.flags & 262144), undefined, intersectionState)) {
|
|
52937
53197
|
resetErrorInfo(saveErrorInfo);
|
|
52938
53198
|
return result;
|
|
52939
53199
|
}
|
|
52940
53200
|
}
|
|
52941
53201
|
}
|
|
52942
53202
|
else if (source.flags & 4194304) {
|
|
52943
|
-
if (result = isRelatedTo(keyofConstraintType, target, reportErrors)) {
|
|
53203
|
+
if (result = isRelatedTo(keyofConstraintType, target, 1, reportErrors)) {
|
|
52944
53204
|
resetErrorInfo(saveErrorInfo);
|
|
52945
53205
|
return result;
|
|
52946
53206
|
}
|
|
52947
53207
|
}
|
|
52948
|
-
else if (source.flags & 134217728) {
|
|
53208
|
+
else if (source.flags & 134217728 && !(target.flags & 524288)) {
|
|
52949
53209
|
if (!(target.flags & 134217728)) {
|
|
52950
|
-
var
|
|
52951
|
-
|
|
52952
|
-
if (result = isRelatedTo(constraint, target, reportErrors)) {
|
|
53210
|
+
var constraint = getBaseConstraintOfType(source);
|
|
53211
|
+
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1, reportErrors))) {
|
|
52953
53212
|
resetErrorInfo(saveErrorInfo);
|
|
52954
53213
|
return result;
|
|
52955
53214
|
}
|
|
@@ -52957,14 +53216,14 @@ var ts;
|
|
|
52957
53216
|
}
|
|
52958
53217
|
else if (source.flags & 268435456) {
|
|
52959
53218
|
if (target.flags & 268435456 && source.symbol === target.symbol) {
|
|
52960
|
-
if (result = isRelatedTo(source.type, target.type, reportErrors)) {
|
|
53219
|
+
if (result = isRelatedTo(source.type, target.type, 3, reportErrors)) {
|
|
52961
53220
|
resetErrorInfo(saveErrorInfo);
|
|
52962
53221
|
return result;
|
|
52963
53222
|
}
|
|
52964
53223
|
}
|
|
52965
53224
|
else {
|
|
52966
53225
|
var constraint = getBaseConstraintOfType(source);
|
|
52967
|
-
if (constraint && (result = isRelatedTo(constraint, target, reportErrors))) {
|
|
53226
|
+
if (constraint && (result = isRelatedTo(constraint, target, 1, reportErrors))) {
|
|
52968
53227
|
resetErrorInfo(saveErrorInfo);
|
|
52969
53228
|
return result;
|
|
52970
53229
|
}
|
|
@@ -52972,40 +53231,44 @@ var ts;
|
|
|
52972
53231
|
}
|
|
52973
53232
|
else if (source.flags & 16777216) {
|
|
52974
53233
|
if (target.flags & 16777216) {
|
|
52975
|
-
|
|
52976
|
-
|
|
52977
|
-
|
|
52978
|
-
|
|
52979
|
-
|
|
52980
|
-
|
|
52981
|
-
|
|
52982
|
-
|
|
52983
|
-
|
|
52984
|
-
if (isTypeIdenticalTo(sourceExtends, target.extendsType) &&
|
|
52985
|
-
(isRelatedTo(source.checkType, target.checkType) || isRelatedTo(target.checkType, source.checkType))) {
|
|
52986
|
-
if (result = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source), mapper), getTrueTypeFromConditionalType(target), reportErrors)) {
|
|
52987
|
-
result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), reportErrors);
|
|
53234
|
+
if (!isDeeplyNestedType(source, sourceStack, sourceDepth) && !isDeeplyNestedType(target, targetStack, targetDepth)) {
|
|
53235
|
+
var sourceParams = source.root.inferTypeParameters;
|
|
53236
|
+
var sourceExtends = source.extendsType;
|
|
53237
|
+
var mapper = void 0;
|
|
53238
|
+
if (sourceParams) {
|
|
53239
|
+
var ctx = createInferenceContext(sourceParams, undefined, 0, isRelatedToWorker);
|
|
53240
|
+
inferTypes(ctx.inferences, target.extendsType, sourceExtends, 512 | 1024);
|
|
53241
|
+
sourceExtends = instantiateType(sourceExtends, ctx.mapper);
|
|
53242
|
+
mapper = ctx.mapper;
|
|
52988
53243
|
}
|
|
52989
|
-
if (
|
|
52990
|
-
|
|
52991
|
-
|
|
53244
|
+
if (isTypeIdenticalTo(sourceExtends, target.extendsType) &&
|
|
53245
|
+
(isRelatedTo(source.checkType, target.checkType, 3) || isRelatedTo(target.checkType, source.checkType, 3))) {
|
|
53246
|
+
if (result = isRelatedTo(instantiateType(getTrueTypeFromConditionalType(source), mapper), getTrueTypeFromConditionalType(target), 3, reportErrors)) {
|
|
53247
|
+
result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, reportErrors);
|
|
53248
|
+
}
|
|
53249
|
+
if (result) {
|
|
53250
|
+
resetErrorInfo(saveErrorInfo);
|
|
53251
|
+
return result;
|
|
53252
|
+
}
|
|
52992
53253
|
}
|
|
52993
53254
|
}
|
|
52994
53255
|
}
|
|
52995
53256
|
else {
|
|
52996
53257
|
var distributiveConstraint = getConstraintOfDistributiveConditionalType(source);
|
|
52997
53258
|
if (distributiveConstraint) {
|
|
52998
|
-
if (result = isRelatedTo(distributiveConstraint, target, reportErrors)) {
|
|
53259
|
+
if (result = isRelatedTo(distributiveConstraint, target, 1, reportErrors)) {
|
|
52999
53260
|
resetErrorInfo(saveErrorInfo);
|
|
53000
53261
|
return result;
|
|
53001
53262
|
}
|
|
53002
53263
|
}
|
|
53003
53264
|
}
|
|
53004
|
-
|
|
53005
|
-
|
|
53006
|
-
if (
|
|
53007
|
-
|
|
53008
|
-
|
|
53265
|
+
if (!isDeeplyNestedType(source, sourceStack, sourceDepth)) {
|
|
53266
|
+
var defaultConstraint = getDefaultConstraintOfConditionalType(source);
|
|
53267
|
+
if (defaultConstraint) {
|
|
53268
|
+
if (result = isRelatedTo(defaultConstraint, target, 1, reportErrors)) {
|
|
53269
|
+
resetErrorInfo(saveErrorInfo);
|
|
53270
|
+
return result;
|
|
53271
|
+
}
|
|
53009
53272
|
}
|
|
53010
53273
|
}
|
|
53011
53274
|
}
|
|
@@ -53042,7 +53305,7 @@ var ts;
|
|
|
53042
53305
|
}
|
|
53043
53306
|
else if (isReadonlyArrayType(target) ? isArrayType(source) || isTupleType(source) : isArrayType(target) && isTupleType(source) && !source.target.readonly) {
|
|
53044
53307
|
if (relation !== identityRelation) {
|
|
53045
|
-
return isRelatedTo(getIndexTypeOfType(source, numberType) || anyType, getIndexTypeOfType(target, numberType) || anyType, reportErrors);
|
|
53308
|
+
return isRelatedTo(getIndexTypeOfType(source, numberType) || anyType, getIndexTypeOfType(target, numberType) || anyType, 3, reportErrors);
|
|
53046
53309
|
}
|
|
53047
53310
|
else {
|
|
53048
53311
|
return 0;
|
|
@@ -53125,10 +53388,10 @@ var ts;
|
|
|
53125
53388
|
var result_11;
|
|
53126
53389
|
var targetConstraint = getConstraintTypeFromMappedType(target);
|
|
53127
53390
|
var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers));
|
|
53128
|
-
if (result_11 = isRelatedTo(targetConstraint, sourceConstraint, reportErrors)) {
|
|
53391
|
+
if (result_11 = isRelatedTo(targetConstraint, sourceConstraint, 3, reportErrors)) {
|
|
53129
53392
|
var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]);
|
|
53130
53393
|
if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) {
|
|
53131
|
-
return result_11 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), reportErrors);
|
|
53394
|
+
return result_11 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3, reportErrors);
|
|
53132
53395
|
}
|
|
53133
53396
|
}
|
|
53134
53397
|
}
|
|
@@ -53234,7 +53497,7 @@ var ts;
|
|
|
53234
53497
|
var targetIsOptional = strictNullChecks && !!(ts.getCheckFlags(targetProp) & 48);
|
|
53235
53498
|
var effectiveTarget = addOptionality(getNonMissingTypeOfSymbol(targetProp), false, targetIsOptional);
|
|
53236
53499
|
var effectiveSource = getTypeOfSourceProperty(sourceProp);
|
|
53237
|
-
return isRelatedTo(effectiveSource, effectiveTarget, reportErrors, undefined, intersectionState);
|
|
53500
|
+
return isRelatedTo(effectiveSource, effectiveTarget, 3, reportErrors, undefined, intersectionState);
|
|
53238
53501
|
}
|
|
53239
53502
|
function propertyRelatedTo(source, target, sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState, skipOptional) {
|
|
53240
53503
|
var sourcePropFlags = ts.getDeclarationModifierFlagsFromSymbol(sourceProp);
|
|
@@ -53404,7 +53667,7 @@ var ts;
|
|
|
53404
53667
|
var targetType = targetTypeArguments[i];
|
|
53405
53668
|
var targetCheckType = sourceFlags & 8 && targetFlags & 4 ? createArrayType(targetType) :
|
|
53406
53669
|
removeMissingType(targetType, !!(targetFlags & 2));
|
|
53407
|
-
var related = isRelatedTo(sourceType, targetCheckType, reportErrors, undefined, intersectionState);
|
|
53670
|
+
var related = isRelatedTo(sourceType, targetCheckType, 3, reportErrors, undefined, intersectionState);
|
|
53408
53671
|
if (!related) {
|
|
53409
53672
|
if (reportErrors && (targetArity > 1 || sourceArity > 1)) {
|
|
53410
53673
|
if (i < startCount || i >= targetArity - endCount || sourceArity - startCount - endCount === 1) {
|
|
@@ -53579,7 +53842,7 @@ var ts;
|
|
|
53579
53842
|
return function (source, target) { return reportIncompatibleError(ts.Diagnostics.Construct_signature_return_types_0_and_1_are_incompatible, typeToString(source), typeToString(target)); };
|
|
53580
53843
|
}
|
|
53581
53844
|
function signatureRelatedTo(source, target, erase, reportErrors, incompatibleReporter) {
|
|
53582
|
-
return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter,
|
|
53845
|
+
return compareSignaturesRelated(erase ? getErasedSignature(source) : source, erase ? getErasedSignature(target) : target, relation === strictSubtypeRelation ? 8 : 0, reportErrors, reportError, incompatibleReporter, isRelatedToWorker, makeFunctionTypeMapper(reportUnreliableMarkers));
|
|
53583
53846
|
}
|
|
53584
53847
|
function signaturesIdenticalTo(source, target, kind) {
|
|
53585
53848
|
var sourceSignatures = getSignaturesOfType(source, kind);
|
|
@@ -53611,7 +53874,7 @@ var ts;
|
|
|
53611
53874
|
var type = exactOptionalPropertyTypes || propType.flags & 32768 || keyType === numberType || !(prop.flags & 16777216)
|
|
53612
53875
|
? propType
|
|
53613
53876
|
: getTypeWithFacts(propType, 524288);
|
|
53614
|
-
var related = isRelatedTo(type, targetInfo.type, reportErrors);
|
|
53877
|
+
var related = isRelatedTo(type, targetInfo.type, 3, reportErrors);
|
|
53615
53878
|
if (!related) {
|
|
53616
53879
|
if (reportErrors) {
|
|
53617
53880
|
reportError(ts.Diagnostics.Property_0_is_incompatible_with_index_signature, symbolToString(prop));
|
|
@@ -53634,7 +53897,7 @@ var ts;
|
|
|
53634
53897
|
return result;
|
|
53635
53898
|
}
|
|
53636
53899
|
function indexInfoRelatedTo(sourceInfo, targetInfo, reportErrors) {
|
|
53637
|
-
var related = isRelatedTo(sourceInfo.type, targetInfo.type, reportErrors);
|
|
53900
|
+
var related = isRelatedTo(sourceInfo.type, targetInfo.type, 3, reportErrors);
|
|
53638
53901
|
if (!related && reportErrors) {
|
|
53639
53902
|
if (sourceInfo.keyType === targetInfo.keyType) {
|
|
53640
53903
|
reportError(ts.Diagnostics._0_index_signatures_are_incompatible, typeToString(sourceInfo.keyType));
|
|
@@ -53655,7 +53918,7 @@ var ts;
|
|
|
53655
53918
|
for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
|
|
53656
53919
|
var targetInfo = indexInfos_3[_i];
|
|
53657
53920
|
var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 ? -1 :
|
|
53658
|
-
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, reportErrors) :
|
|
53921
|
+
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3, reportErrors) :
|
|
53659
53922
|
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
|
53660
53923
|
if (!related) {
|
|
53661
53924
|
return 0;
|
|
@@ -53686,7 +53949,7 @@ var ts;
|
|
|
53686
53949
|
for (var _i = 0, targetInfos_1 = targetInfos; _i < targetInfos_1.length; _i++) {
|
|
53687
53950
|
var targetInfo = targetInfos_1[_i];
|
|
53688
53951
|
var sourceInfo = getIndexInfoOfType(source, targetInfo.keyType);
|
|
53689
|
-
if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
|
|
53952
|
+
if (!(sourceInfo && isRelatedTo(sourceInfo.type, targetInfo.type, 3) && sourceInfo.isReadonly === targetInfo.isReadonly)) {
|
|
53690
53953
|
return 0;
|
|
53691
53954
|
}
|
|
53692
53955
|
}
|
|
@@ -54916,6 +55179,16 @@ var ts;
|
|
|
54916
55179
|
function isFromInferenceBlockedSource(type) {
|
|
54917
55180
|
return !!(type.symbol && ts.some(type.symbol.declarations, hasSkipDirectInferenceFlag));
|
|
54918
55181
|
}
|
|
55182
|
+
function templateLiteralTypesDefinitelyUnrelated(source, target) {
|
|
55183
|
+
var sourceStart = source.texts[0];
|
|
55184
|
+
var targetStart = target.texts[0];
|
|
55185
|
+
var sourceEnd = source.texts[source.texts.length - 1];
|
|
55186
|
+
var targetEnd = target.texts[target.texts.length - 1];
|
|
55187
|
+
var startLen = Math.min(sourceStart.length, targetStart.length);
|
|
55188
|
+
var endLen = Math.min(sourceEnd.length, targetEnd.length);
|
|
55189
|
+
return sourceStart.slice(0, startLen) !== targetStart.slice(0, startLen) ||
|
|
55190
|
+
sourceEnd.slice(sourceEnd.length - endLen) !== targetEnd.slice(targetEnd.length - endLen);
|
|
55191
|
+
}
|
|
54919
55192
|
function isValidBigIntString(s) {
|
|
54920
55193
|
var scanner = ts.createScanner(99, false);
|
|
54921
55194
|
var success = true;
|
|
@@ -55395,8 +55668,10 @@ var ts;
|
|
|
55395
55668
|
function inferToTemplateLiteralType(source, target) {
|
|
55396
55669
|
var matches = inferTypesFromTemplateLiteralType(source, target);
|
|
55397
55670
|
var types = target.types;
|
|
55398
|
-
|
|
55399
|
-
|
|
55671
|
+
if (matches || ts.every(target.texts, function (s) { return s.length === 0; })) {
|
|
55672
|
+
for (var i = 0; i < types.length; i++) {
|
|
55673
|
+
inferFromTypes(matches ? matches[i] : neverType, types[i]);
|
|
55674
|
+
}
|
|
55400
55675
|
}
|
|
55401
55676
|
}
|
|
55402
55677
|
function inferFromObjectTypes(source, target) {
|
|
@@ -55818,7 +56093,7 @@ var ts;
|
|
|
55818
56093
|
if (prop.isDiscriminantProperty === undefined) {
|
|
55819
56094
|
prop.isDiscriminantProperty =
|
|
55820
56095
|
(prop.checkFlags & 192) === 192 &&
|
|
55821
|
-
!
|
|
56096
|
+
!isGenericType(getTypeOfSymbol(prop));
|
|
55822
56097
|
}
|
|
55823
56098
|
return !!prop.isDiscriminantProperty;
|
|
55824
56099
|
}
|
|
@@ -56308,13 +56583,13 @@ var ts;
|
|
|
56308
56583
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
56309
56584
|
}
|
|
56310
56585
|
function replacePrimitivesWithLiterals(typeWithPrimitives, typeWithLiterals) {
|
|
56311
|
-
if (
|
|
56312
|
-
|
|
56313
|
-
isTypeSubsetOf(bigintType, typeWithPrimitives) && maybeTypeOfKind(typeWithLiterals, 2048)) {
|
|
56586
|
+
if (maybeTypeOfKind(typeWithPrimitives, 4 | 134217728 | 8 | 64) &&
|
|
56587
|
+
maybeTypeOfKind(typeWithLiterals, 128 | 134217728 | 268435456 | 256 | 2048)) {
|
|
56314
56588
|
return mapType(typeWithPrimitives, function (t) {
|
|
56315
|
-
return t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 128) :
|
|
56316
|
-
t
|
|
56317
|
-
t.flags &
|
|
56589
|
+
return t.flags & 4 ? extractTypesOfKind(typeWithLiterals, 4 | 128 | 134217728 | 268435456) :
|
|
56590
|
+
isPatternLiteralType(t) && !maybeTypeOfKind(typeWithLiterals, 4 | 134217728 | 268435456) ? extractTypesOfKind(typeWithLiterals, 128) :
|
|
56591
|
+
t.flags & 8 ? extractTypesOfKind(typeWithLiterals, 8 | 256) :
|
|
56592
|
+
t.flags & 64 ? extractTypesOfKind(typeWithLiterals, 64 | 2048) : t;
|
|
56318
56593
|
});
|
|
56319
56594
|
}
|
|
56320
56595
|
return typeWithPrimitives;
|
|
@@ -56385,10 +56660,10 @@ var ts;
|
|
|
56385
56660
|
isTypeAssignableToKind(getTypeOfExpression(parent.argumentExpression), 296);
|
|
56386
56661
|
return isLengthPushOrUnshift || isElementAssignment;
|
|
56387
56662
|
}
|
|
56388
|
-
function isDeclarationWithExplicitTypeAnnotation(
|
|
56389
|
-
return (
|
|
56390
|
-
|
|
56391
|
-
|
|
56663
|
+
function isDeclarationWithExplicitTypeAnnotation(node) {
|
|
56664
|
+
return (ts.isVariableDeclaration(node) || ts.isPropertyDeclaration(node) || ts.isPropertySignature(node) || ts.isParameter(node)) &&
|
|
56665
|
+
!!(ts.getEffectiveTypeAnnotationNode(node) ||
|
|
56666
|
+
ts.isInJSFile(node) && ts.hasInitializer(node) && node.initializer && ts.isFunctionExpressionOrArrowFunction(node.initializer) && ts.getEffectiveReturnTypeNode(node.initializer));
|
|
56392
56667
|
}
|
|
56393
56668
|
function getExplicitTypeOfSymbol(symbol, diagnostic) {
|
|
56394
56669
|
if (symbol.flags & (16 | 8192 | 32 | 512)) {
|
|
@@ -57011,7 +57286,7 @@ var ts;
|
|
|
57011
57286
|
var narrowedPropType = narrowType(propType);
|
|
57012
57287
|
return filterType(type, function (t) {
|
|
57013
57288
|
var discriminantType = getTypeOfPropertyOrIndexSignature(t, propName);
|
|
57014
|
-
return !(
|
|
57289
|
+
return !(narrowedPropType.flags & 131072) && isTypeComparableTo(narrowedPropType, discriminantType);
|
|
57015
57290
|
});
|
|
57016
57291
|
}
|
|
57017
57292
|
function narrowTypeByDiscriminantProperty(type, access, operator, value, assumeTrue) {
|
|
@@ -57120,6 +57395,9 @@ var ts;
|
|
|
57120
57395
|
case 102:
|
|
57121
57396
|
return narrowTypeByInstanceof(type, expr, assumeTrue);
|
|
57122
57397
|
case 101:
|
|
57398
|
+
if (ts.isPrivateIdentifier(expr.left)) {
|
|
57399
|
+
return narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue);
|
|
57400
|
+
}
|
|
57123
57401
|
var target = getReferenceCandidate(expr.right);
|
|
57124
57402
|
var leftType = getTypeOfNode(expr.left);
|
|
57125
57403
|
if (leftType.flags & 128) {
|
|
@@ -57146,6 +57424,22 @@ var ts;
|
|
|
57146
57424
|
}
|
|
57147
57425
|
return type;
|
|
57148
57426
|
}
|
|
57427
|
+
function narrowTypeByPrivateIdentifierInInExpression(type, expr, assumeTrue) {
|
|
57428
|
+
var target = getReferenceCandidate(expr.right);
|
|
57429
|
+
if (!isMatchingReference(reference, target)) {
|
|
57430
|
+
return type;
|
|
57431
|
+
}
|
|
57432
|
+
ts.Debug.assertNode(expr.left, ts.isPrivateIdentifier);
|
|
57433
|
+
var symbol = getSymbolForPrivateIdentifierExpression(expr.left);
|
|
57434
|
+
if (symbol === undefined) {
|
|
57435
|
+
return type;
|
|
57436
|
+
}
|
|
57437
|
+
var classSymbol = symbol.parent;
|
|
57438
|
+
var targetType = ts.hasStaticModifier(ts.Debug.checkDefined(symbol.valueDeclaration, "should always have a declaration"))
|
|
57439
|
+
? getTypeOfSymbol(classSymbol)
|
|
57440
|
+
: getDeclaredTypeOfSymbol(classSymbol);
|
|
57441
|
+
return getNarrowedType(type, targetType, assumeTrue, isTypeDerivedFrom);
|
|
57442
|
+
}
|
|
57149
57443
|
function narrowTypeByOptionalChainContainment(type, operator, value, assumeTrue) {
|
|
57150
57444
|
var equalsOperator = operator === 34 || operator === 36;
|
|
57151
57445
|
var nullableFlags = operator === 34 || operator === 35 ? 98304 : 32768;
|
|
@@ -57162,6 +57456,9 @@ var ts;
|
|
|
57162
57456
|
assumeTrue = !assumeTrue;
|
|
57163
57457
|
}
|
|
57164
57458
|
var valueType = getTypeOfExpression(value);
|
|
57459
|
+
if (assumeTrue && (type.flags & 2) && (operator === 34 || operator === 35) && (valueType.flags & 65536)) {
|
|
57460
|
+
return getUnionType([nullType, undefinedType]);
|
|
57461
|
+
}
|
|
57165
57462
|
if ((type.flags & 2) && assumeTrue && (operator === 36 || operator === 37)) {
|
|
57166
57463
|
if (valueType.flags & (131068 | 67108864)) {
|
|
57167
57464
|
return valueType;
|
|
@@ -57383,16 +57680,7 @@ var ts;
|
|
|
57383
57680
|
}
|
|
57384
57681
|
function getNarrowedType(type, candidate, assumeTrue, isRelated) {
|
|
57385
57682
|
if (!assumeTrue) {
|
|
57386
|
-
return filterType(type, function (t) {
|
|
57387
|
-
if (!isRelated(t, candidate)) {
|
|
57388
|
-
return true;
|
|
57389
|
-
}
|
|
57390
|
-
var constraint = getBaseConstraintOfType(t);
|
|
57391
|
-
if (constraint && constraint !== t) {
|
|
57392
|
-
return !isRelated(constraint, candidate);
|
|
57393
|
-
}
|
|
57394
|
-
return false;
|
|
57395
|
-
});
|
|
57683
|
+
return filterType(type, function (t) { return !isRelated(t, candidate); });
|
|
57396
57684
|
}
|
|
57397
57685
|
if (type.flags & 1048576) {
|
|
57398
57686
|
var assignableType = filterType(type, function (t) { return isRelated(t, candidate); });
|
|
@@ -58315,8 +58603,8 @@ var ts;
|
|
|
58315
58603
|
contextualReturnType = iterationTypes.returnType;
|
|
58316
58604
|
}
|
|
58317
58605
|
if (functionFlags & 2) {
|
|
58318
|
-
var contextualAwaitedType = mapType(contextualReturnType,
|
|
58319
|
-
return contextualAwaitedType && getUnionType([
|
|
58606
|
+
var contextualAwaitedType = mapType(contextualReturnType, getAwaitedTypeNoAlias);
|
|
58607
|
+
return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]);
|
|
58320
58608
|
}
|
|
58321
58609
|
return contextualReturnType;
|
|
58322
58610
|
}
|
|
@@ -58326,8 +58614,8 @@ var ts;
|
|
|
58326
58614
|
function getContextualTypeForAwaitOperand(node, contextFlags) {
|
|
58327
58615
|
var contextualType = getContextualType(node, contextFlags);
|
|
58328
58616
|
if (contextualType) {
|
|
58329
|
-
var contextualAwaitedType =
|
|
58330
|
-
return contextualAwaitedType && getUnionType([
|
|
58617
|
+
var contextualAwaitedType = getAwaitedTypeNoAlias(contextualType);
|
|
58618
|
+
return contextualAwaitedType && getUnionType([contextualAwaitedType, createPromiseLikeType(contextualAwaitedType)]);
|
|
58331
58619
|
}
|
|
58332
58620
|
return undefined;
|
|
58333
58621
|
}
|
|
@@ -58592,8 +58880,8 @@ var ts;
|
|
|
58592
58880
|
return getTypeOfPropertyOfContextualType(type, getSymbolOfNode(element).escapedName);
|
|
58593
58881
|
}
|
|
58594
58882
|
if (element.name) {
|
|
58595
|
-
var
|
|
58596
|
-
return mapType(type, function (t) { var _a; return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t),
|
|
58883
|
+
var nameType_2 = getLiteralTypeFromPropertyName(element.name);
|
|
58884
|
+
return mapType(type, function (t) { var _a; return (_a = findApplicableIndexInfo(getIndexInfosOfStructuredType(t), nameType_2)) === null || _a === void 0 ? void 0 : _a.type; }, true);
|
|
58597
58885
|
}
|
|
58598
58886
|
}
|
|
58599
58887
|
return undefined;
|
|
@@ -58794,7 +59082,7 @@ var ts;
|
|
|
58794
59082
|
var propsType = getTypeOfFirstParameterOfSignatureWithFallback(sig, unknownType);
|
|
58795
59083
|
propsType = getJsxManagedAttributesFromLocatedAttributes(context, getJsxNamespaceAt(context), propsType);
|
|
58796
59084
|
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
|
|
58797
|
-
if (intrinsicAttribs
|
|
59085
|
+
if (!isErrorType(intrinsicAttribs)) {
|
|
58798
59086
|
propsType = intersectTypes(intrinsicAttribs, propsType);
|
|
58799
59087
|
}
|
|
58800
59088
|
return propsType;
|
|
@@ -58876,7 +59164,7 @@ var ts;
|
|
|
58876
59164
|
else {
|
|
58877
59165
|
var apparentAttributesType = attributesType;
|
|
58878
59166
|
var intrinsicClassAttribs = getJsxType(JsxNames.IntrinsicClassAttributes, context);
|
|
58879
|
-
if (intrinsicClassAttribs
|
|
59167
|
+
if (!isErrorType(intrinsicClassAttribs)) {
|
|
58880
59168
|
var typeParams = getLocalTypeParametersOfClassOrInterfaceOrTypeAlias(intrinsicClassAttribs.symbol);
|
|
58881
59169
|
var hostClassType = getReturnTypeOfSignature(sig);
|
|
58882
59170
|
apparentAttributesType = intersectTypes(typeParams
|
|
@@ -58884,7 +59172,7 @@ var ts;
|
|
|
58884
59172
|
: intrinsicClassAttribs, apparentAttributesType);
|
|
58885
59173
|
}
|
|
58886
59174
|
var intrinsicAttribs = getJsxType(JsxNames.IntrinsicAttributes, context);
|
|
58887
|
-
if (intrinsicAttribs
|
|
59175
|
+
if (!isErrorType(intrinsicAttribs)) {
|
|
58888
59176
|
apparentAttributesType = intersectTypes(intrinsicAttribs, apparentAttributesType);
|
|
58889
59177
|
}
|
|
58890
59178
|
return apparentAttributesType;
|
|
@@ -58983,11 +59271,8 @@ var ts;
|
|
|
58983
59271
|
}
|
|
58984
59272
|
return !hasEffectiveRestParameter(signature) && getParameterCount(signature) < targetParameterCount;
|
|
58985
59273
|
}
|
|
58986
|
-
function isFunctionExpressionOrArrowFunction(node) {
|
|
58987
|
-
return node.kind === 212 || node.kind === 213;
|
|
58988
|
-
}
|
|
58989
59274
|
function getContextualSignatureForFunctionLikeDeclaration(node) {
|
|
58990
|
-
return isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
|
|
59275
|
+
return ts.isFunctionExpressionOrArrowFunction(node) || ts.isObjectLiteralMethod(node)
|
|
58991
59276
|
? getContextualSignature(node)
|
|
58992
59277
|
: undefined;
|
|
58993
59278
|
}
|
|
@@ -59280,7 +59565,7 @@ var ts;
|
|
|
59280
59565
|
checkSpreadPropOverrides(mergedType, allPropertiesTable, memberDecl);
|
|
59281
59566
|
}
|
|
59282
59567
|
offset = propertiesArray.length;
|
|
59283
|
-
if (spread
|
|
59568
|
+
if (isErrorType(spread)) {
|
|
59284
59569
|
continue;
|
|
59285
59570
|
}
|
|
59286
59571
|
spread = getSpreadType(spread, mergedType, node.symbol, objectFlags, inConstContext);
|
|
@@ -59328,7 +59613,7 @@ var ts;
|
|
|
59328
59613
|
}
|
|
59329
59614
|
}
|
|
59330
59615
|
}
|
|
59331
|
-
if (spread
|
|
59616
|
+
if (isErrorType(spread)) {
|
|
59332
59617
|
return errorType;
|
|
59333
59618
|
}
|
|
59334
59619
|
if (spread !== emptyObjectType) {
|
|
@@ -59553,7 +59838,7 @@ var ts;
|
|
|
59553
59838
|
var links = getNodeLinks(node);
|
|
59554
59839
|
if (!links.resolvedSymbol) {
|
|
59555
59840
|
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, node);
|
|
59556
|
-
if (intrinsicElementsType
|
|
59841
|
+
if (!isErrorType(intrinsicElementsType)) {
|
|
59557
59842
|
if (!ts.isIdentifier(node.tagName))
|
|
59558
59843
|
return ts.Debug.fail();
|
|
59559
59844
|
var intrinsicProp = getPropertyOfType(intrinsicElementsType, node.tagName.escapedText);
|
|
@@ -59685,7 +59970,7 @@ var ts;
|
|
|
59685
59970
|
}
|
|
59686
59971
|
function getIntrinsicAttributesTypeFromStringLiteralType(type, location) {
|
|
59687
59972
|
var intrinsicElementsType = getJsxType(JsxNames.IntrinsicElements, location);
|
|
59688
|
-
if (intrinsicElementsType
|
|
59973
|
+
if (!isErrorType(intrinsicElementsType)) {
|
|
59689
59974
|
var stringLiteralTypeName = type.value;
|
|
59690
59975
|
var intrinsicProp = getPropertyOfType(intrinsicElementsType, ts.escapeLeadingUnderscores(stringLiteralTypeName));
|
|
59691
59976
|
if (intrinsicProp) {
|
|
@@ -59746,7 +60031,7 @@ var ts;
|
|
|
59746
60031
|
}
|
|
59747
60032
|
function getJsxElementClassTypeAt(location) {
|
|
59748
60033
|
var type = getJsxType(JsxNames.ElementClass, location);
|
|
59749
|
-
if (type
|
|
60034
|
+
if (isErrorType(type))
|
|
59750
60035
|
return undefined;
|
|
59751
60036
|
return type;
|
|
59752
60037
|
}
|
|
@@ -59793,6 +60078,13 @@ var ts;
|
|
|
59793
60078
|
markAliasSymbolAsReferenced(jsxFactorySym);
|
|
59794
60079
|
}
|
|
59795
60080
|
}
|
|
60081
|
+
if (ts.isJsxOpeningFragment(node)) {
|
|
60082
|
+
var file = ts.getSourceFileOfNode(node);
|
|
60083
|
+
var localJsxNamespace = getLocalJsxNamespace(file);
|
|
60084
|
+
if (localJsxNamespace) {
|
|
60085
|
+
resolveName(jsxFactoryLocation, localJsxNamespace, 111551, jsxFactoryRefErr, localJsxNamespace, true);
|
|
60086
|
+
}
|
|
60087
|
+
}
|
|
59796
60088
|
}
|
|
59797
60089
|
if (isNodeOpeningLikeElement) {
|
|
59798
60090
|
var jsxOpeningLikeNode = node;
|
|
@@ -59979,7 +60271,7 @@ var ts;
|
|
|
59979
60271
|
}
|
|
59980
60272
|
function checkNonNullNonVoidType(type, node) {
|
|
59981
60273
|
var nonNullType = checkNonNullType(type, node);
|
|
59982
|
-
if (nonNullType
|
|
60274
|
+
if (nonNullType.flags & 16384) {
|
|
59983
60275
|
error(node, ts.Diagnostics.Object_is_possibly_undefined);
|
|
59984
60276
|
}
|
|
59985
60277
|
return nonNullType;
|
|
@@ -60013,6 +60305,36 @@ var ts;
|
|
|
60013
60305
|
}
|
|
60014
60306
|
}
|
|
60015
60307
|
}
|
|
60308
|
+
function checkGrammarPrivateIdentifierExpression(privId) {
|
|
60309
|
+
if (!ts.getContainingClass(privId)) {
|
|
60310
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
60311
|
+
}
|
|
60312
|
+
if (!ts.isExpressionNode(privId)) {
|
|
60313
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.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);
|
|
60314
|
+
}
|
|
60315
|
+
if (!getSymbolForPrivateIdentifierExpression(privId)) {
|
|
60316
|
+
return grammarErrorOnNode(privId, ts.Diagnostics.Cannot_find_name_0, ts.idText(privId));
|
|
60317
|
+
}
|
|
60318
|
+
return false;
|
|
60319
|
+
}
|
|
60320
|
+
function checkPrivateIdentifierExpression(privId) {
|
|
60321
|
+
checkGrammarPrivateIdentifierExpression(privId);
|
|
60322
|
+
var symbol = getSymbolForPrivateIdentifierExpression(privId);
|
|
60323
|
+
if (symbol) {
|
|
60324
|
+
markPropertyAsReferenced(symbol, undefined, false);
|
|
60325
|
+
}
|
|
60326
|
+
return anyType;
|
|
60327
|
+
}
|
|
60328
|
+
function getSymbolForPrivateIdentifierExpression(privId) {
|
|
60329
|
+
if (!ts.isExpressionNode(privId)) {
|
|
60330
|
+
return undefined;
|
|
60331
|
+
}
|
|
60332
|
+
var links = getNodeLinks(privId);
|
|
60333
|
+
if (links.resolvedSymbol === undefined) {
|
|
60334
|
+
links.resolvedSymbol = lookupSymbolForPrivateIdentifierDeclaration(privId.escapedText, privId);
|
|
60335
|
+
}
|
|
60336
|
+
return links.resolvedSymbol;
|
|
60337
|
+
}
|
|
60016
60338
|
function getPrivateIdentifierPropertyOfType(leftType, lexicallyScopedIdentifier) {
|
|
60017
60339
|
return getPropertyOfType(leftType, lexicallyScopedIdentifier.escapedName);
|
|
60018
60340
|
}
|
|
@@ -60089,7 +60411,7 @@ var ts;
|
|
|
60089
60411
|
}
|
|
60090
60412
|
if (isAnyLike) {
|
|
60091
60413
|
if (lexicallyScopedSymbol) {
|
|
60092
|
-
return apparentType;
|
|
60414
|
+
return isErrorType(apparentType) ? errorType : apparentType;
|
|
60093
60415
|
}
|
|
60094
60416
|
if (!ts.getContainingClass(right)) {
|
|
60095
60417
|
grammarErrorOnNode(right, ts.Diagnostics.Private_identifiers_are_not_allowed_outside_class_bodies);
|
|
@@ -60112,7 +60434,8 @@ var ts;
|
|
|
60112
60434
|
if (ts.isIdentifier(left) && parentSymbol) {
|
|
60113
60435
|
markAliasReferenced(parentSymbol, node);
|
|
60114
60436
|
}
|
|
60115
|
-
return apparentType;
|
|
60437
|
+
return isErrorType(apparentType) ? errorType : apparentType;
|
|
60438
|
+
;
|
|
60116
60439
|
}
|
|
60117
60440
|
prop = getPropertyOfType(apparentType, right.escapedText);
|
|
60118
60441
|
}
|
|
@@ -60515,14 +60838,14 @@ var ts;
|
|
|
60515
60838
|
return isPropertyAccessible(node, node.kind === 205 && node.expression.kind === 106, false, type, property);
|
|
60516
60839
|
}
|
|
60517
60840
|
function isValidPropertyAccessWithType(node, isSuper, propertyName, type) {
|
|
60518
|
-
if (
|
|
60841
|
+
if (isTypeAny(type)) {
|
|
60519
60842
|
return true;
|
|
60520
60843
|
}
|
|
60521
60844
|
var prop = getPropertyOfType(type, propertyName);
|
|
60522
60845
|
return !!prop && isPropertyAccessible(node, isSuper, false, type, prop);
|
|
60523
60846
|
}
|
|
60524
60847
|
function isPropertyAccessible(node, isSuper, isWrite, containingType, property) {
|
|
60525
|
-
if (
|
|
60848
|
+
if (isTypeAny(containingType)) {
|
|
60526
60849
|
return true;
|
|
60527
60850
|
}
|
|
60528
60851
|
if (property.valueDeclaration && ts.isPrivateIdentifierClassElementDeclaration(property.valueDeclaration)) {
|
|
@@ -60581,7 +60904,7 @@ var ts;
|
|
|
60581
60904
|
var objectType = ts.getAssignmentTargetKind(node) !== 0 || isMethodAccessForCall(node) ? getWidenedType(exprType) : exprType;
|
|
60582
60905
|
var indexExpression = node.argumentExpression;
|
|
60583
60906
|
var indexType = checkExpression(indexExpression);
|
|
60584
|
-
if (objectType
|
|
60907
|
+
if (isErrorType(objectType) || objectType === silentNeverType) {
|
|
60585
60908
|
return objectType;
|
|
60586
60909
|
}
|
|
60587
60910
|
if (isConstEnumObjectType(objectType) && !ts.isStringLiteralLike(indexExpression)) {
|
|
@@ -60786,7 +61109,7 @@ var ts;
|
|
|
60786
61109
|
return inferJsxTypeArguments(node, signature, checkMode, context);
|
|
60787
61110
|
}
|
|
60788
61111
|
if (node.kind !== 164) {
|
|
60789
|
-
var contextualType = getContextualType(node, 8);
|
|
61112
|
+
var contextualType = getContextualType(node, ts.every(signature.typeParameters, function (p) { return !!getDefaultFromTypeParameter(p); }) ? 8 : 0);
|
|
60790
61113
|
if (contextualType) {
|
|
60791
61114
|
var outerContext = getInferenceContext(node);
|
|
60792
61115
|
var outerMapper = getMapperFromContext(cloneInferenceContext(outerContext, 1));
|
|
@@ -61185,7 +61508,7 @@ var ts;
|
|
|
61185
61508
|
return false;
|
|
61186
61509
|
var symbol = resolveName(node.expression, node.expression.escapedText, 111551, undefined, undefined, false);
|
|
61187
61510
|
var decl = symbol === null || symbol === void 0 ? void 0 : symbol.valueDeclaration;
|
|
61188
|
-
if (!decl || !ts.isParameter(decl) || !isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) {
|
|
61511
|
+
if (!decl || !ts.isParameter(decl) || !ts.isFunctionExpressionOrArrowFunction(decl.parent) || !ts.isNewExpression(decl.parent.parent) || !ts.isIdentifier(decl.parent.parent.expression)) {
|
|
61189
61512
|
return false;
|
|
61190
61513
|
}
|
|
61191
61514
|
var globalPromiseSymbol = getGlobalPromiseConstructorSymbol(false);
|
|
@@ -61592,7 +61915,7 @@ var ts;
|
|
|
61592
61915
|
}
|
|
61593
61916
|
return anySignature;
|
|
61594
61917
|
}
|
|
61595
|
-
if (superType
|
|
61918
|
+
if (!isErrorType(superType)) {
|
|
61596
61919
|
var baseTypeNode = ts.getEffectiveBaseTypeNode(ts.getContainingClass(node));
|
|
61597
61920
|
if (baseTypeNode) {
|
|
61598
61921
|
var baseConstructors = getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.typeArguments, baseTypeNode);
|
|
@@ -61618,13 +61941,13 @@ var ts;
|
|
|
61618
61941
|
return silentNeverSignature;
|
|
61619
61942
|
}
|
|
61620
61943
|
var apparentType = getApparentType(funcType);
|
|
61621
|
-
if (apparentType
|
|
61944
|
+
if (isErrorType(apparentType)) {
|
|
61622
61945
|
return resolveErrorCall(node);
|
|
61623
61946
|
}
|
|
61624
61947
|
var callSignatures = getSignaturesOfType(apparentType, 0);
|
|
61625
61948
|
var numConstructSignatures = getSignaturesOfType(apparentType, 1).length;
|
|
61626
61949
|
if (isUntypedFunctionCall(funcType, apparentType, callSignatures.length, numConstructSignatures)) {
|
|
61627
|
-
if (funcType
|
|
61950
|
+
if (!isErrorType(funcType) && node.typeArguments) {
|
|
61628
61951
|
error(node, ts.Diagnostics.Untyped_function_calls_may_not_accept_type_arguments);
|
|
61629
61952
|
}
|
|
61630
61953
|
return resolveUntypedCall(node);
|
|
@@ -61674,7 +61997,7 @@ var ts;
|
|
|
61674
61997
|
return silentNeverSignature;
|
|
61675
61998
|
}
|
|
61676
61999
|
expressionType = getApparentType(expressionType);
|
|
61677
|
-
if (expressionType
|
|
62000
|
+
if (isErrorType(expressionType)) {
|
|
61678
62001
|
return resolveErrorCall(node);
|
|
61679
62002
|
}
|
|
61680
62003
|
if (isTypeAny(expressionType)) {
|
|
@@ -61863,7 +62186,7 @@ var ts;
|
|
|
61863
62186
|
function resolveTaggedTemplateExpression(node, candidatesOutArray, checkMode) {
|
|
61864
62187
|
var tagType = checkExpression(node.tag);
|
|
61865
62188
|
var apparentType = getApparentType(tagType);
|
|
61866
|
-
if (apparentType
|
|
62189
|
+
if (isErrorType(apparentType)) {
|
|
61867
62190
|
return resolveErrorCall(node);
|
|
61868
62191
|
}
|
|
61869
62192
|
var callSignatures = getSignaturesOfType(apparentType, 0);
|
|
@@ -61902,7 +62225,7 @@ var ts;
|
|
|
61902
62225
|
function resolveDecorator(node, candidatesOutArray, checkMode) {
|
|
61903
62226
|
var funcType = checkExpression(node.expression);
|
|
61904
62227
|
var apparentType = getApparentType(funcType);
|
|
61905
|
-
if (apparentType
|
|
62228
|
+
if (isErrorType(apparentType)) {
|
|
61906
62229
|
return resolveErrorCall(node);
|
|
61907
62230
|
}
|
|
61908
62231
|
var callSignatures = getSignaturesOfType(apparentType, 0);
|
|
@@ -61952,7 +62275,7 @@ var ts;
|
|
|
61952
62275
|
}
|
|
61953
62276
|
var exprTypes = checkExpression(node.tagName);
|
|
61954
62277
|
var apparentType = getApparentType(exprTypes);
|
|
61955
|
-
if (apparentType
|
|
62278
|
+
if (isErrorType(apparentType)) {
|
|
61956
62279
|
return resolveErrorCall(node);
|
|
61957
62280
|
}
|
|
61958
62281
|
var signatures = getUninstantiatedJsxSignaturesOfType(exprTypes, node);
|
|
@@ -62225,18 +62548,18 @@ var ts;
|
|
|
62225
62548
|
if (moduleSymbol) {
|
|
62226
62549
|
var esModuleSymbol = resolveESModuleSymbol(moduleSymbol, specifier, true, false);
|
|
62227
62550
|
if (esModuleSymbol) {
|
|
62228
|
-
return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol));
|
|
62551
|
+
return createPromiseReturnType(node, getTypeWithSyntheticDefaultImportType(getTypeOfSymbol(esModuleSymbol), esModuleSymbol, moduleSymbol, specifier));
|
|
62229
62552
|
}
|
|
62230
62553
|
}
|
|
62231
62554
|
return createPromiseReturnType(node, anyType);
|
|
62232
62555
|
}
|
|
62233
|
-
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol) {
|
|
62556
|
+
function getTypeWithSyntheticDefaultImportType(type, symbol, originalSymbol, moduleSpecifier) {
|
|
62234
62557
|
var _a;
|
|
62235
|
-
if (allowSyntheticDefaultImports && type && type
|
|
62558
|
+
if (allowSyntheticDefaultImports && type && !isErrorType(type)) {
|
|
62236
62559
|
var synthType = type;
|
|
62237
62560
|
if (!synthType.syntheticType) {
|
|
62238
62561
|
var file = (_a = originalSymbol.declarations) === null || _a === void 0 ? void 0 : _a.find(ts.isSourceFile);
|
|
62239
|
-
var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false);
|
|
62562
|
+
var hasSyntheticDefault = canHaveSyntheticDefault(file, originalSymbol, false, moduleSpecifier);
|
|
62240
62563
|
if (hasSyntheticDefault) {
|
|
62241
62564
|
var memberTable = ts.createSymbolTable();
|
|
62242
62565
|
var newSymbol = createSymbol(2097152, "default");
|
|
@@ -62322,13 +62645,11 @@ var ts;
|
|
|
62322
62645
|
case 205:
|
|
62323
62646
|
case 206:
|
|
62324
62647
|
var expr = node.expression;
|
|
62325
|
-
|
|
62326
|
-
|
|
62327
|
-
|
|
62328
|
-
symbol = resolveAlias(symbol);
|
|
62329
|
-
}
|
|
62330
|
-
return !!(symbol && (symbol.flags & 384) && getEnumKind(symbol) === 1);
|
|
62648
|
+
var symbol = getTypeOfNode(expr).symbol;
|
|
62649
|
+
if (symbol && symbol.flags & 2097152) {
|
|
62650
|
+
symbol = resolveAlias(symbol);
|
|
62331
62651
|
}
|
|
62652
|
+
return !!(symbol && (symbol.flags & 384) && getEnumKind(symbol) === 1);
|
|
62332
62653
|
}
|
|
62333
62654
|
return false;
|
|
62334
62655
|
}
|
|
@@ -62343,7 +62664,7 @@ var ts;
|
|
|
62343
62664
|
checkSourceElement(type);
|
|
62344
62665
|
exprType = getRegularTypeOfObjectLiteral(getBaseTypeOfLiteralType(exprType));
|
|
62345
62666
|
var targetType = getTypeFromTypeNode(type);
|
|
62346
|
-
if (produceDiagnostics && targetType
|
|
62667
|
+
if (produceDiagnostics && !isErrorType(targetType)) {
|
|
62347
62668
|
var widenedType = getWidenedType(exprType);
|
|
62348
62669
|
if (!isTypeComparableTo(targetType, widenedType)) {
|
|
62349
62670
|
checkTypeComparableTo(exprType, targetType, errNode, ts.Diagnostics.Conversion_of_type_0_to_type_1_may_be_a_mistake_because_neither_type_sufficiently_overlaps_with_the_other_If_this_was_intentional_convert_the_expression_to_unknown_first);
|
|
@@ -62376,7 +62697,7 @@ var ts;
|
|
|
62376
62697
|
return getGlobalImportMetaExpressionType();
|
|
62377
62698
|
case 103:
|
|
62378
62699
|
var type = checkNewTargetMetaProperty(node);
|
|
62379
|
-
return type
|
|
62700
|
+
return isErrorType(type) ? errorType : createNewTargetExpressionType(type);
|
|
62380
62701
|
default:
|
|
62381
62702
|
ts.Debug.assertNever(node.keywordToken);
|
|
62382
62703
|
}
|
|
@@ -62397,16 +62718,14 @@ var ts;
|
|
|
62397
62718
|
}
|
|
62398
62719
|
}
|
|
62399
62720
|
function checkImportMetaProperty(node) {
|
|
62400
|
-
if (moduleKind
|
|
62401
|
-
if (
|
|
62402
|
-
|
|
62403
|
-
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
62404
|
-
}
|
|
62405
|
-
}
|
|
62406
|
-
else {
|
|
62407
|
-
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_esnext_system_node12_or_nodenext);
|
|
62721
|
+
if (moduleKind === ts.ModuleKind.Node12 || moduleKind === ts.ModuleKind.NodeNext) {
|
|
62722
|
+
if (ts.getSourceFileOfNode(node).impliedNodeFormat !== ts.ModuleKind.ESNext) {
|
|
62723
|
+
error(node, ts.Diagnostics.The_import_meta_meta_property_is_not_allowed_in_files_which_will_build_into_CommonJS_output);
|
|
62408
62724
|
}
|
|
62409
62725
|
}
|
|
62726
|
+
else if (moduleKind < ts.ModuleKind.ES2020 && moduleKind !== ts.ModuleKind.System) {
|
|
62727
|
+
error(node, ts.Diagnostics.The_import_meta_meta_property_is_only_allowed_when_the_module_option_is_es2020_es2022_esnext_system_node12_or_nodenext);
|
|
62728
|
+
}
|
|
62410
62729
|
var file = ts.getSourceFileOfNode(node);
|
|
62411
62730
|
ts.Debug.assert(!!(file.flags & 2097152), "Containing file is missing import meta node flag.");
|
|
62412
62731
|
return node.name.escapedText === "meta" ? getGlobalImportMetaType() : errorType;
|
|
@@ -62694,7 +63013,7 @@ var ts;
|
|
|
62694
63013
|
function createPromiseType(promisedType) {
|
|
62695
63014
|
var globalPromiseType = getGlobalPromiseType(true);
|
|
62696
63015
|
if (globalPromiseType !== emptyGenericType) {
|
|
62697
|
-
promisedType =
|
|
63016
|
+
promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType;
|
|
62698
63017
|
return createTypeReference(globalPromiseType, [promisedType]);
|
|
62699
63018
|
}
|
|
62700
63019
|
return unknownType;
|
|
@@ -62702,7 +63021,7 @@ var ts;
|
|
|
62702
63021
|
function createPromiseLikeType(promisedType) {
|
|
62703
63022
|
var globalPromiseLikeType = getGlobalPromiseLikeType(true);
|
|
62704
63023
|
if (globalPromiseLikeType !== emptyGenericType) {
|
|
62705
|
-
promisedType =
|
|
63024
|
+
promisedType = getAwaitedTypeNoAlias(unwrapAwaitedType(promisedType)) || unknownType;
|
|
62706
63025
|
return createTypeReference(globalPromiseLikeType, [promisedType]);
|
|
62707
63026
|
}
|
|
62708
63027
|
return unknownType;
|
|
@@ -62745,7 +63064,7 @@ var ts;
|
|
|
62745
63064
|
if (func.body.kind !== 234) {
|
|
62746
63065
|
returnType = checkExpressionCached(func.body, checkMode && checkMode & ~8);
|
|
62747
63066
|
if (isAsync) {
|
|
62748
|
-
returnType = checkAwaitedType(returnType, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
63067
|
+
returnType = unwrapAwaitedType(checkAwaitedType(returnType, false, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member));
|
|
62749
63068
|
}
|
|
62750
63069
|
}
|
|
62751
63070
|
else if (isGenerator) {
|
|
@@ -62925,7 +63244,7 @@ var ts;
|
|
|
62925
63244
|
if (expr) {
|
|
62926
63245
|
var type = checkExpressionCached(expr, checkMode && checkMode & ~8);
|
|
62927
63246
|
if (functionFlags & 2) {
|
|
62928
|
-
type = checkAwaitedType(type, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
63247
|
+
type = unwrapAwaitedType(checkAwaitedType(type, false, func, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member));
|
|
62929
63248
|
}
|
|
62930
63249
|
if (type.flags & 131072) {
|
|
62931
63250
|
hasReturnOfTypeNever = true;
|
|
@@ -63073,7 +63392,7 @@ var ts;
|
|
|
63073
63392
|
var returnOrPromisedType = returnType && unwrapReturnType(returnType, functionFlags);
|
|
63074
63393
|
if (returnOrPromisedType) {
|
|
63075
63394
|
if ((functionFlags & 3) === 2) {
|
|
63076
|
-
var awaitedType = checkAwaitedType(exprType, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
63395
|
+
var awaitedType = checkAwaitedType(exprType, false, node.body, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
63077
63396
|
checkTypeAssignableToAndOptionallyElaborate(awaitedType, returnOrPromisedType, node.body, node.body);
|
|
63078
63397
|
}
|
|
63079
63398
|
else {
|
|
@@ -63232,9 +63551,9 @@ var ts;
|
|
|
63232
63551
|
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);
|
|
63233
63552
|
diagnostics.add(diagnostic);
|
|
63234
63553
|
}
|
|
63235
|
-
if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
|
|
63554
|
+
if ((moduleKind !== ts.ModuleKind.ES2022 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(node).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
|
|
63236
63555
|
span = ts.getSpanOfTokenAtPosition(sourceFile, node.pos);
|
|
63237
|
-
var diagnostic = ts.createFileDiagnostic(sourceFile, span.start, span.length, ts.Diagnostics.
|
|
63556
|
+
var diagnostic = 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_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher);
|
|
63238
63557
|
diagnostics.add(diagnostic);
|
|
63239
63558
|
}
|
|
63240
63559
|
}
|
|
@@ -63257,8 +63576,8 @@ var ts;
|
|
|
63257
63576
|
}
|
|
63258
63577
|
}
|
|
63259
63578
|
var operandType = checkExpression(node.expression);
|
|
63260
|
-
var awaitedType = checkAwaitedType(operandType, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
63261
|
-
if (awaitedType === operandType && awaitedType
|
|
63579
|
+
var awaitedType = checkAwaitedType(operandType, true, node, ts.Diagnostics.Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
63580
|
+
if (awaitedType === operandType && !isErrorType(awaitedType) && !(operandType.flags & 3)) {
|
|
63262
63581
|
addErrorOrSuggestion(false, ts.createDiagnosticForNode(node, ts.Diagnostics.await_has_no_effect_on_the_type_of_this_expression));
|
|
63263
63582
|
}
|
|
63264
63583
|
return awaitedType;
|
|
@@ -63396,12 +63715,23 @@ var ts;
|
|
|
63396
63715
|
if (leftType === silentNeverType || rightType === silentNeverType) {
|
|
63397
63716
|
return silentNeverType;
|
|
63398
63717
|
}
|
|
63399
|
-
|
|
63400
|
-
|
|
63401
|
-
|
|
63402
|
-
|
|
63403
|
-
|
|
63718
|
+
if (ts.isPrivateIdentifier(left)) {
|
|
63719
|
+
if (languageVersion < 99) {
|
|
63720
|
+
checkExternalEmitHelpers(left, 2097152);
|
|
63721
|
+
}
|
|
63722
|
+
if (!getNodeLinks(left).resolvedSymbol && ts.getContainingClass(left)) {
|
|
63723
|
+
var isUncheckedJS = isUncheckedJSSuggestion(left, rightType.symbol, true);
|
|
63724
|
+
reportNonexistentProperty(left, rightType, isUncheckedJS);
|
|
63725
|
+
}
|
|
63404
63726
|
}
|
|
63727
|
+
else {
|
|
63728
|
+
leftType = checkNonNullType(leftType, left);
|
|
63729
|
+
if (!(allTypesAssignableToKind(leftType, 402653316 | 296 | 12288) ||
|
|
63730
|
+
isTypeAssignableToKind(leftType, 4194304 | 134217728 | 268435456 | 262144))) {
|
|
63731
|
+
error(left, ts.Diagnostics.The_left_hand_side_of_an_in_expression_must_be_a_private_identifier_or_of_type_any_string_number_or_symbol);
|
|
63732
|
+
}
|
|
63733
|
+
}
|
|
63734
|
+
rightType = checkNonNullType(rightType, right);
|
|
63405
63735
|
var rightTypeConstraint = getConstraintOfType(rightType);
|
|
63406
63736
|
if (!allTypesAssignableToKind(rightType, 67108864 | 58982400) ||
|
|
63407
63737
|
rightTypeConstraint && (isTypeAssignableToKind(rightType, 3145728) && !allTypesAssignableToKind(rightTypeConstraint, 67108864 | 58982400) ||
|
|
@@ -63830,7 +64160,7 @@ var ts;
|
|
|
63830
64160
|
resultType = stringType;
|
|
63831
64161
|
}
|
|
63832
64162
|
else if (isTypeAny(leftType) || isTypeAny(rightType)) {
|
|
63833
|
-
resultType = leftType
|
|
64163
|
+
resultType = isErrorType(leftType) || isErrorType(rightType) ? errorType : anyType;
|
|
63834
64164
|
}
|
|
63835
64165
|
if (resultType && !checkForDisallowedESSymbolOperand(operator)) {
|
|
63836
64166
|
return resultType;
|
|
@@ -64026,8 +64356,8 @@ var ts;
|
|
|
64026
64356
|
var wouldWorkWithAwait = false;
|
|
64027
64357
|
var errNode = errorNode || operatorToken;
|
|
64028
64358
|
if (isRelated) {
|
|
64029
|
-
var awaitedLeftType =
|
|
64030
|
-
var awaitedRightType =
|
|
64359
|
+
var awaitedLeftType = getAwaitedTypeNoAlias(leftType);
|
|
64360
|
+
var awaitedRightType = getAwaitedTypeNoAlias(rightType);
|
|
64031
64361
|
wouldWorkWithAwait = !(awaitedLeftType === leftType && awaitedRightType === rightType)
|
|
64032
64362
|
&& !!(awaitedLeftType && awaitedRightType)
|
|
64033
64363
|
&& isRelated(awaitedLeftType, awaitedRightType);
|
|
@@ -64502,7 +64832,7 @@ var ts;
|
|
|
64502
64832
|
}
|
|
64503
64833
|
}
|
|
64504
64834
|
function checkParenthesizedExpression(node, checkMode) {
|
|
64505
|
-
if (ts.isJSDocTypeAssertion(node)) {
|
|
64835
|
+
if (ts.hasJSDocNodes(node) && ts.isJSDocTypeAssertion(node)) {
|
|
64506
64836
|
var type = ts.getJSDocTypeAssertionType(node);
|
|
64507
64837
|
return checkAssertionWorker(type, type, node.expression, checkMode);
|
|
64508
64838
|
}
|
|
@@ -64521,6 +64851,8 @@ var ts;
|
|
|
64521
64851
|
switch (kind) {
|
|
64522
64852
|
case 79:
|
|
64523
64853
|
return checkIdentifier(node, checkMode);
|
|
64854
|
+
case 80:
|
|
64855
|
+
return checkPrivateIdentifierExpression(node);
|
|
64524
64856
|
case 108:
|
|
64525
64857
|
return checkThisExpression(node);
|
|
64526
64858
|
case 106:
|
|
@@ -65147,7 +65479,7 @@ var ts;
|
|
|
65147
65479
|
}
|
|
65148
65480
|
function getTypeParametersForTypeReference(node) {
|
|
65149
65481
|
var type = getTypeFromTypeReference(node);
|
|
65150
|
-
if (type
|
|
65482
|
+
if (!isErrorType(type)) {
|
|
65151
65483
|
var symbol = getNodeLinks(node).resolvedSymbol;
|
|
65152
65484
|
if (symbol) {
|
|
65153
65485
|
return symbol.flags & 524288 && getSymbolLinks(symbol).typeParameters ||
|
|
@@ -65163,7 +65495,7 @@ var ts;
|
|
|
65163
65495
|
}
|
|
65164
65496
|
ts.forEach(node.typeArguments, checkSourceElement);
|
|
65165
65497
|
var type = getTypeFromTypeReference(node);
|
|
65166
|
-
if (type
|
|
65498
|
+
if (!isErrorType(type)) {
|
|
65167
65499
|
if (node.typeArguments && produceDiagnostics) {
|
|
65168
65500
|
var typeParameters = getTypeParametersForTypeReference(node);
|
|
65169
65501
|
if (typeParameters) {
|
|
@@ -65696,8 +66028,10 @@ var ts;
|
|
|
65696
66028
|
}
|
|
65697
66029
|
return typeAsPromise.promisedTypeOfPromise = getUnionType(ts.map(onfulfilledParameterSignatures, getTypeOfFirstParameterOfSignature), 2);
|
|
65698
66030
|
}
|
|
65699
|
-
function checkAwaitedType(type, errorNode, diagnosticMessage, arg0) {
|
|
65700
|
-
var awaitedType =
|
|
66031
|
+
function checkAwaitedType(type, withAlias, errorNode, diagnosticMessage, arg0) {
|
|
66032
|
+
var awaitedType = withAlias ?
|
|
66033
|
+
getAwaitedType(type, errorNode, diagnosticMessage, arg0) :
|
|
66034
|
+
getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0);
|
|
65701
66035
|
return awaitedType || errorType;
|
|
65702
66036
|
}
|
|
65703
66037
|
function isThenableType(type) {
|
|
@@ -65716,8 +66050,6 @@ var ts;
|
|
|
65716
66050
|
return false;
|
|
65717
66051
|
}
|
|
65718
66052
|
function unwrapAwaitedType(type) {
|
|
65719
|
-
if (!type)
|
|
65720
|
-
return undefined;
|
|
65721
66053
|
return type.flags & 1048576 ? mapType(type, unwrapAwaitedType) :
|
|
65722
66054
|
isAwaitedTypeInstantiation(type) ? type.aliasTypeArguments[0] :
|
|
65723
66055
|
type;
|
|
@@ -65742,6 +66074,10 @@ var ts;
|
|
|
65742
66074
|
return type;
|
|
65743
66075
|
}
|
|
65744
66076
|
function getAwaitedType(type, errorNode, diagnosticMessage, arg0) {
|
|
66077
|
+
var awaitedType = getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0);
|
|
66078
|
+
return awaitedType && createAwaitedTypeIfNeeded(awaitedType);
|
|
66079
|
+
}
|
|
66080
|
+
function getAwaitedTypeNoAlias(type, errorNode, diagnosticMessage, arg0) {
|
|
65745
66081
|
if (isTypeAny(type)) {
|
|
65746
66082
|
return type;
|
|
65747
66083
|
}
|
|
@@ -65750,12 +66086,11 @@ var ts;
|
|
|
65750
66086
|
}
|
|
65751
66087
|
var typeAsAwaitable = type;
|
|
65752
66088
|
if (typeAsAwaitable.awaitedTypeOfType) {
|
|
65753
|
-
return
|
|
66089
|
+
return typeAsAwaitable.awaitedTypeOfType;
|
|
65754
66090
|
}
|
|
65755
66091
|
if (type.flags & 1048576) {
|
|
65756
|
-
var mapper = errorNode ? function (constituentType) { return
|
|
65757
|
-
typeAsAwaitable.awaitedTypeOfType = mapType(type, mapper);
|
|
65758
|
-
return typeAsAwaitable.awaitedTypeOfType && createAwaitedTypeIfNeeded(typeAsAwaitable.awaitedTypeOfType);
|
|
66092
|
+
var mapper = errorNode ? function (constituentType) { return getAwaitedTypeNoAlias(constituentType, errorNode, diagnosticMessage, arg0); } : getAwaitedTypeNoAlias;
|
|
66093
|
+
return typeAsAwaitable.awaitedTypeOfType = mapType(type, mapper);
|
|
65759
66094
|
}
|
|
65760
66095
|
var promisedType = getPromisedTypeOfPromise(type);
|
|
65761
66096
|
if (promisedType) {
|
|
@@ -65766,12 +66101,12 @@ var ts;
|
|
|
65766
66101
|
return undefined;
|
|
65767
66102
|
}
|
|
65768
66103
|
awaitedTypeStack.push(type.id);
|
|
65769
|
-
var awaitedType =
|
|
66104
|
+
var awaitedType = getAwaitedTypeNoAlias(promisedType, errorNode, diagnosticMessage, arg0);
|
|
65770
66105
|
awaitedTypeStack.pop();
|
|
65771
66106
|
if (!awaitedType) {
|
|
65772
66107
|
return undefined;
|
|
65773
66108
|
}
|
|
65774
|
-
return
|
|
66109
|
+
return typeAsAwaitable.awaitedTypeOfType = awaitedType;
|
|
65775
66110
|
}
|
|
65776
66111
|
if (isThenableType(type)) {
|
|
65777
66112
|
if (errorNode) {
|
|
@@ -65780,23 +66115,23 @@ var ts;
|
|
|
65780
66115
|
}
|
|
65781
66116
|
return undefined;
|
|
65782
66117
|
}
|
|
65783
|
-
return
|
|
66118
|
+
return typeAsAwaitable.awaitedTypeOfType = type;
|
|
65784
66119
|
}
|
|
65785
66120
|
function checkAsyncFunctionReturnType(node, returnTypeNode) {
|
|
65786
66121
|
var returnType = getTypeFromTypeNode(returnTypeNode);
|
|
65787
66122
|
if (languageVersion >= 2) {
|
|
65788
|
-
if (returnType
|
|
66123
|
+
if (isErrorType(returnType)) {
|
|
65789
66124
|
return;
|
|
65790
66125
|
}
|
|
65791
66126
|
var globalPromiseType = getGlobalPromiseType(true);
|
|
65792
66127
|
if (globalPromiseType !== emptyGenericType && !isReferenceToType(returnType, globalPromiseType)) {
|
|
65793
|
-
error(returnTypeNode, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, typeToString(
|
|
66128
|
+
error(returnTypeNode, ts.Diagnostics.The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type_Did_you_mean_to_write_Promise_0, typeToString(getAwaitedTypeNoAlias(returnType) || voidType));
|
|
65794
66129
|
return;
|
|
65795
66130
|
}
|
|
65796
66131
|
}
|
|
65797
66132
|
else {
|
|
65798
66133
|
markTypeNodeAsReferenced(returnTypeNode);
|
|
65799
|
-
if (returnType
|
|
66134
|
+
if (isErrorType(returnType)) {
|
|
65800
66135
|
return;
|
|
65801
66136
|
}
|
|
65802
66137
|
var promiseConstructorName = ts.getEntityNameFromTypeNode(returnTypeNode);
|
|
@@ -65806,7 +66141,7 @@ var ts;
|
|
|
65806
66141
|
}
|
|
65807
66142
|
var promiseConstructorSymbol = resolveEntityName(promiseConstructorName, 111551, true);
|
|
65808
66143
|
var promiseConstructorType = promiseConstructorSymbol ? getTypeOfSymbol(promiseConstructorSymbol) : errorType;
|
|
65809
|
-
if (promiseConstructorType
|
|
66144
|
+
if (isErrorType(promiseConstructorType)) {
|
|
65810
66145
|
if (promiseConstructorName.kind === 79 && promiseConstructorName.escapedText === "Promise" && getTargetType(returnType) === getGlobalPromiseType(false)) {
|
|
65811
66146
|
error(returnTypeNode, ts.Diagnostics.An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option);
|
|
65812
66147
|
}
|
|
@@ -65830,7 +66165,7 @@ var ts;
|
|
|
65830
66165
|
return;
|
|
65831
66166
|
}
|
|
65832
66167
|
}
|
|
65833
|
-
checkAwaitedType(returnType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
66168
|
+
checkAwaitedType(returnType, false, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member);
|
|
65834
66169
|
}
|
|
65835
66170
|
function checkDecorator(node) {
|
|
65836
66171
|
var signature = getResolvedSignature(node);
|
|
@@ -66083,6 +66418,12 @@ var ts;
|
|
|
66083
66418
|
}
|
|
66084
66419
|
}
|
|
66085
66420
|
}
|
|
66421
|
+
function checkJSDocAccessibilityModifiers(node) {
|
|
66422
|
+
var host = ts.getJSDocHost(node);
|
|
66423
|
+
if (host && ts.isPrivateIdentifierClassElementDeclaration(host)) {
|
|
66424
|
+
error(node, ts.Diagnostics.An_accessibility_modifier_cannot_be_used_with_a_private_identifier);
|
|
66425
|
+
}
|
|
66426
|
+
}
|
|
66086
66427
|
function getIdentifierFromEntityNameExpression(node) {
|
|
66087
66428
|
switch (node.kind) {
|
|
66088
66429
|
case 79:
|
|
@@ -66715,7 +67056,7 @@ var ts;
|
|
|
66715
67056
|
}
|
|
66716
67057
|
else {
|
|
66717
67058
|
var declarationType = convertAutoToAny(getWidenedTypeForVariableLikeDeclaration(node));
|
|
66718
|
-
if (type
|
|
67059
|
+
if (!isErrorType(type) && !isErrorType(declarationType) &&
|
|
66719
67060
|
!isTypeIdenticalTo(type, declarationType) &&
|
|
66720
67061
|
!(symbol.flags & 67108864)) {
|
|
66721
67062
|
errorNextVariableOrPropertyDeclarationMustHaveSameType(symbol.valueDeclaration, type, node, declarationType);
|
|
@@ -67470,7 +67811,7 @@ var ts;
|
|
|
67470
67811
|
var isGenerator = !!(functionFlags & 1);
|
|
67471
67812
|
var isAsync = !!(functionFlags & 2);
|
|
67472
67813
|
return isGenerator ? getIterationTypeOfGeneratorFunctionReturnType(1, returnType, isAsync) || errorType :
|
|
67473
|
-
isAsync ?
|
|
67814
|
+
isAsync ? getAwaitedTypeNoAlias(returnType) || errorType :
|
|
67474
67815
|
returnType;
|
|
67475
67816
|
}
|
|
67476
67817
|
function isUnwrappedReturnTypeVoidOrAny(func, returnType) {
|
|
@@ -67509,7 +67850,7 @@ var ts;
|
|
|
67509
67850
|
else if (getReturnTypeFromAnnotation(container)) {
|
|
67510
67851
|
var unwrappedReturnType = (_a = unwrapReturnType(returnType, functionFlags)) !== null && _a !== void 0 ? _a : returnType;
|
|
67511
67852
|
var unwrappedExprType = functionFlags & 2
|
|
67512
|
-
? checkAwaitedType(exprType, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)
|
|
67853
|
+
? checkAwaitedType(exprType, false, node, ts.Diagnostics.The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member)
|
|
67513
67854
|
: exprType;
|
|
67514
67855
|
if (unwrappedReturnType) {
|
|
67515
67856
|
checkTypeAssignableToAndOptionallyElaborate(unwrappedExprType, unwrappedReturnType, node, node.expression);
|
|
@@ -67915,7 +68256,7 @@ var ts;
|
|
|
67915
68256
|
checkTypeReferenceNode(typeRefNode);
|
|
67916
68257
|
if (produceDiagnostics) {
|
|
67917
68258
|
var t = getReducedType(getTypeFromTypeNode(typeRefNode));
|
|
67918
|
-
if (t
|
|
68259
|
+
if (!isErrorType(t)) {
|
|
67919
68260
|
if (isValidBaseType(t)) {
|
|
67920
68261
|
var genericDiag = t.symbol && t.symbol.flags & 32 ?
|
|
67921
68262
|
ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass :
|
|
@@ -68865,7 +69206,7 @@ var ts;
|
|
|
68865
69206
|
grammarErrorOnFirstToken(node, ts.Diagnostics.An_export_declaration_cannot_have_modifiers);
|
|
68866
69207
|
}
|
|
68867
69208
|
if (node.moduleSpecifier && node.exportClause && ts.isNamedExports(node.exportClause) && ts.length(node.exportClause.elements) && languageVersion === 0) {
|
|
68868
|
-
checkExternalEmitHelpers(node,
|
|
69209
|
+
checkExternalEmitHelpers(node, 4194304);
|
|
68869
69210
|
}
|
|
68870
69211
|
checkGrammarExportDeclaration(node);
|
|
68871
69212
|
if (!node.moduleSpecifier || checkExternalImportOrExportDeclaration(node)) {
|
|
@@ -68902,11 +69243,15 @@ var ts;
|
|
|
68902
69243
|
}
|
|
68903
69244
|
function checkGrammarExportDeclaration(node) {
|
|
68904
69245
|
var _a;
|
|
68905
|
-
|
|
68906
|
-
|
|
68907
|
-
|
|
69246
|
+
if (node.isTypeOnly) {
|
|
69247
|
+
if (((_a = node.exportClause) === null || _a === void 0 ? void 0 : _a.kind) === 272) {
|
|
69248
|
+
return checkGrammarNamedImportsOrExports(node.exportClause);
|
|
69249
|
+
}
|
|
69250
|
+
else {
|
|
69251
|
+
return grammarErrorOnNode(node, ts.Diagnostics.Only_named_exports_may_use_export_type);
|
|
69252
|
+
}
|
|
68908
69253
|
}
|
|
68909
|
-
return
|
|
69254
|
+
return false;
|
|
68910
69255
|
}
|
|
68911
69256
|
function checkGrammarModuleElementContext(node, errorMessage) {
|
|
68912
69257
|
var isInAppropriateContext = node.parent.kind === 303 || node.parent.kind === 261 || node.parent.kind === 260;
|
|
@@ -69200,6 +69545,10 @@ var ts;
|
|
|
69200
69545
|
return;
|
|
69201
69546
|
case 307:
|
|
69202
69547
|
return checkSourceElement(node.type);
|
|
69548
|
+
case 331:
|
|
69549
|
+
case 333:
|
|
69550
|
+
case 332:
|
|
69551
|
+
return checkJSDocAccessibilityModifiers(node);
|
|
69203
69552
|
case 193:
|
|
69204
69553
|
return checkIndexedAccessType(node);
|
|
69205
69554
|
case 194:
|
|
@@ -69745,6 +70094,9 @@ var ts;
|
|
|
69745
70094
|
}
|
|
69746
70095
|
return result;
|
|
69747
70096
|
}
|
|
70097
|
+
else if (ts.isPrivateIdentifier(name)) {
|
|
70098
|
+
return getSymbolForPrivateIdentifierExpression(name);
|
|
70099
|
+
}
|
|
69748
70100
|
else if (name.kind === 205 || name.kind === 160) {
|
|
69749
70101
|
var links = getNodeLinks(name);
|
|
69750
70102
|
if (links.resolvedSymbol) {
|
|
@@ -69767,7 +70119,8 @@ var ts;
|
|
|
69767
70119
|
}
|
|
69768
70120
|
else if (isTypeReferenceIdentifier(name)) {
|
|
69769
70121
|
var meaning = name.parent.kind === 177 ? 788968 : 1920;
|
|
69770
|
-
|
|
70122
|
+
var symbol = resolveEntityName(name, meaning, false, true);
|
|
70123
|
+
return symbol && symbol !== unknownSymbol ? symbol : getUnresolvedSymbolForEntityName(name);
|
|
69771
70124
|
}
|
|
69772
70125
|
if (name.parent.kind === 176) {
|
|
69773
70126
|
return resolveEntityName(name, 1);
|
|
@@ -69969,7 +70322,7 @@ var ts;
|
|
|
69969
70322
|
var symbol = getSymbolAtLocation(node);
|
|
69970
70323
|
if (symbol) {
|
|
69971
70324
|
var declaredType = getDeclaredTypeOfSymbol(symbol);
|
|
69972
|
-
return declaredType
|
|
70325
|
+
return !isErrorType(declaredType) ? declaredType : getTypeOfSymbol(symbol);
|
|
69973
70326
|
}
|
|
69974
70327
|
}
|
|
69975
70328
|
if (ts.isMetaProperty(node.parent) && node.parent.keywordToken === node.kind) {
|
|
@@ -70377,7 +70730,7 @@ var ts;
|
|
|
70377
70730
|
return isTypeOnly ? ts.TypeReferenceSerializationKind.ObjectType : ts.TypeReferenceSerializationKind.Unknown;
|
|
70378
70731
|
}
|
|
70379
70732
|
var type = getDeclaredTypeOfSymbol(typeSymbol);
|
|
70380
|
-
if (type
|
|
70733
|
+
if (isErrorType(type)) {
|
|
70381
70734
|
return isTypeOnly ? ts.TypeReferenceSerializationKind.ObjectType : ts.TypeReferenceSerializationKind.Unknown;
|
|
70382
70735
|
}
|
|
70383
70736
|
else if (type.flags & 3) {
|
|
@@ -70845,7 +71198,7 @@ var ts;
|
|
|
70845
71198
|
var helpersModule = resolveHelpersModule(sourceFile, location);
|
|
70846
71199
|
if (helpersModule !== unknownSymbol) {
|
|
70847
71200
|
var uncheckedHelpers = helpers & ~requestedExternalEmitHelpers;
|
|
70848
|
-
for (var helper = 1; helper <=
|
|
71201
|
+
for (var helper = 1; helper <= 4194304; helper <<= 1) {
|
|
70849
71202
|
if (uncheckedHelpers & helper) {
|
|
70850
71203
|
var name = getHelperName(helper);
|
|
70851
71204
|
var symbol = getSymbol(helpersModule.exports, ts.escapeLeadingUnderscores(name), 111551);
|
|
@@ -70897,7 +71250,8 @@ var ts;
|
|
|
70897
71250
|
case 262144: return "__makeTemplateObject";
|
|
70898
71251
|
case 524288: return "__classPrivateFieldGet";
|
|
70899
71252
|
case 1048576: return "__classPrivateFieldSet";
|
|
70900
|
-
case 2097152: return "
|
|
71253
|
+
case 2097152: return "__classPrivateFieldIn";
|
|
71254
|
+
case 4194304: return "__createBinding";
|
|
70901
71255
|
default: return ts.Debug.fail("Unrecognized helper");
|
|
70902
71256
|
}
|
|
70903
71257
|
}
|
|
@@ -71638,8 +71992,8 @@ var ts;
|
|
|
71638
71992
|
if (!ts.isEffectiveExternalModule(sourceFile, compilerOptions)) {
|
|
71639
71993
|
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));
|
|
71640
71994
|
}
|
|
71641
|
-
if ((moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
|
|
71642
|
-
diagnostics.add(ts.createDiagnosticForNode(forInOrOfStatement.awaitModifier, ts.Diagnostics.
|
|
71995
|
+
if ((moduleKind !== ts.ModuleKind.ES2022 && moduleKind !== ts.ModuleKind.ESNext && moduleKind !== ts.ModuleKind.System && !(moduleKind === ts.ModuleKind.NodeNext && ts.getSourceFileOfNode(forInOrOfStatement).impliedNodeFormat === ts.ModuleKind.ESNext)) || languageVersion < 4) {
|
|
71996
|
+
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_or_nodenext_and_the_target_option_is_set_to_es2017_or_higher));
|
|
71643
71997
|
}
|
|
71644
71998
|
}
|
|
71645
71999
|
}
|
|
@@ -72246,14 +72600,27 @@ var ts;
|
|
|
72246
72600
|
return ambientModulesCache;
|
|
72247
72601
|
}
|
|
72248
72602
|
function checkGrammarImportClause(node) {
|
|
72603
|
+
var _a;
|
|
72249
72604
|
if (node.isTypeOnly && node.name && node.namedBindings) {
|
|
72250
72605
|
return grammarErrorOnNode(node, ts.Diagnostics.A_type_only_import_can_specify_a_default_import_or_named_bindings_but_not_both);
|
|
72251
72606
|
}
|
|
72607
|
+
if (node.isTypeOnly && ((_a = node.namedBindings) === null || _a === void 0 ? void 0 : _a.kind) === 268) {
|
|
72608
|
+
return checkGrammarNamedImportsOrExports(node.namedBindings);
|
|
72609
|
+
}
|
|
72252
72610
|
return false;
|
|
72253
72611
|
}
|
|
72612
|
+
function checkGrammarNamedImportsOrExports(namedBindings) {
|
|
72613
|
+
return !!ts.forEach(namedBindings.elements, function (specifier) {
|
|
72614
|
+
if (specifier.isTypeOnly) {
|
|
72615
|
+
return grammarErrorOnFirstToken(specifier, specifier.kind === 269
|
|
72616
|
+
? ts.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_import_when_import_type_is_used_on_its_import_statement
|
|
72617
|
+
: ts.Diagnostics.The_type_modifier_cannot_be_used_on_a_named_export_when_export_type_is_used_on_its_export_statement);
|
|
72618
|
+
}
|
|
72619
|
+
});
|
|
72620
|
+
}
|
|
72254
72621
|
function checkGrammarImportCallExpression(node) {
|
|
72255
72622
|
if (moduleKind === ts.ModuleKind.ES2015) {
|
|
72256
|
-
return grammarErrorOnNode(node, ts.Diagnostics.
|
|
72623
|
+
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_imports_are_only_supported_when_the_module_flag_is_set_to_es2020_es2022_esnext_commonjs_amd_system_umd_node12_or_nodenext);
|
|
72257
72624
|
}
|
|
72258
72625
|
if (node.typeArguments) {
|
|
72259
72626
|
return grammarErrorOnNode(node, ts.Diagnostics.Dynamic_import_cannot_have_type_arguments);
|
|
@@ -72924,7 +73291,7 @@ var ts;
|
|
|
72924
73291
|
return factory.updateNamedImports(node, nodesVisitor(node.elements, visitor, ts.isImportSpecifier));
|
|
72925
73292
|
case 269:
|
|
72926
73293
|
ts.Debug.type(node);
|
|
72927
|
-
return factory.updateImportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
|
|
73294
|
+
return factory.updateImportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
|
|
72928
73295
|
case 270:
|
|
72929
73296
|
ts.Debug.type(node);
|
|
72930
73297
|
return factory.updateExportAssignment(node, nodesVisitor(node.decorators, visitor, ts.isDecorator), nodesVisitor(node.modifiers, visitor, ts.isModifier), nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
@@ -72936,7 +73303,7 @@ var ts;
|
|
|
72936
73303
|
return factory.updateNamedExports(node, nodesVisitor(node.elements, visitor, ts.isExportSpecifier));
|
|
72937
73304
|
case 274:
|
|
72938
73305
|
ts.Debug.type(node);
|
|
72939
|
-
return factory.updateExportSpecifier(node, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
|
|
73306
|
+
return factory.updateExportSpecifier(node, node.isTypeOnly, nodeVisitor(node.propertyName, visitor, ts.isIdentifier), nodeVisitor(node.name, visitor, ts.isIdentifier));
|
|
72940
73307
|
case 276:
|
|
72941
73308
|
ts.Debug.type(node);
|
|
72942
73309
|
return factory.updateExternalModuleReference(node, nodeVisitor(node.expression, visitor, ts.isExpression));
|
|
@@ -73267,7 +73634,7 @@ var ts;
|
|
|
73267
73634
|
}
|
|
73268
73635
|
}
|
|
73269
73636
|
ts.createSourceMapGenerator = createSourceMapGenerator;
|
|
73270
|
-
var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)
|
|
73637
|
+
var sourceMapCommentRegExp = /^\/\/[@#] source[M]appingURL=(.+)\r?\n?$/;
|
|
73271
73638
|
var whitespaceOrMapCommentRegExp = /^\s*(\/\/[@#] .*)?$/;
|
|
73272
73639
|
function getLineInfo(text, lineStarts) {
|
|
73273
73640
|
return {
|
|
@@ -75557,6 +75924,7 @@ var ts;
|
|
|
75557
75924
|
|| (isExternalModuleExport(node)
|
|
75558
75925
|
&& moduleKind !== ts.ModuleKind.ES2015
|
|
75559
75926
|
&& moduleKind !== ts.ModuleKind.ES2020
|
|
75927
|
+
&& moduleKind !== ts.ModuleKind.ES2022
|
|
75560
75928
|
&& moduleKind !== ts.ModuleKind.ESNext
|
|
75561
75929
|
&& moduleKind !== ts.ModuleKind.System);
|
|
75562
75930
|
}
|
|
@@ -75714,12 +76082,14 @@ var ts;
|
|
|
75714
76082
|
return shouldEmitAliasDeclaration(node) ? node : undefined;
|
|
75715
76083
|
}
|
|
75716
76084
|
else {
|
|
76085
|
+
var allowEmpty = compilerOptions.preserveValueImports && (compilerOptions.importsNotUsedAsValues === 1 ||
|
|
76086
|
+
compilerOptions.importsNotUsedAsValues === 2);
|
|
75717
76087
|
var elements = ts.visitNodes(node.elements, visitImportSpecifier, ts.isImportSpecifier);
|
|
75718
|
-
return ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;
|
|
76088
|
+
return allowEmpty || ts.some(elements) ? factory.updateNamedImports(node, elements) : undefined;
|
|
75719
76089
|
}
|
|
75720
76090
|
}
|
|
75721
76091
|
function visitImportSpecifier(node) {
|
|
75722
|
-
return shouldEmitAliasDeclaration(node) ? node : undefined;
|
|
76092
|
+
return !node.isTypeOnly && shouldEmitAliasDeclaration(node) ? node : undefined;
|
|
75723
76093
|
}
|
|
75724
76094
|
function visitExportAssignment(node) {
|
|
75725
76095
|
return resolver.isValueAliasDeclaration(node)
|
|
@@ -75733,26 +76103,25 @@ var ts;
|
|
|
75733
76103
|
if (!node.exportClause || ts.isNamespaceExport(node.exportClause)) {
|
|
75734
76104
|
return node;
|
|
75735
76105
|
}
|
|
75736
|
-
|
|
75737
|
-
|
|
75738
|
-
}
|
|
75739
|
-
var exportClause = ts.visitNode(node.exportClause, visitNamedExportBindings, ts.isNamedExportBindings);
|
|
76106
|
+
var allowEmpty = !!node.moduleSpecifier && (compilerOptions.importsNotUsedAsValues === 1 ||
|
|
76107
|
+
compilerOptions.importsNotUsedAsValues === 2);
|
|
76108
|
+
var exportClause = ts.visitNode(node.exportClause, function (bindings) { return visitNamedExportBindings(bindings, allowEmpty); }, ts.isNamedExportBindings);
|
|
75740
76109
|
return exportClause
|
|
75741
76110
|
? factory.updateExportDeclaration(node, undefined, undefined, node.isTypeOnly, exportClause, node.moduleSpecifier, node.assertClause)
|
|
75742
76111
|
: undefined;
|
|
75743
76112
|
}
|
|
75744
|
-
function visitNamedExports(node) {
|
|
76113
|
+
function visitNamedExports(node, allowEmpty) {
|
|
75745
76114
|
var elements = ts.visitNodes(node.elements, visitExportSpecifier, ts.isExportSpecifier);
|
|
75746
|
-
return ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;
|
|
76115
|
+
return allowEmpty || ts.some(elements) ? factory.updateNamedExports(node, elements) : undefined;
|
|
75747
76116
|
}
|
|
75748
76117
|
function visitNamespaceExports(node) {
|
|
75749
76118
|
return factory.updateNamespaceExport(node, ts.visitNode(node.name, visitor, ts.isIdentifier));
|
|
75750
76119
|
}
|
|
75751
|
-
function visitNamedExportBindings(node) {
|
|
75752
|
-
return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node);
|
|
76120
|
+
function visitNamedExportBindings(node, allowEmpty) {
|
|
76121
|
+
return ts.isNamespaceExport(node) ? visitNamespaceExports(node) : visitNamedExports(node, allowEmpty);
|
|
75753
76122
|
}
|
|
75754
76123
|
function visitExportSpecifier(node) {
|
|
75755
|
-
return resolver.isValueAliasDeclaration(node) ? node : undefined;
|
|
76124
|
+
return !node.isTypeOnly && resolver.isValueAliasDeclaration(node) ? node : undefined;
|
|
75756
76125
|
}
|
|
75757
76126
|
function shouldEmitImportEqualsDeclaration(node) {
|
|
75758
76127
|
return shouldEmitAliasDeclaration(node)
|
|
@@ -76109,8 +76478,25 @@ var ts;
|
|
|
76109
76478
|
if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
76110
76479
|
return node;
|
|
76111
76480
|
}
|
|
76481
|
+
if (ts.isStatement(node.parent)) {
|
|
76482
|
+
return node;
|
|
76483
|
+
}
|
|
76112
76484
|
return ts.setOriginalNode(factory.createIdentifier(""), node);
|
|
76113
76485
|
}
|
|
76486
|
+
function visitPrivateIdentifierInInExpression(node) {
|
|
76487
|
+
if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
76488
|
+
return node;
|
|
76489
|
+
}
|
|
76490
|
+
var privId = node.left;
|
|
76491
|
+
ts.Debug.assertNode(privId, ts.isPrivateIdentifier);
|
|
76492
|
+
ts.Debug.assert(node.operatorToken.kind === 101);
|
|
76493
|
+
var info = accessPrivateIdentifier(privId);
|
|
76494
|
+
if (info) {
|
|
76495
|
+
var receiver = ts.visitNode(node.right, visitor, ts.isExpression);
|
|
76496
|
+
return ts.setOriginalNode(context.getEmitHelperFactory().createClassPrivateFieldInHelper(info.brandCheckIdentifier, receiver), node);
|
|
76497
|
+
}
|
|
76498
|
+
return ts.visitEachChild(node, visitor, context);
|
|
76499
|
+
}
|
|
76114
76500
|
function classElementVisitor(node) {
|
|
76115
76501
|
switch (node.kind) {
|
|
76116
76502
|
case 170:
|
|
@@ -76453,6 +76839,9 @@ var ts;
|
|
|
76453
76839
|
}
|
|
76454
76840
|
}
|
|
76455
76841
|
}
|
|
76842
|
+
if (node.operatorToken.kind === 101 && ts.isPrivateIdentifier(node.left)) {
|
|
76843
|
+
return visitPrivateIdentifierInInExpression(node);
|
|
76844
|
+
}
|
|
76456
76845
|
return ts.visitEachChild(node, visitor, context);
|
|
76457
76846
|
}
|
|
76458
76847
|
function createPrivateIdentifierAssignment(info, receiver, right, operator) {
|
|
@@ -78706,7 +79095,7 @@ var ts;
|
|
|
78706
79095
|
currentFileState.utilizedImplicitRuntimeImports.set(importSource, specifierSourceImports);
|
|
78707
79096
|
}
|
|
78708
79097
|
var generatedName = factory.createUniqueName("_" + name, 16 | 32 | 64);
|
|
78709
|
-
var specifier = factory.createImportSpecifier(factory.createIdentifier(name), generatedName);
|
|
79098
|
+
var specifier = factory.createImportSpecifier(false, factory.createIdentifier(name), generatedName);
|
|
78710
79099
|
generatedName.generatedImportReference = specifier;
|
|
78711
79100
|
specifierSourceImports.set(name, specifier);
|
|
78712
79101
|
return generatedName;
|
|
@@ -79034,7 +79423,8 @@ var ts;
|
|
|
79034
79423
|
}
|
|
79035
79424
|
}
|
|
79036
79425
|
function visitJsxExpression(node) {
|
|
79037
|
-
|
|
79426
|
+
var expression = ts.visitNode(node.expression, visitor, ts.isExpression);
|
|
79427
|
+
return node.dotDotDotToken ? factory.createSpreadElement(expression) : expression;
|
|
79038
79428
|
}
|
|
79039
79429
|
}
|
|
79040
79430
|
ts.transformJsx = transformJsx;
|
|
@@ -85023,7 +85413,7 @@ var ts;
|
|
|
85023
85413
|
if (!importRequireStatements) {
|
|
85024
85414
|
var createRequireName = factory.createUniqueName("_createRequire", 16 | 32);
|
|
85025
85415
|
var importStatement = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamedImports([
|
|
85026
|
-
factory.createImportSpecifier(factory.createIdentifier("createRequire"), createRequireName)
|
|
85416
|
+
factory.createImportSpecifier(false, factory.createIdentifier("createRequire"), createRequireName)
|
|
85027
85417
|
])), factory.createStringLiteral("module"));
|
|
85028
85418
|
var requireHelperName = factory.createUniqueName("__require", 16 | 32);
|
|
85029
85419
|
var requireStatement = factory.createVariableStatement(undefined, factory.createVariableDeclarationList([
|
|
@@ -85048,7 +85438,7 @@ var ts;
|
|
|
85048
85438
|
}
|
|
85049
85439
|
function appendExportsOfImportEqualsDeclaration(statements, node) {
|
|
85050
85440
|
if (ts.hasSyntacticModifier(node, 1)) {
|
|
85051
|
-
statements = ts.append(statements, factory.createExportDeclaration(undefined, undefined, node.isTypeOnly, factory.createNamedExports([factory.createExportSpecifier(undefined, ts.idText(node.name))])));
|
|
85441
|
+
statements = ts.append(statements, factory.createExportDeclaration(undefined, undefined, node.isTypeOnly, factory.createNamedExports([factory.createExportSpecifier(false, undefined, ts.idText(node.name))])));
|
|
85052
85442
|
}
|
|
85053
85443
|
return statements;
|
|
85054
85444
|
}
|
|
@@ -85066,7 +85456,7 @@ var ts;
|
|
|
85066
85456
|
var synthName = factory.getGeneratedNameForNode(oldIdentifier);
|
|
85067
85457
|
var importDecl = factory.createImportDeclaration(undefined, undefined, factory.createImportClause(false, undefined, factory.createNamespaceImport(synthName)), node.moduleSpecifier, node.assertClause);
|
|
85068
85458
|
ts.setOriginalNode(importDecl, node.exportClause);
|
|
85069
|
-
var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports([factory.createExportSpecifier(synthName, oldIdentifier)]));
|
|
85459
|
+
var exportDecl = ts.isExportNamespaceAsDefaultDeclaration(node) ? factory.createExportDefault(synthName) : factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports([factory.createExportSpecifier(false, synthName, oldIdentifier)]));
|
|
85070
85460
|
ts.setOriginalNode(exportDecl, node);
|
|
85071
85461
|
return [importDecl, exportDecl];
|
|
85072
85462
|
}
|
|
@@ -86480,7 +86870,7 @@ var ts;
|
|
|
86480
86870
|
else {
|
|
86481
86871
|
declarations.push(factory.createExportDeclaration(undefined, undefined, false, factory.createNamedExports(ts.map(exportMappings_1, function (_a) {
|
|
86482
86872
|
var gen = _a[0], exp = _a[1];
|
|
86483
|
-
return factory.createExportSpecifier(gen, exp);
|
|
86873
|
+
return factory.createExportSpecifier(false, gen, exp);
|
|
86484
86874
|
}))));
|
|
86485
86875
|
}
|
|
86486
86876
|
var namespaceDecl = factory.createModuleDeclaration(undefined, ensureModifiers(input), input.name, factory.createModuleBlock(declarations), 16);
|
|
@@ -86817,6 +87207,7 @@ var ts;
|
|
|
86817
87207
|
function getModuleTransformer(moduleKind) {
|
|
86818
87208
|
switch (moduleKind) {
|
|
86819
87209
|
case ts.ModuleKind.ESNext:
|
|
87210
|
+
case ts.ModuleKind.ES2022:
|
|
86820
87211
|
case ts.ModuleKind.ES2020:
|
|
86821
87212
|
case ts.ModuleKind.ES2015:
|
|
86822
87213
|
return ts.transformECMAScriptModule;
|
|
@@ -88607,6 +88998,8 @@ var ts;
|
|
|
88607
88998
|
return emitLiteral(node, false);
|
|
88608
88999
|
case 79:
|
|
88609
89000
|
return emitIdentifier(node);
|
|
89001
|
+
case 80:
|
|
89002
|
+
return emitPrivateIdentifier(node);
|
|
88610
89003
|
case 203:
|
|
88611
89004
|
return emitArrayLiteralExpression(node);
|
|
88612
89005
|
case 204:
|
|
@@ -90072,6 +90465,10 @@ var ts;
|
|
|
90072
90465
|
writePunctuation("}");
|
|
90073
90466
|
}
|
|
90074
90467
|
function emitImportOrExportSpecifier(node) {
|
|
90468
|
+
if (node.isTypeOnly) {
|
|
90469
|
+
writeKeyword("type");
|
|
90470
|
+
writeSpace();
|
|
90471
|
+
}
|
|
90075
90472
|
if (node.propertyName) {
|
|
90076
90473
|
emit(node.propertyName);
|
|
90077
90474
|
writeSpace();
|
|
@@ -94584,7 +94981,7 @@ var ts;
|
|
|
94584
94981
|
i++;
|
|
94585
94982
|
}
|
|
94586
94983
|
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
|
|
94587
|
-
var localOverrideModuleResult = ts.resolveModuleName("@typescript/" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
94984
|
+
var localOverrideModuleResult = ts.resolveModuleName("@typescript/lib-" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
94588
94985
|
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
94589
94986
|
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
94590
94987
|
}
|
|
@@ -97894,7 +98291,7 @@ var ts;
|
|
|
97894
98291
|
}
|
|
97895
98292
|
var nodeModulesDirectoryName = moduleSpecifier.substring(parts.topLevelPackageNameIndex + 1);
|
|
97896
98293
|
var packageName = ts.getPackageNameFromTypesPackageName(nodeModulesDirectoryName);
|
|
97897
|
-
return ts.getEmitModuleResolutionKind(options)
|
|
98294
|
+
return ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Classic && packageName === nodeModulesDirectoryName ? undefined : packageName;
|
|
97898
98295
|
function tryDirectoryWithPackageJson(packageRootIndex) {
|
|
97899
98296
|
var packageRootPath = path.substring(0, packageRootIndex);
|
|
97900
98297
|
var packageJsonPath = ts.combinePaths(packageRootPath, "package.json");
|
|
@@ -100935,7 +101332,7 @@ var ts;
|
|
|
100935
101332
|
}
|
|
100936
101333
|
function printEasyHelp(sys, simpleOptions) {
|
|
100937
101334
|
var colors = createColors(sys);
|
|
100938
|
-
var output = __spreadArray([],
|
|
101335
|
+
var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
|
|
100939
101336
|
output.push(colors.bold(ts.getDiagnosticText(ts.Diagnostics.COMMON_COMMANDS)) + sys.newLine + sys.newLine);
|
|
100940
101337
|
example("tsc", ts.Diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory);
|
|
100941
101338
|
example("tsc app.ts util.ts", ts.Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
|
|
@@ -100961,7 +101358,7 @@ var ts;
|
|
|
100961
101358
|
}
|
|
100962
101359
|
}
|
|
100963
101360
|
function printAllHelp(sys, compilerOptions, buildOptions, watchOptions) {
|
|
100964
|
-
var output = __spreadArray([],
|
|
101361
|
+
var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
|
|
100965
101362
|
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.ALL_COMPILER_OPTIONS), compilerOptions, true, undefined, ts.formatMessage(undefined, ts.Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsconfig-reference")), true);
|
|
100966
101363
|
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.WATCH_OPTIONS), watchOptions, false, ts.getDiagnosticText(ts.Diagnostics.Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon)), true);
|
|
100967
101364
|
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.BUILD_OPTIONS), buildOptions, false, ts.formatMessage(undefined, ts.Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")), true);
|
|
@@ -100971,31 +101368,30 @@ var ts;
|
|
|
100971
101368
|
}
|
|
100972
101369
|
}
|
|
100973
101370
|
function printBuildHelp(sys, buildOptions) {
|
|
100974
|
-
var output = __spreadArray([],
|
|
101371
|
+
var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
|
|
100975
101372
|
output = __spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.BUILD_OPTIONS), buildOptions, false, ts.formatMessage(undefined, ts.Diagnostics.Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0, "https://aka.ms/tsc-composite-builds")), true);
|
|
100976
101373
|
for (var _i = 0, output_3 = output; _i < output_3.length; _i++) {
|
|
100977
101374
|
var line = output_3[_i];
|
|
100978
101375
|
sys.write(line);
|
|
100979
101376
|
}
|
|
100980
101377
|
}
|
|
100981
|
-
function
|
|
101378
|
+
function getHeader(sys, message) {
|
|
100982
101379
|
var _a, _b;
|
|
100983
101380
|
var colors = createColors(sys);
|
|
100984
101381
|
var header = [];
|
|
100985
|
-
var tscExplanation = ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version);
|
|
100986
101382
|
var terminalWidth = (_b = (_a = sys.getWidthOfTerminal) === null || _a === void 0 ? void 0 : _a.call(sys)) !== null && _b !== void 0 ? _b : 0;
|
|
100987
101383
|
;
|
|
100988
101384
|
var tsIconLength = 5;
|
|
100989
101385
|
var tsIconFirstLine = colors.blueBackground(ts.padLeft("", tsIconLength));
|
|
100990
101386
|
var tsIconSecondLine = colors.blueBackground(colors.brightWhite(ts.padLeft("TS ", tsIconLength)));
|
|
100991
|
-
if (terminalWidth >=
|
|
101387
|
+
if (terminalWidth >= message.length + tsIconLength) {
|
|
100992
101388
|
var rightAlign = terminalWidth > 120 ? 120 : terminalWidth;
|
|
100993
101389
|
var leftAlign = rightAlign - tsIconLength;
|
|
100994
|
-
header.push(ts.padRight(
|
|
101390
|
+
header.push(ts.padRight(message, leftAlign) + tsIconFirstLine + sys.newLine);
|
|
100995
101391
|
header.push(ts.padLeft("", leftAlign) + tsIconSecondLine + sys.newLine);
|
|
100996
101392
|
}
|
|
100997
101393
|
else {
|
|
100998
|
-
header.push(
|
|
101394
|
+
header.push(message + sys.newLine);
|
|
100999
101395
|
header.push(sys.newLine);
|
|
101000
101396
|
}
|
|
101001
101397
|
return header;
|
|
@@ -101410,7 +101806,13 @@ var ts;
|
|
|
101410
101806
|
}
|
|
101411
101807
|
else {
|
|
101412
101808
|
sys.writeFile(file, ts.generateTSConfig(options, fileNames, sys.newLine));
|
|
101413
|
-
|
|
101809
|
+
var output = __spreadArray([sys.newLine], getHeader(sys, "Created a new tsconfig.json with:"), true);
|
|
101810
|
+
output.push(ts.getCompilerOptionsDiffValue(options, sys.newLine) + sys.newLine + sys.newLine);
|
|
101811
|
+
output.push("You can learn more at https://aka.ms/tsconfig.json" + sys.newLine);
|
|
101812
|
+
for (var _i = 0, output_4 = output; _i < output_4.length; _i++) {
|
|
101813
|
+
var line = output_4[_i];
|
|
101814
|
+
sys.write(line);
|
|
101815
|
+
}
|
|
101414
101816
|
}
|
|
101415
101817
|
return;
|
|
101416
101818
|
}
|