diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index d666da91fe..19a2dae242 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10190,7 +10190,7 @@ module ts { } function getSymbolOfEntityNameOrPropertyAccessExpression(entityName: EntityName | PropertyAccessExpression): Symbol { - if (isDeclarationOrFunctionExpressionOrCatchVariableName(entityName)) { + if (isDeclarationOrCatchVariableName(entityName)) { return getSymbolOfNode(entityName.parent); } @@ -10255,7 +10255,7 @@ module ts { return undefined; } - if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + if (isDeclarationOrCatchVariableName(node)) { // This is a declaration, call getSymbolOfNode return getSymbolOfNode(node.parent); } @@ -10351,7 +10351,7 @@ module ts { return getTypeOfSymbol(symbol); } - if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + if (isDeclarationOrCatchVariableName(node)) { var symbol = getSymbolInfo(node); return symbol && getTypeOfSymbol(symbol); } diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index b53c000724..489e985fb4 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -706,6 +706,7 @@ module ts { case SyntaxKind.ImportSpecifier: case SyntaxKind.NamespaceImport: case SyntaxKind.ExportSpecifier: + case SyntaxKind.FunctionExpression: return true; } return false; @@ -739,7 +740,7 @@ module ts { } // True if the given identifier, string literal, or number literal is the name of a declaration node - export function isDeclarationOrFunctionExpressionOrCatchVariableName(name: Node): boolean { + export function isDeclarationOrCatchVariableName(name: Node): boolean { if (name.kind !== SyntaxKind.Identifier && name.kind !== SyntaxKind.StringLiteral && name.kind !== SyntaxKind.NumericLiteral) { return false; } @@ -751,7 +752,7 @@ module ts { } } - if (isDeclaration(parent) || parent.kind === SyntaxKind.FunctionExpression) { + if (isDeclaration(parent)) { return (parent).name === name; } diff --git a/src/services/services.ts b/src/services/services.ts index 58c1d08110..5ee623fd3f 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -4756,7 +4756,7 @@ module ts { /** A node is considered a writeAccess iff it is a name of a declaration or a target of an assignment */ function isWriteAccess(node: Node): boolean { - if (node.kind === SyntaxKind.Identifier && isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + if (node.kind === SyntaxKind.Identifier && isDeclarationOrCatchVariableName(node)) { return true; } @@ -4918,7 +4918,7 @@ module ts { else if (isInRightSideOfImport(node)) { return getMeaningFromRightHandSideOfImportEquals(node); } - else if (isDeclarationOrFunctionExpressionOrCatchVariableName(node)) { + else if (isDeclarationOrCatchVariableName(node)) { return getMeaningFromDeclaration(node.parent); } else if (isTypeReference(node)) {