Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to reverse the effects Closure Compiler (or the like) on code?

I just recently took over a project because my clients previous web dev disappeared. The only files I have to work with are what is stored on the local server. The only problem I've encountered is all of the JS has been run through Closure Compiler (or something of the like) which makes the javascript really annoying to read (at least for the bigger functions). Is there anything out there that would help me replug vars in JS so I have something cleaner to look at? I've been doing it by hand and it's getting quite tedious.

Here's an example of what I'm dealing with:

    var n = {},
        e = a.extend(n, x),
        y = "pageLoaded",
        u = "pageLoading",
        c = "modLoaded",
        w = "xhrComplete",
        l = true,
        v = false,
        s = a("body"),
        g = Modernizr.historymanagement,
        f = "",
        t = "",
        r = "",
        k = null,
        b = window.History;

Thanks ahead of time!

Tre

like image 267
tr3online Avatar asked Oct 18 '11 23:10

tr3online


1 Answers

No. It's munged. To a certain degree you can replace tokens when literals are assigned - you could, for example, replace all instances of l with true and v with false in the code. But there are other things which it does that would be a lot more complex to reverse and I don't believe anyone's put much effort into it.

like image 96
Chris Morgan Avatar answered Nov 14 '22 22:11

Chris Morgan