Re: Non-constructible constructors and Arrays

On 7/31/11 7:50 PM, Cameron McCormack wrote:
> Here is a proposal (which I haven't thought deeply about yet): any
> interface that supports indexed properties and which does not inherit
> from another interface

As things stand this would include Window (but not HTMLFormElement, 
since that inherits from HTMLElement, right?).

I suspect that having Window inherit from Array.prototype would probably 
not be web-compatible, but I'm willing to be proved wrong...

> It is then incumbent on the API designer to define index setters/creators/deleters
> appropriately such that the mutating Array methods make sense.

We can't really change the meaning of indexed properties on Window, imho.

> Would this work? Is there a problem with sparse Arrays at all?

Depending on the interface, perhaps.

-Boris

Received on Sunday, 31 July 2011 23:57:01 UTC