I tried JSMin+ and Advagg and it broke my javascript. As noted by a comment on the JSMin+ 1.4 release page, its compressed scripts can break when they are aggregated.
http://crisp.tweakblogs.net/blog/6861/jsmin%2B-version-14.html#r_120294
The problem is that JSMin+ does not append a closing semi-colon to the end of a file when it should. So if the 1st script ends with a function call (last character a closing bracket) and the 2nd script begins with a closure (first character an opening bracket), the two are appended together as if it is one big function call and things go haywire.
Seeing as the above comment is almost a year old and there are no signs that it will ever be fixed in JSMin+ I patched Advagg to work around it and append a closing semi-colon to the end of a compressed file whenever it is needed.
Comment | File | Size | Author |
---|---|---|---|
#2 | advagg-2161505-2-fix-jsmin.patch | 1.13 KB | mikeytown2 |
#1 | advagg-2161505-1-D7.patch | 759 bytes | mikeytown2 |
#1 | advagg-2161505-1-D6.patch | 712 bytes | mikeytown2 |
advagg_js_compress.module.patch | 741 bytes | mr.j | |
Comments
Comment #1
mikeytown2 CreditAttribution: mikeytown2 commentedFollowing patches have been applied to 6.x & 7.x. I decided to use strpbrk as accessing the string as an array always seems a little hacky.
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedFix for jsmin as well. Applied to D6. Patch for D7 in #1 works for all 3 compressors.
Comment #4
RaulMuroc CreditAttribution: RaulMuroc commentedTo me for D7 doesn't apply neither stable version nor dev version. :S This is reviewed & tested by community?
Following error is shown:
Comment #5
mikeytown2 CreditAttribution: mikeytown2 commented@RaulMuroc
Latest release came out on 2013-Dec-30; this was applied on 2013-Dec-24. Patch is failing because it is not needed; code changes from this issue were included in the main release as it was committed as stated in #1 :)
You can also verify that the code is in by looking at the git shortlog and finding the commit message