love it ... reminds me those days when [] or {} were invoking Array and Object in some env ...
Anyway, I believe Allen is trying to say that {__proto__:whatever} should be spec'd as syntax, regardless what will be of the Object.prototype.__proto__ property/descriptor so that you can get rid of it but then you can always trust that syntax. In this case __proto__ looks ugly but makes sense ... also because it does not need to loop/copy on JS side So basically that would do exactly what an utopian/never-existent Object.setOwnPrototype({literal}, whatever):{literal} would do On Sun, Apr 21, 2013 at 1:19 PM, André Bargull <andre.barg...@udo.edu>wrote: > SpiderMonkey at least goes out of its way to do [[Set]] (let's call it) >> not [[DefineOwnProperty]] for 'o = {__proto__: 42}', so why wouldn't >> [[Set]] create a fresh property, seeing nothing on Object.prototype >> named '__proto__' with a setter to run? >> > > SpiderMonkey/JSC currently just use [[Set]] without any further checks, > i.e. when you re-define Object.prototype.__proto__, you're able to > interfere object creation which uses __proto__. Is this intentional? > > js> Object.defineProperty(Object.**prototype, "__proto__", {set: > function(){print("setter")}}) > ({}) > js> ({__proto__: null}) > setter > ({}) > > > - André > > ______________________________**_________________ > es-discuss mailing list > es-discuss@mozilla.org > https://mail.mozilla.org/**listinfo/es-discuss<https://mail.mozilla.org/listinfo/es-discuss> >
_______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss