Re: Non-constructible constructors and Arrays

On Aug 1, 2011, at 10:39 PM, Garrett Smith wrote:

> On 8/1/11, Allen Wirfs-Brock <allen@wirfs-brock.com> wrote:
> [...]
>> 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.
>> 
> Have ES5 committee considered separating or tagging the methods that
> mutate the array vs. those that don't, possibly even making this
> discoverable so that a program could determine what the object is
> capable of doing (please no try/catch on arrays).
> -- 
> 

Well, it's inherent in the ES specification's algorithm for each method whether or not it mutates its this value.  We might consider adding a non-normative note that further identifies such methods as mutating or non-mutating but that doesn't really add any additional information that isn't already available to browser implementors.

allen

Received on Tuesday, 2 August 2011 16:04:44 UTC