W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > December 2018

Re: [webrtc-pc] Allow addIceCandidate(null) for backwards compatibility w/adapter (#2039)

From: Jan-Ivar Bruaroey via GitHub <sysbot+gh@w3.org>
Date: Mon, 10 Dec 2018 23:14:47 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-446010764-1544483684-sysbot+gh@w3.org>
I did some archeology, and judging by https://github.com/w3c/webrtc-pc/issues/1077#issuecomment-287159303 there seemed to be some confusion around what would be needed to fix this.

It's surprisingly simple to support: There's no need to reintroduce nullable. In fact, dictionaries *cannot* be nullable, because `null` is already a valid value for a dictionary in WebIDL, [producing the default dictionary](https://heycam.github.io/webidl/#es-dictionary). E.g. `addIceCandidate(null)` is already indistinguishable from `addIceCandidate({candidate: "",  sdpMid: null, sdpMLineIndex: null}`, which is corroborated by the Chrome errors above.

So all we would need to do, is reintroduce the [original language](https://github.com/w3c/webrtc-pc/pull/1088/files) here, just with s/null/empty string/. I.e.:

*"If* candidate *is not `""` and both* sdpMid *and* sdpMLineIndex *are `null`, return a promise rejected with a newly created TypeError."*

GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/2039#issuecomment-446010764 using your GitHub account
Received on Monday, 10 December 2018 23:14:49 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:22:09 UTC