<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@ericsson.com" title="Adam Bergkvist <adam.bergkvist@ericsson.com>"> <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">> Comment on <span class="bz_obsolete"><a href="attachment.cgi?id=281643&action=diff" name="attach_281643" title="Proposed patch">attachment 281643</a> <a href="attachment.cgi?id=281643&action=edit" title="Proposed patch">[details]</a></span>
> Proposed patch
>
> View in context:
> <a href="https://bugs.webkit.org/attachment.cgi?id=281643&action=review">https://bugs.webkit.org/attachment.cgi?id=281643&action=review</a>
>
> > LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt:7
> > +PASS new webkitRTCPeerConnection(null); threw exception TypeError: Type error.
> > +PASS new webkitRTCPeerConnection(undefined); threw exception TypeError: Type error.
>
> I think it may be confusing to a developer that passing null or undefined
> results in an exception with the generic message 'Type error', but passing
> an empty string yields the much more informative message 'RTCPeerConnection
> 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">> > LayoutTests/fast/mediastream/RTCPeerConnection-expected.txt:10
> > +PASS new webkitRTCPeerConnection({}); threw exception TypeError: Type error.
>
> Ditto.
>
> > Source/WebCore/Modules/mediastream/RTCPeerConnection.cpp:84
> > +
>
> 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>