W3C home > Mailing lists > Public > public-script-coord@w3.org > July to September 2011

Re: Non-constructible constructors and Arrays

From: Cameron McCormack <cam@mcc.id.au>
Date: Tue, 02 Aug 2011 17:11:03 +1200
Message-ID: <4E3786E7.5060304@mcc.id.au>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
CC: public-script-coord@w3.org
(Missed your reply earlier, hence responding to Jonas wondering about 
cases when we don't want Array methods on an object.)

On 1/08/11 11:56 AM, Boris Zbarsky wrote:
> 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...

I think that's a good enough counterexample to have to opt in or out of 
this functionality.

>> 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.

Right, though I meant only if you wanted to add the mutable behaviour to 
the list.  (For Window, you wouldn't, so you would rely on push etc. 
throwing.)
Received on Tuesday, 2 August 2011 05:11:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 May 2013 19:30:04 UTC