Re: [selectors-api] Return an Array instead of a static NodeList

On Tue, Aug 30, 2011 at 2:25 PM, Aryeh Gregor <ayg@aryeh.name> wrote:
> On Tue, Aug 30, 2011 at 4:33 AM, Jonas Sicking <jonas@sicking.cc> wrote:
>> My point was that it was a mistake for querySelectorAll to return a
>> NodeList. It should have returned an Array. Sounds like people agree
>> with that then?
>
> I don't have a problem with that, if it can be changed safely.
> However, some things do have to return NodeLists, at least if the
> returned list is live.

Indeed, Arrays can't be returned when live objects are returned.

> In that case, it's still useful to have the
> Array methods available.

Indeed! I think it's already been decided that all non-mutating
functions should be added to NodeLists and other list-like DOM
objects. I believe Cameron is still working on the specifics of that.

/ Jonas

Received on Tuesday, 30 August 2011 23:20:38 UTC