-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Reflect.construct corrupts members of the arguments list (error 80020101) #6338
Comments
I've had a quick look at this with ChakraCore master and there is still an issue - specifically if you provide an array as the second parameter to Reflect.construct the prototype of the members of the array seems to get to changed to var subject = [];
print(subject.__proto__ === Array.prototype); // prints true
Reflect.construct(Object, [subject]);
print(subject.__proto__ === Array.prototype); // prints false
print(subject.__proto__ === Object.prototype); // prints true I cannot quickly see where this is occurring but clearly needs to be fixed. I can't be sure about the error 80020101 I think that's probably something to do with the Edge implementation of console.log and unrelated to this issue (it may not like printing objects perhaps try wrapping subject in JSON.stringify). |
I think the issue here is that the Object constructor thinks that it's being called as a result of a I'll try to come up with a fix shortly @rhuanjl, unless you want to take it on. |
Trying to think if calls being incorrectly assumed to be supers due to Reflect.construct could have other negative effects outside of the Object constructor. If this just needs fixing for the Object constructor can probably special case it/make it work somehow; if it’s broader could be much messier. |
When calling
Reflect.construct
with an argument list, the members of the argument list are corrupted.In other browsers
subject
is not corrupted andtrue
is logged both times.This may be related to #3217.
The text was updated successfully, but these errors were encountered: