Re: Exposing constructors of readonly interfaces to web authors

On Thu, Jul 10, 2014 at 6:51 PM, Domenic Denicola <
domenic@domenicdenicola.com> wrote:

>
>
> > On Jul 10, 2014, at 9:47, "Boris Zbarsky" <bzbarsky@MIT.EDU> wrote:
> >
> >> On 7/10/14, 12:42 PM, Rik Cabanier wrote:
> >> It was to avoid introducing another instance. Is there a way in IDL to
> >> have a constructor but not have the class available in the global
> object?
> >
> > No, but we could certainly add such a thing.  However, why is that
> desirable?  What use is a constructor you can't get hold of without weird
> tricks?
>
> While I don't really understand why it is so important to avoid new
> globals, it *is* important to avoid non-constructible classes where
> possible, even if their constructors are not assigned to global variables.
>

When you add objects to the global namespace and people already defined
those names in their scripts, thei web page is now broken.
We saw this with the introduction of the "Path" object where paper.js pages
no longer worked.

You can search github for pages that will be affected if we introduce these
new classes :-)

Received on Thursday, 10 July 2014 17:21:39 UTC