Test cases for class property display parts

This commit is contained in:
Sheetal Nandi
2014-10-13 15:01:31 -07:00
parent 307e28a8a1
commit 2b2ebf5960
2 changed files with 99 additions and 21 deletions

View File

@@ -2428,32 +2428,25 @@ module ts {
}
function emitDeclarationFlags(node: Declaration) {
if (node.flags & NodeFlags.Private) {
write("private ");
}
else if (node.flags & NodeFlags.Protected) {
write("protected ");
}
if (node.flags & NodeFlags.Static) {
if (node.flags & NodeFlags.Private) {
write("private ");
}
else if (node.flags & NodeFlags.Protected) {
write("protected ");
}
write("static ");
}
else {
if (node.flags & NodeFlags.Private) {
write("private ");
// If the node is parented in the current source file we need to emit export declare or just export
else if (node.parent === currentSourceFile) {
// If the node is exported
if (node.flags & NodeFlags.Export) {
write("export ");
}
else if (node.flags & NodeFlags.Protected) {
write("protected ");
}
// If the node is parented in the current source file we need to emit export declare or just export
else if (node.parent === currentSourceFile) {
// If the node is exported
if (node.flags & NodeFlags.Export) {
write("export ");
}
if (node.kind !== SyntaxKind.InterfaceDeclaration) {
write("declare ");
}
if (node.kind !== SyntaxKind.InterfaceDeclaration) {
write("declare ");
}
}
}