More CR feedback.

This commit is contained in:
Cyrus Najmabadi 2014-12-03 15:36:39 -08:00
parent 22d7aed980
commit 158cf62206
4 changed files with 3 additions and 8 deletions

View File

@ -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);
}

View File

@ -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 {

View File

@ -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;
}

View File

@ -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;
}