Re: What is mandatory in RTCSessionDescription

On 5/19/15 3:57 PM, Martin Thomson wrote:
> [Constructor (optional RTCSessionDescriptionInit descriptionInitDict)]
> interface RTCSessionDescription {
>                  attribute RTCSdpType? type;
>                  attribute DOMString?  sdp;
>      serializer = {attribute};
> };
>
> Why is type nullable here?  Because the constructor argument is optional.
>
> Why is the constructor argument optional?

Because that used to be a requirement (no pun intended). But 
https://heycam.github.io/webidl/#changes says:

"Allow dictionary-typed trailing-position operation arguments not to be 
optional, if and only if the dictionary type has a required dictionary 
member. "

So yay!

> I'd have thought that we'd want to mark RTCSessionDescriptionInit.type
> as required, and remove this optionality here.

+1.

.: Jan-Ivar :.

Received on Thursday, 21 May 2015 01:49:52 UTC