[Pkg-javascript-commits] [uglifyjs] 44/77: Keep single line comments after nlb, after nlb

Jonas Smedegaard dr at jones.dk
Tue May 19 00:02:31 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag v2.4.18
in repository uglifyjs.

commit 099992ecae5ed51332f3928b9e1c06e7ad8147b8
Author: Anthony Van de Gejuchte <anthonyvdgent at yahoo.com>
Date:   Fri Jan 9 16:46:40 2015 +0100

    Keep single line comments after nlb, after nlb
    
    Fixes #583
---
 lib/output.js | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lib/output.js b/lib/output.js
index 72bcdd5..bfe6242 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");

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/uglifyjs.git



More information about the Pkg-javascript-commits mailing list