- From: Jan-Ivar Bruaroey <jib@mozilla.com>
- Date: Thu, 25 Feb 2016 21:56:44 -0500
- To: Adam Bergkvist <adam.bergkvist@ericsson.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>
On 2/23/16 2:17 PM, Adam Bergkvist wrote: > On 2016-02-23 16:30, Jan-Ivar Bruaroey wrote: >> How about "order"? Not different enough? > That would be an improvement. Both for the settings dictionary member > and the readonly attribute. Great! So lets add: enum RTCDataChannelOrder { "ordered", "unordered" }; dictionary RTCDataChannelInit { RTCDataChannelOrder order = "ordered"; // ... }; interface RTCDataChannel : EventTarget { readonly attribute RTCDataChannelOrder order; // ... }; Then there are no surprises: var dc1 = pc.createDataChannel(label, { order: "unordered" }); var dc2 = pc.createDataChannel(label, { order: "ordered" }); var dc3 = pc.createDataChannel(label, { order: undefined }); var dc4 = pc.createDataChannel(label); console.log(dc1.order); // unordered console.log(dc2.order); // ordered console.log(dc3.order); // ordered console.log(dc4.order); // ordered This seems to solve the "avoid having true as default value" problem [1] without any downsides. [1] http://heycam.github.io/webidl/#dfn-dictionary-member-default-value .: Jan-Ivar :.
Received on Friday, 26 February 2016 02:57:15 UTC