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

           Summary: JavaScript minification breaks production when line
                    starts with slashe in block comments
           Product: MediaWiki
           Version: 1.18-svn
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: critical
          Priority: Normal
         Component: Resource Loader
        AssignedTo: tpars...@wikimedia.org
        ReportedBy: krinklem...@gmail.com
                CC: roan.katt...@gmail.com


The following code
<pre>
/**
 * Foobar:
 * {
 * 'ltr' : {
 * //Multiple rules with configurable operators
 * 'iphone' : false
 * }
 * 
 * @return Boolean true lorem ipsum
 */
</pre>
Is minified as:
<pre>
/**
*Foobar:
*{
*'ltr':{
*//Multiple rules with configurable operators
*'iphone':false
*}
*
*@return Boolean true lorem ipsum
*/
</pre>

The following line specifically is where it all breaks:
<pre>
*//Multiple rules with configurable operators
</pre>

Because it is considered as the closure of the block comment " */ " and the
(unexpected) start of a regex.

"Error: unterminated regular expression literal"
Source File:
http://translatewiki.net/w/load.php?debug=false&lang=fi&modules=ext.liquidThreads%7Cjquery.autoEllipsis%7Cjquery.checkboxShiftClick%7Cjquery.client%7Cjquery.collapsibleTabs%7Cjquery.cookie%7Cjquery.delayedBind%7Cjquery.highlightText%7Cjquery.makeCollapsible%7Cjquery.placeholder%7Cjquery.suggestions%7Cjquery.tabIndex%7Cjquery.ui.button%7Cjquery.ui.core%7Cjquery.ui.dialog%7Cjquery.ui.draggable%7Cjquery.ui.mouse%7Cjquery.ui.position%7C

Thanks to TranslateWiki Nikerabbit for reporting this on IRC.

I'm confused though that this is production output, why are there comments in
production output ?
That empty lines were insterted in place of comments (before the minifier
switch by Trevor[0]) to keep track of the line number (although that only
applies to the first file of all loaded modules) was one, but keeping all
comments ? We might as well disable the minifier then.

--
Krinkle

[0] http://lists.wikimedia.org/pipermail/wikitech-l/2011-January/051308.html

-- 
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