typescript 4.6.0-dev.20220122 → 4.6.0-dev.20220126
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/tsc.js +69 -21
- package/lib/tsserver.js +144 -42
- package/lib/tsserverlibrary.d.ts +2 -2
- package/lib/tsserverlibrary.js +144 -42
- package/lib/typescript.d.ts +2 -2
- package/lib/typescript.js +144 -42
- package/lib/typescriptServices.d.ts +2 -2
- package/lib/typescriptServices.js +144 -42
- package/lib/typingsInstaller.js +69 -21
- package/package.json +1 -1
|
@@ -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.20220126";
|
|
298
298
|
/* @internal */
|
|
299
299
|
var Comparison;
|
|
300
300
|
(function (Comparison) {
|
|
@@ -305,13 +305,18 @@ var ts;
|
|
|
305
305
|
/* @internal */
|
|
306
306
|
var NativeCollections;
|
|
307
307
|
(function (NativeCollections) {
|
|
308
|
+
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
309
|
+
typeof global !== "undefined" ? global :
|
|
310
|
+
typeof self !== "undefined" ? self :
|
|
311
|
+
undefined;
|
|
308
312
|
/**
|
|
309
313
|
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
|
|
310
314
|
*/
|
|
311
315
|
function tryGetNativeMap() {
|
|
312
316
|
// Internet Explorer's Map doesn't support iteration, so don't use it.
|
|
317
|
+
var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
|
|
313
318
|
// eslint-disable-next-line no-in-operator
|
|
314
|
-
return typeof
|
|
319
|
+
return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
|
|
315
320
|
}
|
|
316
321
|
NativeCollections.tryGetNativeMap = tryGetNativeMap;
|
|
317
322
|
/**
|
|
@@ -319,8 +324,9 @@ var ts;
|
|
|
319
324
|
*/
|
|
320
325
|
function tryGetNativeSet() {
|
|
321
326
|
// Internet Explorer's Set doesn't support iteration, so don't use it.
|
|
327
|
+
var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
|
|
322
328
|
// eslint-disable-next-line no-in-operator
|
|
323
|
-
return typeof
|
|
329
|
+
return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
|
|
324
330
|
}
|
|
325
331
|
NativeCollections.tryGetNativeSet = tryGetNativeSet;
|
|
326
332
|
})(NativeCollections || (NativeCollections = {}));
|
|
@@ -14251,10 +14257,13 @@ var ts;
|
|
|
14251
14257
|
function packageIdIsEqual(a, b) {
|
|
14252
14258
|
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
14253
14259
|
}
|
|
14254
|
-
function
|
|
14255
|
-
var name = _a.name, subModuleName = _a.subModuleName
|
|
14256
|
-
|
|
14257
|
-
|
|
14260
|
+
function packageIdToPackageName(_a) {
|
|
14261
|
+
var name = _a.name, subModuleName = _a.subModuleName;
|
|
14262
|
+
return subModuleName ? name + "/" + subModuleName : name;
|
|
14263
|
+
}
|
|
14264
|
+
ts.packageIdToPackageName = packageIdToPackageName;
|
|
14265
|
+
function packageIdToString(packageId) {
|
|
14266
|
+
return packageIdToPackageName(packageId) + "@" + packageId.version;
|
|
14258
14267
|
}
|
|
14259
14268
|
ts.packageIdToString = packageIdToString;
|
|
14260
14269
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -15255,7 +15264,8 @@ var ts;
|
|
|
15255
15264
|
node.kind === 212 /* FunctionExpression */ ||
|
|
15256
15265
|
node.kind === 213 /* ArrowFunction */ ||
|
|
15257
15266
|
node.kind === 211 /* ParenthesizedExpression */ ||
|
|
15258
|
-
node.kind === 253 /* VariableDeclaration */
|
|
15267
|
+
node.kind === 253 /* VariableDeclaration */ ||
|
|
15268
|
+
node.kind === 274 /* ExportSpecifier */) ?
|
|
15259
15269
|
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
|
|
15260
15270
|
ts.getLeadingCommentRanges(text, node.pos);
|
|
15261
15271
|
// True if the comment starts with '/**' but not if it is '/**/'
|
|
@@ -36406,7 +36416,8 @@ var ts;
|
|
|
36406
36416
|
return finishNode(node, pos);
|
|
36407
36417
|
}
|
|
36408
36418
|
function parseExportSpecifier() {
|
|
36409
|
-
|
|
36419
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
36420
|
+
return withJSDoc(parseImportOrExportSpecifier(274 /* ExportSpecifier */), hasJSDoc);
|
|
36410
36421
|
}
|
|
36411
36422
|
function parseImportSpecifier() {
|
|
36412
36423
|
return parseImportOrExportSpecifier(269 /* ImportSpecifier */);
|
|
@@ -43611,14 +43622,12 @@ var ts;
|
|
|
43611
43622
|
}
|
|
43612
43623
|
var binder = createBinder();
|
|
43613
43624
|
function bindSourceFile(file, options) {
|
|
43614
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43615
43625
|
ts.performance.mark("beforeBind");
|
|
43616
43626
|
ts.perfLogger.logStartBindFile("" + file.fileName);
|
|
43617
43627
|
binder(file, options);
|
|
43618
43628
|
ts.perfLogger.logStopBindFile();
|
|
43619
43629
|
ts.performance.mark("afterBind");
|
|
43620
43630
|
ts.performance.measure("Bind", "beforeBind", "afterBind");
|
|
43621
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43622
43631
|
}
|
|
43623
43632
|
ts.bindSourceFile = bindSourceFile;
|
|
43624
43633
|
function createBinder() {
|
|
@@ -43678,7 +43687,9 @@ var ts;
|
|
|
43678
43687
|
ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);
|
|
43679
43688
|
ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
|
|
43680
43689
|
if (!file.locals) {
|
|
43690
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43681
43691
|
bind(file);
|
|
43692
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43682
43693
|
file.symbolCount = symbolCount;
|
|
43683
43694
|
file.classifiableNames = classifiableNames;
|
|
43684
43695
|
delayedBindJSDocTypedefTag();
|
|
@@ -47945,6 +47956,9 @@ var ts;
|
|
|
47945
47956
|
suggestionDiagnostics.add(diagnostic);
|
|
47946
47957
|
return diagnostic;
|
|
47947
47958
|
}
|
|
47959
|
+
function isDeprecatedSymbol(symbol) {
|
|
47960
|
+
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 134217728 /* Deprecated */);
|
|
47961
|
+
}
|
|
47948
47962
|
function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
|
|
47949
47963
|
var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
|
|
47950
47964
|
return addDeprecatedSuggestionWorker(declarations, diagnostic);
|
|
@@ -60731,7 +60745,7 @@ var ts;
|
|
|
60731
60745
|
}
|
|
60732
60746
|
var prop = getPropertyOfType(objectType, propName);
|
|
60733
60747
|
if (prop) {
|
|
60734
|
-
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations &&
|
|
60748
|
+
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) {
|
|
60735
60749
|
var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
|
|
60736
60750
|
addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
|
|
60737
60751
|
}
|
|
@@ -70134,9 +70148,9 @@ var ts;
|
|
|
70134
70148
|
markAliasReferenced(symbol, node);
|
|
70135
70149
|
}
|
|
70136
70150
|
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
70137
|
-
var
|
|
70138
|
-
if (
|
|
70139
|
-
addDeprecatedSuggestion(node,
|
|
70151
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
|
|
70152
|
+
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
70153
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
70140
70154
|
}
|
|
70141
70155
|
var declaration = localOrExportSymbol.valueDeclaration;
|
|
70142
70156
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
@@ -73148,7 +73162,7 @@ var ts;
|
|
|
73148
73162
|
}
|
|
73149
73163
|
}
|
|
73150
73164
|
else {
|
|
73151
|
-
if (
|
|
73165
|
+
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
73152
73166
|
addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
|
|
73153
73167
|
}
|
|
73154
73168
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
@@ -83317,7 +83331,6 @@ var ts;
|
|
|
83317
83331
|
return true;
|
|
83318
83332
|
}
|
|
83319
83333
|
function checkAliasSymbol(node) {
|
|
83320
|
-
var _a;
|
|
83321
83334
|
var symbol = getSymbolOfNode(node);
|
|
83322
83335
|
var target = resolveAlias(symbol);
|
|
83323
83336
|
if (target !== unknownSymbol) {
|
|
@@ -83373,11 +83386,46 @@ var ts;
|
|
|
83373
83386
|
}
|
|
83374
83387
|
}
|
|
83375
83388
|
}
|
|
83376
|
-
if (ts.isImportSpecifier(node)
|
|
83377
|
-
|
|
83389
|
+
if (ts.isImportSpecifier(node)) {
|
|
83390
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(symbol, node);
|
|
83391
|
+
if (isDeprecatedAliasedSymbol(targetSymbol) && targetSymbol.declarations) {
|
|
83392
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName);
|
|
83393
|
+
}
|
|
83378
83394
|
}
|
|
83379
83395
|
}
|
|
83380
83396
|
}
|
|
83397
|
+
function isDeprecatedAliasedSymbol(symbol) {
|
|
83398
|
+
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); });
|
|
83399
|
+
}
|
|
83400
|
+
function checkDeprecatedAliasedSymbol(symbol, location) {
|
|
83401
|
+
if (!(symbol.flags & 2097152 /* Alias */))
|
|
83402
|
+
return symbol;
|
|
83403
|
+
var targetSymbol = resolveAlias(symbol);
|
|
83404
|
+
if (targetSymbol === unknownSymbol)
|
|
83405
|
+
return targetSymbol;
|
|
83406
|
+
while (symbol.flags & 2097152 /* Alias */) {
|
|
83407
|
+
var target = getImmediateAliasedSymbol(symbol);
|
|
83408
|
+
if (target) {
|
|
83409
|
+
if (target === targetSymbol)
|
|
83410
|
+
break;
|
|
83411
|
+
if (target.declarations && ts.length(target.declarations)) {
|
|
83412
|
+
if (isDeprecatedAliasedSymbol(target)) {
|
|
83413
|
+
addDeprecatedSuggestion(location, target.declarations, target.escapedName);
|
|
83414
|
+
break;
|
|
83415
|
+
}
|
|
83416
|
+
else {
|
|
83417
|
+
if (symbol === targetSymbol)
|
|
83418
|
+
break;
|
|
83419
|
+
symbol = target;
|
|
83420
|
+
}
|
|
83421
|
+
}
|
|
83422
|
+
}
|
|
83423
|
+
else {
|
|
83424
|
+
break;
|
|
83425
|
+
}
|
|
83426
|
+
}
|
|
83427
|
+
return targetSymbol;
|
|
83428
|
+
}
|
|
83381
83429
|
function checkImportBinding(node) {
|
|
83382
83430
|
checkCollisionsForDeclarationName(node, node.name);
|
|
83383
83431
|
checkAliasSymbol(node);
|
|
@@ -116035,14 +116083,14 @@ var ts;
|
|
|
116035
116083
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
116036
116084
|
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
116037
116085
|
addFileIncludeReason(dupFile, reason);
|
|
116038
|
-
sourceFileToPackageName.set(path, packageId
|
|
116086
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
116039
116087
|
processingOtherFiles.push(dupFile);
|
|
116040
116088
|
return dupFile;
|
|
116041
116089
|
}
|
|
116042
116090
|
else if (file) {
|
|
116043
116091
|
// This is the first source file to have this packageId.
|
|
116044
116092
|
packageIdToSourceFile.set(packageIdKey, file);
|
|
116045
|
-
sourceFileToPackageName.set(path, packageId
|
|
116093
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
116046
116094
|
}
|
|
116047
116095
|
}
|
|
116048
116096
|
addFileToFilesByName(file, path, redirectedPath);
|
|
@@ -141892,6 +141940,8 @@ var ts;
|
|
|
141892
141940
|
}
|
|
141893
141941
|
if (flags & 16 /* Function */)
|
|
141894
141942
|
return isLocalVariableOrFunction(symbol) ? "local function" /* localFunctionElement */ : "function" /* functionElement */;
|
|
141943
|
+
// FIXME: getter and setter use the same symbol. And it is rare to use only setter without getter, so in most cases the symbol always has getter flag.
|
|
141944
|
+
// So, even when the location is just on the declaration of setter, this function returns getter.
|
|
141895
141945
|
if (flags & 32768 /* GetAccessor */)
|
|
141896
141946
|
return "getter" /* memberGetAccessorElement */;
|
|
141897
141947
|
if (flags & 65536 /* SetAccessor */)
|
|
@@ -141978,9 +142028,24 @@ var ts;
|
|
|
141978
142028
|
}
|
|
141979
142029
|
// Class at constructor site need to be shown as constructor apart from property,method, vars
|
|
141980
142030
|
if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) {
|
|
141981
|
-
// If
|
|
142031
|
+
// If symbol is accessor, they are allowed only if location is at declaration identifier of the accessor
|
|
141982
142032
|
if (symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */) {
|
|
141983
|
-
|
|
142033
|
+
var declaration = ts.find(symbol.declarations, function (declaration) { return declaration.name === location; });
|
|
142034
|
+
if (declaration) {
|
|
142035
|
+
switch (declaration.kind) {
|
|
142036
|
+
case 171 /* GetAccessor */:
|
|
142037
|
+
symbolKind = "getter" /* memberGetAccessorElement */;
|
|
142038
|
+
break;
|
|
142039
|
+
case 172 /* SetAccessor */:
|
|
142040
|
+
symbolKind = "setter" /* memberSetAccessorElement */;
|
|
142041
|
+
break;
|
|
142042
|
+
default:
|
|
142043
|
+
ts.Debug.assertNever(declaration);
|
|
142044
|
+
}
|
|
142045
|
+
}
|
|
142046
|
+
else {
|
|
142047
|
+
symbolKind = "property" /* memberVariableElement */;
|
|
142048
|
+
}
|
|
141984
142049
|
}
|
|
141985
142050
|
var signature = void 0;
|
|
141986
142051
|
type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location);
|
|
@@ -142294,6 +142359,8 @@ var ts;
|
|
|
142294
142359
|
}
|
|
142295
142360
|
// For properties, variables and local vars: show the type
|
|
142296
142361
|
if (symbolKind === "property" /* memberVariableElement */ ||
|
|
142362
|
+
symbolKind === "getter" /* memberGetAccessorElement */ ||
|
|
142363
|
+
symbolKind === "setter" /* memberSetAccessorElement */ ||
|
|
142297
142364
|
symbolKind === "JSX attribute" /* jsxAttribute */ ||
|
|
142298
142365
|
symbolFlags & 3 /* Variable */ ||
|
|
142299
142366
|
symbolKind === "local var" /* localVariableElement */ ||
|
|
@@ -142364,7 +142431,7 @@ var ts;
|
|
|
142364
142431
|
}
|
|
142365
142432
|
}
|
|
142366
142433
|
if (tags.length === 0 && !hasMultipleSignatures) {
|
|
142367
|
-
tags = symbol.
|
|
142434
|
+
tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker);
|
|
142368
142435
|
}
|
|
142369
142436
|
if (documentation.length === 0 && documentationFromAlias) {
|
|
142370
142437
|
documentation = documentationFromAlias;
|
|
@@ -160568,13 +160635,11 @@ var ts;
|
|
|
160568
160635
|
switch (context === null || context === void 0 ? void 0 : context.kind) {
|
|
160569
160636
|
case 171 /* GetAccessor */:
|
|
160570
160637
|
if (!this.contextualGetAccessorDocumentationComment) {
|
|
160571
|
-
this.contextualGetAccessorDocumentationComment = ts.emptyArray;
|
|
160572
160638
|
this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isGetAccessor), checker);
|
|
160573
160639
|
}
|
|
160574
160640
|
return this.contextualGetAccessorDocumentationComment;
|
|
160575
160641
|
case 172 /* SetAccessor */:
|
|
160576
160642
|
if (!this.contextualSetAccessorDocumentationComment) {
|
|
160577
|
-
this.contextualSetAccessorDocumentationComment = ts.emptyArray;
|
|
160578
160643
|
this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isSetAccessor), checker);
|
|
160579
160644
|
}
|
|
160580
160645
|
return this.contextualSetAccessorDocumentationComment;
|
|
@@ -160584,10 +160649,26 @@ var ts;
|
|
|
160584
160649
|
};
|
|
160585
160650
|
SymbolObject.prototype.getJsDocTags = function (checker) {
|
|
160586
160651
|
if (this.tags === undefined) {
|
|
160587
|
-
this.tags =
|
|
160652
|
+
this.tags = getJsDocTagsOfDeclarations(this.declarations, checker);
|
|
160588
160653
|
}
|
|
160589
160654
|
return this.tags;
|
|
160590
160655
|
};
|
|
160656
|
+
SymbolObject.prototype.getContextualJsDocTags = function (context, checker) {
|
|
160657
|
+
switch (context === null || context === void 0 ? void 0 : context.kind) {
|
|
160658
|
+
case 171 /* GetAccessor */:
|
|
160659
|
+
if (!this.contextualGetAccessorTags) {
|
|
160660
|
+
this.contextualGetAccessorTags = getJsDocTagsOfDeclarations(ts.filter(this.declarations, ts.isGetAccessor), checker);
|
|
160661
|
+
}
|
|
160662
|
+
return this.contextualGetAccessorTags;
|
|
160663
|
+
case 172 /* SetAccessor */:
|
|
160664
|
+
if (!this.contextualSetAccessorTags) {
|
|
160665
|
+
this.contextualSetAccessorTags = getJsDocTagsOfDeclarations(ts.filter(this.declarations, ts.isSetAccessor), checker);
|
|
160666
|
+
}
|
|
160667
|
+
return this.contextualSetAccessorTags;
|
|
160668
|
+
default:
|
|
160669
|
+
return this.getJsDocTags(checker);
|
|
160670
|
+
}
|
|
160671
|
+
};
|
|
160591
160672
|
return SymbolObject;
|
|
160592
160673
|
}());
|
|
160593
160674
|
var TokenObject = /** @class */ (function (_super) {
|
|
@@ -160757,10 +160838,7 @@ var ts;
|
|
|
160757
160838
|
return this.documentationComment || (this.documentationComment = getDocumentationComment(ts.singleElementArray(this.declaration), this.checker));
|
|
160758
160839
|
};
|
|
160759
160840
|
SignatureObject.prototype.getJsDocTags = function () {
|
|
160760
|
-
|
|
160761
|
-
this.jsDocTags = this.declaration ? getJsDocTagsOfSignature(this.declaration, this.checker) : [];
|
|
160762
|
-
}
|
|
160763
|
-
return this.jsDocTags;
|
|
160841
|
+
return this.jsDocTags || (this.jsDocTags = getJsDocTagsOfDeclarations(ts.singleElementArray(this.declaration), this.checker));
|
|
160764
160842
|
};
|
|
160765
160843
|
return SignatureObject;
|
|
160766
160844
|
}());
|
|
@@ -160772,12 +160850,30 @@ var ts;
|
|
|
160772
160850
|
function hasJSDocInheritDocTag(node) {
|
|
160773
160851
|
return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc"; });
|
|
160774
160852
|
}
|
|
160775
|
-
function
|
|
160776
|
-
|
|
160777
|
-
|
|
160778
|
-
|
|
160779
|
-
|
|
160780
|
-
|
|
160853
|
+
function getJsDocTagsOfDeclarations(declarations, checker) {
|
|
160854
|
+
if (!declarations)
|
|
160855
|
+
return ts.emptyArray;
|
|
160856
|
+
var tags = ts.JsDoc.getJsDocTagsFromDeclarations(declarations, checker);
|
|
160857
|
+
if (checker && (tags.length === 0 || declarations.some(hasJSDocInheritDocTag))) {
|
|
160858
|
+
var seenSymbols_1 = new ts.Set();
|
|
160859
|
+
var _loop_22 = function (declaration) {
|
|
160860
|
+
var inheritedTags = findBaseOfDeclaration(checker, declaration, function (symbol) {
|
|
160861
|
+
var _a;
|
|
160862
|
+
if (!seenSymbols_1.has(symbol)) {
|
|
160863
|
+
seenSymbols_1.add(symbol);
|
|
160864
|
+
if (declaration.kind === 171 /* GetAccessor */ || declaration.kind === 172 /* SetAccessor */) {
|
|
160865
|
+
return symbol.getContextualJsDocTags(declaration, checker);
|
|
160866
|
+
}
|
|
160867
|
+
return ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) === 1 ? symbol.getJsDocTags() : undefined;
|
|
160868
|
+
}
|
|
160869
|
+
});
|
|
160870
|
+
if (inheritedTags) {
|
|
160871
|
+
tags = __spreadArray(__spreadArray([], inheritedTags, true), tags, true);
|
|
160872
|
+
}
|
|
160873
|
+
};
|
|
160874
|
+
for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
|
|
160875
|
+
var declaration = declarations_6[_i];
|
|
160876
|
+
_loop_22(declaration);
|
|
160781
160877
|
}
|
|
160782
160878
|
}
|
|
160783
160879
|
return tags;
|
|
@@ -160787,18 +160883,24 @@ var ts;
|
|
|
160787
160883
|
return ts.emptyArray;
|
|
160788
160884
|
var doc = ts.JsDoc.getJsDocCommentsFromDeclarations(declarations, checker);
|
|
160789
160885
|
if (checker && (doc.length === 0 || declarations.some(hasJSDocInheritDocTag))) {
|
|
160790
|
-
var
|
|
160791
|
-
|
|
160792
|
-
var declaration = declarations_6[_i];
|
|
160886
|
+
var seenSymbols_2 = new ts.Set();
|
|
160887
|
+
var _loop_23 = function (declaration) {
|
|
160793
160888
|
var inheritedDocs = findBaseOfDeclaration(checker, declaration, function (symbol) {
|
|
160794
|
-
if (!
|
|
160795
|
-
|
|
160889
|
+
if (!seenSymbols_2.has(symbol)) {
|
|
160890
|
+
seenSymbols_2.add(symbol);
|
|
160891
|
+
if (declaration.kind === 171 /* GetAccessor */ || declaration.kind === 172 /* SetAccessor */) {
|
|
160892
|
+
return symbol.getContextualDocumentationComment(declaration, checker);
|
|
160893
|
+
}
|
|
160796
160894
|
return symbol.getDocumentationComment(checker);
|
|
160797
160895
|
}
|
|
160798
160896
|
});
|
|
160799
160897
|
// TODO: GH#16312 Return a ReadonlyArray, avoid copying inheritedDocs
|
|
160800
160898
|
if (inheritedDocs)
|
|
160801
160899
|
doc = doc.length === 0 ? inheritedDocs.slice() : inheritedDocs.concat(ts.lineBreakPart(), doc);
|
|
160900
|
+
};
|
|
160901
|
+
for (var _i = 0, declarations_7 = declarations; _i < declarations_7.length; _i++) {
|
|
160902
|
+
var declaration = declarations_7[_i];
|
|
160903
|
+
_loop_23(declaration);
|
|
160802
160904
|
}
|
|
160803
160905
|
}
|
|
160804
160906
|
return doc;
|
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.20220126";
|
|
93
93
|
/* @internal */
|
|
94
94
|
var Comparison;
|
|
95
95
|
(function (Comparison) {
|
|
@@ -100,13 +100,18 @@ var ts;
|
|
|
100
100
|
/* @internal */
|
|
101
101
|
var NativeCollections;
|
|
102
102
|
(function (NativeCollections) {
|
|
103
|
+
var globals = typeof globalThis !== "undefined" ? globalThis :
|
|
104
|
+
typeof global !== "undefined" ? global :
|
|
105
|
+
typeof self !== "undefined" ? self :
|
|
106
|
+
undefined;
|
|
103
107
|
/**
|
|
104
108
|
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
|
|
105
109
|
*/
|
|
106
110
|
function tryGetNativeMap() {
|
|
107
111
|
// Internet Explorer's Map doesn't support iteration, so don't use it.
|
|
112
|
+
var gMap = globals === null || globals === void 0 ? void 0 : globals.Map;
|
|
108
113
|
// eslint-disable-next-line no-in-operator
|
|
109
|
-
return typeof
|
|
114
|
+
return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
|
|
110
115
|
}
|
|
111
116
|
NativeCollections.tryGetNativeMap = tryGetNativeMap;
|
|
112
117
|
/**
|
|
@@ -114,8 +119,9 @@ var ts;
|
|
|
114
119
|
*/
|
|
115
120
|
function tryGetNativeSet() {
|
|
116
121
|
// Internet Explorer's Set doesn't support iteration, so don't use it.
|
|
122
|
+
var gSet = globals === null || globals === void 0 ? void 0 : globals.Set;
|
|
117
123
|
// eslint-disable-next-line no-in-operator
|
|
118
|
-
return typeof
|
|
124
|
+
return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
|
|
119
125
|
}
|
|
120
126
|
NativeCollections.tryGetNativeSet = tryGetNativeSet;
|
|
121
127
|
})(NativeCollections || (NativeCollections = {}));
|
|
@@ -14046,10 +14052,13 @@ var ts;
|
|
|
14046
14052
|
function packageIdIsEqual(a, b) {
|
|
14047
14053
|
return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
|
|
14048
14054
|
}
|
|
14049
|
-
function
|
|
14050
|
-
var name = _a.name, subModuleName = _a.subModuleName
|
|
14051
|
-
|
|
14052
|
-
|
|
14055
|
+
function packageIdToPackageName(_a) {
|
|
14056
|
+
var name = _a.name, subModuleName = _a.subModuleName;
|
|
14057
|
+
return subModuleName ? name + "/" + subModuleName : name;
|
|
14058
|
+
}
|
|
14059
|
+
ts.packageIdToPackageName = packageIdToPackageName;
|
|
14060
|
+
function packageIdToString(packageId) {
|
|
14061
|
+
return packageIdToPackageName(packageId) + "@" + packageId.version;
|
|
14053
14062
|
}
|
|
14054
14063
|
ts.packageIdToString = packageIdToString;
|
|
14055
14064
|
function typeDirectiveIsEqualTo(oldResolution, newResolution) {
|
|
@@ -15050,7 +15059,8 @@ var ts;
|
|
|
15050
15059
|
node.kind === 212 /* FunctionExpression */ ||
|
|
15051
15060
|
node.kind === 213 /* ArrowFunction */ ||
|
|
15052
15061
|
node.kind === 211 /* ParenthesizedExpression */ ||
|
|
15053
|
-
node.kind === 253 /* VariableDeclaration */
|
|
15062
|
+
node.kind === 253 /* VariableDeclaration */ ||
|
|
15063
|
+
node.kind === 274 /* ExportSpecifier */) ?
|
|
15054
15064
|
ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
|
|
15055
15065
|
ts.getLeadingCommentRanges(text, node.pos);
|
|
15056
15066
|
// True if the comment starts with '/**' but not if it is '/**/'
|
|
@@ -36201,7 +36211,8 @@ var ts;
|
|
|
36201
36211
|
return finishNode(node, pos);
|
|
36202
36212
|
}
|
|
36203
36213
|
function parseExportSpecifier() {
|
|
36204
|
-
|
|
36214
|
+
var hasJSDoc = hasPrecedingJSDocComment();
|
|
36215
|
+
return withJSDoc(parseImportOrExportSpecifier(274 /* ExportSpecifier */), hasJSDoc);
|
|
36205
36216
|
}
|
|
36206
36217
|
function parseImportSpecifier() {
|
|
36207
36218
|
return parseImportOrExportSpecifier(269 /* ImportSpecifier */);
|
|
@@ -43406,14 +43417,12 @@ var ts;
|
|
|
43406
43417
|
}
|
|
43407
43418
|
var binder = createBinder();
|
|
43408
43419
|
function bindSourceFile(file, options) {
|
|
43409
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43410
43420
|
ts.performance.mark("beforeBind");
|
|
43411
43421
|
ts.perfLogger.logStartBindFile("" + file.fileName);
|
|
43412
43422
|
binder(file, options);
|
|
43413
43423
|
ts.perfLogger.logStopBindFile();
|
|
43414
43424
|
ts.performance.mark("afterBind");
|
|
43415
43425
|
ts.performance.measure("Bind", "beforeBind", "afterBind");
|
|
43416
|
-
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43417
43426
|
}
|
|
43418
43427
|
ts.bindSourceFile = bindSourceFile;
|
|
43419
43428
|
function createBinder() {
|
|
@@ -43473,7 +43482,9 @@ var ts;
|
|
|
43473
43482
|
ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);
|
|
43474
43483
|
ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
|
|
43475
43484
|
if (!file.locals) {
|
|
43485
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
|
|
43476
43486
|
bind(file);
|
|
43487
|
+
ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
|
|
43477
43488
|
file.symbolCount = symbolCount;
|
|
43478
43489
|
file.classifiableNames = classifiableNames;
|
|
43479
43490
|
delayedBindJSDocTypedefTag();
|
|
@@ -47740,6 +47751,9 @@ var ts;
|
|
|
47740
47751
|
suggestionDiagnostics.add(diagnostic);
|
|
47741
47752
|
return diagnostic;
|
|
47742
47753
|
}
|
|
47754
|
+
function isDeprecatedSymbol(symbol) {
|
|
47755
|
+
return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 134217728 /* Deprecated */);
|
|
47756
|
+
}
|
|
47743
47757
|
function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
|
|
47744
47758
|
var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
|
|
47745
47759
|
return addDeprecatedSuggestionWorker(declarations, diagnostic);
|
|
@@ -60526,7 +60540,7 @@ var ts;
|
|
|
60526
60540
|
}
|
|
60527
60541
|
var prop = getPropertyOfType(objectType, propName);
|
|
60528
60542
|
if (prop) {
|
|
60529
|
-
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations &&
|
|
60543
|
+
if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) {
|
|
60530
60544
|
var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
|
|
60531
60545
|
addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
|
|
60532
60546
|
}
|
|
@@ -69929,9 +69943,9 @@ var ts;
|
|
|
69929
69943
|
markAliasReferenced(symbol, node);
|
|
69930
69944
|
}
|
|
69931
69945
|
var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
|
|
69932
|
-
var
|
|
69933
|
-
if (
|
|
69934
|
-
addDeprecatedSuggestion(node,
|
|
69946
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
|
|
69947
|
+
if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
|
|
69948
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
|
|
69935
69949
|
}
|
|
69936
69950
|
var declaration = localOrExportSymbol.valueDeclaration;
|
|
69937
69951
|
if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
|
|
@@ -72943,7 +72957,7 @@ var ts;
|
|
|
72943
72957
|
}
|
|
72944
72958
|
}
|
|
72945
72959
|
else {
|
|
72946
|
-
if (
|
|
72960
|
+
if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
|
|
72947
72961
|
addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
|
|
72948
72962
|
}
|
|
72949
72963
|
checkPropertyNotUsedBeforeDeclaration(prop, node, right);
|
|
@@ -83112,7 +83126,6 @@ var ts;
|
|
|
83112
83126
|
return true;
|
|
83113
83127
|
}
|
|
83114
83128
|
function checkAliasSymbol(node) {
|
|
83115
|
-
var _a;
|
|
83116
83129
|
var symbol = getSymbolOfNode(node);
|
|
83117
83130
|
var target = resolveAlias(symbol);
|
|
83118
83131
|
if (target !== unknownSymbol) {
|
|
@@ -83168,10 +83181,45 @@ var ts;
|
|
|
83168
83181
|
}
|
|
83169
83182
|
}
|
|
83170
83183
|
}
|
|
83171
|
-
if (ts.isImportSpecifier(node)
|
|
83172
|
-
|
|
83184
|
+
if (ts.isImportSpecifier(node)) {
|
|
83185
|
+
var targetSymbol = checkDeprecatedAliasedSymbol(symbol, node);
|
|
83186
|
+
if (isDeprecatedAliasedSymbol(targetSymbol) && targetSymbol.declarations) {
|
|
83187
|
+
addDeprecatedSuggestion(node, targetSymbol.declarations, targetSymbol.escapedName);
|
|
83188
|
+
}
|
|
83189
|
+
}
|
|
83190
|
+
}
|
|
83191
|
+
}
|
|
83192
|
+
function isDeprecatedAliasedSymbol(symbol) {
|
|
83193
|
+
return !!symbol.declarations && ts.every(symbol.declarations, function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); });
|
|
83194
|
+
}
|
|
83195
|
+
function checkDeprecatedAliasedSymbol(symbol, location) {
|
|
83196
|
+
if (!(symbol.flags & 2097152 /* Alias */))
|
|
83197
|
+
return symbol;
|
|
83198
|
+
var targetSymbol = resolveAlias(symbol);
|
|
83199
|
+
if (targetSymbol === unknownSymbol)
|
|
83200
|
+
return targetSymbol;
|
|
83201
|
+
while (symbol.flags & 2097152 /* Alias */) {
|
|
83202
|
+
var target = getImmediateAliasedSymbol(symbol);
|
|
83203
|
+
if (target) {
|
|
83204
|
+
if (target === targetSymbol)
|
|
83205
|
+
break;
|
|
83206
|
+
if (target.declarations && ts.length(target.declarations)) {
|
|
83207
|
+
if (isDeprecatedAliasedSymbol(target)) {
|
|
83208
|
+
addDeprecatedSuggestion(location, target.declarations, target.escapedName);
|
|
83209
|
+
break;
|
|
83210
|
+
}
|
|
83211
|
+
else {
|
|
83212
|
+
if (symbol === targetSymbol)
|
|
83213
|
+
break;
|
|
83214
|
+
symbol = target;
|
|
83215
|
+
}
|
|
83216
|
+
}
|
|
83217
|
+
}
|
|
83218
|
+
else {
|
|
83219
|
+
break;
|
|
83173
83220
|
}
|
|
83174
83221
|
}
|
|
83222
|
+
return targetSymbol;
|
|
83175
83223
|
}
|
|
83176
83224
|
function checkImportBinding(node) {
|
|
83177
83225
|
checkCollisionsForDeclarationName(node, node.name);
|
|
@@ -115830,14 +115878,14 @@ var ts;
|
|
|
115830
115878
|
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
|
115831
115879
|
addFileToFilesByName(dupFile, path, redirectedPath);
|
|
115832
115880
|
addFileIncludeReason(dupFile, reason);
|
|
115833
|
-
sourceFileToPackageName.set(path, packageId
|
|
115881
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
115834
115882
|
processingOtherFiles.push(dupFile);
|
|
115835
115883
|
return dupFile;
|
|
115836
115884
|
}
|
|
115837
115885
|
else if (file) {
|
|
115838
115886
|
// This is the first source file to have this packageId.
|
|
115839
115887
|
packageIdToSourceFile.set(packageIdKey, file);
|
|
115840
|
-
sourceFileToPackageName.set(path, packageId
|
|
115888
|
+
sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
|
|
115841
115889
|
}
|
|
115842
115890
|
}
|
|
115843
115891
|
addFileToFilesByName(file, path, redirectedPath);
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "typescript",
|
|
3
3
|
"author": "Microsoft Corp.",
|
|
4
4
|
"homepage": "https://www.typescriptlang.org/",
|
|
5
|
-
"version": "4.6.0-dev.
|
|
5
|
+
"version": "4.6.0-dev.20220126",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"description": "TypeScript is a language for application scale JavaScript development",
|
|
8
8
|
"keywords": [
|