respond to code review comments

This commit is contained in:
Mohamed Hegazy
2014-09-17 17:28:03 -07:00
parent deaa58b1a0
commit 9e00693163
2 changed files with 23 additions and 2 deletions
+6 -2
View File
@@ -1844,7 +1844,11 @@ module ts {
function isVisibleWithinClassDeclaration(symbol: Symbol, containingClass: Declaration): boolean {
var declaration = symbol.declarations && symbol.declarations[0];
return !(declaration && (declaration.flags & NodeFlags.Private) && containingClass !== declaration.parent);
if (declaration && (declaration.flags & NodeFlags.Private)) {
var declarationClass = getAncestor(declaration, SyntaxKind.ClassDeclaration);
return containingClass === declarationClass;
}
return true;
}
function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] {
@@ -1966,7 +1970,7 @@ module ts {
}
var type = typeInfoResolver.getTypeOfNode(mappedNode);
var apparentType: ApparentType = type && typeInfoResolver.getApparentType(type);
var apparentType = type && typeInfoResolver.getApparentType(type);
if (apparentType) {
// Filter private properties
forEach(apparentType.getApparentProperties(), symbol => {
@@ -0,0 +1,17 @@
/// <reference path="fourslash.ts"/>
////class Foo {
//// private y;
//// constructor(private x) {}
//// method() { this./*1*/; }
////}
////var f:Foo;
////f./*2*/
goTo.marker("1");
verify.memberListContains("y");
verify.memberListContains("x");
goTo.marker("2");
verify.not.memberListContains("x");
verify.not.memberListContains("y");