Re: QSA, the problem with ":scope", and naming

On Sun, Oct 30, 2011 at 1:23 PM, Rick Waldron <waldron.rick@gmail.com> wrote:
>
>
> On Sat, Oct 29, 2011 at 11:28 PM, Cameron McCormack <cam@mcc.id.au> wrote:
>>
>> On 20/10/11 3:50 AM, Alex Russell wrote:
>>>
>>> I strongly agree that it should be an Array *type*, but I think just
>>> returning a plain Array is the wrong resolution to our NodeList
>>> problem. WebIDL should specify that DOM List types *are* Array types.
>>> It's insane that we even have a NodeList type which isn't a real array
>>> at all. Adding a parallel system when we could just fix the one we
>>> have (and preserve the value of a separate prototype for extension) is
>>> wonky to me.
>>>
>>> That said, I'd *also* support the ability to have some sort of
>>> decorator mechanism before return on .find() or a way to re-route the
>>> prototype of the returned Array.
>>>
>>> +heycam to debate this point.
>>
>> Late replying here again, apologies, but I agree with others who say that
>> an actual Array object should be returned from this new API given that it is
>> not meant to be live.  What benefit is there from returning a NodeList?
>
> As much as I hate saying this: introducing a third return type would be
> counter-productive, as you'd now have live NodeList, static NodeList and
> subclassed Array. Congratulations, the cluster-f*ck continues in true form.

Live NodeList instances don't need to be considered here. They're the
result of an API which generates them, and that API can be described
in terms of Proxies. No need to complicate NodeList or imply that we
need a different type.

Making NodeList instances real array unifies them all. We can get that done too.

Received on Monday, 31 October 2011 21:00:21 UTC