New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patched __proto__ (that uses Object.setPrototypeOf) fails and throws TypeError #18
Comments
This seems to be an issue with Chrome itself rather than my patch: Chrome advertises Object.prototype.proto as an accessor property with a setter, but actually calling the setter produces an error: var protoDesc = Object.getOwnPropertyDescriptor(Object.prototype,'__proto__');
protoDesc.set.call({}, {}); // TypeError: Generic use of __proto__ accessor not allowed I updated reflect.js so that Update to reflect.js v0.0.7 to see the patch. I also filed a bug with v8, asking for clarification: Thanks for reporting. |
Wow. Thanks for looking into this, the clarification, and the workaround. And for filing the issue with v8. |
This seems fixed. The status of the issue you filed with v8 was set to fixed and worked for me in the most recent Chrome. Thanks for your help again! |
No problem! |
There seems to be an issue with how proto is patched to use Object.setPrototypeOf.
Currently, setting the proto property of an object causes a TypeError:
The error occurs, for example, when using test/testProxies.html to run testProxies.js in the testSetPrototypeOf.
Is there another way to patch proto?
I used Chrome 29.0.1547.22 beta (with Experimental JavaScript for the old Harmony proxies and Harmony Weak Maps).
My current solution is to prevent the patch (not executing the function after _var _proto__setter), change Object.setPrototypeOf to directly set the proto property, and then consistently use
instead of
in the project... :-/
The text was updated successfully, but these errors were encountered: