Re: Avoiding overloading the term “prototype”

Axel Rauschmayer axel at rauschma.de
Wed Oct 24 12:16:05 PDT 2012


I like the “t-shirt” approach.

> 0    Constructor.__proto__ === Function

Beware (I frequently get this wrong, too):
Constructor.__proto__ === Function.prototype

>     Constructor.prototype.constructor === Constructor
> 
> 1    ( new C(...args) ).__proto__ === C.prototype
> 
> 2    new C(...args) === C.apply( { __proto__ : C.prototype } , ...args )
> 
> 3    Object.create( p , {...properties} ) === { __proto__ : p, ...properties}

`properties` are property descriptors, so this assertion doesn’t hold.

> Expressing recursive selection is trickier (eg, it would be good to
> be able to split an object into __proto__ and __proto__-free own
> properties, to create objects from properties, and to have
> let-expressions)

Suggestion: create a chain, use it to demonstrate these concepts.
But we are approaching XXL t-shirts then.

-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20121024/2cb23dec/attachment.html>


More information about the es-discuss mailing list