File tree Expand file tree Collapse file tree 2 files changed +20
-16
lines changed
test/renderer/specs/classes Expand file tree Collapse file tree 2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change @@ -25,21 +25,25 @@ export class ExportConverter extends ConverterNodeComponent<ts.ExportAssignment>
2525 }
2626 if ( symbol ) {
2727 const project = context . project ;
28- symbol . declarations . forEach ( ( declaration ) => {
29- if ( ! declaration . symbol ) {
30- return ;
31- }
32- const id = project . symbolMapping [ context . getSymbolID ( declaration . symbol ) ] ;
33- if ( ! id ) {
34- return ;
35- }
36-
37- const reflection = project . reflections [ id ] ;
38- if ( node . isExportEquals && reflection instanceof DeclarationReflection ) {
39- ( < DeclarationReflection > reflection ) . setFlag ( ReflectionFlag . ExportAssignment , true ) ;
40- }
41- markAsExported ( reflection ) ;
42- } ) ;
28+ // if the symbol declarations are undefined due to an export, we skip it
29+ // fixes https://github.com/TypeStrong/typedoc/issues/513
30+ if ( symbol . declarations ) {
31+ symbol . declarations . forEach ( ( declaration ) => {
32+ if ( ! declaration . symbol ) {
33+ return ;
34+ }
35+ const id = project . symbolMapping [ context . getSymbolID ( declaration . symbol ) ] ;
36+ if ( ! id ) {
37+ return ;
38+ }
39+
40+ const reflection = project . reflections [ id ] ;
41+ if ( node . isExportEquals && reflection instanceof DeclarationReflection ) {
42+ ( < DeclarationReflection > reflection ) . setFlag ( ReflectionFlag . ExportAssignment , true ) ;
43+ }
44+ markAsExported ( reflection ) ;
45+ } ) ;
46+ }
4347 }
4448
4549 function markAsExported ( reflection : Reflection ) {
Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ <h1>Class DefaultExportedClass</h1>
7474 < div class ="lead ">
7575 < p > This class is exported via es6 export syntax.</ p >
7676 </ div >
77- < pre > < code > < span class ="hljs-keyword "> export</ span > < span class ="hljs-keyword " > default</ span > < span class =" hljs-class " > < span class =" hljs-keyword " > class < /span > < span class =" hljs-title " > DefaultExportedClass</ span > </ span >
77+ < pre > < code > < span class ="hljs-builtin-name "> export</ span > < span class ="hljs-built_in " > default < /span > class DefaultExportedClass
7878</ code > </ pre >
7979 </ div >
8080 </ section >
You can’t perform that action at this time.
0 commit comments