[BUGFIX RELEASE] Fix toString to not add the property on the class #13333
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When calling
toString()
method on an Ember Object, it attaches thetoString
as a class property for the first time. This does not seem right since this should be on the prototype of the class. We could memoize the value on the class meta data.In v2.5.0 and above, when calling
.set()
on an Ember Object, you end up also attaching thetoString()
property on the class. This PR callstoString()
on the object during setting any property. Therefore, when you walk through the object properties you end up getting an additional property on the object.Thanks to Kris & Chad for guiding on this!
cc: @krisselden @chadhietala