W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2014

Re: Exposing constructors of readonly interfaces to web authors

From: Rik Cabanier <cabanier@gmail.com>
Date: Thu, 10 Jul 2014 19:21:10 +0200
Message-ID: <CAGN7qDB36hJhR47LcOX+QgmP6EnfTk8LyeKVbh6GJ9LFS+Jpww@mail.gmail.com>
To: Domenic Denicola <domenic@domenicdenicola.com>
Cc: Boris Zbarsky <bzbarsky@mit.edu>, "public-script-coord@w3.org" <public-script-coord@w3.org>
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

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 17:14:22 UTC