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

Re: Non-constructible constructors and Arrays

From: Allen Wirfs-Brock <allen@wirfs-brock.com>
Date: Mon, 1 Aug 2011 22:13:08 -0700
Cc: Jonas Sicking <jonas@sicking.cc>, Alex Russell <slightlyoff@google.com>, public-script-coord@w3.org, Brendan Eich <brendan@mozilla.com>
Message-Id: <2F68337D-68C8-4607-8F00-7B8A31784971@wirfs-brock.com>
To: Cameron McCormack <cam@mcc.id.au>

On Aug 1, 2011, at 8:45 PM, Cameron McCormack wrote:

> On 2/08/11 5:24 AM, Jonas Sicking wrote:
>> Seems better to me to instead make up a new prototype object which
>> contains all of Array's non-mutating methods and stick that object on
>> the prototype chain of various classes.
>> 
>> But I'm happy to stick the Array prototype on the prototype chain here
>> if that's what the JS folks say is the right solution.
> 
> It does mean, however, that we would need to list in Web IDL the set of Array prototype functions that get copied across for mutable and non-mutable NodeList-like objects.  If ECMAScript grows new ones, we would need to update that list.

Why do you need to explicitly list them.  Defer that responsibility to ECMAScript. Just say that it is the generic mutating and non-mutating methods of Array.prototype for the version of ECMAScript that is supported by the implementation. 

Allen
Received on Tuesday, 2 August 2011 05:13:46 UTC

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