mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Add support for creating clones with the same [[Prototype]] as value.
This commit is contained in:
@@ -2263,7 +2263,7 @@
|
||||
|
||||
(function() {
|
||||
function Foo() { this.a = 1; }
|
||||
Foo.prototype = { 'b': 1 };
|
||||
Foo.prototype.b = 1;
|
||||
Foo.c = function() {};
|
||||
|
||||
if (Map) {
|
||||
@@ -2451,6 +2451,12 @@
|
||||
assert.strictEqual(actual.lastIndex, 3);
|
||||
});
|
||||
|
||||
QUnit.test('`_.' + methodName + '` should create clone with the same `[[Prototype]]` as `value`', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
assert.ok(func(new Foo) instanceof Foo);
|
||||
});
|
||||
|
||||
QUnit.test('`_.' + methodName + '` should clone properties that shadow those on `Object.prototype`', function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user