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: Martin Thomson <martin.thomson@gmail.com>
Date: Sat, 20 Feb 2016 16:09:01 -0800
Message-ID: <CABkgnnUn+uMYx6MQ1R32N-qTGn1jNBJO8AWH791=z5OMyji_qg@mail.gmail.com>
To: Peter Thatcher <pthatcher@google.com>
Cc: Jan-Ivar Bruaroey <jib@mozilla.com>, Harald Alvestrand <harald@alvestrand.no>, "public-media-capture@w3.org" <public-media-capture@w3.org>
On 19 February 2016 at 23:36, Peter Thatcher <pthatcher@google.com> wrote:
> So pc.createDataChannel("label", {ordered: undefined}) is still going to be
> ordered, right?
>
> So how are we better off with an enum in this case?


The hazard is with code like this:

function q(options) {
  if (!options.ordered) {
    // it's not ordered, we should do something on that basis
  }
  return pc.createDataChannel(options.label, options);
}
Received on Sunday, 21 February 2016 00:09:29 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 21 February 2016 00:09:30 UTC