Supress const enum member value comment from emitted javascript in presence of --removeComments (revised)

This commit is contained in:
Stan Thomas
2015-01-30 06:09:31 -05:00
parent 0b435f56ee
commit 95e7015fa0

View File

@@ -2462,8 +2462,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() + (!compilerOptions.removeComments ? " /* " + 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;