good point, the desugaring should be:

function c() {};
c.prototype=Object.create(s,protoype,{'constructor': { value:c, enumerable: 
false, writable: false, configurable:false}});

We can debate about the attributes of the constructor (and the constructor's 
prototype) property but my stake in the ground is that these should be frozen 
because they are defined declaratively.

On Mar 12, 2011, at 11:06 AM, Michael Haufe wrote:

> On Sat, Mar 12, 2011 at 11:02 AM, Allen Wirfs-Brock <[email protected]> 
> wrote:
> [...]
> > class c {
> >    <proto: s.prototype>
> > }
> 
> > class c {
> >    <superclass: s>
> > }
> 
> > both are equivalent to:
> 
> > function c() {};
> > c.prototype=Object.create(s.prototype);
> [...]
> 
> So if "var b = new c", then "b.constructor" will be "s" instead of "c"?
> 
> 

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to