typescript 4.7.0-dev.20220215 → 4.7.0-dev.20220219
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 +4 -0
- package/lib/es/diagnosticMessages.generated.json +5 -1
- package/lib/fr/diagnosticMessages.generated.json +5 -1
- package/lib/it/diagnosticMessages.generated.json +5 -1
- package/lib/ja/diagnosticMessages.generated.json +5 -1
- package/lib/ko/diagnosticMessages.generated.json +5 -1
- package/lib/lib.es2015.core.d.ts +3 -3
- package/lib/lib.es2020.intl.d.ts +4 -0
- 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 -1
- package/lib/pl/diagnosticMessages.generated.json +5 -1
- package/lib/protocol.d.ts +7 -0
- package/lib/pt-br/diagnosticMessages.generated.json +5 -1
- package/lib/ru/diagnosticMessages.generated.json +5 -1
- package/lib/tr/diagnosticMessages.generated.json +4 -0
- package/lib/tsc.js +670 -516
- package/lib/tsserver.js +840 -648
- package/lib/tsserverlibrary.d.ts +31 -25
- package/lib/tsserverlibrary.js +834 -643
- package/lib/typescript.d.ts +23 -24
- package/lib/typescript.js +832 -641
- package/lib/typescriptServices.d.ts +23 -24
- package/lib/typescriptServices.js +832 -641
- package/lib/typingsInstaller.js +779 -623
- package/lib/zh-cn/diagnosticMessages.generated.json +5 -1
- package/lib/zh-tw/diagnosticMessages.generated.json +4 -0
- 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.7";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220219";
|
|
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;
|
|
@@ -3306,7 +3306,8 @@ var ts;
|
|
|
3306
3306
|
{ name: "types", optional: true, captureSpan: true },
|
|
3307
3307
|
{ name: "lib", optional: true, captureSpan: true },
|
|
3308
3308
|
{ name: "path", optional: true, captureSpan: true },
|
|
3309
|
-
{ name: "no-default-lib", optional: true }
|
|
3309
|
+
{ name: "no-default-lib", optional: true },
|
|
3310
|
+
{ name: "resolution-mode", optional: true }
|
|
3310
3311
|
],
|
|
3311
3312
|
kind: 1
|
|
3312
3313
|
},
|
|
@@ -5283,6 +5284,8 @@ var ts;
|
|
|
5283
5284
|
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."),
|
|
5284
5285
|
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."),
|
|
5285
5286
|
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."),
|
|
5287
|
+
Decorator_function_return_type_0_is_not_assignable_to_type_1: diag(1270, ts.DiagnosticCategory.Error, "Decorator_function_return_type_0_is_not_assignable_to_type_1_1270", "Decorator function return type '{0}' is not assignable to type '{1}'."),
|
|
5288
|
+
Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any: diag(1271, ts.DiagnosticCategory.Error, "Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any_1271", "Decorator function return type is '{0}' but is expected to be 'void' or 'any'."),
|
|
5286
5289
|
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."),
|
|
5287
5290
|
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."),
|
|
5288
5291
|
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."),
|
|
@@ -5351,7 +5354,6 @@ var ts;
|
|
|
5351
5354
|
Unexpected_token_Did_you_mean_or_rbrace: diag(1381, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_rbrace_1381", "Unexpected token. Did you mean `{'}'}` or `}`?"),
|
|
5352
5355
|
Unexpected_token_Did_you_mean_or_gt: diag(1382, ts.DiagnosticCategory.Error, "Unexpected_token_Did_you_mean_or_gt_1382", "Unexpected token. Did you mean `{'>'}` or `>`?"),
|
|
5353
5356
|
Only_named_exports_may_use_export_type: diag(1383, ts.DiagnosticCategory.Error, "Only_named_exports_may_use_export_type_1383", "Only named exports may use 'export type'."),
|
|
5354
|
-
A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list: diag(1384, ts.DiagnosticCategory.Error, "A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list_1384", "A 'new' expression with type arguments must always be followed by a parenthesized argument list."),
|
|
5355
5357
|
Function_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1385, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_a_union_type_1385", "Function type notation must be parenthesized when used in a union type."),
|
|
5356
5358
|
Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type: diag(1386, ts.DiagnosticCategory.Error, "Constructor_type_notation_must_be_parenthesized_when_used_in_a_union_type_1386", "Constructor type notation must be parenthesized when used in a union type."),
|
|
5357
5359
|
Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type: diag(1387, ts.DiagnosticCategory.Error, "Function_type_notation_must_be_parenthesized_when_used_in_an_intersection_type_1387", "Function type notation must be parenthesized when used in an intersection type."),
|
|
@@ -5416,6 +5418,8 @@ var ts;
|
|
|
5416
5418
|
Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed: diag(1449, ts.DiagnosticCategory.Message, "Preserve_unused_imported_values_in_the_JavaScript_output_that_would_otherwise_be_removed_1449", "Preserve unused imported values in the JavaScript output that would otherwise be removed."),
|
|
5417
5419
|
Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments: diag(1450, ts.DiagnosticCategory.Message, "Dynamic_imports_can_only_accept_a_module_specifier_and_an_optional_assertion_as_arguments_1450", "Dynamic imports can only accept a module specifier and an optional assertion as arguments"),
|
|
5418
5420
|
Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member_declaration_property_access_or_on_the_left_hand_side_of_an_in_expression: diag(1451, ts.DiagnosticCategory.Error, "Private_identifiers_are_only_allowed_in_class_bodies_and_may_only_be_used_as_part_of_a_class_member__1451", "Private identifiers are only allowed in class bodies and may only be used as part of a class member declaration, property access, or on the left-hand-side of an 'in' expression"),
|
|
5421
|
+
Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext: diag(1452, ts.DiagnosticCategory.Error, "Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext_1452", "Resolution modes are only supported when `moduleResolution` is `node12` or `nodenext`."),
|
|
5422
|
+
resolution_mode_should_be_either_require_or_import: diag(1453, ts.DiagnosticCategory.Error, "resolution_mode_should_be_either_require_or_import_1453", "`resolution-mode` should be either `require` or `import`."),
|
|
5419
5423
|
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."),
|
|
5420
5424
|
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."),
|
|
5421
5425
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -5735,6 +5739,7 @@ var ts;
|
|
|
5735
5739
|
Cannot_assign_to_0_because_it_is_an_import: diag(2632, ts.DiagnosticCategory.Error, "Cannot_assign_to_0_because_it_is_an_import_2632", "Cannot assign to '{0}' because it is an import."),
|
|
5736
5740
|
JSX_property_access_expressions_cannot_include_JSX_namespace_names: diag(2633, ts.DiagnosticCategory.Error, "JSX_property_access_expressions_cannot_include_JSX_namespace_names_2633", "JSX property access expressions cannot include JSX namespace names"),
|
|
5737
5741
|
_0_index_signatures_are_incompatible: diag(2634, ts.DiagnosticCategory.Error, "_0_index_signatures_are_incompatible_2634", "'{0}' index signatures are incompatible."),
|
|
5742
|
+
Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable: diag(2635, ts.DiagnosticCategory.Error, "Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable_2635", "Type '{0}' has no signatures for which the type argument list is applicable."),
|
|
5738
5743
|
Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: diag(2649, ts.DiagnosticCategory.Error, "Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity_2649", "Cannot augment module '{0}' with value exports because it resolves to a non-module entity."),
|
|
5739
5744
|
A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: diag(2651, ts.DiagnosticCategory.Error, "A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_memb_2651", "A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums."),
|
|
5740
5745
|
Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: diag(2652, ts.DiagnosticCategory.Error, "Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_d_2652", "Merged declaration '{0}' cannot include a default export declaration. Consider adding a separate 'export default {0}' declaration instead."),
|
|
@@ -6780,7 +6785,7 @@ var ts;
|
|
|
6780
6785
|
Fix_all_implicit_this_errors: diag(95107, ts.DiagnosticCategory.Message, "Fix_all_implicit_this_errors_95107", "Fix all implicit-'this' errors"),
|
|
6781
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"),
|
|
6782
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"),
|
|
6783
|
-
|
|
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"),
|
|
6784
6789
|
Add_a_return_statement: diag(95111, ts.DiagnosticCategory.Message, "Add_a_return_statement_95111", "Add a return statement"),
|
|
6785
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"),
|
|
6786
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"),
|
|
@@ -10091,6 +10096,7 @@ var ts;
|
|
|
10091
10096
|
case 110:
|
|
10092
10097
|
case 106:
|
|
10093
10098
|
case 229:
|
|
10099
|
+
case 227:
|
|
10094
10100
|
case 230:
|
|
10095
10101
|
case 100:
|
|
10096
10102
|
return true;
|
|
@@ -10696,7 +10702,10 @@ var ts;
|
|
|
10696
10702
|
ts.Debug.assert(names.length === newResolutions.length);
|
|
10697
10703
|
for (var i = 0; i < names.length; i++) {
|
|
10698
10704
|
var newResolution = newResolutions[i];
|
|
10699
|
-
var
|
|
10705
|
+
var entry = names[i];
|
|
10706
|
+
var name = !ts.isString(entry) ? entry.fileName.toLowerCase() : entry;
|
|
10707
|
+
var mode = !ts.isString(entry) ? ts.getModeForFileReference(entry, oldSourceFile === null || oldSourceFile === void 0 ? void 0 : oldSourceFile.impliedNodeFormat) : oldSourceFile && ts.getModeForResolutionAtIndex(oldSourceFile, i);
|
|
10708
|
+
var oldResolution = oldResolutions && oldResolutions.get(name, mode);
|
|
10700
10709
|
var changed = oldResolution
|
|
10701
10710
|
? !newResolution || !comparer(oldResolution, newResolution)
|
|
10702
10711
|
: newResolution;
|
|
@@ -11616,7 +11625,7 @@ var ts;
|
|
|
11616
11625
|
case 114:
|
|
11617
11626
|
return node.parent.kind !== 216;
|
|
11618
11627
|
case 227:
|
|
11619
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
11628
|
+
return ts.isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
11620
11629
|
case 162:
|
|
11621
11630
|
return node.parent.kind === 194 || node.parent.kind === 189;
|
|
11622
11631
|
case 79:
|
|
@@ -11642,7 +11651,7 @@ var ts;
|
|
|
11642
11651
|
}
|
|
11643
11652
|
switch (parent.kind) {
|
|
11644
11653
|
case 227:
|
|
11645
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
11654
|
+
return ts.isHeritageClause(parent.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
11646
11655
|
case 162:
|
|
11647
11656
|
return node === parent.constraint;
|
|
11648
11657
|
case 342:
|
|
@@ -12281,7 +12290,7 @@ var ts;
|
|
|
12281
12290
|
case 296:
|
|
12282
12291
|
return true;
|
|
12283
12292
|
case 227:
|
|
12284
|
-
return parent.expression === node &&
|
|
12293
|
+
return parent.expression === node && !isPartOfTypeNode(parent);
|
|
12285
12294
|
case 295:
|
|
12286
12295
|
return parent.objectAssignmentInitializer === node;
|
|
12287
12296
|
default:
|
|
@@ -18267,15 +18276,17 @@ var ts;
|
|
|
18267
18276
|
function updateConstructorTypeNode2(node, typeParameters, parameters, type) {
|
|
18268
18277
|
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
|
|
18269
18278
|
}
|
|
18270
|
-
function createTypeQueryNode(exprName) {
|
|
18279
|
+
function createTypeQueryNode(exprName, typeArguments) {
|
|
18271
18280
|
var node = createBaseNode(180);
|
|
18272
18281
|
node.exprName = exprName;
|
|
18282
|
+
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
18273
18283
|
node.transformFlags = 1;
|
|
18274
18284
|
return node;
|
|
18275
18285
|
}
|
|
18276
|
-
function updateTypeQueryNode(node, exprName) {
|
|
18286
|
+
function updateTypeQueryNode(node, exprName, typeArguments) {
|
|
18277
18287
|
return node.exprName !== exprName
|
|
18278
|
-
|
|
18288
|
+
|| node.typeArguments !== typeArguments
|
|
18289
|
+
? update(createTypeQueryNode(exprName, typeArguments), node)
|
|
18279
18290
|
: node;
|
|
18280
18291
|
}
|
|
18281
18292
|
function createTypeLiteralNode(members) {
|
|
@@ -21467,7 +21478,13 @@ var ts;
|
|
|
21467
21478
|
referencedFiles = ts.append(referencedFiles, { pos: -1, end: -1, fileName: section.data });
|
|
21468
21479
|
break;
|
|
21469
21480
|
case "type":
|
|
21470
|
-
typeReferenceDirectives = ts.append(typeReferenceDirectives, section.data);
|
|
21481
|
+
typeReferenceDirectives = ts.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data });
|
|
21482
|
+
break;
|
|
21483
|
+
case "type-import":
|
|
21484
|
+
typeReferenceDirectives = ts.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data, resolutionMode: ts.ModuleKind.ESNext });
|
|
21485
|
+
break;
|
|
21486
|
+
case "type-require":
|
|
21487
|
+
typeReferenceDirectives = ts.append(typeReferenceDirectives, { pos: -1, end: -1, fileName: section.data, resolutionMode: ts.ModuleKind.CommonJS });
|
|
21471
21488
|
break;
|
|
21472
21489
|
case "lib":
|
|
21473
21490
|
libReferenceDirectives = ts.append(libReferenceDirectives, { pos: -1, end: -1, fileName: section.data });
|
|
@@ -21525,6 +21542,8 @@ var ts;
|
|
|
21525
21542
|
case "no-default-lib":
|
|
21526
21543
|
case "reference":
|
|
21527
21544
|
case "type":
|
|
21545
|
+
case "type-import":
|
|
21546
|
+
case "type-require":
|
|
21528
21547
|
case "lib":
|
|
21529
21548
|
syntheticReferences = ts.append(syntheticReferences, ts.setTextRange(ts.factory.createUnparsedSyntheticReference(section), section));
|
|
21530
21549
|
break;
|
|
@@ -24109,7 +24128,8 @@ var ts;
|
|
|
24109
24128
|
visitNode(cbNode, node.parameterName) ||
|
|
24110
24129
|
visitNode(cbNode, node.type);
|
|
24111
24130
|
case 180:
|
|
24112
|
-
return visitNode(cbNode, node.exprName)
|
|
24131
|
+
return visitNode(cbNode, node.exprName) ||
|
|
24132
|
+
visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
24113
24133
|
case 181:
|
|
24114
24134
|
return visitNodes(cbNode, cbNodes, node.members);
|
|
24115
24135
|
case 182:
|
|
@@ -24665,7 +24685,7 @@ var ts;
|
|
|
24665
24685
|
function parseIsolatedEntityName(content, languageVersion) {
|
|
24666
24686
|
initializeState("", content, languageVersion, undefined, 1);
|
|
24667
24687
|
nextToken();
|
|
24668
|
-
var entityName = parseEntityName(true);
|
|
24688
|
+
var entityName = parseEntityName(true, false);
|
|
24669
24689
|
var isInvalid = token() === 1 && !parseDiagnostics.length;
|
|
24670
24690
|
clearState();
|
|
24671
24691
|
return isInvalid ? entityName : undefined;
|
|
@@ -25963,7 +25983,7 @@ var ts;
|
|
|
25963
25983
|
}
|
|
25964
25984
|
return createMissingList();
|
|
25965
25985
|
}
|
|
25966
|
-
function parseEntityName(allowReservedWords, diagnosticMessage) {
|
|
25986
|
+
function parseEntityName(allowReservedWords, allowPrivateIdentifiers, diagnosticMessage) {
|
|
25967
25987
|
var pos = getNodePos();
|
|
25968
25988
|
var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
|
|
25969
25989
|
var dotPos = getNodePos();
|
|
@@ -25973,7 +25993,7 @@ var ts;
|
|
|
25973
25993
|
break;
|
|
25974
25994
|
}
|
|
25975
25995
|
dotPos = getNodePos();
|
|
25976
|
-
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords,
|
|
25996
|
+
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, allowPrivateIdentifiers)), pos);
|
|
25977
25997
|
}
|
|
25978
25998
|
return entity;
|
|
25979
25999
|
}
|
|
@@ -26076,7 +26096,7 @@ var ts;
|
|
|
26076
26096
|
return finishNode(node, pos);
|
|
26077
26097
|
}
|
|
26078
26098
|
function parseEntityNameOfTypeReference() {
|
|
26079
|
-
return parseEntityName(true, ts.Diagnostics.Type_expected);
|
|
26099
|
+
return parseEntityName(true, false, ts.Diagnostics.Type_expected);
|
|
26080
26100
|
}
|
|
26081
26101
|
function parseTypeArgumentsOfTypeReference() {
|
|
26082
26102
|
if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29) {
|
|
@@ -26190,7 +26210,9 @@ var ts;
|
|
|
26190
26210
|
function parseTypeQuery() {
|
|
26191
26211
|
var pos = getNodePos();
|
|
26192
26212
|
parseExpected(112);
|
|
26193
|
-
|
|
26213
|
+
var entityName = parseEntityName(true, true);
|
|
26214
|
+
var typeArguments = tryParseTypeArguments();
|
|
26215
|
+
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
26194
26216
|
}
|
|
26195
26217
|
function parseTypeParameter() {
|
|
26196
26218
|
var pos = getNodePos();
|
|
@@ -27747,19 +27769,28 @@ var ts;
|
|
|
27747
27769
|
expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken);
|
|
27748
27770
|
continue;
|
|
27749
27771
|
}
|
|
27750
|
-
if (!questionDotToken && token() === 53 && !scanner.hasPrecedingLineBreak()) {
|
|
27751
|
-
nextToken();
|
|
27752
|
-
expression = finishNode(factory.createNonNullExpression(expression), pos);
|
|
27753
|
-
continue;
|
|
27754
|
-
}
|
|
27755
27772
|
if ((questionDotToken || !inDecoratorContext()) && parseOptional(22)) {
|
|
27756
27773
|
expression = parseElementAccessExpressionRest(pos, expression, questionDotToken);
|
|
27757
27774
|
continue;
|
|
27758
27775
|
}
|
|
27759
27776
|
if (isTemplateStartOfTaggedTemplate()) {
|
|
27760
|
-
expression =
|
|
27777
|
+
expression = !questionDotToken && expression.kind === 227 ?
|
|
27778
|
+
parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) :
|
|
27779
|
+
parseTaggedTemplateRest(pos, expression, questionDotToken, undefined);
|
|
27761
27780
|
continue;
|
|
27762
27781
|
}
|
|
27782
|
+
if (!questionDotToken) {
|
|
27783
|
+
if (token() === 53 && !scanner.hasPrecedingLineBreak()) {
|
|
27784
|
+
nextToken();
|
|
27785
|
+
expression = finishNode(factory.createNonNullExpression(expression), pos);
|
|
27786
|
+
continue;
|
|
27787
|
+
}
|
|
27788
|
+
var typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
27789
|
+
if (typeArguments) {
|
|
27790
|
+
expression = finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
27791
|
+
continue;
|
|
27792
|
+
}
|
|
27793
|
+
}
|
|
27763
27794
|
return expression;
|
|
27764
27795
|
}
|
|
27765
27796
|
}
|
|
@@ -27779,27 +27810,24 @@ var ts;
|
|
|
27779
27810
|
function parseCallExpressionRest(pos, expression) {
|
|
27780
27811
|
while (true) {
|
|
27781
27812
|
expression = parseMemberExpressionRest(pos, expression, true);
|
|
27813
|
+
var typeArguments = void 0;
|
|
27782
27814
|
var questionDotToken = parseOptionalToken(28);
|
|
27783
|
-
if (
|
|
27784
|
-
|
|
27785
|
-
if (
|
|
27786
|
-
|
|
27787
|
-
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
27788
|
-
continue;
|
|
27789
|
-
}
|
|
27790
|
-
var argumentList = parseArgumentList();
|
|
27791
|
-
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
27792
|
-
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
27793
|
-
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
27794
|
-
expression = finishNode(callExpr, pos);
|
|
27815
|
+
if (questionDotToken) {
|
|
27816
|
+
typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
27817
|
+
if (isTemplateStartOfTaggedTemplate()) {
|
|
27818
|
+
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
27795
27819
|
continue;
|
|
27796
27820
|
}
|
|
27797
27821
|
}
|
|
27798
|
-
|
|
27822
|
+
if (typeArguments || token() === 20) {
|
|
27823
|
+
if (!questionDotToken && expression.kind === 227) {
|
|
27824
|
+
typeArguments = expression.typeArguments;
|
|
27825
|
+
expression = expression.expression;
|
|
27826
|
+
}
|
|
27799
27827
|
var argumentList = parseArgumentList();
|
|
27800
27828
|
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
27801
|
-
factory.createCallChain(expression, questionDotToken,
|
|
27802
|
-
factory.createCallExpression(expression,
|
|
27829
|
+
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
27830
|
+
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
27803
27831
|
expression = finishNode(callExpr, pos);
|
|
27804
27832
|
continue;
|
|
27805
27833
|
}
|
|
@@ -27829,16 +27857,16 @@ var ts;
|
|
|
27829
27857
|
if (!parseExpected(31)) {
|
|
27830
27858
|
return undefined;
|
|
27831
27859
|
}
|
|
27832
|
-
return typeArguments && canFollowTypeArgumentsInExpression()
|
|
27833
|
-
? typeArguments
|
|
27834
|
-
: undefined;
|
|
27860
|
+
return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined;
|
|
27835
27861
|
}
|
|
27836
27862
|
function canFollowTypeArgumentsInExpression() {
|
|
27837
27863
|
switch (token()) {
|
|
27838
27864
|
case 20:
|
|
27839
27865
|
case 14:
|
|
27840
27866
|
case 15:
|
|
27867
|
+
case 27:
|
|
27841
27868
|
case 24:
|
|
27869
|
+
case 28:
|
|
27842
27870
|
case 21:
|
|
27843
27871
|
case 23:
|
|
27844
27872
|
case 58:
|
|
@@ -27857,11 +27885,8 @@ var ts;
|
|
|
27857
27885
|
case 19:
|
|
27858
27886
|
case 1:
|
|
27859
27887
|
return true;
|
|
27860
|
-
case 27:
|
|
27861
|
-
case 18:
|
|
27862
|
-
default:
|
|
27863
|
-
return false;
|
|
27864
27888
|
}
|
|
27889
|
+
return false;
|
|
27865
27890
|
}
|
|
27866
27891
|
function parsePrimaryExpression() {
|
|
27867
27892
|
switch (token()) {
|
|
@@ -28025,26 +28050,14 @@ var ts;
|
|
|
28025
28050
|
return finishNode(factory.createMetaProperty(103, name), pos);
|
|
28026
28051
|
}
|
|
28027
28052
|
var expressionPos = getNodePos();
|
|
28028
|
-
var expression = parsePrimaryExpression();
|
|
28053
|
+
var expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
|
|
28029
28054
|
var typeArguments;
|
|
28030
|
-
|
|
28031
|
-
|
|
28032
|
-
|
|
28033
|
-
if (isTemplateStartOfTaggedTemplate()) {
|
|
28034
|
-
ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
|
|
28035
|
-
expression = parseTaggedTemplateRest(expressionPos, expression, undefined, typeArguments);
|
|
28036
|
-
typeArguments = undefined;
|
|
28037
|
-
}
|
|
28038
|
-
break;
|
|
28039
|
-
}
|
|
28040
|
-
var argumentsArray;
|
|
28041
|
-
if (token() === 20) {
|
|
28042
|
-
argumentsArray = parseArgumentList();
|
|
28043
|
-
}
|
|
28044
|
-
else if (typeArguments) {
|
|
28045
|
-
parseErrorAt(pos, scanner.getStartPos(), ts.Diagnostics.A_new_expression_with_type_arguments_must_always_be_followed_by_a_parenthesized_argument_list);
|
|
28055
|
+
if (expression.kind === 227) {
|
|
28056
|
+
typeArguments = expression.typeArguments;
|
|
28057
|
+
expression = expression.expression;
|
|
28046
28058
|
}
|
|
28047
|
-
|
|
28059
|
+
var argumentList = token() === 20 ? parseArgumentList() : undefined;
|
|
28060
|
+
return finishNode(factory.createNewExpression(expression, typeArguments, argumentList), pos);
|
|
28048
28061
|
}
|
|
28049
28062
|
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
|
|
28050
28063
|
var pos = getNodePos();
|
|
@@ -28201,11 +28214,12 @@ var ts;
|
|
|
28201
28214
|
}
|
|
28202
28215
|
function parseCaseClause() {
|
|
28203
28216
|
var pos = getNodePos();
|
|
28217
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
28204
28218
|
parseExpected(82);
|
|
28205
28219
|
var expression = allowInAnd(parseExpression);
|
|
28206
28220
|
parseExpected(58);
|
|
28207
28221
|
var statements = parseList(3, parseStatement);
|
|
28208
|
-
return finishNode(factory.createCaseClause(expression, statements), pos);
|
|
28222
|
+
return withJSDoc(finishNode(factory.createCaseClause(expression, statements), pos), hasJSDoc);
|
|
28209
28223
|
}
|
|
28210
28224
|
function parseDefaultClause() {
|
|
28211
28225
|
var pos = getNodePos();
|
|
@@ -29009,6 +29023,9 @@ var ts;
|
|
|
29009
29023
|
function parseExpressionWithTypeArguments() {
|
|
29010
29024
|
var pos = getNodePos();
|
|
29011
29025
|
var expression = parseLeftHandSideExpressionOrHigher();
|
|
29026
|
+
if (expression.kind === 227) {
|
|
29027
|
+
return expression;
|
|
29028
|
+
}
|
|
29012
29029
|
var typeArguments = tryParseTypeArguments();
|
|
29013
29030
|
return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
29014
29031
|
}
|
|
@@ -29228,7 +29245,7 @@ var ts;
|
|
|
29228
29245
|
function parseModuleReference() {
|
|
29229
29246
|
return isExternalModuleReference()
|
|
29230
29247
|
? parseExternalModuleReference()
|
|
29231
|
-
: parseEntityName(false);
|
|
29248
|
+
: parseEntityName(false, false);
|
|
29232
29249
|
}
|
|
29233
29250
|
function parseExternalModuleReference() {
|
|
29234
29251
|
var pos = getNodePos();
|
|
@@ -29436,7 +29453,7 @@ var ts;
|
|
|
29436
29453
|
var pos = getNodePos();
|
|
29437
29454
|
var hasBrace = parseOptional(18);
|
|
29438
29455
|
var p2 = getNodePos();
|
|
29439
|
-
var entityName = parseEntityName(false);
|
|
29456
|
+
var entityName = parseEntityName(false, false);
|
|
29440
29457
|
while (token() === 80) {
|
|
29441
29458
|
reScanHashToken();
|
|
29442
29459
|
nextTokenJSDoc();
|
|
@@ -29838,7 +29855,7 @@ var ts;
|
|
|
29838
29855
|
skipWhitespace();
|
|
29839
29856
|
var p2 = getNodePos();
|
|
29840
29857
|
var name = ts.tokenIsIdentifierOrKeyword(token())
|
|
29841
|
-
? parseEntityName(true)
|
|
29858
|
+
? parseEntityName(true, false)
|
|
29842
29859
|
: undefined;
|
|
29843
29860
|
if (name) {
|
|
29844
29861
|
while (token() === 80) {
|
|
@@ -29863,11 +29880,13 @@ var ts;
|
|
|
29863
29880
|
&& nextTokenJSDoc() === 59
|
|
29864
29881
|
&& ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
|
|
29865
29882
|
var kind = scanner.getTokenValue();
|
|
29866
|
-
if (kind
|
|
29883
|
+
if (isJSDocLinkTag(kind))
|
|
29867
29884
|
return kind;
|
|
29868
|
-
}
|
|
29869
29885
|
}
|
|
29870
29886
|
}
|
|
29887
|
+
function isJSDocLinkTag(kind) {
|
|
29888
|
+
return kind === "link" || kind === "linkcode" || kind === "linkplain";
|
|
29889
|
+
}
|
|
29871
29890
|
function parseUnknownTag(start, tagName, indent, indentText) {
|
|
29872
29891
|
return finishNode(factory.createJSDocUnknownTag(tagName, parseTrailingTagComments(start, getNodePos(), indent, indentText)), start);
|
|
29873
29892
|
}
|
|
@@ -29970,7 +29989,7 @@ var ts;
|
|
|
29970
29989
|
}
|
|
29971
29990
|
function parseSeeTag(start, tagName, indent, indentText) {
|
|
29972
29991
|
var isMarkdownOrJSDocLink = token() === 22
|
|
29973
|
-
|| lookAhead(function () { return nextTokenJSDoc() === 59 && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue()
|
|
29992
|
+
|| lookAhead(function () { return nextTokenJSDoc() === 59 && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner.getTokenValue()); });
|
|
29974
29993
|
var nameExpression = isMarkdownOrJSDocLink ? undefined : parseJSDocNameReference();
|
|
29975
29994
|
var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, getNodePos(), indent, indentText) : undefined;
|
|
29976
29995
|
return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start);
|
|
@@ -30625,6 +30644,19 @@ var ts;
|
|
|
30625
30644
|
return ts.fileExtensionIsOneOf(fileName, [".d.ts", ".d.mts", ".d.cts"]);
|
|
30626
30645
|
}
|
|
30627
30646
|
ts.isDeclarationFileName = isDeclarationFileName;
|
|
30647
|
+
function parseResolutionMode(mode, pos, end, reportDiagnostic) {
|
|
30648
|
+
if (!mode) {
|
|
30649
|
+
return undefined;
|
|
30650
|
+
}
|
|
30651
|
+
if (mode === "import") {
|
|
30652
|
+
return ts.ModuleKind.ESNext;
|
|
30653
|
+
}
|
|
30654
|
+
if (mode === "require") {
|
|
30655
|
+
return ts.ModuleKind.CommonJS;
|
|
30656
|
+
}
|
|
30657
|
+
reportDiagnostic(pos, end - pos, ts.Diagnostics.resolution_mode_should_be_either_require_or_import);
|
|
30658
|
+
return undefined;
|
|
30659
|
+
}
|
|
30628
30660
|
function processCommentPragmas(context, sourceText) {
|
|
30629
30661
|
var pragmas = [];
|
|
30630
30662
|
for (var _i = 0, _a = ts.getLeadingCommentRanges(sourceText, 0) || ts.emptyArray; _i < _a.length; _i++) {
|
|
@@ -30663,12 +30695,13 @@ var ts;
|
|
|
30663
30695
|
var typeReferenceDirectives_1 = context.typeReferenceDirectives;
|
|
30664
30696
|
var libReferenceDirectives_1 = context.libReferenceDirectives;
|
|
30665
30697
|
ts.forEach(ts.toArray(entryOrList), function (arg) {
|
|
30666
|
-
var _a = arg.arguments, types = _a.types, lib = _a.lib, path = _a.path;
|
|
30698
|
+
var _a = arg.arguments, types = _a.types, lib = _a.lib, path = _a.path, res = _a["resolution-mode"];
|
|
30667
30699
|
if (arg.arguments["no-default-lib"]) {
|
|
30668
30700
|
context.hasNoDefaultLib = true;
|
|
30669
30701
|
}
|
|
30670
30702
|
else if (types) {
|
|
30671
|
-
|
|
30703
|
+
var parsed = parseResolutionMode(res, types.pos, types.end, reportDiagnostic);
|
|
30704
|
+
typeReferenceDirectives_1.push(__assign({ pos: types.pos, end: types.end, fileName: types.value }, (parsed ? { resolutionMode: parsed } : {})));
|
|
30672
30705
|
}
|
|
30673
30706
|
else if (lib) {
|
|
30674
30707
|
libReferenceDirectives_1.push({ pos: lib.pos, end: lib.end, fileName: lib.value });
|
|
@@ -32919,7 +32952,7 @@ var ts;
|
|
|
32919
32952
|
var result = [];
|
|
32920
32953
|
result.push("{");
|
|
32921
32954
|
result.push(tab + "\"compilerOptions\": {");
|
|
32922
|
-
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) + " */");
|
|
32923
32956
|
result.push("");
|
|
32924
32957
|
for (var _a = 0, entries_2 = entries; _a < entries_2.length; _a++) {
|
|
32925
32958
|
var entry = entries_2[_a];
|
|
@@ -33911,14 +33944,14 @@ var ts;
|
|
|
33911
33944
|
var useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
33912
33945
|
return ts.comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0;
|
|
33913
33946
|
}
|
|
33914
|
-
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache) {
|
|
33947
|
+
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
33915
33948
|
var traceEnabled = isTraceEnabled(options, host);
|
|
33916
33949
|
if (redirectedReference) {
|
|
33917
33950
|
options = redirectedReference.commandLine.options;
|
|
33918
33951
|
}
|
|
33919
33952
|
var containingDirectory = containingFile ? ts.getDirectoryPath(containingFile) : undefined;
|
|
33920
33953
|
var perFolderCache = containingDirectory ? cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference) : undefined;
|
|
33921
|
-
var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName,
|
|
33954
|
+
var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName, resolutionMode);
|
|
33922
33955
|
if (result) {
|
|
33923
33956
|
if (traceEnabled) {
|
|
33924
33957
|
trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
|
|
@@ -33953,7 +33986,11 @@ var ts;
|
|
|
33953
33986
|
}
|
|
33954
33987
|
var failedLookupLocations = [];
|
|
33955
33988
|
var features = getDefaultNodeResolutionFeatures(options);
|
|
33956
|
-
|
|
33989
|
+
if (resolutionMode === ts.ModuleKind.ESNext && (ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.Node12 || ts.getEmitModuleResolutionKind(options) === ts.ModuleResolutionKind.NodeNext)) {
|
|
33990
|
+
features |= NodeResolutionFeatures.EsmMode;
|
|
33991
|
+
}
|
|
33992
|
+
var conditions = features & NodeResolutionFeatures.Exports ? features & NodeResolutionFeatures.EsmMode ? ["node", "import", "types"] : ["node", "require", "types"] : [];
|
|
33993
|
+
var moduleResolutionState = { compilerOptions: options, host: host, traceEnabled: traceEnabled, failedLookupLocations: failedLookupLocations, packageJsonInfoCache: cache, features: features, conditions: conditions };
|
|
33957
33994
|
var resolved = primaryLookup();
|
|
33958
33995
|
var primary = true;
|
|
33959
33996
|
if (!resolved) {
|
|
@@ -33973,7 +34010,7 @@ var ts;
|
|
|
33973
34010
|
};
|
|
33974
34011
|
}
|
|
33975
34012
|
result = { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };
|
|
33976
|
-
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName,
|
|
34013
|
+
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName, resolutionMode, result);
|
|
33977
34014
|
if (traceEnabled)
|
|
33978
34015
|
traceResult(result);
|
|
33979
34016
|
return result;
|
|
@@ -34232,7 +34269,10 @@ var ts;
|
|
|
34232
34269
|
ts.Debug.assert(keys.length === values.length);
|
|
34233
34270
|
var map = createModeAwareCache();
|
|
34234
34271
|
for (var i = 0; i < keys.length; ++i) {
|
|
34235
|
-
|
|
34272
|
+
var entry = keys[i];
|
|
34273
|
+
var name = !ts.isString(entry) ? entry.fileName.toLowerCase() : entry;
|
|
34274
|
+
var mode = !ts.isString(entry) ? entry.resolutionMode || file.impliedNodeFormat : ts.getModeForResolutionAtIndex(file, i);
|
|
34275
|
+
map.set(name, mode, values[i]);
|
|
34236
34276
|
}
|
|
34237
34277
|
return map;
|
|
34238
34278
|
}
|
|
@@ -41895,7 +41935,7 @@ var ts;
|
|
|
41895
41935
|
function isEntityNameVisible(entityName, enclosingDeclaration) {
|
|
41896
41936
|
var meaning;
|
|
41897
41937
|
if (entityName.parent.kind === 180 ||
|
|
41898
|
-
ts.
|
|
41938
|
+
entityName.parent.kind === 227 && !ts.isPartOfTypeNode(entityName.parent) ||
|
|
41899
41939
|
entityName.parent.kind === 161) {
|
|
41900
41940
|
meaning = 111551 | 1048576;
|
|
41901
41941
|
}
|
|
@@ -41998,7 +42038,7 @@ var ts;
|
|
|
41998
42038
|
return flags & 814775659;
|
|
41999
42039
|
}
|
|
42000
42040
|
function isClassInstanceSide(type) {
|
|
42001
|
-
return !!type.symbol && !!(type.symbol.flags & 32) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288) && !!(ts.getObjectFlags(type) &
|
|
42041
|
+
return !!type.symbol && !!(type.symbol.flags & 32) && (type === getDeclaredTypeOfClassOrInterface(type.symbol) || (!!(type.flags & 524288) && !!(ts.getObjectFlags(type) & 33554432)));
|
|
42002
42042
|
}
|
|
42003
42043
|
function createNodeBuilder() {
|
|
42004
42044
|
return {
|
|
@@ -45395,7 +45435,7 @@ var ts;
|
|
|
45395
45435
|
var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
|
|
45396
45436
|
result.objectFlags |= (ts.getObjectFlags(type) & 8192);
|
|
45397
45437
|
if (result.symbol && result.symbol.flags & 32 && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
45398
|
-
result.objectFlags |=
|
|
45438
|
+
result.objectFlags |= 33554432;
|
|
45399
45439
|
}
|
|
45400
45440
|
return result;
|
|
45401
45441
|
}
|
|
@@ -47167,81 +47207,81 @@ var ts;
|
|
|
47167
47207
|
return ts.append(indexInfos, newInfo);
|
|
47168
47208
|
}
|
|
47169
47209
|
function resolveAnonymousTypeMembers(type) {
|
|
47170
|
-
var symbol = getMergedSymbol(type.symbol);
|
|
47171
47210
|
if (type.target) {
|
|
47172
47211
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47173
|
-
var
|
|
47212
|
+
var members_6 = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, false);
|
|
47174
47213
|
var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0), type.mapper);
|
|
47175
47214
|
var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1), type.mapper);
|
|
47176
|
-
var
|
|
47177
|
-
setStructuredTypeMembers(type,
|
|
47215
|
+
var indexInfos_1 = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper);
|
|
47216
|
+
setStructuredTypeMembers(type, members_6, callSignatures, constructSignatures, indexInfos_1);
|
|
47217
|
+
return;
|
|
47178
47218
|
}
|
|
47179
|
-
|
|
47219
|
+
var symbol = getMergedSymbol(type.symbol);
|
|
47220
|
+
if (symbol.flags & 2048) {
|
|
47180
47221
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47181
|
-
var
|
|
47182
|
-
var callSignatures = getSignaturesOfSymbol(
|
|
47183
|
-
var constructSignatures = getSignaturesOfSymbol(
|
|
47184
|
-
var
|
|
47185
|
-
setStructuredTypeMembers(type,
|
|
47222
|
+
var members_7 = getMembersOfSymbol(symbol);
|
|
47223
|
+
var callSignatures = getSignaturesOfSymbol(members_7.get("__call"));
|
|
47224
|
+
var constructSignatures = getSignaturesOfSymbol(members_7.get("__new"));
|
|
47225
|
+
var indexInfos_2 = getIndexInfosOfSymbol(symbol);
|
|
47226
|
+
setStructuredTypeMembers(type, members_7, callSignatures, constructSignatures, indexInfos_2);
|
|
47227
|
+
return;
|
|
47186
47228
|
}
|
|
47187
|
-
|
|
47188
|
-
|
|
47189
|
-
|
|
47190
|
-
|
|
47191
|
-
|
|
47192
|
-
|
|
47193
|
-
|
|
47194
|
-
|
|
47195
|
-
|
|
47196
|
-
|
|
47197
|
-
|
|
47198
|
-
|
|
47199
|
-
members = varsOnly_1;
|
|
47200
|
-
}
|
|
47229
|
+
var members = emptySymbols;
|
|
47230
|
+
var indexInfos;
|
|
47231
|
+
if (symbol.exports) {
|
|
47232
|
+
members = getExportsOfSymbol(symbol);
|
|
47233
|
+
if (symbol === globalThisSymbol) {
|
|
47234
|
+
var varsOnly_1 = new ts.Map();
|
|
47235
|
+
members.forEach(function (p) {
|
|
47236
|
+
if (!(p.flags & 418)) {
|
|
47237
|
+
varsOnly_1.set(p.escapedName, p);
|
|
47238
|
+
}
|
|
47239
|
+
});
|
|
47240
|
+
members = varsOnly_1;
|
|
47201
47241
|
}
|
|
47202
|
-
|
|
47203
|
-
|
|
47204
|
-
|
|
47205
|
-
|
|
47206
|
-
|
|
47207
|
-
|
|
47208
|
-
|
|
47209
|
-
|
|
47210
|
-
|
|
47211
|
-
else if (baseConstructorType === anyType) {
|
|
47212
|
-
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, false);
|
|
47213
|
-
}
|
|
47242
|
+
}
|
|
47243
|
+
var baseConstructorIndexInfo;
|
|
47244
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47245
|
+
if (symbol.flags & 32) {
|
|
47246
|
+
var classType = getDeclaredTypeOfClassOrInterface(symbol);
|
|
47247
|
+
var baseConstructorType = getBaseConstructorTypeOfClass(classType);
|
|
47248
|
+
if (baseConstructorType.flags & (524288 | 2097152 | 8650752)) {
|
|
47249
|
+
members = ts.createSymbolTable(getNamedOrIndexSignatureMembers(members));
|
|
47250
|
+
addInheritedMembers(members, getPropertiesOfType(baseConstructorType));
|
|
47214
47251
|
}
|
|
47215
|
-
|
|
47216
|
-
|
|
47217
|
-
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
47252
|
+
else if (baseConstructorType === anyType) {
|
|
47253
|
+
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, false);
|
|
47218
47254
|
}
|
|
47219
|
-
|
|
47220
|
-
|
|
47221
|
-
|
|
47222
|
-
|
|
47223
|
-
|
|
47224
|
-
|
|
47225
|
-
|
|
47226
|
-
|
|
47255
|
+
}
|
|
47256
|
+
var indexSymbol = getIndexSymbolFromSymbolTable(members);
|
|
47257
|
+
if (indexSymbol) {
|
|
47258
|
+
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
47259
|
+
}
|
|
47260
|
+
else {
|
|
47261
|
+
if (baseConstructorIndexInfo) {
|
|
47262
|
+
indexInfos = ts.append(indexInfos, baseConstructorIndexInfo);
|
|
47227
47263
|
}
|
|
47228
|
-
|
|
47229
|
-
|
|
47230
|
-
|
|
47264
|
+
if (symbol.flags & 384 && (getDeclaredTypeOfSymbol(symbol).flags & 32 ||
|
|
47265
|
+
ts.some(type.properties, function (prop) { return !!(getTypeOfSymbol(prop).flags & 296); }))) {
|
|
47266
|
+
indexInfos = ts.append(indexInfos, enumNumberIndexInfo);
|
|
47231
47267
|
}
|
|
47232
|
-
|
|
47233
|
-
|
|
47234
|
-
|
|
47235
|
-
|
|
47236
|
-
|
|
47237
|
-
|
|
47238
|
-
|
|
47239
|
-
|
|
47240
|
-
|
|
47241
|
-
|
|
47242
|
-
|
|
47243
|
-
|
|
47268
|
+
}
|
|
47269
|
+
setStructuredTypeMembers(type, members, ts.emptyArray, ts.emptyArray, indexInfos || ts.emptyArray);
|
|
47270
|
+
if (symbol.flags & (16 | 8192)) {
|
|
47271
|
+
type.callSignatures = getSignaturesOfSymbol(symbol);
|
|
47272
|
+
}
|
|
47273
|
+
if (symbol.flags & 32) {
|
|
47274
|
+
var classType_1 = getDeclaredTypeOfClassOrInterface(symbol);
|
|
47275
|
+
var constructSignatures = symbol.members ? getSignaturesOfSymbol(symbol.members.get("__constructor")) : ts.emptyArray;
|
|
47276
|
+
if (symbol.flags & 16) {
|
|
47277
|
+
constructSignatures = ts.addRange(constructSignatures.slice(), ts.mapDefined(type.callSignatures, function (sig) { return isJSConstructor(sig.declaration) ?
|
|
47278
|
+
createSignature(sig.declaration, sig.typeParameters, sig.thisParameter, sig.parameters, classType_1, undefined, sig.minArgumentCount, sig.flags & 39) :
|
|
47279
|
+
undefined; }));
|
|
47280
|
+
}
|
|
47281
|
+
if (!constructSignatures.length) {
|
|
47282
|
+
constructSignatures = getDefaultConstructSignatures(classType_1);
|
|
47244
47283
|
}
|
|
47284
|
+
type.constructSignatures = constructSignatures;
|
|
47245
47285
|
}
|
|
47246
47286
|
}
|
|
47247
47287
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
@@ -48101,8 +48141,8 @@ var ts;
|
|
|
48101
48141
|
var stringIndexInfo;
|
|
48102
48142
|
var applicableInfo;
|
|
48103
48143
|
var applicableInfos;
|
|
48104
|
-
for (var _i = 0,
|
|
48105
|
-
var info =
|
|
48144
|
+
for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
|
|
48145
|
+
var info = indexInfos_3[_i];
|
|
48106
48146
|
if (info.keyType === stringType) {
|
|
48107
48147
|
stringIndexInfo = info;
|
|
48108
48148
|
}
|
|
@@ -48591,9 +48631,10 @@ var ts;
|
|
|
48591
48631
|
return signature;
|
|
48592
48632
|
}
|
|
48593
48633
|
function getOrCreateTypeFromSignature(signature) {
|
|
48634
|
+
var _a;
|
|
48594
48635
|
if (!signature.isolatedSignatureType) {
|
|
48595
|
-
var kind = signature.declaration ?
|
|
48596
|
-
var isConstructor = kind === 170 || kind === 174 || kind === 179;
|
|
48636
|
+
var kind = (_a = signature.declaration) === null || _a === void 0 ? void 0 : _a.kind;
|
|
48637
|
+
var isConstructor = kind === undefined || kind === 170 || kind === 174 || kind === 179;
|
|
48597
48638
|
var type = createObjectType(16);
|
|
48598
48639
|
type.members = emptySymbols;
|
|
48599
48640
|
type.properties = ts.emptyArray;
|
|
@@ -48619,14 +48660,14 @@ var ts;
|
|
|
48619
48660
|
}
|
|
48620
48661
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
48621
48662
|
if (indexSymbol.declarations) {
|
|
48622
|
-
var
|
|
48663
|
+
var indexInfos_4 = [];
|
|
48623
48664
|
var _loop_14 = function (declaration) {
|
|
48624
48665
|
if (declaration.parameters.length === 1) {
|
|
48625
48666
|
var parameter = declaration.parameters[0];
|
|
48626
48667
|
if (parameter.type) {
|
|
48627
48668
|
forEachType(getTypeFromTypeNode(parameter.type), function (keyType) {
|
|
48628
|
-
if (isValidIndexKeyType(keyType) && !findIndexInfo(
|
|
48629
|
-
|
|
48669
|
+
if (isValidIndexKeyType(keyType) && !findIndexInfo(indexInfos_4, keyType)) {
|
|
48670
|
+
indexInfos_4.push(createIndexInfo(keyType, declaration.type ? getTypeFromTypeNode(declaration.type) : anyType, ts.hasEffectiveModifier(declaration, 64), declaration));
|
|
48630
48671
|
}
|
|
48631
48672
|
});
|
|
48632
48673
|
}
|
|
@@ -48636,7 +48677,7 @@ var ts;
|
|
|
48636
48677
|
var declaration = _a[_i];
|
|
48637
48678
|
_loop_14(declaration);
|
|
48638
48679
|
}
|
|
48639
|
-
return
|
|
48680
|
+
return indexInfos_4;
|
|
48640
48681
|
}
|
|
48641
48682
|
return ts.emptyArray;
|
|
48642
48683
|
}
|
|
@@ -49121,7 +49162,7 @@ var ts;
|
|
|
49121
49162
|
function getTypeFromTypeQueryNode(node) {
|
|
49122
49163
|
var links = getNodeLinks(node);
|
|
49123
49164
|
if (!links.resolvedType) {
|
|
49124
|
-
var type =
|
|
49165
|
+
var type = checkExpressionWithTypeArguments(node);
|
|
49125
49166
|
links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type));
|
|
49126
49167
|
}
|
|
49127
49168
|
return links.resolvedType;
|
|
@@ -49430,7 +49471,7 @@ var ts;
|
|
|
49430
49471
|
}
|
|
49431
49472
|
}
|
|
49432
49473
|
var fixedLength = properties.length;
|
|
49433
|
-
var lengthSymbol = createSymbol(4, "length");
|
|
49474
|
+
var lengthSymbol = createSymbol(4, "length", readonly ? 8 : 0);
|
|
49434
49475
|
if (combinedFlags & 12) {
|
|
49435
49476
|
lengthSymbol.type = numberType;
|
|
49436
49477
|
}
|
|
@@ -51547,7 +51588,9 @@ var ts;
|
|
|
51547
51588
|
return result;
|
|
51548
51589
|
}
|
|
51549
51590
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
51550
|
-
var declaration = type.objectFlags & 4 ? type.node :
|
|
51591
|
+
var declaration = type.objectFlags & 4 ? type.node :
|
|
51592
|
+
type.objectFlags & 16777216 ? type.node :
|
|
51593
|
+
type.symbol.declarations[0];
|
|
51551
51594
|
var links = getNodeLinks(declaration);
|
|
51552
51595
|
var target = type.objectFlags & 4 ? links.resolvedType :
|
|
51553
51596
|
type.objectFlags & 64 ? type.target : type;
|
|
@@ -51559,8 +51602,8 @@ var ts;
|
|
|
51559
51602
|
outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
|
|
51560
51603
|
}
|
|
51561
51604
|
typeParameters = outerTypeParameters || ts.emptyArray;
|
|
51562
|
-
var allDeclarations_1 = type.objectFlags & 4 ? [declaration] : type.symbol.declarations;
|
|
51563
|
-
typeParameters = (target.objectFlags & 4 || target.symbol.flags & 8192 || target.symbol.flags & 2048) && !target.aliasTypeArguments ?
|
|
51605
|
+
var allDeclarations_1 = type.objectFlags & (4 | 16777216) ? [declaration] : type.symbol.declarations;
|
|
51606
|
+
typeParameters = (target.objectFlags & (4 | 16777216) || target.symbol.flags & 8192 || target.symbol.flags & 2048) && !target.aliasTypeArguments ?
|
|
51564
51607
|
ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
|
|
51565
51608
|
typeParameters;
|
|
51566
51609
|
links.outerTypeParameters = typeParameters;
|
|
@@ -51709,6 +51752,9 @@ var ts;
|
|
|
51709
51752
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
51710
51753
|
freshTypeParameter.mapper = mapper;
|
|
51711
51754
|
}
|
|
51755
|
+
if (type.objectFlags & 16777216) {
|
|
51756
|
+
result.node = type.node;
|
|
51757
|
+
}
|
|
51712
51758
|
result.target = type;
|
|
51713
51759
|
result.mapper = mapper;
|
|
51714
51760
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -52399,9 +52445,6 @@ var ts;
|
|
|
52399
52445
|
if (sourceRestType || targetRestType) {
|
|
52400
52446
|
void instantiateType(sourceRestType || targetRestType, reportUnreliableMarkers);
|
|
52401
52447
|
}
|
|
52402
|
-
if (sourceRestType && targetRestType && sourceCount !== targetCount) {
|
|
52403
|
-
return 0;
|
|
52404
|
-
}
|
|
52405
52448
|
var kind = target.declaration ? target.declaration.kind : 0;
|
|
52406
52449
|
var strictVariance = !(checkMode & 3) && strictFunctionTypes && kind !== 168 &&
|
|
52407
52450
|
kind !== 167 && kind !== 170;
|
|
@@ -52684,11 +52727,11 @@ var ts;
|
|
|
52684
52727
|
var overflow = false;
|
|
52685
52728
|
var overrideNextErrorInfo = 0;
|
|
52686
52729
|
var lastSkippedInfo;
|
|
52687
|
-
var incompatibleStack
|
|
52730
|
+
var incompatibleStack;
|
|
52688
52731
|
var inPropertyCheck = false;
|
|
52689
52732
|
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
52690
52733
|
var result = isRelatedTo(source, target, 3, !!errorNode, headMessage);
|
|
52691
|
-
if (incompatibleStack
|
|
52734
|
+
if (incompatibleStack) {
|
|
52692
52735
|
reportIncompatibleStack();
|
|
52693
52736
|
}
|
|
52694
52737
|
if (overflow) {
|
|
@@ -52743,19 +52786,19 @@ var ts;
|
|
|
52743
52786
|
return {
|
|
52744
52787
|
errorInfo: errorInfo,
|
|
52745
52788
|
lastSkippedInfo: lastSkippedInfo,
|
|
52746
|
-
incompatibleStack: incompatibleStack.slice(),
|
|
52789
|
+
incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
|
|
52747
52790
|
overrideNextErrorInfo: overrideNextErrorInfo,
|
|
52748
|
-
relatedInfo:
|
|
52791
|
+
relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
|
|
52749
52792
|
};
|
|
52750
52793
|
}
|
|
52751
52794
|
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
|
|
52752
52795
|
overrideNextErrorInfo++;
|
|
52753
52796
|
lastSkippedInfo = undefined;
|
|
52754
|
-
incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
|
|
52797
|
+
(incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
|
|
52755
52798
|
}
|
|
52756
52799
|
function reportIncompatibleStack() {
|
|
52757
|
-
var stack = incompatibleStack;
|
|
52758
|
-
incompatibleStack =
|
|
52800
|
+
var stack = incompatibleStack || [];
|
|
52801
|
+
incompatibleStack = undefined;
|
|
52759
52802
|
var info = lastSkippedInfo;
|
|
52760
52803
|
lastSkippedInfo = undefined;
|
|
52761
52804
|
if (stack.length === 1) {
|
|
@@ -52849,7 +52892,7 @@ var ts;
|
|
|
52849
52892
|
}
|
|
52850
52893
|
function reportError(message, arg0, arg1, arg2, arg3) {
|
|
52851
52894
|
ts.Debug.assert(!!errorNode);
|
|
52852
|
-
if (incompatibleStack
|
|
52895
|
+
if (incompatibleStack)
|
|
52853
52896
|
reportIncompatibleStack();
|
|
52854
52897
|
if (message.elidedInCompatabilityPyramid)
|
|
52855
52898
|
return;
|
|
@@ -52865,7 +52908,7 @@ var ts;
|
|
|
52865
52908
|
}
|
|
52866
52909
|
}
|
|
52867
52910
|
function reportRelationError(message, source, target) {
|
|
52868
|
-
if (incompatibleStack
|
|
52911
|
+
if (incompatibleStack)
|
|
52869
52912
|
reportIncompatibleStack();
|
|
52870
52913
|
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
|
|
52871
52914
|
var generalizedSource = source;
|
|
@@ -52956,7 +52999,9 @@ var ts;
|
|
|
52956
52999
|
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
|
|
52957
53000
|
return -1;
|
|
52958
53001
|
}
|
|
52959
|
-
|
|
53002
|
+
if (reportErrors) {
|
|
53003
|
+
reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
|
|
53004
|
+
}
|
|
52960
53005
|
return 0;
|
|
52961
53006
|
}
|
|
52962
53007
|
var source = getNormalizedType(originalSource, false);
|
|
@@ -52964,127 +53009,121 @@ var ts;
|
|
|
52964
53009
|
if (source === target)
|
|
52965
53010
|
return -1;
|
|
52966
53011
|
if (relation === identityRelation) {
|
|
52967
|
-
|
|
53012
|
+
if (source.flags !== target.flags)
|
|
53013
|
+
return 0;
|
|
53014
|
+
if (source.flags & 67358815)
|
|
53015
|
+
return -1;
|
|
53016
|
+
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53017
|
+
return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
|
|
52968
53018
|
}
|
|
52969
53019
|
if (source.flags & 262144 && getConstraintOfType(source) === target) {
|
|
52970
53020
|
return -1;
|
|
52971
53021
|
}
|
|
52972
|
-
if (
|
|
52973
|
-
|
|
52974
|
-
var
|
|
52975
|
-
|
|
52976
|
-
|
|
53022
|
+
if (source.flags & 470302716 && target.flags & 1048576) {
|
|
53023
|
+
var types = target.types;
|
|
53024
|
+
var candidate = types.length === 2 && types[0].flags & 98304 ? types[1] :
|
|
53025
|
+
types.length === 3 && types[0].flags & 98304 && types[1].flags & 98304 ? types[2] :
|
|
53026
|
+
undefined;
|
|
53027
|
+
if (candidate && !(candidate.flags & 98304)) {
|
|
53028
|
+
target = getNormalizedType(candidate, true);
|
|
53029
|
+
if (source === target)
|
|
53030
|
+
return -1;
|
|
52977
53031
|
}
|
|
52978
|
-
if (source === nullStrippedTarget)
|
|
52979
|
-
return -1;
|
|
52980
53032
|
}
|
|
52981
53033
|
if (relation === comparableRelation && !(target.flags & 131072) && isSimpleTypeRelatedTo(target, source, relation) ||
|
|
52982
53034
|
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
|
|
52983
53035
|
return -1;
|
|
52984
|
-
|
|
52985
|
-
|
|
52986
|
-
|
|
52987
|
-
|
|
53036
|
+
if (source.flags & 469499904 || target.flags & 469499904) {
|
|
53037
|
+
var isPerformingExcessPropertyChecks = !(intersectionState & 2) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384);
|
|
53038
|
+
if (isPerformingExcessPropertyChecks) {
|
|
53039
|
+
if (hasExcessProperties(source, target, reportErrors)) {
|
|
53040
|
+
if (reportErrors) {
|
|
53041
|
+
reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
|
|
53042
|
+
}
|
|
53043
|
+
return 0;
|
|
53044
|
+
}
|
|
53045
|
+
}
|
|
53046
|
+
var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2) &&
|
|
53047
|
+
source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
|
|
53048
|
+
target.flags & (524288 | 2097152) && isWeakType(target) &&
|
|
53049
|
+
(getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
|
|
53050
|
+
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048);
|
|
53051
|
+
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
|
|
52988
53052
|
if (reportErrors) {
|
|
52989
|
-
|
|
53053
|
+
var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
|
|
53054
|
+
var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
|
|
53055
|
+
var calls = getSignaturesOfType(source, 0);
|
|
53056
|
+
var constructs = getSignaturesOfType(source, 1);
|
|
53057
|
+
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
|
|
53058
|
+
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
|
|
53059
|
+
reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
|
|
53060
|
+
}
|
|
53061
|
+
else {
|
|
53062
|
+
reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
|
|
53063
|
+
}
|
|
52990
53064
|
}
|
|
52991
53065
|
return 0;
|
|
52992
53066
|
}
|
|
52993
|
-
|
|
52994
|
-
|
|
52995
|
-
|
|
52996
|
-
|
|
52997
|
-
|
|
52998
|
-
|
|
52999
|
-
if (
|
|
53000
|
-
|
|
53001
|
-
|
|
53002
|
-
|
|
53003
|
-
|
|
53004
|
-
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
|
|
53005
|
-
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
|
|
53006
|
-
reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
|
|
53007
|
-
}
|
|
53008
|
-
else {
|
|
53009
|
-
reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
|
|
53010
|
-
}
|
|
53067
|
+
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53068
|
+
var skipCaching = source.flags & 1048576 && source.types.length < 4 && !(target.flags & 1048576) ||
|
|
53069
|
+
target.flags & 1048576 && target.types.length < 4 && !(source.flags & 469499904);
|
|
53070
|
+
var result_7 = skipCaching ?
|
|
53071
|
+
unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
|
|
53072
|
+
recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
|
|
53073
|
+
if (result_7 && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
|
|
53074
|
+
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288); }))) {
|
|
53075
|
+
inPropertyCheck = true;
|
|
53076
|
+
result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
|
|
53077
|
+
inPropertyCheck = false;
|
|
53011
53078
|
}
|
|
53012
|
-
|
|
53013
|
-
|
|
53014
|
-
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53015
|
-
var result = 0;
|
|
53016
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
53017
|
-
if ((source.flags & 1048576 || target.flags & 1048576) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
53018
|
-
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
|
|
53019
|
-
}
|
|
53020
|
-
else if (source.flags & 3145728 || target.flags & 3145728) {
|
|
53021
|
-
result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags);
|
|
53022
|
-
}
|
|
53023
|
-
if (!result && !(source.flags & 1048576) && (source.flags & (469499904) || target.flags & 469499904)) {
|
|
53024
|
-
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
53025
|
-
resetErrorInfo(saveErrorInfo);
|
|
53079
|
+
if (result_7) {
|
|
53080
|
+
return result_7;
|
|
53026
53081
|
}
|
|
53027
53082
|
}
|
|
53028
|
-
if (
|
|
53029
|
-
|
|
53030
|
-
|
|
53031
|
-
|
|
53032
|
-
|
|
53033
|
-
|
|
53034
|
-
|
|
53035
|
-
|
|
53083
|
+
if (reportErrors) {
|
|
53084
|
+
reportErrorResults(originalSource, originalTarget, source, target, headMessage);
|
|
53085
|
+
}
|
|
53086
|
+
return 0;
|
|
53087
|
+
}
|
|
53088
|
+
function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
|
|
53089
|
+
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
53090
|
+
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
53091
|
+
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
53092
|
+
target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
|
|
53093
|
+
var maybeSuppress = overrideNextErrorInfo > 0;
|
|
53094
|
+
if (maybeSuppress) {
|
|
53095
|
+
overrideNextErrorInfo--;
|
|
53096
|
+
}
|
|
53097
|
+
if (source.flags & 524288 && target.flags & 524288) {
|
|
53098
|
+
var currentError = errorInfo;
|
|
53099
|
+
tryElaborateArrayLikeErrors(source, target, true);
|
|
53100
|
+
if (errorInfo !== currentError) {
|
|
53101
|
+
maybeSuppress = !!errorInfo;
|
|
53102
|
+
}
|
|
53103
|
+
}
|
|
53104
|
+
if (source.flags & 524288 && target.flags & 131068) {
|
|
53105
|
+
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
|
53106
|
+
}
|
|
53107
|
+
else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
|
|
53108
|
+
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
53109
|
+
}
|
|
53110
|
+
else if (ts.getObjectFlags(source) & 2048 && target.flags & 2097152) {
|
|
53111
|
+
var targetTypes = target.types;
|
|
53112
|
+
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
53113
|
+
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
53114
|
+
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
53115
|
+
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
53116
|
+
return;
|
|
53036
53117
|
}
|
|
53037
53118
|
}
|
|
53038
|
-
|
|
53039
|
-
|
|
53040
|
-
inPropertyCheck = true;
|
|
53041
|
-
result &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
|
|
53042
|
-
inPropertyCheck = false;
|
|
53119
|
+
else {
|
|
53120
|
+
errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
|
|
53043
53121
|
}
|
|
53044
|
-
|
|
53045
|
-
|
|
53046
|
-
|
|
53047
|
-
if (!result && reportErrors) {
|
|
53048
|
-
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
53049
|
-
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
53050
|
-
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
53051
|
-
target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
|
|
53052
|
-
var maybeSuppress = overrideNextErrorInfo > 0;
|
|
53053
|
-
if (maybeSuppress) {
|
|
53054
|
-
overrideNextErrorInfo--;
|
|
53055
|
-
}
|
|
53056
|
-
if (source.flags & 524288 && target.flags & 524288) {
|
|
53057
|
-
var currentError = errorInfo;
|
|
53058
|
-
tryElaborateArrayLikeErrors(source, target, reportErrors);
|
|
53059
|
-
if (errorInfo !== currentError) {
|
|
53060
|
-
maybeSuppress = !!errorInfo;
|
|
53061
|
-
}
|
|
53062
|
-
}
|
|
53063
|
-
if (source.flags & 524288 && target.flags & 131068) {
|
|
53064
|
-
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
|
53065
|
-
}
|
|
53066
|
-
else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
|
|
53067
|
-
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
53068
|
-
}
|
|
53069
|
-
else if (isComparingJsxAttributes && target.flags & 2097152) {
|
|
53070
|
-
var targetTypes = target.types;
|
|
53071
|
-
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
53072
|
-
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
53073
|
-
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
53074
|
-
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
53075
|
-
return result;
|
|
53076
|
-
}
|
|
53077
|
-
}
|
|
53078
|
-
else {
|
|
53079
|
-
errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
|
|
53080
|
-
}
|
|
53081
|
-
if (!headMessage && maybeSuppress) {
|
|
53082
|
-
lastSkippedInfo = [source, target];
|
|
53083
|
-
return result;
|
|
53084
|
-
}
|
|
53085
|
-
reportRelationError(headMessage, source, target);
|
|
53086
|
-
}
|
|
53122
|
+
if (!headMessage && maybeSuppress) {
|
|
53123
|
+
lastSkippedInfo = [source, target];
|
|
53124
|
+
return;
|
|
53087
53125
|
}
|
|
53126
|
+
reportRelationError(headMessage, source, target);
|
|
53088
53127
|
}
|
|
53089
53128
|
function traceUnionsOrIntersectionsTooLarge(source, target) {
|
|
53090
53129
|
if (!ts.tracing) {
|
|
@@ -53110,21 +53149,6 @@ var ts;
|
|
|
53110
53149
|
}
|
|
53111
53150
|
}
|
|
53112
53151
|
}
|
|
53113
|
-
function isIdenticalTo(source, target, recursionFlags) {
|
|
53114
|
-
if (source.flags !== target.flags)
|
|
53115
|
-
return 0;
|
|
53116
|
-
if (source.flags & 67358815)
|
|
53117
|
-
return -1;
|
|
53118
|
-
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53119
|
-
if (source.flags & 3145728) {
|
|
53120
|
-
var result_7 = eachTypeRelatedToSomeType(source, target);
|
|
53121
|
-
if (result_7) {
|
|
53122
|
-
result_7 &= eachTypeRelatedToSomeType(target, source);
|
|
53123
|
-
}
|
|
53124
|
-
return result_7;
|
|
53125
|
-
}
|
|
53126
|
-
return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
|
|
53127
|
-
}
|
|
53128
53152
|
function getTypeOfPropertyInTypes(types, name) {
|
|
53129
53153
|
var appendPropType = function (propTypes, type) {
|
|
53130
53154
|
var _a;
|
|
@@ -53213,6 +53237,29 @@ var ts;
|
|
|
53213
53237
|
function shouldCheckAsExcessProperty(prop, container) {
|
|
53214
53238
|
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
|
|
53215
53239
|
}
|
|
53240
|
+
function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
|
|
53241
|
+
if (source.flags & 1048576) {
|
|
53242
|
+
return relation === comparableRelation ?
|
|
53243
|
+
someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState) :
|
|
53244
|
+
eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState);
|
|
53245
|
+
}
|
|
53246
|
+
if (target.flags & 1048576) {
|
|
53247
|
+
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068) && !(target.flags & 131068));
|
|
53248
|
+
}
|
|
53249
|
+
if (target.flags & 2097152) {
|
|
53250
|
+
return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2);
|
|
53251
|
+
}
|
|
53252
|
+
if (relation === comparableRelation && target.flags & 131068) {
|
|
53253
|
+
var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
|
|
53254
|
+
if (constraints !== source.types) {
|
|
53255
|
+
source = getIntersectionType(constraints);
|
|
53256
|
+
if (!(source.flags & 2097152)) {
|
|
53257
|
+
return isRelatedTo(source, target, 1, false);
|
|
53258
|
+
}
|
|
53259
|
+
}
|
|
53260
|
+
}
|
|
53261
|
+
return someTypeRelatedToType(source, target, false, 1);
|
|
53262
|
+
}
|
|
53216
53263
|
function eachTypeRelatedToSomeType(source, target) {
|
|
53217
53264
|
var result = -1;
|
|
53218
53265
|
var sourceTypes = source.types;
|
|
@@ -53249,7 +53296,9 @@ var ts;
|
|
|
53249
53296
|
}
|
|
53250
53297
|
if (reportErrors) {
|
|
53251
53298
|
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
|
|
53252
|
-
|
|
53299
|
+
if (bestMatchingType) {
|
|
53300
|
+
isRelatedTo(source, bestMatchingType, 2, true);
|
|
53301
|
+
}
|
|
53253
53302
|
}
|
|
53254
53303
|
return 0;
|
|
53255
53304
|
}
|
|
@@ -53357,7 +53406,7 @@ var ts;
|
|
|
53357
53406
|
if (overflow) {
|
|
53358
53407
|
return 0;
|
|
53359
53408
|
}
|
|
53360
|
-
var keyIntersectionState = intersectionState | (inPropertyCheck ?
|
|
53409
|
+
var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 : 0);
|
|
53361
53410
|
var id = getRelationKey(source, target, keyIntersectionState, relation, false);
|
|
53362
53411
|
var entry = relation.get(id);
|
|
53363
53412
|
if (entry !== undefined) {
|
|
@@ -53418,6 +53467,7 @@ var ts;
|
|
|
53418
53467
|
return originalHandler(onlyUnreliable);
|
|
53419
53468
|
};
|
|
53420
53469
|
}
|
|
53470
|
+
var result;
|
|
53421
53471
|
if (expandingFlags === 3) {
|
|
53422
53472
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "recursiveTypeRelatedTo_DepthLimit", {
|
|
53423
53473
|
sourceId: source.id,
|
|
@@ -53427,8 +53477,13 @@ var ts;
|
|
|
53427
53477
|
depth: sourceDepth,
|
|
53428
53478
|
targetDepth: targetDepth
|
|
53429
53479
|
});
|
|
53480
|
+
result = 3;
|
|
53481
|
+
}
|
|
53482
|
+
else {
|
|
53483
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
|
53484
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
|
|
53485
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
53430
53486
|
}
|
|
53431
|
-
var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3;
|
|
53432
53487
|
if (outofbandVarianceMarkerHandler) {
|
|
53433
53488
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
53434
53489
|
}
|
|
@@ -53456,74 +53511,73 @@ var ts;
|
|
|
53456
53511
|
return result;
|
|
53457
53512
|
}
|
|
53458
53513
|
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
|
|
53459
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
|
53460
|
-
var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
|
|
53461
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
53462
|
-
return result;
|
|
53463
|
-
}
|
|
53464
|
-
function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
|
|
53465
53514
|
if (intersectionState & 4) {
|
|
53466
53515
|
return propertiesRelatedTo(source, target, reportErrors, undefined, 0);
|
|
53467
53516
|
}
|
|
53468
|
-
|
|
53469
|
-
|
|
53470
|
-
|
|
53471
|
-
|
|
53472
|
-
|
|
53473
|
-
|
|
53474
|
-
|
|
53475
|
-
|
|
53476
|
-
|
|
53477
|
-
|
|
53478
|
-
|
|
53479
|
-
}
|
|
53480
|
-
if (relation === comparableRelation && target.flags & 131068) {
|
|
53481
|
-
var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
|
|
53482
|
-
if (constraints !== source.types) {
|
|
53483
|
-
source = getIntersectionType(constraints);
|
|
53484
|
-
if (!(source.flags & 2097152)) {
|
|
53485
|
-
return isRelatedTo(source, target, 1, false);
|
|
53486
|
-
}
|
|
53517
|
+
var result;
|
|
53518
|
+
var originalErrorInfo;
|
|
53519
|
+
var varianceCheckFailed = false;
|
|
53520
|
+
var saveErrorInfo = captureErrorCalculationState();
|
|
53521
|
+
var sourceFlags = source.flags;
|
|
53522
|
+
var targetFlags = target.flags;
|
|
53523
|
+
if (relation === identityRelation) {
|
|
53524
|
+
if (sourceFlags & 3145728) {
|
|
53525
|
+
var result_8 = eachTypeRelatedToSomeType(source, target);
|
|
53526
|
+
if (result_8) {
|
|
53527
|
+
result_8 &= eachTypeRelatedToSomeType(target, source);
|
|
53487
53528
|
}
|
|
53529
|
+
return result_8;
|
|
53488
53530
|
}
|
|
53489
|
-
|
|
53490
|
-
}
|
|
53491
|
-
var flags = source.flags & target.flags;
|
|
53492
|
-
if (relation === identityRelation && !(flags & 524288)) {
|
|
53493
|
-
if (flags & 4194304) {
|
|
53531
|
+
if (sourceFlags & 4194304) {
|
|
53494
53532
|
return isRelatedTo(source.type, target.type, 3, false);
|
|
53495
53533
|
}
|
|
53496
|
-
|
|
53497
|
-
|
|
53498
|
-
|
|
53499
|
-
|
|
53500
|
-
return result_8;
|
|
53534
|
+
if (sourceFlags & 8388608) {
|
|
53535
|
+
if (result = isRelatedTo(source.objectType, target.objectType, 3, false)) {
|
|
53536
|
+
if (result &= isRelatedTo(source.indexType, target.indexType, 3, false)) {
|
|
53537
|
+
return result;
|
|
53501
53538
|
}
|
|
53502
53539
|
}
|
|
53503
53540
|
}
|
|
53504
|
-
if (
|
|
53541
|
+
if (sourceFlags & 16777216) {
|
|
53505
53542
|
if (source.root.isDistributive === target.root.isDistributive) {
|
|
53506
|
-
if (
|
|
53507
|
-
if (
|
|
53508
|
-
if (
|
|
53509
|
-
if (
|
|
53510
|
-
return
|
|
53543
|
+
if (result = isRelatedTo(source.checkType, target.checkType, 3, false)) {
|
|
53544
|
+
if (result &= isRelatedTo(source.extendsType, target.extendsType, 3, false)) {
|
|
53545
|
+
if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3, false)) {
|
|
53546
|
+
if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, false)) {
|
|
53547
|
+
return result;
|
|
53511
53548
|
}
|
|
53512
53549
|
}
|
|
53513
53550
|
}
|
|
53514
53551
|
}
|
|
53515
53552
|
}
|
|
53516
53553
|
}
|
|
53517
|
-
if (
|
|
53554
|
+
if (sourceFlags & 33554432) {
|
|
53518
53555
|
return isRelatedTo(source.substitute, target.substitute, 3, false);
|
|
53519
53556
|
}
|
|
53520
|
-
|
|
53557
|
+
if (!(sourceFlags & 524288)) {
|
|
53558
|
+
return 0;
|
|
53559
|
+
}
|
|
53521
53560
|
}
|
|
53522
|
-
|
|
53523
|
-
|
|
53524
|
-
|
|
53525
|
-
|
|
53526
|
-
|
|
53561
|
+
else if (sourceFlags & 3145728 || targetFlags & 3145728) {
|
|
53562
|
+
if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
|
|
53563
|
+
return result;
|
|
53564
|
+
}
|
|
53565
|
+
if (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576) {
|
|
53566
|
+
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
|
|
53567
|
+
if (constraint && everyType(constraint, function (c) { return c !== source; })) {
|
|
53568
|
+
if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
|
|
53569
|
+
resetErrorInfo(saveErrorInfo);
|
|
53570
|
+
return result;
|
|
53571
|
+
}
|
|
53572
|
+
}
|
|
53573
|
+
}
|
|
53574
|
+
if (!(sourceFlags & 465829888 ||
|
|
53575
|
+
sourceFlags & 524288 && targetFlags & 1048576 ||
|
|
53576
|
+
sourceFlags & 2097152 && targetFlags & (524288 | 1048576 | 465829888))) {
|
|
53577
|
+
return 0;
|
|
53578
|
+
}
|
|
53579
|
+
}
|
|
53580
|
+
if (sourceFlags & (524288 | 16777216) && source.aliasSymbol &&
|
|
53527
53581
|
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
|
|
53528
53582
|
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
|
|
53529
53583
|
var variances = getAliasVariances(source.aliasSymbol);
|
|
@@ -53539,7 +53593,7 @@ var ts;
|
|
|
53539
53593
|
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2))) {
|
|
53540
53594
|
return result;
|
|
53541
53595
|
}
|
|
53542
|
-
if (
|
|
53596
|
+
if (targetFlags & 262144) {
|
|
53543
53597
|
if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3)) {
|
|
53544
53598
|
if (!(getMappedTypeModifiers(source) & 4)) {
|
|
53545
53599
|
var templateType = getTemplateTypeFromMappedType(source);
|
|
@@ -53550,9 +53604,9 @@ var ts;
|
|
|
53550
53604
|
}
|
|
53551
53605
|
}
|
|
53552
53606
|
}
|
|
53553
|
-
else if (
|
|
53607
|
+
else if (targetFlags & 4194304) {
|
|
53554
53608
|
var targetType_1 = target.type;
|
|
53555
|
-
if (
|
|
53609
|
+
if (sourceFlags & 4194304) {
|
|
53556
53610
|
if (result = isRelatedTo(targetType_1, source.type, 3, false)) {
|
|
53557
53611
|
return result;
|
|
53558
53612
|
}
|
|
@@ -53588,8 +53642,8 @@ var ts;
|
|
|
53588
53642
|
}
|
|
53589
53643
|
}
|
|
53590
53644
|
}
|
|
53591
|
-
else if (
|
|
53592
|
-
if (
|
|
53645
|
+
else if (targetFlags & 8388608) {
|
|
53646
|
+
if (sourceFlags & 8388608) {
|
|
53593
53647
|
if (result = isRelatedTo(source.objectType, target.objectType, 3, reportErrors)) {
|
|
53594
53648
|
result &= isRelatedTo(source.indexType, target.indexType, 3, reportErrors);
|
|
53595
53649
|
}
|
|
@@ -53668,7 +53722,7 @@ var ts;
|
|
|
53668
53722
|
}
|
|
53669
53723
|
}
|
|
53670
53724
|
}
|
|
53671
|
-
else if (
|
|
53725
|
+
else if (targetFlags & 16777216) {
|
|
53672
53726
|
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
|
|
53673
53727
|
resetErrorInfo(saveErrorInfo);
|
|
53674
53728
|
return 3;
|
|
@@ -53686,8 +53740,8 @@ var ts;
|
|
|
53686
53740
|
}
|
|
53687
53741
|
}
|
|
53688
53742
|
}
|
|
53689
|
-
else if (
|
|
53690
|
-
if (
|
|
53743
|
+
else if (targetFlags & 134217728) {
|
|
53744
|
+
if (sourceFlags & 134217728) {
|
|
53691
53745
|
if (relation === comparableRelation) {
|
|
53692
53746
|
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 : -1;
|
|
53693
53747
|
}
|
|
@@ -53697,10 +53751,10 @@ var ts;
|
|
|
53697
53751
|
return -1;
|
|
53698
53752
|
}
|
|
53699
53753
|
}
|
|
53700
|
-
if (
|
|
53701
|
-
if (!(
|
|
53754
|
+
if (sourceFlags & 8650752) {
|
|
53755
|
+
if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
|
|
53702
53756
|
var constraint = getConstraintOfType(source);
|
|
53703
|
-
if (!constraint || (
|
|
53757
|
+
if (!constraint || (sourceFlags & 262144 && constraint.flags & 1)) {
|
|
53704
53758
|
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
|
|
53705
53759
|
resetErrorInfo(saveErrorInfo);
|
|
53706
53760
|
return result;
|
|
@@ -53710,7 +53764,7 @@ var ts;
|
|
|
53710
53764
|
resetErrorInfo(saveErrorInfo);
|
|
53711
53765
|
return result;
|
|
53712
53766
|
}
|
|
53713
|
-
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(
|
|
53767
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(targetFlags & sourceFlags & 262144), undefined, intersectionState)) {
|
|
53714
53768
|
resetErrorInfo(saveErrorInfo);
|
|
53715
53769
|
return result;
|
|
53716
53770
|
}
|
|
@@ -53725,14 +53779,14 @@ var ts;
|
|
|
53725
53779
|
}
|
|
53726
53780
|
}
|
|
53727
53781
|
}
|
|
53728
|
-
else if (
|
|
53782
|
+
else if (sourceFlags & 4194304) {
|
|
53729
53783
|
if (result = isRelatedTo(keyofConstraintType, target, 1, reportErrors)) {
|
|
53730
53784
|
resetErrorInfo(saveErrorInfo);
|
|
53731
53785
|
return result;
|
|
53732
53786
|
}
|
|
53733
53787
|
}
|
|
53734
|
-
else if (
|
|
53735
|
-
if (!(
|
|
53788
|
+
else if (sourceFlags & 134217728 && !(targetFlags & 524288)) {
|
|
53789
|
+
if (!(targetFlags & 134217728)) {
|
|
53736
53790
|
var constraint = getBaseConstraintOfType(source);
|
|
53737
53791
|
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1, reportErrors))) {
|
|
53738
53792
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -53740,8 +53794,8 @@ var ts;
|
|
|
53740
53794
|
}
|
|
53741
53795
|
}
|
|
53742
53796
|
}
|
|
53743
|
-
else if (
|
|
53744
|
-
if (
|
|
53797
|
+
else if (sourceFlags & 268435456) {
|
|
53798
|
+
if (targetFlags & 268435456 && source.symbol === target.symbol) {
|
|
53745
53799
|
if (result = isRelatedTo(source.type, target.type, 3, reportErrors)) {
|
|
53746
53800
|
resetErrorInfo(saveErrorInfo);
|
|
53747
53801
|
return result;
|
|
@@ -53755,12 +53809,12 @@ var ts;
|
|
|
53755
53809
|
}
|
|
53756
53810
|
}
|
|
53757
53811
|
}
|
|
53758
|
-
else if (
|
|
53812
|
+
else if (sourceFlags & 16777216) {
|
|
53759
53813
|
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
|
|
53760
53814
|
resetErrorInfo(saveErrorInfo);
|
|
53761
53815
|
return 3;
|
|
53762
53816
|
}
|
|
53763
|
-
if (
|
|
53817
|
+
if (targetFlags & 16777216) {
|
|
53764
53818
|
var sourceParams = source.root.inferTypeParameters;
|
|
53765
53819
|
var sourceExtends = source.extendsType;
|
|
53766
53820
|
var mapper = void 0;
|
|
@@ -53811,9 +53865,10 @@ var ts;
|
|
|
53811
53865
|
}
|
|
53812
53866
|
return 0;
|
|
53813
53867
|
}
|
|
53814
|
-
var sourceIsPrimitive = !!(
|
|
53868
|
+
var sourceIsPrimitive = !!(sourceFlags & 131068);
|
|
53815
53869
|
if (relation !== identityRelation) {
|
|
53816
53870
|
source = getApparentType(source);
|
|
53871
|
+
sourceFlags = source.flags;
|
|
53817
53872
|
}
|
|
53818
53873
|
else if (isGenericMappedType(source)) {
|
|
53819
53874
|
return 0;
|
|
@@ -53843,7 +53898,7 @@ var ts;
|
|
|
53843
53898
|
else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 16384 && !isEmptyObjectType(source)) {
|
|
53844
53899
|
return 0;
|
|
53845
53900
|
}
|
|
53846
|
-
if (
|
|
53901
|
+
if (sourceFlags & (524288 | 2097152) && targetFlags & 524288) {
|
|
53847
53902
|
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
|
|
53848
53903
|
result = propertiesRelatedTo(source, target, reportStructuralErrors, undefined, intersectionState);
|
|
53849
53904
|
if (result) {
|
|
@@ -53862,7 +53917,7 @@ var ts;
|
|
|
53862
53917
|
return result;
|
|
53863
53918
|
}
|
|
53864
53919
|
}
|
|
53865
|
-
if (
|
|
53920
|
+
if (sourceFlags & (524288 | 2097152) && targetFlags & 1048576) {
|
|
53866
53921
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 | 2097152 | 33554432);
|
|
53867
53922
|
if (objectOnlyTarget.flags & 1048576) {
|
|
53868
53923
|
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
@@ -54312,7 +54367,6 @@ var ts;
|
|
|
54312
54367
|
}
|
|
54313
54368
|
}
|
|
54314
54369
|
var result = -1;
|
|
54315
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
54316
54370
|
var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
54317
54371
|
var sourceObjectFlags = ts.getObjectFlags(source);
|
|
54318
54372
|
var targetObjectFlags = ts.getObjectFlags(target);
|
|
@@ -54344,6 +54398,7 @@ var ts;
|
|
|
54344
54398
|
else {
|
|
54345
54399
|
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
|
|
54346
54400
|
var t = targetSignatures_1[_i];
|
|
54401
|
+
var saveErrorInfo = captureErrorCalculationState();
|
|
54347
54402
|
var shouldElaborateErrors = reportErrors;
|
|
54348
54403
|
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
|
|
54349
54404
|
var s = sourceSignatures_1[_c];
|
|
@@ -54449,8 +54504,8 @@ var ts;
|
|
|
54449
54504
|
var indexInfos = getIndexInfosOfType(target);
|
|
54450
54505
|
var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
|
|
54451
54506
|
var result = -1;
|
|
54452
|
-
for (var _i = 0,
|
|
54453
|
-
var targetInfo =
|
|
54507
|
+
for (var _i = 0, indexInfos_5 = indexInfos; _i < indexInfos_5.length; _i++) {
|
|
54508
|
+
var targetInfo = indexInfos_5[_i];
|
|
54454
54509
|
var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 ? -1 :
|
|
54455
54510
|
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3, reportErrors) :
|
|
54456
54511
|
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
|
@@ -54959,10 +55014,10 @@ var ts;
|
|
|
54959
55014
|
if (!(ts.getObjectFlags(type) & 4) || !(ts.getObjectFlags(type.target) & 3)) {
|
|
54960
55015
|
return undefined;
|
|
54961
55016
|
}
|
|
54962
|
-
if (ts.getObjectFlags(type) &
|
|
54963
|
-
return ts.getObjectFlags(type) &
|
|
55017
|
+
if (ts.getObjectFlags(type) & 67108864) {
|
|
55018
|
+
return ts.getObjectFlags(type) & 134217728 ? type.cachedEquivalentBaseType : undefined;
|
|
54964
55019
|
}
|
|
54965
|
-
type.objectFlags |=
|
|
55020
|
+
type.objectFlags |= 67108864;
|
|
54966
55021
|
var target = type.target;
|
|
54967
55022
|
if (ts.getObjectFlags(target) & 1) {
|
|
54968
55023
|
var baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -54981,7 +55036,7 @@ var ts;
|
|
|
54981
55036
|
if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
|
|
54982
55037
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
|
|
54983
55038
|
}
|
|
54984
|
-
type.objectFlags |=
|
|
55039
|
+
type.objectFlags |= 134217728;
|
|
54985
55040
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
54986
55041
|
}
|
|
54987
55042
|
function isEmptyLiteralType(type) {
|
|
@@ -55578,7 +55633,7 @@ var ts;
|
|
|
55578
55633
|
var result = !!(type.flags & 465829888 ||
|
|
55579
55634
|
type.flags & 524288 && !isNonGenericTopLevelType(type) && (objectFlags & 4 && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
|
|
55580
55635
|
objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations ||
|
|
55581
|
-
objectFlags & (32 | 1024 | 8388608)) ||
|
|
55636
|
+
objectFlags & (32 | 1024 | 8388608 | 16777216)) ||
|
|
55582
55637
|
type.flags & 3145728 && !(type.flags & 1024) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
|
|
55583
55638
|
if (type.flags & 3899393) {
|
|
55584
55639
|
type.objectFlags |= 1048576 | (result ? 2097152 : 0);
|
|
@@ -56345,8 +56400,8 @@ var ts;
|
|
|
56345
56400
|
var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32) ? 8 : 0;
|
|
56346
56401
|
var indexInfos = getIndexInfosOfType(target);
|
|
56347
56402
|
if (isObjectTypeWithInferableIndex(source)) {
|
|
56348
|
-
for (var _i = 0,
|
|
56349
|
-
var targetInfo =
|
|
56403
|
+
for (var _i = 0, indexInfos_6 = indexInfos; _i < indexInfos_6.length; _i++) {
|
|
56404
|
+
var targetInfo = indexInfos_6[_i];
|
|
56350
56405
|
var propTypes = [];
|
|
56351
56406
|
for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
|
|
56352
56407
|
var prop = _b[_a];
|
|
@@ -56366,8 +56421,8 @@ var ts;
|
|
|
56366
56421
|
}
|
|
56367
56422
|
}
|
|
56368
56423
|
}
|
|
56369
|
-
for (var _e = 0,
|
|
56370
|
-
var targetInfo =
|
|
56424
|
+
for (var _e = 0, indexInfos_7 = indexInfos; _e < indexInfos_7.length; _e++) {
|
|
56425
|
+
var targetInfo = indexInfos_7[_e];
|
|
56371
56426
|
var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
|
|
56372
56427
|
if (sourceInfo) {
|
|
56373
56428
|
inferWithPriority(sourceInfo.type, targetInfo.type, priority);
|
|
@@ -57132,9 +57187,6 @@ var ts;
|
|
|
57132
57187
|
getUnionType(ts.map(type.types, mapper), 1, aliasSymbol, aliasTypeArguments) :
|
|
57133
57188
|
mapType(type, mapper);
|
|
57134
57189
|
}
|
|
57135
|
-
function getConstituentCount(type) {
|
|
57136
|
-
return type.flags & 1048576 ? type.types.length : 1;
|
|
57137
|
-
}
|
|
57138
57190
|
function extractTypesOfKind(type, kind) {
|
|
57139
57191
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
57140
57192
|
}
|
|
@@ -58479,7 +58531,7 @@ var ts;
|
|
|
58479
58531
|
var substituteConstraints = !(checkMode && checkMode & 2) &&
|
|
58480
58532
|
someType(type, isGenericTypeWithUnionConstraint) &&
|
|
58481
58533
|
(isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode));
|
|
58482
|
-
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;
|
|
58483
58535
|
}
|
|
58484
58536
|
function isExportOrExportExpression(location) {
|
|
58485
58537
|
return !!ts.findAncestor(location, function (n) {
|
|
@@ -61092,6 +61144,9 @@ var ts;
|
|
|
61092
61144
|
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
61093
61145
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
61094
61146
|
}
|
|
61147
|
+
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 134217728) {
|
|
61148
|
+
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
|
|
61149
|
+
}
|
|
61095
61150
|
}
|
|
61096
61151
|
else {
|
|
61097
61152
|
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
@@ -63327,6 +63382,72 @@ var ts;
|
|
|
63327
63382
|
return node.flags & 32 ? checkNonNullChain(node) :
|
|
63328
63383
|
getNonNullableType(checkExpression(node.expression));
|
|
63329
63384
|
}
|
|
63385
|
+
function checkExpressionWithTypeArguments(node) {
|
|
63386
|
+
checkGrammarExpressionWithTypeArguments(node);
|
|
63387
|
+
var exprType = node.kind === 227 ? checkExpression(node.expression) :
|
|
63388
|
+
ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) :
|
|
63389
|
+
checkExpression(node.exprName);
|
|
63390
|
+
var typeArguments = node.typeArguments;
|
|
63391
|
+
if (exprType === silentNeverType || isErrorType(exprType) || !ts.some(typeArguments)) {
|
|
63392
|
+
return exprType;
|
|
63393
|
+
}
|
|
63394
|
+
var hasSomeApplicableSignature = false;
|
|
63395
|
+
var nonApplicableType;
|
|
63396
|
+
var result = getInstantiatedType(exprType);
|
|
63397
|
+
var errorType = hasSomeApplicableSignature ? nonApplicableType : exprType;
|
|
63398
|
+
if (errorType) {
|
|
63399
|
+
diagnostics.add(ts.createDiagnosticForNodeArray(ts.getSourceFileOfNode(node), typeArguments, ts.Diagnostics.Type_0_has_no_signatures_for_which_the_type_argument_list_is_applicable, typeToString(errorType)));
|
|
63400
|
+
}
|
|
63401
|
+
return result;
|
|
63402
|
+
function getInstantiatedType(type) {
|
|
63403
|
+
var hasSignatures = false;
|
|
63404
|
+
var hasApplicableSignature = false;
|
|
63405
|
+
var result = getInstantiatedTypePart(type);
|
|
63406
|
+
hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature);
|
|
63407
|
+
if (hasSignatures && !hasApplicableSignature) {
|
|
63408
|
+
nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : (nonApplicableType = type);
|
|
63409
|
+
}
|
|
63410
|
+
return result;
|
|
63411
|
+
function getInstantiatedTypePart(type) {
|
|
63412
|
+
if (type.flags & 524288) {
|
|
63413
|
+
var resolved = resolveStructuredTypeMembers(type);
|
|
63414
|
+
var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
|
|
63415
|
+
var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
|
|
63416
|
+
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
63417
|
+
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
63418
|
+
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
63419
|
+
var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
63420
|
+
result_11.objectFlags |= 16777216;
|
|
63421
|
+
result_11.node = node;
|
|
63422
|
+
return result_11;
|
|
63423
|
+
}
|
|
63424
|
+
}
|
|
63425
|
+
else if (type.flags & 58982400) {
|
|
63426
|
+
var constraint = getBaseConstraintOfType(type);
|
|
63427
|
+
if (constraint) {
|
|
63428
|
+
var instantiated = getInstantiatedTypePart(constraint);
|
|
63429
|
+
if (instantiated !== constraint) {
|
|
63430
|
+
return instantiated;
|
|
63431
|
+
}
|
|
63432
|
+
}
|
|
63433
|
+
}
|
|
63434
|
+
else if (type.flags & 1048576) {
|
|
63435
|
+
return mapType(type, getInstantiatedType);
|
|
63436
|
+
}
|
|
63437
|
+
else if (type.flags & 2097152) {
|
|
63438
|
+
return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypePart));
|
|
63439
|
+
}
|
|
63440
|
+
return type;
|
|
63441
|
+
}
|
|
63442
|
+
}
|
|
63443
|
+
function getInstantiatedSignatures(signatures) {
|
|
63444
|
+
var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); });
|
|
63445
|
+
return ts.sameMap(applicableSignatures, function (sig) {
|
|
63446
|
+
var typeArgumentTypes = checkTypeArguments(sig, typeArguments, true);
|
|
63447
|
+
return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, ts.isInJSFile(sig.declaration)) : sig;
|
|
63448
|
+
});
|
|
63449
|
+
}
|
|
63450
|
+
}
|
|
63330
63451
|
function checkMetaProperty(node) {
|
|
63331
63452
|
checkGrammarMetaProperty(node);
|
|
63332
63453
|
if (node.keywordToken === 103) {
|
|
@@ -63643,19 +63764,20 @@ var ts;
|
|
|
63643
63764
|
if (links.type === unknownType) {
|
|
63644
63765
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
63645
63766
|
}
|
|
63646
|
-
assignBindingElementTypes(declaration.name);
|
|
63767
|
+
assignBindingElementTypes(declaration.name, links.type);
|
|
63647
63768
|
}
|
|
63648
63769
|
}
|
|
63649
63770
|
}
|
|
63650
|
-
function assignBindingElementTypes(pattern) {
|
|
63771
|
+
function assignBindingElementTypes(pattern, parentType) {
|
|
63651
63772
|
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
|
|
63652
63773
|
var element = _a[_i];
|
|
63653
63774
|
if (!ts.isOmittedExpression(element)) {
|
|
63775
|
+
var type = getBindingElementTypeFromParentType(element, parentType);
|
|
63654
63776
|
if (element.name.kind === 79) {
|
|
63655
|
-
getSymbolLinks(getSymbolOfNode(element)).type =
|
|
63777
|
+
getSymbolLinks(getSymbolOfNode(element)).type = type;
|
|
63656
63778
|
}
|
|
63657
63779
|
else {
|
|
63658
|
-
assignBindingElementTypes(element.name);
|
|
63780
|
+
assignBindingElementTypes(element.name, type);
|
|
63659
63781
|
}
|
|
63660
63782
|
}
|
|
63661
63783
|
}
|
|
@@ -64644,7 +64766,7 @@ var ts;
|
|
|
64644
64766
|
if (operator === 55 || operator === 56 || operator === 60) {
|
|
64645
64767
|
if (operator === 55) {
|
|
64646
64768
|
var parent = ts.walkUpParenthesizedExpressions(node.parent);
|
|
64647
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.left,
|
|
64769
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.left, ts.isIfStatement(parent) ? parent.thenStatement : undefined);
|
|
64648
64770
|
}
|
|
64649
64771
|
checkTruthinessOfType(leftType, node.left);
|
|
64650
64772
|
}
|
|
@@ -65107,8 +65229,8 @@ var ts;
|
|
|
65107
65229
|
return type;
|
|
65108
65230
|
}
|
|
65109
65231
|
function checkConditionalExpression(node, checkMode) {
|
|
65110
|
-
|
|
65111
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.condition,
|
|
65232
|
+
checkTruthinessExpression(node.condition);
|
|
65233
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.condition, node.whenTrue);
|
|
65112
65234
|
var type1 = checkExpression(node.whenTrue, checkMode);
|
|
65113
65235
|
var type2 = checkExpression(node.whenFalse, checkMode);
|
|
65114
65236
|
return getUnionType([type1, type2], 2);
|
|
@@ -65563,6 +65685,8 @@ var ts;
|
|
|
65563
65685
|
return checkAssertion(node);
|
|
65564
65686
|
case 229:
|
|
65565
65687
|
return checkNonNullAssertion(node);
|
|
65688
|
+
case 227:
|
|
65689
|
+
return checkExpressionWithTypeArguments(node);
|
|
65566
65690
|
case 230:
|
|
65567
65691
|
return checkMetaProperty(node);
|
|
65568
65692
|
case 214:
|
|
@@ -66645,12 +66769,12 @@ var ts;
|
|
|
66645
66769
|
case 264:
|
|
66646
66770
|
case 267:
|
|
66647
66771
|
case 266:
|
|
66648
|
-
var
|
|
66772
|
+
var result_12 = 0;
|
|
66649
66773
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
66650
66774
|
ts.forEach(target.declarations, function (d) {
|
|
66651
|
-
|
|
66775
|
+
result_12 |= getDeclarationSpaces(d);
|
|
66652
66776
|
});
|
|
66653
|
-
return
|
|
66777
|
+
return result_12;
|
|
66654
66778
|
case 253:
|
|
66655
66779
|
case 202:
|
|
66656
66780
|
case 255:
|
|
@@ -66850,26 +66974,24 @@ var ts;
|
|
|
66850
66974
|
if (returnType.flags & 1) {
|
|
66851
66975
|
return;
|
|
66852
66976
|
}
|
|
66977
|
+
var headMessage;
|
|
66853
66978
|
var expectedReturnType;
|
|
66854
|
-
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
|
|
66855
|
-
var errorInfo;
|
|
66856
66979
|
switch (node.parent.kind) {
|
|
66857
66980
|
case 256:
|
|
66981
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
|
|
66858
66982
|
var classSymbol = getSymbolOfNode(node.parent);
|
|
66859
66983
|
var classConstructorType = getTypeOfSymbol(classSymbol);
|
|
66860
66984
|
expectedReturnType = getUnionType([classConstructorType, voidType]);
|
|
66861
66985
|
break;
|
|
66862
|
-
case 163:
|
|
66863
|
-
expectedReturnType = voidType;
|
|
66864
|
-
errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
|
|
66865
|
-
break;
|
|
66866
66986
|
case 166:
|
|
66987
|
+
case 163:
|
|
66988
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
|
|
66867
66989
|
expectedReturnType = voidType;
|
|
66868
|
-
errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
|
|
66869
66990
|
break;
|
|
66870
66991
|
case 168:
|
|
66871
66992
|
case 171:
|
|
66872
66993
|
case 172:
|
|
66994
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
|
|
66873
66995
|
var methodType = getTypeOfNode(node.parent);
|
|
66874
66996
|
var descriptorType = createTypedPropertyDescriptorType(methodType);
|
|
66875
66997
|
expectedReturnType = getUnionType([descriptorType, voidType]);
|
|
@@ -66877,7 +66999,7 @@ var ts;
|
|
|
66877
66999
|
default:
|
|
66878
67000
|
return ts.Debug.fail();
|
|
66879
67001
|
}
|
|
66880
|
-
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage
|
|
67002
|
+
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
|
|
66881
67003
|
}
|
|
66882
67004
|
function markTypeNodeAsReferenced(node) {
|
|
66883
67005
|
markEntityNameOrEntityExpressionAsReference(node && ts.getEntityNameFromTypeNode(node));
|
|
@@ -67779,44 +67901,53 @@ var ts;
|
|
|
67779
67901
|
}
|
|
67780
67902
|
function checkIfStatement(node) {
|
|
67781
67903
|
checkGrammarStatementInAmbientContext(node);
|
|
67782
|
-
|
|
67783
|
-
checkTestingKnownTruthyCallableOrAwaitableType(node.expression,
|
|
67904
|
+
checkTruthinessExpression(node.expression);
|
|
67905
|
+
checkTestingKnownTruthyCallableOrAwaitableType(node.expression, node.thenStatement);
|
|
67784
67906
|
checkSourceElement(node.thenStatement);
|
|
67785
67907
|
if (node.thenStatement.kind === 235) {
|
|
67786
67908
|
error(node.thenStatement, ts.Diagnostics.The_body_of_an_if_statement_cannot_be_the_empty_statement);
|
|
67787
67909
|
}
|
|
67788
67910
|
checkSourceElement(node.elseStatement);
|
|
67789
67911
|
}
|
|
67790
|
-
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr,
|
|
67912
|
+
function checkTestingKnownTruthyCallableOrAwaitableType(condExpr, body) {
|
|
67791
67913
|
if (!strictNullChecks)
|
|
67792
67914
|
return;
|
|
67793
|
-
|
|
67794
|
-
|
|
67795
|
-
|
|
67796
|
-
|
|
67797
|
-
|
|
67798
|
-
|
|
67799
|
-
|
|
67800
|
-
|
|
67801
|
-
|
|
67802
|
-
|
|
67803
|
-
|
|
67804
|
-
|
|
67805
|
-
|
|
67806
|
-
|
|
67807
|
-
|
|
67808
|
-
|
|
67809
|
-
|
|
67810
|
-
|
|
67811
|
-
}
|
|
67812
|
-
var isUsed = testedSymbol && ts.isBinaryExpression(condExpr.parent) && isSymbolUsedInBinaryExpressionChain(condExpr.parent, testedSymbol)
|
|
67813
|
-
|| testedSymbol && body && isSymbolUsedInConditionBody(condExpr, body, testedNode, testedSymbol);
|
|
67814
|
-
if (!isUsed) {
|
|
67815
|
-
if (isPromise) {
|
|
67816
|
-
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;
|
|
67817
67933
|
}
|
|
67818
|
-
|
|
67819
|
-
|
|
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
|
+
}
|
|
67820
67951
|
}
|
|
67821
67952
|
}
|
|
67822
67953
|
}
|
|
@@ -68649,8 +68780,8 @@ var ts;
|
|
|
68649
68780
|
}
|
|
68650
68781
|
}
|
|
68651
68782
|
if (indexInfos.length > 1) {
|
|
68652
|
-
for (var _d = 0,
|
|
68653
|
-
var info =
|
|
68783
|
+
for (var _d = 0, indexInfos_8 = indexInfos; _d < indexInfos_8.length; _d++) {
|
|
68784
|
+
var info = indexInfos_8[_d];
|
|
68654
68785
|
checkIndexConstraintForIndexSignature(type, info);
|
|
68655
68786
|
}
|
|
68656
68787
|
}
|
|
@@ -68673,8 +68804,8 @@ var ts;
|
|
|
68673
68804
|
error(errorNode, ts.Diagnostics.Property_0_of_type_1_is_not_assignable_to_2_index_type_3, symbolToString(prop), typeToString(propType), typeToString(info.keyType), typeToString(info.type));
|
|
68674
68805
|
}
|
|
68675
68806
|
};
|
|
68676
|
-
for (var _i = 0,
|
|
68677
|
-
var info =
|
|
68807
|
+
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
68808
|
+
var info = indexInfos_9[_i];
|
|
68678
68809
|
_loop_27(info);
|
|
68679
68810
|
}
|
|
68680
68811
|
}
|
|
@@ -68693,8 +68824,8 @@ var ts;
|
|
|
68693
68824
|
error(errorNode, ts.Diagnostics._0_index_type_1_is_not_assignable_to_2_index_type_3, typeToString(checkInfo.keyType), typeToString(checkInfo.type), typeToString(info.keyType), typeToString(info.type));
|
|
68694
68825
|
}
|
|
68695
68826
|
};
|
|
68696
|
-
for (var _i = 0,
|
|
68697
|
-
var info =
|
|
68827
|
+
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
68828
|
+
var info = indexInfos_10[_i];
|
|
68698
68829
|
_loop_28(info);
|
|
68699
68830
|
}
|
|
68700
68831
|
}
|
|
@@ -68738,9 +68869,9 @@ var ts;
|
|
|
68738
68869
|
var containsArguments = containsArgumentsReference(node);
|
|
68739
68870
|
if (containsArguments) {
|
|
68740
68871
|
var lastJSDocParam = ts.lastOrUndefined(jsdocParameters);
|
|
68741
|
-
if (lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
68872
|
+
if (isJs && lastJSDocParam && ts.isIdentifier(lastJSDocParam.name) && lastJSDocParam.typeExpression &&
|
|
68742
68873
|
lastJSDocParam.typeExpression.type && !parameters.has(lastJSDocParam.name.escapedText) && !isArrayType(getTypeFromTypeNode(lastJSDocParam.typeExpression.type))) {
|
|
68743
|
-
|
|
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));
|
|
68744
68875
|
}
|
|
68745
68876
|
}
|
|
68746
68877
|
else {
|
|
@@ -68750,7 +68881,9 @@ var ts;
|
|
|
68750
68881
|
return;
|
|
68751
68882
|
}
|
|
68752
68883
|
if (ts.isQualifiedName(name)) {
|
|
68753
|
-
|
|
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
|
+
}
|
|
68754
68887
|
}
|
|
68755
68888
|
else {
|
|
68756
68889
|
errorOrSuggestion(isJs, name, ts.Diagnostics.JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name, ts.idText(name));
|
|
@@ -70184,10 +70317,10 @@ var ts;
|
|
|
70184
70317
|
if (id === "__export") {
|
|
70185
70318
|
return;
|
|
70186
70319
|
}
|
|
70187
|
-
if (flags & (1920 |
|
|
70320
|
+
if (flags & (1920 | 384)) {
|
|
70188
70321
|
return;
|
|
70189
70322
|
}
|
|
70190
|
-
var exportedDeclarationsCount = ts.countWhere(declarations, isNotOverloadAndNotAccessor);
|
|
70323
|
+
var exportedDeclarationsCount = ts.countWhere(declarations, ts.and(isNotOverloadAndNotAccessor, ts.not(ts.isInterfaceDeclaration)));
|
|
70191
70324
|
if (flags & 524288 && exportedDeclarationsCount <= 2) {
|
|
70192
70325
|
return;
|
|
70193
70326
|
}
|
|
@@ -71662,13 +71795,13 @@ var ts;
|
|
|
71662
71795
|
var fileToDirective;
|
|
71663
71796
|
if (resolvedTypeReferenceDirectives) {
|
|
71664
71797
|
fileToDirective = new ts.Map();
|
|
71665
|
-
resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) {
|
|
71798
|
+
resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key, mode) {
|
|
71666
71799
|
if (!resolvedDirective || !resolvedDirective.resolvedFileName) {
|
|
71667
71800
|
return;
|
|
71668
71801
|
}
|
|
71669
71802
|
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
|
|
71670
71803
|
if (file) {
|
|
71671
|
-
addReferencedFilesToTypeDirective(file, key);
|
|
71804
|
+
addReferencedFilesToTypeDirective(file, key, mode);
|
|
71672
71805
|
}
|
|
71673
71806
|
});
|
|
71674
71807
|
}
|
|
@@ -71846,16 +71979,16 @@ var ts;
|
|
|
71846
71979
|
}
|
|
71847
71980
|
return false;
|
|
71848
71981
|
}
|
|
71849
|
-
function addReferencedFilesToTypeDirective(file, key) {
|
|
71982
|
+
function addReferencedFilesToTypeDirective(file, key, mode) {
|
|
71850
71983
|
if (fileToDirective.has(file.path))
|
|
71851
71984
|
return;
|
|
71852
|
-
fileToDirective.set(file.path, key);
|
|
71985
|
+
fileToDirective.set(file.path, [key, mode]);
|
|
71853
71986
|
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
|
|
71854
|
-
var
|
|
71987
|
+
var _b = _a[_i], fileName = _b.fileName, resolutionMode = _b.resolutionMode;
|
|
71855
71988
|
var resolvedFile = ts.resolveTripleslashReference(fileName, file.fileName);
|
|
71856
71989
|
var referencedFile = host.getSourceFile(resolvedFile);
|
|
71857
71990
|
if (referencedFile) {
|
|
71858
|
-
addReferencedFilesToTypeDirective(referencedFile, key);
|
|
71991
|
+
addReferencedFilesToTypeDirective(referencedFile, key, resolutionMode || file.impliedNodeFormat);
|
|
71859
71992
|
}
|
|
71860
71993
|
}
|
|
71861
71994
|
}
|
|
@@ -73446,25 +73579,24 @@ var ts;
|
|
|
73446
73579
|
}
|
|
73447
73580
|
function findMostOverlappyType(source, unionTarget) {
|
|
73448
73581
|
var bestMatch;
|
|
73449
|
-
|
|
73450
|
-
|
|
73451
|
-
var
|
|
73452
|
-
|
|
73453
|
-
|
|
73454
|
-
|
|
73455
|
-
|
|
73456
|
-
|
|
73457
|
-
|
|
73458
|
-
|
|
73459
|
-
|
|
73460
|
-
|
|
73461
|
-
|
|
73582
|
+
if (!(source.flags & (131068 | 406847488))) {
|
|
73583
|
+
var matchingCount = 0;
|
|
73584
|
+
for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
|
|
73585
|
+
var target = _a[_i];
|
|
73586
|
+
if (!(target.flags & (131068 | 406847488))) {
|
|
73587
|
+
var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
|
|
73588
|
+
if (overlap.flags & 4194304) {
|
|
73589
|
+
return target;
|
|
73590
|
+
}
|
|
73591
|
+
else if (isUnitType(overlap) || overlap.flags & 1048576) {
|
|
73592
|
+
var len = overlap.flags & 1048576 ? ts.countWhere(overlap.types, isUnitType) : 1;
|
|
73593
|
+
if (len >= matchingCount) {
|
|
73594
|
+
bestMatch = target;
|
|
73595
|
+
matchingCount = len;
|
|
73596
|
+
}
|
|
73597
|
+
}
|
|
73462
73598
|
}
|
|
73463
73599
|
}
|
|
73464
|
-
else if (isUnitType(overlap) && 1 >= matchingCount) {
|
|
73465
|
-
bestMatch = target;
|
|
73466
|
-
matchingCount = 1;
|
|
73467
|
-
}
|
|
73468
73600
|
}
|
|
73469
73601
|
return bestMatch;
|
|
73470
73602
|
}
|
|
@@ -73789,7 +73921,7 @@ var ts;
|
|
|
73789
73921
|
return factory.updateConstructorTypeNode(node, nodesVisitor(node.modifiers, visitor, ts.isModifier), nodesVisitor(node.typeParameters, visitor, ts.isTypeParameterDeclaration), nodesVisitor(node.parameters, visitor, ts.isParameterDeclaration), nodeVisitor(node.type, visitor, ts.isTypeNode));
|
|
73790
73922
|
case 180:
|
|
73791
73923
|
ts.Debug.type(node);
|
|
73792
|
-
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName));
|
|
73924
|
+
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
73793
73925
|
case 181:
|
|
73794
73926
|
ts.Debug.type(node);
|
|
73795
73927
|
return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
|
|
@@ -76008,8 +76140,8 @@ var ts;
|
|
|
76008
76140
|
function generateClassElementDecorationExpressions(node, isStatic) {
|
|
76009
76141
|
var members = getDecoratedClassElements(node, isStatic);
|
|
76010
76142
|
var expressions;
|
|
76011
|
-
for (var _i = 0,
|
|
76012
|
-
var member =
|
|
76143
|
+
for (var _i = 0, members_8 = members; _i < members_8.length; _i++) {
|
|
76144
|
+
var member = members_8[_i];
|
|
76013
76145
|
var expression = generateClassElementDecorationExpression(node, member);
|
|
76014
76146
|
if (expression) {
|
|
76015
76147
|
if (!expressions) {
|
|
@@ -80146,8 +80278,8 @@ var ts;
|
|
|
80146
80278
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
80147
80279
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
80148
80280
|
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
80149
|
-
var
|
|
80150
|
-
return
|
|
80281
|
+
var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
80282
|
+
return result_13 && factory.createPropertyAssignment("children", result_13);
|
|
80151
80283
|
}
|
|
80152
80284
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
80153
80285
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -87148,7 +87280,7 @@ var ts;
|
|
|
87148
87280
|
var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal);
|
|
87149
87281
|
hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib;
|
|
87150
87282
|
collectReferences(sourceFile, refs);
|
|
87151
|
-
recordTypeReferenceDirectivesIfNecessary(sourceFile.typeReferenceDirectives);
|
|
87283
|
+
recordTypeReferenceDirectivesIfNecessary(ts.map(sourceFile.typeReferenceDirectives, function (ref) { return [ref.fileName, ref.resolutionMode]; }));
|
|
87152
87284
|
collectLibs(sourceFile, libs);
|
|
87153
87285
|
return sourceFile;
|
|
87154
87286
|
}
|
|
@@ -87202,9 +87334,10 @@ var ts;
|
|
|
87202
87334
|
return ts.map(ts.arrayFrom(libs.keys()), function (lib) { return ({ fileName: lib, pos: -1, end: -1 }); });
|
|
87203
87335
|
}
|
|
87204
87336
|
function getFileReferencesForUsedTypeReferences() {
|
|
87205
|
-
return necessaryTypeReferences ? ts.mapDefined(ts.arrayFrom(necessaryTypeReferences.keys()),
|
|
87337
|
+
return necessaryTypeReferences ? ts.mapDefined(ts.arrayFrom(necessaryTypeReferences.keys()), getFileReferenceForSpecifierModeTuple) : [];
|
|
87206
87338
|
}
|
|
87207
|
-
function
|
|
87339
|
+
function getFileReferenceForSpecifierModeTuple(_a) {
|
|
87340
|
+
var typeName = _a[0], mode = _a[1];
|
|
87208
87341
|
if (emittedImports) {
|
|
87209
87342
|
for (var _i = 0, emittedImports_1 = emittedImports; _i < emittedImports_1.length; _i++) {
|
|
87210
87343
|
var importStatement = emittedImports_1[_i];
|
|
@@ -87219,7 +87352,7 @@ var ts;
|
|
|
87219
87352
|
}
|
|
87220
87353
|
}
|
|
87221
87354
|
}
|
|
87222
|
-
return { fileName: typeName, pos: -1, end: -1 };
|
|
87355
|
+
return __assign({ fileName: typeName, pos: -1, end: -1 }, (mode ? { resolutionMode: mode } : undefined));
|
|
87223
87356
|
}
|
|
87224
87357
|
function mapReferencesIntoArray(references, outputFilePath) {
|
|
87225
87358
|
return function (file) {
|
|
@@ -87236,7 +87369,7 @@ var ts;
|
|
|
87236
87369
|
if (declFileName) {
|
|
87237
87370
|
var specifier = ts.moduleSpecifiers.getModuleSpecifier(options, currentSourceFile, ts.toPath(outputFilePath, host.getCurrentDirectory(), host.getCanonicalFileName), ts.toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName), host);
|
|
87238
87371
|
if (!ts.pathIsRelative(specifier)) {
|
|
87239
|
-
recordTypeReferenceDirectivesIfNecessary([specifier]);
|
|
87372
|
+
recordTypeReferenceDirectivesIfNecessary([[specifier, undefined]]);
|
|
87240
87373
|
return;
|
|
87241
87374
|
}
|
|
87242
87375
|
var fileName = ts.getRelativePathToDirectoryOrUrl(outputFilePath, declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false);
|
|
@@ -90006,6 +90139,8 @@ var ts;
|
|
|
90006
90139
|
return emitAsExpression(node);
|
|
90007
90140
|
case 229:
|
|
90008
90141
|
return emitNonNullExpression(node);
|
|
90142
|
+
case 227:
|
|
90143
|
+
return emitExpressionWithTypeArguments(node);
|
|
90009
90144
|
case 230:
|
|
90010
90145
|
return emitMetaProperty(node);
|
|
90011
90146
|
case 231:
|
|
@@ -90399,6 +90534,7 @@ var ts;
|
|
|
90399
90534
|
writeKeyword("typeof");
|
|
90400
90535
|
writeSpace();
|
|
90401
90536
|
emit(node.exprName);
|
|
90537
|
+
emitTypeArguments(node, node.typeArguments);
|
|
90402
90538
|
}
|
|
90403
90539
|
function emitTypeLiteral(node) {
|
|
90404
90540
|
writePunctuation("{");
|
|
@@ -91871,9 +92007,12 @@ var ts;
|
|
|
91871
92007
|
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
|
|
91872
92008
|
var directive = types_24[_d];
|
|
91873
92009
|
var pos = writer.getTextPos();
|
|
91874
|
-
|
|
92010
|
+
var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
|
|
92011
|
+
? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
|
|
92012
|
+
: "";
|
|
92013
|
+
writeComment("/// <reference types=\"" + directive.fileName + "\" " + resolutionMode + "/>");
|
|
91875
92014
|
if (bundleFileInfo)
|
|
91876
|
-
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type", data: directive.fileName });
|
|
92015
|
+
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: !directive.resolutionMode ? "type" : directive.resolutionMode === ts.ModuleKind.ESNext ? "type-import" : "type-require", data: directive.fileName });
|
|
91877
92016
|
writeLine();
|
|
91878
92017
|
}
|
|
91879
92018
|
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
|
|
@@ -94179,7 +94318,7 @@ var ts;
|
|
|
94179
94318
|
return result;
|
|
94180
94319
|
}
|
|
94181
94320
|
ts.flattenDiagnosticMessageText = flattenDiagnosticMessageText;
|
|
94182
|
-
function
|
|
94321
|
+
function loadWithTypeDirectiveCache(names, containingFile, redirectedReference, containingFileMode, loader) {
|
|
94183
94322
|
if (names.length === 0) {
|
|
94184
94323
|
return [];
|
|
94185
94324
|
}
|
|
@@ -94188,18 +94327,25 @@ var ts;
|
|
|
94188
94327
|
for (var _i = 0, names_2 = names; _i < names_2.length; _i++) {
|
|
94189
94328
|
var name = names_2[_i];
|
|
94190
94329
|
var result = void 0;
|
|
94191
|
-
|
|
94192
|
-
|
|
94330
|
+
var mode = getModeForFileReference(name, containingFileMode);
|
|
94331
|
+
var strName = ts.isString(name) ? name : name.fileName.toLowerCase();
|
|
94332
|
+
var cacheKey = mode !== undefined ? mode + "|" + strName : strName;
|
|
94333
|
+
if (cache.has(cacheKey)) {
|
|
94334
|
+
result = cache.get(cacheKey);
|
|
94193
94335
|
}
|
|
94194
94336
|
else {
|
|
94195
|
-
cache.set(
|
|
94337
|
+
cache.set(cacheKey, result = loader(strName, containingFile, redirectedReference, mode));
|
|
94196
94338
|
}
|
|
94197
94339
|
resolutions.push(result);
|
|
94198
94340
|
}
|
|
94199
94341
|
return resolutions;
|
|
94200
94342
|
}
|
|
94201
|
-
ts.
|
|
94343
|
+
ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
|
|
94202
94344
|
;
|
|
94345
|
+
function getModeForFileReference(ref, containingFileMode) {
|
|
94346
|
+
return (ts.isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
94347
|
+
}
|
|
94348
|
+
ts.getModeForFileReference = getModeForFileReference;
|
|
94203
94349
|
function getModeForResolutionAtIndex(file, index) {
|
|
94204
94350
|
if (file.impliedNodeFormat === undefined)
|
|
94205
94351
|
return undefined;
|
|
@@ -94288,7 +94434,7 @@ var ts;
|
|
|
94288
94434
|
var _d, _e, _f, _g;
|
|
94289
94435
|
var file = ts.Debug.checkDefined(getSourceFileByPath(ref.file));
|
|
94290
94436
|
var kind = ref.kind, index = ref.index;
|
|
94291
|
-
var pos, end, packageId;
|
|
94437
|
+
var pos, end, packageId, resolutionMode;
|
|
94292
94438
|
switch (kind) {
|
|
94293
94439
|
case ts.FileIncludeKind.Import:
|
|
94294
94440
|
var importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
@@ -94302,8 +94448,8 @@ var ts;
|
|
|
94302
94448
|
(_a = file.referencedFiles[index], pos = _a.pos, end = _a.end);
|
|
94303
94449
|
break;
|
|
94304
94450
|
case ts.FileIncludeKind.TypeReferenceDirective:
|
|
94305
|
-
(_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end);
|
|
94306
|
-
packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), file.impliedNodeFormat)) === null || _g === void 0 ? void 0 : _g.packageId;
|
|
94451
|
+
(_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end, resolutionMode = _b.resolutionMode);
|
|
94452
|
+
packageId = (_g = (_f = file.resolvedTypeReferenceDirectiveNames) === null || _f === void 0 ? void 0 : _f.get(ts.toFileNameLowerCase(file.typeReferenceDirectives[index].fileName), resolutionMode || file.impliedNodeFormat)) === null || _g === void 0 ? void 0 : _g.packageId;
|
|
94307
94453
|
break;
|
|
94308
94454
|
case ts.FileIncludeKind.LibReferenceDirective:
|
|
94309
94455
|
(_c = file.libReferenceDirectives[index], pos = _c.pos, end = _c.end);
|
|
@@ -94509,7 +94655,7 @@ var ts;
|
|
|
94509
94655
|
var fileReasons = ts.createMultiMap();
|
|
94510
94656
|
var cachedBindAndCheckDiagnosticsForFile = {};
|
|
94511
94657
|
var cachedDeclarationDiagnosticsForFile = {};
|
|
94512
|
-
var resolvedTypeReferenceDirectives =
|
|
94658
|
+
var resolvedTypeReferenceDirectives = ts.createModeAwareCache();
|
|
94513
94659
|
var fileProcessingDiagnostics;
|
|
94514
94660
|
var maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
|
|
94515
94661
|
var currentNodeModulesDepth = 0;
|
|
@@ -94550,12 +94696,12 @@ var ts;
|
|
|
94550
94696
|
}
|
|
94551
94697
|
var actualResolveTypeReferenceDirectiveNamesWorker;
|
|
94552
94698
|
if (host.resolveTypeReferenceDirectives) {
|
|
94553
|
-
actualResolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference) { return host.resolveTypeReferenceDirectives(ts.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options); };
|
|
94699
|
+
actualResolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference, containingFileMode) { return host.resolveTypeReferenceDirectives(ts.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options, containingFileMode); };
|
|
94554
94700
|
}
|
|
94555
94701
|
else {
|
|
94556
94702
|
typeReferenceDirectiveResolutionCache = ts.createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, undefined, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
94557
|
-
var loader_2 = function (typesRef, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; };
|
|
94558
|
-
actualResolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference) { return
|
|
94703
|
+
var loader_2 = function (typesRef, containingFile, redirectedReference, resolutionMode) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache, resolutionMode).resolvedTypeReferenceDirective; };
|
|
94704
|
+
actualResolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference, containingFileMode) { return loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_2); };
|
|
94559
94705
|
}
|
|
94560
94706
|
var packageIdToSourceFile = new ts.Map();
|
|
94561
94707
|
var sourceFileToPackageName = new ts.Map();
|
|
@@ -94634,7 +94780,7 @@ var ts;
|
|
|
94634
94780
|
var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
|
|
94635
94781
|
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
|
|
94636
94782
|
for (var i = 0; i < typeReferences.length; i++) {
|
|
94637
|
-
processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
94783
|
+
processTypeReferenceDirective(typeReferences[i], undefined, resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
94638
94784
|
}
|
|
94639
94785
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
94640
94786
|
}
|
|
@@ -94782,9 +94928,10 @@ var ts;
|
|
|
94782
94928
|
return [];
|
|
94783
94929
|
var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;
|
|
94784
94930
|
var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined;
|
|
94931
|
+
var containingFileMode = !ts.isString(containingFile) ? containingFile.impliedNodeFormat : undefined;
|
|
94785
94932
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName });
|
|
94786
94933
|
ts.performance.mark("beforeResolveTypeReference");
|
|
94787
|
-
var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference);
|
|
94934
|
+
var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference, containingFileMode);
|
|
94788
94935
|
ts.performance.mark("afterResolveTypeReference");
|
|
94789
94936
|
ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference");
|
|
94790
94937
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -94861,15 +95008,15 @@ var ts;
|
|
|
94861
95008
|
}
|
|
94862
95009
|
var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
94863
95010
|
if (oldSourceFile !== file && file.resolvedModules) {
|
|
94864
|
-
var
|
|
95011
|
+
var result_14 = [];
|
|
94865
95012
|
var i = 0;
|
|
94866
95013
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
94867
95014
|
var moduleName = moduleNames_1[_i];
|
|
94868
95015
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
94869
95016
|
i++;
|
|
94870
|
-
|
|
95017
|
+
result_14.push(resolvedModule);
|
|
94871
95018
|
}
|
|
94872
|
-
return
|
|
95019
|
+
return result_14;
|
|
94873
95020
|
}
|
|
94874
95021
|
var unknownModuleNames;
|
|
94875
95022
|
var result;
|
|
@@ -95086,7 +95233,7 @@ var ts;
|
|
|
95086
95233
|
else {
|
|
95087
95234
|
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
|
|
95088
95235
|
}
|
|
95089
|
-
var typesReferenceDirectives =
|
|
95236
|
+
var typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
95090
95237
|
var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
|
|
95091
95238
|
var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
|
|
95092
95239
|
if (typeReferenceResolutionsChanged) {
|
|
@@ -96037,7 +96184,7 @@ var ts;
|
|
|
96037
96184
|
});
|
|
96038
96185
|
}
|
|
96039
96186
|
function processTypeReferenceDirectives(file) {
|
|
96040
|
-
var typeDirectives =
|
|
96187
|
+
var typeDirectives = file.typeReferenceDirectives;
|
|
96041
96188
|
if (!typeDirectives) {
|
|
96042
96189
|
return;
|
|
96043
96190
|
}
|
|
@@ -96047,16 +96194,20 @@ var ts;
|
|
|
96047
96194
|
var resolvedTypeReferenceDirective = resolutions[index];
|
|
96048
96195
|
var fileName = ts.toFileNameLowerCase(ref.fileName);
|
|
96049
96196
|
ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
|
|
96050
|
-
|
|
96197
|
+
var mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
96198
|
+
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
96199
|
+
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext));
|
|
96200
|
+
}
|
|
96201
|
+
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
|
|
96051
96202
|
}
|
|
96052
96203
|
}
|
|
96053
|
-
function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {
|
|
96204
|
+
function processTypeReferenceDirective(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) {
|
|
96054
96205
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "processTypeReferenceDirective", { directive: typeReferenceDirective, hasResolved: !!resolveModuleNamesReusingOldState, refKind: reason.kind, refPath: isReferencedFile(reason) ? reason.file : undefined });
|
|
96055
|
-
processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason);
|
|
96206
|
+
processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason);
|
|
96056
96207
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
96057
96208
|
}
|
|
96058
|
-
function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {
|
|
96059
|
-
var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective);
|
|
96209
|
+
function processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) {
|
|
96210
|
+
var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective, mode);
|
|
96060
96211
|
if (previousResolution && previousResolution.primary) {
|
|
96061
96212
|
return;
|
|
96062
96213
|
}
|
|
@@ -96089,7 +96240,7 @@ var ts;
|
|
|
96089
96240
|
addFilePreprocessingFileExplainingDiagnostic(undefined, reason, ts.Diagnostics.Cannot_find_type_definition_file_for_0, [typeReferenceDirective]);
|
|
96090
96241
|
}
|
|
96091
96242
|
if (saveResolution) {
|
|
96092
|
-
resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective);
|
|
96243
|
+
resolvedTypeReferenceDirectives.set(typeReferenceDirective, mode, resolvedTypeReferenceDirective);
|
|
96093
96244
|
}
|
|
96094
96245
|
}
|
|
96095
96246
|
function pathForLibFile(libFileName) {
|
|
@@ -98498,9 +98649,9 @@ var ts;
|
|
|
98498
98649
|
});
|
|
98499
98650
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
98500
98651
|
}
|
|
98501
|
-
function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) {
|
|
98652
|
+
function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference, _containingSourceFile, mode) {
|
|
98502
98653
|
var _a;
|
|
98503
|
-
var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference);
|
|
98654
|
+
var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
98504
98655
|
if (!resolutionHost.getGlobalCache) {
|
|
98505
98656
|
return primaryResult;
|
|
98506
98657
|
}
|
|
@@ -98515,12 +98666,12 @@ var ts;
|
|
|
98515
98666
|
}
|
|
98516
98667
|
return primaryResult;
|
|
98517
98668
|
}
|
|
98518
|
-
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference) {
|
|
98519
|
-
return ts.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache);
|
|
98669
|
+
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, _containingSourceFile, resolutionMode) {
|
|
98670
|
+
return ts.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache, resolutionMode);
|
|
98520
98671
|
}
|
|
98521
98672
|
function resolveNamesWithLocalCache(_a) {
|
|
98522
98673
|
var _b, _c, _d;
|
|
98523
|
-
var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges, containingSourceFile = _a.containingSourceFile;
|
|
98674
|
+
var names = _a.names, containingFile = _a.containingFile, redirectedReference = _a.redirectedReference, cache = _a.cache, perDirectoryCacheWithRedirects = _a.perDirectoryCacheWithRedirects, loader = _a.loader, getResolutionWithResolvedFileName = _a.getResolutionWithResolvedFileName, shouldRetryResolution = _a.shouldRetryResolution, reusedNames = _a.reusedNames, logChanges = _a.logChanges, containingSourceFile = _a.containingSourceFile, containingSourceFileMode = _a.containingSourceFileMode;
|
|
98524
98675
|
var path = resolutionHost.toPath(containingFile);
|
|
98525
98676
|
var resolutionsInFile = cache.get(path) || cache.set(path, ts.createModeAwareCache()).get(path);
|
|
98526
98677
|
var dirPath = ts.getDirectoryPath(path);
|
|
@@ -98541,8 +98692,10 @@ var ts;
|
|
|
98541
98692
|
var seenNamesInFile = ts.createModeAwareCache();
|
|
98542
98693
|
var i = 0;
|
|
98543
98694
|
for (var _i = 0, names_4 = names; _i < names_4.length; _i++) {
|
|
98544
|
-
var
|
|
98545
|
-
var
|
|
98695
|
+
var entry = names_4[_i];
|
|
98696
|
+
var name = ts.isString(entry) ? entry : entry.fileName.toLowerCase();
|
|
98697
|
+
var mode = !ts.isString(entry) ? ts.getModeForFileReference(entry, containingSourceFileMode) :
|
|
98698
|
+
containingSourceFile ? ts.getModeForResolutionAtIndex(containingSourceFile, i) : undefined;
|
|
98546
98699
|
i++;
|
|
98547
98700
|
var resolution = resolutionsInFile.get(name, mode);
|
|
98548
98701
|
if (!seenNamesInFile.has(name, mode) &&
|
|
@@ -98569,7 +98722,7 @@ var ts;
|
|
|
98569
98722
|
}
|
|
98570
98723
|
}
|
|
98571
98724
|
else {
|
|
98572
|
-
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
|
|
98725
|
+
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile, mode);
|
|
98573
98726
|
perDirectoryResolution.set(name, mode, resolution);
|
|
98574
98727
|
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
98575
98728
|
resolutionHost.onDiscoveredSymlink();
|
|
@@ -98631,7 +98784,7 @@ var ts;
|
|
|
98631
98784
|
return oldResult.resolvedFileName === newResult.resolvedFileName;
|
|
98632
98785
|
}
|
|
98633
98786
|
}
|
|
98634
|
-
function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) {
|
|
98787
|
+
function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode) {
|
|
98635
98788
|
return resolveNamesWithLocalCache({
|
|
98636
98789
|
names: typeDirectiveNames,
|
|
98637
98790
|
containingFile: containingFile,
|
|
@@ -98641,6 +98794,7 @@ var ts;
|
|
|
98641
98794
|
loader: resolveTypeReferenceDirective,
|
|
98642
98795
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
|
|
98643
98796
|
shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; },
|
|
98797
|
+
containingSourceFileMode: containingFileMode
|
|
98644
98798
|
});
|
|
98645
98799
|
}
|
|
98646
98800
|
function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, containingSourceFile) {
|
|
@@ -99232,9 +99386,9 @@ var ts;
|
|
|
99232
99386
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
99233
99387
|
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
99234
99388
|
if (!preferSymlinks) {
|
|
99235
|
-
var
|
|
99236
|
-
if (
|
|
99237
|
-
return
|
|
99389
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
99390
|
+
if (result_15)
|
|
99391
|
+
return result_15;
|
|
99238
99392
|
}
|
|
99239
99393
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
99240
99394
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -99253,10 +99407,10 @@ var ts;
|
|
|
99253
99407
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
99254
99408
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
99255
99409
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
99256
|
-
var
|
|
99410
|
+
var result_16 = cb(option, target === referenceRedirect);
|
|
99257
99411
|
shouldFilterIgnoredPaths = true;
|
|
99258
|
-
if (
|
|
99259
|
-
return
|
|
99412
|
+
if (result_16)
|
|
99413
|
+
return result_16;
|
|
99260
99414
|
}
|
|
99261
99415
|
});
|
|
99262
99416
|
});
|
|
@@ -100332,7 +100486,7 @@ var ts;
|
|
|
100332
100486
|
}
|
|
100333
100487
|
return host.resolveTypeReferenceDirectives.apply(host, args);
|
|
100334
100488
|
}) :
|
|
100335
|
-
(function (typeDirectiveNames, containingFile, redirectedReference) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference); });
|
|
100489
|
+
(function (typeDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode); });
|
|
100336
100490
|
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
100337
100491
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
100338
100492
|
synchronizeProgram();
|
|
@@ -100986,9 +101140,9 @@ var ts;
|
|
|
100986
101140
|
compilerHost.getModuleResolutionCache = function () { return moduleResolutionCache; };
|
|
100987
101141
|
}
|
|
100988
101142
|
if (!compilerHost.resolveTypeReferenceDirectives) {
|
|
100989
|
-
var loader_4 = function (moduleName, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; };
|
|
100990
|
-
compilerHost.resolveTypeReferenceDirectives = function (typeReferenceDirectiveNames, containingFile, redirectedReference) {
|
|
100991
|
-
return ts.
|
|
101143
|
+
var loader_4 = function (moduleName, containingFile, redirectedReference, containingFileMode) { return ts.resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache, containingFileMode).resolvedTypeReferenceDirective; };
|
|
101144
|
+
compilerHost.resolveTypeReferenceDirectives = function (typeReferenceDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) {
|
|
101145
|
+
return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
|
|
100992
101146
|
};
|
|
100993
101147
|
}
|
|
100994
101148
|
var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
|
|
@@ -102637,7 +102791,7 @@ var ts;
|
|
|
102637
102791
|
example(["tsc --noEmit", "tsc --target esnext"], ts.Diagnostics.Compiles_the_current_project_with_additional_settings);
|
|
102638
102792
|
var cliCommands = simpleOptions.filter(function (opt) { return opt.isCommandLineOnly || opt.category === ts.Diagnostics.Command_line_Options; });
|
|
102639
102793
|
var configOpts = simpleOptions.filter(function (opt) { return !ts.contains(cliCommands, opt); });
|
|
102640
|
-
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);
|
|
102641
102795
|
for (var _i = 0, output_1 = output; _i < output_1.length; _i++) {
|
|
102642
102796
|
var line = output_1[_i];
|
|
102643
102797
|
sys.write(line);
|
|
@@ -102653,7 +102807,7 @@ var ts;
|
|
|
102653
102807
|
}
|
|
102654
102808
|
function printAllHelp(sys, compilerOptions, buildOptions, watchOptions) {
|
|
102655
102809
|
var output = __spreadArray([], getHeader(sys, ts.getDiagnosticText(ts.Diagnostics.tsc_Colon_The_TypeScript_Compiler) + " - " + ts.getDiagnosticText(ts.Diagnostics.Version_0, ts.version)), true);
|
|
102656
|
-
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);
|
|
102657
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);
|
|
102658
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);
|
|
102659
102813
|
for (var _i = 0, output_2 = output; _i < output_2.length; _i++) {
|
|
@@ -103102,7 +103256,7 @@ var ts;
|
|
|
103102
103256
|
sys.writeFile(file, ts.generateTSConfig(options, fileNames, sys.newLine));
|
|
103103
103257
|
var output = __spreadArray([sys.newLine], getHeader(sys, "Created a new tsconfig.json with:"), true);
|
|
103104
103258
|
output.push(ts.getCompilerOptionsDiffValue(options, sys.newLine) + sys.newLine + sys.newLine);
|
|
103105
|
-
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);
|
|
103106
103260
|
for (var _i = 0, output_4 = output; _i < output_4.length; _i++) {
|
|
103107
103261
|
var line = output_4[_i];
|
|
103108
103262
|
sys.write(line);
|