Make _.defaults follow _.assign and only assign own properties of source.

Former-commit-id: 114dc47bbfa6db6a53a2fa03dd477fe86c3395cb
This commit is contained in:
John-David Dalton
2012-11-11 16:16:11 -08:00
parent 797a87ca26
commit 82e58f2bf9
4 changed files with 41 additions and 2 deletions

View File

@@ -977,7 +977,7 @@
}
/**
* Assigns enumerable properties of the default object(s) to the `destination`
* Assigns own enumerable properties of source object(s) to the `destination`
* object for all `destination` properties that resolve to `null`/`undefined`.
* Once a property is set, additional defaults of the same property will be
* ignored.
@@ -995,7 +995,6 @@
* // => { 'flavor': 'chocolate', 'sprinkles': 'rainbow' }
*/
var defaults = createIterator(assignIteratorOptions, {
'useHas': false,
'objectLoop': 'if (result[index] == null) ' + assignIteratorOptions.objectLoop
});