Could <| be spelled "extends"?

David Bruant bruant.d at gmail.com
Fri Feb 1 13:26:29 PST 2013


Le 01/02/2013 22:02, Allen Wirfs-Brock a écrit :
> Something like this can still be expressed in the current draft of ES6 as:
>
> let p = Proxy(target, {
>        __proto__:  VirtualObject.prototype,
>        get(key, receiver) {...},
>        set(key,value, reciever) {...}
> });
>
> This is ugly in its use of __proto__ and unreliable because __proto__ can be removed from Object.prototype.
Deleting Object.prototype.__proto__ affects the semantics of the object 
literal? This doesn't smell good.

> PrimaryExpression ::
>     ...
>     extends Expression ObjectLiteral
>
> a desugaring semantics might be:
>
> Object.mixin(new (Expresion), ObjectLiteral)
I like this idea :-)

David


More information about the es-discuss mailing list