Re: indexed properties on NodeLists and HTMLCollections

On 5/8/11 6:28 PM, Cameron McCormack wrote:
> * [[GetOwnProperty]] does:
>      * If the property name is a current indexed property, then return
>        a {configurable:false,enumerable:true,get:fn} where fn returns the
>        relevant Node.

Why is this better than just returning a value descriptor with the right 
node?  I can see at least one way in which it's worse: it involves 
reifying some sort of per-index getter function...

The upshot of this proposal is that array properties just shadow 
"normal" properties, right?  I'm in favor of that, whatever we need the 
spec-lawyering to be to make it work.

> The above ignores fixed objects.  What to do when freeze/seal/
> preventExtensions is called is another question, and one I haven’t
> tested current UA behaviour for.  If it’s compatible

1) I doubt it is (but please do test).
2) Which UAs actually implement those at this point?

> we might like to allow converting a live NodeList into a dead one with freeze.

Hmm.  So it would affect what item() returns too?  That could be a 
little odd...  But I suppose livable.

-Boris

Received on Monday, 9 May 2011 01:20:17 UTC