you probably meant this link too? http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof
1. If Type<http://people.mozilla.org/~jorendorff/es6-draft.html#sec-ecmascript-data-types-and-values> (*proto*) is *neither Object nor Null*, then throw a *TypeError* exception. Best Regards On Fri, Apr 4, 2014 at 10:49 AM, Allen Wirfs-Brock <[email protected]>wrote: > > On Apr 4, 2014, at 10:22 AM, John Barton wrote: > > I was surprised to discover that in chrome at least this is valid: > var obj = {}; > obj.__proto__ = undefined; > but this throws > Object.setPrototypeOf(obj, undefined); > > Is it intended? > > > Yes, see the spec at > http://people.mozilla.org/~jorendorff/es6-draft.html#sec-set-object.prototype.__proto__ > > > It's that way because that's how __proto__ has always worked. > > __proto__ is there for legacy compatibility. > setPrototypeOf should be preferred for new code > > Allen > > _______________________________________________ > es-discuss mailing list > [email protected] > https://mail.mozilla.org/listinfo/es-discuss > >
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

