mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 08:37:49 +00:00
Ensure _.isPlainObject returns true for empty objects in older browsers. [closes #283]
Former-commit-id: d01d32b1cbd87d08bc8014d07eaa1842e3118a40
This commit is contained in:
@@ -1655,12 +1655,16 @@
|
||||
}
|
||||
});
|
||||
|
||||
test('should return `true` for empty objects', function() {
|
||||
strictEqual(_.isPlainObject({}), true);
|
||||
});
|
||||
|
||||
test('should return `false` for Object 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