array like objects

Mark S. Miller erights at
Sat Dec 12 14:59:18 PST 2009

On Sat, Dec 12, 2009 at 12:29 PM, Garrett Smith <dhtmlkitchen at>
> Object.prototype.propertyIsEnumerable does not consider properties in
> the prototype chain. In effect, propertyIsEnumerable is a test to see
> if an object has *own* property that is also enumerable.

At the end of <> I have added
the issue:

Unfortunately, the propertyIsEnumerable test above, despite the name,
actually tests whether a property is both enumerable and own. This means the
above predicate will reject objects that inherit a non-enumerable length
property. I can think of no reliable and portable ES3R test which tests only
property enumerability, except by running a for-in loop and testing the
output. Doing so would kill the bounded-by-constant time virtue.

Are we really this stuck? Can anyone think of a reliable, portable, and fast
ES3R test that tests whether a property is enumerable, whether it is
inherited or not?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list