fix(59825): getNavigationTree crash on invalid class merge and function merge with expando members (#60152)

This commit is contained in:
Oleksandr T.
2024-10-07 22:58:15 +03:00
committed by GitHub
parent 20f67d791c
commit 009b3ffdda
2 changed files with 32 additions and 0 deletions

View File

@@ -760,6 +760,7 @@ function isSynthesized(node: Node) {
// We want to merge own children like `I` in in `module A { interface I {} } module A { interface I {} }`
// We don't want to merge unrelated children like `m` in `const o = { a: { m() {} }, b: { m() {} } };`
function isOwnChild(n: Node, parent: NavigationBarNode): boolean {
if (n.parent === undefined) return false;
const par = isModuleBlock(n.parent) ? n.parent.parent : n.parent;
return par === parent.node || contains(parent.additionalNodes, par);
}