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 01:33:10 -0700
Message-ID: <CA+c2ei_a+F6eZc9kP3P0w081CUFGB5Q=E7TAZwH3Ubm2+0NxSA@mail.gmail.com>
To: Aryeh Gregor <ayg@aryeh.name>
Cc: Julien Richard-Foy <julien@richard-foy.fr>, public-webapps@w3.org
On Mon, Aug 29, 2011 at 9:40 AM, Aryeh Gregor <ayg@aryeh.name> wrote:
> On Thu, Aug 25, 2011 at 7:17 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>> .push and .pop are generic and work on anything that looks like an
>> Array. However they don't work on NodeList because NodeList isn't
>> mutable.
>> . . .
>> None of these are *mutable* functions.
> Oh, right.  I misunderstood you.  Yes, obviously we wouldn't expose
> things like .push or .pop on NodeList, since they wouldn't make sense.
>  But we should expose things like .forEach, etc.  Any reason not to?

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?

/ Jonas
Received on Tuesday, 30 August 2011 08:34:07 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:13:23 UTC