Re: [webrtc-pc] RTCConfiguration.iceServers with undefined?

[WebIDL](https://heycam.github.io/webidl/#es-dictionary) says: *"An ECMAScript value V is converted to an IDL dictionary type value by running the following algorithm (where D is the dictionary type): 1. If Type(V) is not Undefined, Null or Object, then throw a TypeError. 2. Let dict be an empty dictionary value of type D; ..."* which gets us past the first `TypeError`. In other words, this is equivalent to:
```js
new RTCPeerConnection({iceServers: [{}]})
```

Then later it says *"if value is undefined and member is a [required dictionary member](https://heycam.github.io/webidl/#required-dictionary-member), then throw a TypeError."*

So Chrome is right, because [urls](http://w3c.github.io/webrtc-pc/#dom-rtciceserver-urls) is a required member. Firefox is [missing](https://dxr.mozilla.org/mozilla-central/rev/bdb2387396b4a74dfefb7c983733eed3625e906a/dom/webidl/RTCConfiguration.webidl#16) the required keyword. But,

sadly, it's not possible to `require` `urls` without dropping legacy support for `url`, something we'll experience if we end up putting `url` back in the spec for webcompat reasons. We'll have to [kludge it](https://bugzilla.mozilla.org/show_bug.cgi?id=1369563).

-- 
GitHub Notification of comment by jan-ivar
Please view or discuss this issue at https://github.com/w3c/webrtc-pc/issues/1251#issuecomment-305650989 using your GitHub account

Received on Thursday, 1 June 2017 23:48:59 UTC