https://bugzilla.wikimedia.org/show_bug.cgi?id=27528

--- Comment #7 from P.Copp <paul.copper...@gmail.com> 2011-02-21 18:15:02 UTC 
---
Created attachment 8185
  --> https://bugzilla.wikimedia.org/attachment.cgi?id=8185
New minifier which takes the division/regexp conflict into account

(In reply to comment #6)
> This has unbalanced parentheses, but the issue you point our (division
Copy'n'Paste fail. Sorry for that :)

> This one is so devious that even Douglas Crockford's JSMin falls for it :O
> 
Right, JSMin makes a fair amount of assumptions about the code that it will
minify.

> I'm interested. I'm also willing to port it to PHP myself if you give me the C
> code and release it under a free license.
Well, usually it's easier to port code that you wrote yourself, so I went ahead
and made the attached patch. It seems, that even in php, its performance is
quite good, in most tested cases it was about the same speed or slightly faster
than JavascriptDistiller.

For now I removed $wgResourceLoaderMinifyJSVerticalSpace. As the new minifier
knows when semicolon insertion will be triggered, it can safely put everything
on a single line. For readability it may be considered to add a few newlines,
though, maybe before each "function"?

I left JavaScriptDistiller.php in place to ease comparing and testing. I also
added a few test cases in
tests/phpunit/includes/libs/JavaScriptMinifierTest.php, probably need a few
more, though.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to