Summary: JS minification regression in ResourceLoader:
                    comment+linebreak as implied semicolon lost
           Product: MediaWiki
           Version: wikimedia-deployment
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: blocker
          Priority: Normal
         Component: Resource Loader
            Blocks: 26611

Found this while tidying up work on SVGEdit; ext.svgedit.embedapi.js get
incorrectly minified by the new JSDistiller stuff.

This file is a short bit of (rather messy and comment-filled ;) third-party JS
which defines functions for communicated with an embedded iframe. I found I got
a syntax error at this point in the original file:

        var t = this //new callback
        for(var g = 0, args = []; g < arguments.length; g++){

which gets minified to:

        var t=thisfor(var g=0,args=[];g<arguments.length;g++){

The first line ('var t = this') allows the statement terminator to be implied
rather than using an explicit semicolon -- a poor practice, but legitimate in
JS. It also uses a double-slash single-line comment on the end.

The combination of these two seems to confuse the new minifier, and it ends up
slapping them together with neither a semicolon nor any whitespace at all!

It needs to either keep the line feed intact as a statement terminator, or add
a semicolon.

I'll work around it for now by adjusting the formatting in this particular

Adding to MW 1.17 blockers (unless we won't be shipping this version of the
minifier -- the old code did fine)

Configure bugmail:
------- You are receiving this mail because: -------
You are on the CC list for the bug.

Wikibugs-l mailing list

Reply via email to