typescript 4.6.0-dev.20220125 → 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.
@@ -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.20220125";
297
+ ts.version = ts.versionMajorMinor + ".0-dev.20220126";
298
298
  /* @internal */
299
299
  var Comparison;
300
300
  (function (Comparison) {
@@ -14257,10 +14257,13 @@ var ts;
14257
14257
  function packageIdIsEqual(a, b) {
14258
14258
  return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
14259
14259
  }
14260
- function packageIdToString(_a) {
14261
- var name = _a.name, subModuleName = _a.subModuleName, version = _a.version;
14262
- var fullName = subModuleName ? name + "/" + subModuleName : name;
14263
- return fullName + "@" + version;
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;
14264
14267
  }
14265
14268
  ts.packageIdToString = packageIdToString;
14266
14269
  function typeDirectiveIsEqualTo(oldResolution, newResolution) {
@@ -15261,7 +15264,8 @@ var ts;
15261
15264
  node.kind === 212 /* FunctionExpression */ ||
15262
15265
  node.kind === 213 /* ArrowFunction */ ||
15263
15266
  node.kind === 211 /* ParenthesizedExpression */ ||
15264
- node.kind === 253 /* VariableDeclaration */) ?
15267
+ node.kind === 253 /* VariableDeclaration */ ||
15268
+ node.kind === 274 /* ExportSpecifier */) ?
15265
15269
  ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
15266
15270
  ts.getLeadingCommentRanges(text, node.pos);
15267
15271
  // True if the comment starts with '/**' but not if it is '/**/'
@@ -36412,7 +36416,8 @@ var ts;
36412
36416
  return finishNode(node, pos);
36413
36417
  }
36414
36418
  function parseExportSpecifier() {
36415
- return parseImportOrExportSpecifier(274 /* ExportSpecifier */);
36419
+ var hasJSDoc = hasPrecedingJSDocComment();
36420
+ return withJSDoc(parseImportOrExportSpecifier(274 /* ExportSpecifier */), hasJSDoc);
36416
36421
  }
36417
36422
  function parseImportSpecifier() {
36418
36423
  return parseImportOrExportSpecifier(269 /* ImportSpecifier */);
@@ -43617,14 +43622,12 @@ var ts;
43617
43622
  }
43618
43623
  var binder = createBinder();
43619
43624
  function bindSourceFile(file, options) {
43620
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
43621
43625
  ts.performance.mark("beforeBind");
43622
43626
  ts.perfLogger.logStartBindFile("" + file.fileName);
43623
43627
  binder(file, options);
43624
43628
  ts.perfLogger.logStopBindFile();
43625
43629
  ts.performance.mark("afterBind");
43626
43630
  ts.performance.measure("Bind", "beforeBind", "afterBind");
43627
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
43628
43631
  }
43629
43632
  ts.bindSourceFile = bindSourceFile;
43630
43633
  function createBinder() {
@@ -43684,7 +43687,9 @@ var ts;
43684
43687
  ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);
43685
43688
  ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
43686
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);
43687
43691
  bind(file);
43692
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
43688
43693
  file.symbolCount = symbolCount;
43689
43694
  file.classifiableNames = classifiableNames;
43690
43695
  delayedBindJSDocTypedefTag();
@@ -47951,6 +47956,9 @@ var ts;
47951
47956
  suggestionDiagnostics.add(diagnostic);
47952
47957
  return diagnostic;
47953
47958
  }
47959
+ function isDeprecatedSymbol(symbol) {
47960
+ return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 134217728 /* Deprecated */);
47961
+ }
47954
47962
  function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
47955
47963
  var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
47956
47964
  return addDeprecatedSuggestionWorker(declarations, diagnostic);
@@ -60737,7 +60745,7 @@ var ts;
60737
60745
  }
60738
60746
  var prop = getPropertyOfType(objectType, propName);
60739
60747
  if (prop) {
60740
- if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) {
60748
+ if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) {
60741
60749
  var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
60742
60750
  addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
60743
60751
  }
@@ -70140,9 +70148,9 @@ var ts;
70140
70148
  markAliasReferenced(symbol, node);
70141
70149
  }
70142
70150
  var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
70143
- var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol;
70144
- if (sourceSymbol.declarations && getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, sourceSymbol)) {
70145
- addDeprecatedSuggestion(node, sourceSymbol.declarations, node.escapedText);
70151
+ var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
70152
+ if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
70153
+ addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
70146
70154
  }
70147
70155
  var declaration = localOrExportSymbol.valueDeclaration;
70148
70156
  if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
@@ -73154,7 +73162,7 @@ var ts;
73154
73162
  }
73155
73163
  }
73156
73164
  else {
73157
- if (prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) {
73165
+ if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
73158
73166
  addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
73159
73167
  }
73160
73168
  checkPropertyNotUsedBeforeDeclaration(prop, node, right);
@@ -83323,7 +83331,6 @@ var ts;
83323
83331
  return true;
83324
83332
  }
83325
83333
  function checkAliasSymbol(node) {
83326
- var _a;
83327
83334
  var symbol = getSymbolOfNode(node);
83328
83335
  var target = resolveAlias(symbol);
83329
83336
  if (target !== unknownSymbol) {
@@ -83379,11 +83386,46 @@ var ts;
83379
83386
  }
83380
83387
  }
83381
83388
  }
83382
- if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
83383
- addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
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
+ }
83384
83394
  }
83385
83395
  }
83386
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
+ }
83387
83429
  function checkImportBinding(node) {
83388
83430
  checkCollisionsForDeclarationName(node, node.name);
83389
83431
  checkAliasSymbol(node);
@@ -116041,14 +116083,14 @@ var ts;
116041
116083
  redirectTargetsMap.add(fileFromPackageId.path, fileName);
116042
116084
  addFileToFilesByName(dupFile, path, redirectedPath);
116043
116085
  addFileIncludeReason(dupFile, reason);
116044
- sourceFileToPackageName.set(path, packageId.name);
116086
+ sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
116045
116087
  processingOtherFiles.push(dupFile);
116046
116088
  return dupFile;
116047
116089
  }
116048
116090
  else if (file) {
116049
116091
  // This is the first source file to have this packageId.
116050
116092
  packageIdToSourceFile.set(packageIdKey, file);
116051
- sourceFileToPackageName.set(path, packageId.name);
116093
+ sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
116052
116094
  }
116053
116095
  }
116054
116096
  addFileToFilesByName(file, path, redirectedPath);
@@ -141898,6 +141940,8 @@ var ts;
141898
141940
  }
141899
141941
  if (flags & 16 /* Function */)
141900
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.
141901
141945
  if (flags & 32768 /* GetAccessor */)
141902
141946
  return "getter" /* memberGetAccessorElement */;
141903
141947
  if (flags & 65536 /* SetAccessor */)
@@ -141984,9 +142028,24 @@ var ts;
141984
142028
  }
141985
142029
  // Class at constructor site need to be shown as constructor apart from property,method, vars
141986
142030
  if (symbolKind !== "" /* unknown */ || symbolFlags & 32 /* Class */ || symbolFlags & 2097152 /* Alias */) {
141987
- // If it is accessor they are allowed only if location is at name of the accessor
142031
+ // If symbol is accessor, they are allowed only if location is at declaration identifier of the accessor
141988
142032
  if (symbolKind === "getter" /* memberGetAccessorElement */ || symbolKind === "setter" /* memberSetAccessorElement */) {
141989
- symbolKind = "property" /* memberVariableElement */;
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
+ }
141990
142049
  }
141991
142050
  var signature = void 0;
141992
142051
  type = isThisExpression ? typeChecker.getTypeAtLocation(location) : typeChecker.getTypeOfSymbolAtLocation(symbol, location);
@@ -142300,6 +142359,8 @@ var ts;
142300
142359
  }
142301
142360
  // For properties, variables and local vars: show the type
142302
142361
  if (symbolKind === "property" /* memberVariableElement */ ||
142362
+ symbolKind === "getter" /* memberGetAccessorElement */ ||
142363
+ symbolKind === "setter" /* memberSetAccessorElement */ ||
142303
142364
  symbolKind === "JSX attribute" /* jsxAttribute */ ||
142304
142365
  symbolFlags & 3 /* Variable */ ||
142305
142366
  symbolKind === "local var" /* localVariableElement */ ||
@@ -142370,7 +142431,7 @@ var ts;
142370
142431
  }
142371
142432
  }
142372
142433
  if (tags.length === 0 && !hasMultipleSignatures) {
142373
- tags = symbol.getJsDocTags(typeChecker);
142434
+ tags = symbol.getContextualJsDocTags(enclosingDeclaration, typeChecker);
142374
142435
  }
142375
142436
  if (documentation.length === 0 && documentationFromAlias) {
142376
142437
  documentation = documentationFromAlias;
@@ -160574,13 +160635,11 @@ var ts;
160574
160635
  switch (context === null || context === void 0 ? void 0 : context.kind) {
160575
160636
  case 171 /* GetAccessor */:
160576
160637
  if (!this.contextualGetAccessorDocumentationComment) {
160577
- this.contextualGetAccessorDocumentationComment = ts.emptyArray;
160578
160638
  this.contextualGetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isGetAccessor), checker);
160579
160639
  }
160580
160640
  return this.contextualGetAccessorDocumentationComment;
160581
160641
  case 172 /* SetAccessor */:
160582
160642
  if (!this.contextualSetAccessorDocumentationComment) {
160583
- this.contextualSetAccessorDocumentationComment = ts.emptyArray;
160584
160643
  this.contextualSetAccessorDocumentationComment = getDocumentationComment(ts.filter(this.declarations, ts.isSetAccessor), checker);
160585
160644
  }
160586
160645
  return this.contextualSetAccessorDocumentationComment;
@@ -160590,10 +160649,26 @@ var ts;
160590
160649
  };
160591
160650
  SymbolObject.prototype.getJsDocTags = function (checker) {
160592
160651
  if (this.tags === undefined) {
160593
- this.tags = ts.JsDoc.getJsDocTagsFromDeclarations(this.declarations, checker);
160652
+ this.tags = getJsDocTagsOfDeclarations(this.declarations, checker);
160594
160653
  }
160595
160654
  return this.tags;
160596
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
+ };
160597
160672
  return SymbolObject;
160598
160673
  }());
160599
160674
  var TokenObject = /** @class */ (function (_super) {
@@ -160763,10 +160838,7 @@ var ts;
160763
160838
  return this.documentationComment || (this.documentationComment = getDocumentationComment(ts.singleElementArray(this.declaration), this.checker));
160764
160839
  };
160765
160840
  SignatureObject.prototype.getJsDocTags = function () {
160766
- if (this.jsDocTags === undefined) {
160767
- this.jsDocTags = this.declaration ? getJsDocTagsOfSignature(this.declaration, this.checker) : [];
160768
- }
160769
- return this.jsDocTags;
160841
+ return this.jsDocTags || (this.jsDocTags = getJsDocTagsOfDeclarations(ts.singleElementArray(this.declaration), this.checker));
160770
160842
  };
160771
160843
  return SignatureObject;
160772
160844
  }());
@@ -160778,12 +160850,30 @@ var ts;
160778
160850
  function hasJSDocInheritDocTag(node) {
160779
160851
  return ts.getJSDocTags(node).some(function (tag) { return tag.tagName.text === "inheritDoc"; });
160780
160852
  }
160781
- function getJsDocTagsOfSignature(declaration, checker) {
160782
- var tags = ts.JsDoc.getJsDocTagsFromDeclarations([declaration], checker);
160783
- if (tags.length === 0 || hasJSDocInheritDocTag(declaration)) {
160784
- var inheritedTags = findBaseOfDeclaration(checker, declaration, function (symbol) { var _a; return ((_a = symbol.declarations) === null || _a === void 0 ? void 0 : _a.length) === 1 ? symbol.getJsDocTags() : undefined; });
160785
- if (inheritedTags) {
160786
- tags = __spreadArray(__spreadArray([], inheritedTags, true), tags, true);
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);
160787
160877
  }
160788
160878
  }
160789
160879
  return tags;
@@ -160793,18 +160883,24 @@ var ts;
160793
160883
  return ts.emptyArray;
160794
160884
  var doc = ts.JsDoc.getJsDocCommentsFromDeclarations(declarations, checker);
160795
160885
  if (checker && (doc.length === 0 || declarations.some(hasJSDocInheritDocTag))) {
160796
- var seenSymbols_1 = new ts.Set();
160797
- for (var _i = 0, declarations_6 = declarations; _i < declarations_6.length; _i++) {
160798
- var declaration = declarations_6[_i];
160886
+ var seenSymbols_2 = new ts.Set();
160887
+ var _loop_23 = function (declaration) {
160799
160888
  var inheritedDocs = findBaseOfDeclaration(checker, declaration, function (symbol) {
160800
- if (!seenSymbols_1.has(symbol)) {
160801
- seenSymbols_1.add(symbol);
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
+ }
160802
160894
  return symbol.getDocumentationComment(checker);
160803
160895
  }
160804
160896
  });
160805
160897
  // TODO: GH#16312 Return a ReadonlyArray, avoid copying inheritedDocs
160806
160898
  if (inheritedDocs)
160807
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);
160808
160904
  }
160809
160905
  }
160810
160906
  return doc;
@@ -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.20220125";
92
+ ts.version = ts.versionMajorMinor + ".0-dev.20220126";
93
93
  /* @internal */
94
94
  var Comparison;
95
95
  (function (Comparison) {
@@ -14052,10 +14052,13 @@ var ts;
14052
14052
  function packageIdIsEqual(a, b) {
14053
14053
  return a === b || !!a && !!b && a.name === b.name && a.subModuleName === b.subModuleName && a.version === b.version;
14054
14054
  }
14055
- function packageIdToString(_a) {
14056
- var name = _a.name, subModuleName = _a.subModuleName, version = _a.version;
14057
- var fullName = subModuleName ? name + "/" + subModuleName : name;
14058
- return fullName + "@" + version;
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;
14059
14062
  }
14060
14063
  ts.packageIdToString = packageIdToString;
14061
14064
  function typeDirectiveIsEqualTo(oldResolution, newResolution) {
@@ -15056,7 +15059,8 @@ var ts;
15056
15059
  node.kind === 212 /* FunctionExpression */ ||
15057
15060
  node.kind === 213 /* ArrowFunction */ ||
15058
15061
  node.kind === 211 /* ParenthesizedExpression */ ||
15059
- node.kind === 253 /* VariableDeclaration */) ?
15062
+ node.kind === 253 /* VariableDeclaration */ ||
15063
+ node.kind === 274 /* ExportSpecifier */) ?
15060
15064
  ts.concatenate(ts.getTrailingCommentRanges(text, node.pos), ts.getLeadingCommentRanges(text, node.pos)) :
15061
15065
  ts.getLeadingCommentRanges(text, node.pos);
15062
15066
  // True if the comment starts with '/**' but not if it is '/**/'
@@ -36207,7 +36211,8 @@ var ts;
36207
36211
  return finishNode(node, pos);
36208
36212
  }
36209
36213
  function parseExportSpecifier() {
36210
- return parseImportOrExportSpecifier(274 /* ExportSpecifier */);
36214
+ var hasJSDoc = hasPrecedingJSDocComment();
36215
+ return withJSDoc(parseImportOrExportSpecifier(274 /* ExportSpecifier */), hasJSDoc);
36211
36216
  }
36212
36217
  function parseImportSpecifier() {
36213
36218
  return parseImportOrExportSpecifier(269 /* ImportSpecifier */);
@@ -43412,14 +43417,12 @@ var ts;
43412
43417
  }
43413
43418
  var binder = createBinder();
43414
43419
  function bindSourceFile(file, options) {
43415
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.push("bind" /* Bind */, "bindSourceFile", { path: file.path }, /*separateBeginAndEnd*/ true);
43416
43420
  ts.performance.mark("beforeBind");
43417
43421
  ts.perfLogger.logStartBindFile("" + file.fileName);
43418
43422
  binder(file, options);
43419
43423
  ts.perfLogger.logStopBindFile();
43420
43424
  ts.performance.mark("afterBind");
43421
43425
  ts.performance.measure("Bind", "beforeBind", "afterBind");
43422
- ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
43423
43426
  }
43424
43427
  ts.bindSourceFile = bindSourceFile;
43425
43428
  function createBinder() {
@@ -43479,7 +43482,9 @@ var ts;
43479
43482
  ts.Debug.attachFlowNodeDebugInfo(unreachableFlow);
43480
43483
  ts.Debug.attachFlowNodeDebugInfo(reportedUnreachableFlow);
43481
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);
43482
43486
  bind(file);
43487
+ ts.tracing === null || ts.tracing === void 0 ? void 0 : ts.tracing.pop();
43483
43488
  file.symbolCount = symbolCount;
43484
43489
  file.classifiableNames = classifiableNames;
43485
43490
  delayedBindJSDocTypedefTag();
@@ -47746,6 +47751,9 @@ var ts;
47746
47751
  suggestionDiagnostics.add(diagnostic);
47747
47752
  return diagnostic;
47748
47753
  }
47754
+ function isDeprecatedSymbol(symbol) {
47755
+ return !!(getDeclarationNodeFlagsFromSymbol(symbol) & 134217728 /* Deprecated */);
47756
+ }
47749
47757
  function addDeprecatedSuggestion(location, declarations, deprecatedEntity) {
47750
47758
  var diagnostic = ts.createDiagnosticForNode(location, ts.Diagnostics._0_is_deprecated, deprecatedEntity);
47751
47759
  return addDeprecatedSuggestionWorker(declarations, diagnostic);
@@ -60532,7 +60540,7 @@ var ts;
60532
60540
  }
60533
60541
  var prop = getPropertyOfType(objectType, propName);
60534
60542
  if (prop) {
60535
- if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(accessNode, prop)) {
60543
+ if (accessFlags & 64 /* ReportDeprecated */ && accessNode && prop.declarations && isDeprecatedSymbol(prop) && isUncalledFunctionReference(accessNode, prop)) {
60536
60544
  var deprecatedNode = (_a = accessExpression === null || accessExpression === void 0 ? void 0 : accessExpression.argumentExpression) !== null && _a !== void 0 ? _a : (ts.isIndexedAccessTypeNode(accessNode) ? accessNode.indexType : accessNode);
60537
60545
  addDeprecatedSuggestion(deprecatedNode, prop.declarations, propName);
60538
60546
  }
@@ -69935,9 +69943,9 @@ var ts;
69935
69943
  markAliasReferenced(symbol, node);
69936
69944
  }
69937
69945
  var localOrExportSymbol = getExportSymbolOfValueSymbolIfExported(symbol);
69938
- var sourceSymbol = localOrExportSymbol.flags & 2097152 /* Alias */ ? resolveAlias(localOrExportSymbol) : localOrExportSymbol;
69939
- if (sourceSymbol.declarations && getDeclarationNodeFlagsFromSymbol(sourceSymbol) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, sourceSymbol)) {
69940
- addDeprecatedSuggestion(node, sourceSymbol.declarations, node.escapedText);
69946
+ var targetSymbol = checkDeprecatedAliasedSymbol(localOrExportSymbol, node);
69947
+ if (isDeprecatedSymbol(targetSymbol) && isUncalledFunctionReference(node, targetSymbol) && targetSymbol.declarations) {
69948
+ addDeprecatedSuggestion(node, targetSymbol.declarations, node.escapedText);
69941
69949
  }
69942
69950
  var declaration = localOrExportSymbol.valueDeclaration;
69943
69951
  if (declaration && localOrExportSymbol.flags & 32 /* Class */) {
@@ -72949,7 +72957,7 @@ var ts;
72949
72957
  }
72950
72958
  }
72951
72959
  else {
72952
- if (prop.declarations && getDeclarationNodeFlagsFromSymbol(prop) & 134217728 /* Deprecated */ && isUncalledFunctionReference(node, prop)) {
72960
+ if (isDeprecatedSymbol(prop) && isUncalledFunctionReference(node, prop) && prop.declarations) {
72953
72961
  addDeprecatedSuggestion(right, prop.declarations, right.escapedText);
72954
72962
  }
72955
72963
  checkPropertyNotUsedBeforeDeclaration(prop, node, right);
@@ -83118,7 +83126,6 @@ var ts;
83118
83126
  return true;
83119
83127
  }
83120
83128
  function checkAliasSymbol(node) {
83121
- var _a;
83122
83129
  var symbol = getSymbolOfNode(node);
83123
83130
  var target = resolveAlias(symbol);
83124
83131
  if (target !== unknownSymbol) {
@@ -83174,10 +83181,45 @@ var ts;
83174
83181
  }
83175
83182
  }
83176
83183
  }
83177
- if (ts.isImportSpecifier(node) && ((_a = target.declarations) === null || _a === void 0 ? void 0 : _a.every(function (d) { return !!(ts.getCombinedNodeFlags(d) & 134217728 /* Deprecated */); }))) {
83178
- addDeprecatedSuggestion(node.name, target.declarations, symbol.escapedName);
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;
83179
83220
  }
83180
83221
  }
83222
+ return targetSymbol;
83181
83223
  }
83182
83224
  function checkImportBinding(node) {
83183
83225
  checkCollisionsForDeclarationName(node, node.name);
@@ -115836,14 +115878,14 @@ var ts;
115836
115878
  redirectTargetsMap.add(fileFromPackageId.path, fileName);
115837
115879
  addFileToFilesByName(dupFile, path, redirectedPath);
115838
115880
  addFileIncludeReason(dupFile, reason);
115839
- sourceFileToPackageName.set(path, packageId.name);
115881
+ sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
115840
115882
  processingOtherFiles.push(dupFile);
115841
115883
  return dupFile;
115842
115884
  }
115843
115885
  else if (file) {
115844
115886
  // This is the first source file to have this packageId.
115845
115887
  packageIdToSourceFile.set(packageIdKey, file);
115846
- sourceFileToPackageName.set(path, packageId.name);
115888
+ sourceFileToPackageName.set(path, ts.packageIdToPackageName(packageId));
115847
115889
  }
115848
115890
  }
115849
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.20220125",
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": [