-
Notifications
You must be signed in to change notification settings - Fork 8
Conversation
This is caused by a bug in ember's |
712073f
to
ab5fc28
Compare
undefined
undefined
as value
This PR now contains also a fix. I'm not so used to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice work + tests!!!
// ember's set method does not handle undefined values correctly in older versions | ||
// https://github.com/emberjs/ember.js/issues/14270 | ||
if ( | ||
acc.hasOwnProperty(currentKey) || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jelhan Want to make sure of your intention - should this be &&
or ||
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's by intention. Maybe it would be easier to read the other way around: setUnknownProperty
should only be used if it exists and if the property is not declared on object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this polyfill for set
is a-ok. Nice work! Just wanted to make sure.
@snewcomer Thanks for merging. Could you please ping me after next release? Will update adopted-ember-addons/ember-changeset#191 afterwards. |
This workaround was added to handle an issue in `Ember.set` poteto#14 This original problem has long been resolved in Ember. _Not_ calling `set` now causes some issues with Ember 3.13+, as properties on the original object either need to be `@tracked` _or_ be updated using `set`, the later of which makes more sense.
No description provided.