From 07c38311cad7590cf3f94b8ac5c1d5f510ef9356 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 9 Jan 2016 01:06:29 -0800 Subject: [PATCH] Add `_.clone` test for objects without a `constructor` function. --- test/test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/test.js b/test/test.js index ba5e4e7bc..52b360ac0 100644 --- a/test/test.js +++ b/test/test.js @@ -2513,6 +2513,14 @@ assert.ok(func(new Foo) instanceof Foo); }); + QUnit.test('should ensure `value` constructor is a function before using its `[[Prototype]]`', function(assert) { + assert.expect(1); + + Foo.prototype.constructor = null; + assert.notOk(func(new Foo) instanceof Foo); + Foo.prototype.constructor = Foo; + }); + QUnit.test('`_.' + methodName + '` should clone properties that shadow those on `Object.prototype`', function(assert) { assert.expect(2);