Allen Wirfs-Brock (2013-09-11T15:51:09.000Z)
domenic at domenicdenicola.com (2013-09-25T01:42:32.524Z)
On Sep 11, 2013, at 7:17 AM, Tom Van Cutsem wrote: > Setting `__proto__` may be bad taste in general, but this is a case where using this capability is necessary. At least if the ES6 spec. is fully implemented, `Object.setPrototypeOf` would be preferable to assigning to `__proto__`. EG, // trap: getPrototypeOf: function(target){ Object.setPrototypeOf(target, B'); return B'; } There's nothing magic about `__proto__=`. Both dunder proto and `Object.setPrototypeOf` are defined in terms of [[SetInheritance]]. The only difference is that the functionality of dunder proto is dependent upon the current [[Prototype]] value of target while `setPrototypeOf` doesn't have that dependency. >> Ps: btw, wasn't "GetInheritance" supposed to be renamed "GetPrototype"? > > I think we had agreement on that. Allen? I'm willing to call them [[GetPrototypeOf]] and [[SetPrototypeOf]] to match the trap names. I prefer avoiding a direct connotation with the [[Prototype]] internal data property as an exotic object is not required to have one.