Skip to content

Commit 9e00693

Browse files
committed
respond to code review comments
1 parent deaa58b commit 9e00693

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/services/services.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1844,7 +1844,11 @@ module ts {
18441844

18451845
function isVisibleWithinClassDeclaration(symbol: Symbol, containingClass: Declaration): boolean {
18461846
var declaration = symbol.declarations && symbol.declarations[0];
1847-
return !(declaration && (declaration.flags & NodeFlags.Private) && containingClass !== declaration.parent);
1847+
if (declaration && (declaration.flags & NodeFlags.Private)) {
1848+
var declarationClass = getAncestor(declaration, SyntaxKind.ClassDeclaration);
1849+
return containingClass === declarationClass;
1850+
}
1851+
return true;
18481852
}
18491853

18501854
function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] {
@@ -1966,7 +1970,7 @@ module ts {
19661970
}
19671971

19681972
var type = typeInfoResolver.getTypeOfNode(mappedNode);
1969-
var apparentType: ApparentType = type && typeInfoResolver.getApparentType(type);
1973+
var apparentType = type && typeInfoResolver.getApparentType(type);
19701974
if (apparentType) {
19711975
// Filter private properties
19721976
forEach(apparentType.getApparentProperties(), symbol => {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/// <reference path="fourslash.ts"/>
2+
3+
////class Foo {
4+
//// private y;
5+
//// constructor(private x) {}
6+
//// method() { this./*1*/; }
7+
////}
8+
////var f:Foo;
9+
////f./*2*/
10+
11+
goTo.marker("1");
12+
verify.memberListContains("y");
13+
verify.memberListContains("x");
14+
15+
goTo.marker("2");
16+
verify.not.memberListContains("x");
17+
verify.not.memberListContains("y");

0 commit comments

Comments
 (0)