Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verbose description for RTCDataChannel default values #1353

Closed
soareschen opened this issue Jun 7, 2017 · 3 comments · Fixed by #1358
Closed

Verbose description for RTCDataChannel default values #1353

soareschen opened this issue Jun 7, 2017 · 3 comments · Fixed by #1358

Comments

@soareschen
Copy link
Contributor

In the attribute descriptions for RTCDataChannel, there are many verbose sentences that describe the same action as setting the attributes with the default/provided values in RTCDataChannelInit dictionary.

The attribute must be initialized to ... by default and must return the value to which it was set when the RTCDataChannel was created.

Is there any reason why the sections require verbose description of default values? They are not really required since the sections that create data channel initialize the attributes with explicit values already.

6.1 createDataChannel
5. Set channel's ordered, maxPacketLifeTime, maxRetransmits, protocol, negotiated, id and priority attributes to the values of the corresponding members of the dataChannelDict argument, using a value of null if the corresponding dictionary member is missing.

6.2 When an underlying data transport is to be announce
4. Initialize channel's label, ordered, maxPacketLifeTime, maxRetransmits, protocol, negotiated and id attributes to their corresponding values in configuration.

For the attributes with default null value, the sentence can be omitted by making the respective fields in RTCDataChannelInit nullable with default value null.

@adam-be
Copy link
Member

adam-be commented Jun 8, 2017

I agree. This is a bit messy and could be better specified with less text.

@adam-be adam-be self-assigned this Jun 8, 2017
@adam-be
Copy link
Member

adam-be commented Jun 8, 2017

Giving maxPacketLifeTime and maxRetransmits default values of null would change the behavior a bit since it implies that the dictionary members need to be nullable. For example:

{ maxPacketLifeTime: null, maxRetrainsmits: 10 }

would be allowed with nullable dictionary members. It currently renders a TypeError. I don't see a problem with making the dictionary members nullable, since the corresponding DataChannel attributes are nullable, but it's not an "editorial" change then.

@adam-be
Copy link
Member

adam-be commented Jun 8, 2017

In PR #1358, the part where all internal slots are initialized could be made a bit simpler if all init dictionary members could have a default value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants