From 60b382d1b33d19a5506d81c13f9b44efae89aa93 Mon Sep 17 00:00:00 2001 From: Yui T Date: Wed, 7 Sep 2016 13:54:52 -0700 Subject: [PATCH] Correct emit comment for decorated class declaration --- src/compiler/transformers/ts.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index efb247ba663..00441c279c7 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -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 ) );