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: Adam Bergkvist <adam.bergkvist@ericsson.com>
Date: Tue, 23 Feb 2016 19:17:50 +0000
To: Jan-Ivar Bruaroey <jib@mozilla.com>, 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: <A222C88B6882744D8D4B9681B3158890295BCD2F@ESESSMB307.ericsson.se>
On 2016-02-23 16:30, Jan-Ivar Bruaroey wrote:
> On 2/23/16 4:16 AM, Adam Bergkvist wrote:
>> On RTCDataChannel we have an oredered attribute, that reflects the
>> ordered setting used to create the object. If we want to be consistent
>> on the type it gets a bit strange if people try to use it as a boolean
>> (which the name suggests it is).
>> var dc = pc.createDataChannel(label, {ordered: "unordered"});
>> !!pc.ordered is true (since !!"unordered" is true)
> Generally, naming an enum after one of its possible choices seems poor,
> so if we switch ordered to be an enum we should probably call it
> something else. That way, there should be no confusion with the ordered
> attribute.
> How about "order"? Not different enough?

That would be an improvement. Both for the settings dictionary member 
and the readonly attribute.

Received on Tuesday, 23 February 2016 19:18:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 23 February 2016 19:18:24 UTC