Re: [WebIDL] Remove ArrayClass?

On 7/19/14, 6:01 PM, Dirk Schulze wrote:
> It would be frustrating for authors to have querySelectorAll return a NodeList with Array prototype but let getElementsBy* return an HTMLCollection without Array capabilities.

Just like it's frustrating that querySelectorAll returns a static list 
but getElementsBy* returns a live list?  Or the various other behavior 
differences between the return values of the methods?

I agree it would be nice to have array stuff on HTMLCollection, but we 
know for a fact that would break code that relies on the named getter 
for a name that happens to collide with something on Array.prototype, 
which is what makes it a non-starter.

> getElementsBy* and querySelectorAll might have the same backwards compatibility issues if we just make them prototype Array.

No, the compat issues for getElementsBy* are much worse.

-Boris

Received on Sunday, 20 July 2014 02:03:29 UTC