@@ -43,6 +43,8 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
4343 }
4444 }
4545
46+ var modifiers = ts . getCombinedModifierFlags ( node ) ;
47+
4648 // Test whether the node is exported
4749 var isExported :boolean ;
4850 if ( container . kindOf ( [ ReflectionKind . Module , ReflectionKind . ExternalModule ] ) ) {
@@ -54,17 +56,18 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
5456 if ( kind == ReflectionKind . ExternalModule ) {
5557 isExported = true ; // Always mark external modules as exported
5658 } else if ( node . parent && node . parent . kind == ts . SyntaxKind . VariableDeclarationList ) {
57- isExported = isExported || ! ! ( node . parent . parent . flags & ts . NodeFlags . Export )
59+ var parentModifiers = ts . getCombinedModifierFlags ( node . parent . parent ) ;
60+ isExported = isExported || ! ! ( parentModifiers & ts . ModifierFlags . Export )
5861 } else {
59- isExported = isExported || ! ! ( node . flags & ts . NodeFlags . Export ) ;
62+ isExported = isExported || ! ! ( modifiers & ts . ModifierFlags . Export ) ;
6063 }
6164
6265 if ( ! isExported && context . converter . excludeNotExported ) {
6366 return null ;
6467 }
6568
6669 // Test whether the node is private, when inheriting ignore private members
67- var isPrivate = ! ! ( node . flags & ts . NodeFlags . Private ) ;
70+ var isPrivate = ! ! ( modifiers & ts . ModifierFlags . Private ) ;
6871 if ( context . isInherit && isPrivate ) {
6972 return null ;
7073 }
@@ -73,7 +76,7 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
7376 var isConstructorProperty :boolean = false ;
7477 var isStatic = false ;
7578 if ( nonStaticKinds . indexOf ( kind ) == - 1 ) {
76- isStatic = ! ! ( node . flags & ts . NodeFlags . Static ) ;
79+ isStatic = ! ! ( modifiers & ts . ModifierFlags . Static ) ;
7780 if ( container . kind == ReflectionKind . Class ) {
7881 if ( node . parent && node . parent . kind == ts . SyntaxKind . Constructor ) {
7982 isConstructorProperty = true ;
@@ -126,9 +129,11 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
126129 * @returns The reflection populated with the values of the given node.
127130 */
128131function setupDeclaration ( context :Context , reflection :DeclarationReflection , node :ts . Node ) {
132+ var modifiers = ts . getCombinedModifierFlags ( node ) ;
133+
129134 reflection . setFlag ( ReflectionFlag . External , context . isExternal ) ;
130- reflection . setFlag ( ReflectionFlag . Protected , ! ! ( node . flags & ts . NodeFlags . Protected ) ) ;
131- reflection . setFlag ( ReflectionFlag . Public , ! ! ( node . flags & ts . NodeFlags . Public ) ) ;
135+ reflection . setFlag ( ReflectionFlag . Protected , ! ! ( modifiers & ts . ModifierFlags . Protected ) ) ;
136+ reflection . setFlag ( ReflectionFlag . Public , ! ! ( modifiers & ts . ModifierFlags . Public ) ) ;
132137 reflection . setFlag ( ReflectionFlag . Optional , ! ! ( node [ 'questionToken' ] ) ) ;
133138
134139 if (
0 commit comments