views:

46

answers:

2

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.

+2  A: 

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)

Harmen
Didn't know about that, looks useful for the minification scenario.
KeeperOfTheSoul
+1  A: 

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.

lincolnk
But my main problem is the original source isn't pure javascript, it's things like jswcs or Narrative, though that beautifier looks useful for basic debugging
KeeperOfTheSoul