<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>17547</bug_id>
          
          <creation_ts>2008-02-25 22:46:43 -0800</creation_ts>
          <short_desc>JavaScriptCore print() differs from Spidermonkey Behavior</short_desc>
          <delta_ts>2008-06-07 12:35:34 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brent Fulgham">bfulgham</reporter>
          <assigned_to name="Sam Weinig">sam</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71971</commentid>
    <comment_count>0</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2008-02-25 22:46:43 -0800</bug_when>
    <thetext>Spidermonkey has the useful behavior of printing a newline when no argument is passed:

print(&quot;abc&quot;)
print()
print(&quot;def&quot;)

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82570</commentid>
    <comment_count>1</comment_count>
      <attachid>21562</attachid>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-06-07 11:34:23 -0700</bug_when>
    <thetext>Created attachment 21562
Proposed patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82572</commentid>
    <comment_count>2</comment_count>
      <attachid>21562</attachid>
    <who name="Sam Weinig">sam</who>
    <bug_when>2008-06-07 12:27:22 -0700</bug_when>
    <thetext>Comment on attachment 21562
Proposed patch

+    if (args.size())

I would rather you use !args.isEmpty() here.

r=me</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82573</commentid>
    <comment_count>3</comment_count>
    <who name="Cameron Zwarich (cpst)">zwarich</who>
    <bug_when>2008-06-07 12:35:34 -0700</bug_when>
    <thetext>Landed in r34428.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>21562</attachid>
            <date>2008-06-07 11:34:23 -0700</date>
            <delta_ts>2008-06-07 12:27:22 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>printempty.diff</filename>
            <type>text/plain</type>
            <size>1081</size>
            <attacher name="Cameron Zwarich (cpst)">zwarich</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDM0NDI2
KQorKysgQ2hhbmdlTG9nCSh3b3JraW5nIGNvcHkpCkBAIC0xLDMgKzEsMTMgQEAKKzIwMDgtMDYt
MDcgIENhbWVyb24gWndhcmljaCAgPGN3endhcmljaEB1d2F0ZXJsb28uY2E+CisKKyAgICAgICAg
UmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgQnVnIDE3NTQ3OiBKYXZhU2Ny
aXB0Q29yZSBwcmludCgpIGRpZmZlcnMgZnJvbSBTcGlkZXJtb25rZXkgQmVoYXZpb3IKKyAgICAg
ICAgPGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xNzU0Nz4KKworICAg
ICAgICAqIGtqcy90ZXN0a2pzLmNwcDoKKyAgICAgICAgKGZ1bmN0aW9uUHJpbnQpOgorCiAyMDA4
LTA2LTA3ICBBbGV4ZXkgUHJvc2t1cnlha292ICA8YXBAd2Via2l0Lm9yZz4KIAogICAgICAgICBN
b3JlIGJ1aWxkIGZpeGVzLgpJbmRleDoga2pzL3Rlc3RranMuY3BwCj09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIGtq
cy90ZXN0a2pzLmNwcAkocmV2aXNpb24gMzQ0MjYpCisrKyBranMvdGVzdGtqcy5jcHAJKHdvcmtp
bmcgY29weSkKQEAgLTE1OSw3ICsxNTksMTEgQEAgR2xvYmFsT2JqZWN0OjpHbG9iYWxPYmplY3Qo
VmVjdG9yPFVTdHJpbgogCiBKU1ZhbHVlKiBmdW5jdGlvblByaW50KEV4ZWNTdGF0ZSogZXhlYywg
SlNPYmplY3QqLCBjb25zdCBMaXN0JiBhcmdzKQogewotICAgIHByaW50ZigiJXNcbiIsIGFyZ3Nb
MF0tPnRvU3RyaW5nKGV4ZWMpLlVURjhTdHJpbmcoKS5jX3N0cigpKTsKKyAgICBpZiAoYXJncy5z
aXplKCkpCisgICAgICAgIHByaW50ZigiJXNcbiIsIGFyZ3NbMF0tPnRvU3RyaW5nKGV4ZWMpLlVU
RjhTdHJpbmcoKS5jX3N0cigpKTsKKyAgICBlbHNlCisgICAgICAgIHB1dGNoYXIoJ1xuJyk7Cisg
ICAgCiAgICAgZmZsdXNoKHN0ZG91dCk7CiAgICAgcmV0dXJuIGpzVW5kZWZpbmVkKCk7CiB9Cg==
</data>
<flag name="review"
          id="9449"
          type_id="1"
          status="+"
          setter="sam"
    />
          </attachment>
      

    </bug>

</bugzilla>