diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3aefe76746d..50eb3669655 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4909,9 +4909,6 @@ module ts { // We cannot answer semantic questions within a with block, do not proceed any further return undefined; } - if (node.contextualType) { - return node.contextualType; - } return getContextualTypeForObjectLiteralElement(node); } diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index bc2bb211959..58c715d721f 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -471,11 +471,11 @@ module ts { } export function isFunctionBlock(node: Node) { - return node && node.kind === SyntaxKind.Block && isAnyFunction(node.parent); + return node !== undefined && node.kind === SyntaxKind.Block && isAnyFunction(node.parent); } export function isObjectLiteralMethod(node: Node) { - return node && node.kind === SyntaxKind.Method && node.parent.kind === SyntaxKind.ObjectLiteralExpression; + return node !== undefined && node.kind === SyntaxKind.Method && node.parent.kind === SyntaxKind.ObjectLiteralExpression; } export function getContainingFunction(node: Node): FunctionLikeDeclaration { diff --git a/src/compiler/types.ts b/src/compiler/types.ts index 4fa7d9421c4..ab396d13a85 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -430,8 +430,6 @@ module ts { // at later stages of the compiler pipeline. In that case, you can either check the parent kind // of the method, or use helpers like isObjectLiteralMethodDeclaration export interface MethodDeclaration extends FunctionLikeDeclaration, ClassElement, ObjectLiteralElement { - contextualType?: Type; // Used to temporarily assign a contextual type during overload resolution - body?: Block; } diff --git a/src/services/syntax/parser.ts b/src/services/syntax/parser.ts index be71c720de2..8aeafd29720 100644 --- a/src/services/syntax/parser.ts +++ b/src/services/syntax/parser.ts @@ -3444,7 +3444,7 @@ module TypeScript.Parser { parseArrowFunctionBody(/*asyncContext:*/ !!asyncKeyword)); } - function isFunctionBlock(): boolean { + function isStartOfFunctionBlock(): boolean { var currentTokenKind = currentToken().kind; return currentTokenKind === SyntaxKind.OpenBraceToken || currentTokenKind === SyntaxKind.EqualsGreaterThanToken; }