From c7319d004d5600e6330f390257346c1095a2af8a Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 10 Mar 2016 16:33:29 -0800 Subject: [PATCH] Add non-function `constructor` tests for `_.isMap`, `_.isSet`, and `_.isWeakMap`. --- test/test.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/test/test.js b/test/test.js index 6ed7c2e92..f944db41c 100644 --- a/test/test.js +++ b/test/test.js @@ -9972,6 +9972,19 @@ assert.strictEqual(_.isMap(weakMap), false); }); + QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) { + assert.expect(1); + + var values = [true, false], + expected = lodashStable.map(values, alwaysFalse); + + var actual = lodashStable.map(values, function(value) { + return _.isMap({ 'constructor': value }); + }); + + assert.deepEqual(actual, expected); + }); + QUnit.test('should work with maps from another realm', function(assert) { assert.expect(1); @@ -11092,6 +11105,19 @@ assert.strictEqual(_.isSet(weakSet), false); }); + QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) { + assert.expect(1); + + var values = [true, false], + expected = lodashStable.map(values, alwaysFalse); + + var actual = lodashStable.map(values, function(value) { + return _.isSet({ 'constructor': value }); + }); + + assert.deepEqual(actual, expected); + }); + QUnit.test('should work with weak sets from another realm', function(assert) { assert.expect(1); @@ -11384,6 +11410,19 @@ assert.strictEqual(_.isWeakMap(symbol), false); }); + QUnit.test('should work for objects with a non-function `constructor` (test in IE 11)', function(assert) { + assert.expect(1); + + var values = [true, false], + expected = lodashStable.map(values, alwaysFalse); + + var actual = lodashStable.map(values, function(value) { + return _.isWeakMap({ 'constructor': value }); + }); + + assert.deepEqual(actual, expected); + }); + QUnit.test('should work with weak maps from another realm', function(assert) { assert.expect(1);