mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-12 04:17:34 -06:00
More CR feedback.
This commit is contained in:
parent
22d7aed980
commit
158cf62206
@ -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);
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user