mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-06 02:33:53 -06:00
Merge branch 'master' into LSAPICleanup
This commit is contained in:
commit
277235539a
@ -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);
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -86,6 +86,11 @@ module m1 {
|
||||
|
||||
/// this is x
|
||||
declare var x;
|
||||
|
||||
|
||||
/** const enum member value comment (generated by TS) */
|
||||
const enum color { red, green, blue }
|
||||
var shade: color = color.green;
|
||||
|
||||
|
||||
//// [commentsdoNotEmitComments.js]
|
||||
@ -129,6 +134,7 @@ var m1;
|
||||
})();
|
||||
m1.b = b;
|
||||
})(m1 || (m1 = {}));
|
||||
var shade = 1;
|
||||
|
||||
|
||||
//// [commentsdoNotEmitComments.d.ts]
|
||||
@ -161,3 +167,9 @@ declare module m1 {
|
||||
}
|
||||
}
|
||||
declare var x: any;
|
||||
declare const enum color {
|
||||
red = 0,
|
||||
green = 1,
|
||||
blue = 2,
|
||||
}
|
||||
declare var shade: color;
|
||||
|
||||
@ -151,3 +151,18 @@ module m1 {
|
||||
declare var x;
|
||||
>x : any
|
||||
|
||||
|
||||
/** const enum member value comment (generated by TS) */
|
||||
const enum color { red, green, blue }
|
||||
>color : color
|
||||
>red : color
|
||||
>green : color
|
||||
>blue : color
|
||||
|
||||
var shade: color = color.green;
|
||||
>shade : color
|
||||
>color : color
|
||||
>color.green : color
|
||||
>color : typeof color
|
||||
>green : color
|
||||
|
||||
|
||||
@ -88,3 +88,8 @@ module m1 {
|
||||
|
||||
/// this is x
|
||||
declare var x;
|
||||
|
||||
|
||||
/** const enum member value comment (generated by TS) */
|
||||
const enum color { red, green, blue }
|
||||
var shade: color = color.green;
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
/// <reference path='fourslash.ts'/>
|
||||
|
||||
//// var x: { f(): string } = { f( }
|
||||
|
||||
verify.numberOfErrorsInCurrentFile(1);
|
||||
Loading…
x
Reference in New Issue
Block a user