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: Wed, 24 Aug 2011 23:33:20 -0700
Message-ID: <CA+c2ei-DNqF0Pck0UHMxmsEsqNQZU3RcCTu=6FQzdcRXDzkXhQ@mail.gmail.com>
To: Aryeh Gregor <ayg@aryeh.name>
Cc: Julien Richard-Foy <julien@richard-foy.fr>, public-webapps@w3.org
On Wed, Aug 24, 2011 at 12:04 PM, Aryeh Gregor <ayg@aryeh.name> wrote:
> On Wed, Aug 24, 2011 at 1:27 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>> I agree with this, but it might be too late to make this change.
>> The problem is that if we returned an Array object, it would not have
>> a .item function, which the currently returned NodeList has.
>> I guess we could return a Array object and add a .item function to it.
> Or return a NodeList and add .forEach/.filter/etc. to it?

That works, but what is the advantage? And .push/.pop or other
mutating functions wouldn't work.

/ Jonas
Received on Thursday, 25 August 2011 06:34:17 UTC

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