Collapse multiple semicolons

This commit is contained in:
Matthias Mullie 2015-02-03 17:45:50 +01:00
parent f54f58d8b1
commit e58caad5b7

View File

@ -265,6 +265,9 @@ class JS extends Minify
*/
$content = preg_replace('/;\}/s', '}', $content);
// get rid of double semicolons
$content = preg_replace('/;+/', ';', $content);
// get rid of remaining whitespace af beginning/end, as well as
// semicolon, which doesn't make sense there: ASI will kick in here too
return trim($content, "\n ;");