Ensure _.isPlainObject returns false for objects without a [[Class]] of "Object".

Former-commit-id: ce034f55733cd1929f09bf80e4a461c6e1502d1b
This commit is contained in:
John-David Dalton
2013-03-10 04:13:34 -07:00
parent 40f9eeda36
commit f9b5d6644d
6 changed files with 31 additions and 16 deletions

View File

@@ -656,7 +656,7 @@
function shimIsPlainObject(value) {
// avoid non-objects and false positives for `arguments` objects
var result = false;
if (!(value && typeof value == 'object') || isArguments(value)) {
if (!(value && toString.call(value) == objectClass)) {
return result;
}
// check that the constructor is `Object` (i.e. `Object instanceof Object`)