File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -1844,7 +1844,11 @@ module ts {
1844
1844
1845
1845
function isVisibleWithinClassDeclaration ( symbol : Symbol , containingClass : Declaration ) : boolean {
1846
1846
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 ;
1848
1852
}
1849
1853
1850
1854
function filterContextualMembersList ( contextualMemberSymbols : Symbol [ ] , existingMembers : Declaration [ ] ) : Symbol [ ] {
@@ -1966,7 +1970,7 @@ module ts {
1966
1970
}
1967
1971
1968
1972
var type = typeInfoResolver . getTypeOfNode ( mappedNode ) ;
1969
- var apparentType : ApparentType = type && typeInfoResolver . getApparentType ( type ) ;
1973
+ var apparentType = type && typeInfoResolver . getApparentType ( type ) ;
1970
1974
if ( apparentType ) {
1971
1975
// Filter private properties
1972
1976
forEach ( apparentType . getApparentProperties ( ) , symbol => {
Original file line number Diff line number Diff line change
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" ) ;
You can’t perform that action at this time.
0 commit comments