mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Supress const enum member value comment from emitted javascript in presence of --removeComments (revised)
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user