W3C home > Mailing lists > Public > public-script-coord@w3.org > October to December 2015

Re: Overload of Dictionary and Callback - why is this disallowed?

From: Harald Alvestrand <harald@alvestrand.no>
Date: Wed, 2 Dec 2015 13:59:45 +0100
To: public-script-coord@w3.org
Message-ID: <565EEB41.4060803@alvestrand.no>
Den 01. des. 2015 22:22, skrev Boris Zbarsky:
> On 12/1/15 3:40 PM, Harald Alvestrand wrote:
>> Getting around this "in prose" requires hacks. And since our
>> implementation uses an IDL compiler, this requires our IDL to be
>> different from the spec's IDL in gratuitous ways.
> 
> I'm a little confused.  What is (or should be) the spec's IDL here?
> 
> If you're talking about just doing this in your own IDL, not in the
> spec, then you can clearly add something to your IDL implementation that
> allows the distinguishability you need here or something....

The spec's IDL has changed multiple times over the years.

This year's version:

Promise<RTCSessionDescription> createOffer (optional RTCOfferOptions
options);
void createOffer (RTCSessionDescriptionCallback successCallback,
RTCPeerConnectionErrorCallback failureCallback, optional RTCOfferOptions
options);

(yes, there's a weird interaction here with overloading of promise vs
non-promise; the consensus between Firefox and Chrome seems to be that
interpreting void as Promise<void> and never resolving the promise is
kind-of-OK.)

August 2012 version:

void createOffer (RTCSessionDescriptionCallback successCallback,
optional RTCPeerConnectionErrorCallback failureCallback, optional
MediaConstraints constraints);

That's the one that Chrome currently implements.
Received on Wednesday, 2 December 2015 13:00:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 2 December 2015 13:00:17 UTC