Prototypes as the new class declaration

Axel Rauschmayer axel at
Tue Jun 14 23:59:21 PDT 2011

> From: Brendan Eich <brendan at>
> Date: June 15, 2011 7:59:34 GMT+02:00
> This brings out a difference between your class-less proposal and classes, you've covered it but it may not pop out: you cannot call a class method cm via
> . Instead you must call or equivalent.
> Probably this is unfixable. The prototype object named here by SkinnedMesh is a singleton containing a single constructor function. Properties of the prototype show up, unless shadowed, in instances via delegation. Properties of the constructor, if inherited as I show above, come from the super-constructor. But there are no classes, so talking about class methods (never mind the "static" misnomer) does not make sense.
> Constructor methods and other constructor properties can be created, but naming them requires that .constructor component.

Wouldn’t you add a class method like this?

const SkinnedMesh = THREE.Mesh <| {
  cm: function() {

Then it could be invoked as (which to me is what a class method is: there is a class named SkinnedMesh and it has a method cm()).

Furthermore, it would automatically be inherited:

const SkinnedMeshExtended = SkinnedMesh <| { ... }

Then the following class method could also be called:


Dr. Axel Rauschmayer

axel at


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list