Subject: | missing final newline |
Date: | Wed, 25 Apr 2012 16:30:57 +0100 |
To: | bug-JavaScript-Minifier [...] rt.cpan.org |
From: | Zefram <zefram [...] fysh.org> |
If a JS source file ends with a newline, JavaScript::Minifier will omit
the final newline from the minified version. This turns out to be a
problem if there's an implicit semicolon at the end of the file. If any
code is appended to the minified version of the code, the lack of newline
means that the implicit semicolon is lost, leading to a syntax error
or worse. I think a final newline should be preserved in minification,
so that minified JS concatenates properly with other JS code.
-zefram