@typescript-deploys/pr-build 4.6.0-pr-47690-4 → 4.6.0-pr-47590-5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cs/diagnosticMessages.generated.json +1 -2
- package/lib/de/diagnosticMessages.generated.json +6 -5
- package/lib/es/diagnosticMessages.generated.json +6 -5
- package/lib/fr/diagnosticMessages.generated.json +1 -2
- package/lib/it/diagnosticMessages.generated.json +1 -2
- package/lib/ja/diagnosticMessages.generated.json +6 -5
- package/lib/ko/diagnosticMessages.generated.json +6 -5
- package/lib/pl/diagnosticMessages.generated.json +1 -2
- package/lib/pt-br/diagnosticMessages.generated.json +6 -5
- package/lib/ru/diagnosticMessages.generated.json +6 -5
- package/lib/tr/diagnosticMessages.generated.json +6 -5
- package/lib/tsc.js +273 -140
- package/lib/tsserver.js +755 -471
- package/lib/tsserverlibrary.d.ts +7 -12
- package/lib/tsserverlibrary.js +755 -471
- package/lib/typescript.d.ts +7 -12
- package/lib/typescript.js +752 -464
- package/lib/typescriptServices.d.ts +7 -12
- package/lib/typescriptServices.js +752 -464
- package/lib/typingsInstaller.js +303 -148
- package/lib/zh-cn/diagnosticMessages.generated.json +6 -5
- package/lib/zh-tw/diagnosticMessages.generated.json +1 -2
- 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.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-insiders.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-insiders.20220211";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -1087,11 +1087,11 @@ var ts;
|
|
|
1087
1087
|
return result;
|
|
1088
1088
|
}
|
|
1089
1089
|
ts.getAllKeys = getAllKeys;
|
|
1090
|
-
function getOwnValues(
|
|
1090
|
+
function getOwnValues(collection) {
|
|
1091
1091
|
var values = [];
|
|
1092
|
-
for (var key in
|
|
1093
|
-
if (hasOwnProperty.call(
|
|
1094
|
-
values.push(
|
|
1092
|
+
for (var key in collection) {
|
|
1093
|
+
if (hasOwnProperty.call(collection, key)) {
|
|
1094
|
+
values.push(collection[key]);
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
1097
|
return values;
|
|
@@ -5259,10 +5259,10 @@ var ts;
|
|
|
5259
5259
|
A_type_predicate_cannot_reference_a_rest_parameter: diag(1229, ts.DiagnosticCategory.Error, "A_type_predicate_cannot_reference_a_rest_parameter_1229", "A type predicate cannot reference a rest parameter."),
|
|
5260
5260
|
A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: diag(1230, ts.DiagnosticCategory.Error, "A_type_predicate_cannot_reference_element_0_in_a_binding_pattern_1230", "A type predicate cannot reference element '{0}' in a binding pattern."),
|
|
5261
5261
|
An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration: diag(1231, ts.DiagnosticCategory.Error, "An_export_assignment_must_be_at_the_top_level_of_a_file_or_module_declaration_1231", "An export assignment must be at the top level of a file or module declaration."),
|
|
5262
|
-
|
|
5263
|
-
|
|
5262
|
+
An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1232, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1232", "An import declaration can only be used at the top level of a namespace or module."),
|
|
5263
|
+
An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module: diag(1233, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module_1233", "An export declaration can only be used at the top level of a namespace or module."),
|
|
5264
5264
|
An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: diag(1234, ts.DiagnosticCategory.Error, "An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file_1234", "An ambient module declaration is only allowed at the top level in a file."),
|
|
5265
|
-
|
|
5265
|
+
A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module: diag(1235, ts.DiagnosticCategory.Error, "A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235", "A namespace declaration is only allowed at the top level of a namespace or module."),
|
|
5266
5266
|
The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: diag(1236, ts.DiagnosticCategory.Error, "The_return_type_of_a_property_decorator_function_must_be_either_void_or_any_1236", "The return type of a property decorator function must be either 'void' or 'any'."),
|
|
5267
5267
|
The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: diag(1237, ts.DiagnosticCategory.Error, "The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any_1237", "The return type of a parameter decorator function must be either 'void' or 'any'."),
|
|
5268
5268
|
Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: diag(1238, ts.DiagnosticCategory.Error, "Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression_1238", "Unable to resolve signature of class decorator when called as an expression."),
|
|
@@ -5294,6 +5294,7 @@ var ts;
|
|
|
5294
5294
|
An_optional_element_cannot_follow_a_rest_element: diag(1266, ts.DiagnosticCategory.Error, "An_optional_element_cannot_follow_a_rest_element_1266", "An optional element cannot follow a rest element."),
|
|
5295
5295
|
Property_0_cannot_have_an_initializer_because_it_is_marked_abstract: diag(1267, ts.DiagnosticCategory.Error, "Property_0_cannot_have_an_initializer_because_it_is_marked_abstract_1267", "Property '{0}' cannot have an initializer because it is marked abstract."),
|
|
5296
5296
|
An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type: diag(1268, ts.DiagnosticCategory.Error, "An_index_signature_parameter_type_must_be_string_number_symbol_or_a_template_literal_type_1268", "An index signature parameter type must be 'string', 'number', 'symbol', or a template literal type."),
|
|
5297
|
+
Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided: diag(1269, ts.DiagnosticCategory.Error, "Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided_1269", "Cannot use 'export import' on a type or type-only namespace when the '--isolatedModules' flag is provided."),
|
|
5297
5298
|
with_statements_are_not_allowed_in_an_async_function_block: diag(1300, ts.DiagnosticCategory.Error, "with_statements_are_not_allowed_in_an_async_function_block_1300", "'with' statements are not allowed in an async function block."),
|
|
5298
5299
|
await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules: diag(1308, ts.DiagnosticCategory.Error, "await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules_1308", "'await' expressions are only allowed within async functions and at the top levels of modules."),
|
|
5299
5300
|
Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_part_of_a_destructuring_pattern: diag(1312, ts.DiagnosticCategory.Error, "Did_you_mean_to_use_a_Colon_An_can_only_follow_a_property_name_when_the_containing_object_literal_is_1312", "Did you mean to use a ':'? An '=' can only follow a property name when the containing object literal is part of a destructuring pattern."),
|
|
@@ -5430,6 +5431,8 @@ var ts;
|
|
|
5430
5431
|
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."),
|
|
5431
5432
|
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."),
|
|
5432
5433
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
5434
|
+
An_import_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1473, ts.DiagnosticCategory.Error, "An_import_declaration_can_only_be_used_at_the_top_level_of_a_module_1473", "An import declaration can only be used at the top level of a module."),
|
|
5435
|
+
An_export_declaration_can_only_be_used_at_the_top_level_of_a_module: diag(1474, ts.DiagnosticCategory.Error, "An_export_declaration_can_only_be_used_at_the_top_level_of_a_module_1474", "An export declaration can only be used at the top level of a module."),
|
|
5433
5436
|
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."),
|
|
5434
5437
|
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."),
|
|
5435
5438
|
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),
|
|
@@ -5895,12 +5898,10 @@ var ts;
|
|
|
5895
5898
|
Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es2015_or_higher: diag(2802, ts.DiagnosticCategory.Error, "Type_0_can_only_be_iterated_through_when_using_the_downlevelIteration_flag_or_with_a_target_of_es201_2802", "Type '{0}' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher."),
|
|
5896
5899
|
Cannot_assign_to_private_method_0_Private_methods_are_not_writable: diag(2803, ts.DiagnosticCategory.Error, "Cannot_assign_to_private_method_0_Private_methods_are_not_writable_2803", "Cannot assign to private method '{0}'. Private methods are not writable."),
|
|
5897
5900
|
Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name: diag(2804, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_Static_and_instance_elements_cannot_share_the_same_private_name_2804", "Duplicate identifier '{0}'. Static and instance elements cannot share the same private name."),
|
|
5898
|
-
Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag: diag(2805, ts.DiagnosticCategory.Error, "Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_no_2805", "Static fields with private names can't have initializers when the '--useDefineForClassFields' flag is not specified with a '--target' of 'esnext'. Consider adding the '--useDefineForClassFields' flag."),
|
|
5899
5901
|
Private_accessor_was_defined_without_a_getter: diag(2806, ts.DiagnosticCategory.Error, "Private_accessor_was_defined_without_a_getter_2806", "Private accessor was defined without a getter."),
|
|
5900
5902
|
This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_one_in_0_Consider_upgrading_your_version_of_0: diag(2807, ts.DiagnosticCategory.Error, "This_syntax_requires_an_imported_helper_named_1_with_2_parameters_which_is_not_compatible_with_the_o_2807", "This syntax requires an imported helper named '{1}' with {2} parameters, which is not compatible with the one in '{0}'. Consider upgrading your version of '{0}'."),
|
|
5901
5903
|
A_get_accessor_must_be_at_least_as_accessible_as_the_setter: diag(2808, ts.DiagnosticCategory.Error, "A_get_accessor_must_be_at_least_as_accessible_as_the_setter_2808", "A get accessor must be at least as accessible as the setter"),
|
|
5902
5904
|
Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_destructuring_assignment_you_might_need_to_wrap_the_the_whole_assignment_in_parentheses: diag(2809, ts.DiagnosticCategory.Error, "Declaration_or_statement_expected_This_follows_a_block_of_statements_so_if_you_intended_to_write_a_d_2809", "Declaration or statement expected. This '=' follows a block of statements, so if you intended to write a destructuring assignment, you might need to wrap the the whole assignment in parentheses."),
|
|
5903
|
-
Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false: diag(2810, ts.DiagnosticCategory.Error, "Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnex_2810", "Property '{0}' may not be used in a static property's initializer in the same class when 'target' is 'esnext' and 'useDefineForClassFields' is 'false'."),
|
|
5904
5905
|
Initializer_for_property_0: diag(2811, ts.DiagnosticCategory.Error, "Initializer_for_property_0_2811", "Initializer for property '{0}'"),
|
|
5905
5906
|
Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom: diag(2812, ts.DiagnosticCategory.Error, "Property_0_does_not_exist_on_type_1_Try_changing_the_lib_compiler_option_to_include_dom_2812", "Property '{0}' does not exist on type '{1}'. Try changing the 'lib' compiler option to include 'dom'."),
|
|
5906
5907
|
Class_declaration_cannot_implement_overload_list_for_0: diag(2813, ts.DiagnosticCategory.Error, "Class_declaration_cannot_implement_overload_list_for_0_2813", "Class declaration cannot implement overload list for '{0}'."),
|
|
@@ -6851,6 +6852,10 @@ var ts;
|
|
|
6851
6852
|
Add_missing_attributes: diag(95167, ts.DiagnosticCategory.Message, "Add_missing_attributes_95167", "Add missing attributes"),
|
|
6852
6853
|
Add_all_missing_attributes: diag(95168, ts.DiagnosticCategory.Message, "Add_all_missing_attributes_95168", "Add all missing attributes"),
|
|
6853
6854
|
Add_undefined_to_optional_property_type: diag(95169, ts.DiagnosticCategory.Message, "Add_undefined_to_optional_property_type_95169", "Add 'undefined' to optional property type"),
|
|
6855
|
+
Convert_named_imports_to_default_import: diag(95170, ts.DiagnosticCategory.Message, "Convert_named_imports_to_default_import_95170", "Convert named imports to default import"),
|
|
6856
|
+
Delete_unused_param_tag_0: diag(95171, ts.DiagnosticCategory.Message, "Delete_unused_param_tag_0_95171", "Delete unused '@param' tag '{0}'"),
|
|
6857
|
+
Delete_all_unused_param_tags: diag(95172, ts.DiagnosticCategory.Message, "Delete_all_unused_param_tags_95172", "Delete all unused '@param' tags"),
|
|
6858
|
+
Rename_param_tag_name_0_to_1: diag(95173, ts.DiagnosticCategory.Message, "Rename_param_tag_name_0_to_1_95173", "Rename '@param' tag name '{0}' to '{1}'"),
|
|
6854
6859
|
No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer: diag(18004, ts.DiagnosticCategory.Error, "No_value_exists_in_scope_for_the_shorthand_property_0_Either_declare_one_or_provide_an_initializer_18004", "No value exists in scope for the shorthand property '{0}'. Either declare one or provide an initializer."),
|
|
6855
6860
|
Classes_may_not_have_a_field_named_constructor: diag(18006, ts.DiagnosticCategory.Error, "Classes_may_not_have_a_field_named_constructor_18006", "Classes may not have a field named 'constructor'."),
|
|
6856
6861
|
JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array: diag(18007, ts.DiagnosticCategory.Error, "JSX_expressions_may_not_use_the_comma_operator_Did_you_mean_to_write_an_array_18007", "JSX expressions may not use the comma operator. Did you mean to write an array?"),
|
|
@@ -8742,6 +8747,8 @@ var ts;
|
|
|
8742
8747
|
case 39:
|
|
8743
8748
|
tokenValue = scanString(true);
|
|
8744
8749
|
return token = 10;
|
|
8750
|
+
case 96:
|
|
8751
|
+
return token = scanTemplateAndSetTokenValue(false);
|
|
8745
8752
|
default:
|
|
8746
8753
|
return scan();
|
|
8747
8754
|
}
|
|
@@ -10391,6 +10398,10 @@ var ts;
|
|
|
10391
10398
|
|| kind === 287;
|
|
10392
10399
|
}
|
|
10393
10400
|
ts.isStringLiteralOrJsxExpression = isStringLiteralOrJsxExpression;
|
|
10401
|
+
function isStringLiteralOrTemplateExpressionOrJsxExpression(node) {
|
|
10402
|
+
return node.kind === 222 || isStringLiteralOrJsxExpression(node);
|
|
10403
|
+
}
|
|
10404
|
+
ts.isStringLiteralOrTemplateExpressionOrJsxExpression = isStringLiteralOrTemplateExpressionOrJsxExpression;
|
|
10394
10405
|
function isJsxOpeningLikeElement(node) {
|
|
10395
10406
|
var kind = node.kind;
|
|
10396
10407
|
return kind === 279
|
|
@@ -10517,6 +10528,10 @@ var ts;
|
|
|
10517
10528
|
return undefined;
|
|
10518
10529
|
}
|
|
10519
10530
|
ts.getDeclarationOfKind = getDeclarationOfKind;
|
|
10531
|
+
function getDeclarationsOfKind(symbol, kind) {
|
|
10532
|
+
return ts.filter(symbol.declarations || ts.emptyArray, function (d) { return d.kind === kind; });
|
|
10533
|
+
}
|
|
10534
|
+
ts.getDeclarationsOfKind = getDeclarationsOfKind;
|
|
10520
10535
|
function createSymbolTable(symbols) {
|
|
10521
10536
|
var result = new ts.Map();
|
|
10522
10537
|
if (symbols) {
|
|
@@ -10736,6 +10751,10 @@ var ts;
|
|
|
10736
10751
|
return getSourceFileOfNode(module.valueDeclaration || getNonAugmentationDeclaration(module));
|
|
10737
10752
|
}
|
|
10738
10753
|
ts.getSourceFileOfModule = getSourceFileOfModule;
|
|
10754
|
+
function isPlainJsFile(file, checkJs) {
|
|
10755
|
+
return !!file && (file.scriptKind === 1 || file.scriptKind === 2) && !file.checkJsDirective && checkJs === undefined;
|
|
10756
|
+
}
|
|
10757
|
+
ts.isPlainJsFile = isPlainJsFile;
|
|
10739
10758
|
function isStatementWithLocals(node) {
|
|
10740
10759
|
switch (node.kind) {
|
|
10741
10760
|
case 234:
|
|
@@ -27617,15 +27636,26 @@ var ts;
|
|
|
27617
27636
|
}
|
|
27618
27637
|
return finishNode(factory.createJsxExpression(dotDotDotToken, expression), pos);
|
|
27619
27638
|
}
|
|
27639
|
+
function parseJsxAttributeValue() {
|
|
27640
|
+
if (token() !== 63) {
|
|
27641
|
+
return undefined;
|
|
27642
|
+
}
|
|
27643
|
+
var jsxAttributeValueToken = scanJsxAttributeValue();
|
|
27644
|
+
if (jsxAttributeValueToken === 10 || jsxAttributeValueToken === 14) {
|
|
27645
|
+
return parseLiteralNode();
|
|
27646
|
+
}
|
|
27647
|
+
if (jsxAttributeValueToken === 15) {
|
|
27648
|
+
return parseTemplateExpression(false);
|
|
27649
|
+
}
|
|
27650
|
+
return parseJsxExpression(true);
|
|
27651
|
+
}
|
|
27620
27652
|
function parseJsxAttribute() {
|
|
27621
27653
|
if (token() === 18) {
|
|
27622
27654
|
return parseJsxSpreadAttribute();
|
|
27623
27655
|
}
|
|
27624
27656
|
scanJsxIdentifier();
|
|
27625
27657
|
var pos = getNodePos();
|
|
27626
|
-
return finishNode(factory.createJsxAttribute(parseIdentifierName(),
|
|
27627
|
-
scanJsxAttributeValue() === 10 ? parseLiteralNode() :
|
|
27628
|
-
parseJsxExpression(true)), pos);
|
|
27658
|
+
return finishNode(factory.createJsxAttribute(parseIdentifierName(), parseJsxAttributeValue()), pos);
|
|
27629
27659
|
}
|
|
27630
27660
|
function parseJsxSpreadAttribute() {
|
|
27631
27661
|
var pos = getNodePos();
|
|
@@ -39326,13 +39356,13 @@ var ts;
|
|
|
39326
39356
|
else {
|
|
39327
39357
|
var isEitherEnum = !!(target.flags & 384 || source.flags & 384);
|
|
39328
39358
|
var isEitherBlockScoped_1 = !!(target.flags & 2 || source.flags & 2);
|
|
39329
|
-
var message = isEitherEnum
|
|
39330
|
-
? ts.Diagnostics.
|
|
39331
|
-
: isEitherBlockScoped_1
|
|
39332
|
-
? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0
|
|
39359
|
+
var message = isEitherEnum ? ts.Diagnostics.Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations
|
|
39360
|
+
: isEitherBlockScoped_1 ? ts.Diagnostics.Cannot_redeclare_block_scoped_variable_0
|
|
39333
39361
|
: ts.Diagnostics.Duplicate_identifier_0;
|
|
39334
39362
|
var sourceSymbolFile = source.declarations && ts.getSourceFileOfNode(source.declarations[0]);
|
|
39335
39363
|
var targetSymbolFile = target.declarations && ts.getSourceFileOfNode(target.declarations[0]);
|
|
39364
|
+
var isSourcePlainJs = ts.isPlainJsFile(sourceSymbolFile, compilerOptions.checkJs);
|
|
39365
|
+
var isTargetPlainJs = ts.isPlainJsFile(targetSymbolFile, compilerOptions.checkJs);
|
|
39336
39366
|
var symbolName_1 = symbolToString(source);
|
|
39337
39367
|
if (sourceSymbolFile && targetSymbolFile && amalgamatedDuplicates && !isEitherEnum && sourceSymbolFile !== targetSymbolFile) {
|
|
39338
39368
|
var firstFile_1 = ts.comparePaths(sourceSymbolFile.path, targetSymbolFile.path) === -1 ? sourceSymbolFile : targetSymbolFile;
|
|
@@ -39343,12 +39373,16 @@ var ts;
|
|
|
39343
39373
|
var conflictingSymbolInfo = ts.getOrUpdate(filesDuplicates.conflictingSymbols, symbolName_1, function () {
|
|
39344
39374
|
return ({ isBlockScoped: isEitherBlockScoped_1, firstFileLocations: [], secondFileLocations: [] });
|
|
39345
39375
|
});
|
|
39346
|
-
|
|
39347
|
-
|
|
39376
|
+
if (!isSourcePlainJs)
|
|
39377
|
+
addDuplicateLocations(conflictingSymbolInfo.firstFileLocations, source);
|
|
39378
|
+
if (!isTargetPlainJs)
|
|
39379
|
+
addDuplicateLocations(conflictingSymbolInfo.secondFileLocations, target);
|
|
39348
39380
|
}
|
|
39349
39381
|
else {
|
|
39350
|
-
|
|
39351
|
-
|
|
39382
|
+
if (!isSourcePlainJs)
|
|
39383
|
+
addDuplicateDeclarationErrorsForSymbols(source, message, symbolName_1, target);
|
|
39384
|
+
if (!isTargetPlainJs)
|
|
39385
|
+
addDuplicateDeclarationErrorsForSymbols(target, message, symbolName_1, source);
|
|
39352
39386
|
}
|
|
39353
39387
|
}
|
|
39354
39388
|
return target;
|
|
@@ -39729,6 +39763,8 @@ var ts;
|
|
|
39729
39763
|
useResult = result.flags & 262144
|
|
39730
39764
|
? lastLocation === location.type ||
|
|
39731
39765
|
lastLocation.kind === 163 ||
|
|
39766
|
+
lastLocation.kind === 338 ||
|
|
39767
|
+
lastLocation.kind === 339 ||
|
|
39732
39768
|
lastLocation.kind === 162
|
|
39733
39769
|
: false;
|
|
39734
39770
|
}
|
|
@@ -39917,9 +39953,9 @@ var ts;
|
|
|
39917
39953
|
lastSelfReferenceLocation = location;
|
|
39918
39954
|
}
|
|
39919
39955
|
lastLocation = location;
|
|
39920
|
-
location = ts.isJSDocTemplateTag(location) ?
|
|
39921
|
-
ts.
|
|
39922
|
-
|
|
39956
|
+
location = ts.isJSDocTemplateTag(location) ? ts.getEffectiveContainerForJSDocTemplateTag(location) || location.parent :
|
|
39957
|
+
ts.isJSDocParameterTag(location) || ts.isJSDocReturnTag(location) ? ts.getHostSignatureFromJSDoc(location) || location.parent :
|
|
39958
|
+
location.parent;
|
|
39923
39959
|
}
|
|
39924
39960
|
if (isUse && result && (!lastSelfReferenceLocation || result !== lastSelfReferenceLocation.symbol)) {
|
|
39925
39961
|
result.isReferenced |= meaning;
|
|
@@ -40911,15 +40947,18 @@ var ts;
|
|
|
40911
40947
|
return;
|
|
40912
40948
|
}
|
|
40913
40949
|
var host = ts.getJSDocHost(node);
|
|
40914
|
-
if (host &&
|
|
40915
|
-
ts.isExpressionStatement(host) &&
|
|
40916
|
-
ts.isBinaryExpression(host.expression) &&
|
|
40917
|
-
ts.getAssignmentDeclarationKind(host.expression) === 3) {
|
|
40950
|
+
if (host && ts.isExpressionStatement(host) && ts.isPrototypePropertyAssignment(host.expression)) {
|
|
40918
40951
|
var symbol = getSymbolOfNode(host.expression.left);
|
|
40919
40952
|
if (symbol) {
|
|
40920
40953
|
return getDeclarationOfJSPrototypeContainer(symbol);
|
|
40921
40954
|
}
|
|
40922
40955
|
}
|
|
40956
|
+
if (host && ts.isFunctionExpression(host) && ts.isPrototypePropertyAssignment(host.parent) && ts.isExpressionStatement(host.parent.parent)) {
|
|
40957
|
+
var symbol = getSymbolOfNode(host.parent.left);
|
|
40958
|
+
if (symbol) {
|
|
40959
|
+
return getDeclarationOfJSPrototypeContainer(symbol);
|
|
40960
|
+
}
|
|
40961
|
+
}
|
|
40923
40962
|
if (host && (ts.isObjectLiteralMethod(host) || ts.isPropertyAssignment(host)) &&
|
|
40924
40963
|
ts.isBinaryExpression(host.parent.parent) &&
|
|
40925
40964
|
ts.getAssignmentDeclarationKind(host.parent.parent) === 6) {
|
|
@@ -44802,9 +44841,12 @@ var ts;
|
|
|
44802
44841
|
function isErrorType(type) {
|
|
44803
44842
|
return type === errorType || !!(type.flags & 1 && type.aliasSymbol);
|
|
44804
44843
|
}
|
|
44805
|
-
function getTypeForBindingElementParent(node) {
|
|
44844
|
+
function getTypeForBindingElementParent(node, checkMode) {
|
|
44845
|
+
if (checkMode !== 0) {
|
|
44846
|
+
return getTypeForVariableLikeDeclaration(node, false, checkMode);
|
|
44847
|
+
}
|
|
44806
44848
|
var symbol = getSymbolOfNode(node);
|
|
44807
|
-
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false);
|
|
44849
|
+
return symbol && getSymbolLinks(symbol).type || getTypeForVariableLikeDeclaration(node, false, checkMode);
|
|
44808
44850
|
}
|
|
44809
44851
|
function getRestType(source, properties, symbol) {
|
|
44810
44852
|
source = filterType(source, function (t) { return !(t.flags & 98304); });
|
|
@@ -44909,7 +44951,8 @@ var ts;
|
|
|
44909
44951
|
return type.flags & (128 | 256) ? "" + type.value : undefined;
|
|
44910
44952
|
}
|
|
44911
44953
|
function getTypeForBindingElement(declaration) {
|
|
44912
|
-
var
|
|
44954
|
+
var checkMode = declaration.dotDotDotToken ? 32 : 0;
|
|
44955
|
+
var parentType = getTypeForBindingElementParent(declaration.parent.parent, checkMode);
|
|
44913
44956
|
return parentType && getBindingElementTypeFromParentType(declaration, parentType);
|
|
44914
44957
|
}
|
|
44915
44958
|
function getBindingElementTypeFromParentType(declaration, parentType) {
|
|
@@ -44969,9 +45012,9 @@ var ts;
|
|
|
44969
45012
|
return type;
|
|
44970
45013
|
}
|
|
44971
45014
|
if (ts.getEffectiveTypeAnnotationNode(ts.walkUpBindingElementsAndPatterns(declaration))) {
|
|
44972
|
-
return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration)) & 32768) ? getNonUndefinedType(type) : type;
|
|
45015
|
+
return strictNullChecks && !(getFalsyFlags(checkDeclarationInitializer(declaration, 0)) & 32768) ? getNonUndefinedType(type) : type;
|
|
44973
45016
|
}
|
|
44974
|
-
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration)], 2));
|
|
45017
|
+
return widenTypeInferredFromInitializer(declaration, getUnionType([getNonUndefinedType(type), checkDeclarationInitializer(declaration, 0)], 2));
|
|
44975
45018
|
}
|
|
44976
45019
|
function getTypeForDeclarationFromJSDocComment(declaration) {
|
|
44977
45020
|
var jsdocType = ts.getJSDocType(declaration);
|
|
@@ -44993,9 +45036,9 @@ var ts;
|
|
|
44993
45036
|
if (isOptional === void 0) { isOptional = true; }
|
|
44994
45037
|
return strictNullChecks && isOptional ? getOptionalType(type, isProperty) : type;
|
|
44995
45038
|
}
|
|
44996
|
-
function getTypeForVariableLikeDeclaration(declaration, includeOptionality) {
|
|
45039
|
+
function getTypeForVariableLikeDeclaration(declaration, includeOptionality, checkMode) {
|
|
44997
45040
|
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 242) {
|
|
44998
|
-
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression)));
|
|
45041
|
+
var indexType = getIndexType(getNonNullableTypeIfNeeded(checkExpression(declaration.parent.parent.expression, checkMode)));
|
|
44999
45042
|
return indexType.flags & (262144 | 4194304) ? getExtractStringType(indexType) : stringType;
|
|
45000
45043
|
}
|
|
45001
45044
|
if (ts.isVariableDeclaration(declaration) && declaration.parent.parent.kind === 243) {
|
|
@@ -45038,12 +45081,9 @@ var ts;
|
|
|
45038
45081
|
}
|
|
45039
45082
|
}
|
|
45040
45083
|
if (ts.isInJSFile(declaration)) {
|
|
45041
|
-
var
|
|
45042
|
-
if (
|
|
45043
|
-
|
|
45044
|
-
var pos = func.parameters.indexOf(declaration);
|
|
45045
|
-
return declaration.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);
|
|
45046
|
-
}
|
|
45084
|
+
var type_1 = getParameterTypeOfTypeTag(func, declaration);
|
|
45085
|
+
if (type_1)
|
|
45086
|
+
return type_1;
|
|
45047
45087
|
}
|
|
45048
45088
|
var type = declaration.symbol.escapedName === "this" ? getContextualThisParameterType(func) : getContextuallyTypedParameterType(declaration);
|
|
45049
45089
|
if (type) {
|
|
@@ -45057,7 +45097,7 @@ var ts;
|
|
|
45057
45097
|
return containerObjectType;
|
|
45058
45098
|
}
|
|
45059
45099
|
}
|
|
45060
|
-
var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration));
|
|
45100
|
+
var type = widenTypeInferredFromInitializer(declaration, checkDeclarationInitializer(declaration, checkMode));
|
|
45061
45101
|
return addOptionality(type, isProperty, isOptional);
|
|
45062
45102
|
}
|
|
45063
45103
|
if (ts.isPropertyDeclaration(declaration) && (noImplicitAny || ts.isInJSFile(declaration))) {
|
|
@@ -45390,7 +45430,7 @@ var ts;
|
|
|
45390
45430
|
function getTypeFromBindingElement(element, includePatternInType, reportErrors) {
|
|
45391
45431
|
if (element.initializer) {
|
|
45392
45432
|
var contextualType = ts.isBindingPattern(element.name) ? getTypeFromBindingPattern(element.name, true, false) : unknownType;
|
|
45393
|
-
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, contextualType)));
|
|
45433
|
+
return addOptionality(widenTypeInferredFromInitializer(element, checkDeclarationInitializer(element, 0, contextualType)));
|
|
45394
45434
|
}
|
|
45395
45435
|
if (ts.isBindingPattern(element.name)) {
|
|
45396
45436
|
return getTypeFromBindingPattern(element.name, includePatternInType, reportErrors);
|
|
@@ -45456,7 +45496,7 @@ var ts;
|
|
|
45456
45496
|
: getTypeFromArrayBindingPattern(pattern, includePatternInType, reportErrors);
|
|
45457
45497
|
}
|
|
45458
45498
|
function getWidenedTypeForVariableLikeDeclaration(declaration, reportErrors) {
|
|
45459
|
-
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, true), declaration, reportErrors);
|
|
45499
|
+
return widenTypeForVariableLikeDeclaration(getTypeForVariableLikeDeclaration(declaration, true, 0), declaration, reportErrors);
|
|
45460
45500
|
}
|
|
45461
45501
|
function isGlobalSymbolConstructor(node) {
|
|
45462
45502
|
var symbol = getSymbolOfNode(node);
|
|
@@ -45535,8 +45575,8 @@ var ts;
|
|
|
45535
45575
|
if (typeNode === undefined) {
|
|
45536
45576
|
return useUnknownInCatchVariables ? unknownType : anyType;
|
|
45537
45577
|
}
|
|
45538
|
-
var
|
|
45539
|
-
return isTypeAny(
|
|
45578
|
+
var type_2 = getTypeOfNode(typeNode);
|
|
45579
|
+
return isTypeAny(type_2) || type_2 === unknownType ? type_2 : errorType;
|
|
45540
45580
|
}
|
|
45541
45581
|
if (ts.isSourceFile(declaration) && ts.isJsonSourceFile(declaration)) {
|
|
45542
45582
|
if (!declaration.statements.length) {
|
|
@@ -45667,9 +45707,11 @@ var ts;
|
|
|
45667
45707
|
if (writing === void 0) { writing = false; }
|
|
45668
45708
|
var getter = ts.getDeclarationOfKind(symbol, 171);
|
|
45669
45709
|
var setter = ts.getDeclarationOfKind(symbol, 172);
|
|
45670
|
-
|
|
45671
|
-
|
|
45672
|
-
|
|
45710
|
+
if (writing) {
|
|
45711
|
+
var setterType_1 = getAnnotatedAccessorType(setter);
|
|
45712
|
+
if (setterType_1) {
|
|
45713
|
+
return instantiateTypeIfNeeded(setterType_1, symbol);
|
|
45714
|
+
}
|
|
45673
45715
|
}
|
|
45674
45716
|
if (getter && ts.isInJSFile(getter)) {
|
|
45675
45717
|
var jsDocType = getTypeForDeclarationFromJSDocComment(getter);
|
|
@@ -45681,6 +45723,7 @@ var ts;
|
|
|
45681
45723
|
if (getterType) {
|
|
45682
45724
|
return instantiateTypeIfNeeded(getterType, symbol);
|
|
45683
45725
|
}
|
|
45726
|
+
var setterType = getAnnotatedAccessorType(setter);
|
|
45684
45727
|
if (setterType) {
|
|
45685
45728
|
return setterType;
|
|
45686
45729
|
}
|
|
@@ -45748,11 +45791,11 @@ var ts;
|
|
|
45748
45791
|
return errorType;
|
|
45749
45792
|
}
|
|
45750
45793
|
var exportEquals = getMergedSymbol(symbol.exports.get("export="));
|
|
45751
|
-
var
|
|
45794
|
+
var type_3 = getWidenedTypeForAssignmentDeclaration(exportEquals, exportEquals === resolvedModule ? undefined : resolvedModule);
|
|
45752
45795
|
if (!popTypeResolution()) {
|
|
45753
45796
|
return reportCircularityError(symbol);
|
|
45754
45797
|
}
|
|
45755
|
-
return
|
|
45798
|
+
return type_3;
|
|
45756
45799
|
}
|
|
45757
45800
|
}
|
|
45758
45801
|
var type = createObjectType(16, symbol);
|
|
@@ -45816,6 +45859,31 @@ var ts;
|
|
|
45816
45859
|
}
|
|
45817
45860
|
return links.type;
|
|
45818
45861
|
}
|
|
45862
|
+
function getWriteTypeOfSymbolWithDeferredType(symbol) {
|
|
45863
|
+
var links = getSymbolLinks(symbol);
|
|
45864
|
+
if (!links.writeType && links.deferralWriteConstituents) {
|
|
45865
|
+
ts.Debug.assertIsDefined(links.deferralParent);
|
|
45866
|
+
ts.Debug.assertIsDefined(links.deferralConstituents);
|
|
45867
|
+
links.writeType = links.deferralParent.flags & 1048576 ? getUnionType(links.deferralWriteConstituents) : getIntersectionType(links.deferralWriteConstituents);
|
|
45868
|
+
}
|
|
45869
|
+
return links.writeType;
|
|
45870
|
+
}
|
|
45871
|
+
function getWriteTypeOfSymbol(symbol) {
|
|
45872
|
+
var checkFlags = ts.getCheckFlags(symbol);
|
|
45873
|
+
if (checkFlags & 65536) {
|
|
45874
|
+
var writeType = getWriteTypeOfSymbolWithDeferredType(symbol);
|
|
45875
|
+
if (writeType) {
|
|
45876
|
+
return writeType;
|
|
45877
|
+
}
|
|
45878
|
+
}
|
|
45879
|
+
if (symbol.flags & 33554432) {
|
|
45880
|
+
var writeType = symbol.writeType;
|
|
45881
|
+
if (writeType) {
|
|
45882
|
+
return writeType;
|
|
45883
|
+
}
|
|
45884
|
+
}
|
|
45885
|
+
return getSetAccessorTypeOfSymbol(symbol);
|
|
45886
|
+
}
|
|
45819
45887
|
function getSetAccessorTypeOfSymbol(symbol) {
|
|
45820
45888
|
if (symbol.flags & 98304) {
|
|
45821
45889
|
var type = getTypeOfSetAccessor(symbol);
|
|
@@ -47660,10 +47728,10 @@ var ts;
|
|
|
47660
47728
|
var baseTypes = [];
|
|
47661
47729
|
var different = false;
|
|
47662
47730
|
for (var _i = 0, types_7 = types; _i < types_7.length; _i++) {
|
|
47663
|
-
var
|
|
47664
|
-
var baseType = getBaseConstraint(
|
|
47731
|
+
var type_4 = types_7[_i];
|
|
47732
|
+
var baseType = getBaseConstraint(type_4);
|
|
47665
47733
|
if (baseType) {
|
|
47666
|
-
if (baseType !==
|
|
47734
|
+
if (baseType !== type_4) {
|
|
47667
47735
|
different = true;
|
|
47668
47736
|
}
|
|
47669
47737
|
baseTypes.push(baseType);
|
|
@@ -47869,6 +47937,7 @@ var ts;
|
|
|
47869
47937
|
var firstType;
|
|
47870
47938
|
var nameType;
|
|
47871
47939
|
var propTypes = [];
|
|
47940
|
+
var writeTypes;
|
|
47872
47941
|
var firstValueDeclaration;
|
|
47873
47942
|
var hasNonUniformValueDeclaration = false;
|
|
47874
47943
|
for (var _d = 0, props_1 = props; _d < props_1.length; _d++) {
|
|
@@ -47885,6 +47954,10 @@ var ts;
|
|
|
47885
47954
|
firstType = type;
|
|
47886
47955
|
nameType = getSymbolLinks(prop).nameType;
|
|
47887
47956
|
}
|
|
47957
|
+
var writeType = getWriteTypeOfSymbol(prop);
|
|
47958
|
+
if (writeTypes || writeType !== type) {
|
|
47959
|
+
writeTypes = ts.append(!writeTypes ? propTypes.slice() : writeTypes, writeType);
|
|
47960
|
+
}
|
|
47888
47961
|
else if (type !== firstType) {
|
|
47889
47962
|
checkFlags |= 64;
|
|
47890
47963
|
}
|
|
@@ -47911,9 +47984,13 @@ var ts;
|
|
|
47911
47984
|
result.checkFlags |= 65536;
|
|
47912
47985
|
result.deferralParent = containingType;
|
|
47913
47986
|
result.deferralConstituents = propTypes;
|
|
47987
|
+
result.deferralWriteConstituents = writeTypes;
|
|
47914
47988
|
}
|
|
47915
47989
|
else {
|
|
47916
47990
|
result.type = isUnion ? getUnionType(propTypes) : getIntersectionType(propTypes);
|
|
47991
|
+
if (writeTypes) {
|
|
47992
|
+
result.writeType = isUnion ? getUnionType(writeTypes) : getIntersectionType(writeTypes);
|
|
47993
|
+
}
|
|
47917
47994
|
}
|
|
47918
47995
|
return result;
|
|
47919
47996
|
}
|
|
@@ -48264,6 +48341,13 @@ var ts;
|
|
|
48264
48341
|
var typeTag = ts.getJSDocTypeTag(node);
|
|
48265
48342
|
return (typeTag === null || typeTag === void 0 ? void 0 : typeTag.typeExpression) && getSingleCallSignature(getTypeFromTypeNode(typeTag.typeExpression));
|
|
48266
48343
|
}
|
|
48344
|
+
function getParameterTypeOfTypeTag(func, parameter) {
|
|
48345
|
+
var signature = getSignatureOfTypeTag(func);
|
|
48346
|
+
if (!signature)
|
|
48347
|
+
return undefined;
|
|
48348
|
+
var pos = func.parameters.indexOf(parameter);
|
|
48349
|
+
return parameter.dotDotDotToken ? getRestTypeAtPosition(signature, pos) : getTypeAtPosition(signature, pos);
|
|
48350
|
+
}
|
|
48267
48351
|
function getReturnTypeOfTypeTag(node) {
|
|
48268
48352
|
var signature = getSignatureOfTypeTag(node);
|
|
48269
48353
|
return signature && getReturnTypeOfSignature(signature);
|
|
@@ -48921,7 +49005,7 @@ var ts;
|
|
|
48921
49005
|
}
|
|
48922
49006
|
function getImpliedConstraint(type, checkNode, extendsNode) {
|
|
48923
49007
|
return isUnaryTupleTypeNode(checkNode) && isUnaryTupleTypeNode(extendsNode) ? getImpliedConstraint(type, checkNode.elements[0], extendsNode.elements[0]) :
|
|
48924
|
-
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === type ? getTypeFromTypeNode(extendsNode) :
|
|
49008
|
+
getActualTypeVariable(getTypeFromTypeNode(checkNode)) === getActualTypeVariable(type) ? getTypeFromTypeNode(extendsNode) :
|
|
48925
49009
|
undefined;
|
|
48926
49010
|
}
|
|
48927
49011
|
function getConditionalFlowTypeOfType(type, node) {
|
|
@@ -58378,16 +58462,18 @@ var ts;
|
|
|
58378
58462
|
function isGenericTypeWithoutNullableConstraint(type) {
|
|
58379
58463
|
return !!(type.flags & 465829888 && !maybeTypeOfKind(getBaseConstraintOrType(type), 98304));
|
|
58380
58464
|
}
|
|
58381
|
-
function
|
|
58465
|
+
function hasContextualTypeWithNoGenericTypes(node, checkMode) {
|
|
58382
58466
|
var contextualType = (ts.isIdentifier(node) || ts.isPropertyAccessExpression(node) || ts.isElementAccessExpression(node)) &&
|
|
58383
58467
|
!((ts.isJsxOpeningElement(node.parent) || ts.isJsxSelfClosingElement(node.parent)) && node.parent.tagName === node) &&
|
|
58384
|
-
|
|
58468
|
+
(checkMode && checkMode & 32 ?
|
|
58469
|
+
getContextualType(node, 8)
|
|
58470
|
+
: getContextualType(node));
|
|
58385
58471
|
return contextualType && !isGenericType(contextualType);
|
|
58386
58472
|
}
|
|
58387
58473
|
function getNarrowableTypeForReference(type, reference, checkMode) {
|
|
58388
58474
|
var substituteConstraints = !(checkMode && checkMode & 2) &&
|
|
58389
58475
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
58390
|
-
(isConstraintPosition(type, reference) ||
|
|
58476
|
+
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
|
58391
58477
|
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 && !isMappedTypeGenericIndexedAccess(t) ? getBaseConstraintOrType(t) : t; }) : type;
|
|
58392
58478
|
}
|
|
58393
58479
|
function isExportOrExportExpression(location) {
|
|
@@ -58429,7 +58515,7 @@ var ts;
|
|
|
58429
58515
|
var links = getNodeLinks(location);
|
|
58430
58516
|
if (!(links.flags & 268435456)) {
|
|
58431
58517
|
links.flags |= 268435456;
|
|
58432
|
-
var parentType = getTypeForBindingElementParent(parent);
|
|
58518
|
+
var parentType = getTypeForBindingElementParent(parent, 0);
|
|
58433
58519
|
links.flags &= ~268435456;
|
|
58434
58520
|
if (parentType && parentType.flags & 1048576 && !(parent.kind === 163 && isSymbolAssigned(symbol))) {
|
|
58435
58521
|
var pattern = declaration.parent;
|
|
@@ -59100,7 +59186,7 @@ var ts;
|
|
|
59100
59186
|
var parent = declaration.parent.parent;
|
|
59101
59187
|
var name = declaration.propertyName || declaration.name;
|
|
59102
59188
|
var parentType = getContextualTypeForVariableLikeDeclaration(parent) ||
|
|
59103
|
-
parent.kind !== 202 && parent.initializer && checkDeclarationInitializer(parent);
|
|
59189
|
+
parent.kind !== 202 && parent.initializer && checkDeclarationInitializer(parent, declaration.dotDotDotToken ? 32 : 0);
|
|
59104
59190
|
if (!parentType || ts.isBindingPattern(name) || ts.isComputedNonLiteralName(name))
|
|
59105
59191
|
return undefined;
|
|
59106
59192
|
if (parent.name.kind === 201) {
|
|
@@ -60938,23 +61024,6 @@ var ts;
|
|
|
60938
61024
|
if (assignmentKind && lexicallyScopedSymbol && lexicallyScopedSymbol.valueDeclaration && ts.isMethodDeclaration(lexicallyScopedSymbol.valueDeclaration)) {
|
|
60939
61025
|
grammarErrorOnNode(right, ts.Diagnostics.Cannot_assign_to_private_method_0_Private_methods_are_not_writable, ts.idText(right));
|
|
60940
61026
|
}
|
|
60941
|
-
if ((lexicallyScopedSymbol === null || lexicallyScopedSymbol === void 0 ? void 0 : lexicallyScopedSymbol.valueDeclaration) && (ts.getEmitScriptTarget(compilerOptions) === 99 && !useDefineForClassFields)) {
|
|
60942
|
-
var lexicalClass_1 = ts.getContainingClass(lexicallyScopedSymbol.valueDeclaration);
|
|
60943
|
-
var parentStaticFieldInitializer = ts.findAncestor(node, function (n) {
|
|
60944
|
-
if (n === lexicalClass_1)
|
|
60945
|
-
return "quit";
|
|
60946
|
-
if (ts.isPropertyDeclaration(n.parent) && ts.hasStaticModifier(n.parent) && n.parent.initializer === n && n.parent.parent === lexicalClass_1) {
|
|
60947
|
-
return true;
|
|
60948
|
-
}
|
|
60949
|
-
return false;
|
|
60950
|
-
});
|
|
60951
|
-
if (parentStaticFieldInitializer) {
|
|
60952
|
-
var parentStaticFieldInitializerSymbol = getSymbolOfNode(parentStaticFieldInitializer.parent);
|
|
60953
|
-
ts.Debug.assert(parentStaticFieldInitializerSymbol, "Initializer without declaration symbol");
|
|
60954
|
-
var diagnostic = error(node, ts.Diagnostics.Property_0_may_not_be_used_in_a_static_property_s_initializer_in_the_same_class_when_target_is_esnext_and_useDefineForClassFields_is_false, ts.symbolName(lexicallyScopedSymbol));
|
|
60955
|
-
ts.addRelatedInfo(diagnostic, ts.createDiagnosticForNode(parentStaticFieldInitializer.parent, ts.Diagnostics.Initializer_for_property_0, ts.symbolName(parentStaticFieldInitializerSymbol)));
|
|
60956
|
-
}
|
|
60957
|
-
}
|
|
60958
61027
|
if (isAnyLike) {
|
|
60959
61028
|
if (lexicallyScopedSymbol) {
|
|
60960
61029
|
return isErrorType(apparentType) ? errorType : apparentType;
|
|
@@ -61032,7 +61101,7 @@ var ts;
|
|
|
61032
61101
|
error(right, ts.Diagnostics.Cannot_assign_to_0_because_it_is_a_read_only_property, ts.idText(right));
|
|
61033
61102
|
return errorType;
|
|
61034
61103
|
}
|
|
61035
|
-
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ?
|
|
61104
|
+
propType = isThisPropertyAccessInConstructor(node, prop) ? autoType : writing ? getWriteTypeOfSymbol(prop) : getTypeOfSymbol(prop);
|
|
61036
61105
|
}
|
|
61037
61106
|
return getFlowTypeOfAccessExpression(node, prop, propType, right, checkMode);
|
|
61038
61107
|
}
|
|
@@ -63124,8 +63193,8 @@ var ts;
|
|
|
63124
63193
|
if (hasDefaultOnly && type && !isErrorType(type)) {
|
|
63125
63194
|
var synthType = type;
|
|
63126
63195
|
if (!synthType.defaultOnlyType) {
|
|
63127
|
-
var
|
|
63128
|
-
synthType.defaultOnlyType =
|
|
63196
|
+
var type_5 = createDefaultPropertyWrapperForModule(symbol, originalSymbol);
|
|
63197
|
+
synthType.defaultOnlyType = type_5;
|
|
63129
63198
|
}
|
|
63130
63199
|
return synthType.defaultOnlyType;
|
|
63131
63200
|
}
|
|
@@ -63791,11 +63860,11 @@ var ts;
|
|
|
63791
63860
|
var operandType = getTypeOfExpression(node.expression.expression);
|
|
63792
63861
|
var witnesses = getSwitchClauseTypeOfWitnesses(node, false);
|
|
63793
63862
|
var notEqualFacts_1 = getFactsFromTypeofSwitch(0, 0, witnesses, true);
|
|
63794
|
-
var
|
|
63795
|
-
if (
|
|
63863
|
+
var type_6 = getBaseConstraintOfType(operandType) || operandType;
|
|
63864
|
+
if (type_6.flags & 3) {
|
|
63796
63865
|
return (556800 & notEqualFacts_1) === 556800;
|
|
63797
63866
|
}
|
|
63798
|
-
return !!(filterType(
|
|
63867
|
+
return !!(filterType(type_6, function (t) { return (getTypeFacts(t) & notEqualFacts_1) === notEqualFacts_1; }).flags & 131072);
|
|
63799
63868
|
}
|
|
63800
63869
|
var type = getTypeOfExpression(node.expression);
|
|
63801
63870
|
if (!isLiteralType(type)) {
|
|
@@ -65086,11 +65155,11 @@ var ts;
|
|
|
65086
65155
|
}
|
|
65087
65156
|
}
|
|
65088
65157
|
function checkExpressionCached(node, checkMode) {
|
|
65158
|
+
if (checkMode && checkMode !== 0) {
|
|
65159
|
+
return checkExpression(node, checkMode);
|
|
65160
|
+
}
|
|
65089
65161
|
var links = getNodeLinks(node);
|
|
65090
65162
|
if (!links.resolvedType) {
|
|
65091
|
-
if (checkMode && checkMode !== 0) {
|
|
65092
|
-
return checkExpression(node, checkMode);
|
|
65093
|
-
}
|
|
65094
65163
|
var saveFlowLoopStart = flowLoopStart;
|
|
65095
65164
|
var saveFlowTypeCache = flowTypeCache;
|
|
65096
65165
|
flowLoopStart = flowLoopCount;
|
|
@@ -65107,10 +65176,12 @@ var ts;
|
|
|
65107
65176
|
node.kind === 228 ||
|
|
65108
65177
|
ts.isJSDocTypeAssertion(node);
|
|
65109
65178
|
}
|
|
65110
|
-
function checkDeclarationInitializer(declaration, contextualType) {
|
|
65179
|
+
function checkDeclarationInitializer(declaration, checkMode, contextualType) {
|
|
65111
65180
|
var initializer = ts.getEffectiveInitializer(declaration);
|
|
65112
65181
|
var type = getQuickTypeOfExpression(initializer) ||
|
|
65113
|
-
(contextualType ?
|
|
65182
|
+
(contextualType ?
|
|
65183
|
+
checkExpressionWithContextualType(initializer, contextualType, undefined, checkMode || 0)
|
|
65184
|
+
: checkExpressionCached(initializer, checkMode));
|
|
65114
65185
|
return ts.isParameter(declaration) && declaration.name.kind === 201 &&
|
|
65115
65186
|
isTupleType(type) && !type.target.hasRestElement && getTypeReferenceArity(type) < declaration.name.elements.length ?
|
|
65116
65187
|
padTupleType(type, declaration.name) : type;
|
|
@@ -65678,6 +65749,7 @@ var ts;
|
|
|
65678
65749
|
}
|
|
65679
65750
|
}
|
|
65680
65751
|
checkTypeParameters(ts.getEffectiveTypeParameterDeclarations(node));
|
|
65752
|
+
checkUnmatchedJSDocParameters(node);
|
|
65681
65753
|
ts.forEach(node.parameters, checkParameter);
|
|
65682
65754
|
if (node.type) {
|
|
65683
65755
|
checkSourceElement(node.type);
|
|
@@ -65881,9 +65953,6 @@ var ts;
|
|
|
65881
65953
|
checkGrammarComputedPropertyName(node.name);
|
|
65882
65954
|
checkVariableLikeDeclaration(node);
|
|
65883
65955
|
setNodeLinksForPrivateIdentifierScope(node);
|
|
65884
|
-
if (ts.isPrivateIdentifier(node.name) && ts.hasStaticModifier(node) && node.initializer && languageVersion === 99 && !compilerOptions.useDefineForClassFields) {
|
|
65885
|
-
error(node.initializer, ts.Diagnostics.Static_fields_with_private_names_can_t_have_initializers_when_the_useDefineForClassFields_flag_is_not_specified_with_a_target_of_esnext_Consider_adding_the_useDefineForClassFields_flag);
|
|
65886
|
-
}
|
|
65887
65956
|
if (ts.hasSyntacticModifier(node, 128) && node.kind === 166 && node.initializer) {
|
|
65888
65957
|
error(node, ts.Diagnostics.Property_0_cannot_have_an_initializer_because_it_is_marked_abstract, ts.declarationNameToString(node.name));
|
|
65889
65958
|
}
|
|
@@ -66962,28 +67031,6 @@ var ts;
|
|
|
66962
67031
|
}
|
|
66963
67032
|
function checkJSDocParameterTag(node) {
|
|
66964
67033
|
checkSourceElement(node.typeExpression);
|
|
66965
|
-
if (!ts.getParameterSymbolFromJSDoc(node)) {
|
|
66966
|
-
var decl = ts.getHostSignatureFromJSDoc(node);
|
|
66967
|
-
if (decl) {
|
|
66968
|
-
var i = ts.getJSDocTags(decl).filter(ts.isJSDocParameterTag).indexOf(node);
|
|
66969
|
-
if (i > -1 && i < decl.parameters.length && ts.isBindingPattern(decl.parameters[i].name)) {
|
|
66970
|
-
return;
|
|
66971
|
-
}
|
|
66972
|
-
if (!containsArgumentsReference(decl)) {
|
|
66973
|
-
if (ts.isQualifiedName(node.name)) {
|
|
66974
|
-
error(node.name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(node.name), ts.entityNameToString(node.name.left));
|
|
66975
|
-
}
|
|
66976
|
-
else {
|
|
66977
|
-
error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(node.name));
|
|
66978
|
-
}
|
|
66979
|
-
}
|
|
66980
|
-
else if (ts.findLast(ts.getJSDocTags(decl), ts.isJSDocParameterTag) === node &&
|
|
66981
|
-
node.typeExpression && node.typeExpression.type &&
|
|
66982
|
-
!isArrayType(getTypeFromTypeNode(node.typeExpression.type))) {
|
|
66983
|
-
error(node.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(node.name.kind === 160 ? node.name.right : node.name));
|
|
66984
|
-
}
|
|
66985
|
-
}
|
|
66986
|
-
}
|
|
66987
67034
|
}
|
|
66988
67035
|
function checkJSDocPropertyTag(node) {
|
|
66989
67036
|
checkSourceElement(node.typeExpression);
|
|
@@ -67584,7 +67631,8 @@ var ts;
|
|
|
67584
67631
|
checkComputedPropertyName(node.propertyName);
|
|
67585
67632
|
}
|
|
67586
67633
|
var parent = node.parent.parent;
|
|
67587
|
-
var
|
|
67634
|
+
var parentCheckMode = node.dotDotDotToken ? 32 : 0;
|
|
67635
|
+
var parentType = getTypeForBindingElementParent(parent, parentCheckMode);
|
|
67588
67636
|
var name = node.propertyName || node.name;
|
|
67589
67637
|
if (parentType && !ts.isBindingPattern(name)) {
|
|
67590
67638
|
var exprType = getLiteralTypeFromPropertyName(name);
|
|
@@ -68548,7 +68596,7 @@ var ts;
|
|
|
68548
68596
|
var declaration = catchClause.variableDeclaration;
|
|
68549
68597
|
var typeNode = ts.getEffectiveTypeAnnotationNode(ts.getRootDeclaration(declaration));
|
|
68550
68598
|
if (typeNode) {
|
|
68551
|
-
var type = getTypeForVariableLikeDeclaration(declaration, false);
|
|
68599
|
+
var type = getTypeForVariableLikeDeclaration(declaration, false, 0);
|
|
68552
68600
|
if (type && !(type.flags & 3)) {
|
|
68553
68601
|
grammarErrorOnFirstToken(typeNode, ts.Diagnostics.Catch_clause_variable_type_annotation_must_be_any_or_unknown_if_specified);
|
|
68554
68602
|
}
|
|
@@ -68666,6 +68714,45 @@ var ts;
|
|
|
68666
68714
|
error(name, ts.Diagnostics.Class_name_cannot_be_Object_when_targeting_ES5_with_module_0, ts.ModuleKind[moduleKind]);
|
|
68667
68715
|
}
|
|
68668
68716
|
}
|
|
68717
|
+
function checkUnmatchedJSDocParameters(node) {
|
|
68718
|
+
var jsdocParameters = ts.filter(ts.getJSDocTags(node), ts.isJSDocParameterTag);
|
|
68719
|
+
if (!ts.length(jsdocParameters))
|
|
68720
|
+
return;
|
|
68721
|
+
var isJs = ts.isInJSFile(node);
|
|
68722
|
+
var parameters = new ts.Set();
|
|
68723
|
+
var excludedParameters = new ts.Set();
|
|
68724
|
+
ts.forEach(node.parameters, function (_a, index) {
|
|
68725
|
+
var name = _a.name;
|
|
68726
|
+
if (ts.isIdentifier(name)) {
|
|
68727
|
+
parameters.add(name.escapedText);
|
|
68728
|
+
}
|
|
68729
|
+
if (ts.isBindingPattern(name)) {
|
|
68730
|
+
excludedParameters.add(index);
|
|
68731
|
+
}
|
|
68732
|
+
});
|
|
68733
|
+
var containsArguments = containsArgumentsReference(node);
|
|
68734
|
+
if (containsArguments) {
|
|
68735
|
+
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
|
|
68736
|
+
if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
68737
|
+
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
|
|
68738
|
+
errorOrSuggestion(isJs, lastJSDocParam.name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type, ts.idText(lastJSDocParam.name));
|
|
68739
|
+
}
|
|
68740
|
+
}
|
|
68741
|
+
else {
|
|
68742
|
+
ts.forEach(jsdocParameters, function (_a, index) {
|
|
68743
|
+
var name = _a.name;
|
|
68744
|
+
if (excludedParameters.has(index) || ts.isIdentifier(name) && parameters.has(name.escapedText)) {
|
|
68745
|
+
return;
|
|
68746
|
+
}
|
|
68747
|
+
if (ts.isQualifiedName(name)) {
|
|
68748
|
+
errorOrSuggestion(isJs, name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
|
|
68749
|
+
}
|
|
68750
|
+
else {
|
|
68751
|
+
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
|
|
68752
|
+
}
|
|
68753
|
+
});
|
|
68754
|
+
}
|
|
68755
|
+
}
|
|
68669
68756
|
function checkTypeParameters(typeParameterDeclarations) {
|
|
68670
68757
|
if (typeParameterDeclarations) {
|
|
68671
68758
|
var seenDefault = false;
|
|
@@ -69542,7 +69629,7 @@ var ts;
|
|
|
69542
69629
|
var isAmbientExternalModule = ts.isAmbientModule(node);
|
|
69543
69630
|
var contextErrorMessage = isAmbientExternalModule
|
|
69544
69631
|
? ts.Diagnostics.An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file
|
|
69545
|
-
: ts.Diagnostics.
|
|
69632
|
+
: ts.Diagnostics.A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module;
|
|
69546
69633
|
if (checkGrammarModuleElementContext(node, contextErrorMessage)) {
|
|
69547
69634
|
return;
|
|
69548
69635
|
}
|
|
@@ -69743,6 +69830,9 @@ var ts;
|
|
|
69743
69830
|
var name = ts.idText(node.kind === 269 ? node.propertyName || node.name : node.name);
|
|
69744
69831
|
addTypeOnlyDeclarationRelatedInfo(error(node, message, name), isType ? undefined : typeOnlyAlias, name);
|
|
69745
69832
|
}
|
|
69833
|
+
if (isType && node.kind === 264 && ts.hasEffectiveModifier(node, 1)) {
|
|
69834
|
+
error(node, ts.Diagnostics.Cannot_use_export_import_on_a_type_or_type_only_namespace_when_the_isolatedModules_flag_is_provided);
|
|
69835
|
+
}
|
|
69746
69836
|
break;
|
|
69747
69837
|
}
|
|
69748
69838
|
case 274: {
|
|
@@ -69823,7 +69913,7 @@ var ts;
|
|
|
69823
69913
|
}
|
|
69824
69914
|
}
|
|
69825
69915
|
function checkImportDeclaration(node) {
|
|
69826
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
69916
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
69827
69917
|
return;
|
|
69828
69918
|
}
|
|
69829
69919
|
if (!checkGrammarDecoratorsAndModifiers(node) && ts.hasEffectiveModifiers(node)) {
|
|
@@ -69854,7 +69944,7 @@ var ts;
|
|
|
69854
69944
|
checkAssertClause(node);
|
|
69855
69945
|
}
|
|
69856
69946
|
function checkImportEqualsDeclaration(node) {
|
|
69857
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
69947
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
69858
69948
|
return;
|
|
69859
69949
|
}
|
|
69860
69950
|
checkGrammarDecoratorsAndModifiers(node);
|
|
@@ -69888,7 +69978,7 @@ var ts;
|
|
|
69888
69978
|
}
|
|
69889
69979
|
}
|
|
69890
69980
|
function checkExportDeclaration(node) {
|
|
69891
|
-
if (checkGrammarModuleElementContext(node, ts.Diagnostics.
|
|
69981
|
+
if (checkGrammarModuleElementContext(node, ts.isInJSFile(node) ? ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module : ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_namespace_or_module)) {
|
|
69892
69982
|
return;
|
|
69893
69983
|
}
|
|
69894
69984
|
if (!checkGrammarDecoratorsAndModifiers(node) && ts.hasEffectiveModifiers(node)) {
|
|
@@ -71006,7 +71096,7 @@ var ts;
|
|
|
71006
71096
|
return errorType;
|
|
71007
71097
|
}
|
|
71008
71098
|
if (ts.isBindingPattern(node)) {
|
|
71009
|
-
return getTypeForVariableLikeDeclaration(node.parent, true) || errorType;
|
|
71099
|
+
return getTypeForVariableLikeDeclaration(node.parent, true, 0) || errorType;
|
|
71010
71100
|
}
|
|
71011
71101
|
if (isInRightSideOfImportOrExportAssignment(node)) {
|
|
71012
71102
|
var symbol = getSymbolAtLocation(node);
|
|
@@ -74001,7 +74091,7 @@ var ts;
|
|
|
74001
74091
|
return factory.updateJsxFragment(node, nodeVisitor(node.openingFragment, visitor, ts.isJsxOpeningFragment), nodesVisitor(node.children, visitor, ts.isJsxChild), nodeVisitor(node.closingFragment, visitor, ts.isJsxClosingFragment));
|
|
74002
74092
|
case 284:
|
|
74003
74093
|
ts.Debug.type(node);
|
|
74004
|
-
return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.
|
|
74094
|
+
return factory.updateJsxAttribute(node, nodeVisitor(node.name, visitor, ts.isIdentifier), nodeVisitor(node.initializer, visitor, ts.isStringLiteralOrTemplateExpressionOrJsxExpression));
|
|
74005
74095
|
case 285:
|
|
74006
74096
|
ts.Debug.type(node);
|
|
74007
74097
|
return factory.updateJsxAttributes(node, nodesVisitor(node.properties, visitor, ts.isJsxAttributeLike));
|
|
@@ -77054,8 +77144,8 @@ var ts;
|
|
|
77054
77144
|
var languageVersion = ts.getEmitScriptTarget(compilerOptions);
|
|
77055
77145
|
var useDefineForClassFields = ts.getUseDefineForClassFields(compilerOptions);
|
|
77056
77146
|
var shouldTransformPrivateElementsOrClassStaticBlocks = languageVersion < 9;
|
|
77057
|
-
var
|
|
77058
|
-
var
|
|
77147
|
+
var shouldTransformThisInStaticInitializers = languageVersion < 9;
|
|
77148
|
+
var shouldTransformSuperInStaticInitializers = shouldTransformThisInStaticInitializers && languageVersion >= 2;
|
|
77059
77149
|
var previousOnSubstituteNode = context.onSubstituteNode;
|
|
77060
77150
|
context.onSubstituteNode = onSubstituteNode;
|
|
77061
77151
|
var previousOnEmitNode = context.onEmitNode;
|
|
@@ -77255,6 +77345,9 @@ var ts;
|
|
|
77255
77345
|
ts.Debug.assert(!ts.some(node.decorators));
|
|
77256
77346
|
if (ts.isPrivateIdentifier(node.name)) {
|
|
77257
77347
|
if (!shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
77348
|
+
if (ts.isStatic(node)) {
|
|
77349
|
+
return ts.visitEachChild(node, visitor, context);
|
|
77350
|
+
}
|
|
77258
77351
|
return factory.updatePropertyDeclaration(node, undefined, ts.visitNodes(node.modifiers, visitor, ts.isModifier), node.name, undefined, undefined, undefined);
|
|
77259
77352
|
}
|
|
77260
77353
|
var info = accessPrivateIdentifier(node.name);
|
|
@@ -77267,6 +77360,18 @@ var ts;
|
|
|
77267
77360
|
if (expr && !ts.isSimpleInlineableExpression(expr)) {
|
|
77268
77361
|
getPendingExpressions().push(expr);
|
|
77269
77362
|
}
|
|
77363
|
+
if (ts.isStatic(node) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) {
|
|
77364
|
+
var initializerStatement = transformPropertyOrClassStaticBlock(node, factory.createThis());
|
|
77365
|
+
if (initializerStatement) {
|
|
77366
|
+
var staticBlock = factory.createClassStaticBlockDeclaration(undefined, undefined, factory.createBlock([initializerStatement]));
|
|
77367
|
+
ts.setOriginalNode(staticBlock, node);
|
|
77368
|
+
ts.setCommentRange(staticBlock, node);
|
|
77369
|
+
ts.setCommentRange(initializerStatement, { pos: -1, end: -1 });
|
|
77370
|
+
ts.setSyntheticLeadingComments(initializerStatement, undefined);
|
|
77371
|
+
ts.setSyntheticTrailingComments(initializerStatement, undefined);
|
|
77372
|
+
return staticBlock;
|
|
77373
|
+
}
|
|
77374
|
+
}
|
|
77270
77375
|
return undefined;
|
|
77271
77376
|
}
|
|
77272
77377
|
function createPrivateIdentifierAccess(info, receiver) {
|
|
@@ -77625,7 +77730,6 @@ var ts;
|
|
|
77625
77730
|
if (facts & 8) {
|
|
77626
77731
|
enableSubstitutionForClassStaticThisOrSuperReference();
|
|
77627
77732
|
}
|
|
77628
|
-
var staticProperties = ts.getStaticPropertiesAndClassStaticBlock(node);
|
|
77629
77733
|
var pendingClassReferenceAssignment;
|
|
77630
77734
|
if (facts & 2) {
|
|
77631
77735
|
var temp = factory.createTempVariable(hoistVariableDeclaration, true);
|
|
@@ -77643,6 +77747,7 @@ var ts;
|
|
|
77643
77747
|
if (ts.some(pendingExpressions)) {
|
|
77644
77748
|
statements.push(factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions)));
|
|
77645
77749
|
}
|
|
77750
|
+
var staticProperties = ts.getStaticPropertiesAndClassStaticBlock(node);
|
|
77646
77751
|
if (ts.some(staticProperties)) {
|
|
77647
77752
|
addPropertyOrClassStaticBlockStatements(statements, staticProperties, factory.getInternalName(node));
|
|
77648
77753
|
}
|
|
@@ -77673,7 +77778,7 @@ var ts;
|
|
|
77673
77778
|
getClassLexicalEnvironment().classConstructor = factory.cloneNode(temp);
|
|
77674
77779
|
}
|
|
77675
77780
|
var classExpression = factory.updateClassExpression(node, ts.visitNodes(node.decorators, visitor, ts.isDecorator), node.modifiers, node.name, undefined, ts.visitNodes(node.heritageClauses, heritageClauseVisitor, ts.isHeritageClause), transformClassMembers(node, isDerivedClass));
|
|
77676
|
-
var hasTransformableStatics = ts.some(staticPropertiesOrClassStaticBlocks, function (p) { return ts.isClassStaticBlockDeclaration(p) || !!p.initializer ||
|
|
77781
|
+
var hasTransformableStatics = shouldTransformPrivateElementsOrClassStaticBlocks && ts.some(staticPropertiesOrClassStaticBlocks, function (p) { return ts.isClassStaticBlockDeclaration(p) || !!p.initializer || ts.isPrivateIdentifier(p.name); });
|
|
77677
77782
|
if (hasTransformableStatics || ts.some(pendingExpressions)) {
|
|
77678
77783
|
if (isDecoratedClassDeclaration) {
|
|
77679
77784
|
ts.Debug.assertIsDefined(pendingStatements, "Decorated classes transformed by TypeScript are expected to be within a variable declaration.");
|
|
@@ -77714,6 +77819,7 @@ var ts;
|
|
|
77714
77819
|
return undefined;
|
|
77715
77820
|
}
|
|
77716
77821
|
function transformClassMembers(node, isDerivedClass) {
|
|
77822
|
+
var members = [];
|
|
77717
77823
|
if (shouldTransformPrivateElementsOrClassStaticBlocks) {
|
|
77718
77824
|
for (var _i = 0, _a = node.members; _i < _a.length; _i++) {
|
|
77719
77825
|
var member = _a[_i];
|
|
@@ -77725,12 +77831,18 @@ var ts;
|
|
|
77725
77831
|
createBrandCheckWeakSetForPrivateMethods();
|
|
77726
77832
|
}
|
|
77727
77833
|
}
|
|
77728
|
-
var members = [];
|
|
77729
77834
|
var constructor = transformConstructor(node, isDerivedClass);
|
|
77835
|
+
var visitedMembers = ts.visitNodes(node.members, classElementVisitor, ts.isClassElement);
|
|
77730
77836
|
if (constructor) {
|
|
77731
77837
|
members.push(constructor);
|
|
77732
77838
|
}
|
|
77733
|
-
|
|
77839
|
+
if (!shouldTransformPrivateElementsOrClassStaticBlocks && ts.some(pendingExpressions)) {
|
|
77840
|
+
members.push(factory.createClassStaticBlockDeclaration(undefined, undefined, factory.createBlock([
|
|
77841
|
+
factory.createExpressionStatement(factory.inlineExpressions(pendingExpressions))
|
|
77842
|
+
])));
|
|
77843
|
+
pendingExpressions = undefined;
|
|
77844
|
+
}
|
|
77845
|
+
ts.addRange(members, visitedMembers);
|
|
77734
77846
|
return ts.setTextRange(factory.createNodeArray(members), node.members);
|
|
77735
77847
|
}
|
|
77736
77848
|
function createBrandCheckWeakSetForPrivateMethods() {
|
|
@@ -77835,21 +77947,31 @@ var ts;
|
|
|
77835
77947
|
function addPropertyOrClassStaticBlockStatements(statements, properties, receiver) {
|
|
77836
77948
|
for (var _i = 0, properties_7 = properties; _i < properties_7.length; _i++) {
|
|
77837
77949
|
var property = properties_7[_i];
|
|
77838
|
-
|
|
77839
|
-
|
|
77840
|
-
|
|
77841
|
-
|
|
77950
|
+
if (ts.isStatic(property) && !shouldTransformPrivateElementsOrClassStaticBlocks && !useDefineForClassFields) {
|
|
77951
|
+
continue;
|
|
77952
|
+
}
|
|
77953
|
+
var statement = transformPropertyOrClassStaticBlock(property, receiver);
|
|
77954
|
+
if (!statement) {
|
|
77842
77955
|
continue;
|
|
77843
77956
|
}
|
|
77844
|
-
var statement = factory.createExpressionStatement(expression);
|
|
77845
|
-
ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
|
|
77846
|
-
ts.setCommentRange(statement, property);
|
|
77847
|
-
ts.setOriginalNode(statement, property);
|
|
77848
|
-
ts.setSyntheticLeadingComments(expression, undefined);
|
|
77849
|
-
ts.setSyntheticTrailingComments(expression, undefined);
|
|
77850
77957
|
statements.push(statement);
|
|
77851
77958
|
}
|
|
77852
77959
|
}
|
|
77960
|
+
function transformPropertyOrClassStaticBlock(property, receiver) {
|
|
77961
|
+
var expression = ts.isClassStaticBlockDeclaration(property) ?
|
|
77962
|
+
transformClassStaticBlockDeclaration(property) :
|
|
77963
|
+
transformProperty(property, receiver);
|
|
77964
|
+
if (!expression) {
|
|
77965
|
+
return undefined;
|
|
77966
|
+
}
|
|
77967
|
+
var statement = factory.createExpressionStatement(expression);
|
|
77968
|
+
ts.setSourceMapRange(statement, ts.moveRangePastModifiers(property));
|
|
77969
|
+
ts.setCommentRange(statement, property);
|
|
77970
|
+
ts.setOriginalNode(statement, property);
|
|
77971
|
+
ts.setSyntheticLeadingComments(expression, undefined);
|
|
77972
|
+
ts.setSyntheticTrailingComments(expression, undefined);
|
|
77973
|
+
return statement;
|
|
77974
|
+
}
|
|
77853
77975
|
function generateInitializedPropertyExpressionsOrClassStaticBlock(propertiesOrClassStaticBlocks, receiver) {
|
|
77854
77976
|
var expressions = [];
|
|
77855
77977
|
for (var _i = 0, propertiesOrClassStaticBlocks_1 = propertiesOrClassStaticBlocks; _i < propertiesOrClassStaticBlocks_1.length; _i++) {
|
|
@@ -80141,6 +80263,9 @@ var ts;
|
|
|
80141
80263
|
var literal = factory.createStringLiteral(tryDecodeEntities(node.text) || node.text, singleQuote);
|
|
80142
80264
|
return ts.setTextRange(literal, node);
|
|
80143
80265
|
}
|
|
80266
|
+
else if (node.kind === 14 || node.kind === 222) {
|
|
80267
|
+
return node;
|
|
80268
|
+
}
|
|
80144
80269
|
else if (node.kind === 287) {
|
|
80145
80270
|
if (node.expression === undefined) {
|
|
80146
80271
|
return factory.createTrue();
|
|
@@ -80743,6 +80868,8 @@ var ts;
|
|
|
80743
80868
|
return visitReturnStatement(node);
|
|
80744
80869
|
case 216:
|
|
80745
80870
|
return visitVoidExpression(node);
|
|
80871
|
+
case 284:
|
|
80872
|
+
return visitJsxAttribute(node);
|
|
80746
80873
|
default:
|
|
80747
80874
|
return ts.visitEachChild(node, visitor, context);
|
|
80748
80875
|
}
|
|
@@ -80772,6 +80899,12 @@ var ts;
|
|
|
80772
80899
|
}
|
|
80773
80900
|
return ts.visitEachChild(node, visitor, context);
|
|
80774
80901
|
}
|
|
80902
|
+
function visitJsxAttribute(node) {
|
|
80903
|
+
if (node.initializer && ts.isTemplateExpression(node.initializer)) {
|
|
80904
|
+
return factory.createJsxAttribute(ts.visitNode(node.name, visitor, ts.isIdentifier), factory.createJsxExpression(undefined, ts.visitNode(node.initializer, visitor, ts.isExpression)));
|
|
80905
|
+
}
|
|
80906
|
+
return ts.visitEachChild(node, visitor, context);
|
|
80907
|
+
}
|
|
80775
80908
|
function visitCaseBlock(node) {
|
|
80776
80909
|
var ancestorFacts = enterSubtree(7104, 0);
|
|
80777
80910
|
var updated = ts.visitEachChild(node, visitor, context);
|
|
@@ -94300,9 +94433,9 @@ var ts;
|
|
|
94300
94433
|
ts.Diagnostics.A_return_statement_cannot_be_used_inside_a_class_static_block.code,
|
|
94301
94434
|
ts.Diagnostics.A_set_accessor_cannot_have_rest_parameter.code,
|
|
94302
94435
|
ts.Diagnostics.A_set_accessor_must_have_exactly_one_parameter.code,
|
|
94303
|
-
ts.Diagnostics.
|
|
94436
|
+
ts.Diagnostics.An_export_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
|
|
94304
94437
|
ts.Diagnostics.An_export_declaration_cannot_have_modifiers.code,
|
|
94305
|
-
ts.Diagnostics.
|
|
94438
|
+
ts.Diagnostics.An_import_declaration_can_only_be_used_at_the_top_level_of_a_module.code,
|
|
94306
94439
|
ts.Diagnostics.An_import_declaration_cannot_have_modifiers.code,
|
|
94307
94440
|
ts.Diagnostics.An_object_member_cannot_be_declared_optional.code,
|
|
94308
94441
|
ts.Diagnostics.Argument_of_dynamic_import_cannot_be_spread_element.code,
|
|
@@ -95200,7 +95333,7 @@ var ts;
|
|
|
95200
95333
|
ts.Debug.assert(!!sourceFile.bindDiagnostics);
|
|
95201
95334
|
var isJs = sourceFile.scriptKind === 1 || sourceFile.scriptKind === 2;
|
|
95202
95335
|
var isCheckJs = isJs && ts.isCheckJsEnabledForFile(sourceFile, options);
|
|
95203
|
-
var isPlainJs =
|
|
95336
|
+
var isPlainJs = ts.isPlainJsFile(sourceFile, options.checkJs);
|
|
95204
95337
|
var isTsNoCheck = !!sourceFile.checkJsDirective && sourceFile.checkJsDirective.enabled === false;
|
|
95205
95338
|
var includeBindAndCheckDiagnostics = !isTsNoCheck && (sourceFile.scriptKind === 3 || sourceFile.scriptKind === 4
|
|
95206
95339
|
|| sourceFile.scriptKind === 5 || isPlainJs || isCheckJs || sourceFile.scriptKind === 7);
|