ES4 draft: Object
jodyer at adobe.com
Thu Mar 13 14:19:13 PDT 2008
FWIW, AS3, which doesn't have iterators, enumerates only the expando
properties of an object. This was in part because we didn't have (qualified)
name objects that could be enumerated, and in part because of it being
complicated to determine the set of names that could be safely exposed (e.g.
all the names in open namespaces, all the public names regardless of their
current visibility, etc). IOW, we punted.
On 3/13/08 11:29 AM, Waldemar Horwat wrote:
> Yuh-Ruey Chen wrote:
>> Brendan Eich wrote:
>>> If we end up making all namespaced properties non-enumerable, then we
>>> may want a property iterator that returns the names of all properties
>>> in a given object. Even if this is not in the standard, it's likely
>>> to be an extension. Or it could be added in the future.
>> Absolutely. In fact, I thought there was already an iterator that yields
>> all properties regardless of enumerability, just that this iterator
>> would not be the default iterator for objects. If it's not in ES4, it
>> should definitely be there because it's essential for those that want to
>> customize enumerability.
> As was discussed before, the language cannot have such an iterator. Were this
> iterator to exist, an attacker could use it to discover hidden properties of
> objects, get access to private and other restricted namespaces, alter private
> state, and break through abstraction barriers.
> Es4-discuss mailing list
> Es4-discuss at mozilla.org
More information about the Es4-discuss