-
-
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
property_set.js won't modify object if value and currentValue is undefined #14270
Comments
After reviewing this a bit, I am not certain that I welcome thoughts from others (cc @krisselden / @stefanpenner), but I don't know that this is a bug... |
i would tend to agree. |
I agree that setting a previously set value to the same value should do nothing.
The issue is that |
rwjblue we could set the property and not have it emit a change event. This should align both the ES semantics, and the change tracking semantics. cc @krisselden |
I opened the file to try and implement stef's suggestion and got intimidated by the code. Should I pursue it, and would it need new tests to be added? |
In newer ember versions,
Ember.set(object, 'field', undefined)
won't set thefield
key on an object, because the value isundefined
.It exits earlier here which causes no object modification.
I think this is a regression (introduced in
v2.7.0-beta.1
), because previously it wouldn't enter that condition, if the value wasundefined
.Using a 2.7.0 ember app:
On discourse:
A possible way to fix this would to reintroduce the
value !== undefined
checkThe text was updated successfully, but these errors were encountered: