mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Ensure _.isPlainObject returns false for objects without a [[Class]] of "Object".
Former-commit-id: ce034f55733cd1929f09bf80e4a461c6e1502d1b
This commit is contained in:
@@ -1406,6 +1406,13 @@
|
||||
strictEqual(_.isPlainObject([1, 2, 3]), false);
|
||||
strictEqual(_.isPlainObject({ 'a': 1 }), true);
|
||||
});
|
||||
|
||||
test('should return `false` for objects without a [[Class]] of "Object"', function() {
|
||||
strictEqual(_.isPlainObject(arguments), false);
|
||||
strictEqual(_.isPlainObject(Error), false);
|
||||
strictEqual(_.isPlainObject(Math), false);
|
||||
strictEqual(_.isPlainObject(window), false);
|
||||
})
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user