diff --git a/CHANGELOG.md b/CHANGELOG.md index 8b59d6069..4224c42f1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ## Bug Fixes - Fixed an issue where a namespace would not be created for merged function-namespaces which are declared as variables, #2478. +- A class which implements itself will no longer cause a crash when rendering HTML, #2495. - Variable functions which have construct signatures will no longer be converted as functions, ignoring the construct signatures. - Fixed an issue where, if the index section was collapsed when loading the page, all content within it would be hidden until expanded, and a member visibility checkbox was changed. diff --git a/src/lib/output/themes/default/templates/hierarchy.tsx b/src/lib/output/themes/default/templates/hierarchy.tsx index ccc1fdf06..f741aeab8 100644 --- a/src/lib/output/themes/default/templates/hierarchy.tsx +++ b/src/lib/output/themes/default/templates/hierarchy.tsx @@ -3,7 +3,14 @@ import type { PageEvent } from "../../../events"; import { JSX } from "../../../../utils"; import { ReflectionKind, type ProjectReflection, DeclarationReflection } from "../../../../models"; -function fullHierarchy(context: DefaultThemeRenderContext, root: DeclarationReflection) { +function fullHierarchy( + context: DefaultThemeRenderContext, + root: DeclarationReflection, + seen = new Set(), +) { + if (seen.has(root)) return; + seen.add(root); + // Note: We don't use root.anchor for the anchor, because those are built on a per page basis. // And classes/interfaces get their own page, so all the anchors will be empty anyways. // Full name should be safe here, since this list only includes classes/interfaces. @@ -16,10 +23,10 @@ function fullHierarchy(context: DefaultThemeRenderContext, root: DeclarationRefl