-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
Add comment about combined _.defaults and _.extend #4088
Add comment about combined _.defaults and _.extend #4088
Conversation
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.
Please undo changes to everything but backbone.js
. All of the others will be built later.
@@ -400,7 +400,11 @@ | |||
if (options.collection) this.collection = options.collection; | |||
if (options.parse) attrs = this.parse(attrs, options) || {}; | |||
var defaults = _.result(this, 'defaults'); | |||
|
|||
// Additional `_.defaults()` wrap after `_.extend()` makes sense | |||
// when `attrs` has a property explicitly set to `undefined`. |
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.
Let's link to #3842.
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.
Rather than "makes sense" can you explain the behavior that it actually avoids?
This reverts commit 9ba7536.
Only backbone.js is changed
@jridgewell it's done. Is it okay that I made this revert commit? I mean if you do squash merge at the end it wont matter. |
No, we can squash merge it. Still need the link to #3842. And someone else should look over the wording. @captbaritone? 😉 |
Do you mean I should add |
To the comment, not the commit message. |
Link to discussion
|
||
// Additional `_.defaults()` wrap after `_.extend()` makes sense | ||
// when `attrs` has a property explicitly set to `undefined`. | ||
// Discussion: https://github.com/jashkenas/backbone/issues/3842 |
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.
You can just use GitHub's issue shorthand #1234
. You could use this as a model: https://github.com/jashkenas/backbone/blob/master/backbone.js#L1158-L1159
Additional explanation
GitHub issue shorthand
@jrburke how about now? |
Rather than "makes sense" can you explain the behavior that it actually avoids? |
@captbaritone I added line about it helps to avoid conflicts with |
I'm not familiar with this issue, and those who are reading this comment probably won't be either. In what way does it "make sense"? Does it preserve attributes which have been explicitly set to |
It has two steps.
|
Squashed from the original commits in jashkenas#4088.
Superseded by #4267. |
No description provided.