Skip to content

Commit 6598ae2

Browse files
fix(javascript): keep the comments of an empty statement the SyntaxTree printer drops
Claude-Session: https://claude.ai/code/session_01Tgxgyb4N35ndP6cC4KcrXC
1 parent cf97e07 commit 6598ae2

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎lib/javascript/syntax-printer.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41689,6 +41689,8 @@ const installTreePrint = (modules) => {
4168941689
output.in_directive = false;
4169041690
}
4169141691
if (!isEmpty) printNode(statement);
41692+
// terser drops an empty statement's comments with it.
41693+
else output.prepend_comments(statement);
4169241694
if (output.in_directive === true && isStringStatement(statement)) {
4169341695
output.in_directive = false;
4169441696
}

0 commit comments

Comments
 (0)