Ensure assignValue assigns values if they aren't the same own value. [closes #2022]

This commit is contained in:
John-David Dalton
2016-02-18 22:17:49 -08:00
parent 49389d0a2f
commit bfbfa719ff
2 changed files with 11 additions and 2 deletions

View File

@@ -3497,6 +3497,16 @@
assert.deepEqual(_.create({}, new Foo), { 'a': 1, 'c': 3 });
});
QUnit.test('should assign properties that shadow those of `prototype`', function(assert) {
assert.expect(1);
function Foo() {
this.a = 1;
}
var object = _.create(new Foo, { 'a': 1 });
assert.deepEqual(lodashStable.keys(object), ['a']);
});
QUnit.test('should accept a falsey `prototype` argument', function(assert) {
assert.expect(1);