Standardizing __proto__

Allen Wirfs-Brock allen at wirfs-brock.com
Fri Mar 18 12:25:10 PDT 2011


Can you provide some concrete real world examples of  setting alternative prototypes on Number, Boolean, and String instances?  RegExp too, but that's a different beast.  Also I don't believe that oliver's solution helps you much for functions.



On Mar 18, 2011, at 12:12 PM, John-David Dalton wrote:

>> I think Oliver's original formulation is more correct, but regardless this really would have to be specified using ES5 pseudo code.
>> 
>> This is along the path of what I was calling a "generalized" solution to the problem and as such I think it needs deeper/longer
>> consideration to be sure we have it right.  I think a single argument Array.create is safer  if we are looking for something that
>> could be immediately implemented in order to start phasing out __proto__.  Having Array.create wouldn't stop also providing
>> a more general solution such as the one below.
> 
> As a dev who actually uses __proto__ as a fallback for sandboxed
> Arrays, I can tell you that Array.create() is **not** a quick,
> suitable solution.
> I support more than Array like String, RegExp, Function, Number, and Boolean.
> I would stress, as it seems you keep circling back to Array.create(),
> that Array.create() is not a fitting replacement for __proto__.
> Not even in the short term.
> 
> I can see Oliver's proposal totally fitting __proto__'s use case, so I
> would +1 his Object.subclass() over Array.create().
> It would be great if solutions like Oliver's Object.subclass() were
> discussed in the next meeting.
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list