typescript 4.5.0-dev.20210914 → 4.5.0-dev.20210919
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 +6 -0
- package/lib/de/diagnosticMessages.generated.json +6 -0
- package/lib/es/diagnosticMessages.generated.json +6 -0
- package/lib/fr/diagnosticMessages.generated.json +6 -0
- package/lib/it/diagnosticMessages.generated.json +6 -0
- package/lib/ja/diagnosticMessages.generated.json +6 -0
- package/lib/ko/diagnosticMessages.generated.json +6 -0
- package/lib/lib.es2018.intl.d.ts +2 -2
- package/lib/lib.es5.d.ts +5 -7
- package/lib/pl/diagnosticMessages.generated.json +6 -0
- package/lib/pt-br/diagnosticMessages.generated.json +6 -0
- package/lib/ru/diagnosticMessages.generated.json +6 -0
- package/lib/tr/diagnosticMessages.generated.json +6 -0
- package/lib/tsc.js +90 -23
- package/lib/tsserver.js +118 -32
- package/lib/tsserverlibrary.d.ts +2 -2
- package/lib/tsserverlibrary.js +118 -32
- package/lib/typescript.d.ts +2 -2
- package/lib/typescript.js +118 -32
- package/lib/typescriptServices.d.ts +2 -2
- package/lib/typescriptServices.js +118 -32
- package/lib/typingsInstaller.js +94 -24
- package/lib/zh-cn/diagnosticMessages.generated.json +6 -0
- package/lib/zh-tw/diagnosticMessages.generated.json +6 -0
- package/package.json +2 -2
|
@@ -294,7 +294,7 @@ var ts;
|
|
|
294
294
|
// The following is baselined as a literal template type without intervention
|
|
295
295
|
/** The version of the TypeScript compiler release */
|
|
296
296
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
297
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
297
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20210919";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -8837,6 +8837,7 @@ var ts;
|
|
|
8837
8837
|
Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."),
|
|
8838
8838
|
Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
|
|
8839
8839
|
Namespace_name_cannot_be_0: diag(2819, ts.DiagnosticCategory.Error, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
|
|
8840
|
+
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
8840
8841
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8841
8842
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8842
8843
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -8938,6 +8939,11 @@ var ts;
|
|
|
8938
8939
|
This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0: diag(4116, ts.DiagnosticCategory.Error, "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116", "This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),
|
|
8939
8940
|
This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4117, ts.DiagnosticCategory.Error, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
8940
8941
|
The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized: diag(4118, ts.DiagnosticCategory.Error, "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118", "The type of this node cannot be serialized because its property '{0}' cannot be serialized."),
|
|
8942
|
+
This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4119, ts.DiagnosticCategory.Error, "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119", "This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),
|
|
8943
|
+
This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4120, ts.DiagnosticCategory.Error, "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120", "This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),
|
|
8944
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),
|
|
8945
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
8946
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
8941
8947
|
The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
8942
8948
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
8943
8949
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -20872,6 +20878,15 @@ var ts;
|
|
|
20872
20878
|
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
|
20873
20879
|
}
|
|
20874
20880
|
ts.isInfinityOrNaNString = isInfinityOrNaNString;
|
|
20881
|
+
function isCatchClauseVariableDeclaration(node) {
|
|
20882
|
+
return node.kind === 252 /* VariableDeclaration */ && node.parent.kind === 290 /* CatchClause */;
|
|
20883
|
+
}
|
|
20884
|
+
ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration;
|
|
20885
|
+
function isParameterOrCatchClauseVariable(symbol) {
|
|
20886
|
+
var declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
|
|
20887
|
+
return !!declaration && (ts.isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
|
|
20888
|
+
}
|
|
20889
|
+
ts.isParameterOrCatchClauseVariable = isParameterOrCatchClauseVariable;
|
|
20875
20890
|
})(ts || (ts = {}));
|
|
20876
20891
|
/* @internal */
|
|
20877
20892
|
var ts;
|
|
@@ -62132,6 +62147,13 @@ var ts;
|
|
|
62132
62147
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;
|
|
62133
62148
|
}
|
|
62134
62149
|
else {
|
|
62150
|
+
if (source.flags & 128 /* StringLiteral */ && target.flags & 1048576 /* Union */) {
|
|
62151
|
+
var suggestedType = getSuggestedTypeForNonexistentStringLiteralType(source, target);
|
|
62152
|
+
if (suggestedType) {
|
|
62153
|
+
reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2, generalizedSourceType, targetType, typeToString(suggestedType));
|
|
62154
|
+
return;
|
|
62155
|
+
}
|
|
62156
|
+
}
|
|
62135
62157
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1;
|
|
62136
62158
|
}
|
|
62137
62159
|
}
|
|
@@ -67292,9 +67314,10 @@ var ts;
|
|
|
67292
67314
|
}
|
|
67293
67315
|
function isConstantReference(node) {
|
|
67294
67316
|
switch (node.kind) {
|
|
67295
|
-
case 79 /* Identifier */:
|
|
67317
|
+
case 79 /* Identifier */: {
|
|
67296
67318
|
var symbol = getResolvedSymbol(node);
|
|
67297
|
-
return isConstVariable(symbol) ||
|
|
67319
|
+
return isConstVariable(symbol) || ts.isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
|
|
67320
|
+
}
|
|
67298
67321
|
case 204 /* PropertyAccessExpression */:
|
|
67299
67322
|
case 205 /* ElementAccessExpression */:
|
|
67300
67323
|
// The resolvedSymbol property is initialized by checkPropertyAccess or checkElementAccess before we get here.
|
|
@@ -68376,35 +68399,37 @@ var ts;
|
|
|
68376
68399
|
node.kind === 165 /* PropertyDeclaration */;
|
|
68377
68400
|
});
|
|
68378
68401
|
}
|
|
68379
|
-
// Check if a parameter is assigned anywhere
|
|
68380
|
-
function
|
|
68402
|
+
// Check if a parameter or catch variable is assigned anywhere
|
|
68403
|
+
function isSymbolAssigned(symbol) {
|
|
68381
68404
|
if (!symbol.valueDeclaration) {
|
|
68382
68405
|
return false;
|
|
68383
68406
|
}
|
|
68384
|
-
var
|
|
68385
|
-
var links = getNodeLinks(
|
|
68407
|
+
var parent = ts.getRootDeclaration(symbol.valueDeclaration).parent;
|
|
68408
|
+
var links = getNodeLinks(parent);
|
|
68386
68409
|
if (!(links.flags & 8388608 /* AssignmentsMarked */)) {
|
|
68387
68410
|
links.flags |= 8388608 /* AssignmentsMarked */;
|
|
68388
|
-
if (!hasParentWithAssignmentsMarked(
|
|
68389
|
-
|
|
68411
|
+
if (!hasParentWithAssignmentsMarked(parent)) {
|
|
68412
|
+
markNodeAssignments(parent);
|
|
68390
68413
|
}
|
|
68391
68414
|
}
|
|
68392
68415
|
return symbol.isAssigned || false;
|
|
68393
68416
|
}
|
|
68394
68417
|
function hasParentWithAssignmentsMarked(node) {
|
|
68395
|
-
return !!ts.findAncestor(node.parent, function (node) {
|
|
68418
|
+
return !!ts.findAncestor(node.parent, function (node) {
|
|
68419
|
+
return (ts.isFunctionLike(node) || ts.isCatchClause(node)) && !!(getNodeLinks(node).flags & 8388608 /* AssignmentsMarked */);
|
|
68420
|
+
});
|
|
68396
68421
|
}
|
|
68397
|
-
function
|
|
68422
|
+
function markNodeAssignments(node) {
|
|
68398
68423
|
if (node.kind === 79 /* Identifier */) {
|
|
68399
68424
|
if (ts.isAssignmentTarget(node)) {
|
|
68400
68425
|
var symbol = getResolvedSymbol(node);
|
|
68401
|
-
if (
|
|
68426
|
+
if (ts.isParameterOrCatchClauseVariable(symbol)) {
|
|
68402
68427
|
symbol.isAssigned = true;
|
|
68403
68428
|
}
|
|
68404
68429
|
}
|
|
68405
68430
|
}
|
|
68406
68431
|
else {
|
|
68407
|
-
ts.forEachChild(node,
|
|
68432
|
+
ts.forEachChild(node, markNodeAssignments);
|
|
68408
68433
|
}
|
|
68409
68434
|
}
|
|
68410
68435
|
function isConstVariable(symbol) {
|
|
@@ -68464,7 +68489,19 @@ var ts;
|
|
|
68464
68489
|
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
|
|
68465
68490
|
}
|
|
68466
68491
|
function isExportOrExportExpression(location) {
|
|
68467
|
-
return !!ts.findAncestor(location, function (
|
|
68492
|
+
return !!ts.findAncestor(location, function (n) {
|
|
68493
|
+
var parent = n.parent;
|
|
68494
|
+
if (parent === undefined) {
|
|
68495
|
+
return "quit";
|
|
68496
|
+
}
|
|
68497
|
+
if (ts.isExportAssignment(parent)) {
|
|
68498
|
+
return parent.expression === n && ts.isEntityNameExpression(n);
|
|
68499
|
+
}
|
|
68500
|
+
if (ts.isExportSpecifier(parent)) {
|
|
68501
|
+
return parent.name === n || parent.propertyName === n;
|
|
68502
|
+
}
|
|
68503
|
+
return false;
|
|
68504
|
+
});
|
|
68468
68505
|
}
|
|
68469
68506
|
function markAliasReferenced(symbol, location) {
|
|
68470
68507
|
if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* Value */) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {
|
|
@@ -68613,7 +68650,7 @@ var ts;
|
|
|
68613
68650
|
// analysis to include the immediately enclosing function.
|
|
68614
68651
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 211 /* FunctionExpression */ ||
|
|
68615
68652
|
flowContainer.kind === 212 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) &&
|
|
68616
|
-
(isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !
|
|
68653
|
+
(isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !isSymbolAssigned(localOrExportSymbol))) {
|
|
68617
68654
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
68618
68655
|
}
|
|
68619
68656
|
// We only look for uninitialized variables in strict null checking mode, and only when we can analyze
|
|
@@ -71843,6 +71880,10 @@ var ts;
|
|
|
71843
71880
|
}
|
|
71844
71881
|
return suggestion;
|
|
71845
71882
|
}
|
|
71883
|
+
function getSuggestedTypeForNonexistentStringLiteralType(source, target) {
|
|
71884
|
+
var candidates = target.types.filter(function (type) { return !!(type.flags & 128 /* StringLiteral */); });
|
|
71885
|
+
return ts.getSpellingSuggestion(source.value, candidates, function (type) { return type.value; });
|
|
71886
|
+
}
|
|
71846
71887
|
/**
|
|
71847
71888
|
* Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough.
|
|
71848
71889
|
* Names less than length 3 only check for case-insensitive equality, not levenshtein distance.
|
|
@@ -80671,6 +80712,7 @@ var ts;
|
|
|
80671
80712
|
function checkClassMember(member, memberIsParameterProperty) {
|
|
80672
80713
|
var hasOverride = ts.hasOverrideModifier(member);
|
|
80673
80714
|
var hasStatic = ts.isStatic(member);
|
|
80715
|
+
var isJs = ts.isInJSFile(member);
|
|
80674
80716
|
if (baseWithThis && (hasOverride || compilerOptions.noImplicitOverride)) {
|
|
80675
80717
|
var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member);
|
|
80676
80718
|
if (!declaredProp) {
|
|
@@ -80684,8 +80726,12 @@ var ts;
|
|
|
80684
80726
|
if (prop && !baseProp && hasOverride) {
|
|
80685
80727
|
var suggestion = getSuggestedSymbolForNonexistentClassMember(ts.symbolName(declaredProp), baseType);
|
|
80686
80728
|
suggestion ?
|
|
80687
|
-
error(member,
|
|
80688
|
-
|
|
80729
|
+
error(member, isJs ?
|
|
80730
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 :
|
|
80731
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, baseClassName, symbolToString(suggestion)) :
|
|
80732
|
+
error(member, isJs ?
|
|
80733
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 :
|
|
80734
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName);
|
|
80689
80735
|
}
|
|
80690
80736
|
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) {
|
|
80691
80737
|
var baseHasAbstract = ts.some(baseProp.declarations, ts.hasAbstractModifier);
|
|
@@ -80694,8 +80740,12 @@ var ts;
|
|
|
80694
80740
|
}
|
|
80695
80741
|
if (!baseHasAbstract) {
|
|
80696
80742
|
var diag = memberIsParameterProperty ?
|
|
80697
|
-
|
|
80698
|
-
|
|
80743
|
+
isJs ?
|
|
80744
|
+
ts.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
80745
|
+
ts.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 :
|
|
80746
|
+
isJs ?
|
|
80747
|
+
ts.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
80748
|
+
ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;
|
|
80699
80749
|
error(member, diag, baseClassName);
|
|
80700
80750
|
}
|
|
80701
80751
|
else if (ts.hasAbstractModifier(member) && baseHasAbstract) {
|
|
@@ -80705,7 +80755,9 @@ var ts;
|
|
|
80705
80755
|
}
|
|
80706
80756
|
else if (hasOverride) {
|
|
80707
80757
|
var className = typeToString(type);
|
|
80708
|
-
error(member,
|
|
80758
|
+
error(member, isJs ?
|
|
80759
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class :
|
|
80760
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className);
|
|
80709
80761
|
}
|
|
80710
80762
|
}
|
|
80711
80763
|
}
|
|
@@ -112211,7 +112263,7 @@ var ts;
|
|
|
112211
112263
|
}
|
|
112212
112264
|
else {
|
|
112213
112265
|
ts.forEach(options.lib, function (libFileName, index) {
|
|
112214
|
-
processRootFile(
|
|
112266
|
+
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.LibFile, index: index });
|
|
112215
112267
|
});
|
|
112216
112268
|
}
|
|
112217
112269
|
}
|
|
@@ -112873,7 +112925,7 @@ var ts;
|
|
|
112873
112925
|
return equalityComparer(file.fileName, getDefaultLibraryFileName());
|
|
112874
112926
|
}
|
|
112875
112927
|
else {
|
|
112876
|
-
return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName,
|
|
112928
|
+
return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName, pathForLibFile(libFileName)); });
|
|
112877
112929
|
}
|
|
112878
112930
|
}
|
|
112879
112931
|
function getDiagnosticsProducingTypeChecker() {
|
|
@@ -113455,7 +113507,7 @@ var ts;
|
|
|
113455
113507
|
var libName = ts.toFileNameLowerCase(ref.fileName);
|
|
113456
113508
|
var libFileName = ts.libMap.get(libName);
|
|
113457
113509
|
if (libFileName) {
|
|
113458
|
-
return getSourceFile(
|
|
113510
|
+
return getSourceFile(pathForLibFile(libFileName));
|
|
113459
113511
|
}
|
|
113460
113512
|
}
|
|
113461
113513
|
/** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */
|
|
@@ -113866,13 +113918,31 @@ var ts;
|
|
|
113866
113918
|
resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective);
|
|
113867
113919
|
}
|
|
113868
113920
|
}
|
|
113921
|
+
function pathForLibFile(libFileName) {
|
|
113922
|
+
// Support resolving to lib.dom.d.ts -> @typescript/dom, and
|
|
113923
|
+
// lib.dom.iterable.d.ts -> @typescript/dom/iterable
|
|
113924
|
+
// lib.es2015.symbol.wellknown.d.ts -> @typescript/es2015/symbol-wellknown
|
|
113925
|
+
var components = libFileName.split(".");
|
|
113926
|
+
var path = components[1];
|
|
113927
|
+
var i = 2;
|
|
113928
|
+
while (components[i] && components[i] !== "d") {
|
|
113929
|
+
path += (i === 2 ? "/" : "-") + components[i];
|
|
113930
|
+
i++;
|
|
113931
|
+
}
|
|
113932
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
|
|
113933
|
+
var localOverrideModuleResult = ts.resolveModuleName("@typescript/" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
113934
|
+
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
113935
|
+
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
113936
|
+
}
|
|
113937
|
+
return ts.combinePaths(defaultLibraryPath, libFileName);
|
|
113938
|
+
}
|
|
113869
113939
|
function processLibReferenceDirectives(file) {
|
|
113870
113940
|
ts.forEach(file.libReferenceDirectives, function (libReference, index) {
|
|
113871
113941
|
var libName = ts.toFileNameLowerCase(libReference.fileName);
|
|
113872
113942
|
var libFileName = ts.libMap.get(libName);
|
|
113873
113943
|
if (libFileName) {
|
|
113874
113944
|
// we ignore any 'no-default-lib' reference set on this file.
|
|
113875
|
-
processRootFile(
|
|
113945
|
+
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ true, { kind: ts.FileIncludeKind.LibReferenceDirective, file: file.path, index: index, });
|
|
113876
113946
|
}
|
|
113877
113947
|
else {
|
|
113878
113948
|
var unqualifiedLibName = ts.removeSuffix(ts.removePrefix(libName, "lib."), ".d.ts");
|
|
@@ -140891,11 +140961,11 @@ var ts;
|
|
|
140891
140961
|
var leadingTrivia = formattingScanner.getCurrentLeadingTrivia();
|
|
140892
140962
|
if (leadingTrivia) {
|
|
140893
140963
|
indentTriviaItems(leadingTrivia, indentation, /*indentNextTokenOrTrivia*/ false, function (item) { return processRange(item, sourceFile.getLineAndCharacterOfPosition(item.pos), enclosingNode, enclosingNode, /*dynamicIndentation*/ undefined); });
|
|
140964
|
+
if (options.trimTrailingWhitespace !== false) {
|
|
140965
|
+
trimTrailingWhitespacesForRemainingRange(leadingTrivia);
|
|
140966
|
+
}
|
|
140894
140967
|
}
|
|
140895
140968
|
}
|
|
140896
|
-
if (options.trimTrailingWhitespace !== false) {
|
|
140897
|
-
trimTrailingWhitespacesForRemainingRange();
|
|
140898
|
-
}
|
|
140899
140969
|
return edits;
|
|
140900
140970
|
// local functions
|
|
140901
140971
|
/** Tries to compute the indentation for a list element.
|
|
@@ -141464,12 +141534,27 @@ var ts;
|
|
|
141464
141534
|
return -1;
|
|
141465
141535
|
}
|
|
141466
141536
|
/**
|
|
141467
|
-
* Trimming will be done for lines after the previous range
|
|
141537
|
+
* Trimming will be done for lines after the previous range.
|
|
141538
|
+
* Exclude comments as they had been previously processed.
|
|
141468
141539
|
*/
|
|
141469
|
-
function trimTrailingWhitespacesForRemainingRange() {
|
|
141470
|
-
var
|
|
141471
|
-
var
|
|
141472
|
-
|
|
141540
|
+
function trimTrailingWhitespacesForRemainingRange(trivias) {
|
|
141541
|
+
var startPos = previousRange ? previousRange.end : originalRange.pos;
|
|
141542
|
+
for (var _i = 0, trivias_1 = trivias; _i < trivias_1.length; _i++) {
|
|
141543
|
+
var trivia = trivias_1[_i];
|
|
141544
|
+
if (ts.isComment(trivia.kind)) {
|
|
141545
|
+
if (startPos < trivia.pos) {
|
|
141546
|
+
trimTrailingWitespacesForPositions(startPos, trivia.pos - 1, previousRange);
|
|
141547
|
+
}
|
|
141548
|
+
startPos = trivia.end + 1;
|
|
141549
|
+
}
|
|
141550
|
+
}
|
|
141551
|
+
if (startPos < originalRange.end) {
|
|
141552
|
+
trimTrailingWitespacesForPositions(startPos, originalRange.end, previousRange);
|
|
141553
|
+
}
|
|
141554
|
+
}
|
|
141555
|
+
function trimTrailingWitespacesForPositions(startPos, endPos, previousRange) {
|
|
141556
|
+
var startLine = sourceFile.getLineAndCharacterOfPosition(startPos).line;
|
|
141557
|
+
var endLine = sourceFile.getLineAndCharacterOfPosition(endPos).line;
|
|
141473
141558
|
trimTrailingWhitespacesForLines(startLine, endLine + 1, previousRange);
|
|
141474
141559
|
}
|
|
141475
141560
|
function recordDelete(start, len) {
|
|
@@ -147414,6 +147499,7 @@ var ts;
|
|
|
147414
147499
|
ts.Diagnostics.Cannot_find_name_0_Did_you_mean_the_static_member_1_0.code,
|
|
147415
147500
|
ts.Diagnostics._0_has_no_exported_member_named_1_Did_you_mean_2.code,
|
|
147416
147501
|
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,
|
|
147502
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1.code,
|
|
147417
147503
|
// for JSX class components
|
|
147418
147504
|
ts.Diagnostics.No_overload_matches_this_call.code,
|
|
147419
147505
|
// for JSX FC
|
package/lib/typingsInstaller.js
CHANGED
|
@@ -89,7 +89,7 @@ var ts;
|
|
|
89
89
|
// The following is baselined as a literal template type without intervention
|
|
90
90
|
/** The version of the TypeScript compiler release */
|
|
91
91
|
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
|
92
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
92
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20210919";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -8632,6 +8632,7 @@ var ts;
|
|
|
8632
8632
|
Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block: diag(2817, ts.DiagnosticCategory.Error, "Property_0_has_no_initializer_and_is_not_definitely_assigned_in_a_class_static_block_2817", "Property '{0}' has no initializer and is not definitely assigned in a class static block."),
|
|
8633
8633
|
Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializers: diag(2818, ts.DiagnosticCategory.Error, "Duplicate_identifier_0_Compiler_reserves_name_1_when_emitting_super_references_in_static_initializer_2818", "Duplicate identifier '{0}'. Compiler reserves name '{1}' when emitting 'super' references in static initializers."),
|
|
8634
8634
|
Namespace_name_cannot_be_0: diag(2819, ts.DiagnosticCategory.Error, "Namespace_name_cannot_be_0_2819", "Namespace name cannot be '{0}'."),
|
|
8635
|
+
Type_0_is_not_assignable_to_type_1_Did_you_mean_2: diag(2820, ts.DiagnosticCategory.Error, "Type_0_is_not_assignable_to_type_1_Did_you_mean_2_2820", "Type '{0}' is not assignable to type '{1}'. Did you mean '{2}'?"),
|
|
8635
8636
|
Import_declaration_0_is_using_private_name_1: diag(4000, ts.DiagnosticCategory.Error, "Import_declaration_0_is_using_private_name_1_4000", "Import declaration '{0}' is using private name '{1}'."),
|
|
8636
8637
|
Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: diag(4002, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_class_has_or_is_using_private_name_1_4002", "Type parameter '{0}' of exported class has or is using private name '{1}'."),
|
|
8637
8638
|
Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: diag(4004, ts.DiagnosticCategory.Error, "Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1_4004", "Type parameter '{0}' of exported interface has or is using private name '{1}'."),
|
|
@@ -8733,6 +8734,11 @@ var ts;
|
|
|
8733
8734
|
This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared_in_the_base_class_0: diag(4116, ts.DiagnosticCategory.Error, "This_member_must_have_an_override_modifier_because_it_overrides_an_abstract_method_that_is_declared__4116", "This member must have an 'override' modifier because it overrides an abstract method that is declared in the base class '{0}'."),
|
|
8734
8735
|
This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4117, ts.DiagnosticCategory.Error, "This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you__4117", "This member cannot have an 'override' modifier because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
8735
8736
|
The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized: diag(4118, ts.DiagnosticCategory.Error, "The_type_of_this_node_cannot_be_serialized_because_its_property_0_cannot_be_serialized_4118", "The type of this node cannot be serialized because its property '{0}' cannot be serialized."),
|
|
8737
|
+
This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4119, ts.DiagnosticCategory.Error, "This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_4119", "This member must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),
|
|
8738
|
+
This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0: diag(4120, ts.DiagnosticCategory.Error, "This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_4120", "This parameter property must have a JSDoc comment with an '@override' tag because it overrides a member in the base class '{0}'."),
|
|
8739
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class: diag(4121, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_4121", "This member cannot have a JSDoc comment with an '@override' tag because its containing class '{0}' does not extend another class."),
|
|
8740
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0: diag(4122, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4122", "This member cannot have a JSDoc comment with an '@override' tag because it is not declared in the base class '{0}'."),
|
|
8741
|
+
This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1: diag(4123, ts.DiagnosticCategory.Error, "This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base__4123", "This member cannot have a JSDoc comment with an 'override' tag because it is not declared in the base class '{0}'. Did you mean '{1}'?"),
|
|
8736
8742
|
The_current_host_does_not_support_the_0_option: diag(5001, ts.DiagnosticCategory.Error, "The_current_host_does_not_support_the_0_option_5001", "The current host does not support the '{0}' option."),
|
|
8737
8743
|
Cannot_find_the_common_subdirectory_path_for_the_input_files: diag(5009, ts.DiagnosticCategory.Error, "Cannot_find_the_common_subdirectory_path_for_the_input_files_5009", "Cannot find the common subdirectory path for the input files."),
|
|
8738
8744
|
File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: diag(5010, ts.DiagnosticCategory.Error, "File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0_5010", "File specification cannot end in a recursive directory wildcard ('**'): '{0}'."),
|
|
@@ -20667,6 +20673,15 @@ var ts;
|
|
|
20667
20673
|
return name === "Infinity" || name === "-Infinity" || name === "NaN";
|
|
20668
20674
|
}
|
|
20669
20675
|
ts.isInfinityOrNaNString = isInfinityOrNaNString;
|
|
20676
|
+
function isCatchClauseVariableDeclaration(node) {
|
|
20677
|
+
return node.kind === 252 /* VariableDeclaration */ && node.parent.kind === 290 /* CatchClause */;
|
|
20678
|
+
}
|
|
20679
|
+
ts.isCatchClauseVariableDeclaration = isCatchClauseVariableDeclaration;
|
|
20680
|
+
function isParameterOrCatchClauseVariable(symbol) {
|
|
20681
|
+
var declaration = symbol.valueDeclaration && getRootDeclaration(symbol.valueDeclaration);
|
|
20682
|
+
return !!declaration && (ts.isParameter(declaration) || isCatchClauseVariableDeclaration(declaration));
|
|
20683
|
+
}
|
|
20684
|
+
ts.isParameterOrCatchClauseVariable = isParameterOrCatchClauseVariable;
|
|
20670
20685
|
})(ts || (ts = {}));
|
|
20671
20686
|
/* @internal */
|
|
20672
20687
|
var ts;
|
|
@@ -61927,6 +61942,13 @@ var ts;
|
|
|
61927
61942
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1_with_exactOptionalPropertyTypes_Colon_true_Consider_adding_undefined_to_the_types_of_the_target_s_properties;
|
|
61928
61943
|
}
|
|
61929
61944
|
else {
|
|
61945
|
+
if (source.flags & 128 /* StringLiteral */ && target.flags & 1048576 /* Union */) {
|
|
61946
|
+
var suggestedType = getSuggestedTypeForNonexistentStringLiteralType(source, target);
|
|
61947
|
+
if (suggestedType) {
|
|
61948
|
+
reportError(ts.Diagnostics.Type_0_is_not_assignable_to_type_1_Did_you_mean_2, generalizedSourceType, targetType, typeToString(suggestedType));
|
|
61949
|
+
return;
|
|
61950
|
+
}
|
|
61951
|
+
}
|
|
61930
61952
|
message = ts.Diagnostics.Type_0_is_not_assignable_to_type_1;
|
|
61931
61953
|
}
|
|
61932
61954
|
}
|
|
@@ -67087,9 +67109,10 @@ var ts;
|
|
|
67087
67109
|
}
|
|
67088
67110
|
function isConstantReference(node) {
|
|
67089
67111
|
switch (node.kind) {
|
|
67090
|
-
case 79 /* Identifier */:
|
|
67112
|
+
case 79 /* Identifier */: {
|
|
67091
67113
|
var symbol = getResolvedSymbol(node);
|
|
67092
|
-
return isConstVariable(symbol) ||
|
|
67114
|
+
return isConstVariable(symbol) || ts.isParameterOrCatchClauseVariable(symbol) && !isSymbolAssigned(symbol);
|
|
67115
|
+
}
|
|
67093
67116
|
case 204 /* PropertyAccessExpression */:
|
|
67094
67117
|
case 205 /* ElementAccessExpression */:
|
|
67095
67118
|
// The resolvedSymbol property is initialized by checkPropertyAccess or checkElementAccess before we get here.
|
|
@@ -68171,35 +68194,37 @@ var ts;
|
|
|
68171
68194
|
node.kind === 165 /* PropertyDeclaration */;
|
|
68172
68195
|
});
|
|
68173
68196
|
}
|
|
68174
|
-
// Check if a parameter is assigned anywhere
|
|
68175
|
-
function
|
|
68197
|
+
// Check if a parameter or catch variable is assigned anywhere
|
|
68198
|
+
function isSymbolAssigned(symbol) {
|
|
68176
68199
|
if (!symbol.valueDeclaration) {
|
|
68177
68200
|
return false;
|
|
68178
68201
|
}
|
|
68179
|
-
var
|
|
68180
|
-
var links = getNodeLinks(
|
|
68202
|
+
var parent = ts.getRootDeclaration(symbol.valueDeclaration).parent;
|
|
68203
|
+
var links = getNodeLinks(parent);
|
|
68181
68204
|
if (!(links.flags & 8388608 /* AssignmentsMarked */)) {
|
|
68182
68205
|
links.flags |= 8388608 /* AssignmentsMarked */;
|
|
68183
|
-
if (!hasParentWithAssignmentsMarked(
|
|
68184
|
-
|
|
68206
|
+
if (!hasParentWithAssignmentsMarked(parent)) {
|
|
68207
|
+
markNodeAssignments(parent);
|
|
68185
68208
|
}
|
|
68186
68209
|
}
|
|
68187
68210
|
return symbol.isAssigned || false;
|
|
68188
68211
|
}
|
|
68189
68212
|
function hasParentWithAssignmentsMarked(node) {
|
|
68190
|
-
return !!ts.findAncestor(node.parent, function (node) {
|
|
68213
|
+
return !!ts.findAncestor(node.parent, function (node) {
|
|
68214
|
+
return (ts.isFunctionLike(node) || ts.isCatchClause(node)) && !!(getNodeLinks(node).flags & 8388608 /* AssignmentsMarked */);
|
|
68215
|
+
});
|
|
68191
68216
|
}
|
|
68192
|
-
function
|
|
68217
|
+
function markNodeAssignments(node) {
|
|
68193
68218
|
if (node.kind === 79 /* Identifier */) {
|
|
68194
68219
|
if (ts.isAssignmentTarget(node)) {
|
|
68195
68220
|
var symbol = getResolvedSymbol(node);
|
|
68196
|
-
if (
|
|
68221
|
+
if (ts.isParameterOrCatchClauseVariable(symbol)) {
|
|
68197
68222
|
symbol.isAssigned = true;
|
|
68198
68223
|
}
|
|
68199
68224
|
}
|
|
68200
68225
|
}
|
|
68201
68226
|
else {
|
|
68202
|
-
ts.forEachChild(node,
|
|
68227
|
+
ts.forEachChild(node, markNodeAssignments);
|
|
68203
68228
|
}
|
|
68204
68229
|
}
|
|
68205
68230
|
function isConstVariable(symbol) {
|
|
@@ -68259,7 +68284,19 @@ var ts;
|
|
|
68259
68284
|
return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type;
|
|
68260
68285
|
}
|
|
68261
68286
|
function isExportOrExportExpression(location) {
|
|
68262
|
-
return !!ts.findAncestor(location, function (
|
|
68287
|
+
return !!ts.findAncestor(location, function (n) {
|
|
68288
|
+
var parent = n.parent;
|
|
68289
|
+
if (parent === undefined) {
|
|
68290
|
+
return "quit";
|
|
68291
|
+
}
|
|
68292
|
+
if (ts.isExportAssignment(parent)) {
|
|
68293
|
+
return parent.expression === n && ts.isEntityNameExpression(n);
|
|
68294
|
+
}
|
|
68295
|
+
if (ts.isExportSpecifier(parent)) {
|
|
68296
|
+
return parent.name === n || parent.propertyName === n;
|
|
68297
|
+
}
|
|
68298
|
+
return false;
|
|
68299
|
+
});
|
|
68263
68300
|
}
|
|
68264
68301
|
function markAliasReferenced(symbol, location) {
|
|
68265
68302
|
if (isNonLocalAlias(symbol, /*excludes*/ 111551 /* Value */) && !isInTypeQuery(location) && !getTypeOnlyAliasDeclaration(symbol)) {
|
|
@@ -68408,7 +68445,7 @@ var ts;
|
|
|
68408
68445
|
// analysis to include the immediately enclosing function.
|
|
68409
68446
|
while (flowContainer !== declarationContainer && (flowContainer.kind === 211 /* FunctionExpression */ ||
|
|
68410
68447
|
flowContainer.kind === 212 /* ArrowFunction */ || ts.isObjectLiteralOrClassExpressionMethodOrAccessor(flowContainer)) &&
|
|
68411
|
-
(isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !
|
|
68448
|
+
(isConstVariable(localOrExportSymbol) && type !== autoArrayType || isParameter && !isSymbolAssigned(localOrExportSymbol))) {
|
|
68412
68449
|
flowContainer = getControlFlowContainer(flowContainer);
|
|
68413
68450
|
}
|
|
68414
68451
|
// We only look for uninitialized variables in strict null checking mode, and only when we can analyze
|
|
@@ -71638,6 +71675,10 @@ var ts;
|
|
|
71638
71675
|
}
|
|
71639
71676
|
return suggestion;
|
|
71640
71677
|
}
|
|
71678
|
+
function getSuggestedTypeForNonexistentStringLiteralType(source, target) {
|
|
71679
|
+
var candidates = target.types.filter(function (type) { return !!(type.flags & 128 /* StringLiteral */); });
|
|
71680
|
+
return ts.getSpellingSuggestion(source.value, candidates, function (type) { return type.value; });
|
|
71681
|
+
}
|
|
71641
71682
|
/**
|
|
71642
71683
|
* Given a name and a list of symbols whose names are *not* equal to the name, return a spelling suggestion if there is one that is close enough.
|
|
71643
71684
|
* Names less than length 3 only check for case-insensitive equality, not levenshtein distance.
|
|
@@ -80466,6 +80507,7 @@ var ts;
|
|
|
80466
80507
|
function checkClassMember(member, memberIsParameterProperty) {
|
|
80467
80508
|
var hasOverride = ts.hasOverrideModifier(member);
|
|
80468
80509
|
var hasStatic = ts.isStatic(member);
|
|
80510
|
+
var isJs = ts.isInJSFile(member);
|
|
80469
80511
|
if (baseWithThis && (hasOverride || compilerOptions.noImplicitOverride)) {
|
|
80470
80512
|
var declaredProp = member.name && getSymbolAtLocation(member.name) || getSymbolAtLocation(member);
|
|
80471
80513
|
if (!declaredProp) {
|
|
@@ -80479,8 +80521,12 @@ var ts;
|
|
|
80479
80521
|
if (prop && !baseProp && hasOverride) {
|
|
80480
80522
|
var suggestion = getSuggestedSymbolForNonexistentClassMember(ts.symbolName(declaredProp), baseType);
|
|
80481
80523
|
suggestion ?
|
|
80482
|
-
error(member,
|
|
80483
|
-
|
|
80524
|
+
error(member, isJs ?
|
|
80525
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1 :
|
|
80526
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0_Did_you_mean_1, baseClassName, symbolToString(suggestion)) :
|
|
80527
|
+
error(member, isJs ?
|
|
80528
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_it_is_not_declared_in_the_base_class_0 :
|
|
80529
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0, baseClassName);
|
|
80484
80530
|
}
|
|
80485
80531
|
else if (prop && (baseProp === null || baseProp === void 0 ? void 0 : baseProp.declarations) && compilerOptions.noImplicitOverride && !nodeInAmbientContext) {
|
|
80486
80532
|
var baseHasAbstract = ts.some(baseProp.declarations, ts.hasAbstractModifier);
|
|
@@ -80489,8 +80535,12 @@ var ts;
|
|
|
80489
80535
|
}
|
|
80490
80536
|
if (!baseHasAbstract) {
|
|
80491
80537
|
var diag = memberIsParameterProperty ?
|
|
80492
|
-
|
|
80493
|
-
|
|
80538
|
+
isJs ?
|
|
80539
|
+
ts.Diagnostics.This_parameter_property_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
80540
|
+
ts.Diagnostics.This_parameter_property_must_have_an_override_modifier_because_it_overrides_a_member_in_base_class_0 :
|
|
80541
|
+
isJs ?
|
|
80542
|
+
ts.Diagnostics.This_member_must_have_a_JSDoc_comment_with_an_override_tag_because_it_overrides_a_member_in_the_base_class_0 :
|
|
80543
|
+
ts.Diagnostics.This_member_must_have_an_override_modifier_because_it_overrides_a_member_in_the_base_class_0;
|
|
80494
80544
|
error(member, diag, baseClassName);
|
|
80495
80545
|
}
|
|
80496
80546
|
else if (ts.hasAbstractModifier(member) && baseHasAbstract) {
|
|
@@ -80500,7 +80550,9 @@ var ts;
|
|
|
80500
80550
|
}
|
|
80501
80551
|
else if (hasOverride) {
|
|
80502
80552
|
var className = typeToString(type);
|
|
80503
|
-
error(member,
|
|
80553
|
+
error(member, isJs ?
|
|
80554
|
+
ts.Diagnostics.This_member_cannot_have_a_JSDoc_comment_with_an_override_tag_because_its_containing_class_0_does_not_extend_another_class :
|
|
80555
|
+
ts.Diagnostics.This_member_cannot_have_an_override_modifier_because_its_containing_class_0_does_not_extend_another_class, className);
|
|
80504
80556
|
}
|
|
80505
80557
|
}
|
|
80506
80558
|
}
|
|
@@ -112006,7 +112058,7 @@ var ts;
|
|
|
112006
112058
|
}
|
|
112007
112059
|
else {
|
|
112008
112060
|
ts.forEach(options.lib, function (libFileName, index) {
|
|
112009
|
-
processRootFile(
|
|
112061
|
+
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ false, { kind: ts.FileIncludeKind.LibFile, index: index });
|
|
112010
112062
|
});
|
|
112011
112063
|
}
|
|
112012
112064
|
}
|
|
@@ -112668,7 +112720,7 @@ var ts;
|
|
|
112668
112720
|
return equalityComparer(file.fileName, getDefaultLibraryFileName());
|
|
112669
112721
|
}
|
|
112670
112722
|
else {
|
|
112671
|
-
return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName,
|
|
112723
|
+
return ts.some(options.lib, function (libFileName) { return equalityComparer(file.fileName, pathForLibFile(libFileName)); });
|
|
112672
112724
|
}
|
|
112673
112725
|
}
|
|
112674
112726
|
function getDiagnosticsProducingTypeChecker() {
|
|
@@ -113250,7 +113302,7 @@ var ts;
|
|
|
113250
113302
|
var libName = ts.toFileNameLowerCase(ref.fileName);
|
|
113251
113303
|
var libFileName = ts.libMap.get(libName);
|
|
113252
113304
|
if (libFileName) {
|
|
113253
|
-
return getSourceFile(
|
|
113305
|
+
return getSourceFile(pathForLibFile(libFileName));
|
|
113254
113306
|
}
|
|
113255
113307
|
}
|
|
113256
113308
|
/** This should have similar behavior to 'processSourceFile' without diagnostics or mutation. */
|
|
@@ -113661,13 +113713,31 @@ var ts;
|
|
|
113661
113713
|
resolvedTypeReferenceDirectives.set(typeReferenceDirective, resolvedTypeReferenceDirective);
|
|
113662
113714
|
}
|
|
113663
113715
|
}
|
|
113716
|
+
function pathForLibFile(libFileName) {
|
|
113717
|
+
// Support resolving to lib.dom.d.ts -> @typescript/dom, and
|
|
113718
|
+
// lib.dom.iterable.d.ts -> @typescript/dom/iterable
|
|
113719
|
+
// lib.es2015.symbol.wellknown.d.ts -> @typescript/es2015/symbol-wellknown
|
|
113720
|
+
var components = libFileName.split(".");
|
|
113721
|
+
var path = components[1];
|
|
113722
|
+
var i = 2;
|
|
113723
|
+
while (components[i] && components[i] !== "d") {
|
|
113724
|
+
path += (i === 2 ? "/" : "-") + components[i];
|
|
113725
|
+
i++;
|
|
113726
|
+
}
|
|
113727
|
+
var resolveFrom = ts.combinePaths(currentDirectory, "__lib_node_modules_lookup_" + libFileName + "__.ts");
|
|
113728
|
+
var localOverrideModuleResult = ts.resolveModuleName("@typescript/" + path, resolveFrom, { moduleResolution: ts.ModuleResolutionKind.NodeJs }, host, moduleResolutionCache);
|
|
113729
|
+
if (localOverrideModuleResult === null || localOverrideModuleResult === void 0 ? void 0 : localOverrideModuleResult.resolvedModule) {
|
|
113730
|
+
return localOverrideModuleResult.resolvedModule.resolvedFileName;
|
|
113731
|
+
}
|
|
113732
|
+
return ts.combinePaths(defaultLibraryPath, libFileName);
|
|
113733
|
+
}
|
|
113664
113734
|
function processLibReferenceDirectives(file) {
|
|
113665
113735
|
ts.forEach(file.libReferenceDirectives, function (libReference, index) {
|
|
113666
113736
|
var libName = ts.toFileNameLowerCase(libReference.fileName);
|
|
113667
113737
|
var libFileName = ts.libMap.get(libName);
|
|
113668
113738
|
if (libFileName) {
|
|
113669
113739
|
// we ignore any 'no-default-lib' reference set on this file.
|
|
113670
|
-
processRootFile(
|
|
113740
|
+
processRootFile(pathForLibFile(libFileName), /*isDefaultLib*/ true, /*ignoreNoDefaultLib*/ true, { kind: ts.FileIncludeKind.LibReferenceDirective, file: file.path, index: index, });
|
|
113671
113741
|
}
|
|
113672
113742
|
else {
|
|
113673
113743
|
var unqualifiedLibName = ts.removeSuffix(ts.removePrefix(libName, "lib."), ".d.ts");
|