typescript 4.6.0-dev.20220211 → 4.7.0-dev.20220217
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 +9 -3
- package/lib/de/diagnosticMessages.generated.json +9 -3
- package/lib/es/diagnosticMessages.generated.json +9 -3
- package/lib/fr/diagnosticMessages.generated.json +9 -3
- package/lib/it/diagnosticMessages.generated.json +9 -3
- package/lib/ja/diagnosticMessages.generated.json +9 -3
- package/lib/ko/diagnosticMessages.generated.json +9 -3
- package/lib/lib.es2020.intl.d.ts +4 -0
- package/lib/lib.esnext.intl.d.ts +4 -1
- package/lib/pl/diagnosticMessages.generated.json +9 -3
- package/lib/protocol.d.ts +7 -0
- package/lib/pt-br/diagnosticMessages.generated.json +9 -3
- package/lib/ru/diagnosticMessages.generated.json +9 -3
- package/lib/tr/diagnosticMessages.generated.json +9 -3
- package/lib/tsc.js +658 -490
- package/lib/tsserver.js +883 -611
- package/lib/tsserverlibrary.d.ts +32 -26
- package/lib/tsserverlibrary.js +883 -611
- package/lib/typescript.d.ts +24 -25
- package/lib/typescript.js +881 -609
- package/lib/typescriptServices.d.ts +24 -25
- package/lib/typescriptServices.js +881 -609
- package/lib/typingsInstaller.js +788 -593
- package/lib/zh-cn/diagnosticMessages.generated.json +9 -3
- package/lib/zh-tw/diagnosticMessages.generated.json +9 -3
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -68,8 +68,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
68
68
|
};
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
|
-
ts.versionMajorMinor = "4.
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
71
|
+
ts.versionMajorMinor = "4.7";
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220217";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
75
|
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
@@ -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
|
},
|
|
@@ -4885,18 +4886,6 @@ var ts;
|
|
|
4885
4886
|
return getCanonicalFileName(nonCanonicalizedPath);
|
|
4886
4887
|
}
|
|
4887
4888
|
ts.toPath = toPath;
|
|
4888
|
-
function normalizePathAndParts(path) {
|
|
4889
|
-
path = normalizeSlashes(path);
|
|
4890
|
-
var _a = reducePathComponents(getPathComponents(path)), root = _a[0], parts = _a.slice(1);
|
|
4891
|
-
if (parts.length) {
|
|
4892
|
-
var joinedParts = root + parts.join(ts.directorySeparator);
|
|
4893
|
-
return { path: hasTrailingDirectorySeparator(path) ? ensureTrailingDirectorySeparator(joinedParts) : joinedParts, parts: parts };
|
|
4894
|
-
}
|
|
4895
|
-
else {
|
|
4896
|
-
return { path: root, parts: parts };
|
|
4897
|
-
}
|
|
4898
|
-
}
|
|
4899
|
-
ts.normalizePathAndParts = normalizePathAndParts;
|
|
4900
4889
|
function removeTrailingDirectorySeparator(path) {
|
|
4901
4890
|
if (hasTrailingDirectorySeparator(path)) {
|
|
4902
4891
|
return path.substr(0, path.length - 1);
|
|
@@ -5295,6 +5284,8 @@ var ts;
|
|
|
5295
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."),
|
|
5296
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."),
|
|
5297
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'."),
|
|
5298
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."),
|
|
5299
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."),
|
|
5300
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."),
|
|
@@ -5363,7 +5354,6 @@ var ts;
|
|
|
5363
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 `}`?"),
|
|
5364
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 `>`?"),
|
|
5365
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'."),
|
|
5366
|
-
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."),
|
|
5367
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."),
|
|
5368
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."),
|
|
5369
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."),
|
|
@@ -5428,6 +5418,8 @@ var ts;
|
|
|
5428
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."),
|
|
5429
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"),
|
|
5430
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`."),
|
|
5431
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."),
|
|
5432
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."),
|
|
5433
5425
|
catch_or_finally_expected: diag(1472, ts.DiagnosticCategory.Error, "catch_or_finally_expected_1472", "'catch' or 'finally' expected."),
|
|
@@ -5747,6 +5739,7 @@ var ts;
|
|
|
5747
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."),
|
|
5748
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"),
|
|
5749
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."),
|
|
5750
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."),
|
|
5751
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."),
|
|
5752
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."),
|
|
@@ -10103,6 +10096,7 @@ var ts;
|
|
|
10103
10096
|
case 110:
|
|
10104
10097
|
case 106:
|
|
10105
10098
|
case 229:
|
|
10099
|
+
case 227:
|
|
10106
10100
|
case 230:
|
|
10107
10101
|
case 100:
|
|
10108
10102
|
return true;
|
|
@@ -10708,7 +10702,10 @@ var ts;
|
|
|
10708
10702
|
ts.Debug.assert(names.length === newResolutions.length);
|
|
10709
10703
|
for (var i = 0; i < names.length; i++) {
|
|
10710
10704
|
var newResolution = newResolutions[i];
|
|
10711
|
-
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);
|
|
10712
10709
|
var changed = oldResolution
|
|
10713
10710
|
? !newResolution || !comparer(oldResolution, newResolution)
|
|
10714
10711
|
: newResolution;
|
|
@@ -11628,7 +11625,7 @@ var ts;
|
|
|
11628
11625
|
case 114:
|
|
11629
11626
|
return node.parent.kind !== 216;
|
|
11630
11627
|
case 227:
|
|
11631
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
11628
|
+
return ts.isHeritageClause(node.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(node);
|
|
11632
11629
|
case 162:
|
|
11633
11630
|
return node.parent.kind === 194 || node.parent.kind === 189;
|
|
11634
11631
|
case 79:
|
|
@@ -11654,7 +11651,7 @@ var ts;
|
|
|
11654
11651
|
}
|
|
11655
11652
|
switch (parent.kind) {
|
|
11656
11653
|
case 227:
|
|
11657
|
-
return !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
11654
|
+
return ts.isHeritageClause(parent.parent) && !isExpressionWithTypeArgumentsInClassExtendsClause(parent);
|
|
11658
11655
|
case 162:
|
|
11659
11656
|
return node === parent.constraint;
|
|
11660
11657
|
case 342:
|
|
@@ -12293,7 +12290,7 @@ var ts;
|
|
|
12293
12290
|
case 296:
|
|
12294
12291
|
return true;
|
|
12295
12292
|
case 227:
|
|
12296
|
-
return parent.expression === node &&
|
|
12293
|
+
return parent.expression === node && !isPartOfTypeNode(parent);
|
|
12297
12294
|
case 295:
|
|
12298
12295
|
return parent.objectAssignmentInitializer === node;
|
|
12299
12296
|
default:
|
|
@@ -18279,15 +18276,17 @@ var ts;
|
|
|
18279
18276
|
function updateConstructorTypeNode2(node, typeParameters, parameters, type) {
|
|
18280
18277
|
return updateConstructorTypeNode1(node, node.modifiers, typeParameters, parameters, type);
|
|
18281
18278
|
}
|
|
18282
|
-
function createTypeQueryNode(exprName) {
|
|
18279
|
+
function createTypeQueryNode(exprName, typeArguments) {
|
|
18283
18280
|
var node = createBaseNode(180);
|
|
18284
18281
|
node.exprName = exprName;
|
|
18282
|
+
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
|
18285
18283
|
node.transformFlags = 1;
|
|
18286
18284
|
return node;
|
|
18287
18285
|
}
|
|
18288
|
-
function updateTypeQueryNode(node, exprName) {
|
|
18286
|
+
function updateTypeQueryNode(node, exprName, typeArguments) {
|
|
18289
18287
|
return node.exprName !== exprName
|
|
18290
|
-
|
|
18288
|
+
|| node.typeArguments !== typeArguments
|
|
18289
|
+
? update(createTypeQueryNode(exprName, typeArguments), node)
|
|
18291
18290
|
: node;
|
|
18292
18291
|
}
|
|
18293
18292
|
function createTypeLiteralNode(members) {
|
|
@@ -21479,7 +21478,13 @@ var ts;
|
|
|
21479
21478
|
referencedFiles = ts.append(referencedFiles, { pos: -1, end: -1, fileName: section.data });
|
|
21480
21479
|
break;
|
|
21481
21480
|
case "type":
|
|
21482
|
-
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 });
|
|
21483
21488
|
break;
|
|
21484
21489
|
case "lib":
|
|
21485
21490
|
libReferenceDirectives = ts.append(libReferenceDirectives, { pos: -1, end: -1, fileName: section.data });
|
|
@@ -21537,6 +21542,8 @@ var ts;
|
|
|
21537
21542
|
case "no-default-lib":
|
|
21538
21543
|
case "reference":
|
|
21539
21544
|
case "type":
|
|
21545
|
+
case "type-import":
|
|
21546
|
+
case "type-require":
|
|
21540
21547
|
case "lib":
|
|
21541
21548
|
syntheticReferences = ts.append(syntheticReferences, ts.setTextRange(ts.factory.createUnparsedSyntheticReference(section), section));
|
|
21542
21549
|
break;
|
|
@@ -24121,7 +24128,8 @@ var ts;
|
|
|
24121
24128
|
visitNode(cbNode, node.parameterName) ||
|
|
24122
24129
|
visitNode(cbNode, node.type);
|
|
24123
24130
|
case 180:
|
|
24124
|
-
return visitNode(cbNode, node.exprName)
|
|
24131
|
+
return visitNode(cbNode, node.exprName) ||
|
|
24132
|
+
visitNodes(cbNode, cbNodes, node.typeArguments);
|
|
24125
24133
|
case 181:
|
|
24126
24134
|
return visitNodes(cbNode, cbNodes, node.members);
|
|
24127
24135
|
case 182:
|
|
@@ -24677,7 +24685,7 @@ var ts;
|
|
|
24677
24685
|
function parseIsolatedEntityName(content, languageVersion) {
|
|
24678
24686
|
initializeState("", content, languageVersion, undefined, 1);
|
|
24679
24687
|
nextToken();
|
|
24680
|
-
var entityName = parseEntityName(true);
|
|
24688
|
+
var entityName = parseEntityName(true, false);
|
|
24681
24689
|
var isInvalid = token() === 1 && !parseDiagnostics.length;
|
|
24682
24690
|
clearState();
|
|
24683
24691
|
return isInvalid ? entityName : undefined;
|
|
@@ -25975,7 +25983,7 @@ var ts;
|
|
|
25975
25983
|
}
|
|
25976
25984
|
return createMissingList();
|
|
25977
25985
|
}
|
|
25978
|
-
function parseEntityName(allowReservedWords, diagnosticMessage) {
|
|
25986
|
+
function parseEntityName(allowReservedWords, allowPrivateIdentifiers, diagnosticMessage) {
|
|
25979
25987
|
var pos = getNodePos();
|
|
25980
25988
|
var entity = allowReservedWords ? parseIdentifierName(diagnosticMessage) : parseIdentifier(diagnosticMessage);
|
|
25981
25989
|
var dotPos = getNodePos();
|
|
@@ -25985,7 +25993,7 @@ var ts;
|
|
|
25985
25993
|
break;
|
|
25986
25994
|
}
|
|
25987
25995
|
dotPos = getNodePos();
|
|
25988
|
-
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords,
|
|
25996
|
+
entity = finishNode(factory.createQualifiedName(entity, parseRightSideOfDot(allowReservedWords, allowPrivateIdentifiers)), pos);
|
|
25989
25997
|
}
|
|
25990
25998
|
return entity;
|
|
25991
25999
|
}
|
|
@@ -26088,7 +26096,7 @@ var ts;
|
|
|
26088
26096
|
return finishNode(node, pos);
|
|
26089
26097
|
}
|
|
26090
26098
|
function parseEntityNameOfTypeReference() {
|
|
26091
|
-
return parseEntityName(true, ts.Diagnostics.Type_expected);
|
|
26099
|
+
return parseEntityName(true, false, ts.Diagnostics.Type_expected);
|
|
26092
26100
|
}
|
|
26093
26101
|
function parseTypeArgumentsOfTypeReference() {
|
|
26094
26102
|
if (!scanner.hasPrecedingLineBreak() && reScanLessThanToken() === 29) {
|
|
@@ -26202,7 +26210,9 @@ var ts;
|
|
|
26202
26210
|
function parseTypeQuery() {
|
|
26203
26211
|
var pos = getNodePos();
|
|
26204
26212
|
parseExpected(112);
|
|
26205
|
-
|
|
26213
|
+
var entityName = parseEntityName(true, true);
|
|
26214
|
+
var typeArguments = tryParseTypeArguments();
|
|
26215
|
+
return finishNode(factory.createTypeQueryNode(entityName, typeArguments), pos);
|
|
26206
26216
|
}
|
|
26207
26217
|
function parseTypeParameter() {
|
|
26208
26218
|
var pos = getNodePos();
|
|
@@ -27759,19 +27769,28 @@ var ts;
|
|
|
27759
27769
|
expression = parsePropertyAccessExpressionRest(pos, expression, questionDotToken);
|
|
27760
27770
|
continue;
|
|
27761
27771
|
}
|
|
27762
|
-
if (!questionDotToken && token() === 53 && !scanner.hasPrecedingLineBreak()) {
|
|
27763
|
-
nextToken();
|
|
27764
|
-
expression = finishNode(factory.createNonNullExpression(expression), pos);
|
|
27765
|
-
continue;
|
|
27766
|
-
}
|
|
27767
27772
|
if ((questionDotToken || !inDecoratorContext()) && parseOptional(22)) {
|
|
27768
27773
|
expression = parseElementAccessExpressionRest(pos, expression, questionDotToken);
|
|
27769
27774
|
continue;
|
|
27770
27775
|
}
|
|
27771
27776
|
if (isTemplateStartOfTaggedTemplate()) {
|
|
27772
|
-
expression =
|
|
27777
|
+
expression = !questionDotToken && expression.kind === 227 ?
|
|
27778
|
+
parseTaggedTemplateRest(pos, expression.expression, questionDotToken, expression.typeArguments) :
|
|
27779
|
+
parseTaggedTemplateRest(pos, expression, questionDotToken, undefined);
|
|
27773
27780
|
continue;
|
|
27774
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
|
+
}
|
|
27775
27794
|
return expression;
|
|
27776
27795
|
}
|
|
27777
27796
|
}
|
|
@@ -27791,27 +27810,24 @@ var ts;
|
|
|
27791
27810
|
function parseCallExpressionRest(pos, expression) {
|
|
27792
27811
|
while (true) {
|
|
27793
27812
|
expression = parseMemberExpressionRest(pos, expression, true);
|
|
27813
|
+
var typeArguments = void 0;
|
|
27794
27814
|
var questionDotToken = parseOptionalToken(28);
|
|
27795
|
-
if (
|
|
27796
|
-
|
|
27797
|
-
if (
|
|
27798
|
-
|
|
27799
|
-
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
27800
|
-
continue;
|
|
27801
|
-
}
|
|
27802
|
-
var argumentList = parseArgumentList();
|
|
27803
|
-
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
27804
|
-
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
27805
|
-
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
27806
|
-
expression = finishNode(callExpr, pos);
|
|
27815
|
+
if (questionDotToken) {
|
|
27816
|
+
typeArguments = tryParse(parseTypeArgumentsInExpression);
|
|
27817
|
+
if (isTemplateStartOfTaggedTemplate()) {
|
|
27818
|
+
expression = parseTaggedTemplateRest(pos, expression, questionDotToken, typeArguments);
|
|
27807
27819
|
continue;
|
|
27808
27820
|
}
|
|
27809
27821
|
}
|
|
27810
|
-
|
|
27822
|
+
if (typeArguments || token() === 20) {
|
|
27823
|
+
if (!questionDotToken && expression.kind === 227) {
|
|
27824
|
+
typeArguments = expression.typeArguments;
|
|
27825
|
+
expression = expression.expression;
|
|
27826
|
+
}
|
|
27811
27827
|
var argumentList = parseArgumentList();
|
|
27812
27828
|
var callExpr = questionDotToken || tryReparseOptionalChain(expression) ?
|
|
27813
|
-
factory.createCallChain(expression, questionDotToken,
|
|
27814
|
-
factory.createCallExpression(expression,
|
|
27829
|
+
factory.createCallChain(expression, questionDotToken, typeArguments, argumentList) :
|
|
27830
|
+
factory.createCallExpression(expression, typeArguments, argumentList);
|
|
27815
27831
|
expression = finishNode(callExpr, pos);
|
|
27816
27832
|
continue;
|
|
27817
27833
|
}
|
|
@@ -27841,16 +27857,16 @@ var ts;
|
|
|
27841
27857
|
if (!parseExpected(31)) {
|
|
27842
27858
|
return undefined;
|
|
27843
27859
|
}
|
|
27844
|
-
return typeArguments && canFollowTypeArgumentsInExpression()
|
|
27845
|
-
? typeArguments
|
|
27846
|
-
: undefined;
|
|
27860
|
+
return typeArguments && canFollowTypeArgumentsInExpression() ? typeArguments : undefined;
|
|
27847
27861
|
}
|
|
27848
27862
|
function canFollowTypeArgumentsInExpression() {
|
|
27849
27863
|
switch (token()) {
|
|
27850
27864
|
case 20:
|
|
27851
27865
|
case 14:
|
|
27852
27866
|
case 15:
|
|
27867
|
+
case 27:
|
|
27853
27868
|
case 24:
|
|
27869
|
+
case 28:
|
|
27854
27870
|
case 21:
|
|
27855
27871
|
case 23:
|
|
27856
27872
|
case 58:
|
|
@@ -27869,11 +27885,8 @@ var ts;
|
|
|
27869
27885
|
case 19:
|
|
27870
27886
|
case 1:
|
|
27871
27887
|
return true;
|
|
27872
|
-
case 27:
|
|
27873
|
-
case 18:
|
|
27874
|
-
default:
|
|
27875
|
-
return false;
|
|
27876
27888
|
}
|
|
27889
|
+
return false;
|
|
27877
27890
|
}
|
|
27878
27891
|
function parsePrimaryExpression() {
|
|
27879
27892
|
switch (token()) {
|
|
@@ -28037,26 +28050,14 @@ var ts;
|
|
|
28037
28050
|
return finishNode(factory.createMetaProperty(103, name), pos);
|
|
28038
28051
|
}
|
|
28039
28052
|
var expressionPos = getNodePos();
|
|
28040
|
-
var expression = parsePrimaryExpression();
|
|
28053
|
+
var expression = parseMemberExpressionRest(expressionPos, parsePrimaryExpression(), false);
|
|
28041
28054
|
var typeArguments;
|
|
28042
|
-
|
|
28043
|
-
|
|
28044
|
-
|
|
28045
|
-
if (isTemplateStartOfTaggedTemplate()) {
|
|
28046
|
-
ts.Debug.assert(!!typeArguments, "Expected a type argument list; all plain tagged template starts should be consumed in 'parseMemberExpressionRest'");
|
|
28047
|
-
expression = parseTaggedTemplateRest(expressionPos, expression, undefined, typeArguments);
|
|
28048
|
-
typeArguments = undefined;
|
|
28049
|
-
}
|
|
28050
|
-
break;
|
|
28051
|
-
}
|
|
28052
|
-
var argumentsArray;
|
|
28053
|
-
if (token() === 20) {
|
|
28054
|
-
argumentsArray = parseArgumentList();
|
|
28055
|
-
}
|
|
28056
|
-
else if (typeArguments) {
|
|
28057
|
-
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;
|
|
28058
28058
|
}
|
|
28059
|
-
|
|
28059
|
+
var argumentList = token() === 20 ? parseArgumentList() : undefined;
|
|
28060
|
+
return finishNode(factory.createNewExpression(expression, typeArguments, argumentList), pos);
|
|
28060
28061
|
}
|
|
28061
28062
|
function parseBlock(ignoreMissingOpenBrace, diagnosticMessage) {
|
|
28062
28063
|
var pos = getNodePos();
|
|
@@ -28213,11 +28214,12 @@ var ts;
|
|
|
28213
28214
|
}
|
|
28214
28215
|
function parseCaseClause() {
|
|
28215
28216
|
var pos = getNodePos();
|
|
28217
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
28216
28218
|
parseExpected(82);
|
|
28217
28219
|
var expression = allowInAnd(parseExpression);
|
|
28218
28220
|
parseExpected(58);
|
|
28219
28221
|
var statements = parseList(3, parseStatement);
|
|
28220
|
-
return finishNode(factory.createCaseClause(expression, statements), pos);
|
|
28222
|
+
return withJSDoc(finishNode(factory.createCaseClause(expression, statements), pos), hasJSDoc);
|
|
28221
28223
|
}
|
|
28222
28224
|
function parseDefaultClause() {
|
|
28223
28225
|
var pos = getNodePos();
|
|
@@ -29021,6 +29023,9 @@ var ts;
|
|
|
29021
29023
|
function parseExpressionWithTypeArguments() {
|
|
29022
29024
|
var pos = getNodePos();
|
|
29023
29025
|
var expression = parseLeftHandSideExpressionOrHigher();
|
|
29026
|
+
if (expression.kind === 227) {
|
|
29027
|
+
return expression;
|
|
29028
|
+
}
|
|
29024
29029
|
var typeArguments = tryParseTypeArguments();
|
|
29025
29030
|
return finishNode(factory.createExpressionWithTypeArguments(expression, typeArguments), pos);
|
|
29026
29031
|
}
|
|
@@ -29240,7 +29245,7 @@ var ts;
|
|
|
29240
29245
|
function parseModuleReference() {
|
|
29241
29246
|
return isExternalModuleReference()
|
|
29242
29247
|
? parseExternalModuleReference()
|
|
29243
|
-
: parseEntityName(false);
|
|
29248
|
+
: parseEntityName(false, false);
|
|
29244
29249
|
}
|
|
29245
29250
|
function parseExternalModuleReference() {
|
|
29246
29251
|
var pos = getNodePos();
|
|
@@ -29448,7 +29453,7 @@ var ts;
|
|
|
29448
29453
|
var pos = getNodePos();
|
|
29449
29454
|
var hasBrace = parseOptional(18);
|
|
29450
29455
|
var p2 = getNodePos();
|
|
29451
|
-
var entityName = parseEntityName(false);
|
|
29456
|
+
var entityName = parseEntityName(false, false);
|
|
29452
29457
|
while (token() === 80) {
|
|
29453
29458
|
reScanHashToken();
|
|
29454
29459
|
nextTokenJSDoc();
|
|
@@ -29850,7 +29855,7 @@ var ts;
|
|
|
29850
29855
|
skipWhitespace();
|
|
29851
29856
|
var p2 = getNodePos();
|
|
29852
29857
|
var name = ts.tokenIsIdentifierOrKeyword(token())
|
|
29853
|
-
? parseEntityName(true)
|
|
29858
|
+
? parseEntityName(true, false)
|
|
29854
29859
|
: undefined;
|
|
29855
29860
|
if (name) {
|
|
29856
29861
|
while (token() === 80) {
|
|
@@ -29875,11 +29880,13 @@ var ts;
|
|
|
29875
29880
|
&& nextTokenJSDoc() === 59
|
|
29876
29881
|
&& ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc())) {
|
|
29877
29882
|
var kind = scanner.getTokenValue();
|
|
29878
|
-
if (kind
|
|
29883
|
+
if (isJSDocLinkTag(kind))
|
|
29879
29884
|
return kind;
|
|
29880
|
-
}
|
|
29881
29885
|
}
|
|
29882
29886
|
}
|
|
29887
|
+
function isJSDocLinkTag(kind) {
|
|
29888
|
+
return kind === "link" || kind === "linkcode" || kind === "linkplain";
|
|
29889
|
+
}
|
|
29883
29890
|
function parseUnknownTag(start, tagName, indent, indentText) {
|
|
29884
29891
|
return finishNode(factory.createJSDocUnknownTag(tagName, parseTrailingTagComments(start, getNodePos(), indent, indentText)), start);
|
|
29885
29892
|
}
|
|
@@ -29982,7 +29989,7 @@ var ts;
|
|
|
29982
29989
|
}
|
|
29983
29990
|
function parseSeeTag(start, tagName, indent, indentText) {
|
|
29984
29991
|
var isMarkdownOrJSDocLink = token() === 22
|
|
29985
|
-
|| lookAhead(function () { return nextTokenJSDoc() === 59 && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && scanner.getTokenValue()
|
|
29992
|
+
|| lookAhead(function () { return nextTokenJSDoc() === 59 && ts.tokenIsIdentifierOrKeyword(nextTokenJSDoc()) && isJSDocLinkTag(scanner.getTokenValue()); });
|
|
29986
29993
|
var nameExpression = isMarkdownOrJSDocLink ? undefined : parseJSDocNameReference();
|
|
29987
29994
|
var comments = indent !== undefined && indentText !== undefined ? parseTrailingTagComments(start, getNodePos(), indent, indentText) : undefined;
|
|
29988
29995
|
return finishNode(factory.createJSDocSeeTag(tagName, nameExpression, comments), start);
|
|
@@ -30637,6 +30644,19 @@ var ts;
|
|
|
30637
30644
|
return ts.fileExtensionIsOneOf(fileName, [".d.ts", ".d.mts", ".d.cts"]);
|
|
30638
30645
|
}
|
|
30639
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
|
+
}
|
|
30640
30660
|
function processCommentPragmas(context, sourceText) {
|
|
30641
30661
|
var pragmas = [];
|
|
30642
30662
|
for (var _i = 0, _a = ts.getLeadingCommentRanges(sourceText, 0) || ts.emptyArray; _i < _a.length; _i++) {
|
|
@@ -30675,12 +30695,13 @@ var ts;
|
|
|
30675
30695
|
var typeReferenceDirectives_1 = context.typeReferenceDirectives;
|
|
30676
30696
|
var libReferenceDirectives_1 = context.libReferenceDirectives;
|
|
30677
30697
|
ts.forEach(ts.toArray(entryOrList), function (arg) {
|
|
30678
|
-
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"];
|
|
30679
30699
|
if (arg.arguments["no-default-lib"]) {
|
|
30680
30700
|
context.hasNoDefaultLib = true;
|
|
30681
30701
|
}
|
|
30682
30702
|
else if (types) {
|
|
30683
|
-
|
|
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 } : {})));
|
|
30684
30705
|
}
|
|
30685
30706
|
else if (lib) {
|
|
30686
30707
|
libReferenceDirectives_1.push({ pos: lib.pos, end: lib.end, fileName: lib.value });
|
|
@@ -33923,14 +33944,14 @@ var ts;
|
|
|
33923
33944
|
var useCaseSensitiveFileNames = typeof host.useCaseSensitiveFileNames === "function" ? host.useCaseSensitiveFileNames() : host.useCaseSensitiveFileNames;
|
|
33924
33945
|
return ts.comparePaths(path1, path2, !useCaseSensitiveFileNames) === 0;
|
|
33925
33946
|
}
|
|
33926
|
-
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache) {
|
|
33947
|
+
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, cache, resolutionMode) {
|
|
33927
33948
|
var traceEnabled = isTraceEnabled(options, host);
|
|
33928
33949
|
if (redirectedReference) {
|
|
33929
33950
|
options = redirectedReference.commandLine.options;
|
|
33930
33951
|
}
|
|
33931
33952
|
var containingDirectory = containingFile ? ts.getDirectoryPath(containingFile) : undefined;
|
|
33932
33953
|
var perFolderCache = containingDirectory ? cache && cache.getOrCreateCacheForDirectory(containingDirectory, redirectedReference) : undefined;
|
|
33933
|
-
var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName,
|
|
33954
|
+
var result = perFolderCache && perFolderCache.get(typeReferenceDirectiveName, resolutionMode);
|
|
33934
33955
|
if (result) {
|
|
33935
33956
|
if (traceEnabled) {
|
|
33936
33957
|
trace(host, ts.Diagnostics.Resolving_type_reference_directive_0_containing_file_1, typeReferenceDirectiveName, containingFile);
|
|
@@ -33965,7 +33986,11 @@ var ts;
|
|
|
33965
33986
|
}
|
|
33966
33987
|
var failedLookupLocations = [];
|
|
33967
33988
|
var features = getDefaultNodeResolutionFeatures(options);
|
|
33968
|
-
|
|
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 };
|
|
33969
33994
|
var resolved = primaryLookup();
|
|
33970
33995
|
var primary = true;
|
|
33971
33996
|
if (!resolved) {
|
|
@@ -33985,7 +34010,7 @@ var ts;
|
|
|
33985
34010
|
};
|
|
33986
34011
|
}
|
|
33987
34012
|
result = { resolvedTypeReferenceDirective: resolvedTypeReferenceDirective, failedLookupLocations: failedLookupLocations };
|
|
33988
|
-
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName,
|
|
34013
|
+
perFolderCache === null || perFolderCache === void 0 ? void 0 : perFolderCache.set(typeReferenceDirectiveName, resolutionMode, result);
|
|
33989
34014
|
if (traceEnabled)
|
|
33990
34015
|
traceResult(result);
|
|
33991
34016
|
return result;
|
|
@@ -34034,7 +34059,7 @@ var ts;
|
|
|
34034
34059
|
result_4 = searchResult && searchResult.value;
|
|
34035
34060
|
}
|
|
34036
34061
|
else {
|
|
34037
|
-
var candidate =
|
|
34062
|
+
var candidate = normalizePathForCJSResolution(initialLocationForSecondaryLookup, typeReferenceDirectiveName).path;
|
|
34038
34063
|
result_4 = nodeLoadModuleByRelativeName(Extensions.DtsOnly, candidate, false, moduleResolutionState, true);
|
|
34039
34064
|
}
|
|
34040
34065
|
return resolvedTypeScriptOnly(result_4);
|
|
@@ -34244,7 +34269,10 @@ var ts;
|
|
|
34244
34269
|
ts.Debug.assert(keys.length === values.length);
|
|
34245
34270
|
var map = createModeAwareCache();
|
|
34246
34271
|
for (var i = 0; i < keys.length; ++i) {
|
|
34247
|
-
|
|
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]);
|
|
34248
34276
|
}
|
|
34249
34277
|
return map;
|
|
34250
34278
|
}
|
|
@@ -34610,12 +34638,19 @@ var ts;
|
|
|
34610
34638
|
return { value: resolvedValue && { resolved: resolvedValue, isExternalLibraryImport: true } };
|
|
34611
34639
|
}
|
|
34612
34640
|
else {
|
|
34613
|
-
var _a =
|
|
34641
|
+
var _a = normalizePathForCJSResolution(containingDirectory, moduleName), candidate = _a.path, parts = _a.parts;
|
|
34614
34642
|
var resolved_2 = nodeLoadModuleByRelativeName(extensions, candidate, false, state, true);
|
|
34615
34643
|
return resolved_2 && toSearchResult({ resolved: resolved_2, isExternalLibraryImport: ts.contains(parts, "node_modules") });
|
|
34616
34644
|
}
|
|
34617
34645
|
}
|
|
34618
34646
|
}
|
|
34647
|
+
function normalizePathForCJSResolution(containingDirectory, moduleName) {
|
|
34648
|
+
var combined = ts.combinePaths(containingDirectory, moduleName);
|
|
34649
|
+
var parts = ts.getPathComponents(combined);
|
|
34650
|
+
var lastPart = ts.lastOrUndefined(parts);
|
|
34651
|
+
var path = lastPart === "." || lastPart === ".." ? ts.ensureTrailingDirectorySeparator(ts.normalizePath(combined)) : ts.normalizePath(combined);
|
|
34652
|
+
return { path: path, parts: parts };
|
|
34653
|
+
}
|
|
34619
34654
|
function realPath(path, host, traceEnabled) {
|
|
34620
34655
|
if (!host.realpath) {
|
|
34621
34656
|
return path;
|
|
@@ -34657,7 +34692,10 @@ var ts;
|
|
|
34657
34692
|
onlyRecordFailures = true;
|
|
34658
34693
|
}
|
|
34659
34694
|
}
|
|
34660
|
-
|
|
34695
|
+
if (!(state.features & NodeResolutionFeatures.EsmMode)) {
|
|
34696
|
+
return loadNodeModuleFromDirectory(extensions, candidate, onlyRecordFailures, state, considerPackageJson);
|
|
34697
|
+
}
|
|
34698
|
+
return undefined;
|
|
34661
34699
|
}
|
|
34662
34700
|
ts.nodeModulesPathPart = "/node_modules/";
|
|
34663
34701
|
function pathContainsNodeModules(path) {
|
|
@@ -34985,7 +35023,13 @@ var ts;
|
|
|
34985
35023
|
}
|
|
34986
35024
|
}
|
|
34987
35025
|
var nextExtensions = extensions === Extensions.DtsOnly ? Extensions.TypeScript : extensions;
|
|
34988
|
-
|
|
35026
|
+
var features = state.features;
|
|
35027
|
+
if ((jsonContent === null || jsonContent === void 0 ? void 0 : jsonContent.type) !== "module") {
|
|
35028
|
+
state.features &= ~NodeResolutionFeatures.EsmMode;
|
|
35029
|
+
}
|
|
35030
|
+
var result = nodeLoadModuleByRelativeName(nextExtensions, candidate, onlyRecordFailures, state, false);
|
|
35031
|
+
state.features = features;
|
|
35032
|
+
return result;
|
|
34989
35033
|
};
|
|
34990
35034
|
var onlyRecordFailuresForPackageFile = packageFile ? !ts.directoryProbablyExists(ts.getDirectoryPath(packageFile), state.host) : undefined;
|
|
34991
35035
|
var onlyRecordFailuresForIndex = onlyRecordFailures || !ts.directoryProbablyExists(candidate, state.host);
|
|
@@ -35314,6 +35358,12 @@ var ts;
|
|
|
35314
35358
|
}
|
|
35315
35359
|
var pathAndExtension = loadModuleFromFile(extensions, candidate, onlyRecordFailures, state) ||
|
|
35316
35360
|
loadNodeModuleFromDirectoryWorker(extensions, candidate, onlyRecordFailures, state, packageInfo && packageInfo.packageJsonContent, packageInfo && packageInfo.versionPaths);
|
|
35361
|
+
if (!pathAndExtension && packageInfo
|
|
35362
|
+
&& packageInfo.packageJsonContent.exports === undefined
|
|
35363
|
+
&& packageInfo.packageJsonContent.main === undefined
|
|
35364
|
+
&& state.features & NodeResolutionFeatures.EsmMode) {
|
|
35365
|
+
pathAndExtension = loadModuleFromFile(extensions, ts.combinePaths(candidate, "index.js"), onlyRecordFailures, state);
|
|
35366
|
+
}
|
|
35317
35367
|
return withPackageId(packageInfo, pathAndExtension);
|
|
35318
35368
|
};
|
|
35319
35369
|
if (rest !== "") {
|
|
@@ -41421,8 +41471,13 @@ var ts;
|
|
|
41421
41471
|
return res;
|
|
41422
41472
|
}
|
|
41423
41473
|
var candidates = ts.mapDefined(symbol.declarations, function (d) {
|
|
41424
|
-
if (!ts.isAmbientModule(d) && d.parent
|
|
41425
|
-
|
|
41474
|
+
if (!ts.isAmbientModule(d) && d.parent) {
|
|
41475
|
+
if (hasNonGlobalAugmentationExternalModuleSymbol(d.parent)) {
|
|
41476
|
+
return getSymbolOfNode(d.parent);
|
|
41477
|
+
}
|
|
41478
|
+
if (ts.isModuleBlock(d.parent) && d.parent.parent && resolveExternalModuleSymbol(getSymbolOfNode(d.parent.parent)) === symbol) {
|
|
41479
|
+
return getSymbolOfNode(d.parent.parent);
|
|
41480
|
+
}
|
|
41426
41481
|
}
|
|
41427
41482
|
if (ts.isClassExpression(d) && ts.isBinaryExpression(d.parent) && d.parent.operatorToken.kind === 63 && ts.isAccessExpression(d.parent.left) && ts.isEntityNameExpression(d.parent.left.expression)) {
|
|
41428
41483
|
if (ts.isModuleExportsAccessExpression(d.parent.left) || ts.isExportsIdentifier(d.parent.left.expression)) {
|
|
@@ -41880,7 +41935,7 @@ var ts;
|
|
|
41880
41935
|
function isEntityNameVisible(entityName, enclosingDeclaration) {
|
|
41881
41936
|
var meaning;
|
|
41882
41937
|
if (entityName.parent.kind === 180 ||
|
|
41883
|
-
ts.
|
|
41938
|
+
entityName.parent.kind === 227 && !ts.isPartOfTypeNode(entityName.parent) ||
|
|
41884
41939
|
entityName.parent.kind === 161) {
|
|
41885
41940
|
meaning = 111551 | 1048576;
|
|
41886
41941
|
}
|
|
@@ -41983,7 +42038,7 @@ var ts;
|
|
|
41983
42038
|
return flags & 814775659;
|
|
41984
42039
|
}
|
|
41985
42040
|
function isClassInstanceSide(type) {
|
|
41986
|
-
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)));
|
|
41987
42042
|
}
|
|
41988
42043
|
function createNodeBuilder() {
|
|
41989
42044
|
return {
|
|
@@ -45380,7 +45435,7 @@ var ts;
|
|
|
45380
45435
|
var result = createAnonymousType(initialSize !== members_4.size ? undefined : exportedType.symbol, members_4, exportedType.callSignatures, exportedType.constructSignatures, exportedType.indexInfos);
|
|
45381
45436
|
result.objectFlags |= (ts.getObjectFlags(type) & 8192);
|
|
45382
45437
|
if (result.symbol && result.symbol.flags & 32 && type === getDeclaredTypeOfClassOrInterface(result.symbol)) {
|
|
45383
|
-
result.objectFlags |=
|
|
45438
|
+
result.objectFlags |= 33554432;
|
|
45384
45439
|
}
|
|
45385
45440
|
return result;
|
|
45386
45441
|
}
|
|
@@ -47152,81 +47207,81 @@ var ts;
|
|
|
47152
47207
|
return ts.append(indexInfos, newInfo);
|
|
47153
47208
|
}
|
|
47154
47209
|
function resolveAnonymousTypeMembers(type) {
|
|
47155
|
-
var symbol = getMergedSymbol(type.symbol);
|
|
47156
47210
|
if (type.target) {
|
|
47157
47211
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47158
|
-
var
|
|
47212
|
+
var members_6 = createInstantiatedSymbolTable(getPropertiesOfObjectType(type.target), type.mapper, false);
|
|
47159
47213
|
var callSignatures = instantiateSignatures(getSignaturesOfType(type.target, 0), type.mapper);
|
|
47160
47214
|
var constructSignatures = instantiateSignatures(getSignaturesOfType(type.target, 1), type.mapper);
|
|
47161
|
-
var
|
|
47162
|
-
setStructuredTypeMembers(type,
|
|
47215
|
+
var indexInfos_1 = instantiateIndexInfos(getIndexInfosOfType(type.target), type.mapper);
|
|
47216
|
+
setStructuredTypeMembers(type, members_6, callSignatures, constructSignatures, indexInfos_1);
|
|
47217
|
+
return;
|
|
47163
47218
|
}
|
|
47164
|
-
|
|
47219
|
+
var symbol = getMergedSymbol(type.symbol);
|
|
47220
|
+
if (symbol.flags & 2048) {
|
|
47165
47221
|
setStructuredTypeMembers(type, emptySymbols, ts.emptyArray, ts.emptyArray, ts.emptyArray);
|
|
47166
|
-
var
|
|
47167
|
-
var callSignatures = getSignaturesOfSymbol(
|
|
47168
|
-
var constructSignatures = getSignaturesOfSymbol(
|
|
47169
|
-
var
|
|
47170
|
-
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;
|
|
47171
47228
|
}
|
|
47172
|
-
|
|
47173
|
-
|
|
47174
|
-
|
|
47175
|
-
|
|
47176
|
-
|
|
47177
|
-
|
|
47178
|
-
|
|
47179
|
-
|
|
47180
|
-
|
|
47181
|
-
|
|
47182
|
-
|
|
47183
|
-
|
|
47184
|
-
members = varsOnly_1;
|
|
47185
|
-
}
|
|
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;
|
|
47186
47241
|
}
|
|
47187
|
-
|
|
47188
|
-
|
|
47189
|
-
|
|
47190
|
-
|
|
47191
|
-
|
|
47192
|
-
|
|
47193
|
-
|
|
47194
|
-
|
|
47195
|
-
|
|
47196
|
-
else if (baseConstructorType === anyType) {
|
|
47197
|
-
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, false);
|
|
47198
|
-
}
|
|
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));
|
|
47199
47251
|
}
|
|
47200
|
-
|
|
47201
|
-
|
|
47202
|
-
indexInfos = getIndexInfosOfIndexSymbol(indexSymbol);
|
|
47252
|
+
else if (baseConstructorType === anyType) {
|
|
47253
|
+
baseConstructorIndexInfo = createIndexInfo(stringType, anyType, false);
|
|
47203
47254
|
}
|
|
47204
|
-
|
|
47205
|
-
|
|
47206
|
-
|
|
47207
|
-
|
|
47208
|
-
|
|
47209
|
-
|
|
47210
|
-
|
|
47211
|
-
|
|
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);
|
|
47212
47263
|
}
|
|
47213
|
-
|
|
47214
|
-
|
|
47215
|
-
|
|
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);
|
|
47216
47267
|
}
|
|
47217
|
-
|
|
47218
|
-
|
|
47219
|
-
|
|
47220
|
-
|
|
47221
|
-
|
|
47222
|
-
|
|
47223
|
-
|
|
47224
|
-
|
|
47225
|
-
|
|
47226
|
-
|
|
47227
|
-
|
|
47228
|
-
|
|
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; }));
|
|
47229
47280
|
}
|
|
47281
|
+
if (!constructSignatures.length) {
|
|
47282
|
+
constructSignatures = getDefaultConstructSignatures(classType_1);
|
|
47283
|
+
}
|
|
47284
|
+
type.constructSignatures = constructSignatures;
|
|
47230
47285
|
}
|
|
47231
47286
|
}
|
|
47232
47287
|
function replaceIndexedAccess(instantiable, type, replacement) {
|
|
@@ -48086,8 +48141,8 @@ var ts;
|
|
|
48086
48141
|
var stringIndexInfo;
|
|
48087
48142
|
var applicableInfo;
|
|
48088
48143
|
var applicableInfos;
|
|
48089
|
-
for (var _i = 0,
|
|
48090
|
-
var info =
|
|
48144
|
+
for (var _i = 0, indexInfos_3 = indexInfos; _i < indexInfos_3.length; _i++) {
|
|
48145
|
+
var info = indexInfos_3[_i];
|
|
48091
48146
|
if (info.keyType === stringType) {
|
|
48092
48147
|
stringIndexInfo = info;
|
|
48093
48148
|
}
|
|
@@ -48576,9 +48631,10 @@ var ts;
|
|
|
48576
48631
|
return signature;
|
|
48577
48632
|
}
|
|
48578
48633
|
function getOrCreateTypeFromSignature(signature) {
|
|
48634
|
+
var _a;
|
|
48579
48635
|
if (!signature.isolatedSignatureType) {
|
|
48580
|
-
var kind = signature.declaration ?
|
|
48581
|
-
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;
|
|
48582
48638
|
var type = createObjectType(16);
|
|
48583
48639
|
type.members = emptySymbols;
|
|
48584
48640
|
type.properties = ts.emptyArray;
|
|
@@ -48604,14 +48660,14 @@ var ts;
|
|
|
48604
48660
|
}
|
|
48605
48661
|
function getIndexInfosOfIndexSymbol(indexSymbol) {
|
|
48606
48662
|
if (indexSymbol.declarations) {
|
|
48607
|
-
var
|
|
48663
|
+
var indexInfos_4 = [];
|
|
48608
48664
|
var _loop_14 = function (declaration) {
|
|
48609
48665
|
if (declaration.parameters.length === 1) {
|
|
48610
48666
|
var parameter = declaration.parameters[0];
|
|
48611
48667
|
if (parameter.type) {
|
|
48612
48668
|
forEachType(getTypeFromTypeNode(parameter.type), function (keyType) {
|
|
48613
|
-
if (isValidIndexKeyType(keyType) && !findIndexInfo(
|
|
48614
|
-
|
|
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));
|
|
48615
48671
|
}
|
|
48616
48672
|
});
|
|
48617
48673
|
}
|
|
@@ -48621,7 +48677,7 @@ var ts;
|
|
|
48621
48677
|
var declaration = _a[_i];
|
|
48622
48678
|
_loop_14(declaration);
|
|
48623
48679
|
}
|
|
48624
|
-
return
|
|
48680
|
+
return indexInfos_4;
|
|
48625
48681
|
}
|
|
48626
48682
|
return ts.emptyArray;
|
|
48627
48683
|
}
|
|
@@ -49106,7 +49162,7 @@ var ts;
|
|
|
49106
49162
|
function getTypeFromTypeQueryNode(node) {
|
|
49107
49163
|
var links = getNodeLinks(node);
|
|
49108
49164
|
if (!links.resolvedType) {
|
|
49109
|
-
var type =
|
|
49165
|
+
var type = checkExpressionWithTypeArguments(node);
|
|
49110
49166
|
links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(type));
|
|
49111
49167
|
}
|
|
49112
49168
|
return links.resolvedType;
|
|
@@ -49415,7 +49471,7 @@ var ts;
|
|
|
49415
49471
|
}
|
|
49416
49472
|
}
|
|
49417
49473
|
var fixedLength = properties.length;
|
|
49418
|
-
var lengthSymbol = createSymbol(4, "length");
|
|
49474
|
+
var lengthSymbol = createSymbol(4, "length", readonly ? 8 : 0);
|
|
49419
49475
|
if (combinedFlags & 12) {
|
|
49420
49476
|
lengthSymbol.type = numberType;
|
|
49421
49477
|
}
|
|
@@ -51532,7 +51588,9 @@ var ts;
|
|
|
51532
51588
|
return result;
|
|
51533
51589
|
}
|
|
51534
51590
|
function getObjectTypeInstantiation(type, mapper, aliasSymbol, aliasTypeArguments) {
|
|
51535
|
-
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];
|
|
51536
51594
|
var links = getNodeLinks(declaration);
|
|
51537
51595
|
var target = type.objectFlags & 4 ? links.resolvedType :
|
|
51538
51596
|
type.objectFlags & 64 ? type.target : type;
|
|
@@ -51544,8 +51602,8 @@ var ts;
|
|
|
51544
51602
|
outerTypeParameters = ts.addRange(outerTypeParameters, templateTagParameters);
|
|
51545
51603
|
}
|
|
51546
51604
|
typeParameters = outerTypeParameters || ts.emptyArray;
|
|
51547
|
-
var allDeclarations_1 = type.objectFlags & 4 ? [declaration] : type.symbol.declarations;
|
|
51548
|
-
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 ?
|
|
51549
51607
|
ts.filter(typeParameters, function (tp) { return ts.some(allDeclarations_1, function (d) { return isTypeParameterPossiblyReferenced(tp, d); }); }) :
|
|
51550
51608
|
typeParameters;
|
|
51551
51609
|
links.outerTypeParameters = typeParameters;
|
|
@@ -51694,6 +51752,9 @@ var ts;
|
|
|
51694
51752
|
mapper = combineTypeMappers(makeUnaryTypeMapper(origTypeParameter, freshTypeParameter), mapper);
|
|
51695
51753
|
freshTypeParameter.mapper = mapper;
|
|
51696
51754
|
}
|
|
51755
|
+
if (type.objectFlags & 16777216) {
|
|
51756
|
+
result.node = type.node;
|
|
51757
|
+
}
|
|
51697
51758
|
result.target = type;
|
|
51698
51759
|
result.mapper = mapper;
|
|
51699
51760
|
result.aliasSymbol = aliasSymbol || type.aliasSymbol;
|
|
@@ -52592,9 +52653,9 @@ var ts;
|
|
|
52592
52653
|
isEnumTypeRelatedTo(getParentOfSymbol(source.symbol), getParentOfSymbol(target.symbol), errorReporter))
|
|
52593
52654
|
return true;
|
|
52594
52655
|
}
|
|
52595
|
-
if (s & 32768 && (!strictNullChecks || t & (32768 | 16384)))
|
|
52656
|
+
if (s & 32768 && (!strictNullChecks && !(t & 3145728) || t & (32768 | 16384)))
|
|
52596
52657
|
return true;
|
|
52597
|
-
if (s & 65536 && (!strictNullChecks || t & 65536))
|
|
52658
|
+
if (s & 65536 && (!strictNullChecks && !(t & 3145728) || t & 65536))
|
|
52598
52659
|
return true;
|
|
52599
52660
|
if (s & 524288 && t & 67108864)
|
|
52600
52661
|
return true;
|
|
@@ -52669,11 +52730,11 @@ var ts;
|
|
|
52669
52730
|
var overflow = false;
|
|
52670
52731
|
var overrideNextErrorInfo = 0;
|
|
52671
52732
|
var lastSkippedInfo;
|
|
52672
|
-
var incompatibleStack
|
|
52733
|
+
var incompatibleStack;
|
|
52673
52734
|
var inPropertyCheck = false;
|
|
52674
52735
|
ts.Debug.assert(relation !== identityRelation || !errorNode, "no error reporting in identity checking");
|
|
52675
52736
|
var result = isRelatedTo(source, target, 3, !!errorNode, headMessage);
|
|
52676
|
-
if (incompatibleStack
|
|
52737
|
+
if (incompatibleStack) {
|
|
52677
52738
|
reportIncompatibleStack();
|
|
52678
52739
|
}
|
|
52679
52740
|
if (overflow) {
|
|
@@ -52728,19 +52789,19 @@ var ts;
|
|
|
52728
52789
|
return {
|
|
52729
52790
|
errorInfo: errorInfo,
|
|
52730
52791
|
lastSkippedInfo: lastSkippedInfo,
|
|
52731
|
-
incompatibleStack: incompatibleStack.slice(),
|
|
52792
|
+
incompatibleStack: incompatibleStack === null || incompatibleStack === void 0 ? void 0 : incompatibleStack.slice(),
|
|
52732
52793
|
overrideNextErrorInfo: overrideNextErrorInfo,
|
|
52733
|
-
relatedInfo:
|
|
52794
|
+
relatedInfo: relatedInfo === null || relatedInfo === void 0 ? void 0 : relatedInfo.slice(),
|
|
52734
52795
|
};
|
|
52735
52796
|
}
|
|
52736
52797
|
function reportIncompatibleError(message, arg0, arg1, arg2, arg3) {
|
|
52737
52798
|
overrideNextErrorInfo++;
|
|
52738
52799
|
lastSkippedInfo = undefined;
|
|
52739
|
-
incompatibleStack.push([message, arg0, arg1, arg2, arg3]);
|
|
52800
|
+
(incompatibleStack || (incompatibleStack = [])).push([message, arg0, arg1, arg2, arg3]);
|
|
52740
52801
|
}
|
|
52741
52802
|
function reportIncompatibleStack() {
|
|
52742
|
-
var stack = incompatibleStack;
|
|
52743
|
-
incompatibleStack =
|
|
52803
|
+
var stack = incompatibleStack || [];
|
|
52804
|
+
incompatibleStack = undefined;
|
|
52744
52805
|
var info = lastSkippedInfo;
|
|
52745
52806
|
lastSkippedInfo = undefined;
|
|
52746
52807
|
if (stack.length === 1) {
|
|
@@ -52834,7 +52895,7 @@ var ts;
|
|
|
52834
52895
|
}
|
|
52835
52896
|
function reportError(message, arg0, arg1, arg2, arg3) {
|
|
52836
52897
|
ts.Debug.assert(!!errorNode);
|
|
52837
|
-
if (incompatibleStack
|
|
52898
|
+
if (incompatibleStack)
|
|
52838
52899
|
reportIncompatibleStack();
|
|
52839
52900
|
if (message.elidedInCompatabilityPyramid)
|
|
52840
52901
|
return;
|
|
@@ -52850,7 +52911,7 @@ var ts;
|
|
|
52850
52911
|
}
|
|
52851
52912
|
}
|
|
52852
52913
|
function reportRelationError(message, source, target) {
|
|
52853
|
-
if (incompatibleStack
|
|
52914
|
+
if (incompatibleStack)
|
|
52854
52915
|
reportIncompatibleStack();
|
|
52855
52916
|
var _a = getTypeNamesForErrorDisplay(source, target), sourceType = _a[0], targetType = _a[1];
|
|
52856
52917
|
var generalizedSource = source;
|
|
@@ -52941,7 +53002,9 @@ var ts;
|
|
|
52941
53002
|
if (isSimpleTypeRelatedTo(originalSource, originalTarget, relation, reportErrors ? reportError : undefined)) {
|
|
52942
53003
|
return -1;
|
|
52943
53004
|
}
|
|
52944
|
-
|
|
53005
|
+
if (reportErrors) {
|
|
53006
|
+
reportErrorResults(originalSource, originalTarget, originalSource, originalTarget, headMessage);
|
|
53007
|
+
}
|
|
52945
53008
|
return 0;
|
|
52946
53009
|
}
|
|
52947
53010
|
var source = getNormalizedType(originalSource, false);
|
|
@@ -52949,127 +53012,121 @@ var ts;
|
|
|
52949
53012
|
if (source === target)
|
|
52950
53013
|
return -1;
|
|
52951
53014
|
if (relation === identityRelation) {
|
|
52952
|
-
|
|
53015
|
+
if (source.flags !== target.flags)
|
|
53016
|
+
return 0;
|
|
53017
|
+
if (source.flags & 67358815)
|
|
53018
|
+
return -1;
|
|
53019
|
+
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53020
|
+
return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
|
|
52953
53021
|
}
|
|
52954
53022
|
if (source.flags & 262144 && getConstraintOfType(source) === target) {
|
|
52955
53023
|
return -1;
|
|
52956
53024
|
}
|
|
52957
|
-
if (
|
|
52958
|
-
|
|
52959
|
-
var
|
|
52960
|
-
|
|
52961
|
-
|
|
53025
|
+
if (source.flags & 470302716 && target.flags & 1048576) {
|
|
53026
|
+
var types = target.types;
|
|
53027
|
+
var candidate = types.length === 2 && types[0].flags & 98304 ? types[1] :
|
|
53028
|
+
types.length === 3 && types[0].flags & 98304 && types[1].flags & 98304 ? types[2] :
|
|
53029
|
+
undefined;
|
|
53030
|
+
if (candidate && !(candidate.flags & 98304)) {
|
|
53031
|
+
target = getNormalizedType(candidate, true);
|
|
53032
|
+
if (source === target)
|
|
53033
|
+
return -1;
|
|
52962
53034
|
}
|
|
52963
|
-
if (source === nullStrippedTarget)
|
|
52964
|
-
return -1;
|
|
52965
53035
|
}
|
|
52966
53036
|
if (relation === comparableRelation && !(target.flags & 131072) && isSimpleTypeRelatedTo(target, source, relation) ||
|
|
52967
53037
|
isSimpleTypeRelatedTo(source, target, relation, reportErrors ? reportError : undefined))
|
|
52968
53038
|
return -1;
|
|
52969
|
-
|
|
52970
|
-
|
|
52971
|
-
|
|
52972
|
-
|
|
53039
|
+
if (source.flags & 469499904 || target.flags & 469499904) {
|
|
53040
|
+
var isPerformingExcessPropertyChecks = !(intersectionState & 2) && (isObjectLiteralType(source) && ts.getObjectFlags(source) & 16384);
|
|
53041
|
+
if (isPerformingExcessPropertyChecks) {
|
|
53042
|
+
if (hasExcessProperties(source, target, reportErrors)) {
|
|
53043
|
+
if (reportErrors) {
|
|
53044
|
+
reportRelationError(headMessage, source, originalTarget.aliasSymbol ? originalTarget : target);
|
|
53045
|
+
}
|
|
53046
|
+
return 0;
|
|
53047
|
+
}
|
|
53048
|
+
}
|
|
53049
|
+
var isPerformingCommonPropertyChecks = relation !== comparableRelation && !(intersectionState & 2) &&
|
|
53050
|
+
source.flags & (131068 | 524288 | 2097152) && source !== globalObjectType &&
|
|
53051
|
+
target.flags & (524288 | 2097152) && isWeakType(target) &&
|
|
53052
|
+
(getPropertiesOfType(source).length > 0 || typeHasCallOrConstructSignatures(source));
|
|
53053
|
+
var isComparingJsxAttributes = !!(ts.getObjectFlags(source) & 2048);
|
|
53054
|
+
if (isPerformingCommonPropertyChecks && !hasCommonProperties(source, target, isComparingJsxAttributes)) {
|
|
52973
53055
|
if (reportErrors) {
|
|
52974
|
-
|
|
53056
|
+
var sourceString = typeToString(originalSource.aliasSymbol ? originalSource : source);
|
|
53057
|
+
var targetString = typeToString(originalTarget.aliasSymbol ? originalTarget : target);
|
|
53058
|
+
var calls = getSignaturesOfType(source, 0);
|
|
53059
|
+
var constructs = getSignaturesOfType(source, 1);
|
|
53060
|
+
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
|
|
53061
|
+
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
|
|
53062
|
+
reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
|
|
53063
|
+
}
|
|
53064
|
+
else {
|
|
53065
|
+
reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
|
|
53066
|
+
}
|
|
52975
53067
|
}
|
|
52976
53068
|
return 0;
|
|
52977
53069
|
}
|
|
52978
|
-
|
|
52979
|
-
|
|
52980
|
-
|
|
52981
|
-
|
|
52982
|
-
|
|
52983
|
-
|
|
52984
|
-
if (
|
|
52985
|
-
|
|
52986
|
-
|
|
52987
|
-
|
|
52988
|
-
|
|
52989
|
-
if (calls.length > 0 && isRelatedTo(getReturnTypeOfSignature(calls[0]), target, 1, false) ||
|
|
52990
|
-
constructs.length > 0 && isRelatedTo(getReturnTypeOfSignature(constructs[0]), target, 1, false)) {
|
|
52991
|
-
reportError(ts.Diagnostics.Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it, sourceString, targetString);
|
|
52992
|
-
}
|
|
52993
|
-
else {
|
|
52994
|
-
reportError(ts.Diagnostics.Type_0_has_no_properties_in_common_with_type_1, sourceString, targetString);
|
|
52995
|
-
}
|
|
53070
|
+
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53071
|
+
var skipCaching = source.flags & 1048576 && source.types.length < 4 && !(target.flags & 1048576) ||
|
|
53072
|
+
target.flags & 1048576 && target.types.length < 4 && !(source.flags & 469499904);
|
|
53073
|
+
var result_7 = skipCaching ?
|
|
53074
|
+
unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) :
|
|
53075
|
+
recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags);
|
|
53076
|
+
if (result_7 && !inPropertyCheck && (target.flags & 2097152 && (isPerformingExcessPropertyChecks || isPerformingCommonPropertyChecks) ||
|
|
53077
|
+
isNonGenericObjectType(target) && !isArrayType(target) && !isTupleType(target) && source.flags & 2097152 && getApparentType(source).flags & 3670016 && !ts.some(source.types, function (t) { return !!(ts.getObjectFlags(t) & 524288); }))) {
|
|
53078
|
+
inPropertyCheck = true;
|
|
53079
|
+
result_7 &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
|
|
53080
|
+
inPropertyCheck = false;
|
|
52996
53081
|
}
|
|
52997
|
-
|
|
52998
|
-
|
|
52999
|
-
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53000
|
-
var result = 0;
|
|
53001
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
53002
|
-
if ((source.flags & 1048576 || target.flags & 1048576) && getConstituentCount(source) * getConstituentCount(target) < 4) {
|
|
53003
|
-
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState | 8);
|
|
53004
|
-
}
|
|
53005
|
-
else if (source.flags & 3145728 || target.flags & 3145728) {
|
|
53006
|
-
result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState | 8, recursionFlags);
|
|
53007
|
-
}
|
|
53008
|
-
if (!result && !(source.flags & 1048576) && (source.flags & (469499904) || target.flags & 469499904)) {
|
|
53009
|
-
if (result = recursiveTypeRelatedTo(source, target, reportErrors, intersectionState, recursionFlags)) {
|
|
53010
|
-
resetErrorInfo(saveErrorInfo);
|
|
53082
|
+
if (result_7) {
|
|
53083
|
+
return result_7;
|
|
53011
53084
|
}
|
|
53012
53085
|
}
|
|
53013
|
-
if (
|
|
53014
|
-
|
|
53015
|
-
|
|
53016
|
-
|
|
53017
|
-
|
|
53018
|
-
|
|
53019
|
-
|
|
53020
|
-
|
|
53086
|
+
if (reportErrors) {
|
|
53087
|
+
reportErrorResults(originalSource, originalTarget, source, target, headMessage);
|
|
53088
|
+
}
|
|
53089
|
+
return 0;
|
|
53090
|
+
}
|
|
53091
|
+
function reportErrorResults(originalSource, originalTarget, source, target, headMessage) {
|
|
53092
|
+
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
53093
|
+
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
53094
|
+
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
53095
|
+
target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
|
|
53096
|
+
var maybeSuppress = overrideNextErrorInfo > 0;
|
|
53097
|
+
if (maybeSuppress) {
|
|
53098
|
+
overrideNextErrorInfo--;
|
|
53099
|
+
}
|
|
53100
|
+
if (source.flags & 524288 && target.flags & 524288) {
|
|
53101
|
+
var currentError = errorInfo;
|
|
53102
|
+
tryElaborateArrayLikeErrors(source, target, true);
|
|
53103
|
+
if (errorInfo !== currentError) {
|
|
53104
|
+
maybeSuppress = !!errorInfo;
|
|
53105
|
+
}
|
|
53106
|
+
}
|
|
53107
|
+
if (source.flags & 524288 && target.flags & 131068) {
|
|
53108
|
+
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
|
53109
|
+
}
|
|
53110
|
+
else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
|
|
53111
|
+
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
53112
|
+
}
|
|
53113
|
+
else if (ts.getObjectFlags(source) & 2048 && target.flags & 2097152) {
|
|
53114
|
+
var targetTypes = target.types;
|
|
53115
|
+
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
53116
|
+
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
53117
|
+
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
53118
|
+
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
53119
|
+
return;
|
|
53021
53120
|
}
|
|
53022
53121
|
}
|
|
53023
|
-
|
|
53024
|
-
|
|
53025
|
-
inPropertyCheck = true;
|
|
53026
|
-
result &= recursiveTypeRelatedTo(source, target, reportErrors, 4, recursionFlags);
|
|
53027
|
-
inPropertyCheck = false;
|
|
53122
|
+
else {
|
|
53123
|
+
errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
|
|
53028
53124
|
}
|
|
53029
|
-
|
|
53030
|
-
|
|
53031
|
-
|
|
53032
|
-
if (!result && reportErrors) {
|
|
53033
|
-
var sourceHasBase = !!getSingleBaseForNonAugmentingSubtype(originalSource);
|
|
53034
|
-
var targetHasBase = !!getSingleBaseForNonAugmentingSubtype(originalTarget);
|
|
53035
|
-
source = (originalSource.aliasSymbol || sourceHasBase) ? originalSource : source;
|
|
53036
|
-
target = (originalTarget.aliasSymbol || targetHasBase) ? originalTarget : target;
|
|
53037
|
-
var maybeSuppress = overrideNextErrorInfo > 0;
|
|
53038
|
-
if (maybeSuppress) {
|
|
53039
|
-
overrideNextErrorInfo--;
|
|
53040
|
-
}
|
|
53041
|
-
if (source.flags & 524288 && target.flags & 524288) {
|
|
53042
|
-
var currentError = errorInfo;
|
|
53043
|
-
tryElaborateArrayLikeErrors(source, target, reportErrors);
|
|
53044
|
-
if (errorInfo !== currentError) {
|
|
53045
|
-
maybeSuppress = !!errorInfo;
|
|
53046
|
-
}
|
|
53047
|
-
}
|
|
53048
|
-
if (source.flags & 524288 && target.flags & 131068) {
|
|
53049
|
-
tryElaborateErrorsForPrimitivesAndObjects(source, target);
|
|
53050
|
-
}
|
|
53051
|
-
else if (source.symbol && source.flags & 524288 && globalObjectType === source) {
|
|
53052
|
-
reportError(ts.Diagnostics.The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead);
|
|
53053
|
-
}
|
|
53054
|
-
else if (isComparingJsxAttributes && target.flags & 2097152) {
|
|
53055
|
-
var targetTypes = target.types;
|
|
53056
|
-
var intrinsicAttributes = getJsxType(JsxNames.IntrinsicAttributes, errorNode);
|
|
53057
|
-
var intrinsicClassAttributes = getJsxType(JsxNames.IntrinsicClassAttributes, errorNode);
|
|
53058
|
-
if (!isErrorType(intrinsicAttributes) && !isErrorType(intrinsicClassAttributes) &&
|
|
53059
|
-
(ts.contains(targetTypes, intrinsicAttributes) || ts.contains(targetTypes, intrinsicClassAttributes))) {
|
|
53060
|
-
return result;
|
|
53061
|
-
}
|
|
53062
|
-
}
|
|
53063
|
-
else {
|
|
53064
|
-
errorInfo = elaborateNeverIntersection(errorInfo, originalTarget);
|
|
53065
|
-
}
|
|
53066
|
-
if (!headMessage && maybeSuppress) {
|
|
53067
|
-
lastSkippedInfo = [source, target];
|
|
53068
|
-
return result;
|
|
53069
|
-
}
|
|
53070
|
-
reportRelationError(headMessage, source, target);
|
|
53071
|
-
}
|
|
53125
|
+
if (!headMessage && maybeSuppress) {
|
|
53126
|
+
lastSkippedInfo = [source, target];
|
|
53127
|
+
return;
|
|
53072
53128
|
}
|
|
53129
|
+
reportRelationError(headMessage, source, target);
|
|
53073
53130
|
}
|
|
53074
53131
|
function traceUnionsOrIntersectionsTooLarge(source, target) {
|
|
53075
53132
|
if (!ts.tracing) {
|
|
@@ -53095,21 +53152,6 @@ var ts;
|
|
|
53095
53152
|
}
|
|
53096
53153
|
}
|
|
53097
53154
|
}
|
|
53098
|
-
function isIdenticalTo(source, target, recursionFlags) {
|
|
53099
|
-
if (source.flags !== target.flags)
|
|
53100
|
-
return 0;
|
|
53101
|
-
if (source.flags & 67358815)
|
|
53102
|
-
return -1;
|
|
53103
|
-
traceUnionsOrIntersectionsTooLarge(source, target);
|
|
53104
|
-
if (source.flags & 3145728) {
|
|
53105
|
-
var result_7 = eachTypeRelatedToSomeType(source, target);
|
|
53106
|
-
if (result_7) {
|
|
53107
|
-
result_7 &= eachTypeRelatedToSomeType(target, source);
|
|
53108
|
-
}
|
|
53109
|
-
return result_7;
|
|
53110
|
-
}
|
|
53111
|
-
return recursiveTypeRelatedTo(source, target, false, 0, recursionFlags);
|
|
53112
|
-
}
|
|
53113
53155
|
function getTypeOfPropertyInTypes(types, name) {
|
|
53114
53156
|
var appendPropType = function (propTypes, type) {
|
|
53115
53157
|
var _a;
|
|
@@ -53198,6 +53240,29 @@ var ts;
|
|
|
53198
53240
|
function shouldCheckAsExcessProperty(prop, container) {
|
|
53199
53241
|
return prop.valueDeclaration && container.valueDeclaration && prop.valueDeclaration.parent === container.valueDeclaration;
|
|
53200
53242
|
}
|
|
53243
|
+
function unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState) {
|
|
53244
|
+
if (source.flags & 1048576) {
|
|
53245
|
+
return relation === comparableRelation ?
|
|
53246
|
+
someTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState) :
|
|
53247
|
+
eachTypeRelatedToType(source, target, reportErrors && !(source.flags & 131068), intersectionState);
|
|
53248
|
+
}
|
|
53249
|
+
if (target.flags & 1048576) {
|
|
53250
|
+
return typeRelatedToSomeType(getRegularTypeOfObjectLiteral(source), target, reportErrors && !(source.flags & 131068) && !(target.flags & 131068));
|
|
53251
|
+
}
|
|
53252
|
+
if (target.flags & 2097152) {
|
|
53253
|
+
return typeRelatedToEachType(getRegularTypeOfObjectLiteral(source), target, reportErrors, 2);
|
|
53254
|
+
}
|
|
53255
|
+
if (relation === comparableRelation && target.flags & 131068) {
|
|
53256
|
+
var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
|
|
53257
|
+
if (constraints !== source.types) {
|
|
53258
|
+
source = getIntersectionType(constraints);
|
|
53259
|
+
if (!(source.flags & 2097152)) {
|
|
53260
|
+
return isRelatedTo(source, target, 1, false);
|
|
53261
|
+
}
|
|
53262
|
+
}
|
|
53263
|
+
}
|
|
53264
|
+
return someTypeRelatedToType(source, target, false, 1);
|
|
53265
|
+
}
|
|
53201
53266
|
function eachTypeRelatedToSomeType(source, target) {
|
|
53202
53267
|
var result = -1;
|
|
53203
53268
|
var sourceTypes = source.types;
|
|
@@ -53234,7 +53299,9 @@ var ts;
|
|
|
53234
53299
|
}
|
|
53235
53300
|
if (reportErrors) {
|
|
53236
53301
|
var bestMatchingType = getBestMatchingType(source, target, isRelatedTo);
|
|
53237
|
-
|
|
53302
|
+
if (bestMatchingType) {
|
|
53303
|
+
isRelatedTo(source, bestMatchingType, 2, true);
|
|
53304
|
+
}
|
|
53238
53305
|
}
|
|
53239
53306
|
return 0;
|
|
53240
53307
|
}
|
|
@@ -53342,7 +53409,7 @@ var ts;
|
|
|
53342
53409
|
if (overflow) {
|
|
53343
53410
|
return 0;
|
|
53344
53411
|
}
|
|
53345
|
-
var keyIntersectionState = intersectionState | (inPropertyCheck ?
|
|
53412
|
+
var keyIntersectionState = intersectionState | (inPropertyCheck ? 8 : 0);
|
|
53346
53413
|
var id = getRelationKey(source, target, keyIntersectionState, relation, false);
|
|
53347
53414
|
var entry = relation.get(id);
|
|
53348
53415
|
if (entry !== undefined) {
|
|
@@ -53403,6 +53470,7 @@ var ts;
|
|
|
53403
53470
|
return originalHandler(onlyUnreliable);
|
|
53404
53471
|
};
|
|
53405
53472
|
}
|
|
53473
|
+
var result;
|
|
53406
53474
|
if (expandingFlags === 3) {
|
|
53407
53475
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.instant("checkTypes", "recursiveTypeRelatedTo_DepthLimit", {
|
|
53408
53476
|
sourceId: source.id,
|
|
@@ -53412,8 +53480,13 @@ var ts;
|
|
|
53412
53480
|
depth: sourceDepth,
|
|
53413
53481
|
targetDepth: targetDepth
|
|
53414
53482
|
});
|
|
53483
|
+
result = 3;
|
|
53484
|
+
}
|
|
53485
|
+
else {
|
|
53486
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
|
53487
|
+
result = structuredTypeRelatedTo(source, target, reportErrors, intersectionState);
|
|
53488
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
53415
53489
|
}
|
|
53416
|
-
var result = expandingFlags !== 3 ? structuredTypeRelatedTo(source, target, reportErrors, intersectionState) : 3;
|
|
53417
53490
|
if (outofbandVarianceMarkerHandler) {
|
|
53418
53491
|
outofbandVarianceMarkerHandler = originalHandler;
|
|
53419
53492
|
}
|
|
@@ -53441,74 +53514,73 @@ var ts;
|
|
|
53441
53514
|
return result;
|
|
53442
53515
|
}
|
|
53443
53516
|
function structuredTypeRelatedTo(source, target, reportErrors, intersectionState) {
|
|
53444
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("checkTypes", "structuredTypeRelatedTo", { sourceId: source.id, targetId: target.id });
|
|
53445
|
-
var result = structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState);
|
|
53446
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
53447
|
-
return result;
|
|
53448
|
-
}
|
|
53449
|
-
function structuredTypeRelatedToWorker(source, target, reportErrors, intersectionState) {
|
|
53450
53517
|
if (intersectionState & 4) {
|
|
53451
53518
|
return propertiesRelatedTo(source, target, reportErrors, undefined, 0);
|
|
53452
53519
|
}
|
|
53453
|
-
|
|
53454
|
-
|
|
53455
|
-
|
|
53456
|
-
|
|
53457
|
-
|
|
53458
|
-
|
|
53459
|
-
|
|
53460
|
-
|
|
53461
|
-
|
|
53462
|
-
|
|
53463
|
-
|
|
53464
|
-
}
|
|
53465
|
-
if (relation === comparableRelation && target.flags & 131068) {
|
|
53466
|
-
var constraints = ts.sameMap(source.types, getBaseConstraintOrType);
|
|
53467
|
-
if (constraints !== source.types) {
|
|
53468
|
-
source = getIntersectionType(constraints);
|
|
53469
|
-
if (!(source.flags & 2097152)) {
|
|
53470
|
-
return isRelatedTo(source, target, 1, false);
|
|
53471
|
-
}
|
|
53520
|
+
var result;
|
|
53521
|
+
var originalErrorInfo;
|
|
53522
|
+
var varianceCheckFailed = false;
|
|
53523
|
+
var saveErrorInfo = captureErrorCalculationState();
|
|
53524
|
+
var sourceFlags = source.flags;
|
|
53525
|
+
var targetFlags = target.flags;
|
|
53526
|
+
if (relation === identityRelation) {
|
|
53527
|
+
if (sourceFlags & 3145728) {
|
|
53528
|
+
var result_8 = eachTypeRelatedToSomeType(source, target);
|
|
53529
|
+
if (result_8) {
|
|
53530
|
+
result_8 &= eachTypeRelatedToSomeType(target, source);
|
|
53472
53531
|
}
|
|
53532
|
+
return result_8;
|
|
53473
53533
|
}
|
|
53474
|
-
|
|
53475
|
-
}
|
|
53476
|
-
var flags = source.flags & target.flags;
|
|
53477
|
-
if (relation === identityRelation && !(flags & 524288)) {
|
|
53478
|
-
if (flags & 4194304) {
|
|
53534
|
+
if (sourceFlags & 4194304) {
|
|
53479
53535
|
return isRelatedTo(source.type, target.type, 3, false);
|
|
53480
53536
|
}
|
|
53481
|
-
|
|
53482
|
-
|
|
53483
|
-
|
|
53484
|
-
|
|
53485
|
-
return result_8;
|
|
53537
|
+
if (sourceFlags & 8388608) {
|
|
53538
|
+
if (result = isRelatedTo(source.objectType, target.objectType, 3, false)) {
|
|
53539
|
+
if (result &= isRelatedTo(source.indexType, target.indexType, 3, false)) {
|
|
53540
|
+
return result;
|
|
53486
53541
|
}
|
|
53487
53542
|
}
|
|
53488
53543
|
}
|
|
53489
|
-
if (
|
|
53544
|
+
if (sourceFlags & 16777216) {
|
|
53490
53545
|
if (source.root.isDistributive === target.root.isDistributive) {
|
|
53491
|
-
if (
|
|
53492
|
-
if (
|
|
53493
|
-
if (
|
|
53494
|
-
if (
|
|
53495
|
-
return
|
|
53546
|
+
if (result = isRelatedTo(source.checkType, target.checkType, 3, false)) {
|
|
53547
|
+
if (result &= isRelatedTo(source.extendsType, target.extendsType, 3, false)) {
|
|
53548
|
+
if (result &= isRelatedTo(getTrueTypeFromConditionalType(source), getTrueTypeFromConditionalType(target), 3, false)) {
|
|
53549
|
+
if (result &= isRelatedTo(getFalseTypeFromConditionalType(source), getFalseTypeFromConditionalType(target), 3, false)) {
|
|
53550
|
+
return result;
|
|
53496
53551
|
}
|
|
53497
53552
|
}
|
|
53498
53553
|
}
|
|
53499
53554
|
}
|
|
53500
53555
|
}
|
|
53501
53556
|
}
|
|
53502
|
-
if (
|
|
53557
|
+
if (sourceFlags & 33554432) {
|
|
53503
53558
|
return isRelatedTo(source.substitute, target.substitute, 3, false);
|
|
53504
53559
|
}
|
|
53505
|
-
|
|
53560
|
+
if (!(sourceFlags & 524288)) {
|
|
53561
|
+
return 0;
|
|
53562
|
+
}
|
|
53506
53563
|
}
|
|
53507
|
-
|
|
53508
|
-
|
|
53509
|
-
|
|
53510
|
-
|
|
53511
|
-
|
|
53564
|
+
else if (sourceFlags & 3145728 || targetFlags & 3145728) {
|
|
53565
|
+
if (result = unionOrIntersectionRelatedTo(source, target, reportErrors, intersectionState)) {
|
|
53566
|
+
return result;
|
|
53567
|
+
}
|
|
53568
|
+
if (source.flags & 2097152 || source.flags & 262144 && target.flags & 1048576) {
|
|
53569
|
+
var constraint = getEffectiveConstraintOfIntersection(source.flags & 2097152 ? source.types : [source], !!(target.flags & 1048576));
|
|
53570
|
+
if (constraint && everyType(constraint, function (c) { return c !== source; })) {
|
|
53571
|
+
if (result = isRelatedTo(constraint, target, 1, false, undefined, intersectionState)) {
|
|
53572
|
+
resetErrorInfo(saveErrorInfo);
|
|
53573
|
+
return result;
|
|
53574
|
+
}
|
|
53575
|
+
}
|
|
53576
|
+
}
|
|
53577
|
+
if (!(sourceFlags & 465829888 ||
|
|
53578
|
+
sourceFlags & 524288 && targetFlags & 1048576 ||
|
|
53579
|
+
sourceFlags & 2097152 && targetFlags & (524288 | 1048576 | 465829888))) {
|
|
53580
|
+
return 0;
|
|
53581
|
+
}
|
|
53582
|
+
}
|
|
53583
|
+
if (sourceFlags & (524288 | 16777216) && source.aliasSymbol &&
|
|
53512
53584
|
source.aliasTypeArguments && source.aliasSymbol === target.aliasSymbol &&
|
|
53513
53585
|
!(source.aliasTypeArgumentsContainsMarker || target.aliasTypeArgumentsContainsMarker)) {
|
|
53514
53586
|
var variances = getAliasVariances(source.aliasSymbol);
|
|
@@ -53524,7 +53596,7 @@ var ts;
|
|
|
53524
53596
|
isSingleElementGenericTupleType(target) && (target.target.readonly || isMutableArrayOrTuple(getBaseConstraintOfType(source) || source)) && (result = isRelatedTo(source, getTypeArguments(target)[0], 2))) {
|
|
53525
53597
|
return result;
|
|
53526
53598
|
}
|
|
53527
|
-
if (
|
|
53599
|
+
if (targetFlags & 262144) {
|
|
53528
53600
|
if (ts.getObjectFlags(source) & 32 && !source.declaration.nameType && isRelatedTo(getIndexType(target), getConstraintTypeFromMappedType(source), 3)) {
|
|
53529
53601
|
if (!(getMappedTypeModifiers(source) & 4)) {
|
|
53530
53602
|
var templateType = getTemplateTypeFromMappedType(source);
|
|
@@ -53535,9 +53607,9 @@ var ts;
|
|
|
53535
53607
|
}
|
|
53536
53608
|
}
|
|
53537
53609
|
}
|
|
53538
|
-
else if (
|
|
53610
|
+
else if (targetFlags & 4194304) {
|
|
53539
53611
|
var targetType_1 = target.type;
|
|
53540
|
-
if (
|
|
53612
|
+
if (sourceFlags & 4194304) {
|
|
53541
53613
|
if (result = isRelatedTo(targetType_1, source.type, 3, false)) {
|
|
53542
53614
|
return result;
|
|
53543
53615
|
}
|
|
@@ -53573,8 +53645,8 @@ var ts;
|
|
|
53573
53645
|
}
|
|
53574
53646
|
}
|
|
53575
53647
|
}
|
|
53576
|
-
else if (
|
|
53577
|
-
if (
|
|
53648
|
+
else if (targetFlags & 8388608) {
|
|
53649
|
+
if (sourceFlags & 8388608) {
|
|
53578
53650
|
if (result = isRelatedTo(source.objectType, target.objectType, 3, reportErrors)) {
|
|
53579
53651
|
result &= isRelatedTo(source.indexType, target.indexType, 3, reportErrors);
|
|
53580
53652
|
}
|
|
@@ -53653,7 +53725,7 @@ var ts;
|
|
|
53653
53725
|
}
|
|
53654
53726
|
}
|
|
53655
53727
|
}
|
|
53656
|
-
else if (
|
|
53728
|
+
else if (targetFlags & 16777216) {
|
|
53657
53729
|
if (isDeeplyNestedType(target, targetStack, targetDepth, 10)) {
|
|
53658
53730
|
resetErrorInfo(saveErrorInfo);
|
|
53659
53731
|
return 3;
|
|
@@ -53671,8 +53743,8 @@ var ts;
|
|
|
53671
53743
|
}
|
|
53672
53744
|
}
|
|
53673
53745
|
}
|
|
53674
|
-
else if (
|
|
53675
|
-
if (
|
|
53746
|
+
else if (targetFlags & 134217728) {
|
|
53747
|
+
if (sourceFlags & 134217728) {
|
|
53676
53748
|
if (relation === comparableRelation) {
|
|
53677
53749
|
return templateLiteralTypesDefinitelyUnrelated(source, target) ? 0 : -1;
|
|
53678
53750
|
}
|
|
@@ -53682,10 +53754,10 @@ var ts;
|
|
|
53682
53754
|
return -1;
|
|
53683
53755
|
}
|
|
53684
53756
|
}
|
|
53685
|
-
if (
|
|
53686
|
-
if (!(
|
|
53757
|
+
if (sourceFlags & 8650752) {
|
|
53758
|
+
if (!(sourceFlags & 8388608 && targetFlags & 8388608)) {
|
|
53687
53759
|
var constraint = getConstraintOfType(source);
|
|
53688
|
-
if (!constraint || (
|
|
53760
|
+
if (!constraint || (sourceFlags & 262144 && constraint.flags & 1)) {
|
|
53689
53761
|
if (result = isRelatedTo(emptyObjectType, extractTypesOfKind(target, ~67108864), 3)) {
|
|
53690
53762
|
resetErrorInfo(saveErrorInfo);
|
|
53691
53763
|
return result;
|
|
@@ -53695,7 +53767,7 @@ var ts;
|
|
|
53695
53767
|
resetErrorInfo(saveErrorInfo);
|
|
53696
53768
|
return result;
|
|
53697
53769
|
}
|
|
53698
|
-
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(
|
|
53770
|
+
else if (result = isRelatedTo(getTypeWithThisArgument(constraint, source), target, 1, reportErrors && !(targetFlags & sourceFlags & 262144), undefined, intersectionState)) {
|
|
53699
53771
|
resetErrorInfo(saveErrorInfo);
|
|
53700
53772
|
return result;
|
|
53701
53773
|
}
|
|
@@ -53710,14 +53782,14 @@ var ts;
|
|
|
53710
53782
|
}
|
|
53711
53783
|
}
|
|
53712
53784
|
}
|
|
53713
|
-
else if (
|
|
53785
|
+
else if (sourceFlags & 4194304) {
|
|
53714
53786
|
if (result = isRelatedTo(keyofConstraintType, target, 1, reportErrors)) {
|
|
53715
53787
|
resetErrorInfo(saveErrorInfo);
|
|
53716
53788
|
return result;
|
|
53717
53789
|
}
|
|
53718
53790
|
}
|
|
53719
|
-
else if (
|
|
53720
|
-
if (!(
|
|
53791
|
+
else if (sourceFlags & 134217728 && !(targetFlags & 524288)) {
|
|
53792
|
+
if (!(targetFlags & 134217728)) {
|
|
53721
53793
|
var constraint = getBaseConstraintOfType(source);
|
|
53722
53794
|
if (constraint && constraint !== source && (result = isRelatedTo(constraint, target, 1, reportErrors))) {
|
|
53723
53795
|
resetErrorInfo(saveErrorInfo);
|
|
@@ -53725,8 +53797,8 @@ var ts;
|
|
|
53725
53797
|
}
|
|
53726
53798
|
}
|
|
53727
53799
|
}
|
|
53728
|
-
else if (
|
|
53729
|
-
if (
|
|
53800
|
+
else if (sourceFlags & 268435456) {
|
|
53801
|
+
if (targetFlags & 268435456 && source.symbol === target.symbol) {
|
|
53730
53802
|
if (result = isRelatedTo(source.type, target.type, 3, reportErrors)) {
|
|
53731
53803
|
resetErrorInfo(saveErrorInfo);
|
|
53732
53804
|
return result;
|
|
@@ -53740,12 +53812,12 @@ var ts;
|
|
|
53740
53812
|
}
|
|
53741
53813
|
}
|
|
53742
53814
|
}
|
|
53743
|
-
else if (
|
|
53815
|
+
else if (sourceFlags & 16777216) {
|
|
53744
53816
|
if (isDeeplyNestedType(source, sourceStack, sourceDepth, 10)) {
|
|
53745
53817
|
resetErrorInfo(saveErrorInfo);
|
|
53746
53818
|
return 3;
|
|
53747
53819
|
}
|
|
53748
|
-
if (
|
|
53820
|
+
if (targetFlags & 16777216) {
|
|
53749
53821
|
var sourceParams = source.root.inferTypeParameters;
|
|
53750
53822
|
var sourceExtends = source.extendsType;
|
|
53751
53823
|
var mapper = void 0;
|
|
@@ -53796,15 +53868,19 @@ var ts;
|
|
|
53796
53868
|
}
|
|
53797
53869
|
return 0;
|
|
53798
53870
|
}
|
|
53799
|
-
var sourceIsPrimitive = !!(
|
|
53871
|
+
var sourceIsPrimitive = !!(sourceFlags & 131068);
|
|
53800
53872
|
if (relation !== identityRelation) {
|
|
53801
53873
|
source = getApparentType(source);
|
|
53874
|
+
sourceFlags = source.flags;
|
|
53802
53875
|
}
|
|
53803
53876
|
else if (isGenericMappedType(source)) {
|
|
53804
53877
|
return 0;
|
|
53805
53878
|
}
|
|
53806
53879
|
if (ts.getObjectFlags(source) & 4 && ts.getObjectFlags(target) & 4 && source.target === target.target &&
|
|
53807
53880
|
!isTupleType(source) && !(ts.getObjectFlags(source) & 4096 || ts.getObjectFlags(target) & 4096)) {
|
|
53881
|
+
if (isEmptyArrayLiteralType(source)) {
|
|
53882
|
+
return -1;
|
|
53883
|
+
}
|
|
53808
53884
|
var variances = getVariances(source.target);
|
|
53809
53885
|
if (variances === ts.emptyArray) {
|
|
53810
53886
|
return 1;
|
|
@@ -53825,7 +53901,7 @@ var ts;
|
|
|
53825
53901
|
else if ((relation === subtypeRelation || relation === strictSubtypeRelation) && isEmptyObjectType(target) && ts.getObjectFlags(target) & 16384 && !isEmptyObjectType(source)) {
|
|
53826
53902
|
return 0;
|
|
53827
53903
|
}
|
|
53828
|
-
if (
|
|
53904
|
+
if (sourceFlags & (524288 | 2097152) && targetFlags & 524288) {
|
|
53829
53905
|
var reportStructuralErrors = reportErrors && errorInfo === saveErrorInfo.errorInfo && !sourceIsPrimitive;
|
|
53830
53906
|
result = propertiesRelatedTo(source, target, reportStructuralErrors, undefined, intersectionState);
|
|
53831
53907
|
if (result) {
|
|
@@ -53844,7 +53920,7 @@ var ts;
|
|
|
53844
53920
|
return result;
|
|
53845
53921
|
}
|
|
53846
53922
|
}
|
|
53847
|
-
if (
|
|
53923
|
+
if (sourceFlags & (524288 | 2097152) && targetFlags & 1048576) {
|
|
53848
53924
|
var objectOnlyTarget = extractTypesOfKind(target, 524288 | 2097152 | 33554432);
|
|
53849
53925
|
if (objectOnlyTarget.flags & 1048576) {
|
|
53850
53926
|
var result_9 = typeRelatedToDiscriminatedType(source, objectOnlyTarget);
|
|
@@ -54040,6 +54116,10 @@ var ts;
|
|
|
54040
54116
|
}
|
|
54041
54117
|
return 0;
|
|
54042
54118
|
}
|
|
54119
|
+
if ((relation === subtypeRelation || relation === strictSubtypeRelation) &&
|
|
54120
|
+
!!(sourcePropFlags & 64) && !(targetPropFlags & 64)) {
|
|
54121
|
+
return 0;
|
|
54122
|
+
}
|
|
54043
54123
|
var related = isPropertySymbolTypeRelated(sourceProp, targetProp, getTypeOfSourceProperty, reportErrors, intersectionState);
|
|
54044
54124
|
if (!related) {
|
|
54045
54125
|
if (reportErrors) {
|
|
@@ -54290,7 +54370,6 @@ var ts;
|
|
|
54290
54370
|
}
|
|
54291
54371
|
}
|
|
54292
54372
|
var result = -1;
|
|
54293
|
-
var saveErrorInfo = captureErrorCalculationState();
|
|
54294
54373
|
var incompatibleReporter = kind === 1 ? reportIncompatibleConstructSignatureReturn : reportIncompatibleCallSignatureReturn;
|
|
54295
54374
|
var sourceObjectFlags = ts.getObjectFlags(source);
|
|
54296
54375
|
var targetObjectFlags = ts.getObjectFlags(target);
|
|
@@ -54322,6 +54401,7 @@ var ts;
|
|
|
54322
54401
|
else {
|
|
54323
54402
|
outer: for (var _i = 0, targetSignatures_1 = targetSignatures; _i < targetSignatures_1.length; _i++) {
|
|
54324
54403
|
var t = targetSignatures_1[_i];
|
|
54404
|
+
var saveErrorInfo = captureErrorCalculationState();
|
|
54325
54405
|
var shouldElaborateErrors = reportErrors;
|
|
54326
54406
|
for (var _c = 0, sourceSignatures_1 = sourceSignatures; _c < sourceSignatures_1.length; _c++) {
|
|
54327
54407
|
var s = sourceSignatures_1[_c];
|
|
@@ -54427,8 +54507,8 @@ var ts;
|
|
|
54427
54507
|
var indexInfos = getIndexInfosOfType(target);
|
|
54428
54508
|
var targetHasStringIndex = ts.some(indexInfos, function (info) { return info.keyType === stringType; });
|
|
54429
54509
|
var result = -1;
|
|
54430
|
-
for (var _i = 0,
|
|
54431
|
-
var targetInfo =
|
|
54510
|
+
for (var _i = 0, indexInfos_5 = indexInfos; _i < indexInfos_5.length; _i++) {
|
|
54511
|
+
var targetInfo = indexInfos_5[_i];
|
|
54432
54512
|
var related = !sourceIsPrimitive && targetHasStringIndex && targetInfo.type.flags & 1 ? -1 :
|
|
54433
54513
|
isGenericMappedType(source) && targetHasStringIndex ? isRelatedTo(getTemplateTypeFromMappedType(source), targetInfo.type, 3, reportErrors) :
|
|
54434
54514
|
typeRelatedToIndexInfo(source, targetInfo, reportErrors, intersectionState);
|
|
@@ -54937,10 +55017,10 @@ var ts;
|
|
|
54937
55017
|
if (!(ts.getObjectFlags(type) & 4) || !(ts.getObjectFlags(type.target) & 3)) {
|
|
54938
55018
|
return undefined;
|
|
54939
55019
|
}
|
|
54940
|
-
if (ts.getObjectFlags(type) &
|
|
54941
|
-
return ts.getObjectFlags(type) &
|
|
55020
|
+
if (ts.getObjectFlags(type) & 67108864) {
|
|
55021
|
+
return ts.getObjectFlags(type) & 134217728 ? type.cachedEquivalentBaseType : undefined;
|
|
54942
55022
|
}
|
|
54943
|
-
type.objectFlags |=
|
|
55023
|
+
type.objectFlags |= 67108864;
|
|
54944
55024
|
var target = type.target;
|
|
54945
55025
|
if (ts.getObjectFlags(target) & 1) {
|
|
54946
55026
|
var baseTypeNode = getBaseTypeNodeOfClass(target);
|
|
@@ -54959,7 +55039,7 @@ var ts;
|
|
|
54959
55039
|
if (ts.length(getTypeArguments(type)) > ts.length(target.typeParameters)) {
|
|
54960
55040
|
instantiatedBase = getTypeWithThisArgument(instantiatedBase, ts.last(getTypeArguments(type)));
|
|
54961
55041
|
}
|
|
54962
|
-
type.objectFlags |=
|
|
55042
|
+
type.objectFlags |= 134217728;
|
|
54963
55043
|
return type.cachedEquivalentBaseType = instantiatedBase;
|
|
54964
55044
|
}
|
|
54965
55045
|
function isEmptyLiteralType(type) {
|
|
@@ -55556,7 +55636,7 @@ var ts;
|
|
|
55556
55636
|
var result = !!(type.flags & 465829888 ||
|
|
55557
55637
|
type.flags & 524288 && !isNonGenericTopLevelType(type) && (objectFlags & 4 && (type.node || ts.forEach(getTypeArguments(type), couldContainTypeVariables)) ||
|
|
55558
55638
|
objectFlags & 16 && type.symbol && type.symbol.flags & (16 | 8192 | 32 | 2048 | 4096) && type.symbol.declarations ||
|
|
55559
|
-
objectFlags & (32 | 1024 | 8388608)) ||
|
|
55639
|
+
objectFlags & (32 | 1024 | 8388608 | 16777216)) ||
|
|
55560
55640
|
type.flags & 3145728 && !(type.flags & 1024) && !isNonGenericTopLevelType(type) && ts.some(type.types, couldContainTypeVariables));
|
|
55561
55641
|
if (type.flags & 3899393) {
|
|
55562
55642
|
type.objectFlags |= 1048576 | (result ? 2097152 : 0);
|
|
@@ -56323,8 +56403,8 @@ var ts;
|
|
|
56323
56403
|
var priority = (ts.getObjectFlags(source) & ts.getObjectFlags(target) & 32) ? 8 : 0;
|
|
56324
56404
|
var indexInfos = getIndexInfosOfType(target);
|
|
56325
56405
|
if (isObjectTypeWithInferableIndex(source)) {
|
|
56326
|
-
for (var _i = 0,
|
|
56327
|
-
var targetInfo =
|
|
56406
|
+
for (var _i = 0, indexInfos_6 = indexInfos; _i < indexInfos_6.length; _i++) {
|
|
56407
|
+
var targetInfo = indexInfos_6[_i];
|
|
56328
56408
|
var propTypes = [];
|
|
56329
56409
|
for (var _a = 0, _b = getPropertiesOfType(source); _a < _b.length; _a++) {
|
|
56330
56410
|
var prop = _b[_a];
|
|
@@ -56344,8 +56424,8 @@ var ts;
|
|
|
56344
56424
|
}
|
|
56345
56425
|
}
|
|
56346
56426
|
}
|
|
56347
|
-
for (var _e = 0,
|
|
56348
|
-
var targetInfo =
|
|
56427
|
+
for (var _e = 0, indexInfos_7 = indexInfos; _e < indexInfos_7.length; _e++) {
|
|
56428
|
+
var targetInfo = indexInfos_7[_e];
|
|
56349
56429
|
var sourceInfo = getApplicableIndexInfo(source, targetInfo.keyType);
|
|
56350
56430
|
if (sourceInfo) {
|
|
56351
56431
|
inferWithPriority(sourceInfo.type, targetInfo.type, priority);
|
|
@@ -57110,9 +57190,6 @@ var ts;
|
|
|
57110
57190
|
getUnionType(ts.map(type.types, mapper), 1, aliasSymbol, aliasTypeArguments) :
|
|
57111
57191
|
mapType(type, mapper);
|
|
57112
57192
|
}
|
|
57113
|
-
function getConstituentCount(type) {
|
|
57114
|
-
return type.flags & 1048576 ? type.types.length : 1;
|
|
57115
|
-
}
|
|
57116
57193
|
function extractTypesOfKind(type, kind) {
|
|
57117
57194
|
return filterType(type, function (t) { return (t.flags & kind) !== 0; });
|
|
57118
57195
|
}
|
|
@@ -61070,6 +61147,9 @@ var ts;
|
|
|
61070
61147
|
if (compilerOptions.noPropertyAccessFromIndexSignature && ts.isPropertyAccessExpression(node)) {
|
|
61071
61148
|
error(right, ts.Diagnostics.Property_0_comes_from_an_index_signature_so_it_must_be_accessed_with_0, ts.unescapeLeadingUnderscores(right.escapedText));
|
|
61072
61149
|
}
|
|
61150
|
+
if (indexInfo.declaration && ts.getCombinedNodeFlags(indexInfo.declaration) & 134217728) {
|
|
61151
|
+
addDeprecatedSuggestion(right, [indexInfo.declaration], right.escapedText);
|
|
61152
|
+
}
|
|
61073
61153
|
}
|
|
61074
61154
|
else {
|
|
61075
61155
|
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
@@ -63305,6 +63385,72 @@ var ts;
|
|
|
63305
63385
|
return node.flags & 32 ? checkNonNullChain(node) :
|
|
63306
63386
|
getNonNullableType(checkExpression(node.expression));
|
|
63307
63387
|
}
|
|
63388
|
+
function checkExpressionWithTypeArguments(node) {
|
|
63389
|
+
checkGrammarExpressionWithTypeArguments(node);
|
|
63390
|
+
var exprType = node.kind === 227 ? checkExpression(node.expression) :
|
|
63391
|
+
ts.isThisIdentifier(node.exprName) ? checkThisExpression(node.exprName) :
|
|
63392
|
+
checkExpression(node.exprName);
|
|
63393
|
+
var typeArguments = node.typeArguments;
|
|
63394
|
+
if (exprType === silentNeverType || isErrorType(exprType) || !ts.some(typeArguments)) {
|
|
63395
|
+
return exprType;
|
|
63396
|
+
}
|
|
63397
|
+
var hasSomeApplicableSignature = false;
|
|
63398
|
+
var nonApplicableType;
|
|
63399
|
+
var result = getInstantiatedType(exprType);
|
|
63400
|
+
var errorType = hasSomeApplicableSignature ? nonApplicableType : exprType;
|
|
63401
|
+
if (errorType) {
|
|
63402
|
+
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)));
|
|
63403
|
+
}
|
|
63404
|
+
return result;
|
|
63405
|
+
function getInstantiatedType(type) {
|
|
63406
|
+
var hasSignatures = false;
|
|
63407
|
+
var hasApplicableSignature = false;
|
|
63408
|
+
var result = getInstantiatedTypePart(type);
|
|
63409
|
+
hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature);
|
|
63410
|
+
if (hasSignatures && !hasApplicableSignature) {
|
|
63411
|
+
nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : (nonApplicableType = type);
|
|
63412
|
+
}
|
|
63413
|
+
return result;
|
|
63414
|
+
function getInstantiatedTypePart(type) {
|
|
63415
|
+
if (type.flags & 524288) {
|
|
63416
|
+
var resolved = resolveStructuredTypeMembers(type);
|
|
63417
|
+
var callSignatures = getInstantiatedSignatures(resolved.callSignatures);
|
|
63418
|
+
var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures);
|
|
63419
|
+
hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0);
|
|
63420
|
+
hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0);
|
|
63421
|
+
if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) {
|
|
63422
|
+
var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos);
|
|
63423
|
+
result_11.objectFlags |= 16777216;
|
|
63424
|
+
result_11.node = node;
|
|
63425
|
+
return result_11;
|
|
63426
|
+
}
|
|
63427
|
+
}
|
|
63428
|
+
else if (type.flags & 58982400) {
|
|
63429
|
+
var constraint = getBaseConstraintOfType(type);
|
|
63430
|
+
if (constraint) {
|
|
63431
|
+
var instantiated = getInstantiatedTypePart(constraint);
|
|
63432
|
+
if (instantiated !== constraint) {
|
|
63433
|
+
return instantiated;
|
|
63434
|
+
}
|
|
63435
|
+
}
|
|
63436
|
+
}
|
|
63437
|
+
else if (type.flags & 1048576) {
|
|
63438
|
+
return mapType(type, getInstantiatedType);
|
|
63439
|
+
}
|
|
63440
|
+
else if (type.flags & 2097152) {
|
|
63441
|
+
return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypePart));
|
|
63442
|
+
}
|
|
63443
|
+
return type;
|
|
63444
|
+
}
|
|
63445
|
+
}
|
|
63446
|
+
function getInstantiatedSignatures(signatures) {
|
|
63447
|
+
var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); });
|
|
63448
|
+
return ts.sameMap(applicableSignatures, function (sig) {
|
|
63449
|
+
var typeArgumentTypes = checkTypeArguments(sig, typeArguments, true);
|
|
63450
|
+
return typeArgumentTypes ? getSignatureInstantiation(sig, typeArgumentTypes, ts.isInJSFile(sig.declaration)) : sig;
|
|
63451
|
+
});
|
|
63452
|
+
}
|
|
63453
|
+
}
|
|
63308
63454
|
function checkMetaProperty(node) {
|
|
63309
63455
|
checkGrammarMetaProperty(node);
|
|
63310
63456
|
if (node.keywordToken === 103) {
|
|
@@ -63621,19 +63767,20 @@ var ts;
|
|
|
63621
63767
|
if (links.type === unknownType) {
|
|
63622
63768
|
links.type = getTypeFromBindingPattern(declaration.name);
|
|
63623
63769
|
}
|
|
63624
|
-
assignBindingElementTypes(declaration.name);
|
|
63770
|
+
assignBindingElementTypes(declaration.name, links.type);
|
|
63625
63771
|
}
|
|
63626
63772
|
}
|
|
63627
63773
|
}
|
|
63628
|
-
function assignBindingElementTypes(pattern) {
|
|
63774
|
+
function assignBindingElementTypes(pattern, parentType) {
|
|
63629
63775
|
for (var _i = 0, _a = pattern.elements; _i < _a.length; _i++) {
|
|
63630
63776
|
var element = _a[_i];
|
|
63631
63777
|
if (!ts.isOmittedExpression(element)) {
|
|
63778
|
+
var type = getBindingElementTypeFromParentType(element, parentType);
|
|
63632
63779
|
if (element.name.kind === 79) {
|
|
63633
|
-
getSymbolLinks(getSymbolOfNode(element)).type =
|
|
63780
|
+
getSymbolLinks(getSymbolOfNode(element)).type = type;
|
|
63634
63781
|
}
|
|
63635
63782
|
else {
|
|
63636
|
-
assignBindingElementTypes(element.name);
|
|
63783
|
+
assignBindingElementTypes(element.name, type);
|
|
63637
63784
|
}
|
|
63638
63785
|
}
|
|
63639
63786
|
}
|
|
@@ -65541,6 +65688,8 @@ var ts;
|
|
|
65541
65688
|
return checkAssertion(node);
|
|
65542
65689
|
case 229:
|
|
65543
65690
|
return checkNonNullAssertion(node);
|
|
65691
|
+
case 227:
|
|
65692
|
+
return checkExpressionWithTypeArguments(node);
|
|
65544
65693
|
case 230:
|
|
65545
65694
|
return checkMetaProperty(node);
|
|
65546
65695
|
case 214:
|
|
@@ -66623,12 +66772,12 @@ var ts;
|
|
|
66623
66772
|
case 264:
|
|
66624
66773
|
case 267:
|
|
66625
66774
|
case 266:
|
|
66626
|
-
var
|
|
66775
|
+
var result_12 = 0;
|
|
66627
66776
|
var target = resolveAlias(getSymbolOfNode(d));
|
|
66628
66777
|
ts.forEach(target.declarations, function (d) {
|
|
66629
|
-
|
|
66778
|
+
result_12 |= getDeclarationSpaces(d);
|
|
66630
66779
|
});
|
|
66631
|
-
return
|
|
66780
|
+
return result_12;
|
|
66632
66781
|
case 253:
|
|
66633
66782
|
case 202:
|
|
66634
66783
|
case 255:
|
|
@@ -66828,26 +66977,24 @@ var ts;
|
|
|
66828
66977
|
if (returnType.flags & 1) {
|
|
66829
66978
|
return;
|
|
66830
66979
|
}
|
|
66980
|
+
var headMessage;
|
|
66831
66981
|
var expectedReturnType;
|
|
66832
|
-
var headMessage = getDiagnosticHeadMessageForDecoratorResolution(node);
|
|
66833
|
-
var errorInfo;
|
|
66834
66982
|
switch (node.parent.kind) {
|
|
66835
66983
|
case 256:
|
|
66984
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
|
|
66836
66985
|
var classSymbol = getSymbolOfNode(node.parent);
|
|
66837
66986
|
var classConstructorType = getTypeOfSymbol(classSymbol);
|
|
66838
66987
|
expectedReturnType = getUnionType([classConstructorType, voidType]);
|
|
66839
66988
|
break;
|
|
66840
|
-
case 163:
|
|
66841
|
-
expectedReturnType = voidType;
|
|
66842
|
-
errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any);
|
|
66843
|
-
break;
|
|
66844
66989
|
case 166:
|
|
66990
|
+
case 163:
|
|
66991
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_is_0_but_is_expected_to_be_void_or_any;
|
|
66845
66992
|
expectedReturnType = voidType;
|
|
66846
|
-
errorInfo = ts.chainDiagnosticMessages(undefined, ts.Diagnostics.The_return_type_of_a_property_decorator_function_must_be_either_void_or_any);
|
|
66847
66993
|
break;
|
|
66848
66994
|
case 168:
|
|
66849
66995
|
case 171:
|
|
66850
66996
|
case 172:
|
|
66997
|
+
headMessage = ts.Diagnostics.Decorator_function_return_type_0_is_not_assignable_to_type_1;
|
|
66851
66998
|
var methodType = getTypeOfNode(node.parent);
|
|
66852
66999
|
var descriptorType = createTypedPropertyDescriptorType(methodType);
|
|
66853
67000
|
expectedReturnType = getUnionType([descriptorType, voidType]);
|
|
@@ -66855,7 +67002,7 @@ var ts;
|
|
|
66855
67002
|
default:
|
|
66856
67003
|
return ts.Debug.fail();
|
|
66857
67004
|
}
|
|
66858
|
-
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage
|
|
67005
|
+
checkTypeAssignableTo(returnType, expectedReturnType, node, headMessage);
|
|
66859
67006
|
}
|
|
66860
67007
|
function markTypeNodeAsReferenced(node) {
|
|
66861
67008
|
markEntityNameOrEntityExpressionAsReference(node && ts.getEntityNameFromTypeNode(node));
|
|
@@ -68627,8 +68774,8 @@ var ts;
|
|
|
68627
68774
|
}
|
|
68628
68775
|
}
|
|
68629
68776
|
if (indexInfos.length > 1) {
|
|
68630
|
-
for (var _d = 0,
|
|
68631
|
-
var info =
|
|
68777
|
+
for (var _d = 0, indexInfos_8 = indexInfos; _d < indexInfos_8.length; _d++) {
|
|
68778
|
+
var info = indexInfos_8[_d];
|
|
68632
68779
|
checkIndexConstraintForIndexSignature(type, info);
|
|
68633
68780
|
}
|
|
68634
68781
|
}
|
|
@@ -68651,8 +68798,8 @@ var ts;
|
|
|
68651
68798
|
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));
|
|
68652
68799
|
}
|
|
68653
68800
|
};
|
|
68654
|
-
for (var _i = 0,
|
|
68655
|
-
var info =
|
|
68801
|
+
for (var _i = 0, indexInfos_9 = indexInfos; _i < indexInfos_9.length; _i++) {
|
|
68802
|
+
var info = indexInfos_9[_i];
|
|
68656
68803
|
_loop_27(info);
|
|
68657
68804
|
}
|
|
68658
68805
|
}
|
|
@@ -68671,8 +68818,8 @@ var ts;
|
|
|
68671
68818
|
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));
|
|
68672
68819
|
}
|
|
68673
68820
|
};
|
|
68674
|
-
for (var _i = 0,
|
|
68675
|
-
var info =
|
|
68821
|
+
for (var _i = 0, indexInfos_10 = indexInfos; _i < indexInfos_10.length; _i++) {
|
|
68822
|
+
var info = indexInfos_10[_i];
|
|
68676
68823
|
_loop_28(info);
|
|
68677
68824
|
}
|
|
68678
68825
|
}
|
|
@@ -71640,13 +71787,13 @@ var ts;
|
|
|
71640
71787
|
var fileToDirective;
|
|
71641
71788
|
if (resolvedTypeReferenceDirectives) {
|
|
71642
71789
|
fileToDirective = new ts.Map();
|
|
71643
|
-
resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key) {
|
|
71790
|
+
resolvedTypeReferenceDirectives.forEach(function (resolvedDirective, key, mode) {
|
|
71644
71791
|
if (!resolvedDirective || !resolvedDirective.resolvedFileName) {
|
|
71645
71792
|
return;
|
|
71646
71793
|
}
|
|
71647
71794
|
var file = host.getSourceFile(resolvedDirective.resolvedFileName);
|
|
71648
71795
|
if (file) {
|
|
71649
|
-
addReferencedFilesToTypeDirective(file, key);
|
|
71796
|
+
addReferencedFilesToTypeDirective(file, key, mode);
|
|
71650
71797
|
}
|
|
71651
71798
|
});
|
|
71652
71799
|
}
|
|
@@ -71824,16 +71971,16 @@ var ts;
|
|
|
71824
71971
|
}
|
|
71825
71972
|
return false;
|
|
71826
71973
|
}
|
|
71827
|
-
function addReferencedFilesToTypeDirective(file, key) {
|
|
71974
|
+
function addReferencedFilesToTypeDirective(file, key, mode) {
|
|
71828
71975
|
if (fileToDirective.has(file.path))
|
|
71829
71976
|
return;
|
|
71830
|
-
fileToDirective.set(file.path, key);
|
|
71977
|
+
fileToDirective.set(file.path, [key, mode]);
|
|
71831
71978
|
for (var _i = 0, _a = file.referencedFiles; _i < _a.length; _i++) {
|
|
71832
|
-
var
|
|
71979
|
+
var _b = _a[_i], fileName = _b.fileName, resolutionMode = _b.resolutionMode;
|
|
71833
71980
|
var resolvedFile = ts.resolveTripleslashReference(fileName, file.fileName);
|
|
71834
71981
|
var referencedFile = host.getSourceFile(resolvedFile);
|
|
71835
71982
|
if (referencedFile) {
|
|
71836
|
-
addReferencedFilesToTypeDirective(referencedFile, key);
|
|
71983
|
+
addReferencedFilesToTypeDirective(referencedFile, key, resolutionMode || file.impliedNodeFormat);
|
|
71837
71984
|
}
|
|
71838
71985
|
}
|
|
71839
71986
|
}
|
|
@@ -73424,25 +73571,24 @@ var ts;
|
|
|
73424
73571
|
}
|
|
73425
73572
|
function findMostOverlappyType(source, unionTarget) {
|
|
73426
73573
|
var bestMatch;
|
|
73427
|
-
|
|
73428
|
-
|
|
73429
|
-
var
|
|
73430
|
-
|
|
73431
|
-
|
|
73432
|
-
|
|
73433
|
-
|
|
73434
|
-
|
|
73435
|
-
|
|
73436
|
-
|
|
73437
|
-
|
|
73438
|
-
|
|
73439
|
-
|
|
73574
|
+
if (!(source.flags & (131068 | 406847488))) {
|
|
73575
|
+
var matchingCount = 0;
|
|
73576
|
+
for (var _i = 0, _a = unionTarget.types; _i < _a.length; _i++) {
|
|
73577
|
+
var target = _a[_i];
|
|
73578
|
+
if (!(target.flags & (131068 | 406847488))) {
|
|
73579
|
+
var overlap = getIntersectionType([getIndexType(source), getIndexType(target)]);
|
|
73580
|
+
if (overlap.flags & 4194304) {
|
|
73581
|
+
return target;
|
|
73582
|
+
}
|
|
73583
|
+
else if (isUnitType(overlap) || overlap.flags & 1048576) {
|
|
73584
|
+
var len = overlap.flags & 1048576 ? ts.countWhere(overlap.types, isUnitType) : 1;
|
|
73585
|
+
if (len >= matchingCount) {
|
|
73586
|
+
bestMatch = target;
|
|
73587
|
+
matchingCount = len;
|
|
73588
|
+
}
|
|
73589
|
+
}
|
|
73440
73590
|
}
|
|
73441
73591
|
}
|
|
73442
|
-
else if (isUnitType(overlap) && 1 >= matchingCount) {
|
|
73443
|
-
bestMatch = target;
|
|
73444
|
-
matchingCount = 1;
|
|
73445
|
-
}
|
|
73446
73592
|
}
|
|
73447
73593
|
return bestMatch;
|
|
73448
73594
|
}
|
|
@@ -73767,7 +73913,7 @@ var ts;
|
|
|
73767
73913
|
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));
|
|
73768
73914
|
case 180:
|
|
73769
73915
|
ts.Debug.type(node);
|
|
73770
|
-
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName));
|
|
73916
|
+
return factory.updateTypeQueryNode(node, nodeVisitor(node.exprName, visitor, ts.isEntityName), nodesVisitor(node.typeArguments, visitor, ts.isTypeNode));
|
|
73771
73917
|
case 181:
|
|
73772
73918
|
ts.Debug.type(node);
|
|
73773
73919
|
return factory.updateTypeLiteralNode(node, nodesVisitor(node.members, visitor, ts.isTypeElement));
|
|
@@ -75986,8 +76132,8 @@ var ts;
|
|
|
75986
76132
|
function generateClassElementDecorationExpressions(node, isStatic) {
|
|
75987
76133
|
var members = getDecoratedClassElements(node, isStatic);
|
|
75988
76134
|
var expressions;
|
|
75989
|
-
for (var _i = 0,
|
|
75990
|
-
var member =
|
|
76135
|
+
for (var _i = 0, members_8 = members; _i < members_8.length; _i++) {
|
|
76136
|
+
var member = members_8[_i];
|
|
75991
76137
|
var expression = generateClassElementDecorationExpression(node, member);
|
|
75992
76138
|
if (expression) {
|
|
75993
76139
|
if (!expressions) {
|
|
@@ -80124,8 +80270,8 @@ var ts;
|
|
|
80124
80270
|
function convertJsxChildrenToChildrenPropAssignment(children) {
|
|
80125
80271
|
var nonWhitespaceChildren = ts.getSemanticJsxChildren(children);
|
|
80126
80272
|
if (ts.length(nonWhitespaceChildren) === 1 && !nonWhitespaceChildren[0].dotDotDotToken) {
|
|
80127
|
-
var
|
|
80128
|
-
return
|
|
80273
|
+
var result_13 = transformJsxChildToExpression(nonWhitespaceChildren[0]);
|
|
80274
|
+
return result_13 && factory.createPropertyAssignment("children", result_13);
|
|
80129
80275
|
}
|
|
80130
80276
|
var result = ts.mapDefined(children, transformJsxChildToExpression);
|
|
80131
80277
|
return ts.length(result) ? factory.createPropertyAssignment("children", factory.createArrayLiteralExpression(result)) : undefined;
|
|
@@ -87126,7 +87272,7 @@ var ts;
|
|
|
87126
87272
|
var sourceFile = ts.createUnparsedSourceFile(prepend, "dts", stripInternal);
|
|
87127
87273
|
hasNoDefaultLib_1 = hasNoDefaultLib_1 || !!sourceFile.hasNoDefaultLib;
|
|
87128
87274
|
collectReferences(sourceFile, refs);
|
|
87129
|
-
recordTypeReferenceDirectivesIfNecessary(sourceFile.typeReferenceDirectives);
|
|
87275
|
+
recordTypeReferenceDirectivesIfNecessary(ts.map(sourceFile.typeReferenceDirectives, function (ref) { return [ref.fileName, ref.resolutionMode]; }));
|
|
87130
87276
|
collectLibs(sourceFile, libs);
|
|
87131
87277
|
return sourceFile;
|
|
87132
87278
|
}
|
|
@@ -87180,9 +87326,10 @@ var ts;
|
|
|
87180
87326
|
return ts.map(ts.arrayFrom(libs.keys()), function (lib) { return ({ fileName: lib, pos: -1, end: -1 }); });
|
|
87181
87327
|
}
|
|
87182
87328
|
function getFileReferencesForUsedTypeReferences() {
|
|
87183
|
-
return necessaryTypeReferences ? ts.mapDefined(ts.arrayFrom(necessaryTypeReferences.keys()),
|
|
87329
|
+
return necessaryTypeReferences ? ts.mapDefined(ts.arrayFrom(necessaryTypeReferences.keys()), getFileReferenceForSpecifierModeTuple) : [];
|
|
87184
87330
|
}
|
|
87185
|
-
function
|
|
87331
|
+
function getFileReferenceForSpecifierModeTuple(_a) {
|
|
87332
|
+
var typeName = _a[0], mode = _a[1];
|
|
87186
87333
|
if (emittedImports) {
|
|
87187
87334
|
for (var _i = 0, emittedImports_1 = emittedImports; _i < emittedImports_1.length; _i++) {
|
|
87188
87335
|
var importStatement = emittedImports_1[_i];
|
|
@@ -87197,7 +87344,7 @@ var ts;
|
|
|
87197
87344
|
}
|
|
87198
87345
|
}
|
|
87199
87346
|
}
|
|
87200
|
-
return { fileName: typeName, pos: -1, end: -1 };
|
|
87347
|
+
return __assign({ fileName: typeName, pos: -1, end: -1 }, (mode ? { resolutionMode: mode } : undefined));
|
|
87201
87348
|
}
|
|
87202
87349
|
function mapReferencesIntoArray(references, outputFilePath) {
|
|
87203
87350
|
return function (file) {
|
|
@@ -87214,7 +87361,7 @@ var ts;
|
|
|
87214
87361
|
if (declFileName) {
|
|
87215
87362
|
var specifier = ts.moduleSpecifiers.getModuleSpecifier(options, currentSourceFile, ts.toPath(outputFilePath, host.getCurrentDirectory(), host.getCanonicalFileName), ts.toPath(declFileName, host.getCurrentDirectory(), host.getCanonicalFileName), host);
|
|
87216
87363
|
if (!ts.pathIsRelative(specifier)) {
|
|
87217
|
-
recordTypeReferenceDirectivesIfNecessary([specifier]);
|
|
87364
|
+
recordTypeReferenceDirectivesIfNecessary([[specifier, undefined]]);
|
|
87218
87365
|
return;
|
|
87219
87366
|
}
|
|
87220
87367
|
var fileName = ts.getRelativePathToDirectoryOrUrl(outputFilePath, declFileName, host.getCurrentDirectory(), host.getCanonicalFileName, false);
|
|
@@ -89984,6 +90131,8 @@ var ts;
|
|
|
89984
90131
|
return emitAsExpression(node);
|
|
89985
90132
|
case 229:
|
|
89986
90133
|
return emitNonNullExpression(node);
|
|
90134
|
+
case 227:
|
|
90135
|
+
return emitExpressionWithTypeArguments(node);
|
|
89987
90136
|
case 230:
|
|
89988
90137
|
return emitMetaProperty(node);
|
|
89989
90138
|
case 231:
|
|
@@ -90377,6 +90526,7 @@ var ts;
|
|
|
90377
90526
|
writeKeyword("typeof");
|
|
90378
90527
|
writeSpace();
|
|
90379
90528
|
emit(node.exprName);
|
|
90529
|
+
emitTypeArguments(node, node.typeArguments);
|
|
90380
90530
|
}
|
|
90381
90531
|
function emitTypeLiteral(node) {
|
|
90382
90532
|
writePunctuation("{");
|
|
@@ -91849,9 +91999,12 @@ var ts;
|
|
|
91849
91999
|
for (var _d = 0, types_24 = types; _d < types_24.length; _d++) {
|
|
91850
92000
|
var directive = types_24[_d];
|
|
91851
92001
|
var pos = writer.getTextPos();
|
|
91852
|
-
|
|
92002
|
+
var resolutionMode = directive.resolutionMode && directive.resolutionMode !== (currentSourceFile === null || currentSourceFile === void 0 ? void 0 : currentSourceFile.impliedNodeFormat)
|
|
92003
|
+
? "resolution-mode=\"" + (directive.resolutionMode === ts.ModuleKind.ESNext ? "import" : "require") + "\""
|
|
92004
|
+
: "";
|
|
92005
|
+
writeComment("/// <reference types=\"" + directive.fileName + "\" " + resolutionMode + "/>");
|
|
91853
92006
|
if (bundleFileInfo)
|
|
91854
|
-
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: "type", data: directive.fileName });
|
|
92007
|
+
bundleFileInfo.sections.push({ pos: pos, end: writer.getTextPos(), kind: !directive.resolutionMode ? "type" : directive.resolutionMode === ts.ModuleKind.ESNext ? "type-import" : "type-require", data: directive.fileName });
|
|
91855
92008
|
writeLine();
|
|
91856
92009
|
}
|
|
91857
92010
|
for (var _e = 0, libs_1 = libs; _e < libs_1.length; _e++) {
|
|
@@ -94157,7 +94310,7 @@ var ts;
|
|
|
94157
94310
|
return result;
|
|
94158
94311
|
}
|
|
94159
94312
|
ts.flattenDiagnosticMessageText = flattenDiagnosticMessageText;
|
|
94160
|
-
function
|
|
94313
|
+
function loadWithTypeDirectiveCache(names, containingFile, redirectedReference, containingFileMode, loader) {
|
|
94161
94314
|
if (names.length === 0) {
|
|
94162
94315
|
return [];
|
|
94163
94316
|
}
|
|
@@ -94166,18 +94319,25 @@ var ts;
|
|
|
94166
94319
|
for (var _i = 0, names_2 = names; _i < names_2.length; _i++) {
|
|
94167
94320
|
var name = names_2[_i];
|
|
94168
94321
|
var result = void 0;
|
|
94169
|
-
|
|
94170
|
-
|
|
94322
|
+
var mode = getModeForFileReference(name, containingFileMode);
|
|
94323
|
+
var strName = ts.isString(name) ? name : name.fileName.toLowerCase();
|
|
94324
|
+
var cacheKey = mode !== undefined ? mode + "|" + strName : strName;
|
|
94325
|
+
if (cache.has(cacheKey)) {
|
|
94326
|
+
result = cache.get(cacheKey);
|
|
94171
94327
|
}
|
|
94172
94328
|
else {
|
|
94173
|
-
cache.set(
|
|
94329
|
+
cache.set(cacheKey, result = loader(strName, containingFile, redirectedReference, mode));
|
|
94174
94330
|
}
|
|
94175
94331
|
resolutions.push(result);
|
|
94176
94332
|
}
|
|
94177
94333
|
return resolutions;
|
|
94178
94334
|
}
|
|
94179
|
-
ts.
|
|
94335
|
+
ts.loadWithTypeDirectiveCache = loadWithTypeDirectiveCache;
|
|
94180
94336
|
;
|
|
94337
|
+
function getModeForFileReference(ref, containingFileMode) {
|
|
94338
|
+
return (ts.isString(ref) ? containingFileMode : ref.resolutionMode) || containingFileMode;
|
|
94339
|
+
}
|
|
94340
|
+
ts.getModeForFileReference = getModeForFileReference;
|
|
94181
94341
|
function getModeForResolutionAtIndex(file, index) {
|
|
94182
94342
|
if (file.impliedNodeFormat === undefined)
|
|
94183
94343
|
return undefined;
|
|
@@ -94266,7 +94426,7 @@ var ts;
|
|
|
94266
94426
|
var _d, _e, _f, _g;
|
|
94267
94427
|
var file = ts.Debug.checkDefined(getSourceFileByPath(ref.file));
|
|
94268
94428
|
var kind = ref.kind, index = ref.index;
|
|
94269
|
-
var pos, end, packageId;
|
|
94429
|
+
var pos, end, packageId, resolutionMode;
|
|
94270
94430
|
switch (kind) {
|
|
94271
94431
|
case ts.FileIncludeKind.Import:
|
|
94272
94432
|
var importLiteral = getModuleNameStringLiteralAt(file, index);
|
|
@@ -94280,8 +94440,8 @@ var ts;
|
|
|
94280
94440
|
(_a = file.referencedFiles[index], pos = _a.pos, end = _a.end);
|
|
94281
94441
|
break;
|
|
94282
94442
|
case ts.FileIncludeKind.TypeReferenceDirective:
|
|
94283
|
-
(_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end);
|
|
94284
|
-
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;
|
|
94443
|
+
(_b = file.typeReferenceDirectives[index], pos = _b.pos, end = _b.end, resolutionMode = _b.resolutionMode);
|
|
94444
|
+
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;
|
|
94285
94445
|
break;
|
|
94286
94446
|
case ts.FileIncludeKind.LibReferenceDirective:
|
|
94287
94447
|
(_c = file.libReferenceDirectives[index], pos = _c.pos, end = _c.end);
|
|
@@ -94487,7 +94647,7 @@ var ts;
|
|
|
94487
94647
|
var fileReasons = ts.createMultiMap();
|
|
94488
94648
|
var cachedBindAndCheckDiagnosticsForFile = {};
|
|
94489
94649
|
var cachedDeclarationDiagnosticsForFile = {};
|
|
94490
|
-
var resolvedTypeReferenceDirectives =
|
|
94650
|
+
var resolvedTypeReferenceDirectives = ts.createModeAwareCache();
|
|
94491
94651
|
var fileProcessingDiagnostics;
|
|
94492
94652
|
var maxNodeModuleJsDepth = typeof options.maxNodeModuleJsDepth === "number" ? options.maxNodeModuleJsDepth : 0;
|
|
94493
94653
|
var currentNodeModulesDepth = 0;
|
|
@@ -94528,12 +94688,12 @@ var ts;
|
|
|
94528
94688
|
}
|
|
94529
94689
|
var actualResolveTypeReferenceDirectiveNamesWorker;
|
|
94530
94690
|
if (host.resolveTypeReferenceDirectives) {
|
|
94531
|
-
actualResolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference) { return host.resolveTypeReferenceDirectives(ts.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options); };
|
|
94691
|
+
actualResolveTypeReferenceDirectiveNamesWorker = function (typeDirectiveNames, containingFile, redirectedReference, containingFileMode) { return host.resolveTypeReferenceDirectives(ts.Debug.checkEachDefined(typeDirectiveNames), containingFile, redirectedReference, options, containingFileMode); };
|
|
94532
94692
|
}
|
|
94533
94693
|
else {
|
|
94534
94694
|
typeReferenceDirectiveResolutionCache = ts.createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, undefined, moduleResolutionCache === null || moduleResolutionCache === void 0 ? void 0 : moduleResolutionCache.getPackageJsonInfoCache());
|
|
94535
|
-
var loader_2 = function (typesRef, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; };
|
|
94536
|
-
actualResolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference) { return
|
|
94695
|
+
var loader_2 = function (typesRef, containingFile, redirectedReference, resolutionMode) { return ts.resolveTypeReferenceDirective(typesRef, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache, resolutionMode).resolvedTypeReferenceDirective; };
|
|
94696
|
+
actualResolveTypeReferenceDirectiveNamesWorker = function (typeReferenceDirectiveNames, containingFile, redirectedReference, containingFileMode) { return loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_2); };
|
|
94537
94697
|
}
|
|
94538
94698
|
var packageIdToSourceFile = new ts.Map();
|
|
94539
94699
|
var sourceFileToPackageName = new ts.Map();
|
|
@@ -94612,7 +94772,7 @@ var ts;
|
|
|
94612
94772
|
var containingFilename = ts.combinePaths(containingDirectory, ts.inferredTypesContainingFile);
|
|
94613
94773
|
var resolutions = resolveTypeReferenceDirectiveNamesWorker(typeReferences, containingFilename);
|
|
94614
94774
|
for (var i = 0; i < typeReferences.length; i++) {
|
|
94615
|
-
processTypeReferenceDirective(typeReferences[i], resolutions[i], { kind: ts.FileIncludeKind.AutomaticTypeDirectiveFile, typeReference: typeReferences[i], packageId: (_c = resolutions[i]) === null || _c === void 0 ? void 0 : _c.packageId });
|
|
94775
|
+
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 });
|
|
94616
94776
|
}
|
|
94617
94777
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
94618
94778
|
}
|
|
@@ -94760,9 +94920,10 @@ var ts;
|
|
|
94760
94920
|
return [];
|
|
94761
94921
|
var containingFileName = !ts.isString(containingFile) ? ts.getNormalizedAbsolutePath(containingFile.originalFileName, currentDirectory) : containingFile;
|
|
94762
94922
|
var redirectedReference = !ts.isString(containingFile) ? getRedirectReferenceForResolution(containingFile) : undefined;
|
|
94923
|
+
var containingFileMode = !ts.isString(containingFile) ? containingFile.impliedNodeFormat : undefined;
|
|
94763
94924
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("program", "resolveTypeReferenceDirectiveNamesWorker", { containingFileName: containingFileName });
|
|
94764
94925
|
ts.performance.mark("beforeResolveTypeReference");
|
|
94765
|
-
var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference);
|
|
94926
|
+
var result = actualResolveTypeReferenceDirectiveNamesWorker(typeDirectiveNames, containingFileName, redirectedReference, containingFileMode);
|
|
94766
94927
|
ts.performance.mark("afterResolveTypeReference");
|
|
94767
94928
|
ts.performance.measure("ResolveTypeReference", "beforeResolveTypeReference", "afterResolveTypeReference");
|
|
94768
94929
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
@@ -94839,15 +95000,15 @@ var ts;
|
|
|
94839
95000
|
}
|
|
94840
95001
|
var oldSourceFile = oldProgram && oldProgram.getSourceFile(file.fileName);
|
|
94841
95002
|
if (oldSourceFile !== file && file.resolvedModules) {
|
|
94842
|
-
var
|
|
95003
|
+
var result_14 = [];
|
|
94843
95004
|
var i = 0;
|
|
94844
95005
|
for (var _i = 0, moduleNames_1 = moduleNames; _i < moduleNames_1.length; _i++) {
|
|
94845
95006
|
var moduleName = moduleNames_1[_i];
|
|
94846
95007
|
var resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
|
94847
95008
|
i++;
|
|
94848
|
-
|
|
95009
|
+
result_14.push(resolvedModule);
|
|
94849
95010
|
}
|
|
94850
|
-
return
|
|
95011
|
+
return result_14;
|
|
94851
95012
|
}
|
|
94852
95013
|
var unknownModuleNames;
|
|
94853
95014
|
var result;
|
|
@@ -95064,7 +95225,7 @@ var ts;
|
|
|
95064
95225
|
else {
|
|
95065
95226
|
newSourceFile.resolvedModules = oldSourceFile.resolvedModules;
|
|
95066
95227
|
}
|
|
95067
|
-
var typesReferenceDirectives =
|
|
95228
|
+
var typesReferenceDirectives = newSourceFile.typeReferenceDirectives;
|
|
95068
95229
|
var typeReferenceResolutions = resolveTypeReferenceDirectiveNamesWorker(typesReferenceDirectives, newSourceFile);
|
|
95069
95230
|
var typeReferenceResolutionsChanged = ts.hasChangesInResolutions(typesReferenceDirectives, typeReferenceResolutions, oldSourceFile.resolvedTypeReferenceDirectiveNames, oldSourceFile, ts.typeDirectiveIsEqualTo);
|
|
95070
95231
|
if (typeReferenceResolutionsChanged) {
|
|
@@ -96015,7 +96176,7 @@ var ts;
|
|
|
96015
96176
|
});
|
|
96016
96177
|
}
|
|
96017
96178
|
function processTypeReferenceDirectives(file) {
|
|
96018
|
-
var typeDirectives =
|
|
96179
|
+
var typeDirectives = file.typeReferenceDirectives;
|
|
96019
96180
|
if (!typeDirectives) {
|
|
96020
96181
|
return;
|
|
96021
96182
|
}
|
|
@@ -96025,16 +96186,20 @@ var ts;
|
|
|
96025
96186
|
var resolvedTypeReferenceDirective = resolutions[index];
|
|
96026
96187
|
var fileName = ts.toFileNameLowerCase(ref.fileName);
|
|
96027
96188
|
ts.setResolvedTypeReferenceDirective(file, fileName, resolvedTypeReferenceDirective);
|
|
96028
|
-
|
|
96189
|
+
var mode = ref.resolutionMode || file.impliedNodeFormat;
|
|
96190
|
+
if (mode && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.Node12 && ts.getEmitModuleResolutionKind(options) !== ts.ModuleResolutionKind.NodeNext) {
|
|
96191
|
+
programDiagnostics.add(ts.createDiagnosticForRange(file, ref, ts.Diagnostics.Resolution_modes_are_only_supported_when_moduleResolution_is_node12_or_nodenext));
|
|
96192
|
+
}
|
|
96193
|
+
processTypeReferenceDirective(fileName, mode, resolvedTypeReferenceDirective, { kind: ts.FileIncludeKind.TypeReferenceDirective, file: file.path, index: index, });
|
|
96029
96194
|
}
|
|
96030
96195
|
}
|
|
96031
|
-
function processTypeReferenceDirective(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {
|
|
96196
|
+
function processTypeReferenceDirective(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) {
|
|
96032
96197
|
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 });
|
|
96033
|
-
processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason);
|
|
96198
|
+
processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason);
|
|
96034
96199
|
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
96035
96200
|
}
|
|
96036
|
-
function processTypeReferenceDirectiveWorker(typeReferenceDirective, resolvedTypeReferenceDirective, reason) {
|
|
96037
|
-
var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective);
|
|
96201
|
+
function processTypeReferenceDirectiveWorker(typeReferenceDirective, mode, resolvedTypeReferenceDirective, reason) {
|
|
96202
|
+
var previousResolution = resolvedTypeReferenceDirectives.get(typeReferenceDirective, mode);
|
|
96038
96203
|
if (previousResolution && previousResolution.primary) {
|
|
96039
96204
|
return;
|
|
96040
96205
|
}
|
|
@@ -96067,7 +96232,7 @@ var ts;
|
|
|
96067
96232
|
addFilePreprocessingFileExplainingDiagnostic(undefined, reason, ts.Diagnostics.Cannot_find_type_definition_file_for_0, [typeReferenceDirective]);
|
|
96068
96233
|
}
|
|
96069
96234
|
if (saveResolution) {
|
|
96070
|
-
resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective);
|
|
96235
|
+
resolvedTypeReferenceDirectives.set(typeReferenceDirective, mode, resolvedTypeReferenceDirective);
|
|
96071
96236
|
}
|
|
96072
96237
|
}
|
|
96073
96238
|
function pathForLibFile(libFileName) {
|
|
@@ -98476,9 +98641,9 @@ var ts;
|
|
|
98476
98641
|
});
|
|
98477
98642
|
hasChangedAutomaticTypeDirectiveNames = false;
|
|
98478
98643
|
}
|
|
98479
|
-
function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference) {
|
|
98644
|
+
function resolveModuleName(moduleName, containingFile, compilerOptions, host, redirectedReference, _containingSourceFile, mode) {
|
|
98480
98645
|
var _a;
|
|
98481
|
-
var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference);
|
|
98646
|
+
var primaryResult = ts.resolveModuleName(moduleName, containingFile, compilerOptions, host, moduleResolutionCache, redirectedReference, mode);
|
|
98482
98647
|
if (!resolutionHost.getGlobalCache) {
|
|
98483
98648
|
return primaryResult;
|
|
98484
98649
|
}
|
|
@@ -98493,12 +98658,12 @@ var ts;
|
|
|
98493
98658
|
}
|
|
98494
98659
|
return primaryResult;
|
|
98495
98660
|
}
|
|
98496
|
-
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference) {
|
|
98497
|
-
return ts.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache);
|
|
98661
|
+
function resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, _containingSourceFile, resolutionMode) {
|
|
98662
|
+
return ts.resolveTypeReferenceDirective(typeReferenceDirectiveName, containingFile, options, host, redirectedReference, typeReferenceDirectiveResolutionCache, resolutionMode);
|
|
98498
98663
|
}
|
|
98499
98664
|
function resolveNamesWithLocalCache(_a) {
|
|
98500
98665
|
var _b, _c, _d;
|
|
98501
|
-
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;
|
|
98666
|
+
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;
|
|
98502
98667
|
var path = resolutionHost.toPath(containingFile);
|
|
98503
98668
|
var resolutionsInFile = cache.get(path) || cache.set(path, ts.createModeAwareCache()).get(path);
|
|
98504
98669
|
var dirPath = ts.getDirectoryPath(path);
|
|
@@ -98519,8 +98684,10 @@ var ts;
|
|
|
98519
98684
|
var seenNamesInFile = ts.createModeAwareCache();
|
|
98520
98685
|
var i = 0;
|
|
98521
98686
|
for (var _i = 0, names_4 = names; _i < names_4.length; _i++) {
|
|
98522
|
-
var
|
|
98523
|
-
var
|
|
98687
|
+
var entry = names_4[_i];
|
|
98688
|
+
var name = ts.isString(entry) ? entry : entry.fileName.toLowerCase();
|
|
98689
|
+
var mode = !ts.isString(entry) ? ts.getModeForFileReference(entry, containingSourceFileMode) :
|
|
98690
|
+
containingSourceFile ? ts.getModeForResolutionAtIndex(containingSourceFile, i) : undefined;
|
|
98524
98691
|
i++;
|
|
98525
98692
|
var resolution = resolutionsInFile.get(name, mode);
|
|
98526
98693
|
if (!seenNamesInFile.has(name, mode) &&
|
|
@@ -98547,7 +98714,7 @@ var ts;
|
|
|
98547
98714
|
}
|
|
98548
98715
|
}
|
|
98549
98716
|
else {
|
|
98550
|
-
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile);
|
|
98717
|
+
resolution = loader(name, containingFile, compilerOptions, ((_c = resolutionHost.getCompilerHost) === null || _c === void 0 ? void 0 : _c.call(resolutionHost)) || resolutionHost, redirectedReference, containingSourceFile, mode);
|
|
98551
98718
|
perDirectoryResolution.set(name, mode, resolution);
|
|
98552
98719
|
if (resolutionHost.onDiscoveredSymlink && resolutionIsSymlink(resolution)) {
|
|
98553
98720
|
resolutionHost.onDiscoveredSymlink();
|
|
@@ -98609,7 +98776,7 @@ var ts;
|
|
|
98609
98776
|
return oldResult.resolvedFileName === newResult.resolvedFileName;
|
|
98610
98777
|
}
|
|
98611
98778
|
}
|
|
98612
|
-
function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference) {
|
|
98779
|
+
function resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode) {
|
|
98613
98780
|
return resolveNamesWithLocalCache({
|
|
98614
98781
|
names: typeDirectiveNames,
|
|
98615
98782
|
containingFile: containingFile,
|
|
@@ -98619,6 +98786,7 @@ var ts;
|
|
|
98619
98786
|
loader: resolveTypeReferenceDirective,
|
|
98620
98787
|
getResolutionWithResolvedFileName: getResolvedTypeReferenceDirective,
|
|
98621
98788
|
shouldRetryResolution: function (resolution) { return resolution.resolvedTypeReferenceDirective === undefined; },
|
|
98789
|
+
containingSourceFileMode: containingFileMode
|
|
98622
98790
|
});
|
|
98623
98791
|
}
|
|
98624
98792
|
function resolveModuleNames(moduleNames, containingFile, reusedNames, redirectedReference, containingSourceFile) {
|
|
@@ -99210,9 +99378,9 @@ var ts;
|
|
|
99210
99378
|
var targets = importedFileNames.map(function (f) { return ts.getNormalizedAbsolutePath(f, cwd); });
|
|
99211
99379
|
var shouldFilterIgnoredPaths = !ts.every(targets, ts.containsIgnoredPath);
|
|
99212
99380
|
if (!preferSymlinks) {
|
|
99213
|
-
var
|
|
99214
|
-
if (
|
|
99215
|
-
return
|
|
99381
|
+
var result_15 = ts.forEach(targets, function (p) { return !(shouldFilterIgnoredPaths && ts.containsIgnoredPath(p)) && cb(p, referenceRedirect === p); });
|
|
99382
|
+
if (result_15)
|
|
99383
|
+
return result_15;
|
|
99216
99384
|
}
|
|
99217
99385
|
var symlinkedDirectories = (_a = host.getSymlinkCache) === null || _a === void 0 ? void 0 : _a.call(host).getSymlinkedDirectoriesByRealpath();
|
|
99218
99386
|
var fullImportedFileName = ts.getNormalizedAbsolutePath(importedFileName, cwd);
|
|
@@ -99231,10 +99399,10 @@ var ts;
|
|
|
99231
99399
|
for (var _i = 0, symlinkDirectories_1 = symlinkDirectories; _i < symlinkDirectories_1.length; _i++) {
|
|
99232
99400
|
var symlinkDirectory = symlinkDirectories_1[_i];
|
|
99233
99401
|
var option = ts.resolvePath(symlinkDirectory, relative);
|
|
99234
|
-
var
|
|
99402
|
+
var result_16 = cb(option, target === referenceRedirect);
|
|
99235
99403
|
shouldFilterIgnoredPaths = true;
|
|
99236
|
-
if (
|
|
99237
|
-
return
|
|
99404
|
+
if (result_16)
|
|
99405
|
+
return result_16;
|
|
99238
99406
|
}
|
|
99239
99407
|
});
|
|
99240
99408
|
});
|
|
@@ -100310,7 +100478,7 @@ var ts;
|
|
|
100310
100478
|
}
|
|
100311
100479
|
return host.resolveTypeReferenceDirectives.apply(host, args);
|
|
100312
100480
|
}) :
|
|
100313
|
-
(function (typeDirectiveNames, containingFile, redirectedReference) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference); });
|
|
100481
|
+
(function (typeDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) { return resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode); });
|
|
100314
100482
|
var userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
|
100315
100483
|
builderProgram = readBuilderProgram(compilerOptions, compilerHost);
|
|
100316
100484
|
synchronizeProgram();
|
|
@@ -100964,9 +101132,9 @@ var ts;
|
|
|
100964
101132
|
compilerHost.getModuleResolutionCache = function () { return moduleResolutionCache; };
|
|
100965
101133
|
}
|
|
100966
101134
|
if (!compilerHost.resolveTypeReferenceDirectives) {
|
|
100967
|
-
var loader_4 = function (moduleName, containingFile, redirectedReference) { return ts.resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache).resolvedTypeReferenceDirective; };
|
|
100968
|
-
compilerHost.resolveTypeReferenceDirectives = function (typeReferenceDirectiveNames, containingFile, redirectedReference) {
|
|
100969
|
-
return ts.
|
|
101135
|
+
var loader_4 = function (moduleName, containingFile, redirectedReference, containingFileMode) { return ts.resolveTypeReferenceDirective(moduleName, containingFile, state.projectCompilerOptions, compilerHost, redirectedReference, state.typeReferenceDirectiveResolutionCache, containingFileMode).resolvedTypeReferenceDirective; };
|
|
101136
|
+
compilerHost.resolveTypeReferenceDirectives = function (typeReferenceDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) {
|
|
101137
|
+
return ts.loadWithTypeDirectiveCache(ts.Debug.checkEachDefined(typeReferenceDirectiveNames), containingFile, redirectedReference, containingFileMode, loader_4);
|
|
100970
101138
|
};
|
|
100971
101139
|
}
|
|
100972
101140
|
var _a = ts.createWatchFactory(hostWithWatch, options), watchFile = _a.watchFile, watchDirectory = _a.watchDirectory, writeLog = _a.writeLog;
|