Skip to content

Commit

Permalink
Add a workaround for microsoft/TypeScript#44422
Browse files Browse the repository at this point in the history
  • Loading branch information
octogonz committed Jun 3, 2021
1 parent d9463e1 commit cfa0abe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions apps/api-extractor/src/analyzer/Span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,16 @@ export class Span {

let previousChildSpan: Span | undefined = undefined;

const visitedChildren: Set<ts.Node> = new Set();

for (const childNode of this.node.getChildren() || []) {
// FIX ME: This is a temporary workaround for a problem introduced by TypeScript 4.3.
// https://github.com/microsoft/TypeScript/issues/44422
if (visitedChildren.has(childNode)) {
continue;
}
visitedChildren.add(childNode);

const childSpan: Span = new Span(childNode);
childSpan._parent = this;
childSpan._previousSibling = previousChildSpan;
Expand Down

0 comments on commit cfa0abe

Please sign in to comment.