Merge pull request #10760 from Microsoft/fix10731_commentDecoratedClass

Fix10731: Correctly emit comment for decorated class declaration
This commit is contained in:
Yui
2016-09-16 09:28:48 -07:00
committed by GitHub
5 changed files with 133 additions and 11 deletions

View File

@@ -694,19 +694,21 @@ namespace ts {
// let ${name} = ${classExpression} where name is either declaredName if the class doesn't contain self-reference
// or decoratedClassAlias if the class contain self-reference.
const transformedClassExpression = createVariableStatement(
/*modifiers*/ undefined,
createLetDeclarationList([
createVariableDeclaration(
classAlias || declaredName,
/*type*/ undefined,
classExpression
)
]),
/*location*/ location
);
setCommentRange(transformedClassExpression, node);
statements.push(
setOriginalNode(
createVariableStatement(
/*modifiers*/ undefined,
createLetDeclarationList([
createVariableDeclaration(
classAlias || declaredName,
/*type*/ undefined,
classExpression
)
]),
/*location*/ location
),
/*node*/ transformedClassExpression,
/*original*/ node
)
);