ES3.1 Object static methods rationale document

Brendan Eich brendan at mozilla.org
Wed Jul 16 11:06:52 PDT 2008


On Jul 16, 2008, at 10:26 AM, Mark S. Miller wrote:

> On Wed, Jul 16, 2008 at 10:11 AM, Brendan Eich  
> <brendan at mozilla.org> wrote:
> And? The doc gives rationales for design decisions. What's the
> rationale for leaving Object.extend out?
>
> If the document needs to give rationales for leaving out each thing  
> we did not include, it would be quite a long document.

It's pretty long already, yet it dotes on some issues that are less  
relevant than Object.extend, as demonstrated by all the Ajax code  
that uses Object.extend but does without, e.g., Object.getPrototypeOf  
(or __proto__). Do what you want with the doc, but please don't  
dismiss particular requests for rationales with general fretting  
about document length.

The issue of draft ES3.1 adding a great many Object APIs, yet not  
adding one of the most common APIs from popular Ajax libraries, is  
legitimate to raise. The answer to my question may not lead to a  
rationale being added to the document, but there ought to be an  
answer other than "no" -- or onlookers will rightly suspect that  
there something is wrong in the reasoning behind the rationales.

> What is the argument for adding Object.extend()? A pointer to  
> Resig's message or a prior discussion is an adequate response.


https://bugzilla.mozilla.org/show_bug.cgi?id=433351

The argument for Object.extend is similar to the one for  
Function.bind. Different use-cases, but common re-implementation in  
real-world code. Both can be built using ES3, but relieving everyone  
from having to re-invent and re-download these wheels is one of the  
main purposes of the standard library.

/be
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20080716/6aa3a64f/attachment-0002.html 


More information about the Es4-discuss mailing list