Re: indexed properties on NodeLists and HTMLCollections

On Mon, Jun 13, 2011 at 8:13 PM, Cameron McCormack <cam@mcc.id.au> wrote:
> Cameron McCormack:
>> I would like to hear from implementors whether they
>>
>>   1. are happy treating indexed properties as a layer above the normal
>>      object property resolution (like Chrome/Safari do);
>>   2. think disallowing user defined non-configurable array index
>>      properties, or disallowing all user defined array index properties,
>>      as own properties on NodeLists/HTMLCollections is a good idea.
>
> Hearing some support for the above and no objections, I will start
> speccing this.  This will involve editorial work specifying the
> behaviour of [[Get]], etc. on these objects, rather than having it
> written in terms of defining and deleting properties at particular
> times.

I'd really like to hear from bz what he thinks will get the best
performance in Gecko. And from other browser vendors what will give
the best performance in their engines.

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. But
if that has bad performance characteristics then that's obviously a
downside.

> I would prefer to go the route of disallowing all user defined array
> index properties on objects with indexed properties, as that is simpler.

I agree.

> I’m yet to do any testing for named properties.  There are two
> interfaces that have [OverrideBuiltins], HTMLDocument and
> HTMLFormElement, and I’m guessing that disallowing all user defined
> properties on objects with [OverrideBuiltins] named properties is not
> feasible.

Unfortunately that is probably the case.

/ Jonas

Received on Tuesday, 14 June 2011 07:25:41 UTC