File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -760,6 +760,7 @@ function isSynthesized(node: Node) {
760760// We want to merge own children like `I` in in `module A { interface I {} } module A { interface I {} }`
761761// We don't want to merge unrelated children like `m` in `const o = { a: { m() {} }, b: { m() {} } };`
762762function isOwnChild ( n : Node , parent : NavigationBarNode ) : boolean {
763+ if ( n . parent === undefined ) return false ;
763764 const par = isModuleBlock ( n . parent ) ? n . parent . parent : n . parent ;
764765 return par === parent . node || contains ( parent . additionalNodes , par ) ;
765766}
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts"/>
2+
3+ ////function Z() { }
4+ ////
5+ ////Z.foo = 42
6+ ////
7+ ////class Z { }
8+
9+ verify . navigationTree ( {
10+ text : "<global>" ,
11+ kind : "script" ,
12+ childItems : [
13+ {
14+ text : "Z" ,
15+ kind : "class" ,
16+ childItems : [
17+ {
18+ text : "constructor" ,
19+ kind : "constructor"
20+ } ,
21+ {
22+ text : "foo"
23+ }
24+ ]
25+ } ,
26+ {
27+ text : "Z" ,
28+ kind : "class"
29+ }
30+ ]
31+ } ) ;
You can’t perform that action at this time.
0 commit comments