Some refactoring as per PR feedback

This commit is contained in:
Sheetal Nandi
2015-10-30 12:03:59 -07:00
parent 67bed265b7
commit 4d3457ca4d

View File

@@ -11854,12 +11854,10 @@ namespace ts {
let symbol = getSymbolOfNode(node);
let localSymbol = node.localSymbol || symbol;
let firstDeclaration = forEach(symbol.declarations, declaration => {
let firstDeclaration = forEach(symbol.declarations,
// Get first non javascript function declaration
if (declaration.kind === node.kind && !isJavaScript(getSourceFile(declaration).fileName)) {
return declaration;
}
});
declaration => declaration.kind === node.kind && !isJavaScript(getSourceFile(declaration).fileName) ?
declaration : undefined);
// Only type check the symbol once
if (node === firstDeclaration) {