Reword predicate to be more readable

This commit is contained in:
Nathan Shively-Sanders
2015-11-04 16:44:21 -08:00
parent ec2eac53bf
commit 57f7d7f9df

View File

@@ -130,12 +130,14 @@ namespace ts {
symbol.members = {};
}
if (symbolFlags & SymbolFlags.Value &&
(!symbol.valueDeclaration ||
(symbol.valueDeclaration.kind === SyntaxKind.ModuleDeclaration && node.kind !== SyntaxKind.ModuleDeclaration))) {
// other kinds of value declarations take precedence over modules
symbol.valueDeclaration = node;
}
if (symbolFlags & SymbolFlags.Value) {
const valueDeclaration = symbol.valueDeclaration;
if (!valueDeclaration ||
(valueDeclaration.kind !== node.kind && valueDeclaration.kind === SyntaxKind.ModuleDeclaration)) {
// other kinds of value declarations take precedence over modules
symbol.valueDeclaration = node;
}
}
}
// Should not be called on a declaration with a computed property name,