-
-
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
Ember.set & Ember.setProperties fail to set properties "enumerable" #14594
Comments
This is because ember-twiddle.com itself is an Ember app (that runs Ember 2.9.0 ATM), and the app that the twiddle is creating is running in an iframe. So asking the host application Changing the console to use the right context will fix this for you. |
I suspect what is happening is that the set determines that the values are the same and does not actually set the property (because there is no work to be done). Demo: const Foo = Ember.Object.extend({
prop1: null
});
let foo = Foo.create();
log('Keys:', Object.keys(foo));
foo.set('prop1', null);
log('Keys:', Object.keys(foo));
foo.set('prop1', 'value');
log('Keys:', Object.keys(foo)); |
I believe this is a duplicate of #14270, can you review and confirm? |
Thanks a lot for your response @rwjblue! At first I also thought it may be a duplicate of the issue you mentionend but I think it's slightly different here as the value will be set not enumerable as soon as an See the edited Demo of yours, where I declared an So, the value is set correctly, but it's not declared |
@herom I cloned your jsbin, https://jsbin.com/limuki/edit?html,js,output and set the version to 2.4.3 and do see the output that the object's property is available via |
Thanks a lot @pixelhandler - I totally forgot about that (a jsbin with the "working" solution) 😃 |
Just a short sumup of the different code samples in order to understand/reproduce this bug for better readability: WORKING Demo (without FAILING Demo (with WORKING Demo (with |
Per our triage policy I'll close this out for now, feel free to reopen if the issue persists on the current release. |
I'm currently using Ember
2.4.3
and wanted to upgrade, but the behaviour ofEmber.set
andEmber.setProperties
in2.7.0
onwards seems a bit buggy to me.To reproduce the "bad" behaviour, do the following:
It seems, that somewhere - deep in the guts of
Ember.set
&&Ember.setProperties
themeta
is declaring the property as "not enumerable"?!I can't reproduce this "bug" at https://ember-twiddle.com as it seems to work over there, if I try these steps in the Chrome DevTools (interesstingly enough, it prints the Ember Version as
2.9.0
but if you callEmber.VERSION
in the console, it prints2.8.0
😸 )The text was updated successfully, but these errors were encountered: