From aea509c2305064a994febc71b6540ac5561795e6 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sun, 9 Oct 2016 22:25:33 -0700 Subject: [PATCH] Add `Symbol.toStringTag` test for `_.isPlainObject`. --- test/test.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/test.js b/test/test.js index 631493287..c66a0eee5 100644 --- a/test/test.js +++ b/test/test.js @@ -11360,7 +11360,21 @@ assert.strictEqual(_.isPlainObject(object), true); }); - QUnit.test('should return `true` for plain objects with a custom `valueOf` property', function(assert) { + QUnit.test('should return `true` for objects with a `Symbol.toStringTag` property', function(assert) { + assert.expect(1); + + if (Symbol && Symbol.toStringTag) { + var object = {}; + object[Symbol.toStringTag] = 'X'; + + assert.deepEqual(_.isPlainObject(object), true); + } + else { + skipAssert(assert); + } + }); + + QUnit.test('should return `true` for objects with a `valueOf` property', function(assert) { assert.expect(2); assert.strictEqual(_.isPlainObject({ 'valueOf': 0 }), true);