Closed GoogleCodeExporter closed 9 years ago
JSMin, not being a real parser, has a tough time distinguishing between
division and the beginning of a regexp literal, and after a line break the
original algorithm has always assumed that "/" would start a regexp. Maybe this
assumption needs some testing?
Open
http://code.google.com/p/minify/source/browse/branches/2.1.4/min/lib/JSMin.php
and try changing this:
if (false !== strpos("\n{;(,=:[!&|?", $this->a)) { // we aren't dividing
return true;
}
to:
if ($this->a === "\n") {
return false; /* assume division */
}
if (false !== strpos("{;(,=:[!&|?", $this->a)) { // we aren't dividing
return true;
}
I'd need to see a lot of testing before I'd release such a change though.
Original comment by mrclay....@gmail.com
on 21 Feb 2011 at 3:23
Original issue reported on code.google.com by
urkle0
on 20 Feb 2011 at 8:16Attachments: