Fixed crash when looking for contextual inherited JSDocs for setters and getters (#60027)

Co-authored-by: Gabriela Araujo Britto <garaujobritto@gmail.com>
This commit is contained in:
Mateusz Burzyński
2024-09-25 20:04:01 +02:00
committed by GitHub
parent e962037df3
commit 413f0fa831
2 changed files with 26 additions and 0 deletions

View File

@@ -735,6 +735,8 @@ class SymbolObject implements Symbol {
if (context) {
if (isGetAccessor(context)) {
if (!this.contextualGetAccessorDocumentationComment) {
this.contextualGetAccessorDocumentationComment = emptyArray; // Set temporarily to avoid an infinite loop finding inherited tags
this.contextualGetAccessorDocumentationComment = getDocumentationComment(filter(this.declarations, isGetAccessor), checker);
}
if (length(this.contextualGetAccessorDocumentationComment)) {
@@ -743,6 +745,8 @@ class SymbolObject implements Symbol {
}
if (isSetAccessor(context)) {
if (!this.contextualSetAccessorDocumentationComment) {
this.contextualSetAccessorDocumentationComment = emptyArray; // Set temporarily to avoid an infinite loop finding inherited tags
this.contextualSetAccessorDocumentationComment = getDocumentationComment(filter(this.declarations, isSetAccessor), checker);
}
if (length(this.contextualSetAccessorDocumentationComment)) {
@@ -766,6 +770,8 @@ class SymbolObject implements Symbol {
if (context) {
if (isGetAccessor(context)) {
if (!this.contextualGetAccessorTags) {
this.contextualGetAccessorTags = emptyArray; // Set temporarily to avoid an infinite loop finding inherited tags
this.contextualGetAccessorTags = getJsDocTagsOfDeclarations(filter(this.declarations, isGetAccessor), checker);
}
if (length(this.contextualGetAccessorTags)) {
@@ -774,6 +780,8 @@ class SymbolObject implements Symbol {
}
if (isSetAccessor(context)) {
if (!this.contextualSetAccessorTags) {
this.contextualSetAccessorTags = emptyArray; // Set temporarily to avoid an infinite loop finding inherited tags
this.contextualSetAccessorTags = getJsDocTagsOfDeclarations(filter(this.declarations, isSetAccessor), checker);
}
if (length(this.contextualSetAccessorTags)) {