Fix max_line_len not working for JSON files
authormicschro <micschro@users.noreply.github.com>
Wed, 17 Dec 2014 15:31:03 +0000 (16:31 +0100)
committermicschro <micschro@users.noreply.github.com>
Wed, 17 Dec 2014 15:31:03 +0000 (16:31 +0100)
commit39d8880f2cd17c9b96bf73a3bcd7c27a89cf919e
treea113b4896e8639216d677d2f41d76aff2c171858
parent5538ec7bd8a64c7fcc45895308a8463e4ca4d00a
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