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

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 UTC