<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Bound functions toString method should return &quot;bound &quot; + the target function's toString()"
   href="https://bugs.webkit.org/show_bug.cgi?id=153909#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Bound functions toString method should return &quot;bound &quot; + the target function's toString()"
   href="https://bugs.webkit.org/show_bug.cgi?id=153909">bug 153909</a>
              from <span class="vcard"><a class="email" href="mailto:sbarati&#64;apple.com" title="Saam Barati &lt;sbarati&#64;apple.com&gt;"> <span class="fn">Saam Barati</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=153909#c0">comment #0</a>)
<span class="quote">&gt; Via <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - [ES6] bound functions .name property should be &quot;bound &quot; + the target function's name"
   href="show_bug.cgi?id=153796">Bug 153796</a> [ES6] bound functions .name property should be &quot;bound &quot; + the
&gt; target function's name
&gt; 
&gt; We improved bound functions .name, but .toString() wasn't affected.
&gt; 
&gt; &gt; function foo() {return 42}
&gt; &gt; boundFunc = foo.bind(null)
&gt; &gt; boundFunc.name
&gt; &lt; &quot;bound foo&quot;
&gt; &gt; boundFunc.toString()
&gt; &lt; &quot;function foo() {
&gt;       [native code]
&gt;   }&quot;
&gt; 
&gt; 
&gt; What if we return the following instead:
&gt; 
&gt; &gt; boundFunc.toString()
&gt; &lt; &quot;function bound foo() {return 42}&quot;
&gt; 
&gt; or this:
&gt; 
&gt; &gt; boundFunc.toString()
&gt; &lt; &quot;bound function foo() {return 42}&quot;
&gt; 
&gt; I have no preference.
&gt; 
&gt; Two things are different from the current behavior:
&gt; 
&gt; 1. Instead of &quot;[native code]&quot;, the original content of the function is shown.
&gt;    This is much more convenient for debugging. Currently, all anonymous
&gt;    functions look alike:
&gt; 
&gt;    function () {
&gt;        [native code]
&gt;    }</span >
Depending on how we do this, it's not spec compliant.
toString() needs to return a string that if eval()ed
in the original context, would reproduce an identical
function. Or, if that's not possible, the toString(),
when eval()ed, must throw a syntax error.
We could achieve a syntax error with your proposal of:
&quot;function bound foo { return 42; }&quot;
And I considered doing this.
But, there is new a new proposal that would require
the use of &quot;[native code]&quot; here:
<a href="https://raw.githubusercontent.com/michaelficarra/Function-prototype-toString-revision/fc69a0a31dc6d625736bfbb712ac782eb241ff3d/proposal.html">https://raw.githubusercontent.com/michaelficarra/Function-prototype-toString-revision/fc69a0a31dc6d625736bfbb712ac782eb241ff3d/proposal.html</a></pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>