- From: Jan-Ivar Bruaroey <jib@mozilla.com>
- Date: Fri, 06 Dec 2013 13:53:37 -0500
- To: cowwoc <cowwoc@bbs.darktech.org>, public-media-capture@w3.org
On 12/6/13 11:56 AM, cowwoc wrote: > There is nothing in Javascript which implies that unknown keys should > be ignored silently. Yes there is. JavaScript APIs accept extra parameters and do not throw. This is established practice, as Travis points out in http://lists.w3.org/Archives/Public/public-media-capture/2013Oct/0129.html There is nothing in Javascript which implies that unknown keys should be ANYTHING BUT ignored silently. > Throwing exceptions on bad input is not meant as a mechanism for > detecting browser support. There is no duplication here. Typos are not > an indication that the browser doesn't support the input *yet*. They > are an indication that the browser may *never* support this kind of input. You cannot distinguish typos from future parameters in JavaScript, and trying to is misguided, because it prevents adding new parameters in the future without breaking old implementations. Would you have us throw if 'audio' or 'video' were misspelled? If so, how could we ever add a third media type like 'smellovision' ? >> What about: { audio: true, video: { optional: { maxW1dth: 320, >> maxHeight: 240 }}} ? >> >> or: { audio: true, video: { mandtory: { maxW1dth: 320, maxHeight: 240 >> }}} ? ... > I'm not advocating changing the language, just validating the function > input. This is function input to gUM()! Would you have us fail on the two cases above? .: Jan-Ivar :.
Received on Friday, 6 December 2013 18:54:07 UTC