Re: Using arrays in platform APIs

On Wed, Sep 25, 2013 at 3:52 PM, Anne van Kesteren <annevk@annevk.nl> wrote:
> Allen, we discussed this briefly during the last TC39 meeting and it
> seemed you had some different ideas on how to approach these.

Ping! Without input we might end up with something that cannot be
changed into this compatibly:
https://bugzilla.mozilla.org/show_bug.cgi?id=757664#c45


> 1) Exposing file-like objects through <input type=type>.files as
> array. Modifications to the array (e.g. via push()) would take affect.
> The way this is accomplished is through the <input type=file>
> implementation using Array.observe(). Elements in the array that are
> not Blob or File would be ignored.
>
> 2) Exposing a list of elements as the result of a query operation on a
> DOM. The idea is to have a subclass of Array named Elements on which
> you can perform further queries.
>
> In both cases reusing Array is convenient as it guarantees all the
> Array methods to be available as well as future Array methods and does
> not require re-implementing them.


-- 
http://annevankesteren.nl/

Received on Thursday, 10 October 2013 08:02:24 UTC