Bug 10880 - Do..while loop gains a semicolon each time it is toStringed
Summary: Do..while loop gains a semicolon each time it is toStringed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Minor
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks: 13638
  Show dependency treegraph
 
Reported: 2006-09-15 23:25 PDT by Jesse Ruderman
Modified: 2007-05-08 20:33 PDT (History)
1 user (show)

See Also:


Attachments
Avoid new semicolon when toString()ing function which has do..while (3.78 KB, patch)
2007-05-08 11:20 PDT, Kimmo Kinnunen
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Ruderman 2006-09-15 23:25:07 PDT
javascript:f=function(){do{}while(0)}; for(i=0;i<4;++i) { alert(f); f=eval("(" + f + ")"); }
Comment 1 Eric Seidel (no email) 2007-05-08 02:45:26 PDT
Although no website would ever care about this, this totally breaks jruderman's testing tool since so many of the generated tests seem to contain do {} while
Comment 2 Kimmo Kinnunen 2007-05-08 11:20:04 PDT
Created attachment 14416 [details]
Avoid new semicolon when toString()ing function which has do..while

EmptyStatement got created after every do..while();, because ';' was not consumed as part of the do..while.
Comment 3 Darin Adler 2007-05-08 11:53:30 PDT
Comment on attachment 14416 [details]
Avoid new semicolon when toString()ing function which has do..while

Nice! r=me
Comment 4 David Kilzer (:ddkilzer) 2007-05-08 13:46:55 PDT
(In reply to comment #3)
> (From update of attachment 14416 [details] [edit])
> Nice! r=me

Please avoid using tabs in ChangeLog entries in the future.  Thanks!

Comment 5 Eric Seidel (no email) 2007-05-08 20:33:32 PDT
Need a changelog for layouttests next time too.  Commited as 21320