Chris Chilvers
Chris Chilvers

Reputation: 6479

JavaScript debugging symbols

When using minified or generated javascript I would like to be able to see the original source an step through the original rather than the generated output.

This would be in much the same way debugging symbols for compiled binary files let you see the original source.

The original source might not even be javascript but some equivalent such as Script# or the output from jwacs.

Ideally this would work with existing debuggers, perhaps as a FireBug plugin.

Upvotes: 2

Views: 538

Answers (2)

lincolnk
lincolnk

Reputation: 11238

When you see minified javascript, that's all there is. javascript is not passed around in "compiled" form the way executables are; there are no symbols or original code available. The best you can do is run it through a formatting routine ala http://jsbeautifier.org/ or I've heard there's a plugin for Firebug that will accomplish the same thing. You're still going to have all the one letter variable names and whatnot. The only way to get the original code is to download it that way.

Upvotes: 1

Harmen
Harmen

Reputation: 22438

I think Google Closure Compiler is your solution, but I need to read it all one more time to be certain.

Edit: Yep, that's it (link updated)

Upvotes: 2

Related Questions