Prototypes as the new class declaration

Axel Rauschmayer axel at rauschma.de
Sun Jun 19 09:23:50 PDT 2011


>> Where would the prototype of the new instance come from? Would SkinnedMesh.constructor.prototype point to SkinnedMesh?
> 
> Of course -- Allen's proposal just "rotates" the (constructor, prototype) pair so the named or "outer" object is the prototype.


The only thing I don’t understand is how/where the assignment
    SkinnedMesh.constructor.prototype = SkinnedMesh
is made.
Would Allen’s proposal change the language so that whenever a function f is assigned to the property "constructor" of an object o, there is the following assignment?
    f.prototype = o

I have no trouble understanding that everything (modulo builtins) works fine if the above assignment is made *somewhere*.

-- 
Dr. Axel Rauschmayer

axel at rauschma.de
twitter.com/rauschma

home: rauschma.de
blog: 2ality.com





More information about the es-discuss mailing list