Re: [ACTION-43] (sdp related objects and global namespace) - way forward

On 06/15/2012 08:16 AM, Dominique Hazael-Massieux wrote:
> Le vendredi 15 juin 2012 à 12:55 +0200, Harald Alvestrand a écrit :
>
>> Tommy promised to provide more information on this, but apparently
>> stuff
>> that doesn't have constructors isn't accessible from the global JS
>> namespace, so doesn't pollute in the same way - the names are only
>> visible internally in the IDL specifications.
>
> That's not exactly true; not having constructors just mean that "new
> Foo()" isn't valid, but the interface object is still available in the
> global name space (e.g. you can look at "Foo.prototype" and "typeof Foo"
> is "object"). To avoid this completely, we would need the
> [NoInterfaceObject] extended attribute.
>
>> We do provide constructors for PeerConnectionEvent,
>> PeerConnectionIceEvent, MediaStreamTrackEvent, MediaStreamEvent and
>> DataChannelEvent.
>>
>> Dom, do all events require constructors?
>
> They're not required, but my understanding is that they are usually
> expected; they allow developers to trigger events on their own via
> dispatchEvent() for instance.

This is definitely one optimization we can make. I propose we remove all 
the event constructors. Developers wanting to dispatch their own events 
can build them manually.

-Anant

Received on Saturday, 16 June 2012 04:51:25 UTC