W3C home > Mailing lists > Public > public-webrtc-logs@w3.org > June 2017

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

From: jan-ivar via GitHub <sysbot+gh@w3.org>
Date: Thu, 01 Jun 2017 23:48:53 +0000
To: public-webrtc-logs@w3.org
Message-ID: <issue_comment.created-305650989-1496360931-sysbot+gh@w3.org>
[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

This archive was generated by hypermail 2.3.1 : Tuesday, 4 June 2019 15:32:43 UTC