Brendan Eich (2013-10-14T20:22:31.000Z)
domenic at domenicdenicola.com (2013-10-23T19:50:42.069Z)
Andrea Giammarchi wrote: > __Current Status__ (Thanks for the dunders! :-P) > Instead of formalizing its form, ES6 accepted `Object.setPrototypeOf` > as described in specs and decided to silently move beside, but still > have in specs, the dunder `__proto__` form, fixing at least a couple > of related gotchas so that: > > * unless explicitly set as property, `__proto__` is a named property > for every object that should not affect inheritance so that > `obj["__proto__"]` or `obj[key]` where `key` is the string > `"__proto__"` should not hot/swap the prototypal chain I'm not sure what you mean here, but first, `__proto__` is not specified in ES6 drafts as an own property. See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-B.2.2.1 ``` B.2.2.1 Object.prototype.__proto__ Object.prototype.__proto__ is an accessor property with attributes { [[Enumerable]]: false, [[Configurable]]: true }. The [[Get]] and [[Set]] attributes are defined as follows B.2.2.1.1 get Object.prototype.__proto__ The value of the [[Get]] attribute is a built-in function that requires no arguments. It performs the following steps: 1. Let O be the result of calling ToObject the *this* value as the argument. 2. ReturnIfAbrupt(O). 3. Return the result of calling the [[GetPrototypeOf]] internal method of O. B.2.2.1.2 set Object.prototype.__proto__ The value of the [[Set]] attribute is a built-in function that takes an argument proto. It performs the following steps: 1. Let O be CheckObjectCoercible(this value). 2. ReturnIfAbrupt(O). 3. If Type(proto) is neither Object or Null, then return proto. 4. If Type(O) is not Object, then return proto. 5. Let status be the result of calling the [[SetPrototypeOf]] internal method of O with argument proto. 6. ReturnIfAbrupt(status). 7. If status is false, then throw a TypeError exception. 8. Return proto. ```