typescript 4.6.0-dev.20220124 → 4.6.0-dev.20220128
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 +19 -4
- package/lib/de/diagnosticMessages.generated.json +19 -4
- package/lib/es/diagnosticMessages.generated.json +19 -4
- package/lib/fr/diagnosticMessages.generated.json +19 -4
- package/lib/ja/diagnosticMessages.generated.json +19 -4
- package/lib/ko/diagnosticMessages.generated.json +19 -4
- package/lib/lib.dom.d.ts +72 -0
- package/lib/lib.dom.iterable.d.ts +4 -0
- package/lib/lib.webworker.d.ts +48 -0
- package/lib/pl/diagnosticMessages.generated.json +17 -4
- package/lib/pt-br/diagnosticMessages.generated.json +19 -4
- package/lib/ru/diagnosticMessages.generated.json +19 -4
- package/lib/tr/diagnosticMessages.generated.json +17 -4
- package/lib/tsc.js +148 -90
- package/lib/tsserver.js +555 -202
- package/lib/tsserverlibrary.d.ts +9 -5
- package/lib/tsserverlibrary.js +555 -202
- package/lib/typescript.d.ts +9 -5
- package/lib/typescript.js +555 -202
- package/lib/typescriptServices.d.ts +9 -5
- package/lib/typescriptServices.js +555 -202
- package/lib/typingsInstaller.js +158 -100
- package/lib/zh-cn/diagnosticMessages.generated.json +19 -4
- package/lib/zh-tw/diagnosticMessages.generated.json +19 -4
- package/package.json +1 -1
package/lib/tsc.js
CHANGED
|
@@ -69,15 +69,21 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
var ts;
|
|
70
70
|
(function (ts) {
|
|
71
71
|
ts.versionMajorMinor = "4.6";
|
|
72
|
-
ts.version = ts.versionMajorMinor + ".0-dev.
|
|
72
|
+
ts.version = ts.versionMajorMinor + ".0-dev.20220128";
|
|
73
73
|
var NativeCollections;
|
|
74
74
|
(function (NativeCollections) {
|
|
75
|
+
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
76
|
+
typeof global !== "undefined" ? global :
|
|
77
|
+
typeof self !== "undefined" ? self :
|
|
78
|
+
undefined;
|
|
75
79
|
function tryGetNativeMap() {
|
|
76
|
-
|
|
80
|
+
var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
|
|
81
|
+
return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
|
|
77
82
|
}
|
|
78
83
|
NativeCollections.tryGetNativeMap = tryGetNativeMap;
|
|
79
84
|
function tryGetNativeSet() {
|
|
80
|
-
|
|
85
|
+
var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
|
|
86
|
+
return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
|
|
81
87
|
}
|
|
82
88
|
NativeCollections.tryGetNativeSet = tryGetNativeSet;
|
|
83
89
|
})(NativeCollections || (NativeCollections = {}));
|
|
@@ -6651,9 +6657,8 @@ var ts;
|
|
|
6651
6657
|
Remove_variable_statement: diag(90010, ts.DiagnosticCategory.Message, "Remove_variable_statement_90010", "Remove variable statement"),
|
|
6652
6658
|
Remove_template_tag: diag(90011, ts.DiagnosticCategory.Message, "Remove_template_tag_90011", "Remove template tag"),
|
|
6653
6659
|
Remove_type_parameters: diag(90012, ts.DiagnosticCategory.Message, "Remove_type_parameters_90012", "Remove type parameters"),
|
|
6654
|
-
|
|
6660
|
+
Import_0_from_1: diag(90013, ts.DiagnosticCategory.Message, "Import_0_from_1_90013", "Import '{0}' from \"{1}\""),
|
|
6655
6661
|
Change_0_to_1: diag(90014, ts.DiagnosticCategory.Message, "Change_0_to_1_90014", "Change '{0}' to '{1}'"),
|
|
6656
|
-
Add_0_to_existing_import_declaration_from_1: diag(90015, ts.DiagnosticCategory.Message, "Add_0_to_existing_import_declaration_from_1_90015", "Add '{0}' to existing import declaration from \"{1}\""),
|
|
6657
6662
|
Declare_property_0: diag(90016, ts.DiagnosticCategory.Message, "Declare_property_0_90016", "Declare property '{0}'"),
|
|
6658
6663
|
Add_index_signature_for_property_0: diag(90017, ts.DiagnosticCategory.Message, "Add_index_signature_for_property_0_90017", "Add index signature for property '{0}'"),
|
|
6659
6664
|
Disable_checking_for_this_file: diag(90018, ts.DiagnosticCategory.Message, "Disable_checking_for_this_file_90018", "Disable checking for this file"),
|
|
@@ -6670,8 +6675,6 @@ var ts;
|
|
|
6670
6675
|
Add_async_modifier_to_containing_function: diag(90029, ts.DiagnosticCategory.Message, "Add_async_modifier_to_containing_function_90029", "Add async modifier to containing function"),
|
|
6671
6676
|
Replace_infer_0_with_unknown: diag(90030, ts.DiagnosticCategory.Message, "Replace_infer_0_with_unknown_90030", "Replace 'infer {0}' with 'unknown'"),
|
|
6672
6677
|
Replace_all_unused_infer_with_unknown: diag(90031, ts.DiagnosticCategory.Message, "Replace_all_unused_infer_with_unknown_90031", "Replace all unused 'infer' with 'unknown'"),
|
|
6673
|
-
Import_default_0_from_module_1: diag(90032, ts.DiagnosticCategory.Message, "Import_default_0_from_module_1_90032", "Import default '{0}' from module \"{1}\""),
|
|
6674
|
-
Add_default_import_0_to_existing_import_declaration_from_1: diag(90033, ts.DiagnosticCategory.Message, "Add_default_import_0_to_existing_import_declaration_from_1_90033", "Add default import '{0}' to existing import declaration from \"{1}\""),
|
|
6675
6678
|
Add_parameter_name: diag(90034, ts.DiagnosticCategory.Message, "Add_parameter_name_90034", "Add parameter name"),
|
|
6676
6679
|
Declare_private_property_0: diag(90035, ts.DiagnosticCategory.Message, "Declare_private_property_0_90035", "Declare private property '{0}'"),
|
|
6677
6680
|
Replace_0_with_Promise_1: diag(90036, ts.DiagnosticCategory.Message, "Replace_0_with_Promise_1_90036", "Replace '{0}' with 'Promise<{1}>'"),
|
|
@@ -6681,6 +6684,10 @@ var ts;
|
|
|
6681
6684
|
Remove_unused_declarations_for_Colon_0: diag(90041, ts.DiagnosticCategory.Message, "Remove_unused_declarations_for_Colon_0_90041", "Remove unused declarations for: '{0}'"),
|
|
6682
6685
|
Declare_a_private_field_named_0: diag(90053, ts.DiagnosticCategory.Message, "Declare_a_private_field_named_0_90053", "Declare a private field named '{0}'."),
|
|
6683
6686
|
Includes_imports_of_types_referenced_by_0: diag(90054, ts.DiagnosticCategory.Message, "Includes_imports_of_types_referenced_by_0_90054", "Includes imports of types referenced by '{0}'"),
|
|
6687
|
+
Remove_type_from_import_declaration_from_0: diag(90055, ts.DiagnosticCategory.Message, "Remove_type_from_import_declaration_from_0_90055", "Remove 'type' from import declaration from \"{0}\""),
|
|
6688
|
+
Remove_type_from_import_of_0_from_1: diag(90056, ts.DiagnosticCategory.Message, "Remove_type_from_import_of_0_from_1_90056", "Remove 'type' from import of '{0}' from \"{1}\""),
|
|
6689
|
+
Add_import_from_0: diag(90057, ts.DiagnosticCategory.Message, "Add_import_from_0_90057", "Add import from \"{0}\""),
|
|
6690
|
+
Update_import_from_0: diag(90058, ts.DiagnosticCategory.Message, "Update_import_from_0_90058", "Update import from \"{0}\""),
|
|
6684
6691
|
Convert_function_to_an_ES2015_class: diag(95001, ts.DiagnosticCategory.Message, "Convert_function_to_an_ES2015_class_95001", "Convert function to an ES2015 class"),
|
|
6685
6692
|
Convert_0_to_1_in_0: diag(95003, ts.DiagnosticCategory.Message, "Convert_0_to_1_in_0_95003", "Convert '{0}' to '{1} in {0}'"),
|
|
6686
6693
|
Extract_to_0_in_1: diag(95004, ts.DiagnosticCategory.Message, "Extract_to_0_in_1_95004", "Extract to {0} in {1}"),
|
|
@@ -10667,10 +10674,13 @@ var ts;
|
|
|
10667
10674
|
function packageIdIsEqual(a, b) {
|
|
10668
10675
|
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
10669
10676
|
}
|
|
10670
|
-
function
|
|
10671
|
-
var name = _a.name, subModuleName = _a.subModuleName
|
|
10672
|
-
|
|
10673
|
-
|
|
10677
|
+
function packageIdToPackageName(_a) {
|
|
10678
|
+
var name = _a.name, subModuleName = _a.subModuleName;
|
|
10679
|
+
return subModuleName ? name + "/" + subModuleName : name;
|
|
10680
|
+
}
|
|
10681
|
+
ts.packageIdToPackageName = packageIdToPackageName;
|
|
10682
|
+
function packageIdToString(packageId) {
|
|
10683
|
+
return packageIdToPackageName(packageId) + "@" + packageId.version;
|
|
10674
10684
|
}
|
|
10675
10685
|
ts.packageIdToString = packageIdToString;
|
|
10676
10686
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -11396,6 +11406,15 @@ var ts;
|
|
|
11396
11406
|
};
|
|
11397
11407
|
}
|
|
11398
11408
|
ts.createDiagnosticForFileFromMessageChain = createDiagnosticForFileFromMessageChain;
|
|
11409
|
+
function createDiagnosticMessageChainFromDiagnostic(diagnostic) {
|
|
11410
|
+
return typeof diagnostic.messageText === "string" ? {
|
|
11411
|
+
code: diagnostic.code,
|
|
11412
|
+
category: diagnostic.category,
|
|
11413
|
+
messageText: diagnostic.messageText,
|
|
11414
|
+
next: diagnostic.next,
|
|
11415
|
+
} : diagnostic.messageText;
|
|
11416
|
+
}
|
|
11417
|
+
ts.createDiagnosticMessageChainFromDiagnostic = createDiagnosticMessageChainFromDiagnostic;
|
|
11399
11418
|
function createDiagnosticForRange(sourceFile, range, message) {
|
|
11400
11419
|
return {
|
|
11401
11420
|
file: sourceFile,
|
|
@@ -11556,7 +11575,8 @@ var ts;
|
|
|
11556
11575
|
node.kind === 212 ||
|
|
11557
11576
|
node.kind === 213 ||
|
|
11558
11577
|
node.kind === 211 ||
|
|
11559
|
-
node.kind === 253
|
|
11578
|
+
node.kind === 253 ||
|
|
11579
|
+
node.kind === 274) ?
|
|
11560
11580
|
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
|
|
11561
11581
|
ts.getLeadingCommentRanges(text, node.pos);
|
|
11562
11582
|
return ts.filter(commentRanges, function (comment) {
|
|
@@ -16578,6 +16598,49 @@ var ts;
|
|
|
16578
16598
|
return !!(type.flags & 262144 && type.isThisType);
|
|
16579
16599
|
}
|
|
16580
16600
|
ts.isThisTypeParameter = isThisTypeParameter;
|
|
16601
|
+
function getNodeModulePathParts(fullPath) {
|
|
16602
|
+
var topLevelNodeModulesIndex = 0;
|
|
16603
|
+
var topLevelPackageNameIndex = 0;
|
|
16604
|
+
var packageRootIndex = 0;
|
|
16605
|
+
var fileNameIndex = 0;
|
|
16606
|
+
var partStart = 0;
|
|
16607
|
+
var partEnd = 0;
|
|
16608
|
+
var state = 0;
|
|
16609
|
+
while (partEnd >= 0) {
|
|
16610
|
+
partStart = partEnd;
|
|
16611
|
+
partEnd = fullPath.indexOf("/", partStart + 1);
|
|
16612
|
+
switch (state) {
|
|
16613
|
+
case 0:
|
|
16614
|
+
if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
|
|
16615
|
+
topLevelNodeModulesIndex = partStart;
|
|
16616
|
+
topLevelPackageNameIndex = partEnd;
|
|
16617
|
+
state = 1;
|
|
16618
|
+
}
|
|
16619
|
+
break;
|
|
16620
|
+
case 1:
|
|
16621
|
+
case 2:
|
|
16622
|
+
if (state === 1 && fullPath.charAt(partStart + 1) === "@") {
|
|
16623
|
+
state = 2;
|
|
16624
|
+
}
|
|
16625
|
+
else {
|
|
16626
|
+
packageRootIndex = partEnd;
|
|
16627
|
+
state = 3;
|
|
16628
|
+
}
|
|
16629
|
+
break;
|
|
16630
|
+
case 3:
|
|
16631
|
+
if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
|
|
16632
|
+
state = 1;
|
|
16633
|
+
}
|
|
16634
|
+
else {
|
|
16635
|
+
state = 3;
|
|
16636
|
+
}
|
|
16637
|
+
break;
|
|
16638
|
+
}
|
|
16639
|
+
}
|
|
16640
|
+
fileNameIndex = partStart;
|
|
16641
|
+
return state > 1 ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined;
|
|
16642
|
+
}
|
|
16643
|
+
ts.getNodeModulePathParts = getNodeModulePathParts;
|
|
16581
16644
|
})(ts || (ts = {}));
|
|
16582
16645
|
var ts;
|
|
16583
16646
|
(function (ts) {
|
|
@@ -29193,7 +29256,8 @@ var ts;
|
|
|
29193
29256
|
return finishNode(node, pos);
|
|
29194
29257
|
}
|
|
29195
29258
|
function parseExportSpecifier() {
|
|
29196
|
-
|
|
29259
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
29260
|
+
return withJSDoc(parseImportOrExportSpecifier(274), hasJSDoc);
|
|
29197
29261
|
}
|
|
29198
29262
|
function parseImportSpecifier() {
|
|
29199
29263
|
return parseImportOrExportSpecifier(269);
|
|
@@ -35492,14 +35556,12 @@ var ts;
|
|
|
35492
35556
|
}
|
|
35493
35557
|
var binder = createBinder();
|
|
35494
35558
|
function bindSourceFile(file, options) {
|
|
35495
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind", "bindSourceFile", { path: file.path }, true);
|
|
35496
35559
|
ts.performance.mark("beforeBind");
|
|
35497
35560
|
ts.perfLogger.logStartBindFile("" + file.fileName);
|
|
35498
35561
|
binder(file, options);
|
|
35499
35562
|
ts.perfLogger.logStopBindFile();
|
|
35500
35563
|
ts.performance.mark("afterBind");
|
|
35501
35564
|
ts.performance.measure("Bind", "beforeBind", "afterBind");
|
|
35502
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
35503
35565
|
}
|
|
35504
35566
|
ts.bindSourceFile = bindSourceFile;
|
|
35505
35567
|
function createBinder() {
|
|
@@ -35546,7 +35608,9 @@ var ts;
|
|
|
35546
35608
|
ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);
|
|
35547
35609
|
ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
|
|
35548
35610
|
if (!file.locals) {
|
|
35611
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind", "bindSourceFile", { path: file.path }, true);
|
|
35549
35612
|
bind(file);
|
|
35613
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
35550
35614
|
file.symbolCount = symbolCount;
|
|
35551
35615
|
file.classifiableNames = classifiableNames;
|
|
35552
35616
|
delayedBindJSDocTypedefTag();
|
|
@@ -39135,6 +39199,9 @@ var ts;
|
|
|
39135
39199
|
suggestionDiagnostics.add(diagnostic);
|
|
39136
39200
|
return diagnostic;
|
|
39137
39201
|
}
|
|
39202
|
+
function isDeprecatedSymbol(symbol) {
|
|
39203
|
+
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 134217728);
|
|
39204
|
+
}
|
|
39138
39205
|
function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
|
|
39139
39206
|
var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
|
|
39140
39207
|
return addDeprecatedSuggestionWorker(declarations, diagnostic);
|
|
@@ -39945,24 +40012,19 @@ var ts;
|
|
|
39945
40012
|
error(errorLocation, ts.Diagnostics.Parameter_0_cannot_reference_identifier_1_declared_after_it, ts.declarationNameToString(associatedDeclarationForContainingInitializerOrBindingName.name), ts.declarationNameToString(errorLocation));
|
|
39946
40013
|
}
|
|
39947
40014
|
}
|
|
39948
|
-
if (result && errorLocation && meaning & 111551 && result.flags & 2097152) {
|
|
39949
|
-
|
|
40015
|
+
if (result && errorLocation && meaning & 111551 && result.flags & 2097152 && !(result.flags & 111551) && !ts.isValidTypeOnlyAliasUseSite(errorLocation)) {
|
|
40016
|
+
var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(result);
|
|
40017
|
+
if (typeOnlyDeclaration) {
|
|
40018
|
+
var message = typeOnlyDeclaration.kind === 274
|
|
40019
|
+
? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
|
|
40020
|
+
: ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
|
|
40021
|
+
var unescapedName = ts.unescapeLeadingUnderscores(name);
|
|
40022
|
+
addTypeOnlyDeclarationRelatedInfo(error(errorLocation, message, unescapedName), typeOnlyDeclaration, unescapedName);
|
|
40023
|
+
}
|
|
39950
40024
|
}
|
|
39951
40025
|
}
|
|
39952
40026
|
return result;
|
|
39953
40027
|
}
|
|
39954
|
-
function checkSymbolUsageInExpressionContext(symbol, name, useSite) {
|
|
39955
|
-
if (!ts.isValidTypeOnlyAliasUseSite(useSite)) {
|
|
39956
|
-
var typeOnlyDeclaration = getTypeOnlyAliasDeclaration(symbol);
|
|
39957
|
-
if (typeOnlyDeclaration) {
|
|
39958
|
-
var message = typeOnlyDeclaration.kind === 274
|
|
39959
|
-
? ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_exported_using_export_type
|
|
39960
|
-
: ts.Diagnostics._0_cannot_be_used_as_a_value_because_it_was_imported_using_import_type;
|
|
39961
|
-
var unescapedName = ts.unescapeLeadingUnderscores(name);
|
|
39962
|
-
addTypeOnlyDeclarationRelatedInfo(error(useSite, message, unescapedName), typeOnlyDeclaration, unescapedName);
|
|
39963
|
-
}
|
|
39964
|
-
}
|
|
39965
|
-
}
|
|
39966
40028
|
function addTypeOnlyDeclarationRelatedInfo(diagnostic, typeOnlyDeclaration, unescapedName) {
|
|
39967
40029
|
if (!typeOnlyDeclaration)
|
|
39968
40030
|
return diagnostic;
|
|
@@ -43355,7 +43417,8 @@ var ts;
|
|
|
43355
43417
|
includePrivateSymbol === null || includePrivateSymbol === void 0 ? void 0 : includePrivateSymbol(sym);
|
|
43356
43418
|
}
|
|
43357
43419
|
if (ts.isIdentifier(node)) {
|
|
43358
|
-
var
|
|
43420
|
+
var type = getDeclaredTypeOfSymbol(sym);
|
|
43421
|
+
var name = sym.flags & 262144 && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration) ? typeParameterToName(type, context) : ts.factory.cloneNode(node);
|
|
43359
43422
|
name.symbol = sym;
|
|
43360
43423
|
return { introducesError: introducesError, node: ts.setEmitFlags(ts.setOriginalNode(name, node), 16777216) };
|
|
43361
43424
|
}
|
|
@@ -50260,7 +50323,7 @@ var ts;
|
|
|
50260
50323
|
}
|
|
50261
50324
|
var prop = getPropertyOfType(objectType, propName);
|
|
50262
50325
|
if (prop) {
|
|
50263
|
-
if (accessFlags & 64 && accessNode && prop.declarations &&
|
|
50326
|
+
if (accessFlags & 64 && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) {
|
|
50264
50327
|
var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
|
|
50265
50328
|
addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
|
|
50266
50329
|
}
|
|
@@ -58410,9 +58473,9 @@ var ts;
|
|
|
58410
58473
|
markAliasReferenced(symbol, node);
|
|
58411
58474
|
}
|
|
58412
58475
|
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
58413
|
-
var
|
|
58414
|
-
if (
|
|
58415
|
-
addDeprecatedSuggestion(node,
|
|
58476
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
|
|
58477
|
+
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
58478
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
58416
58479
|
}
|
|
58417
58480
|
var declaration = localOrExportSymbol.valueDeclaration;
|
|
58418
58481
|
if (declaration && localOrExportSymbol.flags & 32) {
|
|
@@ -60944,7 +61007,7 @@ var ts;
|
|
|
60944
61007
|
}
|
|
60945
61008
|
}
|
|
60946
61009
|
else {
|
|
60947
|
-
if (
|
|
61010
|
+
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
60948
61011
|
addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
|
|
60949
61012
|
}
|
|
60950
61013
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
@@ -62171,7 +62234,7 @@ var ts;
|
|
|
62171
62234
|
}
|
|
62172
62235
|
var diags_3 = max > 1 ? allDiagnostics[minIndex] : ts.flatten(allDiagnostics);
|
|
62173
62236
|
ts.Debug.assert(diags_3.length > 0, "No errors reported for 3 or fewer overload signatures");
|
|
62174
|
-
var chain = ts.chainDiagnosticMessages(ts.map(diags_3,
|
|
62237
|
+
var chain = ts.chainDiagnosticMessages(ts.map(diags_3, ts.createDiagnosticMessageChainFromDiagnostic), ts.Diagnostics.No_overload_matches_this_call);
|
|
62175
62238
|
var related = __spreadArray([], ts.flatMap(diags_3, function (d) { return d.relatedInformation; }), true);
|
|
62176
62239
|
var diag = void 0;
|
|
62177
62240
|
if (ts.every(diags_3, function (d) { return d.start === diags_3[0].start && d.length === diags_3[0].length && d.file === diags_3[0].file; })) {
|
|
@@ -69334,16 +69397,15 @@ var ts;
|
|
|
69334
69397
|
return ts.nodeIsMissing(expr) ? 0 : evaluateEnumMember(expr, getSymbolOfNode(member.parent), identifier.escapedText);
|
|
69335
69398
|
case 206:
|
|
69336
69399
|
case 205:
|
|
69337
|
-
|
|
69338
|
-
|
|
69339
|
-
var type = getTypeOfExpression(ex.expression);
|
|
69400
|
+
if (isConstantMemberAccess(expr)) {
|
|
69401
|
+
var type = getTypeOfExpression(expr.expression);
|
|
69340
69402
|
if (type.symbol && type.symbol.flags & 384) {
|
|
69341
69403
|
var name = void 0;
|
|
69342
|
-
if (
|
|
69343
|
-
name =
|
|
69404
|
+
if (expr.kind === 205) {
|
|
69405
|
+
name = expr.name.escapedText;
|
|
69344
69406
|
}
|
|
69345
69407
|
else {
|
|
69346
|
-
name = ts.escapeLeadingUnderscores(ts.cast(
|
|
69408
|
+
name = ts.escapeLeadingUnderscores(ts.cast(expr.argumentExpression, ts.isLiteralExpression).text);
|
|
69347
69409
|
}
|
|
69348
69410
|
return evaluateEnumMember(expr, type.symbol, name);
|
|
69349
69411
|
}
|
|
@@ -69371,6 +69433,10 @@ var ts;
|
|
|
69371
69433
|
}
|
|
69372
69434
|
}
|
|
69373
69435
|
function isConstantMemberAccess(node) {
|
|
69436
|
+
var type = getTypeOfExpression(node);
|
|
69437
|
+
if (type === errorType) {
|
|
69438
|
+
return false;
|
|
69439
|
+
}
|
|
69374
69440
|
return node.kind === 79 ||
|
|
69375
69441
|
node.kind === 205 && isConstantMemberAccess(node.expression) ||
|
|
69376
69442
|
node.kind === 206 && isConstantMemberAccess(node.expression) &&
|
|
@@ -69629,7 +69695,6 @@ var ts;
|
|
|
69629
69695
|
return true;
|
|
69630
69696
|
}
|
|
69631
69697
|
function checkAliasSymbol(node) {
|
|
69632
|
-
var _a;
|
|
69633
69698
|
var symbol = getSymbolOfNode(node);
|
|
69634
69699
|
var target = resolveAlias(symbol);
|
|
69635
69700
|
if (target !== unknownSymbol) {
|
|
@@ -69676,10 +69741,45 @@ var ts;
|
|
|
69676
69741
|
}
|
|
69677
69742
|
}
|
|
69678
69743
|
}
|
|
69679
|
-
if (ts.isImportSpecifier(node)
|
|
69680
|
-
|
|
69744
|
+
if (ts.isImportSpecifier(node)) {
|
|
69745
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(symbol, node);
|
|
69746
|
+
if (isDeprecatedAliasedSymbol(targetSymbol) && targetSymbol.declarations) {
|
|
69747
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName);
|
|
69748
|
+
}
|
|
69749
|
+
}
|
|
69750
|
+
}
|
|
69751
|
+
}
|
|
69752
|
+
function isDeprecatedAliasedSymbol(symbol) {
|
|
69753
|
+
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728); });
|
|
69754
|
+
}
|
|
69755
|
+
function checkDeprecatedAliasedSymbol(symbol, location) {
|
|
69756
|
+
if (!(symbol.flags & 2097152))
|
|
69757
|
+
return symbol;
|
|
69758
|
+
var targetSymbol = resolveAlias(symbol);
|
|
69759
|
+
if (targetSymbol === unknownSymbol)
|
|
69760
|
+
return targetSymbol;
|
|
69761
|
+
while (symbol.flags & 2097152) {
|
|
69762
|
+
var target = getImmediateAliasedSymbol(symbol);
|
|
69763
|
+
if (target) {
|
|
69764
|
+
if (target === targetSymbol)
|
|
69765
|
+
break;
|
|
69766
|
+
if (target.declarations && ts.length(target.declarations)) {
|
|
69767
|
+
if (isDeprecatedAliasedSymbol(target)) {
|
|
69768
|
+
addDeprecatedSuggestion(location, target.declarations, target.escapedName);
|
|
69769
|
+
break;
|
|
69770
|
+
}
|
|
69771
|
+
else {
|
|
69772
|
+
if (symbol === targetSymbol)
|
|
69773
|
+
break;
|
|
69774
|
+
symbol = target;
|
|
69775
|
+
}
|
|
69776
|
+
}
|
|
69777
|
+
}
|
|
69778
|
+
else {
|
|
69779
|
+
break;
|
|
69681
69780
|
}
|
|
69682
69781
|
}
|
|
69782
|
+
return targetSymbol;
|
|
69683
69783
|
}
|
|
69684
69784
|
function checkImportBinding(node) {
|
|
69685
69785
|
checkCollisionsForDeclarationName(node, node.name);
|
|
@@ -95574,13 +95674,13 @@ var ts;
|
|
|
95574
95674
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
95575
95675
|
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
95576
95676
|
addFileIncludeReason(dupFile, reason);
|
|
95577
|
-
sourceFileToPackageName.set(path, packageId
|
|
95677
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
95578
95678
|
processingOtherFiles.push(dupFile);
|
|
95579
95679
|
return dupFile;
|
|
95580
95680
|
}
|
|
95581
95681
|
else if (file) {
|
|
95582
95682
|
packageIdToSourceFile.set(packageIdKey, file);
|
|
95583
|
-
sourceFileToPackageName.set(path, packageId
|
|
95683
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
95584
95684
|
}
|
|
95585
95685
|
}
|
|
95586
95686
|
addFileToFilesByName(file, path, redirectedPath);
|
|
@@ -99130,7 +99230,7 @@ var ts;
|
|
|
99130
99230
|
if (!host.fileExists || !host.readFile) {
|
|
99131
99231
|
return undefined;
|
|
99132
99232
|
}
|
|
99133
|
-
var parts = getNodeModulePathParts(path);
|
|
99233
|
+
var parts = ts.getNodeModulePathParts(path);
|
|
99134
99234
|
if (!parts) {
|
|
99135
99235
|
return undefined;
|
|
99136
99236
|
}
|
|
@@ -99237,48 +99337,6 @@ var ts;
|
|
|
99237
99337
|
}
|
|
99238
99338
|
}
|
|
99239
99339
|
}
|
|
99240
|
-
function getNodeModulePathParts(fullPath) {
|
|
99241
|
-
var topLevelNodeModulesIndex = 0;
|
|
99242
|
-
var topLevelPackageNameIndex = 0;
|
|
99243
|
-
var packageRootIndex = 0;
|
|
99244
|
-
var fileNameIndex = 0;
|
|
99245
|
-
var partStart = 0;
|
|
99246
|
-
var partEnd = 0;
|
|
99247
|
-
var state = 0;
|
|
99248
|
-
while (partEnd >= 0) {
|
|
99249
|
-
partStart = partEnd;
|
|
99250
|
-
partEnd = fullPath.indexOf("/", partStart + 1);
|
|
99251
|
-
switch (state) {
|
|
99252
|
-
case 0:
|
|
99253
|
-
if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
|
|
99254
|
-
topLevelNodeModulesIndex = partStart;
|
|
99255
|
-
topLevelPackageNameIndex = partEnd;
|
|
99256
|
-
state = 1;
|
|
99257
|
-
}
|
|
99258
|
-
break;
|
|
99259
|
-
case 1:
|
|
99260
|
-
case 2:
|
|
99261
|
-
if (state === 1 && fullPath.charAt(partStart + 1) === "@") {
|
|
99262
|
-
state = 2;
|
|
99263
|
-
}
|
|
99264
|
-
else {
|
|
99265
|
-
packageRootIndex = partEnd;
|
|
99266
|
-
state = 3;
|
|
99267
|
-
}
|
|
99268
|
-
break;
|
|
99269
|
-
case 3:
|
|
99270
|
-
if (fullPath.indexOf(ts.nodeModulesPathPart, partStart) === partStart) {
|
|
99271
|
-
state = 1;
|
|
99272
|
-
}
|
|
99273
|
-
else {
|
|
99274
|
-
state = 3;
|
|
99275
|
-
}
|
|
99276
|
-
break;
|
|
99277
|
-
}
|
|
99278
|
-
}
|
|
99279
|
-
fileNameIndex = partStart;
|
|
99280
|
-
return state > 1 ? { topLevelNodeModulesIndex: topLevelNodeModulesIndex, topLevelPackageNameIndex: topLevelPackageNameIndex, packageRootIndex: packageRootIndex, fileNameIndex: fileNameIndex } : undefined;
|
|
99281
|
-
}
|
|
99282
99340
|
function getPathRelativeToRootDirs(path, rootDirs, getCanonicalFileName) {
|
|
99283
99341
|
return ts.firstDefined(rootDirs, function (rootDir) {
|
|
99284
99342
|
var relativePath = getRelativePathIfInDirectory(path, rootDir, getCanonicalFileName);
|