Re: indexed properties on NodeLists and HTMLCollections

Jonas Sicking:
> > Personally I think it makes things the most consistent with JS if
> > these properties appear as properties on the object itself as that
> > avoids using magic catch-all getters/setters on the proto chain.

Boris Zbarsky:
> I think that's a separate concern.  No one is proposing we use
> catchall getters/setters here.  The only question is how the behavior
> of the own properties is defined.

My plan was (and I’ve written a patch to the spec to do this but haven’t
committed it yet) to redefine [[GetOwnProperty]] (as opposed to [[Get]])
to make it appear like real own properties exist on the object.  That
means Object.getOwnPropertyDescriptor would return a descriptor for
these objects.

However, they would still be an additional layer on top of the “real” own
properties on the object (assuming we didn’t outlaw own array index
properties altogether like I suggested a couple of mails back), so that
if an item is removed from a collection, an own property with the same
name would be revealed again.

I just want to make sure that’s consistent with your “catch-all getters/
setters” comment.

-- 
Cameron McCormack ≝ http://mcc.id.au/

Received on Thursday, 16 June 2011 00:26:22 UTC