Minimalist (why) classes ?

Brendan Eich brendan at mozilla.com
Sat Nov 12 16:08:07 PST 2011


On Nov 12, 2011, at 1:07 PM, John J Barton wrote:

> On Sat, Nov 12, 2011 at 11:53 AM, Brendan Eich <brendan at mozilla.com> wrote:
>> That's right. My point is that Irakli's .extend is quite different from
>> PrototypeJS's, contrary to what John seemed to assume.
> 
> Irakli proposed his extend() for the same set of use cases covered by
> PrototypeJS's extend(): creating objects from prototypes.

PrototypeJS's Object.extend, last I looked, was this:

Object.extend = function(destination, source) {
  for (var property in source)
    destination[property] = source[property];
  return destination;
};

This doesn't create an object from a prototype at all.


> This kind of discussion illustrates my point: JS is not sweet enough
> because we are missing core operations for constructing prototypes in
> a standard way.

A PrototypeJS-derived Object.extend is on the agenda, as part of .{ (but different from it -- and different from Irakli's extend).

Let's argue about specifics or we'll get nowhere. Do you think Irakli's selfish.js extend (https://github.com/Gozala/selfish/blob/master/selfish.js) is the way to go, or Prototype's quite different form?

/be


More information about the es-discuss mailing list