| Summary: | X.[[SetPrototypeOf]](Y) should succeed if X.[[Prototype]] is already Y even if X is not extensible | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | ziyunfei <446240525> | ||||
| Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, sam, ysuzuki | ||||
| Priority: | P2 | ||||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
(In reply to comment #0) > js> var proto = {} > js> var obj = Object.preventExtensions(Object.create(proto)) > js> Object.setPrototypeOf(obj ,proto) > TypeError: Attempted to assign to readonly property. // should return obj > js> Reflect.setPrototypeOf(obj, proto) > false // should be true Nice catch! We need to fix 1. Object.setPrototypeOf 2. Reflect.setPrototypeOf 3. object.__proto__ = ... Created attachment 258886 [details]
Patch
Comment on attachment 258886 [details]
Patch
r=me
Comment on attachment 258886 [details]
Patch
Thank you!
Comment on attachment 258886 [details] Patch Clearing flags on attachment: 258886 Committed r188384: <http://trac.webkit.org/changeset/188384> All reviewed patches have been landed. Closing bug. |
js> var proto = {} js> var obj = Object.preventExtensions(Object.create(proto)) js> Object.setPrototypeOf(obj ,proto) TypeError: Attempted to assign to readonly property. // should return obj js> Reflect.setPrototypeOf(obj, proto) false // should be true