Bug 18869 - SQUIRRELFISH: function toString broken after calling
: SQUIRRELFISH: function toString broken after calling
Status: RESOLVED FIXED
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore
: 528+ (Nightly build)
: Macintosh Mac OS X 10.5
: P2 Normal
Assigned To: Maciej Stachowiak
:
Depends on:
Blocks: 18631
  Show dependency treegraph
 
Reported: 2008-05-03 01:38 PDT by Maciej Stachowiak
Modified: 2008-05-10 13:40 PDT (History)
0 users

See Also:


Attachments
fix by keeping references to the original source (107.76 KB, patch)
2008-05-10 05:10 PDT, Maciej Stachowiak
oliver: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Stachowiak 2008-05-03 01:38:34 PDT
function.toString does not work right after calling the function. This breaks at least the following layout tests:

  fast/js/toString-elision-trailing-comma.html
  fast/js/toString-prefix-postfix-preserve-parens.html
  fast/js/kde/lval-exceptions.html
Comment 1 Geoffrey Garen 2008-05-07 13:17:12 PDT
On IRC, Maciej said he was working on this.
Comment 2 Maciej Stachowiak 2008-05-10 05:10:05 PDT
Created attachment 21056 [details]
fix by keeping references to the original source
Comment 3 Oliver Hunt 2008-05-10 12:59:01 PDT
Comment on attachment 21056 [details]
fix by keeping references to the original source

r=me, although i am concerned about this approach in the long term.  As we are no longer actually decompiling there are two side effects:
* It is no longer possible to use function.toString to "prettify" source which makes debugging google, etc difficult (for us), and there are a number of places i've seen on the web that reference decompilation as a way to reformat JS.
* This renders a number of fuzzers somewhat useless.  JSFunFuzz for instance does roundtrip checks which in general are meant to pick up times when we have compiled code that does one thing into an incorrect form, which we now lose as all we do is regurgitate what we were given.

That said if we start doing significant optimisations and restructuring with the bytecode stream decopmilation may not be entirely helpful.