<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#c33">Comment # 33</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:matthew.jh&#64;outlook.com" title="Matthew Hill &lt;matthew.jh&#64;outlook.com&gt;"> <span class="fn">Matthew Hill</span></a>
</span></b>
        <pre>Thanks Geoffrey. The reason for the cast was that it seemed to be necessary (see below).  

````
bool hasDefaultPrototype = targetPrototype == globalObject-&gt;functionPrototype();
````

doesn't compile. 

````
run-javascriptcore-tests

...

error: invalid operands to binary expression ('JSC::JSValue' and 'JSC::FunctionPrototype *')
    bool hasDefaultPrototype = targetPrototype == globalObject-&gt;functionPrototype();
                               ~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
````

Even 

````
asObject(targetPrototype) == globalObject-&gt;functionPrototype();
````

doesn't compile with

````
error: comparison of distinct pointer types ('JSC::JSObject *' and 'JSC::FunctionPrototype *')
    bool hasDefaultPrototype = asObject(targetPrototype) == globalObject-&gt;functionPrototype();
                               ~~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
````

which I don't understand because as you rightly say, FunctionPrototype inherits from JSObject</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>