<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Function.prototype.bind: Bound functions must use the [[Prototype]] of their target function instead of Function.prototype"
   href="https://bugs.webkit.org/show_bug.cgi?id=145605#c34">Comment # 34</a>
              on <a class="bz_bug_link 
          bz_status_REOPENED "
   title="REOPENED - Function.prototype.bind: Bound functions must use the [[Prototype]] of their target function instead of Function.prototype"
   href="https://bugs.webkit.org/show_bug.cgi?id=145605">bug 145605</a>
              from <span class="vcard"><a class="email" href="mailto:ggaren&#64;apple.com" title="Geoffrey Garen &lt;ggaren&#64;apple.com&gt;"> <span class="fn">Geoffrey Garen</span></a>
</span></b>
        <pre><span class="quote">&gt; error: invalid operands to binary expression ('JSC::JSValue' and
&gt; 'JSC::FunctionPrototype *')
&gt;     bool hasDefaultPrototype = targetPrototype ==
&gt; globalObject-&gt;functionPrototype();</span >

To provide the right type, use JSValue(globalObject-&gt;functionPrototype()).

<span class="quote">&gt; error: comparison of distinct pointer types ('JSC::JSObject *' and
&gt; 'JSC::FunctionPrototype *')
&gt;     bool hasDefaultPrototype = asObject(targetPrototype) ==
&gt; globalObject-&gt;functionPrototype();
&gt;                                ~~~~~~~~~~~~~~~~~~~~~~~~~ ^ 
&gt; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&gt; ````
&gt; 
&gt; which I don't understand because as you rightly say, FunctionPrototype
&gt; inherits from JSObject</span >

In this formulation we have the right type but the compiler doesn't know it. So, you need to #include FunctionPrototype.h.

We shouldn't use this formulation, though, unless we can guarantee that the target callee in fact has a [[Prototype]]. I don't think we can guarantee that.</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>