Prototypes as the new class declaration

Allen Wirfs-Brock allen at
Mon Jun 20 05:28:16 PDT 2011

On Jun 20, 2011, at 12:12 PM, Axel Rauschmayer wrote:

> I was referring to “such things could still be wired up manually”. Where would the manual wiring occur?

SkinnedMesh = Object.create(THREE.Mesh);
const ctor = constructor(geometry, materials) {
   super.constructor(geometry, materials);

   this.identityMatrix = new THREE.Matrix4();
   this.bones = [];
   this.boneMatrices = [];

However, in another thread today I mentioned that to allow super to be used in functions outside of object literals we probably a new reflection function that binds super.  In that case the last line above would probably be replaed with something like:


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

More information about the es-discuss mailing list