* SUMMARY Add support for Object.setPrototypeOf. This is already very similar to __proto__ assignment, which we already support, with a few minor differences (throwing exceptions in some cases, and return values). * REFERENCE <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf> * SPEC ES6 19.1.2.18 <https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof> > When the setPrototypeOf function is called with arguments O and proto, the following steps are taken: > > 1. Let O be RequireObjectCoercible(O). > 2. ReturnIfAbrupt(O). > 3. If Type(proto) is neither Object nor Null, throw a TypeError exception. > 4. If Type(O) is not Object, return O. > 5. Let status be O.[[SetPrototypeOf]](proto). > 6. ReturnIfAbrupt(status). > 7. If status is false, throw a TypeError exception. > 8. Return O. Compare this to Object.prototype.__proto__: <https://people.mozilla.org/~jorendorff/es6-draft.html#sec-set-object.prototype.__proto__> * TEST js> o = {}; Object.setPrototypeOf(o, Array.prototype); o instanceof Array; => should be true * NOTES - This is covered by the ES6 Compat Table: <https://kangax.github.io/compat-table/es6/#Object_static_methods_Object.setPrototypeOf> - Other browsers have implemented this: (their tests cases are nearly identical) - Chrome (v8): <https://code.google.com/p/v8/source/detail?r=18739> - Firefox: <https://bugzilla.mozilla.org/show_bug.cgi?id=885788>
<rdar://problem/21032827>
Created attachment 253425 [details] [PATCH] Proposed Fix
Comment on attachment 253425 [details] [PATCH] Proposed Fix Clearing flags on attachment: 253425 Committed r184642: <http://trac.webkit.org/changeset/184642>
All reviewed patches have been landed. Closing bug.