简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM