-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
__nextSuper property on objects #5485
Comments
@gordonkristan what's |
@gordonkristan interesting quirk. the way |
Thanks @gordonkristan, good to track. Ideally we could figure out what changed between 1.6 and 1.7. Possible fixes include going back to an old style of _super (now that we can track when _super is and is not called we might be able to do this efficiently), and replacing hasOwnProperty on Ember.Object. Or, of course, finding out what introduces this post 1.6. |
@knownasilya As far as fixes go, I like the idea of replacing |
@gordonkristan - For now you should be able to use var o = Ember.Object.create({
name: 'foo'
});
var keys = Ember.keys(o);
for (var i = 0, l = keys.length; i < l; i++) {
var name = keys[i];
console.log(name);
}
console.log('done!') |
this was introduced in this commit. Moving |
@twokul do all tests pass when you make that move? |
@stefanpenner nope, one test fails >_< (the one that tests JSBin that was provided uses I would expect
o____O We can mark Here's the benchmark, btw. update: The benchmark results that I posted are from Chrome Canary. Stable Chrome:
|
Starting to have mega-doubts indeed. I'm unfamiliar with what is happening on I general, having the post-hook for creating a property call I expect having superWrapper use defineProperty is a no-go. My understanding has always been that defineProperty is too slow to use unless required, I would like to see BMs on IE and get more feedback on this. Regardless, I don't think we need to use this solution. |
The performance is biased likely because we are only actually changing 2 objects, then repeatedly changing those. But since we are just re-setting the same property with the same configuration I suspect this means we are not re-changing those object shape. In a real scenario we could be dealing with thousands or tens of thousands of different objects all with multiple different super methods. |
@twokul I think not-calling super in that |
@stefanpenner removing |
@twokul awesome thanks! |
We're seeing this behavior occurring again in 1.13.10, but only in production builds. I think it's fixed by #12062. Any ideas why it would be prod-specific though? |
I know there's a lot of changes going on with the
__nextSuper
stuff, but I think I've found a bug in 1.7.0.__nextSuper
is now being added as a property to all objects. Example:If you run the above code,
__nextSuper
will be logged to the console. (JSBin for the lazy.) But oddly enough,Object.keys()
doesn't include__nextSuper
. I'm assuming it's because the property is declared on the object, but not declared enumerable.I don't know if this is a bug exactly, maybe just a quirk, but it certainly broke my code.
The text was updated successfully, but these errors were encountered: