W3C home > Mailing lists > Public > public-webapps@w3.org > October to December 2011

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

From: Cameron McCormack <cam@mcc.id.au>
Date: Mon, 24 Oct 2011 15:02:14 -0700
Message-ID: <4EA5E066.1080405@mcc.id.au>
To: Jonas Sicking <jonas@sicking.cc>
CC: Aryeh Gregor <ayg@aryeh.name>, Julien Richard-Foy <julien@richard-foy.fr>, public-webapps@w3.org
On 24/10/11 12:14 PM, Jonas Sicking wrote:
> Based on my testing, many methods wouldn't throw for zero-size
> array-like objects. Similarly, methods like .push(), .unshift() and
> .slice() wouldn't throw if no entries were actually requested to be
> added or removed. And .reverse() wouldn't throw for single-sized
> array-like objects.
>
> May or may not be a big deal though.

Yeah.  IMO it's not.

One thing that is difficult to reflect from the JS Array API to objects 
like HTMLInputElements.files which we might want to make mutable is that 
the former is designed to work with sparse arrays while we have 
typically considered DOM collection/list objects as dense.

   myFileInput.files.length;    // let's say this is 1
   myFileInput.files[2] = ...;  // what does this mean?
Received on Monday, 24 October 2011 22:02:56 GMT

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