Namespaces as Sugar (was: complexity tax)

Lars Hansen lhansen at
Thu May 29 14:18:27 PDT 2008

> -----Original Message-----
> From: es4-discuss-bounces at 
> [mailto:es4-discuss-bounces at] On Behalf Of Brendan Eich
> Sent: 29. mai 2008 13:49
> To: Mark S. Miller; Maciej Stachowiak
> Cc: es4-discuss at es4-discuss; Mark Miller; Douglas 
> Crockford
> Subject: Re: Namespaces as Sugar (was: complexity tax)
> We've since decided not to return Name instances from 
> for-in's underlying iterator -- that is, non-public-qualified 
> property identifiers are not enumerated. The motivation for 
> obj[name] and the reflection APIs remains strong in ES4.

It's a little more subtle than that, as the underlying iterator
returns only public names (as strings) by default, but it is
possible to feed the iterator constructor a set of namespaces,
and if that is done then it will return Name objects for all
the enumerable properties whose namespace is among the ones
fed to the iterator constructor.

The reflection interface will have something similar but that
design is far from finished.


More information about the Es4-discuss mailing list