<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Check type of this in RTCPeerConnection JS built-in functions"
   href="https://bugs.webkit.org/show_bug.cgi?id=151303#c5">Comment # 5</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Check type of this in RTCPeerConnection JS built-in functions"
   href="https://bugs.webkit.org/show_bug.cgi?id=151303">bug 151303</a>
              from <span class="vcard"><a class="email" href="mailto:youennf&#64;gmail.com" title="youenn fablet &lt;youennf&#64;gmail.com&gt;"> <span class="fn">youenn fablet</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=151303#c4">comment #4</a>)
<span class="quote">&gt; (In reply to <a href="show_bug.cgi?id=151303#c3">comment #3</a>)
&gt; &gt; Would you be able to add 2 tests:
&gt; &gt; - Changing a RTCPeerConnection object prototype, then calling one of
&gt; &gt; RTCPeerConnection function on the object.
&gt; &gt; - Setting an object to the RTCPeerConnection prototype and calling one of
&gt; &gt; the methods.
&gt; &gt; 
&gt; &gt; Ideally we should not rely on the object prototype itself.
&gt; 
&gt; The current &#64;isRTCPeerConnection() cannot deal with the cases you describe
&gt; Youenn. My initial thinking is to add a JSBuiltinConstructor where I can
&gt; initialize the &#64;operations field and use that one as a probe. Right now the
&gt; existence for &#64;operations is checked before every use, so a JS built-in
&gt; constructor would be useful anyhow.</span >

That would probably cover the cases.

In the future we might want to make checks more uniform, for instance something like:
if (!(object instanceof &#64;RTCPeerConnection))
   throw new &#64;TypeError(...)</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>