W3C home > Mailing lists > Public > public-webrtc@w3.org > June 2012

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

From: Dominique Hazael-Massieux <dom@w3.org>
Date: Fri, 15 Jun 2012 17:16:37 +0200
Message-ID: <1339773397.3217.514.camel@altostratustier>
To: Harald Alvestrand <harald@alvestrand.no>
Cc: Adam Bergkvist <adam.bergkvist@ericsson.com>, "public-webrtc@w3.org" <public-webrtc@w3.org>
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

This archive was generated by hypermail 2.3.1 : Monday, 23 October 2017 15:19:28 UTC