New ES6 spec draft (Rev 22, Jan 20, 2014)

Sam Tobin-Hochstadt samth at cs.indiana.edu
Tue Jan 21 06:37:28 PST 2014


On Tue, Jan 21, 2014 at 9:29 AM, Kevin Smith <zenparsing at gmail.com> wrote:
>
>   2) The current loader is an instance of the Loader type.  It is
> incongruent to name an instance with a capitalized identifier.  I believe it
> would be more appropriate to provide access to the current loader via a
> getter on the Loader or Realm constructor.  For example:
>
>     Realm.loader
>     Loader.current
>     etc...
>

First, there are plenty of standard bindings on the global object that
are not constructors and yet are capitalized -- `Math` is a prime
example here.

Second, there's no reason that access to a particular loader and
access to the Realm or Loader constructors should be related.

Third, anything in the `.current` style is introducing inexplicable
magic into the platform to have the value of the property vary
depending on a property that code otherwise can't observe.

Fourth, there can be multiple loaders associated with a given Realm.

Fifth, the binding for `System` is not a general mechanism for
accessing loaders -- it is a binding for a particular one, the one
provided by the host environment. it shouldn't be confused with such a
general mechanism (which, as I say above, would be a bad idea anyway).

Sam


More information about the es-discuss mailing list