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

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