Readdition of __proto__

Brendan Eich brendan at mozilla.com
Tue Oct 15 23:01:19 PDT 2013


Allen Wirfs-Brock wrote:
> On Oct 15, 2013, at 3:19 PM, Dean Landolt wrote:
>> >  
>> >  So just to be clear, the only way to add a __proto__ property to an existing object is with Object.defineProperty?
>> >  
>
> Object.mixin(obj, {["__proto__"]:42});
>
> Allen

Don't forget this chestnut:


js> var o = {}
js> o.__proto__ = null
null
js> o.__proto__ = 42
42
js> o.toString
js>

/be


More information about the es-discuss mailing list