Merge branch 'master' into LSAPICleanup

This commit is contained in:
Mohamed Hegazy
2015-02-02 17:14:08 -08:00
6 changed files with 45 additions and 2 deletions
+3
View File
@@ -6553,6 +6553,9 @@ module ts {
function getReturnTypeFromBody(func: FunctionLikeDeclaration, contextualMapper?: TypeMapper): Type {
var contextualSignature = getContextualSignatureForFunctionLikeDeclaration(func);
if (!func.body) {
return unknownType;
}
if (func.body.kind !== SyntaxKind.Block) {
var type = checkExpressionCached(<Expression>func.body, contextualMapper);
}
+5 -2
View File
@@ -2461,8 +2461,11 @@ module ts {
function tryEmitConstantValue(node: PropertyAccessExpression | ElementAccessExpression): boolean {
var constantValue = resolver.getConstantValue(node);
if (constantValue !== undefined) {
var propertyName = node.kind === SyntaxKind.PropertyAccessExpression ? declarationNameToString((<PropertyAccessExpression>node).name) : getTextOfNode((<ElementAccessExpression>node).argumentExpression);
write(constantValue.toString() + " /* " + propertyName + " */");
write(constantValue.toString());
if (!compilerOptions.removeComments) {
var propertyName: string = node.kind === SyntaxKind.PropertyAccessExpression ? declarationNameToString((<PropertyAccessExpression>node).name) : getTextOfNode((<ElementAccessExpression>node).argumentExpression);
write(" /* " + propertyName + " */");
}
return true;
}
return false;