diff options
author | micschro <micschro@users.noreply.github.com> | 2014-12-17 16:31:03 +0100 |
---|---|---|
committer | micschro <micschro@users.noreply.github.com> | 2014-12-17 16:31:03 +0100 |
commit | 39d8880f2cd17c9b96bf73a3bcd7c27a89cf919e (patch) | |
tree | a113b4896e8639216d677d2f41d76aff2c171858 /lib/output.js | |
parent | 5538ec7bd8a64c7fcc45895308a8463e4ca4d00a (diff) | |
download | tracifyjs-39d8880f2cd17c9b96bf73a3bcd7c27a89cf919e.tar.gz tracifyjs-39d8880f2cd17c9b96bf73a3bcd7c27a89cf919e.zip |
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.
Diffstat (limited to 'lib/output.js')
-rw-r--r-- | lib/output.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/output.js b/lib/output.js index 7fe61af3..b713be83 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(";"); |