-
-
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
ES5 getters on an Ember.Object only ever return first computed value #12940
Comments
Oh, and just in case people were curious, using var i = 0;
var obj = Ember.Object.extend({
get index() {
return i++;
}
}).create();
console.log(obj.get('index')); // 0
console.log(obj.get('index')); // 0 I wouldn't expect it to though. It looks like Ember is doing a 1-time evaluation of the property at mergeMixins time. Anything after that resolves to that "cached" value. |
fixed (for objects, not mixins) in master |
awesome! any chance of a commit or PR link? |
I believe it is also included in 2.4.0-beta.2 |
Can we reopen this? The snippet above is not fixed (Ember 2.8.0). |
Compare to not extending Ember.Object:
Ember 2.3.0
The text was updated successfully, but these errors were encountered: