Merge pull request #10760 from Microsoft/fix10731_commentDecoratedClass

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

No files matched your search

+13 -11
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
)
);