From: Anthony Van de Gejuchte Date: Fri, 9 Jan 2015 15:46:40 +0000 (+0100) Subject: Keep single line comments after nlb, after nlb X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=099992ecae5ed51332f3928b9e1c06e7ad8147b8;p=UglifyJS.git Keep single line comments after nlb, after nlb Fixes #583 --- diff --git a/lib/output.js b/lib/output.js index 72bcdd5e..bfe6242a 100644 --- a/lib/output.js +++ b/lib/output.js @@ -413,6 +413,15 @@ function OutputStream(options) { return c(self, comment); }); } + + // Keep single line comments after nlb, after nlb + if (!output.option("beautify") && comments.length > 0 && + /comment[134]/.test(comments[0].type) && + output.col() !== 0 && comments[0].nlb) + { + output.print("\n"); + } + comments.forEach(function(c){ if (/comment[134]/.test(c.type)) { output.print("//" + c.value + "\n");