The class operator: a bridge between object and function exemplers
Brendan Eich
brendan at mozilla.com
Mon Nov 14 20:02:14 PST 2011
On Nov 14, 2011, at 6:56 PM, Brendan Eich wrote:
> On Nov 14, 2011, at 6:47 PM, Axel Rauschmayer wrote:
>> Sorry, mucked it up (shouldn’t email when tired):
>>
>> let Foo = { constructor: function() {} }; // or any valid object exemplar on the RHS, really
>> var f = new Foo();
>> classof f === Foo // true
>
> In that case class f === f.constructor && f.constructor === Foo per Allen's last post about this wiring.
Maybe I'm over-optimistic. If you had written
let Foo = {constructor(){}};
then I could see wiring up Foo.constructor.prototype === Foo. But with the plain old property initaliser syntax, would we really require mutating .prototype to reference the enclosing object litetral?
/be
>
> /be
>
>>
>> --
>> Dr. Axel Rauschmayer
>> axel at rauschma.de
>>
>> home: rauschma.de
>> twitter: twitter.com/rauschma
>> blog: 2ality.com
>>
>>
>>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111114/284d3bc8/attachment-0001.html>
More information about the es-discuss
mailing list