<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Replace RTCPeerConnection custom constructor with a JS built-in constructor"
   href="https://bugs.webkit.org/show_bug.cgi?id=158832#c4">Comment # 4</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - WebRTC: Replace RTCPeerConnection custom constructor with a JS built-in constructor"
   href="https://bugs.webkit.org/show_bug.cgi?id=158832">bug 158832</a>
              from <span class="vcard"><a class="email" href="mailto:adam.bergkvist&#64;ericsson.com" title="Adam Bergkvist &lt;adam.bergkvist&#64;ericsson.com&gt;"> <span class="fn">Adam Bergkvist</span></a>
</span></b>
        <pre>(In reply to <a href="show_bug.cgi?id=158832#c2">comment #2</a>)
<span class="quote">&gt; Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=281643&amp;action=diff" name="attach_281643" title="Proposed patch">attachment 281643</a> <a href="attachment.cgi?id=281643&amp;action=edit" title="Proposed patch">[details]</a></span>
&gt; Proposed patch
&gt; 
&gt; View in context:
&gt; <a href="https://bugs.webkit.org/attachment.cgi?id=281643&amp;action=review">https://bugs.webkit.org/attachment.cgi?id=281643&amp;action=review</a>
&gt; 
&gt; &gt; LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt:7
&gt; &gt; +PASS new webkitRTCPeerConnection(null); threw exception TypeError: Type error.
&gt; &gt; +PASS new webkitRTCPeerConnection(undefined); threw exception TypeError: Type error.
&gt; 
&gt; I think it may be confusing to a developer that passing null or undefined
&gt; results in an exception with the generic message 'Type error', but passing
&gt; an empty string yields the much more informative message 'RTCPeerConnection
&gt; argument must be a valid Dictionary'. Why the difference?</span >

Let's not introduce such a behavior. I modified the JS constructor slightly to behave exactly like the old custom constructor; hence no changes to the test any more. The current behavior is not really spec compliant, but there's a bug to address that [1] (also noted in change log).

[1] <a href="http://webkit.org/b/158936">http://webkit.org/b/158936</a>

<span class="quote">&gt; &gt; LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt:10
&gt; &gt; +PASS new webkitRTCPeerConnection({}); threw exception TypeError: Type error.
&gt; 
&gt; Ditto.
&gt; 
&gt; &gt; Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:84
&gt; &gt; +
&gt; 
&gt; Nit: I am not sure this blank line aids readability.</span >

Removed.</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>