Add Symbol.toStringTag test for _.isPlainObject.

This commit is contained in:
John-David Dalton
2016-10-09 22:25:33 -07:00
parent 21113b8c87
commit aea509c230

View File

@@ -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);