Skip to content

Commit a164e6a

Browse files
committed
respond to code review comments
1 parent 511c076 commit a164e6a

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7145,7 +7145,7 @@ module ts {
71457145
}
71467146

71477147
function getRootSymbol(symbol: Symbol) {
7148-
return (symbol.flags & SymbolFlags.Transient) && getSymbolLinks(symbol).target || symbol;
7148+
return ((symbol.flags & SymbolFlags.Transient) && getSymbolLinks(symbol).target) || symbol;
71497149
}
71507150

71517151
// Emitter support

src/services/services.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,7 @@ module ts {
15761576

15771577
var isValid = isIdentifierStart(displayName.charCodeAt(0), target);
15781578
for (var i = 1, n = displayName.length; isValid && i < n; i++) {
1579-
isValid = isValid && isIdentifierPart(displayName.charCodeAt(i), target);
1579+
isValid = isIdentifierPart(displayName.charCodeAt(i), target);
15801580
}
15811581

15821582
if (isValid) {
@@ -1742,9 +1742,9 @@ module ts {
17421742
return (SyntaxKind.FirstPunctuation <= kind && kind <= SyntaxKind.LastPunctuation);
17431743
}
17441744

1745-
function isVisibleWithinDeclaration(symbol: Symbol, containingClass: Declaration): boolean {
1745+
function isVisibleWithinClassDeclaration(symbol: Symbol, containingClass: Declaration): boolean {
17461746
var declaration = symbol.declarations && symbol.declarations[0];
1747-
return !(declaration && declaration.flags & NodeFlags.Private && containingClass !== declaration.parent);
1747+
return !(declaration && (declaration.flags & NodeFlags.Private) && containingClass !== declaration.parent);
17481748
}
17491749

17501750
function filterContextualMembersList(contextualMemberSymbols: Symbol[], existingMembers: Declaration[]): Symbol[] {
@@ -1755,11 +1755,11 @@ module ts {
17551755
var existingMemberNames: Map<boolean> = {};
17561756
forEach(existingMembers, m => {
17571757
if (m.kind !== SyntaxKind.PropertyAssignment) {
1758-
// Ignore ommited expressions for missing members in the object literal
1758+
// Ignore omitted expressions for missing members in the object literal
17591759
return;
17601760
}
17611761

1762-
if (position <= m.getEnd() && position >= m.getStart()) {
1762+
if (m.getStart() <= position && position <= m.getEnd()) {
17631763
// If this is the current item we are editing right now, do not filter it out
17641764
return;
17651765
}
@@ -1768,7 +1768,7 @@ module ts {
17681768
});
17691769

17701770
var filteredMembers: Symbol[] = [];
1771-
forEach(contextualMemberSymbols, s=> {
1771+
forEach(contextualMemberSymbols, s => {
17721772
if (!existingMemberNames[s.name]) {
17731773
filteredMembers.push(s);
17741774
}
@@ -1859,7 +1859,7 @@ module ts {
18591859
if (symbol && symbol.flags & SymbolFlags.HasExports) {
18601860
// Extract module or enum members
18611861
forEachValue(symbol.exports, symbol => {
1862-
if (isVisibleWithinDeclaration(symbol, containingClass)) {
1862+
if (isVisibleWithinClassDeclaration(symbol, containingClass)) {
18631863
symbols.push(symbol);
18641864
}
18651865
});
@@ -1871,7 +1871,7 @@ module ts {
18711871
if (apparentType) {
18721872
// Filter private properties
18731873
forEach(apparentType.getApparentProperties(), symbol => {
1874-
if (isVisibleWithinDeclaration(symbol, containingClass)) {
1874+
if (isVisibleWithinClassDeclaration(symbol, containingClass)) {
18751875
symbols.push(symbol);
18761876
}
18771877
});
@@ -1884,7 +1884,7 @@ module ts {
18841884

18851885
// Object literal expression, look up possible property names from contextual type
18861886
if (containingObjectLiteral) {
1887-
var objectLiteral = mappedNode.kind === SyntaxKind.ObjectLiteral ? <ObjectLiteral>mappedNode : <ObjectLiteral>getAncestor(mappedNode, SyntaxKind.ObjectLiteral);
1887+
var objectLiteral = <ObjectLiteral>(mappedNode.kind === SyntaxKind.ObjectLiteral ? mappedNode : getAncestor(mappedNode, SyntaxKind.ObjectLiteral));
18881888

18891889
Debug.assert(objectLiteral);
18901890

@@ -1897,7 +1897,7 @@ module ts {
18971897

18981898
var contextualTypeMembers = typeInfoResolver.getPropertiesOfType(contextualType);
18991899
if (contextualTypeMembers && contextualTypeMembers.length > 0) {
1900-
// Add filtterd items to the completion list
1900+
// Add filtered items to the completion list
19011901
var filteredMembers = filterContextualMembersList(contextualTypeMembers, objectLiteral.properties);
19021902
getCompletionEntriesFromSymbols(filteredMembers, activeCompletionSession);
19031903
}

0 commit comments

Comments
 (0)