Bug 17548

Summary: JavaScriptCore print(a, b) differs from Spidermonkey Behavior
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: JavaScriptCoreAssignee: Sam Weinig <sam>
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Mac   
OS: OS X 10.5   
Description Flags
Proposed patch
Revised proposed patch eric: review+

Description Brent Fulgham 2008-02-25 23:29:22 PST
Spidermonkey allows comma-separated arguments to print.  These values are printed with a space inbetween.

print ("foo", "bar")

foo bar

In JavaScriptCore it produces:
Comment 1 Cameron Zwarich (cpst) 2008-06-07 14:04:35 PDT
Created attachment 21565 [details]
Proposed patch

Here is a patch. It uses indices instead of iterators because our iterators don't have a distance function.
Comment 2 Cameron Zwarich (cpst) 2008-06-07 14:51:27 PDT
Created attachment 21566 [details]
Revised proposed patch

Includes some changes suggested by Eric.
Comment 3 Eric Seidel (no email) 2008-06-07 14:52:40 PDT
Comment on attachment 21566 [details]
Revised proposed patch

Looks great!  (I think I even wrote work-around code in some test cases instead of fixing this once.)
Comment 4 Cameron Zwarich (cpst) 2008-06-07 14:58:09 PDT
Landed in r34429.