Script formatter user JS
Tuesday, 13. May 2008, 22:34:15
Here is a small user JavaScript which re-formats script source code to make those "compressed" files simpler to debug with Opera Dragonfly
Download User Javascript..
Note: this script is converted from PHP in a quick and messy way - apologies for any PHPisms, and for the variables that are still prefixed with a dollar sign. I've been using it for a while but I still find bugs and scripts that the formatter can not handle, so be prepared that there may still be some work to do.. Let's call it an alpha release










Darken # 13. May 2008, 23:06
fearphage # 14. May 2008, 03:13
Andrew Gregory # 14. May 2008, 11:50
Thank you Hallvord, that's one thing scratched off my Dragonfly annoyances list.
fearphage # 14. May 2008, 13:13
Originally posted by Andrew Gregory:
No. This functionality was sacrificed for performance.hallvors # 14. May 2008, 21:07
I've read through most of the script. Mine looks a little simpler but might of course fail in more cases. Have you used Vital's script? Any idea how they compare in terms of correctness and performance?
fearphage # 14. May 2008, 21:42
Originally posted by hallvors:
YesOriginally posted by hallvors:
No but a good lithmus test is obfuscated code.Andrew Gregory # 17. May 2008, 08:54
hallvors # 19. May 2008, 11:31
I never added anything to remove superfluous lines (or not add them in the first place) because I mostly just enabled it for debugging all-on-one-line code anyway
fearphage # 24. May 2008, 13:24
hallvors # 24. May 2008, 19:35
fearphage # 3. June 2008, 17:43
Originally posted by hallvors:
I would like it to be available all the time so i can use the following:and get pretty code like i used to do... Basically, I want the functionality back. Dragonfly can hopefully be used as leverage to pull it back.Andrew Gregory # 4. June 2008, 14:28
It would be nice if Dragonfly could make accessible the unpacked result of packed JS - it must be somewhere, but I'm sure that might be a bit tricky. In fact, it might be an argument for the return of the nice Function.toString.
hallvors # 14. August 2008, 13:10
return /^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/.test(this)My parser is too low-level to understand that / after "return " starts a regexp and not a division. To tell them apart I would have to add some tokenising and knowledge of keywords I guess, so Vital's JS is a good alternative. Would be nice as a user JS for Dragonfly work.
fearphage # 15. August 2008, 12:27
Originally posted by hallvors:
I propose that it should be configurable functionality in the same way as stacktraces are now. I hope this is an issue that you and other staff members can push for.