Refine _.isError checks to avoid false positives on plain objects.

This commit is contained in:
John-David Dalton
2016-10-09 19:54:37 -07:00
parent 054e78572b
commit 22b51ed232
2 changed files with 10 additions and 2 deletions

View File

@@ -10425,6 +10425,12 @@
assert.strictEqual(_.isError(symbol), false);
});
QUnit.test('should return `false` for plain objects', function(assert) {
assert.expect(1);
assert.strictEqual(_.isError({ 'name': 'Error', 'message': '' }), false);
});
QUnit.test('should work with an error object from another realm', function(assert) {
assert.expect(1);