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