Bug 10880

Summary: Do..while loop gains a semicolon each time it is toStringed
Product: WebKit Reporter: Jesse Ruderman <jruderman>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Minor CC: gavin.sharp
Priority: P2 Keywords: HasReduction
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Bug Depends on:    
Bug Blocks: 13638    
Attachments:
Description Flags
Avoid new semicolon when toString()ing function which has do..while darin: review+

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