@@ -46,6 +46,7 @@ function inferHierarchy(comments) {
46
46
for ( i = 0 ; i < comments . length ; i ++ ) {
47
47
nameIndex [ comments [ i ] . name ] = comments [ i ] ;
48
48
comments [ i ] . members = { instance : [ ] , static : [ ] } ;
49
+ comments [ i ] . events = [ ] ;
49
50
}
50
51
51
52
for ( i = comments . length - 1 ; i >= 0 ; i -- ) {
@@ -62,13 +63,20 @@ function inferHierarchy(comments) {
62
63
continue ;
63
64
}
64
65
65
- if ( ! comment . scope ) {
66
- console . error ( error ( comment , 'found memberof but no @scope, @static, or @instance tag' ) ) ;
67
- continue ;
66
+ switch ( comment . kind ) {
67
+ case 'event' :
68
+ parent . events . push ( comment ) ;
69
+ break ;
70
+
71
+ default :
72
+ if ( ! comment . scope ) {
73
+ console . error ( error ( comment , 'found memberof but no @scope, @static, or @instance tag' ) ) ;
74
+ continue ;
75
+ }
76
+ parent . members [ comment . scope ] . push ( comment ) ;
77
+ break ;
68
78
}
69
79
70
- parent . members [ comment . scope ] . push ( comment ) ;
71
-
72
80
// remove non-root nodes from the lowest level: these are reachable
73
81
// as members of other docs.
74
82
comments . splice ( i , 1 ) ;
@@ -95,6 +103,9 @@ function inferHierarchy(comments) {
95
103
comment . members . static . forEach ( function ( member ) {
96
104
addPath ( member , comment . path ) ;
97
105
} ) ;
106
+ comment . events . forEach ( function ( member ) {
107
+ addPath ( member , comment . path ) ;
108
+ } ) ;
98
109
}
99
110
100
111
for ( i = 0 ; i < comments . length ; i ++ ) addPath ( comments [ i ] , [ ] ) ;
0 commit comments