W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2015

Dictionary errors

From: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Tue, 18 Aug 2015 08:39:01 +0000
To: "public-script-coord@w3.org" <public-script-coord@w3.org>
CC: Jan-Ivar Bruaroey <jib@mozilla.com>
Message-ID: <A222C88B6882744D8D4B9681B315889023FFC9FC@ESESSMB307.ericsson.se>

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.


Received on Tuesday, 18 August 2015 08:39:29 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:24 UTC