The JS minification interprets // in regular expressions as beginning a comment and so removes following code.
Example:
if (/\/commons\//.test($this.find('img').attr('src')))
is minified to
if(/\/commons\
Version: 1.17.x
Severity: critical
The JS minification interprets // in regular expressions as beginning a comment and so removes following code.
Example:
if (/\/commons\//.test($this.find('img').attr('src')))
is minified to
if(/\/commons\
Version: 1.17.x
Severity: critical
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T28439 Deploy updated WMF branch to production (February 2011) | |||
Resolved | None | T28676 Milestone: MediaWiki 1.17 release tarball (tracking) | |||
Resolved | None | T28611 Bugs that should be fixed for 1.17 WMF deployment (tracking) | |||
Resolved | • TrevorParscal | T29492 JS minification error with regular expressions |
http://translatewiki.net/w/load.php?debug=false&lang=nl&modules=site&only=scripts&skin=modern
jQuery(document).ready(function($){
var $this=$('#content');
if(/\/commons\
|> SyntaxError: Parse error
});
mediaWiki.loader.state({"site":"ready"});
This only fails for regexes which contain a slash at the end (causing //) AND contain a slash somewhere in the middle (causing the minifier to incorrectly regard it as the end of the regex).
Fixed in r82340