mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-04 08:57:49 +00:00
Ensure _.defaults assigns properties that shadow those on Object.prototype.
This commit is contained in:
@@ -3626,6 +3626,13 @@
|
||||
var actual = _.defaults({ 'a': undefined }, { 'a': 1 });
|
||||
assert.strictEqual(actual.a, 1);
|
||||
});
|
||||
|
||||
QUnit.test('should assign properties that shadow those on `Object.prototype`', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var actual = _.defaults({}, { 'constructor': 1 });
|
||||
assert.strictEqual(actual.constructor, 1);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user