setPrototypeOf vs obj.__proto__ assignment

Andrea Giammarchi andrea.giammarchi at
Mon Apr 7 18:27:10 PDT 2014

just for topic and documentation sake ...

On Mon, Apr 7, 2014 at 11:02 AM, John Barton <johnjbarton at> wrote:

> on platforms without setPrototypeOf(), it's advantages are not relevant.
> jjb

this works in Firefox since quite a while, and probably some other engine
that supports `__proto__` as non poisoned and configurable as every other
`Object.prototype` is:

Object.setPrototypeOf || (
  Object.setPrototypeOf = function(set){
    delete Object.prototype.__proto__;
    return function setPrototypeOf(o, p) {, p);
      return o;
      Object.prototype, '__proto__'

Best Regards
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list