W3C home > Mailing lists > Public > public-media-capture@w3.org > February 2016

Re: Using enums to avoid default true in "settings dictionaries" (#466, #467, #471)

From: Jan-Ivar Bruaroey <jib@mozilla.com>
Date: Wed, 17 Feb 2016 20:39:40 -0500
To: Peter Thatcher <pthatcher@google.com>, Martin Thomson <martin.thomson@gmail.com>
Cc: Harald Alvestrand <harald@alvestrand.no>, "public-media-capture@w3.org" <public-media-capture@w3.org>
Message-ID: <56C520DC.8070703@mozilla.com>
On 2/17/16 3:54 PM, Peter Thatcher wrote:
> Sorry for my ignorance of WebIDL-ish things, but I still don't 
> understand how using a enum value as the default is different.  The 
> only "bad case" I've seen is that we wouldn't want 
> "createOffer({voiceActivityDetection: undefined})" to send VAD, but 
> even with the default being an enum, that still happens, doesn't it?

Webidl enums are strings [1], and according to ToString() [2] undefined 
turns into "undefined", which I suspect throws as invalid input for this 
enum, so it shouldn't happen (though I should test it).

That's my understanding anyway,

[1] https://heycam.github.io/webidl/#es-enumeration
[2] http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tostring

.: Jan-Ivar :.
Received on Thursday, 18 February 2016 01:40:18 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 18 February 2016 01:40:19 UTC