Skip to content

Commit 60b382d

Browse files
author
Yui T
committed
Correct emit comment for decorated class declaration
1 parent 5c72a32 commit 60b382d

File tree

1 file changed

+13
-11
lines changed
  • src/compiler/transformers

1 file changed

+13
-11
lines changed

src/compiler/transformers/ts.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -694,19 +694,21 @@ namespace ts {
694694

695695
// let ${name} = ${classExpression} where name is either declaredName if the class doesn't contain self-reference
696696
// or decoratedClassAlias if the class contain self-reference.
697+
const transformedClassExpression = createVariableStatement(
698+
/*modifiers*/ undefined,
699+
createLetDeclarationList([
700+
createVariableDeclaration(
701+
classAlias || declaredName,
702+
/*type*/ undefined,
703+
classExpression
704+
)
705+
]),
706+
/*location*/ location
707+
);
708+
setCommentRange(transformedClassExpression, node);
697709
statements.push(
698710
setOriginalNode(
699-
createVariableStatement(
700-
/*modifiers*/ undefined,
701-
createLetDeclarationList([
702-
createVariableDeclaration(
703-
classAlias || declaredName,
704-
/*type*/ undefined,
705-
classExpression
706-
)
707-
]),
708-
/*location*/ location
709-
),
711+
/*node*/ transformedClassExpression,
710712
/*original*/ node
711713
)
712714
);

0 commit comments

Comments
 (0)