mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-06 09:47:48 +00:00
Avoid false positives for arguments objects in IE < 9 when using isPlainObject.
Former-commit-id: 19e5a6efed32f26d0c908771eec40e7fb2ecf265
This commit is contained in:
@@ -744,8 +744,9 @@
|
|||||||
* @returns {Boolean} Returns `true` if the `value` is a plain `Object` object, else `false`.
|
* @returns {Boolean} Returns `true` if the `value` is a plain `Object` object, else `false`.
|
||||||
*/
|
*/
|
||||||
function isPlainObject(value) {
|
function isPlainObject(value) {
|
||||||
|
// avoid non-objects and false positives for `arguments` objects in IE < 9
|
||||||
var result = false;
|
var result = false;
|
||||||
if (!(value && typeof value == 'object')) {
|
if (!(value && typeof value == 'object') || (noArgumentsClass && isArguments(value))) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
|
// IE < 9 presents DOM nodes as `Object` objects except they have `toString`
|
||||||
|
|||||||
Reference in New Issue
Block a user