Bug 17547

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

Brent Fulgham
Reported 2008-02-25 22:46:43 PST
Spidermonkey has the useful behavior of printing a newline when no argument is passed: print("abc") print() print("def") yields: abc def In JavaScriptCore, the same code yields: abc undefined def This can be easily worked around by passing an empty string, but it prevents reuse of code between the two implementations.
Attachments
Proposed patch (1.06 KB, patch)
2008-06-07 11:34 PDT, Cameron Zwarich (cpst)
sam: review+
Cameron Zwarich (cpst)
Comment 1 2008-06-07 11:34:23 PDT
Created attachment 21562 [details] Proposed patch
Sam Weinig
Comment 2 2008-06-07 12:27:22 PDT
Comment on attachment 21562 [details] Proposed patch + if (args.size()) I would rather you use !args.isEmpty() here. r=me
Cameron Zwarich (cpst)
Comment 3 2008-06-07 12:35:34 PDT
Landed in r34428.
Note You need to log in before you can comment on or make changes to this bug.