Re: Dictionary errors

On 2015-08-18 10:39, Adam Bergkvist wrote:
> Hi
>
> In the WebRTC WG, we have the getUserMedia() function where the script
> can specify which types of media it wants to request with a dictionary.
> For example:
>
> navigator.mediaDevices.getUserMedia({ "audio": true, "video": true});
>
> We currently reject with a NotSupportedError if the script doesn't
> specify at least one media type (e.g. an empty dictionary).
>
> We recently had a discussion about rejecting with a TypeError instead.
> The reason is that since the required keyword was introduced, there's a
> way to specify that not all Objects can represent a dictionary since
> there can be rules regarding what members that need to be present. We
> don't have a keyword to express that "at least one of these members need
> to be present", but we're expressing that in prose instead.
>
> We would very much appreciate your input on this.

No one?

/Adam


Received on Wednesday, 26 August 2015 08:30:45 UTC