Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the JavaScript-Minifier CPAN distribution.

Report information
The Basics
Id: 76800
Status: resolved
Priority: 0/
Queue: JavaScript-Minifier

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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
Fixed in 1.08 that just got shipped to CPAN. The last newline at the end of original file will be preserved, if exists. -- Cheers, ZZ [ https://metacpan.org/author/ZOFFIX ]