W3C home > Mailing lists > Public > public-webrtc@w3.org > May 2016

[webrtc-pc] Overloaded operations: Throw or reject?

From: Adam Bergkvist via GitHub <sysbot+gh@w3.org>
Date: Wed, 04 May 2016 09:34:49 +0000
To: public-webrtc@w3.org
Message-ID: <issues.opened-152969955-1462354488-sysbot+gh@w3.org>
adam-be has just created a new issue for 
https://github.com/w3c/webrtc-pc:

== Overloaded operations: Throw or reject? ==
```
pc.addIceCandidate(); // TypeError
```
The above code needs to produce a TypeError since the mandatory 
candidate argument is missing. We have specified two overloaded 
version of addIceCandidate:

```
// Promise version
Promise<void> addIceCandidate ((RTCIceCandidateInit or 
RTCIceCandidate)? candidate);

// Legacy version with callbacks
void addIceCandidate ((RTCIceCandidateInit or RTCIceCandidate) 
candidate, VoidFunction successCallback, 
RTCPeerConnectionErrorCallback failureCallback);

```
As specified, one should reject with TypeErrors during WebIDL argument
 checking, and the other should throw. What should happen in the case 
above?

Please view or discuss this issue at 
https://github.com/w3c/webrtc-pc/issues/615 using your GitHub account
Received on Wednesday, 4 May 2016 09:36:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:48 UTC