typescript 4.7.0-dev.20220217 → 4.7.0-dev.20220221
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 +5 -1
- package/lib/de/diagnosticMessages.generated.json +6 -2
- package/lib/es/diagnosticMessages.generated.json +5 -1
- package/lib/fr/diagnosticMessages.generated.json +6 -2
- package/lib/it/diagnosticMessages.generated.json +5 -1
- package/lib/ja/diagnosticMessages.generated.json +6 -2
- package/lib/ko/diagnosticMessages.generated.json +6 -2
- package/lib/lib.es2015.core.d.ts +3 -3
- package/lib/lib.es2021.intl.d.ts +6 -6
- package/lib/lib.es5.d.ts +3 -1
- package/lib/lib.esnext.intl.d.ts +4 -4
- package/lib/pl/diagnosticMessages.generated.json +5 -1
- package/lib/pt-br/diagnosticMessages.generated.json +6 -2
- package/lib/ru/diagnosticMessages.generated.json +6 -2
- package/lib/tr/diagnosticMessages.generated.json +6 -2
- package/lib/tsc.js +56 -48
- package/lib/tsserver.js +101 -68
- package/lib/tsserverlibrary.js +95 -63
- package/lib/typescript.js +95 -63
- package/lib/typescriptServices.js +95 -63
- package/lib/typingsInstaller.js +59 -52
- package/lib/zh-cn/diagnosticMessages.generated.json +6 -2
- package/lib/zh-tw/diagnosticMessages.generated.json +6 -2
- package/package.json +1 -1
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Объявление пространства имен и класс или функция, с которыми оно объединено, не могут находится в разных файлах.",
|
|
56
56
|
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Объявление пространства имен не может располагаться раньше класса или функции, с которыми оно объединено.",
|
|
57
57
|
"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235": "Объявление пространства имен разрешено только на верхнем уровне пространства имен или модуля.",
|
|
58
|
-
"A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384": "После выражения \"new\" с аргументами типа должен всегда следовать список аргументов в круглых скобках.",
|
|
59
58
|
"A_non_dry_build_would_build_project_0_6357": "При сборке без флага -dry будет собран проект \"{0}\"",
|
|
60
59
|
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "При сборке без флага -dry будут удалены следующие файлы: {0}",
|
|
61
60
|
"A_non_dry_build_would_update_output_of_project_0_6375": "Сборка без флага -dry обновит выходные данные проекта \"{0}\"",
|
|
@@ -491,6 +490,8 @@
|
|
|
491
490
|
"Declare_property_0_90016": "Объявите свойство \"{0}\"",
|
|
492
491
|
"Declare_static_method_0_90024": "Объявите статический метод \"{0}\"",
|
|
493
492
|
"Declare_static_property_0_90027": "Объявите статическое свойство \"{0}\"",
|
|
493
|
+
"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270": "Тип возвращаемого значения функции декоратора \"{0}\" нельзя назначить типу \"{1}\".",
|
|
494
|
+
"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271": "Тип возвращаемого значения функции декоратора — \"{0}\", но ожидается \"void\" или \"any\".",
|
|
494
495
|
"Decorators_are_not_valid_here_1206": "Декораторы здесь недопустимы.",
|
|
495
496
|
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Декораторы нельзя применять к множественным методам доступа get или set с совпадающим именем.",
|
|
496
497
|
"Decorators_may_not_be_applied_to_this_parameters_1433": "Декораторы не могут применяться к параметрам \"this\".",
|
|
@@ -1197,6 +1198,7 @@
|
|
|
1197
1198
|
"Required_type_parameters_may_not_follow_optional_type_parameters_2706": "Обязательные параметры типа не могут следовать за необязательными параметрами типа.",
|
|
1198
1199
|
"Resolution_for_module_0_was_found_in_cache_from_location_1_6147": "Разрешение для модуля \"{0}\" найдено в кэше из расположения \"{1}\".",
|
|
1199
1200
|
"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241": "Разрешение для директивы ссылки на тип \"{0}\" обнаружено в кэше из расположения \"{1}\".",
|
|
1201
|
+
"Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452": "Режимы разрешения поддерживаются, только если параметр moduleResolution имеет значение \"node12\" или \"nodenext\".",
|
|
1200
1202
|
"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195": "Разрешать \"keyof\" только в имена свойств со строковым значением (не числа и не символы).",
|
|
1201
1203
|
"Resolving_module_0_from_1_6086": "======== Идет разрешение модуля \"{0}\" из \"{1}\". ========",
|
|
1202
1204
|
"Resolving_module_name_0_relative_to_base_url_1_2_6094": "Идет разрешение имени модуля \"{0}\" относительного к базовому URL-адресу \"{1}\" — \"{2}\".",
|
|
@@ -1498,6 +1500,7 @@
|
|
|
1498
1500
|
"Type_0_has_no_construct_signatures_2761": "Тип \"{0}\" не содержит сигнатуры конструкции.",
|
|
1499
1501
|
"Type_0_has_no_matching_index_signature_for_type_1_2537": "Тип \"{0}\" не содержит соответствующую сигнатуру индекса для типа \"{1}\".",
|
|
1500
1502
|
"Type_0_has_no_properties_in_common_with_type_1_2559": "У типа \"{0}\" нет общих свойств с типом \"{1}\".",
|
|
1503
|
+
"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635": "Тип \"{0}\" не содержит подписей, к которым применим список аргументов типа.",
|
|
1501
1504
|
"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739": "В типе \"{0}\" отсутствуют следующие свойства из типа \"{1}\": {2}",
|
|
1502
1505
|
"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740": "В типе \"{0}\" отсутствуют следующие свойства из типа \"{1}\": {2} и еще {3}.",
|
|
1503
1506
|
"Type_0_is_not_a_constructor_function_type_2507": "Тип \"{0}\" не является типом функции конструктора.",
|
|
@@ -1628,7 +1631,7 @@
|
|
|
1628
1631
|
"Variable_declaration_not_allowed_at_this_location_1440": "Объявление переменной в этом расположении запрещено.",
|
|
1629
1632
|
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Элемент с переменным числом аргументов в позиции {0} в источнике не соответствует элементу в позиции {1} в целевом объекте.",
|
|
1630
1633
|
"Version_0_6029": "Версия {0}",
|
|
1631
|
-
"
|
|
1634
|
+
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Дополнительные сведения об этом файле: https://aka.ms/tsconfig.",
|
|
1632
1635
|
"WATCH_OPTIONS_6918": "ПАРАМЕТРЫ ПРОСМОТРА",
|
|
1633
1636
|
"Watch_and_Build_Modes_6250": "Режимы отслеживания и сборки",
|
|
1634
1637
|
"Watch_input_files_6005": "Просмотр входных файлов.",
|
|
@@ -1778,6 +1781,7 @@
|
|
|
1778
1781
|
"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024": "Модификатор readonly может отображаться только в объявлении свойства или сигнатуре индекса.",
|
|
1779
1782
|
"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354": "Модификатор типа \"readonly\" допускается только для типов литерала массива и кортежа.",
|
|
1780
1783
|
"require_call_may_be_converted_to_an_import_80005": "Вызов \"require\" можно преобразовать в \"import\".",
|
|
1784
|
+
"resolution_mode_should_be_either_require_or_import_1453": "\"resolution-mode\" должен иметь значение \"require\" или \"import\".",
|
|
1781
1785
|
"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107": "Параметр \"rootDirs\" задан; он используется для разрешения относительного имени модуля \"{0}\".",
|
|
1782
1786
|
"super_can_only_be_referenced_in_a_derived_class_2335": "Ссылка на super может указываться только в производном классе.",
|
|
1783
1787
|
"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660": "На super можно ссылаться только в элементах производных классов или литеральных выражениях объекта.",
|
|
@@ -55,7 +55,6 @@
|
|
|
55
55
|
"A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merg_2433": "Bir ad alanı bildirimi, birleştirildiği sınıf veya işlevden farklı bir dosyada olamaz.",
|
|
56
56
|
"A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged_2434": "Bir ad alanı bildirimi, birleştirildiği sınıf veya işlevden önce gelemez.",
|
|
57
57
|
"A_namespace_declaration_is_only_allowed_at_the_top_level_of_a_namespace_or_module_1235": "Ad alanı bildirimine yalnızca bir ad alanının veya modülün en üst düzeyinde izin verilir.",
|
|
58
|
-
"A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384": "Tür bağımsız değişkenlerine sahip bir 'new' ifadesinin arkasından her zaman parantez içine alınmış bağımsız değişken listesi gelmelidir.",
|
|
59
58
|
"A_non_dry_build_would_build_project_0_6357": "-dry bayrağı kullanılmayan bir derleme '{0}' projesini derler",
|
|
60
59
|
"A_non_dry_build_would_delete_the_following_files_Colon_0_6356": "-dry bayrağı kullanılmayan bir derleme şu dosyaları siler: {0}",
|
|
61
60
|
"A_non_dry_build_would_update_output_of_project_0_6375": "DRY dışı bir derleme, '{0}' projesinin çıkışını güncelleştirir",
|
|
@@ -491,6 +490,8 @@
|
|
|
491
490
|
"Declare_property_0_90016": "'{0}' özelliğini bildir",
|
|
492
491
|
"Declare_static_method_0_90024": "'{0}' statik metodunu bildir",
|
|
493
492
|
"Declare_static_property_0_90027": "'{0}' statik özelliğini bildir",
|
|
493
|
+
"Decorator_function_return_type_0_is_not_assignable_to_type_1_1270": "'{0}' dekoratör işlevi dönüş türü, '{1}' türüne atanamıyor.",
|
|
494
|
+
"Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271": "Dekoratör işlevi dönüş türü '{0}', ancak 'void' veya 'any' olması bekleniyor.",
|
|
494
495
|
"Decorators_are_not_valid_here_1206": "Buradaki dekoratörler geçerli değil.",
|
|
495
496
|
"Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name_1207": "Dekoratörler aynı ada sahip birden fazla get/set erişimcisine uygulanamaz.",
|
|
496
497
|
"Decorators_may_not_be_applied_to_this_parameters_1433": "Dekoratörler 'this' parametrelerine uygulanamaz.",
|
|
@@ -1197,6 +1198,7 @@
|
|
|
1197
1198
|
"Required_type_parameters_may_not_follow_optional_type_parameters_2706": "Gerekli tür parametreleri, isteğe bağlı tür parametrelerini takip edemez.",
|
|
1198
1199
|
"Resolution_for_module_0_was_found_in_cache_from_location_1_6147": "'{0}' modülünün çözümü '{1}' konumundaki önbellekte bulundu.",
|
|
1199
1200
|
"Resolution_for_type_reference_directive_0_was_found_in_cache_from_location_1_6241": "'{0}' tür başvurusu yönergesinin çözümlemesi '{1}' konumundaki önbellekte bulundu.",
|
|
1201
|
+
"Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452": "Çözümleme modları yalnızca `moduleResolution` değeri `node12` veya `nodenext` olduğunda desteklenir.",
|
|
1200
1202
|
"Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols_6195": "'Keyof' değerini yalnızca dize değerli özellik adlarına (sayılar veya simgeler olmadan) çözümleyin.",
|
|
1201
1203
|
"Resolving_module_0_from_1_6086": "======== '{0}' modülü '{1}' öğesinden çözümleniyor. ========",
|
|
1202
1204
|
"Resolving_module_name_0_relative_to_base_url_1_2_6094": "'{0}' modül adı, '{1}' - '{2}' temel url'sine göre çözümleniyor.",
|
|
@@ -1498,6 +1500,7 @@
|
|
|
1498
1500
|
"Type_0_has_no_construct_signatures_2761": "'{0}' türünün oluşturma imzası yok.",
|
|
1499
1501
|
"Type_0_has_no_matching_index_signature_for_type_1_2537": "'{0}' türü, '{1}' türüyle eşleşen dizin imzasına sahip değil.",
|
|
1500
1502
|
"Type_0_has_no_properties_in_common_with_type_1_2559": "'{0}' türünün '{1}' türüyle ortak özelliği yok.",
|
|
1503
|
+
"Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635": "'{0}' türü, tür bağımsız değişkeni listesi için geçerli imzalar içermiyor.",
|
|
1501
1504
|
"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_2739": "'{0}' türünde, '{1}' türündeki şu özellikler eksik: {2}",
|
|
1502
1505
|
"Type_0_is_missing_the_following_properties_from_type_1_Colon_2_and_3_more_2740": "'{0}' türünde, '{1}' türündeki şu özellikler eksik: {2} ve diğer {3} özellik.",
|
|
1503
1506
|
"Type_0_is_not_a_constructor_function_type_2507": "'{0}' türü bir oluşturucu işlevi türü değil.",
|
|
@@ -1628,7 +1631,7 @@
|
|
|
1628
1631
|
"Variable_declaration_not_allowed_at_this_location_1440": "Bu konumda değişken bildirimine izin verilmiyor.",
|
|
1629
1632
|
"Variadic_element_at_position_0_in_source_does_not_match_element_at_position_1_in_target_2625": "Kaynaktaki {0} konumunda bulunan değişen sayıda bağımsız değişken içeren öğe, hedefteki {1} konumunda bulunan öğeyle eşleşmiyor.",
|
|
1630
1633
|
"Version_0_6029": "Sürüm {0}",
|
|
1631
|
-
"
|
|
1634
|
+
"Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110": "Bu dosya hakkında daha fazla bilgi için https://aka.ms/tsconfig sayfasını ziyaret edin",
|
|
1632
1635
|
"WATCH_OPTIONS_6918": "İZLEME SEÇENEKLERİ",
|
|
1633
1636
|
"Watch_and_Build_Modes_6250": "İzleme ve Derleme Modları",
|
|
1634
1637
|
"Watch_input_files_6005": "Giriş dosyalarını izleyin.",
|
|
@@ -1778,6 +1781,7 @@
|
|
|
1778
1781
|
"readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature_1024": "'readonly' değiştiricisi yalnızca özellik bildiriminde ya da dizin imzasında görünebilir.",
|
|
1779
1782
|
"readonly_type_modifier_is_only_permitted_on_array_and_tuple_literal_types_1354": "'readonly' tür değiştiricisine yalnızca dizide ve demet sabit değeri türlerinde izin verilir.",
|
|
1780
1783
|
"require_call_may_be_converted_to_an_import_80005": "'require' çağrısı bir import olarak dönüştürülebilir.",
|
|
1784
|
+
"resolution_mode_should_be_either_require_or_import_1453": "`resolution-mode`, `require` ya da `import` olmalıdır.",
|
|
1781
1785
|
"rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0_6107": "'rootDirs' seçeneği ayarlandı, '{0}' göreli modül adını çözümlemek için bu değer kullanılıyor.",
|
|
1782
1786
|
"super_can_only_be_referenced_in_a_derived_class_2335": "'super' öğesine yalnızca bir türetilmiş sınıfta başvurulabilir.",
|
|
1783
1787
|
"super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions_2660": "'super' değerine yalnızca türetilen sınıfların üyelerinde ya da nesne değişmez ifadelerinde başvurulabilir.",
|
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.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220221";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -2018,7 +2018,7 @@ var ts;
|
|
|
2018
2018
|
Debug.checkEachDefined = checkEachDefined;
|
|
2019
2019
|
function assertNever(member, message, stackCrawlMark) {
|
|
2020
2020
|
if (message === void 0) { message = "Illegal value:"; }
|
|
2021
|
-
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos")
|
|
2021
|
+
var detail = typeof member === "object" && ts.hasProperty(member, "kind") && ts.hasProperty(member, "pos") ? "SyntaxKind: " + formatSyntaxKind(member.kind) : JSON.stringify(member);
|
|
2022
2022
|
return fail(message + " " + detail, stackCrawlMark || assertNever);
|
|
2023
2023
|
}
|
|
2024
2024
|
Debug.assertNever = assertNever;
|
|
@@ -6785,7 +6785,7 @@ var ts;
|
|
|
6785
6785
|
Fix_all_implicit_this_errors: diag(95107, ts.DiagnosticCategory.Message, "Fix_all_implicit_this_errors_95107", "Fix all implicit-'this' errors"),
|
|
6786
6786
|
Wrap_invalid_character_in_an_expression_container: diag(95108, ts.DiagnosticCategory.Message, "Wrap_invalid_character_in_an_expression_container_95108", "Wrap invalid character in an expression container"),
|
|
6787
6787
|
Wrap_all_invalid_characters_in_an_expression_container: diag(95109, ts.DiagnosticCategory.Message, "Wrap_all_invalid_characters_in_an_expression_container_95109", "Wrap all invalid characters in an expression container"),
|
|
6788
|
-
|
|
6788
|
+
Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file: diag(95110, ts.DiagnosticCategory.Message, "Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file_95110", "Visit https://aka.ms/tsconfig to read more about this file"),
|
|
6789
6789
|
Add_a_return_statement: diag(95111, ts.DiagnosticCategory.Message, "Add_a_return_statement_95111", "Add a return statement"),
|
|
6790
6790
|
Remove_braces_from_arrow_function_body: diag(95112, ts.DiagnosticCategory.Message, "Remove_braces_from_arrow_function_body_95112", "Remove braces from arrow function body"),
|
|
6791
6791
|
Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal: diag(95113, ts.DiagnosticCategory.Message, "Wrap_the_following_body_with_parentheses_which_should_be_an_object_literal_95113", "Wrap the following body with parentheses which should be an object literal"),
|
|
@@ -32952,7 +32952,7 @@ var ts;
|
|
|
32952
32952
|
var result = [];
|
|
32953
32953
|
result.push("{");
|
|
32954
32954
|
result.push(tab + "\"compilerOptions\": {");
|
|
32955
|
-
result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.
|
|
32955
|
+
result.push("" + tab + tab + "/* " + ts.getLocaleSpecificMessage(ts.Diagnostics.Visit_https_Colon_Slash_Slashaka_ms_Slashtsconfig_to_read_more_about_this_file) + " */");
|
|
32956
32956
|
result.push("");
|
|
32957
32957
|
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
|
|
32958
32958
|
var entry = entries_2[_a];
|
|
@@ -52445,9 +52445,6 @@ var ts;
|
|
|
52445
52445
|
if (sourceRestType || targetRestType) {
|
|
52446
52446
|
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
|
|
52447
52447
|
}
|
|
52448
|
-
if (sourceRestType && targetRestType && sourceCount !== targetCount) {
|
|
52449
|
-
return 0;
|
|
52450
|
-
}
|
|
52451
52448
|
var kind = target.declaration ? target.declaration.kind : 0;
|
|
52452
52449
|
var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 168 &&
|
|
52453
52450
|
kind !== 167 && kind !== 170;
|
|
@@ -58534,7 +58531,7 @@ var ts;
|
|
|
58534
58531
|
var substituteConstraints = !(checkMode && checkMode & 2) &&
|
|
58535
58532
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
58536
58533
|
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
|
58537
|
-
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888
|
|
58534
|
+
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 ? getBaseConstraintOrType(t) : t; }) : type;
|
|
58538
58535
|
}
|
|
58539
58536
|
function isExportOrExportExpression(location) {
|
|
58540
58537
|
return !!ts.findAncestor(location, function (n) {
|
|
@@ -64769,7 +64766,7 @@ var ts;
|
|
|
64769
64766
|
if (operator === 55 || operator === 56 || operator === 60) {
|
|
64770
64767
|
if (operator === 55) {
|
|
64771
64768
|
var parent = ts.walkUpParenthesizedExpressions(node.parent);
|
|
64772
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.left,
|
|
64769
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.left, ts.isIfStatement(parent) ? parent.thenStatement : undefined);
|
|
64773
64770
|
}
|
|
64774
64771
|
checkTruthinessOfType(leftType, node.left);
|
|
64775
64772
|
}
|
|
@@ -65232,8 +65229,8 @@ var ts;
|
|
|
65232
65229
|
return type;
|
|
65233
65230
|
}
|
|
65234
65231
|
function checkConditionalExpression(node, checkMode) {
|
|
65235
|
-
|
|
65236
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.condition,
|
|
65232
|
+
checkTruthinessExpression(node.condition);
|
|
65233
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.condition, node.whenTrue);
|
|
65237
65234
|
var type1 = checkExpression(node.whenTrue, checkMode);
|
|
65238
65235
|
var type2 = checkExpression(node.whenFalse, checkMode);
|
|
65239
65236
|
return getUnionType([type1, type2], 2);
|
|
@@ -67904,44 +67901,53 @@ var ts;
|
|
|
67904
67901
|
}
|
|
67905
67902
|
function checkIfStatement(node) {
|
|
67906
67903
|
checkGrammarStatementInAmbientContext(node);
|
|
67907
|
-
|
|
67908
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.expression,
|
|
67904
|
+
checkTruthinessExpression(node.expression);
|
|
67905
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.expression, node.thenStatement);
|
|
67909
67906
|
checkSourceElement(node.thenStatement);
|
|
67910
67907
|
if (node.thenStatement.kind === 235) {
|
|
67911
67908
|
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
|
|
67912
67909
|
}
|
|
67913
67910
|
checkSourceElement(node.elseStatement);
|
|
67914
67911
|
}
|
|
67915
|
-
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr,
|
|
67912
|
+
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, body) {
|
|
67916
67913
|
if (!strictNullChecks)
|
|
67917
67914
|
return;
|
|
67918
|
-
|
|
67919
|
-
|
|
67920
|
-
|
|
67921
|
-
|
|
67922
|
-
|
|
67923
|
-
|
|
67924
|
-
|
|
67925
|
-
|
|
67926
|
-
|
|
67927
|
-
|
|
67928
|
-
|
|
67929
|
-
|
|
67930
|
-
|
|
67931
|
-
|
|
67932
|
-
|
|
67933
|
-
|
|
67934
|
-
|
|
67935
|
-
|
|
67936
|
-
}
|
|
67937
|
-
var isUsed = testedSymbol && ts.isBinaryExpression(condExpr.parent) && isSymbolUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)
|
|
67938
|
-
|| testedSymbol && body && isSymbolUsedInConditionBody(condExpr, body, testedNode, testedSymbol);
|
|
67939
|
-
if (!isUsed) {
|
|
67940
|
-
if (isPromise) {
|
|
67941
|
-
errorAndMaybeSuggestAwait(location, true, ts.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined, getTypeNameForErrorDisplay(type));
|
|
67915
|
+
helper(condExpr, body);
|
|
67916
|
+
while (ts.isBinaryExpression(condExpr) && condExpr.operatorToken.kind === 56) {
|
|
67917
|
+
condExpr = condExpr.left;
|
|
67918
|
+
helper(condExpr, body);
|
|
67919
|
+
}
|
|
67920
|
+
function helper(condExpr, body) {
|
|
67921
|
+
var location = ts.isBinaryExpression(condExpr) &&
|
|
67922
|
+
(condExpr.operatorToken.kind === 56 || condExpr.operatorToken.kind === 55)
|
|
67923
|
+
? condExpr.right
|
|
67924
|
+
: condExpr;
|
|
67925
|
+
var type = checkTruthinessExpression(location);
|
|
67926
|
+
var isPropertyExpressionCast = ts.isPropertyAccessExpression(location) && isTypeAssertion(location.expression);
|
|
67927
|
+
if (getFalsyFlags(type) || isPropertyExpressionCast)
|
|
67928
|
+
return;
|
|
67929
|
+
var callSignatures = getSignaturesOfType(type, 0);
|
|
67930
|
+
var isPromise = !!getAwaitedTypeOfPromise(type);
|
|
67931
|
+
if (callSignatures.length === 0 && !isPromise) {
|
|
67932
|
+
return;
|
|
67942
67933
|
}
|
|
67943
|
-
|
|
67944
|
-
|
|
67934
|
+
var testedNode = ts.isIdentifier(location) ? location
|
|
67935
|
+
: ts.isPropertyAccessExpression(location) ? location.name
|
|
67936
|
+
: ts.isBinaryExpression(location) && ts.isIdentifier(location.right) ? location.right
|
|
67937
|
+
: undefined;
|
|
67938
|
+
var testedSymbol = testedNode && getSymbolAtLocation(testedNode);
|
|
67939
|
+
if (!testedSymbol && !isPromise) {
|
|
67940
|
+
return;
|
|
67941
|
+
}
|
|
67942
|
+
var isUsed = testedSymbol && ts.isBinaryExpression(condExpr.parent) && isSymbolUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)
|
|
67943
|
+
|| testedSymbol && body && isSymbolUsedInConditionBody(condExpr, body, testedNode, testedSymbol);
|
|
67944
|
+
if (!isUsed) {
|
|
67945
|
+
if (isPromise) {
|
|
67946
|
+
errorAndMaybeSuggestAwait(location, true, ts.Diagnostics.This_condition_will_always_return_true_since_this_0_is_always_defined, getTypeNameForErrorDisplay(type));
|
|
67947
|
+
}
|
|
67948
|
+
else {
|
|
67949
|
+
error(location, ts.Diagnostics.This_condition_will_always_return_true_since_this_function_is_always_defined_Did_you_mean_to_call_it_instead);
|
|
67950
|
+
}
|
|
67945
67951
|
}
|
|
67946
67952
|
}
|
|
67947
67953
|
}
|
|
@@ -68863,9 +68869,9 @@ var ts;
|
|
|
68863
68869
|
var containsArguments = containsArgumentsReference(node);
|
|
68864
68870
|
if (containsArguments) {
|
|
68865
68871
|
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
|
|
68866
|
-
if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
68872
|
+
if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
68867
68873
|
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
|
|
68868
|
-
|
|
68874
|
+
error(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));
|
|
68869
68875
|
}
|
|
68870
68876
|
}
|
|
68871
68877
|
else {
|
|
@@ -68875,7 +68881,9 @@ var ts;
|
|
|
68875
68881
|
return;
|
|
68876
68882
|
}
|
|
68877
68883
|
if (ts.isQualifiedName(name)) {
|
|
68878
|
-
|
|
68884
|
+
if (isJs) {
|
|
68885
|
+
error(name, ts.Diagnostics.Qualified_name_0_is_not_allowed_without_a_leading_param_object_1, ts.entityNameToString(name), ts.entityNameToString(name.left));
|
|
68886
|
+
}
|
|
68879
68887
|
}
|
|
68880
68888
|
else {
|
|
68881
68889
|
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
|
|
@@ -70309,10 +70317,10 @@ var ts;
|
|
|
70309
70317
|
if (id === "__export") {
|
|
70310
70318
|
return;
|
|
70311
70319
|
}
|
|
70312
|
-
if (flags & (1920 |
|
|
70320
|
+
if (flags & (1920 | 384)) {
|
|
70313
70321
|
return;
|
|
70314
70322
|
}
|
|
70315
|
-
var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverloadAndNotAccessor);
|
|
70323
|
+
var exportedDeclarationsCount = ts.countWhere(declarations, ts.and(isNotOverloadAndNotAccessor, ts.not(ts.isInterfaceDeclaration)));
|
|
70316
70324
|
if (flags & 524288 && exportedDeclarationsCount <= 2) {
|
|
70317
70325
|
return;
|
|
70318
70326
|
}
|
|
@@ -102783,7 +102791,7 @@ var ts;
|
|
|
102783
102791
|
example(["tsc --noEmit", "tsc --target esnext"], ts.Diagnostics.Compiles_the_current_project_with_additional_settings);
|
|
102784
102792
|
var cliCommands = simpleOptions.filter(function (opt) { return opt.isCommandLineOnly || opt.category === ts.Diagnostics.Command_line_Options; });
|
|
102785
102793
|
var configOpts = simpleOptions.filter(function (opt) { return !ts.contains(cliCommands, opt); });
|
|
102786
|
-
output = __spreadArray(__spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.COMMAND_LINE_FLAGS), cliCommands, false, undefined, undefined), true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.COMMON_COMPILER_OPTIONS), configOpts, false, undefined, ts.formatMessage(undefined, ts.Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/
|
|
102794
|
+
output = __spreadArray(__spreadArray(__spreadArray([], output, true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.COMMAND_LINE_FLAGS), cliCommands, false, undefined, undefined), true), generateSectionOptionsOutput(sys, ts.getDiagnosticText(ts.Diagnostics.COMMON_COMPILER_OPTIONS), configOpts, false, undefined, ts.formatMessage(undefined, ts.Diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0, "https://aka.ms/tsc")), true);
|
|
102787
102795
|
for (var _i = 0, output_1 = output; _i < output_1.length; _i++) {
|
|
102788
102796
|
var line = output_1[_i];
|
|
102789
102797
|
sys.write(line);
|
|
@@ -102799,7 +102807,7 @@ var ts;
|
|
|
102799
102807
|
}
|
|
102800
102808
|
function printAllHelp(sys, compilerOptions, buildOptions, watchOptions) {
|
|
102801
102809
|
var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
|
|
102802
|
-
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/
|
|
102810
|
+
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/tsc")), true);
|
|
102803
102811
|
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);
|
|
102804
102812
|
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);
|
|
102805
102813
|
for (var _i = 0, output_2 = output; _i < output_2.length; _i++) {
|
|
@@ -103248,7 +103256,7 @@ var ts;
|
|
|
103248
103256
|
sys.writeFile(file, ts.generateTSConfig(options, fileNames, sys.newLine));
|
|
103249
103257
|
var output = __spreadArray([sys.newLine], getHeader(sys, "Created a new tsconfig.json with:"), true);
|
|
103250
103258
|
output.push(ts.getCompilerOptionsDiffValue(options, sys.newLine) + sys.newLine + sys.newLine);
|
|
103251
|
-
output.push("You can learn more at https://aka.ms/tsconfig
|
|
103259
|
+
output.push("You can learn more at https://aka.ms/tsconfig" + sys.newLine);
|
|
103252
103260
|
for (var _i = 0, output_4 = output; _i < output_4.length; _i++) {
|
|
103253
103261
|
var line = output_4[_i];
|
|
103254
103262
|
sys.write(line);
|