-
Notifications
You must be signed in to change notification settings - Fork 7k
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
Investigate potential __proto__
issues.
#226
Comments
var a = {};a.__proto__ = [];Object.keys(a);
// => [] which is expected. |
var a = Object.create(null);a.__proto__ = [];Object.keys(a);
// => ["__proto__"] which is able to screw clone/copy operations being a bomb in the system able to break all instances check this in Canary, Firefox, Nightly, or node.js |
var a = Object.create(null);a.__proto__=[];Object.keys(a);
// => ['__proto__']; in Opera (the correct behavior).
// Safari/Chrome/Firefox are currently [], though Chrome has it fixed in Canary |
precisely |
This is the desired behavior, not a bomb. On an object with a Also, how awesome is it that we both typed the exact same example code within seconds of each other. Wonder twin powers! |
Ok, so since detecting if To reiterate the behavior of |
@sharifmacky ? ES6 draft has |
@jdalton the issue is not that Why This Is A Problem
If Lo-Dash wants to be consistent with the known behavior:
Thanks TC39, We Gonna Have Bad Time What To Do To Change This Of course libraries will not drop it until there is a standard able to replace same behavior. var setPrototypeOf = Object.setPrototypeOf || function (o, p) {
o.__proto__ = p;
return o;
}; This method preserves easiness and semantic, allowing |
I'm not concerned w/ what the current non-spec'ed behavior is (we can't control that), I'm glad the spec'ed behavior is clearing up these issues.
Cannot work anymore? This has been an issue with
No, thanks to the TC39
I've already explored this in my previous comment.
Let's not speculate on IE11 please.
|
using The usage of a global Object method would be explicit and avoid everything we are discussing here .. so the point is, as I've written in my post, being stubborn for something that easy to solve nobody wants to. So here my question: would you use |
The sky is not falling. If it was a real pain point |
I think that's a feature. If the source object has an enumerable So the only issue I can see is with our |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Investigate potential
__proto__
issues. //cc @WebReflectionThe text was updated successfully, but these errors were encountered: