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

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.

Dom

Received on Friday, 15 June 2012 15:17:02 UTC