getUserMedia({ }) should be a TypeError

In hindsight, I think it's clear that getUserMedia({ }) should be a 
TypeError rather than a NotSupportedError.

Having { lasers: true } throw NotSupportedError may sound good, but 
gives the wrong impression, as it leads to surprise when { lasers: true, 
audio: true } succeeds without error.

More importantly, the arrival of the required keyword for dictionary 
members in WebIDL suggests that empty dictionaries in new APIs are more 
likely to throw TypeError than anything else.

Even though the 'required' keyword wont work in our particular case, who 
knows, WebIDL may someday add a way to specify mutually-exclusive 
required members, and we'd wish we'd made this change now.

This also aligns well with the recent move to make this validation 
synchronous #182

.: Jan-Ivar :.

https://github.com/w3c/mediacapture-main/issues/189

Received on Thursday, 18 June 2015 22:53:47 UTC