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

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