WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED DUPLICATE of
bug 14469
20308
Pretty print minimized/obfuscated JS code for readability and debugging
https://bugs.webkit.org/show_bug.cgi?id=20308
Summary
Pretty print minimized/obfuscated JS code for readability and debugging
Andy Clark
Reported
2008-08-06 14:55:28 PDT
JavaScript apps are often deployed with the source minimized (or obfuscated). This results in the source being reduced to a single line or multiple lines with multiple statements per line. This makes it very difficult to read when the debugger traps on an error. Also, it is impossible to set meaningful breakpoints because they are set on lines, not statements. The first request for enhancement is to add a setting that will pretty-print the JS source. So even if the code is minimized, it will appear as separate lines, indented appropriately, and with added whitespace between tokens for readability. Even though the process of minimization often renames local variables this would allow the developer to more easily associate the lines of code back to the original source. The second request for enhancement falls out from the first request because once the source code is pretty-printed, each statement appears on a separate line. Then the user should be allowed to set breakpoints on these statements (or "virtual lines" of code). This allows the developer to read and debug the JS source in a deployed environment.
Attachments
Add attachment
proposed patch, testcase, etc.
Mark Rowe (bdash)
Comment 1
2008-08-06 15:40:32 PDT
<
rdar://problem/6130992
>
Gavin Sherlock
Comment 2
2008-08-24 19:10:51 PDT
This seems to be essentially a duplicate of
bug 16397
. Also, check out:
http://elfz.laacz.lv/beautify/
it's good a prettifying javascript - maybe it could be used (though its sources appear to have no explicit license).
Timothy Hatcher
Comment 3
2008-09-28 12:10:44 PDT
*** This bug has been marked as a duplicate of
14469
***
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug