W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2011

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

From: Jonas Sicking <jonas@sicking.cc>
Date: Tue, 30 Aug 2011 16:19:32 -0700
Message-ID: <CA+c2ei9YUKSfd141VDueKx0OeKPKzFQE6+N8nWZc2XxRx7=jvA@mail.gmail.com>
To: Aryeh Gregor <ayg@aryeh.name>
Cc: Julien Richard-Foy <julien@richard-foy.fr>, public-webapps@w3.org
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:47 GMT