Allen Wirfs-Brock (2013-04-21T16:33:41.000Z)
github at esdiscuss.org (2013-07-12T02:26:56.533Z)
On Apr 21, 2013, at 5:22 AM, David Bruant wrote: > Le 21/04/2013 01:37, Axel Rauschmayer a ?crit : >> Globally, I would only want to switch off #3. > > You can re-enable #1 by re-adding `Object.prototype.__proto__` as your own getter wrapping `Object.getPrototypeOf`. Or maybe instead of `delete Object.prototype.__proto__`, just do: > ```js > Object.defineProperty(Object.prototype, "__proto__", {set: undefined}); > ``` I still think that Dunder proto should not be exposed at all by `Object.getOwnPropertyDescriptor` (or any other reflection) and that there is no need to leak either a working or always throwing `__proto__` setter function into the hands of a ES programmer. My preferred spec for it is at http://wiki.ecmascript.org/lib/exe/fetch.php?id=meetings%3Ameeting_may_21_2013&cache=cache&media=meetings:rev_15_proto_.pdf Note that the behavior that some people have expressed a preference for (Dunder proto is observably an accessor property but its set function when retrieved always throws) will also require an exotic Object prototype object to specify so my proposal is not adding any spec. complexity. As an exercise to the reader, it isn't hard to demonstrate that specified approach could be expressed by using a Proxy to defined `Object.prototype` (if the proxy handler had access to [[SetInheritance]]). Since proxy objects are allowed to occur on the [[Prototype]] chain, if an implementation has the mechanism to implement Proxy it will also have the mechanism necessary to implement this definition of Dunder proto.