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

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