javierfernandezbaz / minify

Automatically exported from code.google.com/p/minify
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Incorrect minification of js code without semicolons #256

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Get https://github.com/twitter/bootstrap/blob/master/js/bootstrap-dropdown.js
2. Try to minify

There are two lines listed below that have broked by minifier.
<code>
clearMenus()
!isActive && $parent.toggleClass('open')
</code>

Expected:
clearMenus()
!isActive&&$parent.toggleClass('open')

Currently:
clearMenus()!isActive&&$parent.toggleClass('open')

Original issue reported on code.google.com by d.menshi...@gmail.com on 28 Mar 2012 at 1:06

GoogleCodeExporter commented 8 years ago
Jsmin is never going to support the full ECMA spec w/r/t automatic semicolon 
insertion, but there may be a fix for this case. In the meantime use a 
pre-minified version, or insert the semi-colon manually. Leaving out semicolons 
is poor form.

Original comment by mrclay....@gmail.com on 28 Mar 2012 at 6:03