[Pkg-javascript-commits] [uglifyjs] 04/77: Fix max_line_len not working for JSON files

Jonas Smedegaard dr at jones.dk
Tue May 19 00:02:26 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 39d8880f2cd17c9b96bf73a3bcd7c27a89cf919e
Author: micschro <micschro at users.noreply.github.com>
Date:   Wed Dec 17 16:31:03 2014 +0100

    Fix max_line_len not working for JSON files
    
    As `maybe_newline()` is only called when `might_need_semicolon` is `true`, the `max_line_len` option has no effect for files without (or with very few) semicolons (like JSON files). A simple for this problem is to use `maybe_newline()` instead of `noop` as the `newline()` function in non-beautify mode.
---
 lib/output.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/output.js b/lib/output.js
index 7fe61af..b713be8 100644
--- a/lib/output.js
+++ b/lib/output.js
@@ -221,7 +221,7 @@ function OutputStream(options) {
 
     var newline = options.beautify ? function() {
         print("\n");
-    } : noop;
+    } : maybe_newline;
 
     var semicolon = options.beautify ? function() {
         print(";");

-- 
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