Re: Removing syntaxerror for ice candidates

On 07/16/2015 05:27 PM, Jan-Ivar Bruaroey wrote:
> On 7/15/15 5:03 AM, Harald Alvestrand wrote:
>>> If we plan to fail when an RTCIceCandidate is constructed with a bad
>>> candidate string, we need to perform the same check every time the
>>> corresponding attribute is set.
>> Yep. Which argues that the RTCIceCandidate should either be immutable or
>> allow syntactically invalid candidates.
>>
>> Otherwise, this will work:
>>
>> c.candidate = part1 + ' ' + part2
>>
>> but this will not work
>>
>> c.candidate = part1
>> c.candidate += ' '
>> c.candidate += part2
>>
>> Violates the principle of least surprise.
>
> Good point. Not to advocate change, but just for info, what was the
> rationale for RTCIceCandidate not just being a dictionary?

Speaking from memory....

when RTCIceCandidate and RTCSessionDescription were added to the spec,
we felt that having these as interfaces would allow us to provide them
with accessors and manipulators at a later stage (one could imagine
having RTCIceCandidate having a "syntacticallyValid" attribute, for
instance).

This was before we started falling in love with dictionaries. Many moons
ago....

Received on Friday, 17 July 2015 08:20:20 UTC