W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > March 2019

Re: [webrtc-pc] RTCIceCandidateInit has no required fields, so should probably be optional in addIceCandidate (#2125)

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Tue, 12 Mar 2019 22:12:28 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-472201633-1552428747-sysbot+gh@w3.org>
Depends. To discourage anything but `addIceCandidate({candidate: signaledCandidate})`, then yeah we could *require* `addIceCandidate({candidate: ""})` and remove the `""` default. This would make it harder to end candidates "manually" or accidentally.

This is the opposite of WebIDL advice which aims to make calling APIs simpler, but we have a reason. I don't have a strong opinion however.

The legacy API is OK: the dictionary is not in trailing position there and doesn't [need to be optional](https://heycam.github.io/webidl/#dfn-optional-argument-default-value).

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2125#issuecomment-472201633 using your GitHub account
Received on Tuesday, 12 March 2019 22:12:31 UTC

This archive was generated by hypermail 2.4.0 : Saturday, 6 May 2023 21:19:46 UTC